1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <common.h>
25#include <i2c.h>
26#include <libfdt.h>
27#include <fdt_support.h>
28#include <pci.h>
29#include <mpc83xx.h>
30#include <netdev.h>
31#include <asm/io.h>
32#include <asm/fsl_serdes.h>
33#include <asm/fsl_mpc83xx_serdes.h>
34
35DECLARE_GLOBAL_DATA_PTR;
36
37int checkboard(void)
38{
39 printf("Board: MPC8308 P1M\n");
40
41 return 0;
42}
43
44static struct pci_region pcie_regions_0[] = {
45 {
46 .bus_start = CONFIG_SYS_PCIE1_MEM_BASE,
47 .phys_start = CONFIG_SYS_PCIE1_MEM_PHYS,
48 .size = CONFIG_SYS_PCIE1_MEM_SIZE,
49 .flags = PCI_REGION_MEM,
50 },
51 {
52 .bus_start = CONFIG_SYS_PCIE1_IO_BASE,
53 .phys_start = CONFIG_SYS_PCIE1_IO_PHYS,
54 .size = CONFIG_SYS_PCIE1_IO_SIZE,
55 .flags = PCI_REGION_IO,
56 },
57};
58
59void pci_init_board(void)
60{
61 immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
62 sysconf83xx_t *sysconf = &immr->sysconf;
63 law83xx_t *pcie_law = sysconf->pcielaw;
64 struct pci_region *pcie_reg[] = { pcie_regions_0 };
65
66 fsl_setup_serdes(CONFIG_FSL_SERDES1, FSL_SERDES_PROTO_PEX,
67 FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
68
69
70 out_be32(&sysconf->pecr1, 0xE0008000);
71 udelay(2000);
72
73
74 out_be32(&pcie_law[0].bar, CONFIG_SYS_PCIE1_BASE & LAWBAR_BAR);
75 out_be32(&pcie_law[0].ar, LBLAWAR_EN | LBLAWAR_512MB);
76
77 mpc83xx_pcie_init(1, pcie_reg);
78}
79
80#if defined(CONFIG_OF_BOARD_SETUP)
81void ft_board_setup(void *blob, bd_t *bd)
82{
83 ft_cpu_setup(blob, bd);
84 fdt_fixup_dr_usb(blob, bd);
85}
86#endif
87
88int board_eth_init(bd_t *bis)
89{
90 int rv, num_if = 0;
91
92
93 rv = cpu_eth_init(bis);
94 if (rv >= 0)
95 num_if += rv;
96 else
97 printf("ERROR: failed to initialize TSECs.\n");
98
99 rv = pci_eth_init(bis);
100 if (rv >= 0)
101 num_if += rv;
102 else
103 printf("ERROR: failed to initialize PCI Ethernet.\n");
104
105 return num_if;
106}
107