]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/arm/mach-uniphier/boot-mode/boot-mode-ph1-sld3.c
ARM: uniphier: allow to enable multiple SoCs
[people/ms/u-boot.git] / arch / arm / mach-uniphier / boot-mode / boot-mode-ph1-sld3.c
similarity index 89%
rename from arch/arm/mach-uniphier/ph1-sld3/boot-mode.c
rename to arch/arm/mach-uniphier/boot-mode/boot-mode-ph1-sld3.c
index 40000afe74102165b2cea1e9c357bf66716d09ec..c943e12db15d75b73a7a485b726804ab65676e39 100644 (file)
@@ -11,7 +11,7 @@
 #include <mach/sg-regs.h>
 #include <mach/sbc-regs.h>
 
-struct boot_device_info boot_device_table[] = {
+static struct boot_device_info boot_device_table[] = {
        {BOOT_DEVICE_NONE, "Reserved"},
        {BOOT_DEVICE_NONE, "External Master"},
        {BOOT_DEVICE_NONE, "Reserved"},
@@ -76,22 +76,31 @@ struct boot_device_info boot_device_table[] = {
        {BOOT_DEVICE_NONE, "Reserved"},
        {BOOT_DEVICE_NONE, "Reserved"},
        {BOOT_DEVICE_NONE, "Reserved"},
-       { /* sentinel */ }
 };
 
-int get_boot_mode_sel(void)
+static int get_boot_mode_sel(void)
 {
        return readl(SG_PINMON0) & 0x3f;
 }
 
-u32 spl_boot_device(void)
+u32 ph1_sld3_boot_device(void)
 {
        int boot_mode;
 
-       if (boot_is_swapped())
-               return BOOT_DEVICE_NOR;
-
        boot_mode = get_boot_mode_sel();
 
        return boot_device_table[boot_mode].type;
 }
+
+void ph1_sld3_boot_mode_show(void)
+{
+       int mode_sel, i;
+
+       mode_sel = get_boot_mode_sel();
+
+       puts("Boot Mode Pin:\n");
+
+       for (i = 0; i < ARRAY_SIZE(boot_device_table); i++)
+               printf(" %c %02x %s\n", i == mode_sel ? '*' : ' ', i,
+                      boot_device_table[i].info);
+}