xref: /openbmc/u-boot/arch/arm/mach-orion5x/cpu.c (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
23e93b4e6SMasahiro Yamada /*
33e93b4e6SMasahiro Yamada  * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
43e93b4e6SMasahiro Yamada  *
53e93b4e6SMasahiro Yamada  * Based on original Kirkwood support which is
63e93b4e6SMasahiro Yamada  * (C) Copyright 2009
73e93b4e6SMasahiro Yamada  * Marvell Semiconductor <www.marvell.com>
83e93b4e6SMasahiro Yamada  * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
93e93b4e6SMasahiro Yamada  */
103e93b4e6SMasahiro Yamada 
113e93b4e6SMasahiro Yamada #include <common.h>
123e93b4e6SMasahiro Yamada #include <netdev.h>
133e93b4e6SMasahiro Yamada #include <asm/cache.h>
143e93b4e6SMasahiro Yamada #include <asm/io.h>
153e93b4e6SMasahiro Yamada #include <u-boot/md5.h>
163e93b4e6SMasahiro Yamada #include <asm/arch/cpu.h>
173e93b4e6SMasahiro Yamada 
183e93b4e6SMasahiro Yamada #define BUFLEN	16
193e93b4e6SMasahiro Yamada 
reset_cpu(unsigned long ignored)203e93b4e6SMasahiro Yamada void reset_cpu(unsigned long ignored)
213e93b4e6SMasahiro Yamada {
223e93b4e6SMasahiro Yamada 	struct orion5x_cpu_registers *cpureg =
233e93b4e6SMasahiro Yamada 	    (struct orion5x_cpu_registers *)ORION5X_CPU_REG_BASE;
243e93b4e6SMasahiro Yamada 
253e93b4e6SMasahiro Yamada 	writel(readl(&cpureg->rstoutn_mask) | (1 << 2),
263e93b4e6SMasahiro Yamada 		&cpureg->rstoutn_mask);
273e93b4e6SMasahiro Yamada 	writel(readl(&cpureg->sys_soft_rst) | 1,
283e93b4e6SMasahiro Yamada 		&cpureg->sys_soft_rst);
293e93b4e6SMasahiro Yamada 	while (1)
303e93b4e6SMasahiro Yamada 		;
313e93b4e6SMasahiro Yamada }
323e93b4e6SMasahiro Yamada 
333e93b4e6SMasahiro Yamada /*
343e93b4e6SMasahiro Yamada  * Compute Window Size field value from size expressed in bytes
353e93b4e6SMasahiro Yamada  * Used with the Base register to set the address window size and location.
363e93b4e6SMasahiro Yamada  * Must be programmed from LSB to MSB as sequence of ones followed by
373e93b4e6SMasahiro Yamada  * sequence of zeros. The number of ones specifies the size of the window in
383e93b4e6SMasahiro Yamada  * 64 KiB granularity (e.g., a value of 0x00FF specifies 256 = 16 MiB).
393e93b4e6SMasahiro Yamada  * NOTES:
403e93b4e6SMasahiro Yamada  * 1) A sizeval equal to 0x0 specifies 4 GiB.
413e93b4e6SMasahiro Yamada  * 2) A return value of 0x0 specifies 64 KiB.
423e93b4e6SMasahiro Yamada  */
orion5x_winctrl_calcsize(unsigned int sizeval)433e93b4e6SMasahiro Yamada unsigned int orion5x_winctrl_calcsize(unsigned int sizeval)
443e93b4e6SMasahiro Yamada {
453e93b4e6SMasahiro Yamada 	/*
463e93b4e6SMasahiro Yamada 	 * Calculate the number of 64 KiB blocks needed minus one (rounding up).
473e93b4e6SMasahiro Yamada 	 * For sizeval > 0 this is equivalent to:
483e93b4e6SMasahiro Yamada 	 * sizeval = (u32) ceil((double) sizeval / 65536.0) - 1
493e93b4e6SMasahiro Yamada 	 */
503e93b4e6SMasahiro Yamada 	sizeval = (sizeval - 1) >> 16;
513e93b4e6SMasahiro Yamada 
523e93b4e6SMasahiro Yamada 	/*
533e93b4e6SMasahiro Yamada 	 * Propagate 'one' bits to the right by 'oring' them.
543e93b4e6SMasahiro Yamada 	 * We need only treat bits 15-0.
553e93b4e6SMasahiro Yamada 	 */
563e93b4e6SMasahiro Yamada 	sizeval |= sizeval >> 1;  /* 'Or' bit 15 onto bit 14 */
573e93b4e6SMasahiro Yamada 	sizeval |= sizeval >> 2;  /* 'Or' bits 15-14 onto bits 13-12 */
583e93b4e6SMasahiro Yamada 	sizeval |= sizeval >> 4;  /* 'Or' bits 15-12 onto bits 11-8 */
593e93b4e6SMasahiro Yamada 	sizeval |= sizeval >> 8;  /* 'Or' bits 15-8 onto bits 7-0*/
603e93b4e6SMasahiro Yamada 
613e93b4e6SMasahiro Yamada 	return sizeval;
623e93b4e6SMasahiro Yamada }
633e93b4e6SMasahiro Yamada 
643e93b4e6SMasahiro Yamada /*
653e93b4e6SMasahiro Yamada  * orion5x_config_adr_windows - Configure address Windows
663e93b4e6SMasahiro Yamada  *
673e93b4e6SMasahiro Yamada  * There are 8 address windows supported by Orion5x Soc to addess different
683e93b4e6SMasahiro Yamada  * devices. Each window can be configured for size, BAR and remap addr
693e93b4e6SMasahiro Yamada  * Below configuration is standard for most of the cases
703e93b4e6SMasahiro Yamada  *
713e93b4e6SMasahiro Yamada  * If remap function not used, remap_lo must be set as base
723e93b4e6SMasahiro Yamada  *
733e93b4e6SMasahiro Yamada  * NOTES:
743e93b4e6SMasahiro Yamada  *
753e93b4e6SMasahiro Yamada  * 1) in order to avoid windows with inconsistent control and base values
763e93b4e6SMasahiro Yamada  *    (which could prevent access to BOOTCS and hence execution from FLASH)
773e93b4e6SMasahiro Yamada  *    always disable window before writing the base value then reenable it
783e93b4e6SMasahiro Yamada  *    by writing the control value.
793e93b4e6SMasahiro Yamada  *
803e93b4e6SMasahiro Yamada  * 2) in order to avoid losing access to BOOTCS when disabling window 7,
813e93b4e6SMasahiro Yamada  *    first configure window 6 for BOOTCS, then configure window 7 for BOOTCS,
823e93b4e6SMasahiro Yamada  *    then configure windows 6 for its own target.
833e93b4e6SMasahiro Yamada  *
843e93b4e6SMasahiro Yamada  * Reference Documentation:
853e93b4e6SMasahiro Yamada  * Mbus-L to Mbus Bridge Registers Configuration.
863e93b4e6SMasahiro Yamada  * (Sec 25.1 and 25.3 of Datasheet)
873e93b4e6SMasahiro Yamada  */
orion5x_config_adr_windows(void)883e93b4e6SMasahiro Yamada int orion5x_config_adr_windows(void)
893e93b4e6SMasahiro Yamada {
903e93b4e6SMasahiro Yamada 	struct orion5x_win_registers *winregs =
913e93b4e6SMasahiro Yamada 		(struct orion5x_win_registers *)ORION5X_CPU_WIN_BASE;
923e93b4e6SMasahiro Yamada 
933e93b4e6SMasahiro Yamada /* Disable window 0, configure it for its intended target, enable it. */
943e93b4e6SMasahiro Yamada 	writel(0, &winregs[0].ctrl);
953e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_PCIE_MEM, &winregs[0].base);
963e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_PCIE_MEM_REMAP_LO, &winregs[0].remap_lo);
973e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_PCIE_MEM_REMAP_HI, &winregs[0].remap_hi);
983e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_PCIE_MEM,
993e93b4e6SMasahiro Yamada 		ORION5X_TARGET_PCIE, ORION5X_ATTR_PCIE_MEM,
1003e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[0].ctrl);
1013e93b4e6SMasahiro Yamada /* Disable window 1, configure it for its intended target, enable it. */
1023e93b4e6SMasahiro Yamada 	writel(0, &winregs[1].ctrl);
1033e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_PCIE_IO, &winregs[1].base);
1043e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_PCIE_IO_REMAP_LO, &winregs[1].remap_lo);
1053e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_PCIE_IO_REMAP_HI, &winregs[1].remap_hi);
1063e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_PCIE_IO,
1073e93b4e6SMasahiro Yamada 		ORION5X_TARGET_PCIE, ORION5X_ATTR_PCIE_IO,
1083e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[1].ctrl);
1093e93b4e6SMasahiro Yamada /* Disable window 2, configure it for its intended target, enable it. */
1103e93b4e6SMasahiro Yamada 	writel(0, &winregs[2].ctrl);
1113e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_PCI_MEM, &winregs[2].base);
1123e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_PCI_MEM,
1133e93b4e6SMasahiro Yamada 		ORION5X_TARGET_PCI, ORION5X_ATTR_PCI_MEM,
1143e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[2].ctrl);
1153e93b4e6SMasahiro Yamada /* Disable window 3, configure it for its intended target, enable it. */
1163e93b4e6SMasahiro Yamada 	writel(0, &winregs[3].ctrl);
1173e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_PCI_IO, &winregs[3].base);
1183e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_PCI_IO,
1193e93b4e6SMasahiro Yamada 		ORION5X_TARGET_PCI, ORION5X_ATTR_PCI_IO,
1203e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[3].ctrl);
1213e93b4e6SMasahiro Yamada /* Disable window 4, configure it for its intended target, enable it. */
1223e93b4e6SMasahiro Yamada 	writel(0, &winregs[4].ctrl);
1233e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_DEV_CS0, &winregs[4].base);
1243e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_DEV_CS0,
1253e93b4e6SMasahiro Yamada 		ORION5X_TARGET_DEVICE, ORION5X_ATTR_DEV_CS0,
1263e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[4].ctrl);
1273e93b4e6SMasahiro Yamada /* Disable window 5, configure it for its intended target, enable it. */
1283e93b4e6SMasahiro Yamada 	writel(0, &winregs[5].ctrl);
1293e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_DEV_CS1, &winregs[5].base);
1303e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_DEV_CS1,
1313e93b4e6SMasahiro Yamada 		ORION5X_TARGET_DEVICE, ORION5X_ATTR_DEV_CS1,
1323e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[5].ctrl);
1333e93b4e6SMasahiro Yamada /* Disable window 6, configure it for FLASH, enable it. */
1343e93b4e6SMasahiro Yamada 	writel(0, &winregs[6].ctrl);
1353e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_BOOTROM, &winregs[6].base);
1363e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_BOOTROM,
1373e93b4e6SMasahiro Yamada 		ORION5X_TARGET_DEVICE, ORION5X_ATTR_BOOTROM,
1383e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[6].ctrl);
1393e93b4e6SMasahiro Yamada /* Disable window 7, configure it for FLASH, enable it. */
1403e93b4e6SMasahiro Yamada 	writel(0, &winregs[7].ctrl);
1413e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_BOOTROM, &winregs[7].base);
1423e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_BOOTROM,
1433e93b4e6SMasahiro Yamada 		ORION5X_TARGET_DEVICE, ORION5X_ATTR_BOOTROM,
1443e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[7].ctrl);
1453e93b4e6SMasahiro Yamada /* Disable window 6, configure it for its intended target, enable it. */
1463e93b4e6SMasahiro Yamada 	writel(0, &winregs[6].ctrl);
1473e93b4e6SMasahiro Yamada 	writel(ORION5X_ADR_DEV_CS2, &winregs[6].base);
1483e93b4e6SMasahiro Yamada 	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_DEV_CS2,
1493e93b4e6SMasahiro Yamada 		ORION5X_TARGET_DEVICE, ORION5X_ATTR_DEV_CS2,
1503e93b4e6SMasahiro Yamada 		ORION5X_WIN_ENABLE), &winregs[6].ctrl);
1513e93b4e6SMasahiro Yamada 
1523e93b4e6SMasahiro Yamada 	return 0;
1533e93b4e6SMasahiro Yamada }
1543e93b4e6SMasahiro Yamada 
1553e93b4e6SMasahiro Yamada /*
1563e93b4e6SMasahiro Yamada  * Orion5x identification is done through PCIE space.
1573e93b4e6SMasahiro Yamada  */
1583e93b4e6SMasahiro Yamada 
orion5x_device_id(void)1593e93b4e6SMasahiro Yamada u32 orion5x_device_id(void)
1603e93b4e6SMasahiro Yamada {
1613e93b4e6SMasahiro Yamada 	return readl(PCIE_DEV_ID_OFF) >> 16;
1623e93b4e6SMasahiro Yamada }
1633e93b4e6SMasahiro Yamada 
orion5x_device_rev(void)1643e93b4e6SMasahiro Yamada u32 orion5x_device_rev(void)
1653e93b4e6SMasahiro Yamada {
1663e93b4e6SMasahiro Yamada 	return readl(PCIE_DEV_REV_OFF) & 0xff;
1673e93b4e6SMasahiro Yamada }
1683e93b4e6SMasahiro Yamada 
1693e93b4e6SMasahiro Yamada #if defined(CONFIG_DISPLAY_CPUINFO)
1703e93b4e6SMasahiro Yamada 
1713e93b4e6SMasahiro Yamada /* Display device and revision IDs.
1723e93b4e6SMasahiro Yamada  * This function must cover all known device/revision
1733e93b4e6SMasahiro Yamada  * combinations, not only the one for which u-boot is
1743e93b4e6SMasahiro Yamada  * compiled; this way, one can identify actual HW in
1753e93b4e6SMasahiro Yamada  * case of a mismatch.
1763e93b4e6SMasahiro Yamada  */
print_cpuinfo(void)1773e93b4e6SMasahiro Yamada int print_cpuinfo(void)
1783e93b4e6SMasahiro Yamada {
1793e93b4e6SMasahiro Yamada 	char dev_str[7]; /* room enough for 0x0000 plus null byte */
1803e93b4e6SMasahiro Yamada 	char rev_str[5]; /* room enough for 0x00 plus null byte */
1813e93b4e6SMasahiro Yamada 	char *dev_name = NULL;
1823e93b4e6SMasahiro Yamada 	char *rev_name = NULL;
1833e93b4e6SMasahiro Yamada 
1843e93b4e6SMasahiro Yamada 	u32 dev = orion5x_device_id();
1853e93b4e6SMasahiro Yamada 	u32 rev = orion5x_device_rev();
1863e93b4e6SMasahiro Yamada 
1873e93b4e6SMasahiro Yamada 	if (dev == MV88F5181_DEV_ID) {
1883e93b4e6SMasahiro Yamada 		dev_name = "MV88F5181";
1893e93b4e6SMasahiro Yamada 		if (rev == MV88F5181_REV_B1)
1903e93b4e6SMasahiro Yamada 			rev_name = "B1";
1913e93b4e6SMasahiro Yamada 		else if (rev == MV88F5181L_REV_A1) {
1923e93b4e6SMasahiro Yamada 			dev_name = "MV88F5181L";
1933e93b4e6SMasahiro Yamada 			rev_name = "A1";
1943e93b4e6SMasahiro Yamada 		} else if (rev == MV88F5181L_REV_A0) {
1953e93b4e6SMasahiro Yamada 			dev_name = "MV88F5181L";
1963e93b4e6SMasahiro Yamada 			rev_name = "A0";
1973e93b4e6SMasahiro Yamada 		}
1983e93b4e6SMasahiro Yamada 	} else if (dev == MV88F5182_DEV_ID) {
1993e93b4e6SMasahiro Yamada 		dev_name = "MV88F5182";
2003e93b4e6SMasahiro Yamada 		if (rev == MV88F5182_REV_A2)
2013e93b4e6SMasahiro Yamada 			rev_name = "A2";
2023e93b4e6SMasahiro Yamada 	} else if (dev == MV88F5281_DEV_ID) {
2033e93b4e6SMasahiro Yamada 		dev_name = "MV88F5281";
2043e93b4e6SMasahiro Yamada 		if (rev == MV88F5281_REV_D2)
2053e93b4e6SMasahiro Yamada 			rev_name = "D2";
2063e93b4e6SMasahiro Yamada 		else if (rev == MV88F5281_REV_D1)
2073e93b4e6SMasahiro Yamada 			rev_name = "D1";
2083e93b4e6SMasahiro Yamada 		else if (rev == MV88F5281_REV_D0)
2093e93b4e6SMasahiro Yamada 			rev_name = "D0";
2103e93b4e6SMasahiro Yamada 	} else if (dev == MV88F6183_DEV_ID) {
2113e93b4e6SMasahiro Yamada 		dev_name = "MV88F6183";
2123e93b4e6SMasahiro Yamada 		if (rev == MV88F6183_REV_B0)
2133e93b4e6SMasahiro Yamada 			rev_name = "B0";
2143e93b4e6SMasahiro Yamada 	}
2153e93b4e6SMasahiro Yamada 	if (dev_name == NULL) {
2163e93b4e6SMasahiro Yamada 		sprintf(dev_str, "0x%04x", dev);
2173e93b4e6SMasahiro Yamada 		dev_name = dev_str;
2183e93b4e6SMasahiro Yamada 	}
2193e93b4e6SMasahiro Yamada 	if (rev_name == NULL) {
2203e93b4e6SMasahiro Yamada 		sprintf(rev_str, "0x%02x", rev);
2213e93b4e6SMasahiro Yamada 		rev_name = rev_str;
2223e93b4e6SMasahiro Yamada 	}
2233e93b4e6SMasahiro Yamada 
2243e93b4e6SMasahiro Yamada 	printf("SoC:   Orion5x %s-%s\n", dev_name, rev_name);
2253e93b4e6SMasahiro Yamada 
2263e93b4e6SMasahiro Yamada 	return 0;
2273e93b4e6SMasahiro Yamada }
2283e93b4e6SMasahiro Yamada #endif /* CONFIG_DISPLAY_CPUINFO */
2293e93b4e6SMasahiro Yamada 
2303e93b4e6SMasahiro Yamada #ifdef CONFIG_ARCH_CPU_INIT
arch_cpu_init(void)2313e93b4e6SMasahiro Yamada int arch_cpu_init(void)
2323e93b4e6SMasahiro Yamada {
2333e93b4e6SMasahiro Yamada 	/* Enable and invalidate L2 cache in write through mode */
2343e93b4e6SMasahiro Yamada 	invalidate_l2_cache();
2353e93b4e6SMasahiro Yamada 
2369608e7deSAlbert ARIBAUD #ifdef CONFIG_SPL_BUILD
2373e93b4e6SMasahiro Yamada 	orion5x_config_adr_windows();
2389608e7deSAlbert ARIBAUD #endif
2393e93b4e6SMasahiro Yamada 
2403e93b4e6SMasahiro Yamada 	return 0;
2413e93b4e6SMasahiro Yamada }
2423e93b4e6SMasahiro Yamada #endif /* CONFIG_ARCH_CPU_INIT */
2433e93b4e6SMasahiro Yamada 
2443e93b4e6SMasahiro Yamada /*
2453e93b4e6SMasahiro Yamada  * SOC specific misc init
2463e93b4e6SMasahiro Yamada  */
2473e93b4e6SMasahiro Yamada #if defined(CONFIG_ARCH_MISC_INIT)
arch_misc_init(void)2483e93b4e6SMasahiro Yamada int arch_misc_init(void)
2493e93b4e6SMasahiro Yamada {
2503e93b4e6SMasahiro Yamada 	u32 temp;
2513e93b4e6SMasahiro Yamada 
2523e93b4e6SMasahiro Yamada 	/*CPU streaming & write allocate */
2533e93b4e6SMasahiro Yamada 	temp = readfr_extra_feature_reg();
2543e93b4e6SMasahiro Yamada 	temp &= ~(1 << 28);	/* disable wr alloc */
2553e93b4e6SMasahiro Yamada 	writefr_extra_feature_reg(temp);
2563e93b4e6SMasahiro Yamada 
2573e93b4e6SMasahiro Yamada 	temp = readfr_extra_feature_reg();
2583e93b4e6SMasahiro Yamada 	temp &= ~(1 << 29);	/* streaming disabled */
2593e93b4e6SMasahiro Yamada 	writefr_extra_feature_reg(temp);
2603e93b4e6SMasahiro Yamada 
2613e93b4e6SMasahiro Yamada 	/* L2Cache settings */
2623e93b4e6SMasahiro Yamada 	temp = readfr_extra_feature_reg();
2633e93b4e6SMasahiro Yamada 	/* Disable L2C pre fetch - Set bit 24 */
2643e93b4e6SMasahiro Yamada 	temp |= (1 << 24);
2653e93b4e6SMasahiro Yamada 	/* enable L2C - Set bit 22 */
2663e93b4e6SMasahiro Yamada 	temp |= (1 << 22);
2673e93b4e6SMasahiro Yamada 	writefr_extra_feature_reg(temp);
2683e93b4e6SMasahiro Yamada 
2693e93b4e6SMasahiro Yamada 	icache_enable();
2703e93b4e6SMasahiro Yamada 	/* Change reset vector to address 0x0 */
2713e93b4e6SMasahiro Yamada 	temp = get_cr();
2723e93b4e6SMasahiro Yamada 	set_cr(temp & ~CR_V);
2733e93b4e6SMasahiro Yamada 
2743e93b4e6SMasahiro Yamada 	/* Set CPIOs and MPPs - values provided by board
2753e93b4e6SMasahiro Yamada 	   include file */
2763e93b4e6SMasahiro Yamada 	writel(ORION5X_MPP0_7, ORION5X_MPP_BASE+0x00);
2773e93b4e6SMasahiro Yamada 	writel(ORION5X_MPP8_15, ORION5X_MPP_BASE+0x04);
2783e93b4e6SMasahiro Yamada 	writel(ORION5X_MPP16_23, ORION5X_MPP_BASE+0x50);
2793e93b4e6SMasahiro Yamada 	writel(ORION5X_GPIO_OUT_VALUE, ORION5X_GPIO_BASE+0x00);
2803e93b4e6SMasahiro Yamada 	writel(ORION5X_GPIO_OUT_ENABLE, ORION5X_GPIO_BASE+0x04);
2813e93b4e6SMasahiro Yamada 	writel(ORION5X_GPIO_IN_POLARITY, ORION5X_GPIO_BASE+0x0c);
2823e93b4e6SMasahiro Yamada 
2833e93b4e6SMasahiro Yamada 	/* initialize timer */
2843e93b4e6SMasahiro Yamada 	timer_init_r();
2853e93b4e6SMasahiro Yamada 	return 0;
2863e93b4e6SMasahiro Yamada }
2873e93b4e6SMasahiro Yamada #endif /* CONFIG_ARCH_MISC_INIT */
2883e93b4e6SMasahiro Yamada 
2893e93b4e6SMasahiro Yamada #ifdef CONFIG_MVGBE
cpu_eth_init(bd_t * bis)2903e93b4e6SMasahiro Yamada int cpu_eth_init(bd_t *bis)
2913e93b4e6SMasahiro Yamada {
2923e93b4e6SMasahiro Yamada 	mvgbe_initialize(bis);
2933e93b4e6SMasahiro Yamada 	return 0;
2943e93b4e6SMasahiro Yamada }
2953e93b4e6SMasahiro Yamada #endif
296