ARM: uniphier: simplify SoC ID get function
[project/bcm63xx/u-boot.git] / arch / arm / mach-uniphier / boot-mode / spl_board.c
index 4eadc2f26a75a50b07d88fb3176f0a62ad260b8a..0aac9241c3039c6ba9ea7860b4e5eee4826fc3b5 100644 (file)
 
 #include "../soc-info.h"
 
-void spl_board_announce_boot_device(void)
-{
-       printf("eMMC");
-}
-
 struct uniphier_romfunc_table {
        void *mmc_send_cmd;
        void *mmc_card_blockaddr;
@@ -45,11 +40,11 @@ int uniphier_rom_get_mmc_funcptr(int (**send_cmd)(u32, u32),
 {
        const struct uniphier_romfunc_table *table;
 
-       switch (uniphier_get_soc_type()) {
-       case SOC_UNIPHIER_LD11:
+       switch (uniphier_get_soc_id()) {
+       case UNIPHIER_LD11_ID:
                table = &uniphier_ld11_romfunc_table;
                break;
-       case SOC_UNIPHIER_LD20:
+       case UNIPHIER_LD20_ID:
                table = &uniphier_ld20_romfunc_table;
                break;
        default:
@@ -65,7 +60,8 @@ int uniphier_rom_get_mmc_funcptr(int (**send_cmd)(u32, u32),
        return 0;
 }
 
-int spl_board_load_image(struct spl_boot_device *bootdev)
+static int spl_board_load_image(struct spl_image_info *spl_image,
+                               struct spl_boot_device *bootdev)
 {
        int (*send_cmd)(u32 cmd, u32 arg);
        int (*card_blockaddr)(u32 rca);
@@ -113,12 +109,12 @@ int spl_board_load_image(struct spl_boot_device *bootdev)
                return ret;
        }
 
-       ret = spl_parse_image_header(&spl_image, (void *)CONFIG_SYS_TEXT_BASE);
+       ret = spl_parse_image_header(spl_image, (void *)CONFIG_SYS_TEXT_BASE);
        if (ret)
                return ret;
 
-       ret = (*load_image)(dev_addr, spl_image.load_addr,
-                           spl_image.size / 512);
+       ret = (*load_image)(dev_addr, spl_image->load_addr,
+                           spl_image->size / 512);
        if (ret) {
                printf("failed to load image\n");
                return ret;
@@ -126,3 +122,4 @@ int spl_board_load_image(struct spl_boot_device *bootdev)
 
        return 0;
 }
+SPL_LOAD_IMAGE_METHOD("eMMC", 0, BOOT_DEVICE_BOARD, spl_board_load_image);