aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Breeds <tony@bakeyournoodle.com>2011-11-30 16:39:23 -0500
committerJosh Boyer <jwboyer@gmail.com>2011-12-09 07:51:02 -0500
commitdf777bd39a266637d1765d48043493489418e75b (patch)
treeedd0b29da39bb9bd4266bd026cd4510041cb03b5
parent075bcf5879225d0c2a119c23d8046b890e051e81 (diff)
powerpc/476fpe: Add 476fpe SoC code
Based on original work by David 'Shaggy' Kleikamp. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
-rw-r--r--arch/powerpc/include/asm/reg.h1
-rw-r--r--arch/powerpc/kernel/cputable.c14
-rw-r--r--arch/powerpc/kernel/head_44x.S2
-rw-r--r--arch/powerpc/platforms/44x/Kconfig4
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c57
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.h7
6 files changed, 84 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 559da199edb5..7fdc2c0b7fa0 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -951,6 +951,7 @@
951#define PVR_403GCX 0x00201400 951#define PVR_403GCX 0x00201400
952#define PVR_405GP 0x40110000 952#define PVR_405GP 0x40110000
953#define PVR_476 0x11a52000 953#define PVR_476 0x11a52000
954#define PVR_476FPE 0x7ff50000
954#define PVR_STB03XXX 0x40310000 955#define PVR_STB03XXX 0x40310000
955#define PVR_NP405H 0x41410000 956#define PVR_NP405H 0x41410000
956#define PVR_NP405L 0x41610000 957#define PVR_NP405L 0x41610000
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index ce59693835c7..81db9e2a8a20 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1843,6 +1843,20 @@ static struct cpu_spec __initdata cpu_specs[] = {
1843 .machine_check = machine_check_47x, 1843 .machine_check = machine_check_47x,
1844 .platform = "ppc470", 1844 .platform = "ppc470",
1845 }, 1845 },
1846 { /* 476fpe */
1847 .pvr_mask = 0xffff0000,
1848 .pvr_value = 0x7ff50000,
1849 .cpu_name = "476fpe",
1850 .cpu_features = CPU_FTRS_47X | CPU_FTR_476_DD2,
1851 .cpu_user_features = COMMON_USER_BOOKE |
1852 PPC_FEATURE_HAS_FPU,
1853 .mmu_features = MMU_FTR_TYPE_47x |
1854 MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
1855 .icache_bsize = 32,
1856 .dcache_bsize = 128,
1857 .machine_check = machine_check_47x,
1858 .platform = "ppc470",
1859 },
1846 { /* 476 iss */ 1860 { /* 476 iss */
1847 .pvr_mask = 0xffff0000, 1861 .pvr_mask = 0xffff0000,
1848 .pvr_value = 0x00050000, 1862 .pvr_value = 0x00050000,
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index b725dab0f88a..bb7a9c7a4c05 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -732,6 +732,8 @@ _GLOBAL(init_cpu_state)
732 /* We use the PVR to differenciate 44x cores from 476 */ 732 /* We use the PVR to differenciate 44x cores from 476 */
733 mfspr r3,SPRN_PVR 733 mfspr r3,SPRN_PVR
734 srwi r3,r3,16 734 srwi r3,r3,16
735 cmplwi cr0,r3,PVR_476FPE@h
736 beq head_start_47x
735 cmplwi cr0,r3,PVR_476@h 737 cmplwi cr0,r3,PVR_476@h
736 beq head_start_47x 738 beq head_start_47x
737 cmplwi cr0,r3,PVR_476_ISS@h 739 cmplwi cr0,r3,PVR_476_ISS@h
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 762322ce24a9..f0be6e0b164d 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -308,6 +308,10 @@ config 460SX
308 select IBM_EMAC_ZMII 308 select IBM_EMAC_ZMII
309 select IBM_EMAC_TAH 309 select IBM_EMAC_TAH
310 310
311config 476FPE
312 bool
313 select PPC_FPU
314
311config APM821xx 315config APM821xx
312 bool 316 bool
313 select PPC_FPU 317 select PPC_FPU
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 472d2b840f10..4f05f7542346 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1296,6 +1296,52 @@ static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata =
1296 1296
1297#endif /* CONFIG_40x */ 1297#endif /* CONFIG_40x */
1298 1298
1299#ifdef CONFIG_476FPE
1300static int __init ppc_476fpe_pciex_core_init(struct device_node *np)
1301{
1302 return 4;
1303}
1304
1305static void __init ppc_476fpe_pciex_check_link(struct ppc4xx_pciex_port *port)
1306{
1307 u32 timeout_ms = 20;
1308 u32 val = 0, mask = (PECFG_TLDLP_LNKUP|PECFG_TLDLP_PRESENT);
1309 void __iomem *mbase = ioremap(port->cfg_space.start + 0x10000000,
1310 0x1000);
1311
1312 printk(KERN_INFO "PCIE%d: Checking link...\n", port->index);
1313
1314 if (mbase == NULL) {
1315 printk(KERN_WARNING "PCIE%d: failed to get cfg space\n",
1316 port->index);
1317 return;
1318 }
1319
1320 while (timeout_ms--) {
1321 val = in_le32(mbase + PECFG_TLDLP);
1322
1323 if ((val & mask) == mask)
1324 break;
1325 msleep(10);
1326 }
1327
1328 if (val & PECFG_TLDLP_PRESENT) {
1329 printk(KERN_INFO "PCIE%d: link is up !\n", port->index);
1330 port->link = 1;
1331 } else
1332 printk(KERN_WARNING "PCIE%d: Link up failed\n", port->index);
1333
1334 iounmap(mbase);
1335 return;
1336}
1337
1338static struct ppc4xx_pciex_hwops ppc_476fpe_pcie_hwops __initdata =
1339{
1340 .core_init = ppc_476fpe_pciex_core_init,
1341 .check_link = ppc_476fpe_pciex_check_link,
1342};
1343#endif /* CONFIG_476FPE */
1344
1299/* Check that the core has been initied and if not, do it */ 1345/* Check that the core has been initied and if not, do it */
1300static int __init ppc4xx_pciex_check_core_init(struct device_node *np) 1346static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
1301{ 1347{
@@ -1321,6 +1367,10 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
1321 if (of_device_is_compatible(np, "ibm,plb-pciex-405ex")) 1367 if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
1322 ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops; 1368 ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops;
1323#endif 1369#endif
1370#ifdef CONFIG_476FPE
1371 if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe"))
1372 ppc4xx_pciex_hwops = &ppc_476fpe_pcie_hwops;
1373#endif
1324 if (ppc4xx_pciex_hwops == NULL) { 1374 if (ppc4xx_pciex_hwops == NULL) {
1325 printk(KERN_WARNING "PCIE: unknown host type %s\n", 1375 printk(KERN_WARNING "PCIE: unknown host type %s\n",
1326 np->full_name); 1376 np->full_name);
@@ -1629,6 +1679,10 @@ static int __init ppc4xx_setup_one_pciex_POM(struct ppc4xx_pciex_port *port,
1629 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 1679 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL,
1630 sa | DCRO_PEGPL_460SX_OMR1MSKL_UOT 1680 sa | DCRO_PEGPL_460SX_OMR1MSKL_UOT
1631 | DCRO_PEGPL_OMRxMSKL_VAL); 1681 | DCRO_PEGPL_OMRxMSKL_VAL);
1682 else if (of_device_is_compatible(port->node, "ibm,plb-pciex-476fpe"))
1683 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL,
1684 sa | DCRO_PEGPL_476FPE_OMR1MSKL_UOT
1685 | DCRO_PEGPL_OMRxMSKL_VAL);
1632 else 1686 else
1633 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 1687 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL,
1634 sa | DCRO_PEGPL_OMR1MSKL_UOT 1688 sa | DCRO_PEGPL_OMR1MSKL_UOT
@@ -1753,7 +1807,8 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
1753 if (res->flags & IORESOURCE_PREFETCH) 1807 if (res->flags & IORESOURCE_PREFETCH)
1754 sa |= PCI_BASE_ADDRESS_MEM_PREFETCH; 1808 sa |= PCI_BASE_ADDRESS_MEM_PREFETCH;
1755 1809
1756 if (of_device_is_compatible(port->node, "ibm,plb-pciex-460sx")) 1810 if (of_device_is_compatible(port->node, "ibm,plb-pciex-460sx") ||
1811 of_device_is_compatible(port->node, "ibm,plb-pciex-476fpe"))
1757 sa |= PCI_BASE_ADDRESS_MEM_TYPE_64; 1812 sa |= PCI_BASE_ADDRESS_MEM_TYPE_64;
1758 1813
1759 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa)); 1814 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa));
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.h b/arch/powerpc/sysdev/ppc4xx_pci.h
index 32ce763a375a..bb4821938ab1 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.h
+++ b/arch/powerpc/sysdev/ppc4xx_pci.h
@@ -476,6 +476,13 @@
476#define DCRO_PEGPL_OMR1MSKL_UOT 0x00000002 476#define DCRO_PEGPL_OMR1MSKL_UOT 0x00000002
477#define DCRO_PEGPL_OMR3MSKL_IO 0x00000002 477#define DCRO_PEGPL_OMR3MSKL_IO 0x00000002
478 478
479/* 476FPE */
480#define PCCFG_LCPA 0x270
481#define PECFG_TLDLP 0x3F8
482#define PECFG_TLDLP_LNKUP 0x00000008
483#define PECFG_TLDLP_PRESENT 0x00000010
484#define DCRO_PEGPL_476FPE_OMR1MSKL_UOT 0x00000004
485
479/* SDR Bit Mappings */ 486/* SDR Bit Mappings */
480#define PESDRx_RCSSET_HLDPLB 0x10000000 487#define PESDRx_RCSSET_HLDPLB 0x10000000
481#define PESDRx_RCSSET_RSTGU 0x01000000 488#define PESDRx_RCSSET_RSTGU 0x01000000