mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
ARM: Kirkwood: Remove mach-kirkwood
Now that all boards have been converted to DT and all the support code lives in mach-mvebu, we can remove mach-kirkwood. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Link: https://lkml.kernel.org/r/1405028192-9623-2-git-send-email-andrew@lunn.ch Signed-off-by: Jason Cooper <jason@lakedaemon.net>
This commit is contained in:
committed by
Jason Cooper
parent
e65714740d
commit
ba364fc752
@@ -536,22 +536,6 @@ config ARCH_DOVE
|
||||
help
|
||||
Support for the Marvell Dove SoC 88AP510
|
||||
|
||||
config ARCH_KIRKWOOD
|
||||
bool "Marvell Kirkwood"
|
||||
select ARCH_HAS_CPUFREQ
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select CPU_FEROCEON
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select MVEBU_MBUS
|
||||
select PCI
|
||||
select PCI_QUIRKS
|
||||
select PINCTRL
|
||||
select PINCTRL_KIRKWOOD
|
||||
select PLAT_ORION_LEGACY
|
||||
help
|
||||
Support for the following Marvell Kirkwood series SoCs:
|
||||
88F6180, 88F6192 and 88F6281.
|
||||
|
||||
config ARCH_MV78XX0
|
||||
bool "Marvell MV78xx0"
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
@@ -966,8 +950,6 @@ source "arch/arm/mach-ixp4xx/Kconfig"
|
||||
|
||||
source "arch/arm/mach-keystone/Kconfig"
|
||||
|
||||
source "arch/arm/mach-kirkwood/Kconfig"
|
||||
|
||||
source "arch/arm/mach-ks8695/Kconfig"
|
||||
|
||||
source "arch/arm/mach-msm/Kconfig"
|
||||
|
||||
@@ -1033,7 +1033,7 @@ config DEBUG_UART_8250
|
||||
def_bool ARCH_DOVE || ARCH_EBSA110 || \
|
||||
(FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
|
||||
ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
|
||||
ARCH_IOP33X || ARCH_IXP4XX || ARCH_KIRKWOOD || \
|
||||
ARCH_IOP33X || ARCH_IXP4XX || \
|
||||
ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
|
||||
|
||||
config DEBUG_UART_PHYS
|
||||
@@ -1089,7 +1089,7 @@ config DEBUG_UART_PHYS
|
||||
default 0xe0000000 if ARCH_SPEAR13XX
|
||||
default 0xf0000be0 if ARCH_EBSA110
|
||||
default 0xf1012000 if DEBUG_MVEBU_UART_ALTERNATE
|
||||
default 0xf1012000 if ARCH_DOVE || ARCH_KIRKWOOD || ARCH_MV78XX0 || \
|
||||
default 0xf1012000 if ARCH_DOVE || ARCH_MV78XX0 || \
|
||||
ARCH_ORION5X
|
||||
default 0xf7fc9000 if DEBUG_BERLIN_UART
|
||||
default 0xf8b00000 if DEBUG_HI3716_UART
|
||||
@@ -1154,7 +1154,6 @@ config DEBUG_UART_VIRT
|
||||
default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0
|
||||
default 0xfed0c000 if DEBUG_DAVINCI_DA8XX_UART1
|
||||
default 0xfed0d000 if DEBUG_DAVINCI_DA8XX_UART2
|
||||
default 0xfed12000 if ARCH_KIRKWOOD
|
||||
default 0xfed60000 if DEBUG_RK29_UART0
|
||||
default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
|
||||
default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3
|
||||
|
||||
@@ -163,7 +163,6 @@ machine-$(CONFIG_ARCH_IOP32X) += iop32x
|
||||
machine-$(CONFIG_ARCH_IOP33X) += iop33x
|
||||
machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx
|
||||
machine-$(CONFIG_ARCH_KEYSTONE) += keystone
|
||||
machine-$(CONFIG_ARCH_KIRKWOOD) += kirkwood
|
||||
machine-$(CONFIG_ARCH_KS8695) += ks8695
|
||||
machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx
|
||||
machine-$(CONFIG_ARCH_MMP) += mmp
|
||||
|
||||
@@ -90,8 +90,7 @@ dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
|
||||
dtb-$(CONFIG_ARCH_KEYSTONE) += k2hk-evm.dtb \
|
||||
k2l-evm.dtb \
|
||||
k2e-evm.dtb
|
||||
kirkwood := \
|
||||
kirkwood-b3.dtb \
|
||||
dtb-$(CONFIG_MACH_KIRKWOOD) += kirkwood-b3.dtb \
|
||||
kirkwood-cloudbox.dtb \
|
||||
kirkwood-db-88f6281.dtb \
|
||||
kirkwood-db-88f6282.dtb \
|
||||
@@ -150,8 +149,6 @@ kirkwood := \
|
||||
kirkwood-ts219-6282.dtb \
|
||||
kirkwood-ts419-6281.dtb \
|
||||
kirkwood-ts419-6282.dtb
|
||||
dtb-$(CONFIG_ARCH_KIRKWOOD) += $(kirkwood)
|
||||
dtb-$(CONFIG_MACH_KIRKWOOD) += $(kirkwood)
|
||||
dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
|
||||
dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
|
||||
dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
if ARCH_KIRKWOOD
|
||||
|
||||
menu "Marvell Kirkwood Implementations"
|
||||
|
||||
config KIRKWOOD_LEGACY
|
||||
bool
|
||||
|
||||
config MACH_D2NET_V2
|
||||
bool "LaCie d2 Network v2 NAS Board"
|
||||
select KIRKWOOD_LEGACY
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
LaCie d2 Network v2 NAS.
|
||||
|
||||
config MACH_NET2BIG_V2
|
||||
bool "LaCie 2Big Network v2 NAS Board"
|
||||
select KIRKWOOD_LEGACY
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
LaCie 2Big Network v2 NAS.
|
||||
|
||||
config MACH_NET5BIG_V2
|
||||
bool "LaCie 5Big Network v2 NAS Board"
|
||||
select KIRKWOOD_LEGACY
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
LaCie 5Big Network v2 NAS.
|
||||
|
||||
config MACH_OPENRD
|
||||
select KIRKWOOD_LEGACY
|
||||
bool
|
||||
|
||||
config MACH_OPENRD_BASE
|
||||
bool "Marvell OpenRD Base Board"
|
||||
select MACH_OPENRD
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
Marvell OpenRD Base Board.
|
||||
|
||||
config MACH_OPENRD_CLIENT
|
||||
bool "Marvell OpenRD Client Board"
|
||||
select MACH_OPENRD
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
Marvell OpenRD Client Board.
|
||||
|
||||
config MACH_OPENRD_ULTIMATE
|
||||
bool "Marvell OpenRD Ultimate Board"
|
||||
select MACH_OPENRD
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
Marvell OpenRD Ultimate Board.
|
||||
|
||||
config MACH_RD88F6192_NAS
|
||||
bool "Marvell RD-88F6192-NAS Reference Board"
|
||||
select KIRKWOOD_LEGACY
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
Marvell RD-88F6192-NAS Reference Board.
|
||||
|
||||
config MACH_RD88F6281
|
||||
bool "Marvell RD-88F6281 Reference Board"
|
||||
select KIRKWOOD_LEGACY
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
Marvell RD-88F6281 Reference Board.
|
||||
|
||||
config MACH_T5325
|
||||
bool "HP t5325 Thin Client"
|
||||
select KIRKWOOD_LEGACY
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
HP t5325 Thin Client.
|
||||
|
||||
config MACH_TS219
|
||||
bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
|
||||
select KIRKWOOD_LEGACY
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and
|
||||
TS-219P+ Turbo NAS devices.
|
||||
|
||||
config MACH_TS41X
|
||||
bool "QNAP TS-410, TS-410U, TS-419P, TS-419P+ and TS-419U Turbo NAS"
|
||||
select KIRKWOOD_LEGACY
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
QNAP TS-410, TS-410U, TS-419P, TS-419P+ and TS-419U Turbo
|
||||
NAS devices.
|
||||
|
||||
comment "Device tree entries"
|
||||
|
||||
config ARCH_KIRKWOOD_DT
|
||||
bool "Marvell Kirkwood Flattened Device Tree"
|
||||
select KIRKWOOD_CLK
|
||||
select OF_IRQ
|
||||
select ORION_IRQCHIP
|
||||
select ORION_TIMER
|
||||
select POWER_SUPPLY
|
||||
select POWER_RESET
|
||||
select POWER_RESET_GPIO
|
||||
select REGULATOR
|
||||
select REGULATOR_FIXED_VOLTAGE
|
||||
select USE_OF
|
||||
help
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
Marvell Kirkwood using flattened device tree.
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
@@ -1,14 +0,0 @@
|
||||
obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o common.o pcie.o
|
||||
obj-$(CONFIG_PM) += pm.o
|
||||
|
||||
obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
|
||||
obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
|
||||
obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
|
||||
obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o
|
||||
obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
|
||||
obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
|
||||
obj-$(CONFIG_MACH_T5325) += t5325-setup.o
|
||||
obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
|
||||
obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
|
||||
|
||||
obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
|
||||
@@ -1,3 +0,0 @@
|
||||
zreladdr-y += 0x00008000
|
||||
params_phys-y := 0x00000100
|
||||
initrd_phys-y := 0x00800000
|
||||
@@ -1,223 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
|
||||
*
|
||||
* arch/arm/mach-kirkwood/board-dt.c
|
||||
*
|
||||
* Flattened Device Tree board initialization
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_net.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/irqchip.h>
|
||||
#include <asm/hardware/cache-feroceon-l2.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/bridge-regs.h>
|
||||
#include <plat/common.h>
|
||||
#include <plat/pcie.h>
|
||||
#include "pm.h"
|
||||
|
||||
static struct map_desc kirkwood_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE,
|
||||
.pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
|
||||
.length = KIRKWOOD_REGS_SIZE,
|
||||
.type = MT_DEVICE,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init kirkwood_map_io(void)
|
||||
{
|
||||
iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
|
||||
}
|
||||
|
||||
static struct resource kirkwood_cpufreq_resources[] = {
|
||||
[0] = {
|
||||
.start = CPU_CONTROL_PHYS,
|
||||
.end = CPU_CONTROL_PHYS + 3,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device kirkwood_cpufreq_device = {
|
||||
.name = "kirkwood-cpufreq",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources),
|
||||
.resource = kirkwood_cpufreq_resources,
|
||||
};
|
||||
|
||||
static void __init kirkwood_cpufreq_init(void)
|
||||
{
|
||||
platform_device_register(&kirkwood_cpufreq_device);
|
||||
}
|
||||
|
||||
static struct resource kirkwood_cpuidle_resource[] = {
|
||||
{
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = DDR_OPERATION_BASE,
|
||||
.end = DDR_OPERATION_BASE + 3,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device kirkwood_cpuidle = {
|
||||
.name = "kirkwood_cpuidle",
|
||||
.id = -1,
|
||||
.resource = kirkwood_cpuidle_resource,
|
||||
.num_resources = 1,
|
||||
};
|
||||
|
||||
static void __init kirkwood_cpuidle_init(void)
|
||||
{
|
||||
platform_device_register(&kirkwood_cpuidle);
|
||||
}
|
||||
|
||||
/* Temporary here since mach-mvebu has a function we can use */
|
||||
static void kirkwood_restart(enum reboot_mode mode, const char *cmd)
|
||||
{
|
||||
/*
|
||||
* Enable soft reset to assert RSTOUTn.
|
||||
*/
|
||||
writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
|
||||
|
||||
/*
|
||||
* Assert soft reset.
|
||||
*/
|
||||
writel(SOFT_RESET, SYSTEM_SOFT_RESET);
|
||||
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
||||
#define MV643XX_ETH_MAC_ADDR_LOW 0x0414
|
||||
#define MV643XX_ETH_MAC_ADDR_HIGH 0x0418
|
||||
|
||||
static void __init kirkwood_dt_eth_fixup(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
|
||||
/*
|
||||
* The ethernet interfaces forget the MAC address assigned by u-boot
|
||||
* if the clocks are turned off. Usually, u-boot on kirkwood boards
|
||||
* has no DT support to properly set local-mac-address property.
|
||||
* As a workaround, we get the MAC address from mv643xx_eth registers
|
||||
* and update the port device node if no valid MAC address is set.
|
||||
*/
|
||||
for_each_compatible_node(np, NULL, "marvell,kirkwood-eth-port") {
|
||||
struct device_node *pnp = of_get_parent(np);
|
||||
struct clk *clk;
|
||||
struct property *pmac;
|
||||
void __iomem *io;
|
||||
u8 *macaddr;
|
||||
u32 reg;
|
||||
|
||||
if (!pnp)
|
||||
continue;
|
||||
|
||||
/* skip disabled nodes or nodes with valid MAC address*/
|
||||
if (!of_device_is_available(pnp) || of_get_mac_address(np))
|
||||
goto eth_fixup_skip;
|
||||
|
||||
clk = of_clk_get(pnp, 0);
|
||||
if (IS_ERR(clk))
|
||||
goto eth_fixup_skip;
|
||||
|
||||
io = of_iomap(pnp, 0);
|
||||
if (!io)
|
||||
goto eth_fixup_no_map;
|
||||
|
||||
/* ensure port clock is not gated to not hang CPU */
|
||||
clk_prepare_enable(clk);
|
||||
|
||||
/* store MAC address register contents in local-mac-address */
|
||||
pr_err(FW_INFO "%s: local-mac-address is not set\n",
|
||||
np->full_name);
|
||||
|
||||
pmac = kzalloc(sizeof(*pmac) + 6, GFP_KERNEL);
|
||||
if (!pmac)
|
||||
goto eth_fixup_no_mem;
|
||||
|
||||
pmac->value = pmac + 1;
|
||||
pmac->length = 6;
|
||||
pmac->name = kstrdup("local-mac-address", GFP_KERNEL);
|
||||
if (!pmac->name) {
|
||||
kfree(pmac);
|
||||
goto eth_fixup_no_mem;
|
||||
}
|
||||
|
||||
macaddr = pmac->value;
|
||||
reg = readl(io + MV643XX_ETH_MAC_ADDR_HIGH);
|
||||
macaddr[0] = (reg >> 24) & 0xff;
|
||||
macaddr[1] = (reg >> 16) & 0xff;
|
||||
macaddr[2] = (reg >> 8) & 0xff;
|
||||
macaddr[3] = reg & 0xff;
|
||||
|
||||
reg = readl(io + MV643XX_ETH_MAC_ADDR_LOW);
|
||||
macaddr[4] = (reg >> 8) & 0xff;
|
||||
macaddr[5] = reg & 0xff;
|
||||
|
||||
of_update_property(np, pmac);
|
||||
|
||||
eth_fixup_no_mem:
|
||||
iounmap(io);
|
||||
clk_disable_unprepare(clk);
|
||||
eth_fixup_no_map:
|
||||
clk_put(clk);
|
||||
eth_fixup_skip:
|
||||
of_node_put(pnp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable propagation of mbus errors to the CPU local bus, as this
|
||||
* causes mbus errors (which can occur for example for PCI aborts) to
|
||||
* throw CPU aborts, which we're not set up to deal with.
|
||||
*/
|
||||
static void __init kirkwood_disable_mbus_error_propagation(void)
|
||||
{
|
||||
void __iomem *cpu_config;
|
||||
|
||||
cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
|
||||
writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
|
||||
iounmap(cpu_config);
|
||||
}
|
||||
|
||||
static void __init kirkwood_dt_init(void)
|
||||
{
|
||||
kirkwood_disable_mbus_error_propagation();
|
||||
|
||||
BUG_ON(mvebu_mbus_dt_init(false));
|
||||
|
||||
#ifdef CONFIG_CACHE_FEROCEON_L2
|
||||
feroceon_of_init();
|
||||
#endif
|
||||
kirkwood_cpufreq_init();
|
||||
kirkwood_cpuidle_init();
|
||||
|
||||
kirkwood_pm_init();
|
||||
kirkwood_dt_eth_fixup();
|
||||
|
||||
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
|
||||
}
|
||||
|
||||
static const char * const kirkwood_dt_board_compat[] = {
|
||||
"marvell,kirkwood",
|
||||
NULL
|
||||
};
|
||||
|
||||
DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
|
||||
/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
|
||||
.map_io = kirkwood_map_io,
|
||||
.init_machine = kirkwood_dt_init,
|
||||
.restart = kirkwood_restart,
|
||||
.dt_compat = kirkwood_dt_board_compat,
|
||||
MACHINE_END
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/common.h
|
||||
*
|
||||
* Core functions for Marvell Kirkwood SoCs
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef __ARCH_KIRKWOOD_COMMON_H
|
||||
#define __ARCH_KIRKWOOD_COMMON_H
|
||||
|
||||
#include <linux/reboot.h>
|
||||
|
||||
struct dsa_platform_data;
|
||||
struct mv643xx_eth_platform_data;
|
||||
struct mv_sata_platform_data;
|
||||
struct mvsdio_platform_data;
|
||||
struct mtd_partition;
|
||||
struct mtd_info;
|
||||
struct kirkwood_asoc_platform_data;
|
||||
|
||||
#define KW_PCIE0 (1 << 0)
|
||||
#define KW_PCIE1 (1 << 1)
|
||||
|
||||
/*
|
||||
* Basic Kirkwood init functions used early by machine-setup.
|
||||
*/
|
||||
void kirkwood_map_io(void);
|
||||
void kirkwood_init(void);
|
||||
void kirkwood_init_early(void);
|
||||
void kirkwood_init_irq(void);
|
||||
|
||||
void kirkwood_setup_wins(void);
|
||||
|
||||
void kirkwood_enable_pcie(void);
|
||||
void kirkwood_pcie_id(u32 *dev, u32 *rev);
|
||||
|
||||
void kirkwood_ehci_init(void);
|
||||
void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data);
|
||||
void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data);
|
||||
void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq);
|
||||
void kirkwood_pcie_init(unsigned int portmask);
|
||||
void kirkwood_sata_init(struct mv_sata_platform_data *sata_data);
|
||||
void kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data);
|
||||
void kirkwood_spi_init(void);
|
||||
void kirkwood_i2c_init(void);
|
||||
void kirkwood_uart0_init(void);
|
||||
void kirkwood_uart1_init(void);
|
||||
void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
|
||||
void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
|
||||
int (*dev_ready)(struct mtd_info *));
|
||||
void kirkwood_audio_init(void);
|
||||
void kirkwood_cpuidle_init(void);
|
||||
void kirkwood_cpufreq_init(void);
|
||||
|
||||
void kirkwood_restart(enum reboot_mode, const char *);
|
||||
void kirkwood_clk_init(void);
|
||||
|
||||
/* early init functions not converted to fdt yet */
|
||||
char *kirkwood_id(void);
|
||||
void kirkwood_l2_init(void);
|
||||
void kirkwood_wdt_init(void);
|
||||
void kirkwood_xor0_init(void);
|
||||
void kirkwood_xor1_init(void);
|
||||
void kirkwood_crypto_init(void);
|
||||
|
||||
extern int kirkwood_tclk;
|
||||
extern void kirkwood_timer_init(void);
|
||||
|
||||
#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
|
||||
|
||||
#endif
|
||||
@@ -1,231 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/d2net_v2-setup.c
|
||||
*
|
||||
* LaCie d2 Network Space v2 Board Setup
|
||||
*
|
||||
* Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/ata_platform.h>
|
||||
#include <linux/mv643xx_eth.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
#include <linux/leds.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <mach/kirkwood.h>
|
||||
#include <linux/platform_data/leds-kirkwood-ns2.h>
|
||||
#include "common.h"
|
||||
#include "mpp.h"
|
||||
#include "lacie_v2-common.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* Ethernet
|
||||
****************************************************************************/
|
||||
|
||||
static struct mv643xx_eth_platform_data d2net_v2_ge00_data = {
|
||||
.phy_addr = MV643XX_ETH_PHY_ADDR(8),
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* SATA
|
||||
****************************************************************************/
|
||||
|
||||
static struct mv_sata_platform_data d2net_v2_sata_data = {
|
||||
.n_ports = 2,
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* GPIO keys
|
||||
****************************************************************************/
|
||||
|
||||
#define D2NET_V2_GPIO_PUSH_BUTTON 34
|
||||
#define D2NET_V2_GPIO_POWER_SWITCH_ON 13
|
||||
#define D2NET_V2_GPIO_POWER_SWITCH_OFF 15
|
||||
|
||||
#define D2NET_V2_SWITCH_POWER_ON 0x1
|
||||
#define D2NET_V2_SWITCH_POWER_OFF 0x2
|
||||
|
||||
static struct gpio_keys_button d2net_v2_buttons[] = {
|
||||
[0] = {
|
||||
.type = EV_SW,
|
||||
.code = D2NET_V2_SWITCH_POWER_ON,
|
||||
.gpio = D2NET_V2_GPIO_POWER_SWITCH_ON,
|
||||
.desc = "Back power switch (on|auto)",
|
||||
.active_low = 0,
|
||||
},
|
||||
[1] = {
|
||||
.type = EV_SW,
|
||||
.code = D2NET_V2_SWITCH_POWER_OFF,
|
||||
.gpio = D2NET_V2_GPIO_POWER_SWITCH_OFF,
|
||||
.desc = "Back power switch (auto|off)",
|
||||
.active_low = 0,
|
||||
},
|
||||
[2] = {
|
||||
.code = KEY_POWER,
|
||||
.gpio = D2NET_V2_GPIO_PUSH_BUTTON,
|
||||
.desc = "Front Push Button",
|
||||
.active_low = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_keys_platform_data d2net_v2_button_data = {
|
||||
.buttons = d2net_v2_buttons,
|
||||
.nbuttons = ARRAY_SIZE(d2net_v2_buttons),
|
||||
};
|
||||
|
||||
static struct platform_device d2net_v2_gpio_buttons = {
|
||||
.name = "gpio-keys",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &d2net_v2_button_data,
|
||||
},
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* GPIO LEDs
|
||||
****************************************************************************/
|
||||
|
||||
#define D2NET_V2_GPIO_RED_LED 12
|
||||
|
||||
static struct gpio_led d2net_v2_gpio_led_pins[] = {
|
||||
{
|
||||
.name = "d2net_v2:red:fail",
|
||||
.gpio = D2NET_V2_GPIO_RED_LED,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_led_platform_data d2net_v2_gpio_leds_data = {
|
||||
.num_leds = ARRAY_SIZE(d2net_v2_gpio_led_pins),
|
||||
.leds = d2net_v2_gpio_led_pins,
|
||||
};
|
||||
|
||||
static struct platform_device d2net_v2_gpio_leds = {
|
||||
.name = "leds-gpio",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &d2net_v2_gpio_leds_data,
|
||||
},
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Dual-GPIO CPLD LEDs
|
||||
****************************************************************************/
|
||||
|
||||
#define D2NET_V2_GPIO_BLUE_LED_SLOW 29
|
||||
#define D2NET_V2_GPIO_BLUE_LED_CMD 30
|
||||
|
||||
static struct ns2_led d2net_v2_led_pins[] = {
|
||||
{
|
||||
.name = "d2net_v2:blue:sata",
|
||||
.cmd = D2NET_V2_GPIO_BLUE_LED_CMD,
|
||||
.slow = D2NET_V2_GPIO_BLUE_LED_SLOW,
|
||||
},
|
||||
};
|
||||
|
||||
static struct ns2_led_platform_data d2net_v2_leds_data = {
|
||||
.num_leds = ARRAY_SIZE(d2net_v2_led_pins),
|
||||
.leds = d2net_v2_led_pins,
|
||||
};
|
||||
|
||||
static struct platform_device d2net_v2_leds = {
|
||||
.name = "leds-ns2",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &d2net_v2_leds_data,
|
||||
},
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* General Setup
|
||||
****************************************************************************/
|
||||
|
||||
static unsigned int d2net_v2_mpp_config[] __initdata = {
|
||||
MPP0_SPI_SCn,
|
||||
MPP1_SPI_MOSI,
|
||||
MPP2_SPI_SCK,
|
||||
MPP3_SPI_MISO,
|
||||
MPP6_SYSRST_OUTn,
|
||||
MPP7_GPO, /* Request power-off */
|
||||
MPP8_TW0_SDA,
|
||||
MPP9_TW0_SCK,
|
||||
MPP10_UART0_TXD,
|
||||
MPP11_UART0_RXD,
|
||||
MPP12_GPO, /* Red led */
|
||||
MPP13_GPIO, /* Rear power switch (on|auto) */
|
||||
MPP14_GPIO, /* USB fuse */
|
||||
MPP15_GPIO, /* Rear power switch (auto|off) */
|
||||
MPP16_GPIO, /* SATA 0 power */
|
||||
MPP21_SATA0_ACTn,
|
||||
MPP24_GPIO, /* USB mode select */
|
||||
MPP26_GPIO, /* USB device vbus */
|
||||
MPP28_GPIO, /* USB enable host vbus */
|
||||
MPP29_GPIO, /* Blue led (slow register) */
|
||||
MPP30_GPIO, /* Blue led (command register) */
|
||||
MPP34_GPIO, /* Power button (1 = Released, 0 = Pushed) */
|
||||
MPP35_GPIO, /* Inhibit power-off */
|
||||
0
|
||||
};
|
||||
|
||||
#define D2NET_V2_GPIO_POWER_OFF 7
|
||||
|
||||
static void d2net_v2_power_off(void)
|
||||
{
|
||||
gpio_set_value(D2NET_V2_GPIO_POWER_OFF, 1);
|
||||
}
|
||||
|
||||
static void __init d2net_v2_init(void)
|
||||
{
|
||||
/*
|
||||
* Basic setup. Needs to be called early.
|
||||
*/
|
||||
kirkwood_init();
|
||||
kirkwood_mpp_conf(d2net_v2_mpp_config);
|
||||
|
||||
lacie_v2_hdd_power_init(1);
|
||||
|
||||
kirkwood_ehci_init();
|
||||
kirkwood_ge00_init(&d2net_v2_ge00_data);
|
||||
kirkwood_sata_init(&d2net_v2_sata_data);
|
||||
kirkwood_uart0_init();
|
||||
lacie_v2_register_flash();
|
||||
lacie_v2_register_i2c_devices();
|
||||
|
||||
platform_device_register(&d2net_v2_leds);
|
||||
platform_device_register(&d2net_v2_gpio_leds);
|
||||
platform_device_register(&d2net_v2_gpio_buttons);
|
||||
|
||||
if (gpio_request(D2NET_V2_GPIO_POWER_OFF, "power-off") == 0 &&
|
||||
gpio_direction_output(D2NET_V2_GPIO_POWER_OFF, 0) == 0)
|
||||
pm_power_off = d2net_v2_power_off;
|
||||
else
|
||||
pr_err("d2net_v2: failed to configure power-off GPIO\n");
|
||||
}
|
||||
|
||||
MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
|
||||
.atag_offset = 0x100,
|
||||
.init_machine = d2net_v2_init,
|
||||
.map_io = kirkwood_map_io,
|
||||
.init_early = kirkwood_init_early,
|
||||
.init_irq = kirkwood_init_irq,
|
||||
.init_time = kirkwood_timer_init,
|
||||
.restart = kirkwood_restart,
|
||||
MACHINE_END
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/include/mach/bridge-regs.h
|
||||
*
|
||||
* Mbus-L to Mbus Bridge Registers
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_BRIDGE_REGS_H
|
||||
#define __ASM_ARCH_BRIDGE_REGS_H
|
||||
|
||||
#include <mach/kirkwood.h>
|
||||
|
||||
#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100)
|
||||
#define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100)
|
||||
#define CPU_CONFIG_ERROR_PROP 0x00000004
|
||||
|
||||
#define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104)
|
||||
#define CPU_CONTROL_PHYS (BRIDGE_PHYS_BASE + 0x0104)
|
||||
#define CPU_RESET 0x00000002
|
||||
|
||||
#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
|
||||
#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
|
||||
#define SOFT_RESET_OUT_EN 0x00000004
|
||||
|
||||
#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
|
||||
#define SOFT_RESET 0x00000001
|
||||
|
||||
#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE + 0x0110)
|
||||
|
||||
#define BRIDGE_INT_TIMER1_CLR (~0x0004)
|
||||
|
||||
#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE + 0x0200)
|
||||
#define IRQ_CAUSE_LOW_OFF 0x0000
|
||||
#define IRQ_MASK_LOW_OFF 0x0004
|
||||
#define IRQ_CAUSE_HIGH_OFF 0x0010
|
||||
#define IRQ_MASK_HIGH_OFF 0x0014
|
||||
|
||||
#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE + 0x0300)
|
||||
#define TIMER_PHYS_BASE (BRIDGE_PHYS_BASE + 0x0300)
|
||||
|
||||
#define L2_CONFIG_REG (BRIDGE_VIRT_BASE + 0x0128)
|
||||
#define L2_WRITETHROUGH 0x00000010
|
||||
|
||||
#define CLOCK_GATING_CTRL (BRIDGE_VIRT_BASE + 0x11c)
|
||||
#define CGC_BIT_GE0 (0)
|
||||
#define CGC_BIT_PEX0 (2)
|
||||
#define CGC_BIT_USB0 (3)
|
||||
#define CGC_BIT_SDIO (4)
|
||||
#define CGC_BIT_TSU (5)
|
||||
#define CGC_BIT_DUNIT (6)
|
||||
#define CGC_BIT_RUNIT (7)
|
||||
#define CGC_BIT_XOR0 (8)
|
||||
#define CGC_BIT_AUDIO (9)
|
||||
#define CGC_BIT_SATA0 (14)
|
||||
#define CGC_BIT_SATA1 (15)
|
||||
#define CGC_BIT_XOR1 (16)
|
||||
#define CGC_BIT_CRYPTO (17)
|
||||
#define CGC_BIT_PEX1 (18)
|
||||
#define CGC_BIT_GE1 (19)
|
||||
#define CGC_BIT_TDM (20)
|
||||
#define CGC_GE0 (1 << 0)
|
||||
#define CGC_PEX0 (1 << 2)
|
||||
#define CGC_USB0 (1 << 3)
|
||||
#define CGC_SDIO (1 << 4)
|
||||
#define CGC_TSU (1 << 5)
|
||||
#define CGC_DUNIT (1 << 6)
|
||||
#define CGC_RUNIT (1 << 7)
|
||||
#define CGC_XOR0 (1 << 8)
|
||||
#define CGC_AUDIO (1 << 9)
|
||||
#define CGC_POWERSAVE (1 << 11)
|
||||
#define CGC_SATA0 (1 << 14)
|
||||
#define CGC_SATA1 (1 << 15)
|
||||
#define CGC_XOR1 (1 << 16)
|
||||
#define CGC_CRYPTO (1 << 17)
|
||||
#define CGC_PEX1 (1 << 18)
|
||||
#define CGC_GE1 (1 << 19)
|
||||
#define CGC_TDM (1 << 20)
|
||||
#define CGC_RESERVED (0x6 << 21)
|
||||
|
||||
#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118)
|
||||
#define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x118)
|
||||
|
||||
#endif
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/include/mach/entry-macro.S
|
||||
*
|
||||
* Low-level IRQ helper macros for Marvell Kirkwood platforms
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <mach/bridge-regs.h>
|
||||
|
||||
.macro get_irqnr_preamble, base, tmp
|
||||
ldr \base, =IRQ_VIRT_BASE
|
||||
.endm
|
||||
|
||||
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
|
||||
@ check low interrupts
|
||||
ldr \irqstat, [\base, #IRQ_CAUSE_LOW_OFF]
|
||||
ldr \tmp, [\base, #IRQ_MASK_LOW_OFF]
|
||||
mov \irqnr, #31
|
||||
ands \irqstat, \irqstat, \tmp
|
||||
bne 1001f
|
||||
|
||||
@ if no low interrupts set, check high interrupts
|
||||
ldr \irqstat, [\base, #IRQ_CAUSE_HIGH_OFF]
|
||||
ldr \tmp, [\base, #IRQ_MASK_HIGH_OFF]
|
||||
mov \irqnr, #63
|
||||
ands \irqstat, \irqstat, \tmp
|
||||
|
||||
@ find first active interrupt source
|
||||
1001: clzne \irqstat, \irqstat
|
||||
subne \irqnr, \irqnr, \irqstat
|
||||
.endm
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/include/mach/hardware.h
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_HARDWARE_H
|
||||
#define __ASM_ARCH_HARDWARE_H
|
||||
|
||||
#include "kirkwood.h"
|
||||
|
||||
#endif
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/include/mach/irqs.h
|
||||
*
|
||||
* IRQ definitions for Marvell Kirkwood SoCs
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_IRQS_H
|
||||
#define __ASM_ARCH_IRQS_H
|
||||
|
||||
/*
|
||||
* Low Interrupt Controller
|
||||
*/
|
||||
#define IRQ_KIRKWOOD_HIGH_SUM 0
|
||||
#define IRQ_KIRKWOOD_BRIDGE 1
|
||||
#define IRQ_KIRKWOOD_HOST2CPU 2
|
||||
#define IRQ_KIRKWOOD_CPU2HOST 3
|
||||
#define IRQ_KIRKWOOD_XOR_00 5
|
||||
#define IRQ_KIRKWOOD_XOR_01 6
|
||||
#define IRQ_KIRKWOOD_XOR_10 7
|
||||
#define IRQ_KIRKWOOD_XOR_11 8
|
||||
#define IRQ_KIRKWOOD_PCIE 9
|
||||
#define IRQ_KIRKWOOD_PCIE1 10
|
||||
#define IRQ_KIRKWOOD_GE00_SUM 11
|
||||
#define IRQ_KIRKWOOD_GE01_SUM 15
|
||||
#define IRQ_KIRKWOOD_USB 19
|
||||
#define IRQ_KIRKWOOD_SATA 21
|
||||
#define IRQ_KIRKWOOD_CRYPTO 22
|
||||
#define IRQ_KIRKWOOD_SPI 23
|
||||
#define IRQ_KIRKWOOD_I2S 24
|
||||
#define IRQ_KIRKWOOD_TS_0 26
|
||||
#define IRQ_KIRKWOOD_SDIO 28
|
||||
#define IRQ_KIRKWOOD_TWSI 29
|
||||
#define IRQ_KIRKWOOD_AVB 30
|
||||
#define IRQ_KIRKWOOD_TDMI 31
|
||||
|
||||
/*
|
||||
* High Interrupt Controller
|
||||
*/
|
||||
#define IRQ_KIRKWOOD_UART_0 33
|
||||
#define IRQ_KIRKWOOD_UART_1 34
|
||||
#define IRQ_KIRKWOOD_GPIO_LOW_0_7 35
|
||||
#define IRQ_KIRKWOOD_GPIO_LOW_8_15 36
|
||||
#define IRQ_KIRKWOOD_GPIO_LOW_16_23 37
|
||||
#define IRQ_KIRKWOOD_GPIO_LOW_24_31 38
|
||||
#define IRQ_KIRKWOOD_GPIO_HIGH_0_7 39
|
||||
#define IRQ_KIRKWOOD_GPIO_HIGH_8_15 40
|
||||
#define IRQ_KIRKWOOD_GPIO_HIGH_16_23 41
|
||||
#define IRQ_KIRKWOOD_GE00_ERR 46
|
||||
#define IRQ_KIRKWOOD_GE01_ERR 47
|
||||
#define IRQ_KIRKWOOD_RTC 53
|
||||
|
||||
/*
|
||||
* KIRKWOOD General Purpose Pins
|
||||
*/
|
||||
#define IRQ_KIRKWOOD_GPIO_START 64
|
||||
#define NR_GPIO_IRQS 50
|
||||
|
||||
#define NR_IRQS (IRQ_KIRKWOOD_GPIO_START + NR_GPIO_IRQS)
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,142 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/include/mach/kirkwood.h
|
||||
*
|
||||
* Generic definitions for Marvell Kirkwood SoC flavors:
|
||||
* 88F6180, 88F6192 and 88F6281.
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_KIRKWOOD_H
|
||||
#define __ASM_ARCH_KIRKWOOD_H
|
||||
|
||||
/*
|
||||
* Marvell Kirkwood address maps.
|
||||
*
|
||||
* phys
|
||||
* e0000000 PCIe #0 Memory space
|
||||
* e8000000 PCIe #1 Memory space
|
||||
* f1000000 on-chip peripheral registers
|
||||
* f2000000 PCIe #0 I/O space
|
||||
* f3000000 PCIe #1 I/O space
|
||||
* f4000000 NAND controller address window
|
||||
* f5000000 Security Accelerator SRAM
|
||||
*
|
||||
* virt phys size
|
||||
* fed00000 f1000000 1M on-chip peripheral registers
|
||||
* fee00000 f2000000 1M PCIe #0 I/O space
|
||||
* fef00000 f3000000 1M PCIe #1 I/O space
|
||||
*/
|
||||
|
||||
#define KIRKWOOD_SRAM_PHYS_BASE 0xf5000000
|
||||
#define KIRKWOOD_SRAM_SIZE SZ_2K
|
||||
|
||||
#define KIRKWOOD_NAND_MEM_PHYS_BASE 0xf4000000
|
||||
#define KIRKWOOD_NAND_MEM_SIZE SZ_1K
|
||||
|
||||
#define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000
|
||||
#define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00010000
|
||||
#define KIRKWOOD_PCIE1_IO_SIZE SZ_64K
|
||||
|
||||
#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000
|
||||
#define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000
|
||||
#define KIRKWOOD_PCIE_IO_SIZE SZ_64K
|
||||
|
||||
#define KIRKWOOD_REGS_PHYS_BASE 0xf1000000
|
||||
#define KIRKWOOD_REGS_VIRT_BASE IOMEM(0xfed00000)
|
||||
#define KIRKWOOD_REGS_SIZE SZ_1M
|
||||
|
||||
#define KIRKWOOD_PCIE_MEM_PHYS_BASE 0xe0000000
|
||||
#define KIRKWOOD_PCIE_MEM_BUS_BASE 0xe0000000
|
||||
#define KIRKWOOD_PCIE_MEM_SIZE SZ_128M
|
||||
|
||||
#define KIRKWOOD_PCIE1_MEM_PHYS_BASE 0xe8000000
|
||||
#define KIRKWOOD_PCIE1_MEM_BUS_BASE 0xe8000000
|
||||
#define KIRKWOOD_PCIE1_MEM_SIZE SZ_128M
|
||||
|
||||
/*
|
||||
* Register Map
|
||||
*/
|
||||
#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x00000)
|
||||
#define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000)
|
||||
#define DDR_WINDOW_CPU_BASE (DDR_PHYS_BASE + 0x1500)
|
||||
#define DDR_WINDOW_CPU_SZ (0x20)
|
||||
#define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418)
|
||||
|
||||
#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x10000)
|
||||
#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x10000)
|
||||
#define SAMPLE_AT_RESET (DEV_BUS_VIRT_BASE + 0x0030)
|
||||
#define DEVICE_ID (DEV_BUS_VIRT_BASE + 0x0034)
|
||||
#define GPIO_LOW_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x0100)
|
||||
#define GPIO_HIGH_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x0140)
|
||||
#define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x0300)
|
||||
#define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x0600)
|
||||
#define I2C_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x1000)
|
||||
#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2000)
|
||||
#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2000)
|
||||
#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2100)
|
||||
#define UART1_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2100)
|
||||
|
||||
#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x20000)
|
||||
#define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000)
|
||||
#define BRIDGE_WINS_BASE (BRIDGE_PHYS_BASE)
|
||||
#define BRIDGE_WINS_SZ (0x80)
|
||||
|
||||
#define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x30000)
|
||||
|
||||
#define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x40000)
|
||||
#define PCIE_LINK_CTRL (PCIE_VIRT_BASE + 0x70)
|
||||
#define PCIE_STATUS (PCIE_VIRT_BASE + 0x1a04)
|
||||
#define PCIE1_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x44000)
|
||||
#define PCIE1_LINK_CTRL (PCIE1_VIRT_BASE + 0x70)
|
||||
#define PCIE1_STATUS (PCIE1_VIRT_BASE + 0x1a04)
|
||||
|
||||
#define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x50000)
|
||||
|
||||
#define XOR0_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x60800)
|
||||
#define XOR0_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x60800)
|
||||
#define XOR1_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x60900)
|
||||
#define XOR1_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x60900)
|
||||
#define XOR0_HIGH_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x60A00)
|
||||
#define XOR0_HIGH_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x60A00)
|
||||
#define XOR1_HIGH_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x60B00)
|
||||
#define XOR1_HIGH_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x60B00)
|
||||
|
||||
#define GE00_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x70000)
|
||||
#define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x74000)
|
||||
|
||||
#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x80000)
|
||||
#define SATA_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x80000)
|
||||
#define SATA0_IF_CTRL (SATA_VIRT_BASE + 0x2050)
|
||||
#define SATA0_PHY_MODE_2 (SATA_VIRT_BASE + 0x2330)
|
||||
#define SATA1_IF_CTRL (SATA_VIRT_BASE + 0x4050)
|
||||
#define SATA1_PHY_MODE_2 (SATA_VIRT_BASE + 0x4330)
|
||||
|
||||
#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x90000)
|
||||
|
||||
#define AUDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0xA0000)
|
||||
#define AUDIO_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0xA0000)
|
||||
|
||||
/*
|
||||
* Supported devices and revisions.
|
||||
*/
|
||||
#define MV88F6281_DEV_ID 0x6281
|
||||
#define MV88F6281_REV_Z0 0
|
||||
#define MV88F6281_REV_A0 2
|
||||
#define MV88F6281_REV_A1 3
|
||||
|
||||
#define MV88F6192_DEV_ID 0x6192
|
||||
#define MV88F6192_REV_Z0 0
|
||||
#define MV88F6192_REV_A0 2
|
||||
#define MV88F6192_REV_A1 3
|
||||
|
||||
#define MV88F6180_DEV_ID 0x6180
|
||||
#define MV88F6180_REV_A0 2
|
||||
#define MV88F6180_REV_A1 3
|
||||
|
||||
#define MV88F6282_DEV_ID 0x6282
|
||||
#define MV88F6282_REV_A0 0
|
||||
#define MV88F6282_REV_A1 1
|
||||
#endif
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/include/mach/uncompress.h
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/serial_reg.h>
|
||||
#include <mach/kirkwood.h>
|
||||
|
||||
#define SERIAL_BASE ((unsigned char *)UART0_PHYS_BASE)
|
||||
|
||||
static void putc(const char c)
|
||||
{
|
||||
unsigned char *base = SERIAL_BASE;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 0x1000; i++) {
|
||||
if (base[UART_LSR << 2] & UART_LSR_THRE)
|
||||
break;
|
||||
barrier();
|
||||
}
|
||||
|
||||
base[UART_TX << 2] = c;
|
||||
}
|
||||
|
||||
static void flush(void)
|
||||
{
|
||||
unsigned char *base = SERIAL_BASE;
|
||||
unsigned char mask;
|
||||
int i;
|
||||
|
||||
mask = UART_LSR_TEMT | UART_LSR_THRE;
|
||||
|
||||
for (i = 0; i < 0x1000; i++) {
|
||||
if ((base[UART_LSR << 2] & mask) == mask)
|
||||
break;
|
||||
barrier();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* nothing to do
|
||||
*/
|
||||
#define arch_decomp_setup()
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/irq.c
|
||||
*
|
||||
* Kirkwood IRQ handling.
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
#include <asm/exception.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <mach/bridge-regs.h>
|
||||
#include <plat/orion-gpio.h>
|
||||
#include <plat/irq.h>
|
||||
#include "common.h"
|
||||
|
||||
static int __initdata gpio0_irqs[4] = {
|
||||
IRQ_KIRKWOOD_GPIO_LOW_0_7,
|
||||
IRQ_KIRKWOOD_GPIO_LOW_8_15,
|
||||
IRQ_KIRKWOOD_GPIO_LOW_16_23,
|
||||
IRQ_KIRKWOOD_GPIO_LOW_24_31,
|
||||
};
|
||||
|
||||
static int __initdata gpio1_irqs[4] = {
|
||||
IRQ_KIRKWOOD_GPIO_HIGH_0_7,
|
||||
IRQ_KIRKWOOD_GPIO_HIGH_8_15,
|
||||
IRQ_KIRKWOOD_GPIO_HIGH_16_23,
|
||||
0,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MULTI_IRQ_HANDLER
|
||||
/*
|
||||
* Compiling with both non-DT and DT support enabled, will
|
||||
* break asm irq handler used by non-DT boards. Therefore,
|
||||
* we provide a C-style irq handler even for non-DT boards,
|
||||
* if MULTI_IRQ_HANDLER is set.
|
||||
*/
|
||||
|
||||
static void __iomem *kirkwood_irq_base = IRQ_VIRT_BASE;
|
||||
|
||||
asmlinkage void
|
||||
__exception_irq_entry kirkwood_legacy_handle_irq(struct pt_regs *regs)
|
||||
{
|
||||
u32 stat;
|
||||
|
||||
stat = readl_relaxed(kirkwood_irq_base + IRQ_CAUSE_LOW_OFF);
|
||||
stat &= readl_relaxed(kirkwood_irq_base + IRQ_MASK_LOW_OFF);
|
||||
if (stat) {
|
||||
unsigned int hwirq = __fls(stat);
|
||||
handle_IRQ(hwirq, regs);
|
||||
return;
|
||||
}
|
||||
stat = readl_relaxed(kirkwood_irq_base + IRQ_CAUSE_HIGH_OFF);
|
||||
stat &= readl_relaxed(kirkwood_irq_base + IRQ_MASK_HIGH_OFF);
|
||||
if (stat) {
|
||||
unsigned int hwirq = 32 + __fls(stat);
|
||||
handle_IRQ(hwirq, regs);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void __init kirkwood_init_irq(void)
|
||||
{
|
||||
orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF);
|
||||
orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF);
|
||||
|
||||
#ifdef CONFIG_MULTI_IRQ_HANDLER
|
||||
set_handle_irq(kirkwood_legacy_handle_irq);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize gpiolib for GPIOs 0-49.
|
||||
*/
|
||||
orion_gpio_init(NULL, 0, 32, GPIO_LOW_VIRT_BASE, 0,
|
||||
IRQ_KIRKWOOD_GPIO_START, gpio0_irqs);
|
||||
orion_gpio_init(NULL, 32, 18, GPIO_HIGH_VIRT_BASE, 0,
|
||||
IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs);
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/lacie_v2-common.c
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/spi/flash.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/platform_data/at24.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <asm/mach/time.h>
|
||||
#include <mach/kirkwood.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <plat/time.h>
|
||||
#include "common.h"
|
||||
#include "lacie_v2-common.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* 512KB SPI Flash on Boot Device (MACRONIX MX25L4005)
|
||||
****************************************************************************/
|
||||
|
||||
static struct mtd_partition lacie_v2_flash_parts[] = {
|
||||
{
|
||||
.name = "u-boot",
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
.offset = 0,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
};
|
||||
|
||||
static const struct flash_platform_data lacie_v2_flash = {
|
||||
.type = "mx25l4005a",
|
||||
.name = "spi_flash",
|
||||
.parts = lacie_v2_flash_parts,
|
||||
.nr_parts = ARRAY_SIZE(lacie_v2_flash_parts),
|
||||
};
|
||||
|
||||
static struct spi_board_info __initdata lacie_v2_spi_slave_info[] = {
|
||||
{
|
||||
.modalias = "m25p80",
|
||||
.platform_data = &lacie_v2_flash,
|
||||
.irq = -1,
|
||||
.max_speed_hz = 20000000,
|
||||
.bus_num = 0,
|
||||
.chip_select = 0,
|
||||
},
|
||||
};
|
||||
|
||||
void __init lacie_v2_register_flash(void)
|
||||
{
|
||||
spi_register_board_info(lacie_v2_spi_slave_info,
|
||||
ARRAY_SIZE(lacie_v2_spi_slave_info));
|
||||
kirkwood_spi_init();
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* I2C devices
|
||||
****************************************************************************/
|
||||
|
||||
static struct at24_platform_data at24c04 = {
|
||||
.byte_len = SZ_4K / 8,
|
||||
.page_size = 16,
|
||||
};
|
||||
|
||||
/*
|
||||
* i2c addr | chip | description
|
||||
* 0x50 | HT24LC04 | eeprom (512B)
|
||||
*/
|
||||
|
||||
static struct i2c_board_info __initdata lacie_v2_i2c_info[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("24c04", 0x50),
|
||||
.platform_data = &at24c04,
|
||||
}
|
||||
};
|
||||
|
||||
void __init lacie_v2_register_i2c_devices(void)
|
||||
{
|
||||
kirkwood_i2c_init();
|
||||
i2c_register_board_info(0, lacie_v2_i2c_info,
|
||||
ARRAY_SIZE(lacie_v2_i2c_info));
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Hard Disk power
|
||||
****************************************************************************/
|
||||
|
||||
static int __initdata lacie_v2_gpio_hdd_power[] = { 16, 17, 41, 42, 43 };
|
||||
|
||||
void __init lacie_v2_hdd_power_init(int hdd_num)
|
||||
{
|
||||
int i;
|
||||
int err;
|
||||
|
||||
/* Power up all hard disks. */
|
||||
for (i = 0; i < hdd_num; i++) {
|
||||
err = gpio_request(lacie_v2_gpio_hdd_power[i], NULL);
|
||||
if (err == 0) {
|
||||
err = gpio_direction_output(
|
||||
lacie_v2_gpio_hdd_power[i], 1);
|
||||
/* Free the HDD power GPIOs. This allow user-space to
|
||||
* configure them via the gpiolib sysfs interface. */
|
||||
gpio_free(lacie_v2_gpio_hdd_power[i]);
|
||||
}
|
||||
if (err)
|
||||
pr_err("Failed to power up HDD%d\n", i + 1);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-kirkwood/lacie_v2-common.h
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef __ARCH_KIRKWOOD_LACIE_V2_COMMON_H
|
||||
#define __ARCH_KIRKWOOD_LACIE_V2_COMMON_H
|
||||
|
||||
void lacie_v2_register_flash(void);
|
||||
void lacie_v2_register_i2c_devices(void);
|
||||
void lacie_v2_hdd_power_init(int hdd_num);
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user