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

« back to all changes in this revision

Viewing changes to board/freescale/mpc8572ds/mpc8572ds.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:
27
27
#include <asm/mmu.h>
28
28
#include <asm/cache.h>
29
29
#include <asm/immap_85xx.h>
30
 
#include <asm/fsl_pci.h>
 
30
#include <asm/immap_fsl_pci.h>
31
31
#include <asm/fsl_ddr_sdram.h>
32
32
#include <asm/io.h>
33
33
#include <miiphy.h>
42
42
 
43
43
int checkboard (void)
44
44
{
45
 
        u8 vboot;
46
 
        u8 *pixis_base = (u8 *)PIXIS_BASE;
47
 
 
48
 
        puts ("Board: MPC8572DS ");
49
 
#ifdef CONFIG_PHYS_64BIT
50
 
        puts ("(36-bit addrmap) ");
51
 
#endif
52
 
        printf ("Sys ID: 0x%02x, "
53
 
                "Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
54
 
                in_8(pixis_base + PIXIS_ID), in_8(pixis_base + PIXIS_VER),
55
 
                in_8(pixis_base + PIXIS_PVER));
56
 
 
57
 
        vboot = in_8(pixis_base + PIXIS_VBOOT);
58
 
        switch ((vboot & PIXIS_VBOOT_LBMAP) >> 6) {
59
 
                case PIXIS_VBOOT_LBMAP_NOR0:
60
 
                        puts ("vBank: 0\n");
61
 
                        break;
62
 
                case PIXIS_VBOOT_LBMAP_PJET:
63
 
                        puts ("Promjet\n");
64
 
                        break;
65
 
                case PIXIS_VBOOT_LBMAP_NAND:
66
 
                        puts ("NAND\n");
67
 
                        break;
68
 
                case PIXIS_VBOOT_LBMAP_NOR1:
69
 
                        puts ("vBank: 1\n");
70
 
                        break;
71
 
        }
72
 
 
 
45
        printf ("Board: MPC8572DS, System ID: 0x%02x, "
 
46
                "System Version: 0x%02x, FPGA Version: 0x%02x\n",
 
47
                in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER),
 
48
                in8(PIXIS_BASE + PIXIS_PVER));
73
49
        return 0;
74
50
}
75
51
 
159
135
static struct pci_controller pcie3_hose;
160
136
#endif
161
137
 
 
138
extern int fsl_pci_setup_inbound_windows(struct pci_region *r);
 
139
extern void fsl_pci_init(struct pci_controller *hose);
 
140
 
162
141
int first_free_busno=0;
163
142
#ifdef CONFIG_PCI
164
143
void pci_init_board(void)
206
185
 
207
186
                        /* outbound memory */
208
187
                        pci_set_region(r++,
209
 
                                        CONFIG_SYS_PCIE3_MEM_BUS,
 
188
                                        CONFIG_SYS_PCIE3_MEM_BASE,
210
189
                                        CONFIG_SYS_PCIE3_MEM_PHYS,
211
190
                                        CONFIG_SYS_PCIE3_MEM_SIZE,
212
191
                                        PCI_REGION_MEM);
213
192
 
214
193
                        /* outbound io */
215
194
                        pci_set_region(r++,
216
 
                                        CONFIG_SYS_PCIE3_IO_BUS,
 
195
                                        CONFIG_SYS_PCIE3_IO_BASE,
217
196
                                        CONFIG_SYS_PCIE3_IO_PHYS,
218
197
                                        CONFIG_SYS_PCIE3_IO_SIZE,
219
198
                                        PCI_REGION_IO);
236
215
 
237
216
                        pci_hose_read_config_dword(hose, PCI_BDF(2, 0x1d, 0 ),
238
217
                                        PCI_BASE_ADDRESS_1, &temp32);
