From 724cfb944007b7f8d346523a7810b53a35921bc5 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Tue, 28 Apr 2009 08:02:13 +0000 Subject: sh: smsc911x support for the rsk7203 board This patch adds support for the LAN9118 ethernet on rsk7203. The LAN9118 controller is hooked up using a 16-bit data bus, but the rsk7203 board does not swap the byte lanes as needed between the sh7203 processor and the the ethernet controller. In the processor the CS memory window is configured in 16-bit mode but the smsc911x driver is told to do 32-bit accesses to improve performance. The SMSC911X_SWAP_FIFO flag is used to tell the driver to do software byte swapping of fifo data. Signed-off-by: Magnus Damm Acked-by: Steve Glendinning Signed-off-by: Paul Mundt --- arch/sh/boards/mach-rsk/devices-rsk7203.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/boards/mach-rsk/devices-rsk7203.c b/arch/sh/boards/mach-rsk/devices-rsk7203.c index d8a65ea9166..4af3a771c05 100644 --- a/arch/sh/boards/mach-rsk/devices-rsk7203.c +++ b/arch/sh/boards/mach-rsk/devices-rsk7203.c @@ -26,13 +26,13 @@ static struct smsc911x_platform_config smsc911x_config = { .phy_interface = PHY_INTERFACE_MODE_MII, .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, - .flags = SMSC911X_USE_16BIT, + .flags = SMSC911X_USE_32BIT | SMSC911X_SWAP_FIFO, }; static struct resource smsc911x_resources[] = { [0] = { .start = 0x24000000, - .end = 0x24000000 + 0x100, + .end = 0x240000ff, .flags = IORESOURCE_MEM, }, [1] = { @@ -99,6 +99,10 @@ static int __init rsk7203_devices_setup(void) gpio_request(GPIO_FN_TXD0, NULL); gpio_request(GPIO_FN_RXD0, NULL); + /* Setup LAN9118: CS1 in 16-bit Big Endian Mode, IRQ0 at Port B */ + ctrl_outl(0x36db0400, 0xfffc0008); /* CS1BCR */ + gpio_request(GPIO_FN_IRQ0_PB, NULL); + return platform_add_devices(rsk7203_devices, ARRAY_SIZE(rsk7203_devices)); } -- cgit v1.2.3 From 66765fe1b62e4c0eee3b7e3aa1eb34e5428f52ec Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Tue, 16 Jun 2009 06:26:08 +0900 Subject: sh: pci: SH7786 PCI ops. This adds in preliminary support for the SH7786 PCIe module PCI ops, and the corresponding module definitions. Signed-off-by: Paul Mundt --- arch/sh/drivers/pci/Makefile | 1 + arch/sh/drivers/pci/ops-sh7786.c | 134 +++++++++ arch/sh/drivers/pci/pcie-sh7786.h | 589 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 724 insertions(+) create mode 100644 arch/sh/drivers/pci/ops-sh7786.c create mode 100644 arch/sh/drivers/pci/pcie-sh7786.h (limited to 'arch/sh') diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile index d2ffc477549..d6303d0e494 100644 --- a/arch/sh/drivers/pci/Makefile +++ b/arch/sh/drivers/pci/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o obj-$(CONFIG_CPU_SUBTYPE_SH7763) += pci-sh7780.o ops-sh4.o obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o +obj-$(CONFIG_CPU_SUBTYPE_SH7786) += ops-sh7786.o obj-$(CONFIG_CPU_SH5) += pci-sh5.o ops-sh5.o obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \ diff --git a/arch/sh/drivers/pci/ops-sh7786.c b/arch/sh/drivers/pci/ops-sh7786.c new file mode 100644 index 00000000000..48f594b9582 --- /dev/null +++ b/arch/sh/drivers/pci/ops-sh7786.c @@ -0,0 +1,134 @@ +/* + * Generic SH7786 PCI-Express operations. + * + * Copyright (C) 2009 Paul Mundt + * + * This file is subject to the terms and conditions of the GNU General Public + * License v2. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#include +#include +#include +#include +#include +#include "pcie-sh7786.h" + +enum { + PCI_ACCESS_READ, + PCI_ACCESS_WRITE, +}; + +static DEFINE_SPINLOCK(sh7786_pcie_lock); + +static int sh7786_pcie_config_access(unsigned char access_type, + struct pci_bus *bus, unsigned int devfn, int where, u32 *data) +{ + struct pci_channel *chan = bus->sysdata; + int dev, func; + + dev = PCI_SLOT(devfn); + func = PCI_FUNC(devfn); + + if (bus->number > 255 || dev > 31 || func > 7) + return PCIBIOS_FUNC_NOT_SUPPORTED; + if (devfn) + return PCIBIOS_DEVICE_NOT_FOUND; + + /* Set the PIO address */ + pci_write_reg(chan, (bus->number << 24) | (dev << 19) | + (func << 16) | (where & ~3), SH4A_PCIEPAR); + + /* Enable the configuration access */ + pci_write_reg(chan, (1 << 31), SH4A_PCIEPCTLR); + + if (access_type == PCI_ACCESS_READ) + *data = pci_read_reg(chan, SH4A_PCIEPDR); + else + pci_write_reg(chan, *data, SH4A_PCIEPDR); + + /* Check for master and target aborts */ + if (pci_read_reg(chan, SH4A_PCIEPCICONF1) & ((1 << 29) | (1 << 28))) + return PCIBIOS_DEVICE_NOT_FOUND; + + return PCIBIOS_SUCCESSFUL; +} + +static int sh7786_pcie_read(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val) +{ + unsigned long flags; + int ret; + u32 data; + + if ((size == 2) && (where & 1)) + return PCIBIOS_BAD_REGISTER_NUMBER; + else if ((size == 4) && (where & 3)) + return PCIBIOS_BAD_REGISTER_NUMBER; + + spin_lock_irqsave(&sh7786_pcie_lock, flags); + ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, + devfn, where, &data); + if (ret != PCIBIOS_SUCCESSFUL) + goto out; + + if (size == 1) + *val = (data >> ((where & 3) << 3)) & 0xff; + else if (size == 2) + *val = (data >> ((where & 2) << 3)) & 0xffff; + else + *val = data; + + dev_dbg(&bus->dev, "pcie-config-read: bus=%3d devfn=0x%04x " + "where=0x%04x size=%d val=0x%08lx\n", bus->number, + devfn, where, size, (unsigned long)*val); + +out: + spin_unlock_irqrestore(&sh7786_pcie_lock, flags); + return ret; +} + +static int sh7786_pcie_write(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 val) +{ + unsigned long flags; + int shift, ret; + u32 data; + + if ((size == 2) && (where & 1)) + return PCIBIOS_BAD_REGISTER_NUMBER; + else if ((size == 4) && (where & 3)) + return PCIBIOS_BAD_REGISTER_NUMBER; + + spin_lock_irqsave(&sh7786_pcie_lock, flags); + ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, + devfn, where, &data); + if (ret != PCIBIOS_SUCCESSFUL) + goto out; + + dev_dbg(&bus->dev, "pcie-config-write: bus=%3d devfn=0x%04x " + "where=0x%04x size=%d val=%08lx\n", bus->number, + devfn, where, size, (unsigned long)val); + + if (size == 1) { + shift = (where & 3) << 3; + data &= ~(0xff << shift); + data |= ((val & 0xff) << shift); + } else if (size == 2) { + shift = (where & 2) << 3; + data &= ~(0xffff << shift); + data |= ((val & 0xffff) << shift); + } else + data = val; + + ret = sh7786_pcie_config_access(PCI_ACCESS_WRITE, bus, + devfn, where, &data); +out: + spin_unlock_irqrestore(&sh7786_pcie_lock, flags); + return ret; +} + +struct pci_ops sh7786_pci_ops = { + .read = sh7786_pcie_read, + .write = sh7786_pcie_write, +}; diff --git a/arch/sh/drivers/pci/pcie-sh7786.h b/arch/sh/drivers/pci/pcie-sh7786.h new file mode 100644 index 00000000000..c655290a775 --- /dev/null +++ b/arch/sh/drivers/pci/pcie-sh7786.h @@ -0,0 +1,589 @@ +/* + * SH7786 PCI-Express controller definitions. + * + * Copyright (C) 2008, 2009 Renesas Technology Corp. + * All rights reserved. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#ifndef __PCI_SH7786_H +#define __PCI_SH7786_H + +/* PCIe bus-0(x4) on SH7786 */ // Rev1.171 +#define SH4A_PCIE_SPW_BASE 0xFE000000 /* spw config address for controller 0 */ +#define SH4A_PCIE_SPW_BASE1 0xFE200000 /* spw config address for controller 1 (Rev1.14)*/ +#define SH4A_PCIE_SPW_BASE2 0xFCC00000 /* spw config address for controller 2 (Rev1.171)*/ +#define SH4A_PCIE_SPW_BASE_LEN 0x00080000 + +#define SH4A_PCI_CNFG_BASE 0xFE040000 /* pci config address for controller 0 */ +#define SH4A_PCI_CNFG_BASE1 0xFE240000 /* pci config address for controller 1 (Rev1.14)*/ +#define SH4A_PCI_CNFG_BASE2 0xFCC40000 /* pci config address for controller 2 (Rev1.171)*/ +#define SH4A_PCI_CNFG_BASE_LEN 0x00040000 + +#define SH4A_PCIPIO_ADDR_OFFSET 0x000001c0 /* offset to pci config_address */ +#define SH4A_PCIPIO_DATA_OFFSET 0x00000220 /* offset to pci config_data */ + +/* + * for PEX8111(Max Payload Size=128B,PCIIO_SIZE=64K), + * for other(Max Payload Size=4096B,PCIIO_SIZE=8M) + */ + +/* PCI0-0: PCI I/O space */ +#define SH4A_PCIIO_BASE 0xFD000000 /* PCI I/O for controller 0 */ +#define SH4A_PCIIO_BASE1 0xFD800000 /* PCI I/O for controller 1 (Rev1.14)*/ +#define SH4A_PCIIO_BASE2 0xFC800000 /* PCI I/O for controller 2 (Rev1.171)*/ + +#define SH4A_PCIIO_SIZE64 0x00010000 /* PLX allows only 64K */ +#define SH4A_PCIIO_SIZE 0x00800000 /* 8M */ +#define SH4A_PCIIO_SIZE2 0x00400000 /* 4M (Rev1.171)*/ + +/* PCI0-1: PCI memory space 29-bit address */ +#define SH4A_PCIMEM_BASE 0x10000000 +#define SH4A_PCIMEM_SIZE 0x04000000 /* 64M */ + +/* PCI0-2: PCI memory space 32-bit address */ +#define SH4A_PCIMEM_BASEA 0xC0000000 /* for controller 0 */ +#define SH4A_PCIMEM_BASEA1 0xA0000000 /* for controller 1 (Rev1.14)*/ +#define SH4A_PCIMEM_BASEA2 0x80000000 /* for controller 2 (Rev1.171)*/ +#define SH4A_PCIMEM_SIZEA 0x20000000 /* 512M */ + +/* PCI0: PCI memory target transfer 32-bit address translation value(Rev1.11T)*/ +#define SH4A_PCIBMSTR_TRANSLATION 0x20000000 + +#define SH4A_PCI_DEVICE_ID 0x0002 +#define SH4A_PCI_VENDOR_ID 0x1912 + +// PCI compatible 000-03f +#define PCI_CMD 0x004 +#define PCI_RID 0x008 +#define PCI_IBAR 0x010 +#define PCI_MBAR0 0x014 +#define PCI_MBAR1 0x018 + +/* PCI power management/MSI/capablity 040-0ff */ +/* PCIE extended 100-fff */ + +/* SH7786 device identification */ // Rev1.171 +#define SH4A_PVR (0xFF000030) +#define SH4A_PVR_SHX3 (0x10400000) +#define SH4A_PRR (0xFF000044) +#define SH4A_PRR_SH7786 (0x00000400) // Rev1.171 + +/* SPVCR0 */ +#define SH4A_PCIEVCR0 (0x000000) /* R - 0x0000 0000 32 */ +#define BITS_TOP_MB (24) +#define MASK_TOP_MB (0xff<reg_base + reg); +} + +static inline unsigned long +pci_read_reg(struct pci_channel *chan, unsigned long reg) +{ + return __raw_readl(chan->reg_base + reg); +} + +#endif /* __PCI_SH7786_H */ -- cgit v1.2.3 From f01789c68882d846946cf9b972cf090b283d1f73 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 17 Jun 2009 10:43:13 +0900 Subject: sh: Use generic atomic64_t implementation. Signed-off-by: Paul Mundt --- arch/sh/Kconfig | 1 + arch/sh/include/asm/atomic.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'arch/sh') diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 586cd045e2d..a6f9eaa6e0b 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -16,6 +16,7 @@ config SUPERH select HAVE_ARCH_TRACEHOOK select HAVE_DMA_API_DEBUG select RTC_LIB + select GENERIC_ATOMIC64 help The SuperH is a RISC processor targeted for use in embedded systems and consumer electronics; it was also used in the Sega Dreamcast diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h index 157c320272c..e8e78137c6f 100644 --- a/arch/sh/include/asm/atomic.h +++ b/arch/sh/include/asm/atomic.h @@ -85,4 +85,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) #define smp_mb__after_atomic_inc() barrier() #include +#include + #endif /* __ASM_SH_ATOMIC_H */ -- cgit v1.2.3 From bb1f17b0372de93758653ca3454bc0df18dc2e5c Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 16 Jun 2009 15:31:18 -0700 Subject: mm: consolidate init_mm definition * create mm/init-mm.c, move init_mm there * remove INIT_MM, initialize init_mm with C99 initializer * unexport init_mm on all arches: init_mm is already unexported on x86. One strange place is some OMAP driver (drivers/video/omap/) which won't build modular, but it's already wants get_vm_area() export. Somebody should look there. [akpm@linux-foundation.org: add missing #includes] Signed-off-by: Alexey Dobriyan Cc: Mike Frysinger Cc: Americo Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/sh/kernel/init_task.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c index 80c35ff71d5..1719957c0a6 100644 --- a/arch/sh/kernel/init_task.c +++ b/arch/sh/kernel/init_task.c @@ -10,9 +10,6 @@ static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); struct pt_regs fake_swapper_regs; -struct mm_struct init_mm = INIT_MM(init_mm); -EXPORT_SYMBOL(init_mm); - /* * Initial thread structure. * -- cgit v1.2.3 From e4c9dd0fbad60c098a026e9b06d9de1bc98c5e89 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 16 Jun 2009 15:33:47 -0700 Subject: kmap_types: make most arches use generic header file Convert most arches to use asm-generic/kmap_types.h. Move the KM_FENCE_ macro additions into asm-generic/kmap_types.h, controlled by __WITH_KM_FENCE from each arch's kmap_types.h file. Would be nice to be able to add custom KM_types per arch, but I don't yet see a nice, clean way to do that. Built on x86_64, i386, mips, sparc, alpha(tonyb), powerpc(tonyb), and 68k(tonyb). Note: avr32 should be able to remove KM_PTE2 (since it's not used) and then just use the generic kmap_types.h file. Get avr32 maintainer approval. Signed-off-by: Randy Dunlap Cc: Acked-by: Mike Frysinger Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Bryan Wu Cc: Mikael Starvik Cc: Hirokazu Takata Cc: "Luck Tony" Cc: Geert Uytterhoeven Cc: Ralf Baechle Cc: David Howells Cc: Kyle McMartin Cc: Martin Schwidefsky Cc: Paul Mundt Cc: "David S. Miller" Cc: Ingo Molnar Cc: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Arnd Bergmann Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/sh/include/asm/kmap_types.h | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/include/asm/kmap_types.h b/arch/sh/include/asm/kmap_types.h index 84d565c696b..5962b08b6dd 100644 --- a/arch/sh/include/asm/kmap_types.h +++ b/arch/sh/include/asm/kmap_types.h @@ -3,30 +3,12 @@ /* Dummy header just to define km_type. */ - #ifdef CONFIG_DEBUG_HIGHMEM -# define D(n) __KM_FENCE_##n , -#else -# define D(n) +#define __WITH_KM_FENCE #endif -enum km_type { -D(0) KM_BOUNCE_READ, -D(1) KM_SKB_SUNRPC_DATA, -D(2) KM_SKB_DATA_SOFTIRQ, -D(3) KM_USER0, -D(4) KM_USER1, -D(5) KM_BIO_SRC_IRQ, -D(6) KM_BIO_DST_IRQ, -D(7) KM_PTE0, -D(8) KM_PTE1, -D(9) KM_IRQ0, -D(10) KM_IRQ1, -D(11) KM_SOFTIRQ0, -D(12) KM_SOFTIRQ1, -D(13) KM_TYPE_NR -}; +#include -#undef D +#undef __WITH_KM_FENCE #endif -- cgit v1.2.3 From 5a62a22514f97c04b434163195820cbe31ded888 Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Tue, 26 May 2009 09:33:02 +0000 Subject: sh: sh7785lcr: add platform data for r8a66597-hcd and remove redundant parameter for r8a66597-hcd. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Paul Mundt --- arch/sh/boards/board-sh7785lcr.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c index 7be56fb06c1..42410a15d25 100644 --- a/arch/sh/boards/board-sh7785lcr.c +++ b/arch/sh/boards/board-sh7785lcr.c @@ -15,16 +15,18 @@ #include #include #include +#include #include #include #include +#include #include #include #include #include +#include #include #include -#include /* * NOTE: This board has 2 physical memory maps. @@ -98,18 +100,21 @@ static struct platform_device nor_flash_device = { .resource = nor_flash_resources, }; +static struct r8a66597_platdata r8a66597_data = { + .xtal = R8A66597_PLATDATA_XTAL_12MHZ, + .vif = 1, +}; + static struct resource r8a66597_usb_host_resources[] = { [0] = { - .name = "r8a66597_hcd", .start = R8A66597_ADDR, .end = R8A66597_ADDR + R8A66597_SIZE - 1, .flags = IORESOURCE_MEM, }, [1] = { - .name = "r8a66597_hcd", .start = 2, .end = 2, - .flags = IORESOURCE_IRQ, + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, }, }; @@ -119,6 +124,7 @@ static struct platform_device r8a66597_usb_host_device = { .dev = { .dma_mask = NULL, .coherent_dma_mask = 0xffffffff, + .platform_data = &r8a66597_data, }, .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources), .resource = r8a66597_usb_host_resources, -- cgit v1.2.3 From 6239b20d1ba60810c122390e79f968ccb69908a6 Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Tue, 26 May 2009 09:33:05 +0000 Subject: sh: highlander: add platform data for r8a66597-hcd and remove redundant parameter for r8a66597-hcd. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Paul Mundt --- arch/sh/boards/mach-highlander/setup.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c index 20fe72c515d..920ea76abac 100644 --- a/arch/sh/boards/mach-highlander/setup.c +++ b/arch/sh/boards/mach-highlander/setup.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include #include @@ -27,18 +29,21 @@ #include #include +static struct r8a66597_platdata r8a66597_data = { + .xtal = R8A66597_PLATDATA_XTAL_12MHZ, + .vif = 1, +}; + static struct resource r8a66597_usb_host_resources[] = { [0] = { - .name = "r8a66597_hcd", .start = 0xA4200000, .end = 0xA42000FF, .flags = IORESOURCE_MEM, }, [1] = { - .name = "r8a66597_hcd", .start = IRQ_EXT1, /* irq number */ .end = IRQ_EXT1, - .flags = IORESOURCE_IRQ, + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, }, }; @@ -48,6 +53,7 @@ static struct platform_device r8a66597_usb_host_device = { .dev = { .dma_mask = NULL, /* don't use dma */ .coherent_dma_mask = 0xffffffff, + .platform_data = &r8a66597_data, }, .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources), .resource = r8a66597_usb_host_resources, -- cgit v1.2.3 From fcaf99d20d86995cfa1a4f01b1273f9f7d74717e Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Tue, 26 May 2009 09:33:08 +0000 Subject: sh: x3proto: add platform data for r8a66597-hcd and remove redundant parameter for r8a66597-hcd. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Paul Mundt --- arch/sh/boards/mach-x3proto/setup.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/boards/mach-x3proto/setup.c b/arch/sh/boards/mach-x3proto/setup.c index a340492087f..8913ae39a80 100644 --- a/arch/sh/boards/mach-x3proto/setup.c +++ b/arch/sh/boards/mach-x3proto/setup.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include static struct resource heartbeat_resources[] = { @@ -58,17 +60,20 @@ static struct platform_device smc91x_device = { }, }; +static struct r8a66597_platdata r8a66597_data = { + .xtal = R8A66597_PLATDATA_XTAL_12MHZ, + .vif = 1, +}; + static struct resource r8a66597_usb_host_resources[] = { [0] = { - .name = "r8a66597_hcd", .start = 0x18040000, .end = 0x18080000 - 1, .flags = IORESOURCE_MEM, }, [1] = { - .name = "r8a66597_hcd", /* Filled in by ilsel */ - .flags = IORESOURCE_IRQ, + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, }, }; @@ -78,6 +83,7 @@ static struct platform_device r8a66597_usb_host_device = { .dev = { .dma_mask = NULL, /* don't use dma */ .coherent_dma_mask = 0xffffffff, + .platform_data = &r8a66597_data, }, .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources), .resource = r8a66597_usb_host_resources, -- cgit v1.2.3 From 6b64929c1e696090f32c31782e44d3b51754126f Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Tue, 26 May 2009 09:33:11 +0000 Subject: sh: add platform data for r8a66597-hcd in setup-sh7366 and remove redundant parameter for r8a66597-hcd. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Paul Mundt --- arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c index 318516f6bfa..c18f7d09281 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c @@ -15,6 +15,7 @@ #include #include #include +#include #include static struct resource iic_resources[] = { @@ -38,18 +39,20 @@ static struct platform_device iic_device = { .resource = iic_resources, }; +static struct r8a66597_platdata r8a66597_data = { + /* This set zero to all members */ +}; + static struct resource usb_host_resources[] = { [0] = { - .name = "r8a66597_hcd", .start = 0xa4d80000, .end = 0xa4d800ff, .flags = IORESOURCE_MEM, }, [1] = { - .name = "r8a66597_hcd", .start = 65, .end = 65, - .flags = IORESOURCE_IRQ, + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, }, }; @@ -59,6 +62,7 @@ static struct platform_device usb_host_device = { .dev = { .dma_mask = NULL, .coherent_dma_mask = 0xffffffff, + .platform_data = &r8a66597_data, }, .num_resources = ARRAY_SIZE(usb_host_resources), .resource = usb_host_resources, -- cgit v1.2.3 From f73c8f53ccc13ae13c6dbfa002083448a5ad0c81 Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Tue, 26 May 2009 09:33:14 +0000 Subject: sh: add platform data for r8a66597-hcd in setup-sh7723 and remove redundant parameter for r8a66597-hcd. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Paul Mundt --- arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c index d8f4a13aeff..e1bb80b2a27 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -396,9 +397,12 @@ static struct platform_device rtc_device = { .resource = rtc_resources, }; +static struct r8a66597_platdata r8a66597_data = { + /* This set zero to all members */ +}; + static struct resource sh7723_usb_host_resources[] = { [0] = { - .name = "r8a66597_hcd", .start = 0xa4d80000, .end = 0xa4d800ff, .flags = IORESOURCE_MEM, @@ -406,7 +410,7 @@ static struct resource sh7723_usb_host_resources[] = { [1] = { .start = 65, .end = 65, - .flags = IORESOURCE_IRQ, + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, }, }; @@ -416,6 +420,7 @@ static struct platform_device sh7723_usb_host_device = { .dev = { .dma_mask = NULL, /* not use dma */ .coherent_dma_mask = 0xffffffff, + .platform_data = &r8a66597_data, }, .num_resources = ARRAY_SIZE(sh7723_usb_host_resources), .resource = sh7723_usb_host_resources, -- cgit v1.2.3 From 0a861e9eb76c68b23be1aa4758269c5b412089a9 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 12 May 2009 15:13:32 +0000 Subject: soc-camera: unify i2c camera device platform data Unify i2c camera device platform data to point to struct soc_camera_link for a smooth transition to soc-camera as a platform driver. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Paul Mundt --- arch/sh/boards/board-ap325rxa.c | 2 +- arch/sh/boards/mach-migor/setup.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 1c4d83ef2a4..8cc46874ade 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c @@ -417,7 +417,7 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { }, { I2C_BOARD_INFO("ov772x", 0x21), - .platform_data = &ov7725_info, + .platform_data = &ov7725_info.link, }, }; diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 6ed401cd315..95d90213be0 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c @@ -430,11 +430,11 @@ static struct i2c_board_info migor_i2c_devices[] = { }, { I2C_BOARD_INFO("ov772x", 0x21), - .platform_data = &ov7725_info, + .platform_data = &ov7725_info.link, }, { I2C_BOARD_INFO("tw9910", 0x45), - .platform_data = &tw9910_info, + .platform_data = &tw9910_info.link, }, }; -- cgit v1.2.3 From 194a17305cb0b5e0686261b645d3fd537d2fc58d Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 12 May 2009 15:13:36 +0000 Subject: SH: convert ap325rxa to soc-camera as platform-device Signed-off-by: Guennadi Liakhovetski Signed-off-by: Paul Mundt --- arch/sh/boards/board-ap325rxa.c | 50 ++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 18 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 8cc46874ade..7ffd1b4315b 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c @@ -349,15 +349,6 @@ static int ov7725_power(struct device *dev, int mode) return 0; } -static struct ov772x_camera_info ov7725_info = { - .buswidth = SOCAM_DATAWIDTH_8, - .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, - .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), - .link = { - .power = ov7725_power, - }, -}; - static struct sh_mobile_ceu_info sh_mobile_ceu_info = { .flags = SH_CEU_FLAG_USE_8BIT_BUS, }; @@ -402,25 +393,48 @@ static struct platform_device sdcard_cn3_device = { }, }; -static struct platform_device *ap325rxa_devices[] __initdata = { - &smsc9118_device, - &ap325rxa_nor_flash_device, - &lcdc_device, - &ceu_device, - &nand_flash_device, - &sdcard_cn3_device, -}; - static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { { I2C_BOARD_INFO("pcf8563", 0x51), }, +}; + +static struct i2c_board_info ap325rxa_i2c_camera[] = { { I2C_BOARD_INFO("ov772x", 0x21), + }, +}; + +static struct ov772x_camera_info ov7725_info = { + .buswidth = SOCAM_DATAWIDTH_8, + .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, + .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), + .link = { + .power = ov7725_power, + .board_info = &ap325rxa_i2c_camera[0], + .i2c_adapter_id = 0, + .module_name = "ov772x", + }, +}; + +static struct platform_device ap325rxa_camera = { + .name = "soc-camera-pdrv", + .id = 0, + .dev = { .platform_data = &ov7725_info.link, }, }; +static struct platform_device *ap325rxa_devices[] __initdata = { + &smsc9118_device, + &ap325rxa_nor_flash_device, + &lcdc_device, + &ceu_device, + &nand_flash_device, + &sdcard_cn3_device, + &ap325rxa_camera, +}; + static struct spi_board_info ap325rxa_spi_devices[] = { { .modalias = "mmc_spi", -- cgit v1.2.3 From 2cb582ca0d6bd0274b15c9ee9549fc2251b7b599 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 12 May 2009 15:13:40 +0000 Subject: SH: convert migor to soc-camera as platform-device Signed-off-by: Guennadi Liakhovetski Signed-off-by: Paul Mundt --- arch/sh/boards/mach-migor/setup.c | 79 ++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 27 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 95d90213be0..f70f4644deb 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c @@ -381,21 +381,6 @@ static struct platform_device migor_ceu_device = { }, }; -static struct ov772x_camera_info ov7725_info = { - .buswidth = SOCAM_DATAWIDTH_8, - .link = { - .power = ov7725_power, - }, -}; - -static struct tw9910_video_info tw9910_info = { - .buswidth = SOCAM_DATAWIDTH_8, - .mpout = TW9910_MPO_FIELD, - .link = { - .power = tw9910_power, - } -}; - struct spi_gpio_platform_data sdcard_cn9_platform_data = { .sck = GPIO_PTD0, .mosi = GPIO_PTD1, @@ -410,16 +395,6 @@ static struct platform_device sdcard_cn9_device = { }, }; -static struct platform_device *migor_devices[] __initdata = { - &smc91x_eth_device, - &sh_keysc_device, - &migor_lcdc_device, - &migor_ceu_device, - &migor_nor_flash_device, - &migor_nand_flash_device, - &sdcard_cn9_device, -}; - static struct i2c_board_info migor_i2c_devices[] = { { I2C_BOARD_INFO("rs5c372b", 0x32), @@ -428,16 +403,66 @@ static struct i2c_board_info migor_i2c_devices[] = { I2C_BOARD_INFO("migor_ts", 0x51), .irq = 38, /* IRQ6 */ }, +}; + +static struct i2c_board_info migor_i2c_camera[] = { { I2C_BOARD_INFO("ov772x", 0x21), - .platform_data = &ov7725_info.link, }, { I2C_BOARD_INFO("tw9910", 0x45), - .platform_data = &tw9910_info.link, }, }; +static struct ov772x_camera_info ov7725_info = { + .buswidth = SOCAM_DATAWIDTH_8, + .link = { + .power = ov7725_power, + .board_info = &migor_i2c_camera[0], + .i2c_adapter_id = 0, + .module_name = "ov772x", + }, +}; + +static struct tw9910_video_info tw9910_info = { + .buswidth = SOCAM_DATAWIDTH_8, + .mpout = TW9910_MPO_FIELD, + .link = { + .power = tw9910_power, + .board_info = &migor_i2c_camera[1], + .i2c_adapter_id = 0, + .module_name = "tw9910", + } +}; + +static struct platform_device migor_camera[] = { + { + .name = "soc-camera-pdrv", + .id = 0, + .dev = { + .platform_data = &ov7725_info.link, + }, + }, { + .name = "soc-camera-pdrv", + .id = 1, + .dev = { + .platform_data = &tw9910_info.link, + }, + }, +}; + +static struct platform_device *migor_devices[] __initdata = { + &smc91x_eth_device, + &sh_keysc_device, + &migor_lcdc_device, + &migor_ceu_device, + &migor_nor_flash_device, + &migor_nand_flash_device, + &sdcard_cn9_device, + &migor_camera[0], + &migor_camera[1], +}; + static struct spi_board_info migor_spi_devices[] = { { .modalias = "mmc_spi", -- cgit v1.2.3 From 9c93e596979021b159736a1273987c3e52d809e0 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 17 Jun 2009 16:34:45 +0900 Subject: sh: Generic HAVE_PERF_COUNTER support. This enables support for the generic software-based perf counters. Hardware counter support could be added in the future, but the lack of a performance counter IRQ makes this rather dubious. Signed-off-by: Paul Mundt --- arch/sh/Kconfig | 1 + arch/sh/include/asm/perf_counter.h | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 arch/sh/include/asm/perf_counter.h (limited to 'arch/sh') diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index a6f9eaa6e0b..e487e6d5a4d 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -15,6 +15,7 @@ config SUPERH select HAVE_IOREMAP_PROT if MMU select HAVE_ARCH_TRACEHOOK select HAVE_DMA_API_DEBUG + select HAVE_PERF_COUNTER select RTC_LIB select GENERIC_ATOMIC64 help diff --git a/arch/sh/include/asm/perf_counter.h b/arch/sh/include/asm/perf_counter.h new file mode 100644 index 00000000000..a8153c2aa6f --- /dev/null +++ b/arch/sh/include/asm/perf_counter.h @@ -0,0 +1,7 @@ +#ifndef __ASM_SH_PERF_COUNTER_H +#define __ASM_SH_PERF_COUNTER_H + +/* SH only supports software counters through this interface. */ +#define set_perf_counter_pending() do { } while (0) + +#endif /* __ASM_SH_PERF_COUNTER_H */ -- cgit v1.2.3