sunxi: Create helper function veryfing valid boot signature on MMC
This patch extracts checking for valid SD card "eGON.BT0" signature from `board_mmc_init` into function `sunxi_mmc_has_egon_boot_signature`. Buffer for mmc sector is allocated and freed at runtime. `panic` is triggered on malloc failure. Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu> CC: Roy Spliet <r.spliet@ultimaker.com> Cc: Ian Campbell <ijc@hellion.org.uk> [hdegoede@redhat.com: Small bugfix to make it work for devs other then mmc0] Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:

committed by
Hans de Goede

parent
1b26bab12e
commit
645c48f50e
@@ -127,4 +127,5 @@ struct sunxi_mmc {
|
||||
#define SUNXI_MMC_COMMON_RESET (1 << 18)
|
||||
|
||||
struct mmc *sunxi_mmc_init(int sdc_no);
|
||||
int sunxi_mmc_has_egon_boot_signature(struct mmc *mmc);
|
||||
#endif /* _SUNXI_MMC_H */
|
||||
|
Reference in New Issue
Block a user