Nomadik Device Tree conversion rebased on ARM SoC cleanup branch
This patch set converts the Nomadik (mach-nomadik) to Device Tree and delete the old board files, paving the road for single zImage. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) iQIcBAABAgAGBQJRBvtsAAoJEEEQszewGV1zTrIP/05jEYiH/M3VsyL36V+QeTVb vKdAa9vaCkd6xex3wYujzlLaWO/uw5MZfftaV1TLIe0U9bLk0vm6Pq3z7UB4OxTo iQzCg8UNxsrVe1FvOUHZXR+YQwAgN4fkZHf+FxxV5TNHJ/Kpx6qNgskAc5xAa5CC fc62WEq9LBliiremeNKcuyB2odjQA9Gbdw9URkeZW/OrnB7uFZBnfp1+MEZrzwH3 dXKBPAIdcFBNdlDTSasclWaoBakIQ2nktUFQaOS4bpYyZ6+Z4GyREkVcHG9UdCEN 2OEE6FWQR5/0PM20DWmURN4gS3fufSAloauBz6dfOIi9D7HdpHXcMcvTj4GQFnY6 K2hGA5nQCz3lKxFUtxpJImiZiFnuGapPYwEUZqcponXLRqfykyEE4ts0jpwWNnor rbPiLcvEKwaK4VV1UR7LlAhq5IfnH9z8Q1BWk3sW0nhXuMiM+anxr2N9awGlXCq4 uzrjwNi5GA+zUgFClGbc9xw4rndJl0MRoXQ/JDtsgRuFWL7lGNKFV2fnLKopaYbu xZ5uXbTWfLXxQXEidq7GIiG43xP/LZ26VA8fzJFncGxLrLuf5ME9A1kyXjCT8kPw VJKeVJVjdTszXio8kop6UHTrluBk8W4Th0FcfHQv+WO6bcq+7lhjVxBh02n71JaV MiJ7MrkZbHANKCew4esm =Ip5x -----END PGP SIGNATURE----- Merge tag 'nmk-dt-on-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into next/dt From Linus Walleij: Nomadik Device Tree conversion rebased on ARM SoC cleanup branch This patch set converts the Nomadik (mach-nomadik) to Device Tree and delete the old board files, paving the road for single zImage. * tag 'nmk-dt-on-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: nomadik: get rid of <mach/hardware.h> ARM: nomadik: delete old board files ARM: nomadik: add I2C devices to the device tree ARM: nomadik: migrate MMC/SD card support to device tree ARM: nomadik: convert SMSC91x ethernet to device tree ARM: nomadik: move GPIO and pinctrl to device tree ARM: nomadik: add FSMC NAND ARM: nomadik: move remaining PrimeCells to device tree ARM: nomadik: move pin maps to cpu file ARM: nomadik: initial devicetree support ARM: nomadik: move last custom calls to pinctrl Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Коммит
a6f243a4d6
|
@ -0,0 +1,27 @@
|
|||
ST-Ericsson Nomadik Device Tree Bindings
|
||||
|
||||
For various board the "board" node may contain specific properties
|
||||
that pertain to this particular board, such as board-specific GPIOs.
|
||||
|
||||
Boards with the Nomadik SoC include:
|
||||
|
||||
S8815 "MiniKit" manufactured by Calao Systems:
|
||||
|
||||
Required root node property:
|
||||
|
||||
compatible="calaosystems,usb-s8815";
|
||||
|
||||
Required node: usb-s8815
|
||||
|
||||
Example:
|
||||
|
||||
usb-s8815 {
|
||||
ethernet-gpio {
|
||||
gpios = <&gpio3 19 0x1>;
|
||||
interrupts = <19 0x1>;
|
||||
interrupt-parent = <&gpio3>;
|
||||
};
|
||||
mmcsd-gpio {
|
||||
gpios = <&gpio3 16 0x1>;
|
||||
};
|
||||
};
|
|
@ -1,7 +1,7 @@
|
|||
* FSMC NAND
|
||||
|
||||
Required properties:
|
||||
- compatible : "st,spear600-fsmc-nand"
|
||||
- compatible : "st,spear600-fsmc-nand", "stericsson,fsmc-nand"
|
||||
- reg : Address range of the mtd chip
|
||||
- reg-names: Should contain the reg names "fsmc_regs", "nand_data", "nand_addr" and "nand_cmd"
|
||||
|
||||
|
|
|
@ -899,10 +899,12 @@ config ARCH_NOMADIK
|
|||
select ARCH_REQUIRE_GPIOLIB
|
||||
select ARM_AMBA
|
||||
select ARM_VIC
|
||||
select CLKSRC_NOMADIK_MTU
|
||||
select COMMON_CLK
|
||||
select CPU_ARM926T
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select MIGHT_HAVE_CACHE_L2X0
|
||||
select OF
|
||||
select PINCTRL
|
||||
select PINCTRL_STN8815
|
||||
select SPARSE_IRQ
|
||||
|
|
|
@ -100,6 +100,7 @@ dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
|
|||
imx28-m28evk.dtb \
|
||||
imx28-sps1.dtb \
|
||||
imx28-tx28.dtb
|
||||
dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb
|
||||
dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
|
||||
omap3-beagle.dtb \
|
||||
omap3-beagle-xm.dtb \
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Device Tree for the ST-Ericsson Nomadik S8815 board
|
||||
* Produced by Calao Systems
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/include/ "ste-nomadik-stn8815.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Calao Systems USB-S8815";
|
||||
compatible = "calaosystems,usb-s8815";
|
||||
|
||||
chosen {
|
||||
bootargs = "root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk";
|
||||
};
|
||||
|
||||
/* Custom board node with GPIO pins to active etc */
|
||||
usb-s8815 {
|
||||
/* The S8815 is using this very GPIO pin for the SMSC91x IRQs */
|
||||
ethernet-gpio {
|
||||
gpios = <&gpio3 19 0x1>;
|
||||
interrupts = <19 0x1>;
|
||||
interrupt-parent = <&gpio3>;
|
||||
};
|
||||
/* This will bias the MMC/SD card detect line */
|
||||
mmcsd-gpio {
|
||||
gpios = <&gpio3 16 0x1>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,256 @@
|
|||
/*
|
||||
* Device Tree for the ST-Ericsson Nomadik 8815 STn8815 SoC
|
||||
*/
|
||||
/include/ "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
memory {
|
||||
reg = <0x00000000 0x04000000>,
|
||||
<0x08000000 0x04000000>;
|
||||
};
|
||||
|
||||
L2: l2-cache {
|
||||
compatible = "arm,l210-cache";
|
||||
reg = <0x10210000 0x1000>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <30>;
|
||||
cache-unified;
|
||||
cache-level = <2>;
|
||||
};
|
||||
|
||||
mtu0 {
|
||||
/* Nomadik system timer */
|
||||
reg = <0x101e2000 0x1000>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <4>;
|
||||
};
|
||||
|
||||
mtu1 {
|
||||
/* Secondary timer */
|
||||
reg = <0x101e3000 0x1000>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <5>;
|
||||
};
|
||||
|
||||
gpio0: gpio@101e4000 {
|
||||
compatible = "st,nomadik-gpio";
|
||||
reg = <0x101e4000 0x80>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <6>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-bank = <0>;
|
||||
};
|
||||
|
||||
gpio1: gpio@101e5000 {
|
||||
compatible = "st,nomadik-gpio";
|
||||
reg = <0x101e5000 0x80>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <7>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-bank = <1>;
|
||||
};
|
||||
|
||||
gpio2: gpio@101e6000 {
|
||||
compatible = "st,nomadik-gpio";
|
||||
reg = <0x101e6000 0x80>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <8>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-bank = <2>;
|
||||
};
|
||||
|
||||
gpio3: gpio@101e7000 {
|
||||
compatible = "st,nomadik-gpio";
|
||||
reg = <0x101e7000 0x80>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <9>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-bank = <3>;
|
||||
};
|
||||
|
||||
pinctrl {
|
||||
compatible = "stericsson,nmk-pinctrl-stn8815";
|
||||
};
|
||||
|
||||
/* A NAND flash of 128 MiB */
|
||||
fsmc: flash@40000000 {
|
||||
compatible = "stericsson,fsmc-nand";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0x10100000 0x1000>, /* FSMC Register*/
|
||||
<0x40000000 0x2000>, /* NAND Base DATA */
|
||||
<0x41000000 0x2000>, /* NAND Base ADDR */
|
||||
<0x40800000 0x2000>; /* NAND Base CMD */
|
||||
reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
|
||||
status = "okay";
|
||||
|
||||
partition@0 {
|
||||
label = "X-Loader(NAND)";
|
||||
reg = <0x0 0x40000>;
|
||||
};
|
||||
partition@40000 {
|
||||
label = "MemInit(NAND)";
|
||||
reg = <0x40000 0x40000>;
|
||||
};
|
||||
partition@80000 {
|
||||
label = "BootLoader(NAND)";
|
||||
reg = <0x80000 0x200000>;
|
||||
};
|
||||
partition@280000 {
|
||||
label = "Kernel zImage(NAND)";
|
||||
reg = <0x280000 0x300000>;
|
||||
};
|
||||
partition@580000 {
|
||||
label = "Root Filesystem(NAND)";
|
||||
reg = <0x580000 0x1600000>;
|
||||
};
|
||||
partition@1b80000 {
|
||||
label = "User Filesystem(NAND)";
|
||||
reg = <0x1b80000 0x6480000>;
|
||||
};
|
||||
};
|
||||
|
||||
external-bus@34000000 {
|
||||
compatible = "simple-bus";
|
||||
reg = <0x34000000 0x1000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0 0x34000000 0x1000000>;
|
||||
ethernet@300 {
|
||||
compatible = "smsc,lan91c111";
|
||||
reg = <0x300 0x0fd00>;
|
||||
};
|
||||
};
|
||||
|
||||
/* I2C0 connected to the STw4811 power management chip */
|
||||
i2c0 {
|
||||
compatible = "i2c-gpio";
|
||||
gpios = <&gpio1 31 0>, /* sda */
|
||||
<&gpio1 30 0>; /* scl */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
stw4811@2d {
|
||||
compatible = "st,stw4811";
|
||||
reg = <0x2d>;
|
||||
};
|
||||
};
|
||||
|
||||
/* I2C1 connected to various sensors */
|
||||
i2c1 {
|
||||
compatible = "i2c-gpio";
|
||||
gpios = <&gpio1 22 0>, /* sda */
|
||||
<&gpio1 21 0>; /* scl */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
camera@2d {
|
||||
compatible = "st,camera";
|
||||
reg = <0x10>;
|
||||
};
|
||||
stw5095@1a {
|
||||
compatible = "st,stw5095";
|
||||
reg = <0x1a>;
|
||||
};
|
||||
lis3lv02dl@1d {
|
||||
compatible = "st,lis3lv02dl";
|
||||
reg = <0x1d>;
|
||||
};
|
||||
};
|
||||
|
||||
/* I2C2 connected to the USB portions of the STw4811 only */
|
||||
i2c2 {
|
||||
compatible = "i2c-gpio";
|
||||
gpios = <&gpio2 10 0>, /* sda */
|
||||
<&gpio2 9 0>; /* scl */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
stw4811@2d {
|
||||
compatible = "st,stw4811-usb";
|
||||
reg = <0x2d>;
|
||||
};
|
||||
};
|
||||
|
||||
amba {
|
||||
compatible = "arm,amba-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
vica: intc@0x10140000 {
|
||||
compatible = "arm,versatile-vic";
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
reg = <0x10140000 0x20>;
|
||||
};
|
||||
|
||||
vicb: intc@0x10140020 {
|
||||
compatible = "arm,versatile-vic";
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
reg = <0x10140020 0x20>;
|
||||
};
|
||||
|
||||
uart0: uart@101fd000 {
|
||||
compatible = "arm,pl011", "arm,primecell";
|
||||
reg = <0x101fd000 0x1000>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <12>;
|
||||
};
|
||||
|
||||
uart1: uart@101fb000 {
|
||||
compatible = "arm,pl011", "arm,primecell";
|
||||
reg = <0x101fb000 0x1000>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <17>;
|
||||
};
|
||||
|
||||
uart2: uart@101f2000 {
|
||||
compatible = "arm,pl011", "arm,primecell";
|
||||
reg = <0x101f2000 0x1000>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <28>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
rng: rng@101b0000 {
|
||||
compatible = "arm,primecell";
|
||||
reg = <0x101b0000 0x1000>;
|
||||
};
|
||||
|
||||
rtc: rtc@101e8000 {
|
||||
compatible = "arm,pl031", "arm,primecell";
|
||||
reg = <0x101e8000 0x1000>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <10>;
|
||||
};
|
||||
|
||||
mmcsd: sdi@101f6000 {
|
||||
compatible = "arm,pl18x", "arm,primecell";
|
||||
reg = <0x101f6000 0x1000>;
|
||||
interrupt-parent = <&vica>;
|
||||
interrupts = <22>;
|
||||
max-frequency = <48000000>;
|
||||
bus-width = <4>;
|
||||
mmc-cap-mmc-highspeed;
|
||||
mmc-cap-sd-highspeed;
|
||||
cd-gpios = <&gpio3 15 0x1>;
|
||||
cd-inverted;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -4,19 +4,13 @@ menu "Nomadik boards"
|
|||
|
||||
config MACH_NOMADIK_8815NHK
|
||||
bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
|
||||
select CLKSRC_NOMADIK_MTU
|
||||
select NOMADIK_8815
|
||||
select I2C
|
||||
select I2C_ALGOBIT
|
||||
|
||||
endmenu
|
||||
|
||||
config NOMADIK_8815
|
||||
bool
|
||||
|
||||
config I2C_BITBANG_8815NHK
|
||||
tristate "Driver for bit-bang busses found on the 8815 NHK"
|
||||
depends on I2C && MACH_NOMADIK_8815NHK
|
||||
depends on PINCTRL_NOMADIK
|
||||
default y
|
||||
select I2C_ALGOBIT
|
||||
|
||||
endif
|
||||
|
|
|
@ -9,9 +9,3 @@
|
|||
|
||||
# Cpu revision
|
||||
obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o
|
||||
|
||||
# Specific board support
|
||||
obj-$(CONFIG_MACH_NOMADIK_8815NHK) += board-nhk8815.o
|
||||
|
||||
# Nomadik extra devices
|
||||
obj-$(CONFIG_I2C_BITBANG_8815NHK) += i2c-8815nhk.o
|
||||
|
|
|
@ -1,353 +0,0 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-nomadik/board-8815nhk.c
|
||||
*
|
||||
* Copyright (C) STMicroelectronics
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* NHK15 board specifc driver definition
|
||||
*/
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/amba/bus.h>
|
||||
#include <linux/amba/mmci.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/nand.h>
|
||||
#include <linux/mtd/fsmc.h>
|
||||
#include <linux/mtd/onenand.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/pinctrl/machine.h>
|
||||
#include <linux/platform_data/pinctrl-nomadik.h>
|
||||
#include <linux/platform_data/clocksource-nomadik-mtu.h>
|
||||
#include <asm/sizes.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/flash.h>
|
||||
#include <asm/mach/time.h>
|
||||
#include <mach/irqs.h>
|
||||
|
||||
#include "cpu-8815.h"
|
||||
|
||||
/* Initial value for SRC control register: all timers use MXTAL/8 source */
|
||||
#define SRC_CR_INIT_MASK 0x00007fff
|
||||
#define SRC_CR_INIT_VAL 0x2aaa8000
|
||||
|
||||
#define ALE_OFF 0x1000000
|
||||
#define CLE_OFF 0x800000
|
||||
|
||||
/* These addresses span 16MB, so use three individual pages */
|
||||
static struct resource nhk8815_nand_resources[] = {
|
||||
{
|
||||
.name = "nand_data",
|
||||
.start = 0x40000000,
|
||||
.end = 0x40000000 + SZ_16K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.name = "nand_addr",
|
||||
.start = 0x40000000 + ALE_OFF,
|
||||
.end = 0x40000000 +ALE_OFF + SZ_16K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.name = "nand_cmd",
|
||||
.start = 0x40000000 + CLE_OFF,
|
||||
.end = 0x40000000 + CLE_OFF + SZ_16K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.name = "fsmc_regs",
|
||||
.start = NOMADIK_FSMC_BASE,
|
||||
.end = NOMADIK_FSMC_BASE + SZ_4K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* These partitions are the same as those used in the 2.6.20 release
|
||||
* shipped by the vendor; the first two partitions are mandated
|
||||
* by the boot ROM, and the bootloader area is somehow oversized...
|
||||
*/
|
||||
static struct mtd_partition nhk8815_partitions[] = {
|
||||
{
|
||||
.name = "X-Loader(NAND)",
|
||||
.offset = 0,
|
||||
.size = SZ_256K,
|
||||
}, {
|
||||
.name = "MemInit(NAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_256K,
|
||||
}, {
|
||||
.name = "BootLoader(NAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_2M,
|
||||
}, {
|
||||
.name = "Kernel zImage(NAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 3 * SZ_1M,
|
||||
}, {
|
||||
.name = "Root Filesystem(NAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 22 * SZ_1M,
|
||||
}, {
|
||||
.name = "User Filesystem(NAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
}
|
||||
};
|
||||
|
||||
static struct fsmc_nand_timings nhk8815_nand_timings = {
|
||||
.thiz = 0,
|
||||
.thold = 0x10,
|
||||
.twait = 0x0A,
|
||||
.tset = 0,
|
||||
};
|
||||
|
||||
static struct fsmc_nand_platform_data nhk8815_nand_platform_data = {
|
||||
.nand_timings = &nhk8815_nand_timings,
|
||||
.partitions = nhk8815_partitions,
|
||||
.nr_partitions = ARRAY_SIZE(nhk8815_partitions),
|
||||
.width = FSMC_NAND_BW8,
|
||||
};
|
||||
|
||||
static struct platform_device nhk8815_nand_device = {
|
||||
.name = "fsmc-nand",
|
||||
.id = -1,
|
||||
.resource = nhk8815_nand_resources,
|
||||
.num_resources = ARRAY_SIZE(nhk8815_nand_resources),
|
||||
.dev = {
|
||||
.platform_data = &nhk8815_nand_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* These are the partitions for the OneNand device, different from above */
|
||||
static struct mtd_partition nhk8815_onenand_partitions[] = {
|
||||
{
|
||||
.name = "X-Loader(OneNAND)",
|
||||
.offset = 0,
|
||||
.size = SZ_256K,
|
||||
}, {
|
||||
.name = "MemInit(OneNAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_256K,
|
||||
}, {
|
||||
.name = "BootLoader(OneNAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_2M-SZ_256K,
|
||||
}, {
|
||||
.name = "SysImage(OneNAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 4 * SZ_1M,
|
||||
}, {
|
||||
.name = "Root Filesystem(OneNAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 22 * SZ_1M,
|
||||
}, {
|
||||
.name = "User Filesystem(OneNAND)",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
}
|
||||
};
|
||||
|
||||
static struct onenand_platform_data nhk8815_onenand_data = {
|
||||
.parts = nhk8815_onenand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(nhk8815_onenand_partitions),
|
||||
};
|
||||
|
||||
static struct resource nhk8815_onenand_resource[] = {
|
||||
{
|
||||
.start = 0x30000000,
|
||||
.end = 0x30000000 + SZ_128K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device nhk8815_onenand_device = {
|
||||
.name = "onenand-flash",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &nhk8815_onenand_data,
|
||||
},
|
||||
.resource = nhk8815_onenand_resource,
|
||||
.num_resources = ARRAY_SIZE(nhk8815_onenand_resource),
|
||||
};
|
||||
|
||||
/* bus control reg. and bus timing reg. for CS0..CS3 */
|
||||
#define FSMC_BCR(x) (NOMADIK_FSMC_VA + (x << 3))
|
||||
#define FSMC_BTR(x) (NOMADIK_FSMC_VA + (x << 3) + 0x04)
|
||||
|
||||
static void __init nhk8815_onenand_init(void)
|
||||
{
|
||||
#ifdef CONFIG_MTD_ONENAND
|
||||
/* Set up SMCS0 for OneNand */
|
||||
writel(0x000030db, FSMC_BCR(0));
|
||||
writel(0x02100551, FSMC_BTR(0));
|
||||
#endif
|
||||
}
|
||||
|
||||
static struct mmci_platform_data mmcsd_plat_data = {
|
||||
.ocr_mask = MMC_VDD_29_30,
|
||||
.f_max = 48000000,
|
||||
.gpio_wp = -1,
|
||||
.gpio_cd = 111,
|
||||
.cd_invert = true,
|
||||
.capabilities = MMC_CAP_MMC_HIGHSPEED |
|
||||
MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA,
|
||||
};
|
||||
|
||||
static int __init nhk8815_mmcsd_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(112, "card detect bias");
|
||||
if (ret)
|
||||
return ret;
|
||||
gpio_direction_output(112, 0);
|
||||
amba_apb_device_add(NULL, "mmci", NOMADIK_SDI_BASE, SZ_4K, IRQ_SDMMC, 0, &mmcsd_plat_data, 0x10180180);
|
||||
return 0;
|
||||
}
|
||||
module_init(nhk8815_mmcsd_init);
|
||||
|
||||
static struct resource nhk8815_eth_resources[] = {
|
||||
{
|
||||
.name = "smc91x-regs",
|
||||
.start = 0x34000000 + 0x300,
|
||||
.end = 0x34000000 + SZ_64K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = NOMADIK_GPIO_TO_IRQ(115),
|
||||
.end = NOMADIK_GPIO_TO_IRQ(115),
|
||||
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device nhk8815_eth_device = {
|
||||
.name = "smc91x",
|
||||
.resource = nhk8815_eth_resources,
|
||||
.num_resources = ARRAY_SIZE(nhk8815_eth_resources),
|
||||
};
|
||||
|
||||
static int __init nhk8815_eth_init(void)
|
||||
{
|
||||
int gpio_nr = 115; /* hardwired in the board */
|
||||
int err;
|
||||
|
||||
err = gpio_request(gpio_nr, "eth_irq");
|
||||
if (!err) err = nmk_gpio_set_mode(gpio_nr, NMK_GPIO_ALT_GPIO);
|
||||
if (!err) err = gpio_direction_input(gpio_nr);
|
||||
if (err)
|
||||
pr_err("Error %i in %s\n", err, __func__);
|
||||
return err;
|
||||
}
|
||||
device_initcall(nhk8815_eth_init);
|
||||
|
||||
static struct platform_device *nhk8815_platform_devices[] __initdata = {
|
||||
&nhk8815_nand_device,
|
||||
&nhk8815_onenand_device,
|
||||
&nhk8815_eth_device,
|
||||
/* will add more devices */
|
||||
};
|
||||
|
||||
static void __init nomadik_timer_init(void)
|
||||
{
|
||||
u32 src_cr;
|
||||
|
||||
/* Configure timer sources in "system reset controller" ctrl reg */
|
||||
src_cr = readl(io_p2v(NOMADIK_SRC_BASE));
|
||||
src_cr &= SRC_CR_INIT_MASK;
|
||||
src_cr |= SRC_CR_INIT_VAL;
|
||||
writel(src_cr, io_p2v(NOMADIK_SRC_BASE));
|
||||
|
||||
nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0);
|
||||
}
|
||||
|
||||
static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("stw4811", 0x2d),
|
||||
},
|
||||
};
|
||||
|
||||
static struct i2c_board_info __initdata nhk8815_i2c1_devices[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("camera", 0x10),
|
||||
},
|
||||
{
|
||||
I2C_BOARD_INFO("stw5095", 0x1a),
|
||||
},
|
||||
{
|
||||
I2C_BOARD_INFO("lis3lv02dl", 0x1d),
|
||||
},
|
||||
};
|
||||
|
||||
static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("stw4811-usb", 0x2d),
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned long out_low[] = { PIN_OUTPUT_LOW };
|
||||
static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
|
||||
static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
|
||||
static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
|
||||
|
||||
static struct pinctrl_map __initdata nhk8815_pinmap[] = {
|
||||
PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
|
||||
PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
|
||||
/* Hog in MMC/SD card mux */
|
||||
PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
|
||||
/* MCCLK */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
|
||||
/* MCCMD */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
|
||||
/* MCCMDDIR */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
|
||||
/* MCDAT3-0 */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
|
||||
/* MCDAT0DIR */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
|
||||
/* MCDAT31DIR */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
|
||||
/* MCMSFBCLK */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
|
||||
/* CD input GPIO */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
|
||||
/* CD bias drive */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
|
||||
};
|
||||
|
||||
static void __init nhk8815_platform_init(void)
|
||||
{
|
||||
pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
|
||||
cpu8815_platform_init();
|
||||
nhk8815_onenand_init();
|
||||
platform_add_devices(nhk8815_platform_devices,
|
||||
ARRAY_SIZE(nhk8815_platform_devices));
|
||||
|
||||
amba_apb_device_add(NULL, "uart0", NOMADIK_UART0_BASE, SZ_4K, IRQ_UART0, 0, NULL, 0);
|
||||
amba_apb_device_add(NULL, "uart1", NOMADIK_UART1_BASE, SZ_4K, IRQ_UART1, 0, NULL, 0);
|
||||
|
||||
i2c_register_board_info(0, nhk8815_i2c0_devices,
|
||||
ARRAY_SIZE(nhk8815_i2c0_devices));
|
||||
i2c_register_board_info(1, nhk8815_i2c1_devices,
|
||||
ARRAY_SIZE(nhk8815_i2c1_devices));
|
||||
i2c_register_board_info(2, nhk8815_i2c2_devices,
|
||||
ARRAY_SIZE(nhk8815_i2c2_devices));
|
||||
}
|
||||
|
||||
MACHINE_START(NOMADIK, "NHK8815")
|
||||
/* Maintainer: ST MicroElectronics */
|
||||
.atag_offset = 0x100,
|
||||
.map_io = cpu8815_map_io,
|
||||
.init_irq = cpu8815_init_irq,
|
||||
.init_time = nomadik_timer_init,
|
||||
.init_machine = nhk8815_platform_init,
|
||||
.restart = cpu8815_restart,
|
||||
MACHINE_END
|
|
@ -25,138 +25,308 @@
|
|||
#include <linux/slab.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/irqchip/arm-vic.h>
|
||||
#include <linux/irqchip.h>
|
||||
#include <linux/platform_data/clk-nomadik.h>
|
||||
#include <linux/platform_data/pinctrl-nomadik.h>
|
||||
#include <linux/pinctrl/machine.h>
|
||||
#include <linux/platform_data/clocksource-nomadik-mtu.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/mtd/fsmc.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/amba/mmci.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/mach/time.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
|
||||
#include "cpu-8815.h"
|
||||
|
||||
/* The 8815 has 4 GPIO blocks, let's register them immediately */
|
||||
static resource_size_t __initdata cpu8815_gpio_base[] = {
|
||||
NOMADIK_GPIO0_BASE,
|
||||
NOMADIK_GPIO1_BASE,
|
||||
NOMADIK_GPIO2_BASE,
|
||||
NOMADIK_GPIO3_BASE,
|
||||
};
|
||||
|
||||
static struct platform_device *
|
||||
cpu8815_add_gpio(int id, resource_size_t addr, int irq,
|
||||
struct nmk_gpio_platform_data *pdata)
|
||||
{
|
||||
struct resource resources[] = {
|
||||
{
|
||||
.start = addr,
|
||||
.end = addr + 127,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = irq,
|
||||
.end = irq,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
return platform_device_register_resndata(NULL, "gpio", id,
|
||||
resources, ARRAY_SIZE(resources),
|
||||
pdata, sizeof(*pdata));
|
||||
}
|
||||
|
||||
void cpu8815_add_gpios(resource_size_t *base, int num, int irq,
|
||||
struct nmk_gpio_platform_data *pdata)
|
||||
{
|
||||
int first = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++, first += 32, irq++) {
|
||||
pdata->first_gpio = first;
|
||||
pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first);
|
||||
pdata->num_gpio = 32;
|
||||
|
||||
cpu8815_add_gpio(i, base[i], irq, pdata);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
cpu8815_add_pinctrl(struct device *parent, const char *name)
|
||||
{
|
||||
struct platform_device_info pdevinfo = {
|
||||
.parent = parent,
|
||||
.name = name,
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
platform_device_register_full(&pdevinfo);
|
||||
}
|
||||
|
||||
static int __init cpu8815_init(void)
|
||||
{
|
||||
struct nmk_gpio_platform_data pdata = {
|
||||
/* No custom data yet */
|
||||
};
|
||||
|
||||
cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base),
|
||||
IRQ_GPIO0, &pdata);
|
||||
cpu8815_add_pinctrl(NULL, "pinctrl-stn8815");
|
||||
amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0);
|
||||
amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(cpu8815_init);
|
||||
|
||||
/* All SoC devices live in the same area (see hardware.h) */
|
||||
static struct map_desc nomadik_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = NOMADIK_IO_VIRTUAL,
|
||||
.pfn = __phys_to_pfn(NOMADIK_IO_PHYSICAL),
|
||||
.length = NOMADIK_IO_SIZE,
|
||||
.type = MT_DEVICE,
|
||||
}
|
||||
/* static ram and secured ram may be added later */
|
||||
};
|
||||
|
||||
void __init cpu8815_map_io(void)
|
||||
{
|
||||
iotable_init(nomadik_io_desc, ARRAY_SIZE(nomadik_io_desc));
|
||||
}
|
||||
|
||||
void __init cpu8815_init_irq(void)
|
||||
{
|
||||
/* This modified VIC cell has two register blocks, at 0 and 0x20 */
|
||||
vic_init(io_p2v(NOMADIK_IC_BASE + 0x00), IRQ_VIC_START + 0, ~0, 0);
|
||||
vic_init(io_p2v(NOMADIK_IC_BASE + 0x20), IRQ_VIC_START + 32, ~0, 0);
|
||||
|
||||
/*
|
||||
* Init clocks here so that they are available for system timer
|
||||
* initialization.
|
||||
*/
|
||||
nomadik_clk_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is called from the board init ("init_machine").
|
||||
* These are the only hard-coded address offsets we still have to use.
|
||||
*/
|
||||
void __init cpu8815_platform_init(void)
|
||||
#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */
|
||||
#define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */
|
||||
#define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */
|
||||
#define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */
|
||||
#define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */
|
||||
#define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */
|
||||
#define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */
|
||||
#define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */
|
||||
#define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */
|
||||
#define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */
|
||||
#define NOMADIK_XTI_BASE 0x101A0000 /* XTI */
|
||||
#define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */
|
||||
#define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */
|
||||
#define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */
|
||||
#define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */
|
||||
#define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */
|
||||
#define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */
|
||||
#define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */
|
||||
#define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */
|
||||
#define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */
|
||||
#define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */
|
||||
#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */
|
||||
#define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */
|
||||
#define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */
|
||||
#define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */
|
||||
#define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */
|
||||
#define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */
|
||||
#define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */
|
||||
#define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */
|
||||
#define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */
|
||||
#define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */
|
||||
#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */
|
||||
#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */
|
||||
#define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */
|
||||
#define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */
|
||||
#define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */
|
||||
#define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */
|
||||
#define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */
|
||||
#define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */
|
||||
#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */
|
||||
#define NOMADIK_UART1_VBASE 0xF01FB000
|
||||
|
||||
static unsigned long out_low[] = { PIN_OUTPUT_LOW };
|
||||
static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
|
||||
static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
|
||||
static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
|
||||
|
||||
static struct pinctrl_map __initdata nhk8815_pinmap[] = {
|
||||
PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
|
||||
PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
|
||||
/* Hog in MMC/SD card mux */
|
||||
PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
|
||||
/* MCCLK */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
|
||||
/* MCCMD */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
|
||||
/* MCCMDDIR */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
|
||||
/* MCDAT3-0 */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
|
||||
/* MCDAT0DIR */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
|
||||
/* MCDAT31DIR */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
|
||||
/* MCMSFBCLK */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
|
||||
/* CD input GPIO */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
|
||||
/* CD bias drive */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
|
||||
/* I2C0 */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO62_D3", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO63_D2", in_pullup),
|
||||
/* I2C1 */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO53_L4", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO54_L3", in_pullup),
|
||||
/* I2C2 */
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO73_C21", in_pullup),
|
||||
PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup),
|
||||
};
|
||||
|
||||
/* This is needed for LL-debug/earlyprintk/debug-macro.S */
|
||||
static struct map_desc cpu8815_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = NOMADIK_UART1_VBASE,
|
||||
.pfn = __phys_to_pfn(NOMADIK_UART1_BASE),
|
||||
.length = SZ_4K,
|
||||
.type = MT_DEVICE,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init cpu8815_map_io(void)
|
||||
{
|
||||
#ifdef CONFIG_CACHE_L2X0
|
||||
/* At full speed latency must be >=2, so 0x249 in low bits */
|
||||
l2x0_init(io_p2v(NOMADIK_L2CC_BASE), 0x00730249, 0xfe000fff);
|
||||
#endif
|
||||
return;
|
||||
iotable_init(cpu8815_io_desc, ARRAY_SIZE(cpu8815_io_desc));
|
||||
}
|
||||
|
||||
void cpu8815_restart(char mode, const char *cmd)
|
||||
static void cpu8815_restart(char mode, const char *cmd)
|
||||
{
|
||||
void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
|
||||
void __iomem *srcbase = ioremap(NOMADIK_SRC_BASE, SZ_4K);
|
||||
|
||||
/* FIXME: use egpio when implemented */
|
||||
|
||||
/* Write anything to Reset status register */
|
||||
writel(1, src_rstsr);
|
||||
writel(1, srcbase + 0x18);
|
||||
}
|
||||
|
||||
/* Initial value for SRC control register: all timers use MXTAL/8 source */
|
||||
#define SRC_CR_INIT_MASK 0x00007fff
|
||||
#define SRC_CR_INIT_VAL 0x2aaa8000
|
||||
|
||||
static void __init cpu8815_timer_init_of(void)
|
||||
{
|
||||
struct device_node *mtu;
|
||||
void __iomem *base;
|
||||
int irq;
|
||||
u32 src_cr;
|
||||
|
||||
/* We need this to be up now */
|
||||
nomadik_clk_init();
|
||||
|
||||
mtu = of_find_node_by_path("/mtu0");
|
||||
if (!mtu)
|
||||
return;
|
||||
base = of_iomap(mtu, 0);
|
||||
if (WARN_ON(!base))
|
||||
return;
|
||||
irq = irq_of_parse_and_map(mtu, 0);
|
||||
|
||||
pr_info("Remapped MTU @ %p, irq: %d\n", base, irq);
|
||||
|
||||
/* Configure timer sources in "system reset controller" ctrl reg */
|
||||
src_cr = readl(base);
|
||||
src_cr &= SRC_CR_INIT_MASK;
|
||||
src_cr |= SRC_CR_INIT_VAL;
|
||||
writel(src_cr, base);
|
||||
|
||||
nmdk_timer_init(base, irq);
|
||||
}
|
||||
|
||||
static struct fsmc_nand_timings cpu8815_nand_timings = {
|
||||
.thiz = 0,
|
||||
.thold = 0x10,
|
||||
.twait = 0x0A,
|
||||
.tset = 0,
|
||||
};
|
||||
|
||||
static struct fsmc_nand_platform_data cpu8815_nand_data = {
|
||||
.nand_timings = &cpu8815_nand_timings,
|
||||
};
|
||||
|
||||
/*
|
||||
* The SMSC911x IRQ is connected to a GPIO pin, but the driver expects
|
||||
* to simply request an IRQ passed as a resource. So the GPIO pin needs
|
||||
* to be requested by this hog and set as input.
|
||||
*/
|
||||
static int __init cpu8815_eth_init(void)
|
||||
{
|
||||
struct device_node *eth;
|
||||
int gpio, irq, err;
|
||||
|
||||
eth = of_find_node_by_path("/usb-s8815/ethernet-gpio");
|
||||
if (!eth) {
|
||||
pr_info("could not find any ethernet GPIO\n");
|
||||
return 0;
|
||||
}
|
||||
gpio = of_get_gpio(eth, 0);
|
||||
err = gpio_request(gpio, "eth_irq");
|
||||
if (err) {
|
||||
pr_info("failed to request ethernet GPIO\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
err = gpio_direction_input(gpio);
|
||||
if (err) {
|
||||
pr_info("failed to set ethernet GPIO as input\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
irq = gpio_to_irq(gpio);
|
||||
pr_info("enabled USB-S8815 ethernet GPIO %d, IRQ %d\n", gpio, irq);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(cpu8815_eth_init);
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* cannot be set from device tree, convert to a proper DT
|
||||
* binding.
|
||||
*/
|
||||
static struct mmci_platform_data mmcsd_plat_data = {
|
||||
.ocr_mask = MMC_VDD_29_30,
|
||||
};
|
||||
|
||||
/*
|
||||
* This GPIO pin turns on a line that is used to detect card insertion
|
||||
* on this board.
|
||||
*/
|
||||
static int __init cpu8815_mmcsd_init(void)
|
||||
{
|
||||
struct device_node *cdbias;
|
||||
int gpio, err;
|
||||
|
||||
cdbias = of_find_node_by_path("/usb-s8815/mmcsd-gpio");
|
||||
if (!cdbias) {
|
||||
pr_info("could not find MMC/SD card detect bias node\n");
|
||||
return 0;
|
||||
}
|
||||
gpio = of_get_gpio(cdbias, 0);
|
||||
if (gpio < 0) {
|
||||
pr_info("could not obtain MMC/SD card detect bias GPIO\n");
|
||||
return 0;
|
||||
}
|
||||
err = gpio_request(gpio, "card detect bias");
|
||||
if (err) {
|
||||
pr_info("failed to request card detect bias GPIO %d\n", gpio);
|
||||
return -ENODEV;
|
||||
}
|
||||
err = gpio_direction_output(gpio, 0);
|
||||
if (err){
|
||||
pr_info("failed to set GPIO %d as output, low\n", gpio);
|
||||
return err;
|
||||
}
|
||||
pr_info("enabled USB-S8815 CD bias GPIO %d, low\n", gpio);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(cpu8815_mmcsd_init);
|
||||
|
||||
|
||||
/* These are mostly to get the right device names for the clock lookups */
|
||||
static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
|
||||
OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE,
|
||||
"gpio.0", NULL),
|
||||
OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO1_BASE,
|
||||
"gpio.1", NULL),
|
||||
OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO2_BASE,
|
||||
"gpio.2", NULL),
|
||||
OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO3_BASE,
|
||||
"gpio.3", NULL),
|
||||
OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0,
|
||||
"pinctrl-stn8815", NULL),
|
||||
OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE,
|
||||
"uart0", NULL),
|
||||
OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART1_BASE,
|
||||
"uart1", NULL),
|
||||
OF_DEV_AUXDATA("arm,primecell", NOMADIK_RNG_BASE,
|
||||
"rng", NULL),
|
||||
OF_DEV_AUXDATA("arm,primecell", NOMADIK_RTC_BASE,
|
||||
"rtc-pl031", NULL),
|
||||
OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
|
||||
"fsmc-nand", &cpu8815_nand_data),
|
||||
OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE,
|
||||
"mmci", &mmcsd_plat_data),
|
||||
{ /* sentinel */ },
|
||||
};
|
||||
|
||||
static void __init cpu8815_init_of(void)
|
||||
{
|
||||
#ifdef CONFIG_CACHE_L2X0
|
||||
/* At full speed latency must be >=2, so 0x249 in low bits */
|
||||
l2x0_of_init(0x00730249, 0xfe000fff);
|
||||
#endif
|
||||
pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
|
||||
of_platform_populate(NULL, of_default_bus_match_table,
|
||||
cpu8815_auxdata_lookup, NULL);
|
||||
}
|
||||
|
||||
static const char * cpu8815_board_compat[] = {
|
||||
"calaosystems,usb-s8815",
|
||||
NULL,
|
||||
};
|
||||
|
||||
DT_MACHINE_START(NOMADIK_DT, "Nomadik STn8815")
|
||||
.map_io = cpu8815_map_io,
|
||||
.init_irq = irqchip_init,
|
||||
.init_time = cpu8815_timer_init_of,
|
||||
.init_machine = cpu8815_init_of,
|
||||
.restart = cpu8815_restart,
|
||||
.dt_compat = cpu8815_board_compat,
|
||||
MACHINE_END
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
extern void cpu8815_map_io(void);
|
||||
extern void cpu8815_platform_init(void);
|
||||
extern void cpu8815_init_irq(void);
|
||||
extern void cpu8815_restart(char, const char *);
|
|
@ -1,88 +0,0 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/i2c-algo-bit.h>
|
||||
#include <linux/i2c-gpio.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/platform_data/pinctrl-nomadik.h>
|
||||
|
||||
/*
|
||||
* There are two busses in the 8815NHK.
|
||||
* They could, in theory, be driven by the hardware component, but we
|
||||
* use bit-bang through GPIO by now, to keep things simple
|
||||
*/
|
||||
|
||||
/* I2C0 connected to the STw4811 power management chip */
|
||||
static struct i2c_gpio_platform_data nhk8815_i2c_data0 = {
|
||||
/* keep defaults for timeouts; pins are push-pull bidirectional */
|
||||
.scl_pin = 62,
|
||||
.sda_pin = 63,
|
||||
};
|
||||
|
||||
/* I2C1 connected to various sensors */
|
||||
static struct i2c_gpio_platform_data nhk8815_i2c_data1 = {
|
||||
/* keep defaults for timeouts; pins are push-pull bidirectional */
|
||||
.scl_pin = 53,
|
||||
.sda_pin = 54,
|
||||
};
|
||||
|
||||
/* I2C2 connected to the USB portions of the STw4811 only */
|
||||
static struct i2c_gpio_platform_data nhk8815_i2c_data2 = {
|
||||
/* keep defaults for timeouts; pins are push-pull bidirectional */
|
||||
.scl_pin = 73,
|
||||
.sda_pin = 74,
|
||||
};
|
||||
|
||||
static struct platform_device nhk8815_i2c_dev0 = {
|
||||
.name = "i2c-gpio",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &nhk8815_i2c_data0,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device nhk8815_i2c_dev1 = {
|
||||
.name = "i2c-gpio",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &nhk8815_i2c_data1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device nhk8815_i2c_dev2 = {
|
||||
.name = "i2c-gpio",
|
||||
.id = 2,
|
||||
.dev = {
|
||||
.platform_data = &nhk8815_i2c_data2,
|
||||
},
|
||||
};
|
||||
|
||||
static pin_cfg_t cpu8815_pins_i2c[] = {
|
||||
PIN_CFG_INPUT(62, GPIO, PULLUP),
|
||||
PIN_CFG_INPUT(63, GPIO, PULLUP),
|
||||
PIN_CFG_INPUT(53, GPIO, PULLUP),
|
||||
PIN_CFG_INPUT(54, GPIO, PULLUP),
|
||||
PIN_CFG_INPUT(73, GPIO, PULLUP),
|
||||
PIN_CFG_INPUT(74, GPIO, PULLUP),
|
||||
};
|
||||
|
||||
static int __init nhk8815_i2c_init(void)
|
||||
{
|
||||
nmk_config_pins(cpu8815_pins_i2c, ARRAY_SIZE(cpu8815_pins_i2c));
|
||||
platform_device_register(&nhk8815_i2c_dev0);
|
||||
platform_device_register(&nhk8815_i2c_dev1);
|
||||
platform_device_register(&nhk8815_i2c_dev2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit nhk8815_i2c_exit(void)
|
||||
{
|
||||
platform_device_unregister(&nhk8815_i2c_dev0);
|
||||
platform_device_unregister(&nhk8815_i2c_dev1);
|
||||
platform_device_unregister(&nhk8815_i2c_dev2);
|
||||
return;
|
||||
}
|
||||
|
||||
module_init(nhk8815_i2c_init);
|
||||
module_exit(nhk8815_i2c_exit);
|
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
* This file contains the hardware definitions of the Nomadik.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
#ifndef __ASM_ARCH_HARDWARE_H
|
||||
#define __ASM_ARCH_HARDWARE_H
|
||||
|
||||
/* Nomadik registers live from 0x1000.0000 to 0x1023.0000 -- currently */
|
||||
#define NOMADIK_IO_VIRTUAL 0xF0000000 /* VA of IO */
|
||||
#define NOMADIK_IO_PHYSICAL 0x10000000 /* PA of IO */
|
||||
#define NOMADIK_IO_SIZE 0x00300000 /* 3MB for all regs */
|
||||
|
||||
/* used in C code, so cast to proper type */
|
||||
#define io_p2v(x) ((void __iomem *)(x) \
|
||||
- NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
|
||||
#define io_v2p(x) ((unsigned long)(x) \
|
||||
- NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL)
|
||||
|
||||
/* used in asm code, so no casts */
|
||||
#define IO_ADDRESS(x) IOMEM((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
|
||||
|
||||
/*
|
||||
* Base address defination for Nomadik Onchip Logic Block
|
||||
*/
|
||||
#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */
|
||||
#define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */
|
||||
#define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */
|
||||
#define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */
|
||||
#define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */
|
||||
#define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */
|
||||
#define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */
|
||||
#define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */
|
||||
#define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */
|
||||
#define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */
|
||||
#define NOMADIK_XTI_BASE 0x101A0000 /* XTI */
|
||||
#define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */
|
||||
#define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */
|
||||
#define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */
|
||||
#define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */
|
||||
#define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */
|
||||
#define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */
|
||||
#define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */
|
||||
#define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */
|
||||
#define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */
|
||||
#define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */
|
||||
#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */
|
||||
#define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */
|
||||
#define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */
|
||||
#define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */
|
||||
#define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */
|
||||
#define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */
|
||||
#define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */
|
||||
#define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */
|
||||
#define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */
|
||||
#define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */
|
||||
#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */
|
||||
#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */
|
||||
#define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */
|
||||
#define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */
|
||||
#define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */
|
||||
#define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */
|
||||
#define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */
|
||||
#define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */
|
||||
#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */
|
||||
|
||||
/* Other ranges, not for p2v/v2p */
|
||||
#define NOMADIK_BACKUP_RAM 0x80010000
|
||||
#define NOMADIK_EBROM 0x80000000 /* Embedded boot ROM */
|
||||
#define NOMADIK_HAMACV_DMEM_BASE 0xA0100000 /* HAMACV Data Memory Start */
|
||||
#define NOMADIK_HAMACV_DMEM_END 0xA01FFFFF /* HAMACV Data Memory End */
|
||||
#define NOMADIK_HAMACA_DMEM 0xA0200000 /* HAMACA Data Memory Space */
|
||||
|
||||
#define NOMADIK_FSMC_VA IO_ADDRESS(NOMADIK_FSMC_BASE)
|
||||
#define NOMADIK_MTU0_VA IO_ADDRESS(NOMADIK_MTU0_BASE)
|
||||
#define NOMADIK_MTU1_VA IO_ADDRESS(NOMADIK_MTU1_BASE)
|
||||
|
||||
#endif /* __ASM_ARCH_HARDWARE_H */
|
|
@ -20,8 +20,6 @@
|
|||
#ifndef __ASM_ARCH_IRQS_H
|
||||
#define __ASM_ARCH_IRQS_H
|
||||
|
||||
#include <mach/hardware.h>
|
||||
|
||||
#define IRQ_VIC_START 32 /* first VIC interrupt is 1 */
|
||||
|
||||
/*
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/io.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
/* we need the constants in amba/serial.h, but it refers to amba_device */
|
||||
struct amba_device;
|
||||
|
|
|
@ -1218,6 +1218,7 @@ static SIMPLE_DEV_PM_OPS(fsmc_nand_pm_ops, fsmc_nand_suspend, fsmc_nand_resume);
|
|||
#ifdef CONFIG_OF
|
||||
static const struct of_device_id fsmc_nand_id_table[] = {
|
||||
{ .compatible = "st,spear600-fsmc-nand" },
|
||||
{ .compatible = "stericsson,fsmc-nand" },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, fsmc_nand_id_table);
|
||||
|
|
|
@ -1845,6 +1845,10 @@ static struct pinctrl_desc nmk_pinctrl_desc = {
|
|||
};
|
||||
|
||||
static const struct of_device_id nmk_pinctrl_match[] = {
|
||||
{
|
||||
.compatible = "stericsson,nmk-pinctrl-stn8815",
|
||||
.data = (void *)PINCTRL_NMK_STN8815,
|
||||
},
|
||||
{
|
||||
.compatible = "stericsson,nmk_pinctrl",
|
||||
.data = (void *)PINCTRL_NMK_DB8500,
|
||||
|
|
Загрузка…
Ссылка в новой задаче