xref: /openbmc/linux/arch/arm/mach-nomadik/cpu-8815.c (revision 2ad6e398)
128ad94ecSAlessandro Rubini /*
228ad94ecSAlessandro Rubini  * Copyright STMicroelectronics, 2007.
328ad94ecSAlessandro Rubini  *
428ad94ecSAlessandro Rubini  *  This program is free software; you can redistribute it and/or modify
528ad94ecSAlessandro Rubini  *  it under the terms of the GNU General Public License as published by
628ad94ecSAlessandro Rubini  *  the Free Software Foundation; either version 2 of the License, or
728ad94ecSAlessandro Rubini  *  (at your option) any later version.
828ad94ecSAlessandro Rubini  *
928ad94ecSAlessandro Rubini  *  This program is distributed in the hope that it will be useful,
1028ad94ecSAlessandro Rubini  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
1128ad94ecSAlessandro Rubini  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1228ad94ecSAlessandro Rubini  *  GNU General Public License for more details.
1328ad94ecSAlessandro Rubini  *
1428ad94ecSAlessandro Rubini  *  You should have received a copy of the GNU General Public License
1528ad94ecSAlessandro Rubini  *  along with this program; if not, write to the Free Software
1628ad94ecSAlessandro Rubini  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1728ad94ecSAlessandro Rubini  */
1828ad94ecSAlessandro Rubini 
1928ad94ecSAlessandro Rubini #include <linux/types.h>
2028ad94ecSAlessandro Rubini #include <linux/init.h>
2128ad94ecSAlessandro Rubini #include <linux/device.h>
222ec1d359SAlessandro Rubini #include <linux/amba/bus.h>
233e3c62caSRabin Vincent #include <linux/platform_device.h>
2435b47a40SRussell King #include <linux/io.h>
257c77852dSLinus Walleij #include <linux/slab.h>
267c77852dSLinus Walleij #include <linux/irq.h>
277c77852dSLinus Walleij #include <linux/dma-mapping.h>
28f8635abdSLinus Walleij #include <linux/irqchip.h>
294a31bd28SLinus Walleij #include <linux/platform_data/clk-nomadik.h>
30bb16bd9bSLinus Walleij #include <linux/platform_data/pinctrl-nomadik.h>
311b542757SLinus Walleij #include <linux/pinctrl/machine.h>
32f8635abdSLinus Walleij #include <linux/platform_data/clocksource-nomadik-mtu.h>
33f8635abdSLinus Walleij #include <linux/of_irq.h>
342ad6e398SLinus Walleij #include <linux/of_gpio.h>
35f8635abdSLinus Walleij #include <linux/of_address.h>
36f8635abdSLinus Walleij #include <linux/of_platform.h>
37ba785205SLinus Walleij #include <linux/mtd/fsmc.h>
382ad6e398SLinus Walleij #include <linux/gpio.h>
3928ad94ecSAlessandro Rubini 
4028ad94ecSAlessandro Rubini #include <mach/hardware.h>
4128ad94ecSAlessandro Rubini #include <mach/irqs.h>
42f8635abdSLinus Walleij #include <asm/mach/arch.h>
4328ad94ecSAlessandro Rubini #include <asm/mach/map.h>
44f8635abdSLinus Walleij #include <asm/mach/time.h>
4527bda036SLinus Walleij #include <asm/mach-types.h>
4628ad94ecSAlessandro Rubini 
470b260fd4SAlessandro Rubini #include <asm/cacheflush.h>
480b260fd4SAlessandro Rubini #include <asm/hardware/cache-l2x0.h>
490b260fd4SAlessandro Rubini 
5061b38753SLinus Walleij #include "cpu-8815.h"
51ba327b1eSLinus Walleij 
52056c78d3SLinus Walleij /* The 8815 has 4 GPIO blocks, let's register them immediately */
53056c78d3SLinus Walleij static resource_size_t __initdata cpu8815_gpio_base[] = {
54056c78d3SLinus Walleij 	NOMADIK_GPIO0_BASE,
55056c78d3SLinus Walleij 	NOMADIK_GPIO1_BASE,
56056c78d3SLinus Walleij 	NOMADIK_GPIO2_BASE,
57056c78d3SLinus Walleij 	NOMADIK_GPIO3_BASE,
58056c78d3SLinus Walleij };
59056c78d3SLinus Walleij 
60056c78d3SLinus Walleij static struct platform_device *
61056c78d3SLinus Walleij cpu8815_add_gpio(int id, resource_size_t addr, int irq,
62056c78d3SLinus Walleij 		 struct nmk_gpio_platform_data *pdata)
63056c78d3SLinus Walleij {
64056c78d3SLinus Walleij 	struct resource resources[] = {
65056c78d3SLinus Walleij 		{
66056c78d3SLinus Walleij 			.start	= addr,
67056c78d3SLinus Walleij 			.end	= addr + 127,
68056c78d3SLinus Walleij 			.flags	= IORESOURCE_MEM,
69056c78d3SLinus Walleij 		},
70056c78d3SLinus Walleij 		{
71056c78d3SLinus Walleij 			.start	= irq,
72056c78d3SLinus Walleij 			.end	= irq,
73056c78d3SLinus Walleij 			.flags	= IORESOURCE_IRQ,
74056c78d3SLinus Walleij 		}
75056c78d3SLinus Walleij 	};
76056c78d3SLinus Walleij 
77056c78d3SLinus Walleij 	return platform_device_register_resndata(NULL, "gpio", id,
78056c78d3SLinus Walleij 				resources, ARRAY_SIZE(resources),
79056c78d3SLinus Walleij 				pdata, sizeof(*pdata));
80056c78d3SLinus Walleij }
81056c78d3SLinus Walleij 
82056c78d3SLinus Walleij void cpu8815_add_gpios(resource_size_t *base, int num, int irq,
83056c78d3SLinus Walleij 		       struct nmk_gpio_platform_data *pdata)
84056c78d3SLinus Walleij {
85056c78d3SLinus Walleij 	int first = 0;
86056c78d3SLinus Walleij 	int i;
87056c78d3SLinus Walleij 
88056c78d3SLinus Walleij 	for (i = 0; i < num; i++, first += 32, irq++) {
89056c78d3SLinus Walleij 		pdata->first_gpio = first;
90056c78d3SLinus Walleij 		pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first);
91056c78d3SLinus Walleij 		pdata->num_gpio = 32;
92056c78d3SLinus Walleij 
93056c78d3SLinus Walleij 		cpu8815_add_gpio(i, base[i], irq, pdata);
94056c78d3SLinus Walleij 	}
95056c78d3SLinus Walleij }
96056c78d3SLinus Walleij 
971b542757SLinus Walleij static unsigned long out_low[] = { PIN_OUTPUT_LOW };
981b542757SLinus Walleij static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
991b542757SLinus Walleij static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
1001b542757SLinus Walleij static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
1011b542757SLinus Walleij 
1021b542757SLinus Walleij static struct pinctrl_map __initdata nhk8815_pinmap[] = {
1031b542757SLinus Walleij 	PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
1041b542757SLinus Walleij 	PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
1051b542757SLinus Walleij 	/* Hog in MMC/SD card mux */
1061b542757SLinus Walleij 	PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
1071b542757SLinus Walleij 	/* MCCLK */
1081b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
1091b542757SLinus Walleij 	/* MCCMD */
1101b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
1111b542757SLinus Walleij 	/* MCCMDDIR */
1121b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
1131b542757SLinus Walleij 	/* MCDAT3-0 */
1141b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
1151b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
1161b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
1171b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
1181b542757SLinus Walleij 	/* MCDAT0DIR */
1191b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
1201b542757SLinus Walleij 	/* MCDAT31DIR */
1211b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
1221b542757SLinus Walleij 	/* MCMSFBCLK */
1231b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
1241b542757SLinus Walleij 	/* CD input GPIO */
1251b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
1261b542757SLinus Walleij 	/* CD bias drive */
1271b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
1281b542757SLinus Walleij 	/* I2C0 */
1291b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO62_D3", in_pullup),
1301b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO63_D2", in_pullup),
1311b542757SLinus Walleij 	/* I2C1 */
1321b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO53_L4", in_pullup),
1331b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO54_L3", in_pullup),
1341b542757SLinus Walleij 	/* I2C2 */
1351b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO73_C21", in_pullup),
1361b542757SLinus Walleij 	PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup),
1371b542757SLinus Walleij };
1381b542757SLinus Walleij 
1392601ccfeSLinus Walleij static inline void
1402601ccfeSLinus Walleij cpu8815_add_pinctrl(struct device *parent, const char *name)
1412601ccfeSLinus Walleij {
1422601ccfeSLinus Walleij 	struct platform_device_info pdevinfo = {
1432601ccfeSLinus Walleij 		.parent = parent,
1442601ccfeSLinus Walleij 		.name = name,
1452601ccfeSLinus Walleij 		.id = -1,
1462601ccfeSLinus Walleij 	};
1472601ccfeSLinus Walleij 
1481b542757SLinus Walleij 	pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
1492601ccfeSLinus Walleij 	platform_device_register_full(&pdevinfo);
1502601ccfeSLinus Walleij }
1512601ccfeSLinus Walleij 
1522ec1d359SAlessandro Rubini static int __init cpu8815_init(void)
1532ec1d359SAlessandro Rubini {
154056c78d3SLinus Walleij 	struct nmk_gpio_platform_data pdata = {
155056c78d3SLinus Walleij 		/* No custom data yet */
156056c78d3SLinus Walleij 	};
1572ec1d359SAlessandro Rubini 
1586010d403SLinus Walleij 	/* For e.g. device tree boots */
1596010d403SLinus Walleij 	if (!machine_is_nomadik())
1606010d403SLinus Walleij 		return 0;
1616010d403SLinus Walleij 
162056c78d3SLinus Walleij 	cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base),
163056c78d3SLinus Walleij 			  IRQ_GPIO0, &pdata);
1642601ccfeSLinus Walleij 	cpu8815_add_pinctrl(NULL, "pinctrl-stn8815");
1657c77852dSLinus Walleij 	amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0);
166b5111d9eSLinus Walleij 	amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0);
1672ec1d359SAlessandro Rubini 	return 0;
1682ec1d359SAlessandro Rubini }
1692ec1d359SAlessandro Rubini arch_initcall(cpu8815_init);
1702ec1d359SAlessandro Rubini 
17128ad94ecSAlessandro Rubini /* All SoC devices live in the same area (see hardware.h) */
17228ad94ecSAlessandro Rubini static struct map_desc nomadik_io_desc[] __initdata = {
17328ad94ecSAlessandro Rubini 	{
17428ad94ecSAlessandro Rubini 		.virtual =	NOMADIK_IO_VIRTUAL,
17528ad94ecSAlessandro Rubini 		.pfn =		__phys_to_pfn(NOMADIK_IO_PHYSICAL),
17628ad94ecSAlessandro Rubini 		.length =	NOMADIK_IO_SIZE,
17728ad94ecSAlessandro Rubini 		.type = 	MT_DEVICE,
17828ad94ecSAlessandro Rubini 	}
17928ad94ecSAlessandro Rubini 	/* static ram and secured ram may be added later */
18028ad94ecSAlessandro Rubini };
18128ad94ecSAlessandro Rubini 
18228ad94ecSAlessandro Rubini void __init cpu8815_map_io(void)
18328ad94ecSAlessandro Rubini {
18428ad94ecSAlessandro Rubini 	iotable_init(nomadik_io_desc, ARRAY_SIZE(nomadik_io_desc));
18528ad94ecSAlessandro Rubini }
18628ad94ecSAlessandro Rubini 
18728ad94ecSAlessandro Rubini void __init cpu8815_init_irq(void)
18828ad94ecSAlessandro Rubini {
18928ad94ecSAlessandro Rubini 	/* This modified VIC cell has two register blocks, at 0 and 0x20 */
19028ad94ecSAlessandro Rubini 	vic_init(io_p2v(NOMADIK_IC_BASE + 0x00), IRQ_VIC_START +  0, ~0, 0);
19128ad94ecSAlessandro Rubini 	vic_init(io_p2v(NOMADIK_IC_BASE + 0x20), IRQ_VIC_START + 32, ~0, 0);
192ba327b1eSLinus Walleij 
193ba327b1eSLinus Walleij 	/*
194ba327b1eSLinus Walleij 	 * Init clocks here so that they are available for system timer
195ba327b1eSLinus Walleij 	 * initialization.
196ba327b1eSLinus Walleij 	 */
1974a31bd28SLinus Walleij 	nomadik_clk_init();
19828ad94ecSAlessandro Rubini }
19928ad94ecSAlessandro Rubini 
20028ad94ecSAlessandro Rubini /*
20128ad94ecSAlessandro Rubini  * This function is called from the board init ("init_machine").
20228ad94ecSAlessandro Rubini  */
20328ad94ecSAlessandro Rubini  void __init cpu8815_platform_init(void)
20428ad94ecSAlessandro Rubini {
2050b260fd4SAlessandro Rubini #ifdef CONFIG_CACHE_L2X0
2060b260fd4SAlessandro Rubini 	/* At full speed latency must be >=2, so 0x249 in low bits */
2070b260fd4SAlessandro Rubini 	l2x0_init(io_p2v(NOMADIK_L2CC_BASE), 0x00730249, 0xfe000fff);
2080b260fd4SAlessandro Rubini #endif
20928ad94ecSAlessandro Rubini 	 return;
21028ad94ecSAlessandro Rubini }
21135b47a40SRussell King 
21235b47a40SRussell King void cpu8815_restart(char mode, const char *cmd)
21335b47a40SRussell King {
21435b47a40SRussell King 	void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
21535b47a40SRussell King 
21635b47a40SRussell King 	/* FIXME: use egpio when implemented */
21735b47a40SRussell King 
21835b47a40SRussell King 	/* Write anything to Reset status register */
21935b47a40SRussell King 	writel(1, src_rstsr);
22035b47a40SRussell King }
221f8635abdSLinus Walleij 
222f8635abdSLinus Walleij #ifdef CONFIG_OF
223f8635abdSLinus Walleij 
224f8635abdSLinus Walleij /* Initial value for SRC control register: all timers use MXTAL/8 source */
225f8635abdSLinus Walleij #define SRC_CR_INIT_MASK	0x00007fff
226f8635abdSLinus Walleij #define SRC_CR_INIT_VAL		0x2aaa8000
227f8635abdSLinus Walleij 
228f8635abdSLinus Walleij static void __init cpu8815_timer_init_of(void)
229f8635abdSLinus Walleij {
230f8635abdSLinus Walleij 	struct device_node *mtu;
231f8635abdSLinus Walleij 	void __iomem *base;
232f8635abdSLinus Walleij 	int irq;
233f8635abdSLinus Walleij 	u32 src_cr;
234f8635abdSLinus Walleij 
235f8635abdSLinus Walleij 	/* We need this to be up now */
236f8635abdSLinus Walleij 	nomadik_clk_init();
237f8635abdSLinus Walleij 
238f8635abdSLinus Walleij 	mtu = of_find_node_by_path("/mtu0");
239f8635abdSLinus Walleij 	if (!mtu)
240f8635abdSLinus Walleij 		return;
241f8635abdSLinus Walleij 	base = of_iomap(mtu, 0);
242f8635abdSLinus Walleij 	if (WARN_ON(!base))
243f8635abdSLinus Walleij 		return;
244f8635abdSLinus Walleij 	irq = irq_of_parse_and_map(mtu, 0);
245f8635abdSLinus Walleij 
246f8635abdSLinus Walleij 	pr_info("Remapped MTU @ %p, irq: %d\n", base, irq);
247f8635abdSLinus Walleij 
248f8635abdSLinus Walleij 	/* Configure timer sources in "system reset controller" ctrl reg */
249f8635abdSLinus Walleij 	src_cr = readl(base);
250f8635abdSLinus Walleij 	src_cr &= SRC_CR_INIT_MASK;
251f8635abdSLinus Walleij 	src_cr |= SRC_CR_INIT_VAL;
252f8635abdSLinus Walleij 	writel(src_cr, base);
253f8635abdSLinus Walleij 
254f8635abdSLinus Walleij 	nmdk_timer_init(base, irq);
255f8635abdSLinus Walleij }
256f8635abdSLinus Walleij 
257ba785205SLinus Walleij static struct fsmc_nand_timings cpu8815_nand_timings = {
258ba785205SLinus Walleij 	.thiz	= 0,
259ba785205SLinus Walleij 	.thold	= 0x10,
260ba785205SLinus Walleij 	.twait	= 0x0A,
261ba785205SLinus Walleij 	.tset	= 0,
262ba785205SLinus Walleij };
263ba785205SLinus Walleij 
264ba785205SLinus Walleij static struct fsmc_nand_platform_data cpu8815_nand_data = {
265ba785205SLinus Walleij 	.nand_timings = &cpu8815_nand_timings,
266ba785205SLinus Walleij };
267ba785205SLinus Walleij 
2682ad6e398SLinus Walleij /*
2692ad6e398SLinus Walleij  * The SMSC911x IRQ is connected to a GPIO pin, but the driver expects
2702ad6e398SLinus Walleij  * to simply request an IRQ passed as a resource. So the GPIO pin needs
2712ad6e398SLinus Walleij  * to be requested by this hog and set as input.
2722ad6e398SLinus Walleij  */
2732ad6e398SLinus Walleij static int __init cpu8815_eth_init(void)
2742ad6e398SLinus Walleij {
2752ad6e398SLinus Walleij 	struct device_node *eth;
2762ad6e398SLinus Walleij 	int gpio, irq, err;
2772ad6e398SLinus Walleij 
2782ad6e398SLinus Walleij 	eth = of_find_node_by_path("/usb-s8815/ethernet-gpio");
2792ad6e398SLinus Walleij 	if (!eth) {
2802ad6e398SLinus Walleij 		pr_info("could not find any ethernet GPIO\n");
2812ad6e398SLinus Walleij 		return 0;
2822ad6e398SLinus Walleij 	}
2832ad6e398SLinus Walleij 	gpio = of_get_gpio(eth, 0);
2842ad6e398SLinus Walleij 	err = gpio_request(gpio, "eth_irq");
2852ad6e398SLinus Walleij 	if (err) {
2862ad6e398SLinus Walleij 		pr_info("failed to request ethernet GPIO\n");
2872ad6e398SLinus Walleij 		return -ENODEV;
2882ad6e398SLinus Walleij 	}
2892ad6e398SLinus Walleij 	err = gpio_direction_input(gpio);
2902ad6e398SLinus Walleij 	if (err) {
2912ad6e398SLinus Walleij 		pr_info("failed to set ethernet GPIO as input\n");
2922ad6e398SLinus Walleij 		return -ENODEV;
2932ad6e398SLinus Walleij 	}
2942ad6e398SLinus Walleij 	irq = gpio_to_irq(gpio);
2952ad6e398SLinus Walleij 	pr_info("enabled USB-S8815 ethernet GPIO %d, IRQ %d\n", gpio, irq);
2962ad6e398SLinus Walleij 	return 0;
2972ad6e398SLinus Walleij }
2982ad6e398SLinus Walleij device_initcall(cpu8815_eth_init);
2992ad6e398SLinus Walleij 
300f8635abdSLinus Walleij /* These are mostly to get the right device names for the clock lookups */
301f8635abdSLinus Walleij static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
3026010d403SLinus Walleij 	OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE,
3036010d403SLinus Walleij 		"gpio.0", NULL),
3046010d403SLinus Walleij 	OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO1_BASE,
3056010d403SLinus Walleij 		"gpio.1", NULL),
3066010d403SLinus Walleij 	OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO2_BASE,
3076010d403SLinus Walleij 		"gpio.2", NULL),
3086010d403SLinus Walleij 	OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO3_BASE,
3096010d403SLinus Walleij 		"gpio.3", NULL),
3106010d403SLinus Walleij 	OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0,
3116010d403SLinus Walleij 		"pinctrl-stn8815", NULL),
312f8635abdSLinus Walleij 	OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE,
313f8635abdSLinus Walleij 		"uart0", NULL),
314f8635abdSLinus Walleij 	OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART1_BASE,
315f8635abdSLinus Walleij 		"uart1", NULL),
31627bda036SLinus Walleij 	OF_DEV_AUXDATA("arm,primecell", NOMADIK_RNG_BASE,
31727bda036SLinus Walleij 		"rng", NULL),
31827bda036SLinus Walleij 	OF_DEV_AUXDATA("arm,primecell", NOMADIK_RTC_BASE,
31927bda036SLinus Walleij 		"rtc-pl031", NULL),
320ba785205SLinus Walleij 	OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
321ba785205SLinus Walleij 		"fsmc-nand", &cpu8815_nand_data),
322ba785205SLinus Walleij 
323f8635abdSLinus Walleij 	{ /* sentinel */ },
324f8635abdSLinus Walleij };
325f8635abdSLinus Walleij 
326f8635abdSLinus Walleij static void __init cpu8815_init_of(void)
327f8635abdSLinus Walleij {
328f8635abdSLinus Walleij #ifdef CONFIG_CACHE_L2X0
329f8635abdSLinus Walleij 	/* At full speed latency must be >=2, so 0x249 in low bits */
330f8635abdSLinus Walleij 	l2x0_of_init(0x00730249, 0xfe000fff);
331f8635abdSLinus Walleij #endif
3326010d403SLinus Walleij 	pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
333f8635abdSLinus Walleij 	of_platform_populate(NULL, of_default_bus_match_table,
334f8635abdSLinus Walleij 			cpu8815_auxdata_lookup, NULL);
335f8635abdSLinus Walleij }
336f8635abdSLinus Walleij 
337f8635abdSLinus Walleij static const char * cpu8815_board_compat[] = {
338f8635abdSLinus Walleij 	"calaosystems,usb-s8815",
339f8635abdSLinus Walleij 	NULL,
340f8635abdSLinus Walleij };
341f8635abdSLinus Walleij 
342f8635abdSLinus Walleij DT_MACHINE_START(NOMADIK_DT, "Nomadik STn8815")
343f8635abdSLinus Walleij 	.map_io		= cpu8815_map_io,
344f8635abdSLinus Walleij 	.init_irq	= irqchip_init,
345f8635abdSLinus Walleij 	.init_time	= cpu8815_timer_init_of,
346f8635abdSLinus Walleij 	.init_machine	= cpu8815_init_of,
347f8635abdSLinus Walleij 	.restart	= cpu8815_restart,
348f8635abdSLinus Walleij 	.dt_compat      = cpu8815_board_compat,
349f8635abdSLinus Walleij MACHINE_END
350f8635abdSLinus Walleij 
351f8635abdSLinus Walleij #endif
352