~ubuntu-branches/ubuntu/maverick/uboot-imx/maverick

« back to all changes in this revision

Viewing changes to board/amcc/sequoia/sequoia.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2010-01-20 15:41:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100120154126-7bha1jeyjegu7xm5
Tags: 2009.08+really2009.01-0ubuntu1
* revert to the 2009.01 upstream version, 2009.08 has still to 
  many work in progress items in the freescale patchset (MMC and NIC
  dont work at all)
* add the latest patchset from freescale for 2009.01
* add 1002_enable_hush_shell_and_ext2.patch to enable hush shell and ext2 
* add 1003_fix_board_revision_numbers to make sure babbage 2.5 boards have 
  revision 51120 and babbage 3.0 boards have revision 51130 properly set in 
  their cpuinfo

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * (C) Copyright 2006-2009
 
2
 * (C) Copyright 2006-2007
3
3
 * Stefan Roese, DENX Software Engineering, sr@denx.de.
4
4
 *
5
5
 * (C) Copyright 2006
33
33
 
34
34
DECLARE_GLOBAL_DATA_PTR;
35
35
 
36
 
#if !defined(CONFIG_SYS_NO_FLASH)
37
36
extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
38
 
#endif
39
37
 
40
 
extern void __ft_board_setup(void *blob, bd_t *bd);
41
 
ulong flash_get_size(ulong base, int banknum);
 
38
ulong flash_get_size (ulong base, int banknum);
42
39
 
43
40
int board_early_init_f(void)
44
41
{
124
121
 
125
122
int misc_init_r(void)
126
123
{
127
 
#if !defined(CONFIG_SYS_NO_FLASH)
128
124
        uint pbcr;
129
125
        int size_val = 0;
130
 
#endif
 
126
        u32 reg;
131
127
#ifdef CONFIG_440EPX
132
128
        unsigned long usb2d0cr = 0;
133
129
        unsigned long usb2phy0cr, usb2h0cr = 0;
134
130
        unsigned long sdr0_pfc1;
135
131
        char *act = getenv("usbact");
136
132
#endif
137
 
        u32 reg;
138
133
 
139
 
#if !defined(CONFIG_SYS_NO_FLASH)
140
134
        /* Re-do flash sizing to get full correct info */
141
135
 
142
136
        /* adjust flash start and offset */
176
170
                            CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1,
177
171
                            &flash_info[0]);
178
172
#endif
179
 
#endif /* CONFIG_SYS_NO_FLASH */
180
173
 
181
174
        /*
182
175
         * USB suff...
520
513
        return 0;       /* No hotkeys supported */
521
514
}
522
515
#endif /* CONFIG_POST */
523
 
 
524
 
#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_SYS_RAMBOOT)
525
 
/*
526
 
 * On NAND-booting sequoia, we need to patch the chips select numbers
527
 
 * in the dtb (CS0 - NAND, CS3 - NOR)
528
 
 */
529
 
void ft_board_setup(void *blob, bd_t *bd)
530
 
{
531
 
        int rc;
532
 
        int len;
533
 
        int nodeoffset;
534
 
        struct fdt_property *prop;
535
 
        u32 *reg;
536
 
        char path[32];
537
 
 
538
 
        /* First do common fdt setup */
539
 
        __ft_board_setup(blob, bd);
540
 
 
541
 
        /* And now configure NOR chip select to 3 instead of 0 */
542
 
        strcpy(path, "/plb/opb/ebc/nor_flash@0,0");
543
 
        nodeoffset = fdt_path_offset(blob, path);
544
 
        prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
545
 
        if (prop == NULL) {
546
 
                printf("Unable to update NOR chip select for NAND booting\n");
547
 
                return;
548
 
        }
549
 
        reg = (u32 *)&prop->data[0];
550
 
        reg[0] = 3;
551
 
        rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);
552
 
        if (rc) {
553
 
                printf("Unable to update property NOR mappings, err=%s\n",
554
 
                       fdt_strerror(rc));
555
 
                return;
556
 
        }
557
 
 
558
 
        /* And now configure NAND chip select to 0 instead of 3 */
559
 
        strcpy(path, "/plb/opb/ebc/ndfc@3,0");
560
 
        nodeoffset = fdt_path_offset(blob, path);
561
 
        prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);
562
 
        if (prop == NULL) {
563
 
                printf("Unable to update NDFC chip select for NAND booting\n");
564
 
                return;
565
 
        }
566
 
        reg = (u32 *)&prop->data[0];
567
 
        reg[0] = 0;
568
 
        rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);
569
 
        if (rc) {
570
 
                printf("Unable to update property NDFC mappings, err=%s\n",
571
 
                       fdt_strerror(rc));
572
 
                return;
573
 
        }
574
 
}
575
 
#endif /* CONFIG_NAND_U_BOOT */