12c8086a5Seric miao /* 22c8086a5Seric miao * linux/arch/arm/mach-pxa/pxa300.c 32c8086a5Seric miao * 42c8086a5Seric miao * Code specific to PXA300/PXA310 52c8086a5Seric miao * 62c8086a5Seric miao * Copyright (C) 2007 Marvell Internation Ltd. 72c8086a5Seric miao * 8e9bba8eeSeric miao * 2007-08-21: eric miao <eric.miao@marvell.com> 92c8086a5Seric miao * initial version 102c8086a5Seric miao * 112c8086a5Seric miao * This program is free software; you can redistribute it and/or modify 122c8086a5Seric miao * it under the terms of the GNU General Public License version 2 as 132c8086a5Seric miao * published by the Free Software Foundation. 142c8086a5Seric miao */ 152c8086a5Seric miao 162c8086a5Seric miao #include <linux/module.h> 172c8086a5Seric miao #include <linux/kernel.h> 187c3ada4fSEric Miao #include <linux/platform_device.h> 192c8086a5Seric miao 20a09e64fbSRussell King #include <mach/hardware.h> 21a09e64fbSRussell King #include <mach/pxa3xx-regs.h> 22a09e64fbSRussell King #include <mach/mfp-pxa300.h> 232c8086a5Seric miao 247c3ada4fSEric Miao #include "generic.h" 257c3ada4fSEric Miao #include "devices.h" 267c3ada4fSEric Miao #include "clock.h" 277c3ada4fSEric Miao 282c8086a5Seric miao static struct pxa3xx_mfp_addr_map pxa300_mfp_addr_map[] __initdata = { 292c8086a5Seric miao 302c8086a5Seric miao MFP_ADDR_X(GPIO0, GPIO2, 0x00b4), 312c8086a5Seric miao MFP_ADDR_X(GPIO3, GPIO26, 0x027c), 320825c672SAleksey Makarov MFP_ADDR_X(GPIO27, GPIO98, 0x0400), 330825c672SAleksey Makarov MFP_ADDR_X(GPIO99, GPIO127, 0x0600), 340825c672SAleksey Makarov MFP_ADDR_X(GPIO0_2, GPIO1_2, 0x0674), 350825c672SAleksey Makarov MFP_ADDR_X(GPIO2_2, GPIO6_2, 0x02dc), 362c8086a5Seric miao 372c8086a5Seric miao MFP_ADDR(nBE0, 0x0204), 382c8086a5Seric miao MFP_ADDR(nBE1, 0x0208), 392c8086a5Seric miao 402c8086a5Seric miao MFP_ADDR(nLUA, 0x0244), 412c8086a5Seric miao MFP_ADDR(nLLA, 0x0254), 422c8086a5Seric miao 432c8086a5Seric miao MFP_ADDR(DF_CLE_nOE, 0x0240), 442c8086a5Seric miao MFP_ADDR(DF_nRE_nOE, 0x0200), 452c8086a5Seric miao MFP_ADDR(DF_ALE_nWE, 0x020C), 462c8086a5Seric miao MFP_ADDR(DF_INT_RnB, 0x00C8), 472c8086a5Seric miao MFP_ADDR(DF_nCS0, 0x0248), 482c8086a5Seric miao MFP_ADDR(DF_nCS1, 0x0278), 492c8086a5Seric miao MFP_ADDR(DF_nWE, 0x00CC), 502c8086a5Seric miao 512c8086a5Seric miao MFP_ADDR(DF_ADDR0, 0x0210), 522c8086a5Seric miao MFP_ADDR(DF_ADDR1, 0x0214), 532c8086a5Seric miao MFP_ADDR(DF_ADDR2, 0x0218), 542c8086a5Seric miao MFP_ADDR(DF_ADDR3, 0x021C), 552c8086a5Seric miao 562c8086a5Seric miao MFP_ADDR(DF_IO0, 0x0220), 572c8086a5Seric miao MFP_ADDR(DF_IO1, 0x0228), 582c8086a5Seric miao MFP_ADDR(DF_IO2, 0x0230), 592c8086a5Seric miao MFP_ADDR(DF_IO3, 0x0238), 602c8086a5Seric miao MFP_ADDR(DF_IO4, 0x0258), 612c8086a5Seric miao MFP_ADDR(DF_IO5, 0x0260), 622c8086a5Seric miao MFP_ADDR(DF_IO6, 0x0268), 632c8086a5Seric miao MFP_ADDR(DF_IO7, 0x0270), 642c8086a5Seric miao MFP_ADDR(DF_IO8, 0x0224), 652c8086a5Seric miao MFP_ADDR(DF_IO9, 0x022C), 662c8086a5Seric miao MFP_ADDR(DF_IO10, 0x0234), 672c8086a5Seric miao MFP_ADDR(DF_IO11, 0x023C), 682c8086a5Seric miao MFP_ADDR(DF_IO12, 0x025C), 692c8086a5Seric miao MFP_ADDR(DF_IO13, 0x0264), 702c8086a5Seric miao MFP_ADDR(DF_IO14, 0x026C), 712c8086a5Seric miao MFP_ADDR(DF_IO15, 0x0274), 722c8086a5Seric miao 732c8086a5Seric miao MFP_ADDR_END, 742c8086a5Seric miao }; 752c8086a5Seric miao 762c8086a5Seric miao /* override pxa300 MFP register addresses */ 772c8086a5Seric miao static struct pxa3xx_mfp_addr_map pxa310_mfp_addr_map[] __initdata = { 782c8086a5Seric miao MFP_ADDR_X(GPIO30, GPIO98, 0x0418), 792c8086a5Seric miao MFP_ADDR_X(GPIO7_2, GPIO12_2, 0x052C), 802c8086a5Seric miao 812c8086a5Seric miao MFP_ADDR(ULPI_STP, 0x040C), 822c8086a5Seric miao MFP_ADDR(ULPI_NXT, 0x0410), 832c8086a5Seric miao MFP_ADDR(ULPI_DIR, 0x0414), 842c8086a5Seric miao 852c8086a5Seric miao MFP_ADDR_END, 862c8086a5Seric miao }; 872c8086a5Seric miao 888c3abc7dSRussell King static DEFINE_PXA3_CKEN(common_nand, NAND, 156000000, 0); 898c3abc7dSRussell King 908c3abc7dSRussell King static struct clk_lookup common_clkregs[] = { 918c3abc7dSRussell King INIT_CLKREG(&clk_common_nand, "pxa3xx-nand", "NANDCLK"), 929ae819a8SEric Miao }; 939ae819a8SEric Miao 948c3abc7dSRussell King static DEFINE_PXA3_CKEN(pxa310_mmc3, MMC3, 19500000, 0); 958c3abc7dSRussell King 968c3abc7dSRussell King static struct clk_lookup pxa310_clkregs[] = { 978c3abc7dSRussell King INIT_CLKREG(&clk_pxa310_mmc3, "pxa2xx-mci.2", "MMCCLK"), 987c3ada4fSEric Miao }; 997c3ada4fSEric Miao 1002c8086a5Seric miao static int __init pxa300_init(void) 1012c8086a5Seric miao { 1022c8086a5Seric miao if (cpu_is_pxa300() || cpu_is_pxa310()) { 1032c8086a5Seric miao pxa3xx_init_mfp(); 1042c8086a5Seric miao pxa3xx_mfp_init_addr(pxa300_mfp_addr_map); 1058c3abc7dSRussell King clks_register(ARRAY_AND_SIZE(common_clkregs)); 1062c8086a5Seric miao } 1072c8086a5Seric miao 1087c3ada4fSEric Miao if (cpu_is_pxa310()) { 1092c8086a5Seric miao pxa3xx_mfp_init_addr(pxa310_mfp_addr_map); 1108c3abc7dSRussell King clks_register(ARRAY_AND_SIZE(pxa310_clkregs)); 1117c3ada4fSEric Miao } 1122c8086a5Seric miao 1132c8086a5Seric miao return 0; 1142c8086a5Seric miao } 1152c8086a5Seric miao 1162c8086a5Seric miao core_initcall(pxa300_init); 117