]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/amcc/sequoia/sequoia.c
drivers, block: remove sil680 driver
[people/ms/u-boot.git] / board / amcc / sequoia / sequoia.c
index 53f9b3419faa4961d3eb10a60471ae69edd4cdc4..1e45774ce40d55041a8a62941433d2d2d660084c 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <errno.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <asm/ppc4xx.h>
@@ -20,7 +21,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CONFIG_SYS_NO_FLASH)
+#if defined(CONFIG_MTD_NOR_FLASH)
 extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
 #endif
 
@@ -123,7 +124,7 @@ int board_early_init_f(void)
 
 int misc_init_r(void)
 {
-#if !defined(CONFIG_SYS_NO_FLASH)
+#if defined(CONFIG_MTD_NOR_FLASH)
        uint pbcr;
        int size_val = 0;
 #endif
@@ -135,7 +136,7 @@ int misc_init_r(void)
 #endif
        u32 reg;
 
-#if !defined(CONFIG_SYS_NO_FLASH)
+#if defined(CONFIG_MTD_NOR_FLASH)
        /* Re-do flash sizing to get full correct info */
 
        /* adjust flash start and offset */
@@ -175,7 +176,7 @@ int misc_init_r(void)
                            CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1,
                            &flash_info[0]);
 #endif
-#endif /* CONFIG_SYS_NO_FLASH */
+#endif /* CONFIG_MTD_NOR_FLASH */
 
        /*
         * USB suff...
@@ -363,7 +364,7 @@ void board_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
  * On NAND-booting sequoia, we need to patch the chips select numbers
  * in the dtb (CS0 - NAND, CS3 - NOR)
  */
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int rc;
        int len;
@@ -381,15 +382,14 @@ void ft_board_setup(void *blob, bd_t *bd)
        prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
        if (prop == NULL) {
                printf("Unable to update NOR chip select for NAND booting\n");
-               return;
+               return -FDT_ERR_NOTFOUND;
        }
        reg = (u32 *)&prop->data[0];
        reg[0] = 3;
        rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);
        if (rc) {
-               printf("Unable to update property NOR mappings, err=%s\n",
-                      fdt_strerror(rc));
-               return;
+               printf("Unable to update property NOR mappings\n");
+               return rc;
        }
 
        /* And now configure NAND chip select to 0 instead of 3 */
@@ -398,15 +398,16 @@ void ft_board_setup(void *blob, bd_t *bd)
        prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
        if (prop == NULL) {
                printf("Unable to update NDFC chip select for NAND booting\n");
-               return;
+               return len;
        }
        reg = (u32 *)&prop->data[0];
        reg[0] = 0;
        rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);
        if (rc) {
-               printf("Unable to update property NDFC mappings, err=%s\n",
-                      fdt_strerror(rc));
-               return;
+               printf("Unable to update property NDFC mapping\n");
+               return rc;
        }
+
+       return 0;
 }
 #endif /* CONFIG_SYS_RAMBOOT */