239
 
                        if (temp32 >= CONFIG_SYS_PCIE3_MEM_BUS) {
240
 
                                void *p = pci_mem_to_virt(PCI_BDF(2, 0x1d, 0),
241
 
                                                                temp32, 4, 0);
242
 
                                debug(" uli1572 read to %p\n", p);
243
 
                                in_be32(p);
 
218
                        if (temp32 >= CONFIG_SYS_PCIE3_MEM_PHYS) {
 
219
                                debug(" uli1572 read to %x\n", temp32);
 
220
                                in_be32((unsigned *)temp32);
244
221
                        }
245
222
                } else {
246
223
                        printf ("    PCIE3: disabled\n");
275
252
 
276
253
                        /* outbound memory */
277
254
                        pci_set_region(r++,
278
 
                                        CONFIG_SYS_PCIE2_MEM_BUS,
 
255
                                        CONFIG_SYS_PCIE2_MEM_BASE,
279
256
                                        CONFIG_SYS_PCIE2_MEM_PHYS,
280
257
                                        CONFIG_SYS_PCIE2_MEM_SIZE,
281
258
                                        PCI_REGION_MEM);
282
259
 
283
260
                        /* outbound io */
284
261
                        pci_set_region(r++,
285
 
                                        CONFIG_SYS_PCIE2_IO_BUS,
 
262
                                        CONFIG_SYS_PCIE2_IO_BASE,
286
263
                                        CONFIG_SYS_PCIE2_IO_PHYS,
287
264
                                        CONFIG_SYS_PCIE2_IO_SIZE,
288
265
                                        PCI_REGION_IO);
330
307
 
331
308
                        /* outbound memory */
332
309
                        pci_set_region(r++,
333
 
                                        CONFIG_SYS_PCIE1_MEM_BUS,
 
310
                                        CONFIG_SYS_PCIE1_MEM_BASE,
334
311
                                        CONFIG_SYS_PCIE1_MEM_PHYS,
335
312
                                        CONFIG_SYS_PCIE1_MEM_SIZE,
336
313
                                        PCI_REGION_MEM);
337
314
 
338
315
                        /* outbound io */
339
316
                        pci_set_region(r++,
340
 
                                        CONFIG_SYS_PCIE1_IO_BUS,
 
317
                                        CONFIG_SYS_PCIE1_IO_BASE,
341
318
                                        CONFIG_SYS_PCIE1_IO_PHYS,
342
319
                                        CONFIG_SYS_PCIE1_IO_SIZE,
343
320
                                        PCI_REGION_IO);
381
358
        /* invalidate existing TLB entry for flash + promjet */
382
359
        disable_tlb(flash_esel);
383
360
 
384
 
        set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,       /* tlb, epn, rpn */
 
361
        set_tlb(1, flashbase, flashbase,                /* tlb, epn, rpn */
385
362
                        MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, /* perms, wimge */
386
363
                        0, flash_esel, BOOKE_PAGESZ_256M, 1);   /* ts, esel, tsize, iprot */
387
364
 
432
409
 
433
410
unsigned long get_board_sys_clk(ulong dummy)
434
411
{
435
 
        u8 *pixis_base = (u8 *)PIXIS_BASE;
436
 
 
437
412
        return ics307_clk_freq (
438
 
                        in_8(pixis_base + PIXIS_VSYSCLK0),
439
 
                        in_8(pixis_base + PIXIS_VSYSCLK1),
440
 
                        in_8(pixis_base + PIXIS_VSYSCLK2)
 
413
                        in8(PIXIS_BASE + PIXIS_VSYSCLK0),
 
414
                        in8(PIXIS_BASE + PIXIS_VSYSCLK1),
 
415
                        in8(PIXIS_BASE + PIXIS_VSYSCLK2)
441
416
                        );
442
417
}
443
418
 
444
419
unsigned long get_board_ddr_clk(ulong dummy)
445
420
{
446
 
        u8 *pixis_base = (u8 *)PIXIS_BASE;
447
 
 
448
421
        return ics307_clk_freq (
449
 
                        in_8(pixis_base + PIXIS_VDDRCLK0),
450
 
                        in_8(pixis_base + PIXIS_VDDRCLK1),
451
 
                        in_8(pixis_base + PIXIS_VDDRCLK2)
 
422
                        in8(PIXIS_BASE + PIXIS_VDDRCLK0),
 
423
                        in8(PIXIS_BASE + PIXIS_VDDRCLK1),
 
424
                        in8(PIXIS_BASE + PIXIS_VDDRCLK2)
452
425
                        );
453
426
}
454
427
#else
456
429
{
457
430
        u8 i;
458
431
        ulong val = 0;
459
 
        u8 *pixis_base = (u8 *)PIXIS_BASE;
460
432
 
461
 
        i = in_8(pixis_base + PIXIS_SPD);
 
433
        i = in8(PIXIS_BASE + PIXIS_SPD);
462
434
        i &= 0x07;
463
435
 
464
436
        switch (i) {
495
467
{
496
468
        u8 i;
497
469
        ulong val = 0;
498
 
        u8 *pixis_base = (u8 *)PIXIS_BASE;
499
470
 
500
 
        i = in_8(pixis_base + PIXIS_SPD);
 
471
        i = in8(PIXIS_BASE + PIXIS_SPD);
501
472
        i &= 0x38;
502
473
        i >>= 3;
503
474
 
569
540
                return 0;
570
541
        }
571
542
 
572
 
#ifdef CONFIG_FSL_SGMII_RISER
573
543
        fsl_sgmii_riser_init(tsec_info, num);
574
 
#endif
575
544
 
576
545
        tsec_eth_init(bis, tsec_info, num);
577
546
 
580
549
#endif
581
550
 
582
551
#if defined(CONFIG_OF_BOARD_SETUP)
 
552
extern void ft_fsl_pci_setup(void *blob, const char *pci_alias,
 
553
                        struct pci_controller *hose);
 
554
 
583
555
void ft_board_setup(void *blob, bd_t *bd)
584
556
{
585
 
        phys_addr_t base;
586
 
        phys_size_t size;
 
557
        ulong base, size;
587
558
 
588
559
        ft_cpu_setup(blob, bd);
589
560
 
601
572
#ifdef CONFIG_PCIE1
602
573
        ft_fsl_pci_setup(blob, "pci2", &pcie1_hose);
603
574
#endif
604
 
#ifdef CONFIG_FSL_SGMII_RISER
605
 
        fsl_sgmii_riser_fdt_fixup(blob);
606
 
#endif
607
575
}
608
576
#endif
609
577