mpc85xx: Add support for the MPC8572DS reference board
Subsystems (2)
PATCH 1/3 mpc85xx: Add support for the MPC8572DS reference board
--- MAKEALL | 1 + Makefile | 3 + board/freescale/mpc8572ds/Makefile | 54 +++ board/freescale/mpc8572ds/config.mk | 32 ++ board/freescale/mpc8572ds/ddr.c | 344 +++++++++++++++++++ board/freescale/mpc8572ds/law.c | 41 +++ board/freescale/mpc8572ds/mpc8572ds.c | 573 +++++++++++++++++++++++++++++++ board/freescale/mpc8572ds/tlb.c | 85 +++++ board/freescale/mpc8572ds/u-boot.lds | 145 ++++++++ cpu/mpc85xx/cpu.c | 2 +- cpu/mpc85xx/pci.c | 2 +- include/configs/MPC8572DS.h | 600 +++++++++++++++++++++++++++++++++ 12 files changed, 1880 insertions(+), 2 deletions(-) create mode 100644 board/freescale/mpc8572ds/Makefile create mode 100644 board/freescale/mpc8572ds/config.mk create mode 100644 board/freescale/mpc8572ds/ddr.c create mode 100644 board/freescale/mpc8572ds/law.c create mode 100644 board/freescale/mpc8572ds/mpc8572ds.c create mode 100644 board/freescale/mpc8572ds/tlb.c create mode 100644 board/freescale/mpc8572ds/u-boot.lds create mode 100644 include/configs/MPC8572DS.h
MAKEALL +1 -0
@@ -352,6 +352,7 @@ LIST_85xx=" \ MPC8555CDS \ MPC8560ADS \ MPC8568MDS \ + MPC8572DS \ PM854 \ PM856 \ sbc8540 \
Makefile +3 -0
@@ -2197,6 +2197,9 @@ MPC8555CDS_config: unconfig MPC8568MDS_config: unconfig @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8568mds freescale +MPC8572DS_config: unconfig + @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8572ds freescale + PM854_config: unconfig @$(MKCONFIG) $(@:_config=) ppc mpc85xx pm854
board/freescale/mpc8572ds/Makefile new file +54 -0
54 lines not on this page · raw message
board/freescale/mpc8572ds/config.mk new file +32 -0
@@ -0,0 +1,32 @@ +# +# Copyright 2007-2008 Freescale Semiconductor, Inc. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +# +# mpc8572ds board +# +ifndef TEXT_BASE +TEXT_BASE = 0xeff80000 +endif + +PLATFORM_CPPFLAGS += -DCONFIG_E500=1 +PLATFORM_CPPFLAGS += -DCONFIG_MPC85xx=1 +PLATFORM_CPPFLAGS += -DCONFIG_MPC8572=1
board/freescale/mpc8572ds/ddr.c new file +344 -0
344 lines not on this page · raw message
board/freescale/mpc8572ds/law.c new file +41 -0
41 lines not on this page · raw message
board/freescale/mpc8572ds/mpc8572ds.c new file +573 -0
573 lines not on this page · raw message
board/freescale/mpc8572ds/tlb.c new file +85 -0
85 lines not on this page · raw message
board/freescale/mpc8572ds/u-boot.lds new file +145 -0
145 lines not on this page · raw message
cpu/mpc85xx/cpu.c +1 -1
@@ -154,7 +154,7 @@ int checkcpu (void)#endif clkdiv = lcrr &0x0f ;if (clkdiv ==2 || clkdiv ==4 || clkdiv ==8 ) { -#if defined(CONFIG_MPC8548 ) || defined(CONFIG_MPC8544 ) +#if defined(CONFIG_MPC8548 ) || defined(CONFIG_MPC8544 ) || defined(CONFIG_MPC8572 )/* * Yes, the entire PQ38 family use the same * bit-representation for twice the clock divider values.
cpu/mpc85xx/pci.c +1 -1
@@ -29,7 +29,7 @@#include <asm/cpm_85xx.h> #include <pci.h> -#if defined(CONFIG_PCI ) +#if defined(CONFIG_PCI ) && !defined(CONFIG_FSL_PCI_INIT )static struct pci_controller *pci_hose;
include/configs/MPC8572DS.h new file +600 -0
600 lines not on this page · raw message
Signature · 1 line
1.5.5.1
PATCH 2/3 mpc85xx: Add support for the MPC8536
The MPC8536 Adds SDHC and SATA controllers to the PQ3 family. We also have SERDES init code for the 8536.
--- cpu/mpc85xx/Makefile | 1 + cpu/mpc85xx/cpu.c | 8 ++- cpu/mpc85xx/cpu_init.c | 7 ++ cpu/mpc85xx/mpc8536_serdes.c | 180 +++++++++++++++++++++++++++++++++++++++++ cpu/mpc85xx/speed.c | 4 + drivers/misc/fsl_law.c | 2 +- include/asm-ppc/global_data.h | 6 +- include/asm-ppc/immap_85xx.h | 11 +++ include/asm-ppc/processor.h | 2 + include/pci_ids.h | 2 + 10 files changed, 218 insertions(+), 5 deletions(-) create mode 100644 cpu/mpc85xx/mpc8536_serdes.c
cpu/mpc85xx/Makefile +1 -0
@@ -42,6 +42,7 @@ endif endif endif +COBJS-$(CONFIG_MPC8536) += mpc8536_serdes.o COBJS = traps.o cpu.o cpu_init.o speed.o interrupts.o tlb.o \ pci.o serial_scc.o commproc.o ether_fcc.o qe_io.o \ $(COBJS-y)
cpu/mpc85xx/cpu.c +7 -1
@@ -36,6 +36,8 @@ DECLARE_GLOBAL_DATA_PTR;struct cpu_type cpu_type_list [] = {CPU_TYPE_ENTRY (8533 ,8533 ), CPU_TYPE_ENTRY(8533, 8533_E), +CPU_TYPE_ENTRY (8536 ,8536 ), + CPU_TYPE_ENTRY(8536, 8536_E),CPU_TYPE_ENTRY (8540 ,8540 ),CPU_TYPE_ENTRY (8541 ,8541 ), CPU_TYPE_ENTRY(8541, 8541_E),
@@ -89,6 +91,9 @@ int checkcpu (void) svr =get_svr (); ver =SVR_SOC_VER (svr); major =SVR_MAJ (svr); +#ifdef CONFIG_MPC8536 + major &=0x7 ;/* the msb of this nibble is a mfg code */ +#endif minor =SVR_MIN (svr);puts ("CPU: " );
@@ -154,7 +159,8 @@ int checkcpu (void)#endif clkdiv = lcrr &0x0f ;if (clkdiv ==2 || clkdiv ==4 || clkdiv ==8 ) { -#if defined(CONFIG_MPC8548 ) || defined(CONFIG_MPC8544 ) || defined(CONFIG_MPC8572 ) +#if defined(CONFIG_MPC8548 ) || defined(CONFIG_MPC8544 ) || \ + defined(CONFIG_MPC8572 ) || defined(CONFIG_MPC8536 )/* * Yes, the entire PQ38 family use the same * bit-representation for twice the clock divider values.
cpu/mpc85xx/cpu_init.c +7 -0
@@ -37,6 +37,10 @@DECLARE_GLOBAL_DATA_PTR ; +#ifdef CONFIG_MPC8536 +extern void fsl_serdes_init (void ); +#endif +#ifdef CONFIG_QE extern qe_iop_conf_t qe_iop_conf_tab[]; extern void qe_config_iopin(u8 port, u8 pin, int dir,
@@ -240,6 +244,9 @@ void cpu_init_f (void)/* Config QE ioports */ config_qe_ioports ();#endif +#if defined(CONFIG_MPC8536 ) +fsl_serdes_init (); +#endif }
cpu/mpc85xx/mpc8536_serdes.c new file +180 -0
180 lines not on this page · raw message
cpu/mpc85xx/speed.c +4 -0
@@ -110,6 +110,10 @@ int get_clocks (void)#endif gd->i2c2_clk = gd->i2c1_clk; +#if defined(CONFIG_MPC8536 ) + gd->sdhc_clk = gd->bus_clk /2 ; +#endif +#if defined(CONFIG_CPM2 ) gd->vco_out =2 *sys_info.freqSystemBus; gd->cpm_clk = gd->vco_out /2 ;
drivers/misc/fsl_law.c +1 -1
@@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;defined (CONFIG_MPC8568 ) || \ defined(CONFIG_MPC8641) || defined(CONFIG_MPC8610)#define FSL_HW_NUM_LAWS 10 -#elif defined(CONFIG_MPC8572 ) +#elif defined(CONFIG_MPC8536 ) || defined(CONFIG_MPC8572 )#define FSL_HW_NUM_LAWS 12#else #error FSL_HW_NUM_LAWS not defined for this platform
include/asm-ppc/global_data.h +3 -3
@@ -70,9 +70,6 @@ typedef struct global_data {#if defined(CONFIG_MPC8315 )u32 tdm_clk;#endif -#if defined(CONFIG_MPC837X ) -u32 sdhc_clk; -#endif u32 core_clk;u32 enc_clk;u32 lbiu_clk;
@@ -89,6 +86,9 @@ typedef struct global_data {u32 mem_sec_clk;#endif /* CONFIG_MPC8360 */ #endif +#if defined(CONFIG_MPC837X ) || defined(CONFIG_MPC8536 ) +u32 sdhc_clk; +#endif #if defined(CONFIG_MPC83XX ) || defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)u32 i2c1_clk;u32 i2c2_clk;
include/asm-ppc/immap_85xx.h +11 -0
@@ -1560,6 +1560,7 @@ typedef struct ccsr_gur {#define MPC85xx_PORDEVSR_SGMII2_DIS 0x10000000#define MPC85xx_PORDEVSR_SGMII3_DIS 0x08000000#define MPC85xx_PORDEVSR_SGMII4_DIS 0x04000000 +#define MPC85xx_PORDEVSR_SRDS2_IO_SEL 0x38000000#define MPC85xx_PORDEVSR_IO_SEL 0x00380000#define MPC85xx_PORDEVSR_PCI2_ARB 0x00040000#define MPC85xx_PORDEVSR_PCI1_ARB 0x00020000
@@ -1653,13 +1654,23 @@ typedef struct ccsr_gur {#define CFG_MPC85xx_PCIX_ADDR (CFG_IMMR + CFG_MPC85xx_PCIX_OFFSET)#define CFG_MPC85xx_PCIX2_OFFSET (0x9000)#define CFG_MPC85xx_PCIX2_ADDR (CFG_IMMR + CFG_MPC85xx_PCIX2_OFFSET) +#define CFG_MPC85xx_SATA1_OFFSET (0x18000) +#define CFG_MPC85xx_SATA1_ADDR (CFG_IMMR + CFG_MPC85xx_SATA1_OFFSET) +#define CFG_MPC85xx_SATA2_OFFSET (0x19000) +#define CFG_MPC85xx_SATA2_ADDR (CFG_IMMR + CFG_MPC85xx_SATA2_OFFSET)#define CFG_MPC85xx_L2_OFFSET (0x20000)#define CFG_MPC85xx_L2_ADDR (CFG_IMMR + CFG_MPC85xx_L2_OFFSET)#define CFG_MPC85xx_DMA_OFFSET (0x21000)#define CFG_MPC85xx_DMA_ADDR (CFG_IMMR + CFG_MPC85xx_DMA_OFFSET) +#define CFG_MPC85xx_ESDHC_OFFSET (0x2e000) +#define CFG_MPC85xx_ESDHC_ADDR (CFG_IMMR + CFG_MPC85xx_ESDHC_OFFSET)#define CFG_MPC85xx_PIC_OFFSET (0x40000)#define CFG_MPC85xx_PIC_ADDR (CFG_IMMR + CFG_MPC85xx_PIC_OFFSET)#define CFG_MPC85xx_CPM_OFFSET (0x80000)#define CFG_MPC85xx_CPM_ADDR (CFG_IMMR + CFG_MPC85xx_CPM_OFFSET) +#define CFG_MPC85xx_SERDES1_OFFSET (0xE3000) +#define CFG_MPC85xx_SERDES1_ADDR (CFG_IMMR + CFG_MPC85xx_SERDES2_OFFSET) +#define CFG_MPC85xx_SERDES2_OFFSET (0xE3100) +#define CFG_MPC85xx_SERDES2_ADDR (CFG_IMMR + CFG_MPC85xx_SERDES2_OFFSET)#endif /*__IMMAP_85xx__*/
include/asm-ppc/processor.h +2 -0
@@ -920,6 +920,8 @@#define SVR_8533 0x803400#define SVR_8533_E 0x803C00 +#define SVR_8536 0x803700 +#define SVR_8536_E 0x803F00#define SVR_8540 0x803000#define SVR_8541 0x807200#define SVR_8541_E 0x807A00
include/pci_ids.h +2 -0
@@ -2057,6 +2057,8 @@#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030#define PCI_VENDOR_ID_FREESCALE 0x1957 +#define PCI_DEVICE_ID_MPC8536E 0x0050 +#define PCI_DEVICE_ID_MPC8536 0x0051#define PCI_DEVICE_ID_MPC8548E 0x0012#define PCI_DEVICE_ID_MPC8548 0x0013#define PCI_DEVICE_ID_MPC8543E 0x0014
Signature · 1 line
1.5.5.1
PATCH 3/3 mpc85xx: Add support for the MPC8536DS reference board
--- MAKEALL | 1 + Makefile | 3 + board/freescale/mpc8536ds/Makefile | 54 +++ board/freescale/mpc8536ds/config.mk | 32 ++ board/freescale/mpc8536ds/ddr.c | 334 +++++++++++++++++ board/freescale/mpc8536ds/law.c | 43 +++ board/freescale/mpc8536ds/mpc8536ds.c | 653 +++++++++++++++++++++++++++++++++ board/freescale/mpc8536ds/tlb.c | 71 ++++ board/freescale/mpc8536ds/u-boot.lds | 145 ++++++++ include/configs/MPC8536DS.h | 624 +++++++++++++++++++++++++++++++ 10 files changed, 1960 insertions(+), 0 deletions(-) create mode 100644 board/freescale/mpc8536ds/Makefile create mode 100644 board/freescale/mpc8536ds/config.mk create mode 100644 board/freescale/mpc8536ds/ddr.c create mode 100644 board/freescale/mpc8536ds/law.c create mode 100644 board/freescale/mpc8536ds/mpc8536ds.c create mode 100644 board/freescale/mpc8536ds/tlb.c create mode 100644 board/freescale/mpc8536ds/u-boot.lds create mode 100644 include/configs/MPC8536DS.h
MAKEALL +1 -0
@@ -344,6 +344,7 @@ LIST_83xx=" \ LIST_85xx=" \ ATUM8548 \ + MPC8536DS \ MPC8540ADS \ MPC8540EVAL \ MPC8541CDS \
Makefile +3 -0
@@ -2138,6 +2138,9 @@ TQM834x_config: unconfig ATUM8548_config: unconfig @$(MKCONFIG) $(@:_config=) ppc mpc85xx atum8548 +MPC8536DS_config: unconfig + @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8536ds freescale + MPC8540ADS_config: unconfig @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8540ads freescale
board/freescale/mpc8536ds/Makefile new file +54 -0
54 lines not on this page · raw message
board/freescale/mpc8536ds/config.mk new file +32 -0
@@ -0,0 +1,32 @@ +# +# Copyright 2008 Freescale Semiconductor. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +# +# mpc8536ds board +# +ifndef TEXT_BASE +TEXT_BASE = 0xeff80000 +endif + +PLATFORM_CPPFLAGS += -DCONFIG_E500=1 +PLATFORM_CPPFLAGS += -DCONFIG_MPC85xx=1 +PLATFORM_CPPFLAGS += -DCONFIG_MPC8536=1
board/freescale/mpc8536ds/ddr.c new file +334 -0
334 lines not on this page · raw message
board/freescale/mpc8536ds/law.c new file +43 -0
43 lines not on this page · raw message
board/freescale/mpc8536ds/mpc8536ds.c new file +653 -0
653 lines not on this page · raw message
board/freescale/mpc8536ds/tlb.c new file +71 -0
71 lines not on this page · raw message
board/freescale/mpc8536ds/u-boot.lds new file +145 -0
145 lines not on this page · raw message
include/configs/MPC8536DS.h new file +624 -0
624 lines not on this page · raw message
Signature · 1 line
1.5.5.1
PATCH 1/3 mpc85xx: Add support for the MPC8572DS reference board
In reply to Kumar GalaQuoted 41 lines · Kumar Gala
board/freescale/mpc8572ds/ddr.c new file +41
-0+for (i =0 ; i <CONFIG_CHIP_SELECTS_PER_CTRL ; i++) { +unsigned int bnds =0 ; +unsigned int config =0 ; +unsigned int config_2 =0 ; +unsigned int *pbnds =NULL ; +unsigned int *pconfig =NULL ; +unsigned int *pconfig_2 =NULL ; + +if (i ==0 ) { + bnds = ddr->cs0_bnds; + config = ddr->cs0_config; + config_2 = ddr->cs0_config_2; + pbnds = (unsigned int *)&ddr->cs0_bnds; + pconfig = (unsigned int *)&ddr->cs0_config; + pconfig_2= (unsigned int *)&ddr->cs0_config_2; + + }else if (i ==1 ) { + bnds = ddr->cs1_bnds; + config = ddr->cs1_config; + config_2 = ddr->cs1_config_2; + pbnds = (unsigned int *)&ddr->cs1_bnds; + pconfig = (unsigned int *)&ddr->cs1_config; + pconfig_2= (unsigned int *)&ddr->cs1_config_2; + + }else if (i ==2 ) { + bnds = ddr->cs2_bnds; + config = ddr->cs2_config; + config_2 = ddr->cs2_config_2; + pbnds = (unsigned int *)&ddr->cs2_bnds; + pconfig = (unsigned int *)&ddr->cs2_config; + pconfig_2= (unsigned int *)&ddr->cs2_config_2; + + }else if (i ==3 ) { + bnds = ddr->cs3_bnds; + config = ddr->cs3_config; + config_2 = ddr->cs3_config_2; + pbnds = (unsigned int *) &ddr->cs3_bnds; + pconfig = (unsigned int *) &ddr->cs3_config; + pconfig_2= (unsigned int *) &ddr->cs3_config_2; + + }else {
board/freescale/mpc8572ds/ddr.c line 114
Quoted 10 lines
board/freescale/mpc8572ds/ddr.c new file +10
-0+/* +* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 4 +*/ + } + +printf ("cs%u_bnds = %08X\t%p\n" , i, bnds, pbnds); +printf ("cs%u_config = %08X\t%p\n" , i, config, pconfig); +printf ("cs%u_config_2 = %08X\t%p\n" , + i, config_2, pconfig_2); + }
Couldn't we use arrays for this sort of thing?
-Scott
PATCH 1/3 mpc85xx: Add support for the MPC8572DS reference board
Quoted 46 lines · Scott Wood
Quoted 45 lines · Kumar Gala
board/freescale/mpc8572ds/ddr.c new file +45
-0+for (i =0 ; i <CONFIG_CHIP_SELECTS_PER_CTRL ; i++) { +unsigned int bnds =0 ; +unsigned int config =0 ; +unsigned int config_2 =0 ; +unsigned int *pbnds =NULL ; +unsigned int *pconfig =NULL ; +unsigned int *pconfig_2 =NULL ; + +if (i ==0 ) { + bnds = ddr->cs0_bnds; + config = ddr->cs0_config; + config_2 = ddr->cs0_config_2; + pbnds = (unsigned int *)&ddr->cs0_bnds; + pconfig = (unsigned int *)&ddr->cs0_config; + pconfig_2= (unsigned int *)&ddr->cs0_config_2; + + }else if (i ==1 ) { + bnds = ddr->cs1_bnds; + config = ddr->cs1_config; + config_2 = ddr->cs1_config_2; + pbnds = (unsigned int *)&ddr->cs1_bnds; + pconfig = (unsigned int *)&ddr->cs1_config; + pconfig_2= (unsigned int *)&ddr->cs1_config_2; + + }else if (i ==2 ) { + bnds = ddr->cs2_bnds; + config = ddr->cs2_config; + config_2 = ddr->cs2_config_2; + pbnds = (unsigned int *)&ddr->cs2_bnds; + pconfig = (unsigned int *)&ddr->cs2_config; + pconfig_2= (unsigned int *)&ddr->cs2_config_2; + + }else if (i ==3 ) { + bnds = ddr->cs3_bnds; + config = ddr->cs3_config; + config_2 = ddr->cs3_config_2; + pbnds = (unsigned int *) &ddr->cs3_bnds; + pconfig = (unsigned int *) &ddr->cs3_config; + pconfig_2= (unsigned int *) &ddr->cs3_config_2; + + }else { +/* +* FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 4 +*/ + }
Quoted 8 lines
board/freescale/mpc8572ds/ddr.c line 114
Quoted 6 lines
board/freescale/mpc8572ds/ddr.c new file +6
-0+ +printf ("cs%u_bnds = %08X\t%p\n" , i, bnds, pbnds); +printf ("cs%u_config = %08X\t%p\n" , i, config, pconfig); +printf ("cs%u_config_2 = %08X\t%p\n" , + i, config_2, pconfig_2); + }Couldn't we use arrays for this sort of thing?
this is historic in how the immap is defined for these parts. As patch is welcome to do such cleanup. I don't think it should hold up acceptance.
- k
PATCH 1/3 mpc85xx: Add support for the MPC8572DS reference board
Quoted 4 lines · Kumar Gala
Quoted 1 line
Couldn't we use arrays for this sort of thing?
this is historic in how the immap is defined for these parts. As patch is welcome to do such cleanup. I don't think it should hold up acceptance.
Neither do I; it just stood out as I glanced over the patch and I felt compelled to grumble. :-)
-Scott