diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-07-29 21:01:19 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-07-29 21:01:19 +0900 |
commit | da2014a2b080e7f3024a4eb6917d47069ad9620b (patch) | |
tree | cfde12c6d4b5baa222966b14a676f107992cf786 /arch/sh/boards/renesas | |
parent | 71b8064e7df5698520d73b4c1566a3dbc98eb9ef (diff) | |
download | kernel_samsung_smdk4412-da2014a2b080e7f3024a4eb6917d47069ad9620b.zip kernel_samsung_smdk4412-da2014a2b080e7f3024a4eb6917d47069ad9620b.tar.gz kernel_samsung_smdk4412-da2014a2b080e7f3024a4eb6917d47069ad9620b.tar.bz2 |
sh: Shuffle the board directories in to mach groups.
This flattens out the board directories in to individual mach groups,
we will use this for getting rid of unneeded directories, simplifying
the build system, and becoming more coherent with the refactored
arch/sh/include topology.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/renesas')
38 files changed, 0 insertions, 3756 deletions
diff --git a/arch/sh/boards/renesas/ap325rxa/Makefile b/arch/sh/boards/renesas/ap325rxa/Makefile deleted file mode 100644 index f663768..0000000 --- a/arch/sh/boards/renesas/ap325rxa/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y := setup.o diff --git a/arch/sh/boards/renesas/ap325rxa/setup.c b/arch/sh/boards/renesas/ap325rxa/setup.c deleted file mode 100644 index 7fa7446..0000000 --- a/arch/sh/boards/renesas/ap325rxa/setup.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Renesas - AP-325RXA - * (Compatible with Algo System ., LTD. - AP-320A) - * - * Copyright (C) 2008 Renesas Solutions Corp. - * Author : Yusuke Goda <goda.yuske@renesas.com> - * - * 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. - */ - -#include <linux/init.h> -#include <linux/device.h> -#include <linux/interrupt.h> -#include <linux/platform_device.h> -#include <linux/mtd/physmap.h> -#include <linux/delay.h> -#include <linux/i2c.h> -#include <linux/delay.h> -#include <linux/smc911x.h> -#include <media/soc_camera_platform.h> -#include <media/sh_mobile_ceu.h> -#include <asm/sh_mobile_lcdc.h> -#include <asm/io.h> -#include <asm/clock.h> - -static struct smc911x_platdata smc911x_info = { - .flags = SMC911X_USE_32BIT, - .irq_flags = IRQF_TRIGGER_LOW, -}; - -static struct resource smc9118_resources[] = { - [0] = { - .start = 0xb6080000, - .end = 0xb60fffff, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 35, - .end = 35, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device smc9118_device = { - .name = "smc911x", - .id = -1, - .num_resources = ARRAY_SIZE(smc9118_resources), - .resource = smc9118_resources, - .dev = { - .platform_data = &smc911x_info, - }, -}; - -static struct mtd_partition ap325rxa_nor_flash_partitions[] = { - { - .name = "uboot", - .offset = 0, - .size = (1 * 1024 * 1024), - .mask_flags = MTD_WRITEABLE, /* Read-only */ - }, { - .name = "kernel", - .offset = MTDPART_OFS_APPEND, - .size = (2 * 1024 * 1024), - }, { - .name = "other", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - }, -}; - -static struct physmap_flash_data ap325rxa_nor_flash_data = { - .width = 2, - .parts = ap325rxa_nor_flash_partitions, - .nr_parts = ARRAY_SIZE(ap325rxa_nor_flash_partitions), -}; - -static struct resource ap325rxa_nor_flash_resources[] = { - [0] = { - .name = "NOR Flash", - .start = 0x00000000, - .end = 0x00ffffff, - .flags = IORESOURCE_MEM, - } -}; - -static struct platform_device ap325rxa_nor_flash_device = { - .name = "physmap-flash", - .resource = ap325rxa_nor_flash_resources, - .num_resources = ARRAY_SIZE(ap325rxa_nor_flash_resources), - .dev = { - .platform_data = &ap325rxa_nor_flash_data, - }, -}; - -#define FPGA_LCDREG 0xB4100180 -#define FPGA_BKLREG 0xB4100212 -#define FPGA_LCDREG_VAL 0x0018 -#define PORT_PHCR 0xA405010E -#define PORT_PLCR 0xA4050114 -#define PORT_PMCR 0xA4050116 -#define PORT_PRCR 0xA405011C -#define PORT_PSCR 0xA405011E -#define PORT_PZCR 0xA405014C -#define PORT_HIZCRA 0xA4050158 -#define PORT_MSELCRB 0xA4050182 -#define PORT_PSDR 0xA405013E -#define PORT_PZDR 0xA405016C -#define PORT_PSELD 0xA4050154 - -static void ap320_wvga_power_on(void *board_data) -{ - msleep(100); - - /* ASD AP-320/325 LCD ON */ - ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG); - - /* backlight */ - ctrl_outw((ctrl_inw(PORT_PSCR) & ~0x00C0) | 0x40, PORT_PSCR); - ctrl_outb(ctrl_inb(PORT_PSDR) & ~0x08, PORT_PSDR); - ctrl_outw(0x100, FPGA_BKLREG); -} - -static struct sh_mobile_lcdc_info lcdc_info = { - .clock_source = LCDC_CLK_EXTERNAL, - .ch[0] = { - .chan = LCDC_CHAN_MAINLCD, - .bpp = 16, - .interface_type = RGB18, - .clock_divider = 1, - .lcd_cfg = { - .name = "LB070WV1", - .xres = 800, - .yres = 480, - .left_margin = 40, - .right_margin = 160, - .hsync_len = 8, - .upper_margin = 63, - .lower_margin = 80, - .vsync_len = 1, - .sync = 0, /* hsync and vsync are active low */ - }, - .board_cfg = { - .display_on = ap320_wvga_power_on, - }, - } -}; - -static struct resource lcdc_resources[] = { - [0] = { - .name = "LCDC", - .start = 0xfe940000, /* P4-only space */ - .end = 0xfe941fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device lcdc_device = { - .name = "sh_mobile_lcdc_fb", - .num_resources = ARRAY_SIZE(lcdc_resources), - .resource = lcdc_resources, - .dev = { - .platform_data = &lcdc_info, - }, -}; - -static unsigned char camera_ncm03j_magic[] = -{ - 0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8, - 0x1D, 0x00, 0x1E, 0x8A, 0x21, 0x00, 0x33, 0x36, - 0x36, 0x60, 0x37, 0x08, 0x3B, 0x31, 0x44, 0x0F, - 0x46, 0xF0, 0x4B, 0x28, 0x4C, 0x21, 0x4D, 0x55, - 0x4E, 0x1B, 0x4F, 0xC7, 0x50, 0xFC, 0x51, 0x12, - 0x58, 0x02, 0x66, 0xC0, 0x67, 0x46, 0x6B, 0xA0, - 0x6C, 0x34, 0x7E, 0x25, 0x7F, 0x25, 0x8D, 0x0F, - 0x92, 0x40, 0x93, 0x04, 0x94, 0x26, 0x95, 0x0A, - 0x99, 0x03, 0x9A, 0xF0, 0x9B, 0x14, 0x9D, 0x7A, - 0xC5, 0x02, 0xD6, 0x07, 0x59, 0x00, 0x5A, 0x1A, - 0x5B, 0x2A, 0x5C, 0x37, 0x5D, 0x42, 0x5E, 0x56, - 0xC8, 0x00, 0xC9, 0x1A, 0xCA, 0x2A, 0xCB, 0x37, - 0xCC, 0x42, 0xCD, 0x56, 0xCE, 0x00, 0xCF, 0x1A, - 0xD0, 0x2A, 0xD1, 0x37, 0xD2, 0x42, 0xD3, 0x56, - 0x5F, 0x68, 0x60, 0x87, 0x61, 0xA3, 0x62, 0xBC, - 0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F, -}; - -static int camera_set_capture(struct soc_camera_platform_info *info, - int enable) -{ - struct i2c_adapter *a = i2c_get_adapter(0); - struct i2c_msg msg; - int ret = 0; - int i; - - if (!enable) - return 0; /* no disable for now */ - - for (i = 0; i < ARRAY_SIZE(camera_ncm03j_magic); i += 2) { - u_int8_t buf[8]; - - msg.addr = 0x6e; - msg.buf = buf; - msg.len = 2; - msg.flags = 0; - - buf[0] = camera_ncm03j_magic[i]; - buf[1] = camera_ncm03j_magic[i + 1]; - - ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1); - } - - return ret; -} - -static struct soc_camera_platform_info camera_info = { - .iface = 0, - .format_name = "UYVY", - .format_depth = 16, - .format = { - .pixelformat = V4L2_PIX_FMT_UYVY, - .colorspace = V4L2_COLORSPACE_SMPTE170M, - .width = 640, - .height = 480, - }, - .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | - SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, - .set_capture = camera_set_capture, -}; - -static struct platform_device camera_device = { - .name = "soc_camera_platform", - .dev = { - .platform_data = &camera_info, - }, -}; - -static struct sh_mobile_ceu_info sh_mobile_ceu_info = { - .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | - SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, -}; - -static struct resource ceu_resources[] = { - [0] = { - .name = "CEU", - .start = 0xfe910000, - .end = 0xfe91009f, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 52, - .flags = IORESOURCE_IRQ, - }, - [2] = { - /* place holder for contiguous memory */ - }, -}; - -static struct platform_device ceu_device = { - .name = "sh_mobile_ceu", - .num_resources = ARRAY_SIZE(ceu_resources), - .resource = ceu_resources, - .dev = { - .platform_data = &sh_mobile_ceu_info, - }, -}; - -static struct platform_device *ap325rxa_devices[] __initdata = { - &smc9118_device, - &ap325rxa_nor_flash_device, - &lcdc_device, - &ceu_device, - &camera_device, -}; - -static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { -}; - -static int __init ap325rxa_devices_setup(void) -{ - clk_always_enable("mstp200"); /* LCDC */ - clk_always_enable("mstp203"); /* CEU */ - - platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20); - - i2c_register_board_info(0, ap325rxa_i2c_devices, - ARRAY_SIZE(ap325rxa_i2c_devices)); - - return platform_add_devices(ap325rxa_devices, - ARRAY_SIZE(ap325rxa_devices)); -} -device_initcall(ap325rxa_devices_setup); - -static void __init ap325rxa_setup(char **cmdline_p) -{ - /* LCDC configuration */ - ctrl_outw(ctrl_inw(PORT_PHCR) & ~0xffff, PORT_PHCR); - ctrl_outw(ctrl_inw(PORT_PLCR) & ~0xffff, PORT_PLCR); - ctrl_outw(ctrl_inw(PORT_PMCR) & ~0xffff, PORT_PMCR); - ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x03ff, PORT_PRCR); - ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01C0, PORT_HIZCRA); - - /* CEU */ - ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB); - ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD); - ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR); - ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR); -} - -static struct sh_machine_vector mv_ap325rxa __initmv = { - .mv_name = "AP-325RXA", - .mv_setup = ap325rxa_setup, -}; diff --git a/arch/sh/boards/renesas/edosk7705/Makefile b/arch/sh/boards/renesas/edosk7705/Makefile deleted file mode 100644 index 14bdd53..0000000 --- a/arch/sh/boards/renesas/edosk7705/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# -# Makefile for the EDOSK7705 specific parts of the kernel -# - -obj-y := setup.o io.o - diff --git a/arch/sh/boards/renesas/edosk7705/io.c b/arch/sh/boards/renesas/edosk7705/io.c deleted file mode 100644 index 541cea2..0000000 --- a/arch/sh/boards/renesas/edosk7705/io.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * arch/sh/boards/renesas/edosk7705/io.c - * - * Copyright (C) 2001 Ian da Silva, Jeremy Siegel - * Based largely on io_se.c. - * - * I/O routines for Hitachi EDOSK7705 board. - * - */ - -#include <linux/kernel.h> -#include <linux/types.h> -#include <asm/io.h> -#include <asm/edosk7705/io.h> -#include <asm/addrspace.h> - -#define SMC_IOADDR 0xA2000000 - -#define maybebadio(name,port) \ - printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \ - #name, (port), (__u32) __builtin_return_address(0)) - -/* Map the Ethernet addresses as if it is at 0x300 - 0x320 */ -unsigned long sh_edosk7705_isa_port2addr(unsigned long port) -{ - if (port >= 0x300 && port < 0x320) { - /* SMC91C96 registers are 4 byte aligned rather than the - * usual 2 byte! - */ - return SMC_IOADDR + ( (port - 0x300) * 2); - } - - maybebadio(sh_edosk7705_isa_port2addr, port); - return port; -} - -/* Trying to read / write bytes on odd-byte boundaries to the Ethernet - * registers causes problems. So we bit-shift the value and read / write - * in 2 byte chunks. Setting the low byte to 0 does not cause problems - * now as odd byte writes are only made on the bit mask / interrupt - * register. This may not be the case in future Mar-2003 SJD - */ -unsigned char sh_edosk7705_inb(unsigned long port) -{ - if (port >= 0x300 && port < 0x320 && port & 0x01) { - return (volatile unsigned char)(generic_inw(port -1) >> 8); - } - return *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port); -} - -unsigned int sh_edosk7705_inl(unsigned long port) -{ - return *(volatile unsigned long *)port; -} - -void sh_edosk7705_outb(unsigned char value, unsigned long port) -{ - if (port >= 0x300 && port < 0x320 && port & 0x01) { - generic_outw(((unsigned short)value << 8), port -1); - return; - } - *(volatile unsigned char *)sh_edosk7705_isa_port2addr(port) = value; -} - -void sh_edosk7705_outl(unsigned int value, unsigned long port) -{ - *(volatile unsigned long *)port = value; -} - -void sh_edosk7705_insb(unsigned long port, void *addr, unsigned long count) -{ - unsigned char *p = addr; - while (count--) *p++ = sh_edosk7705_inb(port); -} - -void sh_edosk7705_insl(unsigned long port, void *addr, unsigned long count) -{ - unsigned long *p = (unsigned long*)addr; - while (count--) - *p++ = *(volatile unsigned long *)port; -} - -void sh_edosk7705_outsb(unsigned long port, const void *addr, unsigned long count) -{ - unsigned char *p = (unsigned char*)addr; - while (count--) sh_edosk7705_outb(*p++, port); -} - -void sh_edosk7705_outsl(unsigned long port, const void *addr, unsigned long count) -{ - unsigned long *p = (unsigned long*)addr; - while (count--) sh_edosk7705_outl(*p++, port); -} - diff --git a/arch/sh/boards/renesas/edosk7705/setup.c b/arch/sh/boards/renesas/edosk7705/setup.c deleted file mode 100644 index f076c45..0000000 --- a/arch/sh/boards/renesas/edosk7705/setup.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * arch/sh/boards/renesas/edosk7705/setup.c - * - * Copyright (C) 2000 Kazumoto Kojima - * - * Hitachi SolutionEngine Support. - * - * Modified for edosk7705 development - * board by S. Dunn, 2003. - */ -#include <linux/init.h> -#include <asm/machvec.h> -#include <asm/edosk7705/io.h> - -static void __init sh_edosk7705_init_irq(void) -{ - /* This is the Ethernet interrupt */ - make_imask_irq(0x09); -} - -/* - * The Machine Vector - */ -static struct sh_machine_vector mv_edosk7705 __initmv = { - .mv_name = "EDOSK7705", - .mv_nr_irqs = 80, - - .mv_inb = sh_edosk7705_inb, - .mv_inl = sh_edosk7705_inl, - .mv_outb = sh_edosk7705_outb, - .mv_outl = sh_edosk7705_outl, - - .mv_inl_p = sh_edosk7705_inl, - .mv_outl_p = sh_edosk7705_outl, - - .mv_insb = sh_edosk7705_insb, - .mv_insl = sh_edosk7705_insl, - .mv_outsb = sh_edosk7705_outsb, - .mv_outsl = sh_edosk7705_outsl, - - .mv_isa_port2addr = sh_edosk7705_isa_port2addr, - .mv_init_irq = sh_edosk7705_init_irq, -}; diff --git a/arch/sh/boards/renesas/migor/Kconfig b/arch/sh/boards/renesas/migor/Kconfig deleted file mode 100644 index a7b3b72..0000000 --- a/arch/sh/boards/renesas/migor/Kconfig +++ /dev/null @@ -1,15 +0,0 @@ -if SH_MIGOR - -choice - prompt "Migo-R LCD Panel Board Selection" - default SH_MIGOR_QVGA - -config SH_MIGOR_QVGA - bool "QVGA (320x240)" - -config SH_MIGOR_RTA_WVGA - bool "RTA WVGA (800x480)" - -endchoice - -endif diff --git a/arch/sh/boards/renesas/migor/Makefile b/arch/sh/boards/renesas/migor/Makefile deleted file mode 100644 index 5f231dd..0000000 --- a/arch/sh/boards/renesas/migor/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -obj-y := setup.o -obj-$(CONFIG_SH_MIGOR_QVGA) += lcd_qvga.o diff --git a/arch/sh/boards/renesas/migor/lcd_qvga.c b/arch/sh/boards/renesas/migor/lcd_qvga.c deleted file mode 100644 index 6e96095..0000000 --- a/arch/sh/boards/renesas/migor/lcd_qvga.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Support for SuperH MigoR Quarter VGA LCD Panel - * - * Copyright (C) 2008 Magnus Damm - * - * Based on lcd_powertip.c from Kenati Technologies Pvt Ltd. - * Copyright (c) 2007 Ujjwal Pande <ujjwal@kenati.com>, - * - * 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. - */ - -#include <linux/delay.h> -#include <linux/err.h> -#include <linux/fb.h> -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <asm/sh_mobile_lcdc.h> -#include <asm/migor.h> - -/* LCD Module is a PH240320T according to board schematics. This module - * is made up of a 240x320 LCD hooked up to a R61505U (or HX8347-A01?) - * Driver IC. This IC is connected to the SH7722 built-in LCDC using a - * SYS-80 interface configured in 16 bit mode. - * - * Index 0: "Device Code Read" returns 0x1505. - */ - -static void reset_lcd_module(void) -{ - ctrl_outb(ctrl_inb(PORT_PHDR) & ~0x04, PORT_PHDR); - mdelay(2); - ctrl_outb(ctrl_inb(PORT_PHDR) | 0x04, PORT_PHDR); - mdelay(1); -} - -/* DB0-DB7 are connected to D1-D8, and DB8-DB15 to D10-D17 */ - -static unsigned long adjust_reg18(unsigned short data) -{ - unsigned long tmp1, tmp2; - - tmp1 = (data<<1 | 0x00000001) & 0x000001FF; - tmp2 = (data<<2 | 0x00000200) & 0x0003FE00; - return tmp1 | tmp2; -} - -static void write_reg(void *sys_ops_handle, - struct sh_mobile_lcdc_sys_bus_ops *sys_ops, - unsigned short reg, unsigned short data) -{ - sys_ops->write_index(sys_ops_handle, adjust_reg18(reg << 8 | data)); -} - -static void write_reg16(void *sys_ops_handle, - struct sh_mobile_lcdc_sys_bus_ops *sys_ops, - unsigned short reg, unsigned short data) -{ - sys_ops->write_index(sys_ops_handle, adjust_reg18(reg)); - sys_ops->write_data(sys_ops_handle, adjust_reg18(data)); -} - -static unsigned long read_reg16(void *sys_ops_handle, - struct sh_mobile_lcdc_sys_bus_ops *sys_ops, - unsigned short reg) -{ - unsigned long data; - - sys_ops->write_index(sys_ops_handle, adjust_reg18(reg)); - data = sys_ops->read_data(sys_ops_handle); - return ((data >> 1) & 0xff) | ((data >> 2) & 0xff00); -} - -static void migor_lcd_qvga_seq(void *sys_ops_handle, - struct sh_mobile_lcdc_sys_bus_ops *sys_ops, - unsigned short const *data, int no_data) -{ - int i; - - for (i = 0; i < no_data; i += 2) - write_reg16(sys_ops_handle, sys_ops, data[i], data[i + 1]); -} - -static const unsigned short sync_data[] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -}; - -static const unsigned short magic0_data[] = { - 0x0060, 0x2700, 0x0008, 0x0808, 0x0090, 0x001A, 0x0007, 0x0001, - 0x0017, 0x0001, 0x0019, 0x0000, 0x0010, 0x17B0, 0x0011, 0x0116, - 0x0012, 0x0198, 0x0013, 0x1400, 0x0029, 0x000C, 0x0012, 0x01B8, -}; - -static const unsigned short magic1_data[] = { - 0x0030, 0x0307, 0x0031, 0x0303, 0x0032, 0x0603, 0x0033, 0x0202, - 0x0034, 0x0202, 0x0035, 0x0202, 0x0036, 0x1F1F, 0x0037, 0x0303, - 0x0038, 0x0303, 0x0039, 0x0603, 0x003A, 0x0202, 0x003B, 0x0102, - 0x003C, 0x0204, 0x003D, 0x0000, 0x0001, 0x0100, 0x0002, 0x0300, - 0x0003, 0x5028, 0x0020, 0x00ef, 0x0021, 0x0000, 0x0004, 0x0000, - 0x0009, 0x0000, 0x000A, 0x0008, 0x000C, 0x0000, 0x000D, 0x0000, - 0x0015, 0x8000, -}; - -static const unsigned short magic2_data[] = { - 0x0061, 0x0001, 0x0092, 0x0100, 0x0093, 0x0001, 0x0007, 0x0021, -}; - -static const unsigned short magic3_data[] = { - 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061, -}; - -int migor_lcd_qvga_setup(void *board_data, void *sohandle, - struct sh_mobile_lcdc_sys_bus_ops *so) -{ - unsigned long xres = 320; - unsigned long yres = 240; - int k; - - reset_lcd_module(); - migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data)); - - if (read_reg16(sohandle, so, 0) != 0x1505) - return -ENODEV; - - pr_info("Migo-R QVGA LCD Module detected.\n"); - - migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data)); - write_reg16(sohandle, so, 0x00A4, 0x0001); - mdelay(10); - - migor_lcd_qvga_seq(sohandle, so, magic0_data, ARRAY_SIZE(magic0_data)); - mdelay(100); - - migor_lcd_qvga_seq(sohandle, so, magic1_data, ARRAY_SIZE(magic1_data)); - write_reg16(sohandle, so, 0x0050, 0xef - (yres - 1)); - write_reg16(sohandle, so, 0x0051, 0x00ef); - write_reg16(sohandle, so, 0x0052, 0x0000); - write_reg16(sohandle, so, 0x0053, xres - 1); - - migor_lcd_qvga_seq(sohandle, so, magic2_data, ARRAY_SIZE(magic2_data)); - mdelay(10); - - migor_lcd_qvga_seq(sohandle, so, magic3_data, ARRAY_SIZE(magic3_data)); - mdelay(40); - - /* clear GRAM to avoid displaying garbage */ - - write_reg16(sohandle, so, 0x0020, 0x0000); /* horiz addr */ - write_reg16(sohandle, so, 0x0021, 0x0000); /* vert addr */ - - for (k = 0; k < (xres * 256); k++) /* yes, 256 words per line */ - write_reg16(sohandle, so, 0x0022, 0x0000); - - write_reg16(sohandle, so, 0x0020, 0x0000); /* reset horiz addr */ - write_reg16(sohandle, so, 0x0021, 0x0000); /* reset vert addr */ - write_reg16(sohandle, so, 0x0007, 0x0173); - mdelay(40); - - /* enable display */ - write_reg(sohandle, so, 0x00, 0x22); - mdelay(100); - return 0; -} diff --git a/arch/sh/boards/renesas/migor/setup.c b/arch/sh/boards/renesas/migor/setup.c deleted file mode 100644 index 7bd365a..0000000 --- a/arch/sh/boards/renesas/migor/setup.c +++ /dev/null @@ -1,523 +0,0 @@ -/* - * Renesas System Solutions Asia Pte. Ltd - Migo-R - * - * Copyright (C) 2008 Magnus Damm - * - * 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. - */ -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/interrupt.h> -#include <linux/input.h> -#include <linux/mtd/physmap.h> -#include <linux/mtd/nand.h> -#include <linux/i2c.h> -#include <linux/smc91x.h> -#include <linux/delay.h> -#include <linux/clk.h> -#include <media/soc_camera_platform.h> -#include <media/sh_mobile_ceu.h> -#include <asm/clock.h> -#include <asm/machvec.h> -#include <asm/io.h> -#include <asm/sh_keysc.h> -#include <asm/sh_mobile_lcdc.h> -#include <asm/migor.h> - -/* Address IRQ Size Bus Description - * 0x00000000 64MB 16 NOR Flash (SP29PL256N) - * 0x0c000000 64MB 64 SDRAM (2xK4M563233G) - * 0x10000000 IRQ0 16 Ethernet (SMC91C111) - * 0x14000000 IRQ4 16 USB 2.0 Host Controller (M66596) - * 0x18000000 8GB 8 NAND Flash (K9K8G08U0A) - */ - -static struct smc91x_platdata smc91x_info = { - .flags = SMC91X_USE_16BIT, -}; - -static struct resource smc91x_eth_resources[] = { - [0] = { - .name = "SMC91C111" , - .start = 0x10000300, - .end = 0x1000030f, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 32, /* IRQ0 */ - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, - }, -}; - -static struct platform_device smc91x_eth_device = { - .name = "smc91x", - .num_resources = ARRAY_SIZE(smc91x_eth_resources), - .resource = smc91x_eth_resources, - .dev = { - .platform_data = &smc91x_info, - }, -}; - -static struct sh_keysc_info sh_keysc_info = { - .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */ - .scan_timing = 3, - .delay = 5, - .keycodes = { - 0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER, - 0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1, - 0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, - 0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0, - 0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD, - }, -}; - -static struct resource sh_keysc_resources[] = { - [0] = { - .start = 0x044b0000, - .end = 0x044b000f, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 79, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device sh_keysc_device = { - .name = "sh_keysc", - .num_resources = ARRAY_SIZE(sh_keysc_resources), - .resource = sh_keysc_resources, - .dev = { - .platform_data = &sh_keysc_info, - }, -}; - -static struct mtd_partition migor_nor_flash_partitions[] = -{ - { - .name = "uboot", - .offset = 0, - .size = (1 * 1024 * 1024), - .mask_flags = MTD_WRITEABLE, /* Read-only */ - }, - { - .name = "rootfs", - .offset = MTDPART_OFS_APPEND, - .size = (15 * 1024 * 1024), - }, - { - .name = "other", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - }, -}; - -static struct physmap_flash_data migor_nor_flash_data = { - .width = 2, - .parts = migor_nor_flash_partitions, - .nr_parts = ARRAY_SIZE(migor_nor_flash_partitions), -}; - -static struct resource migor_nor_flash_resources[] = { - [0] = { - .name = "NOR Flash", - .start = 0x00000000, - .end = 0x03ffffff, - .flags = IORESOURCE_MEM, - } -}; - -static struct platform_device migor_nor_flash_device = { - .name = "physmap-flash", - .resource = migor_nor_flash_resources, - .num_resources = ARRAY_SIZE(migor_nor_flash_resources), - .dev = { - .platform_data = &migor_nor_flash_data, - }, -}; - -static struct mtd_partition migor_nand_flash_partitions[] = { - { - .name = "nanddata1", - .offset = 0x0, - .size = 512 * 1024 * 1024, - }, - { - .name = "nanddata2", - .offset = MTDPART_OFS_APPEND, - .size = 512 * 1024 * 1024, - }, -}; - -static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd, - unsigned int ctrl) -{ - struct nand_chip *chip = mtd->priv; - - if (cmd == NAND_CMD_NONE) - return; - - if (ctrl & NAND_CLE) - writeb(cmd, chip->IO_ADDR_W + 0x00400000); - else if (ctrl & NAND_ALE) - writeb(cmd, chip->IO_ADDR_W + 0x00800000); - else - writeb(cmd, chip->IO_ADDR_W); -} - -static int migor_nand_flash_ready(struct mtd_info *mtd) -{ - return ctrl_inb(PORT_PADR) & 0x02; /* PTA1 */ -} - -struct platform_nand_data migor_nand_flash_data = { - .chip = { - .nr_chips = 1, - .partitions = migor_nand_flash_partitions, - .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions), - .chip_delay = 20, - .part_probe_types = (const char *[]) { "cmdlinepart", NULL }, - }, - .ctrl = { - .dev_ready = migor_nand_flash_ready, - .cmd_ctrl = migor_nand_flash_cmd_ctl, - }, -}; - -static struct resource migor_nand_flash_resources[] = { - [0] = { - .name = "NAND Flash", - .start = 0x18000000, - .end = 0x18ffffff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device migor_nand_flash_device = { - .name = "gen_nand", - .resource = migor_nand_flash_resources, - .num_resources = ARRAY_SIZE(migor_nand_flash_resources), - .dev = { - .platform_data = &migor_nand_flash_data, - } -}; - -static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = { -#ifdef CONFIG_SH_MIGOR_RTA_WVGA - .clock_source = LCDC_CLK_BUS, - .ch[0] = { - .chan = LCDC_CHAN_MAINLCD, - .bpp = 16, - .interface_type = RGB16, - .clock_divider = 2, - .lcd_cfg = { - .name = "LB070WV1", - .xres = 800, - .yres = 480, - .left_margin = 64, - .right_margin = 16, - .hsync_len = 120, - .upper_margin = 1, - .lower_margin = 17, - .vsync_len = 2, - .sync = 0, - }, - } -#endif -#ifdef CONFIG_SH_MIGOR_QVGA - .clock_source = LCDC_CLK_PERIPHERAL, - .ch[0] = { - .chan = LCDC_CHAN_MAINLCD, - .bpp = 16, - .interface_type = SYS16A, - .clock_divider = 10, - .lcd_cfg = { - .name = "PH240320T", - .xres = 320, - .yres = 240, - .left_margin = 0, - .right_margin = 16, - .hsync_len = 8, - .upper_margin = 1, - .lower_margin = 17, - .vsync_len = 2, - .sync = FB_SYNC_HOR_HIGH_ACT, - }, - .board_cfg = { - .setup_sys = migor_lcd_qvga_setup, - }, - .sys_bus_cfg = { - .ldmt2r = 0x06000a09, - .ldmt3r = 0x180e3418, - }, - } -#endif -}; - -static struct resource migor_lcdc_resources[] = { - [0] = { - .name = "LCDC", - .start = 0xfe940000, /* P4-only space */ - .end = 0xfe941fff, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device migor_lcdc_device = { - .name = "sh_mobile_lcdc_fb", - .num_resources = ARRAY_SIZE(migor_lcdc_resources), - .resource = migor_lcdc_resources, - .dev = { - .platform_data = &sh_mobile_lcdc_info, - }, -}; - -static struct clk *camera_clk; - -static void camera_power_on(void) -{ - unsigned char value; - - camera_clk = clk_get(NULL, "video_clk"); - clk_set_rate(camera_clk, 24000000); - clk_enable(camera_clk); /* start VIO_CKO */ - - mdelay(10); - value = ctrl_inb(PORT_PTDR); - value &= ~0x09; -#ifndef CONFIG_SH_MIGOR_RTA_WVGA - value |= 0x01; -#endif - ctrl_outb(value, PORT_PTDR); - mdelay(10); - - ctrl_outb(value | 8, PORT_PTDR); -} - -static void camera_power_off(void) -{ - clk_disable(camera_clk); /* stop VIO_CKO */ - clk_put(camera_clk); - - ctrl_outb(ctrl_inb(PORT_PTDR) & ~0x08, PORT_PTDR); -} - -static unsigned char camera_ov772x_magic[] = -{ - 0x09, 0x01, 0x0c, 0x10, 0x0d, 0x41, 0x0e, 0x01, - 0x12, 0x00, 0x13, 0x8F, 0x14, 0x4A, 0x15, 0x00, - 0x16, 0x00, 0x17, 0x23, 0x18, 0xa0, 0x19, 0x07, - 0x1a, 0xf0, 0x1b, 0x40, 0x1f, 0x00, 0x20, 0x10, - 0x22, 0xff, 0x23, 0x01, 0x28, 0x00, 0x29, 0xa0, - 0x2a, 0x00, 0x2b, 0x00, 0x2c, 0xf0, 0x2d, 0x00, - 0x2e, 0x00, 0x30, 0x80, 0x31, 0x60, 0x32, 0x00, - 0x33, 0x00, 0x34, 0x00, 0x3d, 0x80, 0x3e, 0xe2, - 0x3f, 0x1f, 0x42, 0x80, 0x43, 0x80, 0x44, 0x80, - 0x45, 0x80, 0x46, 0x00, 0x47, 0x00, 0x48, 0x00, - 0x49, 0x50, 0x4a, 0x30, 0x4b, 0x50, 0x4c, 0x50, - 0x4d, 0x00, 0x4e, 0xef, 0x4f, 0x10, 0x50, 0x60, - 0x51, 0x00, 0x52, 0x00, 0x53, 0x24, 0x54, 0x7a, - 0x55, 0xfc, 0x62, 0xff, 0x63, 0xf0, 0x64, 0x1f, - 0x65, 0x00, 0x66, 0x10, 0x67, 0x00, 0x68, 0x00, - 0x69, 0x5c, 0x6a, 0x11, 0x6b, 0xa2, 0x6c, 0x01, - 0x6d, 0x50, 0x6e, 0x80, 0x6f, 0x80, 0x70, 0x0f, - 0x71, 0x00, 0x72, 0x00, 0x73, 0x0f, 0x74, 0x0f, - 0x75, 0xff, 0x78, 0x10, 0x79, 0x70, 0x7a, 0x70, - 0x7b, 0xf0, 0x7c, 0xf0, 0x7d, 0xf0, 0x7e, 0x0e, - 0x7f, 0x1a, 0x80, 0x31, 0x81, 0x5a, 0x82, 0x69, - 0x83, 0x75, 0x84, 0x7e, 0x85, 0x88, 0x86, 0x8f, - 0x87, 0x96, 0x88, 0xa3, 0x89, 0xaf, 0x8a, 0xc4, - 0x8b, 0xd7, 0x8c, 0xe8, 0x8d, 0x20, 0x8e, 0x00, - 0x8f, 0x00, 0x90, 0x08, 0x91, 0x10, 0x92, 0x1f, - 0x93, 0x01, 0x94, 0x2c, 0x95, 0x24, 0x96, 0x08, - 0x97, 0x14, 0x98, 0x24, 0x99, 0x38, 0x9a, 0x9e, - 0x9b, 0x00, 0x9c, 0x40, 0x9e, 0x11, 0x9f, 0x02, - 0xa0, 0x00, 0xa1, 0x40, 0xa2, 0x40, 0xa3, 0x06, - 0xa4, 0x00, 0xa6, 0x00, 0xa7, 0x40, 0xa8, 0x40, - 0xa9, 0x80, 0xaa, 0x80, 0xab, 0x06, 0xac, 0xff, - 0x12, 0x06, 0x64, 0x3f, 0x12, 0x46, 0x17, 0x3f, - 0x18, 0x50, 0x19, 0x03, 0x1a, 0x78, 0x29, 0x50, - 0x2c, 0x78, -}; - -static int ov772x_set_capture(struct soc_camera_platform_info *info, - int enable) -{ - struct i2c_adapter *a = i2c_get_adapter(0); - struct i2c_msg msg; - int ret = 0; - int i; - - if (!enable) - return 0; /* camera_power_off() is enough */ - - for (i = 0; i < ARRAY_SIZE(camera_ov772x_magic); i += 2) { - u_int8_t buf[8]; - - msg.addr = 0x21; - msg.buf = buf; - msg.len = 2; - msg.flags = 0; - - buf[0] = camera_ov772x_magic[i]; - buf[1] = camera_ov772x_magic[i + 1]; - - ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1); - } - - return ret; -} - -static struct soc_camera_platform_info ov772x_info = { - .iface = 0, - .format_name = "RGB565", - .format_depth = 16, - .format = { - .pixelformat = V4L2_PIX_FMT_RGB565, - .colorspace = V4L2_COLORSPACE_SRGB, - .width = 320, - .height = 240, - }, - .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | - SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, - .set_capture = ov772x_set_capture, -}; - -static struct platform_device migor_camera_device = { - .name = "soc_camera_platform", - .dev = { - .platform_data = &ov772x_info, - }, -}; - -static struct sh_mobile_ceu_info sh_mobile_ceu_info = { - .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \ - | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH, - .enable_camera = camera_power_on, - .disable_camera = camera_power_off, -}; - -static struct resource migor_ceu_resources[] = { - [0] = { - .name = "CEU", - .start = 0xfe910000, - .end = 0xfe91009f, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 52, - .flags = IORESOURCE_IRQ, - }, - [2] = { - /* place holder for contiguous memory */ - }, -}; - -static struct platform_device migor_ceu_device = { - .name = "sh_mobile_ceu", - .num_resources = ARRAY_SIZE(migor_ceu_resources), - .resource = migor_ceu_resources, - .dev = { - .platform_data = &sh_mobile_ceu_info, - }, -}; - -static struct platform_device *migor_devices[] __initdata = { - &smc91x_eth_device, - &sh_keysc_device, - &migor_lcdc_device, - &migor_ceu_device, - &migor_camera_device, - &migor_nor_flash_device, - &migor_nand_flash_device, -}; - -static struct i2c_board_info migor_i2c_devices[] = { - { - I2C_BOARD_INFO("rs5c372b", 0x32), - }, - { - I2C_BOARD_INFO("migor_ts", 0x51), - .irq = 38, /* IRQ6 */ - }, -}; - -static int __init migor_devices_setup(void) -{ - clk_always_enable("mstp214"); /* KEYSC */ - clk_always_enable("mstp200"); /* LCDC */ - clk_always_enable("mstp203"); /* CEU */ - - platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20); - - i2c_register_board_info(0, migor_i2c_devices, - ARRAY_SIZE(migor_i2c_devices)); - - return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); -} -__initcall(migor_devices_setup); - -static void __init migor_setup(char **cmdline_p) -{ - /* SMC91C111 - Enable IRQ0 */ - ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR); - - /* KEYSC */ - ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR); - ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR); - ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA); - ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA); - ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC); - - /* NAND Flash */ - ctrl_outw(ctrl_inw(PORT_PXCR) & 0x0fff, PORT_PXCR); - ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x00000600) | 0x00000200, - BSC_CS6ABCR); - - /* Touch Panel - Enable IRQ6 */ - ctrl_outw(ctrl_inw(PORT_PZCR) & ~0xc, PORT_PZCR); - ctrl_outw((ctrl_inw(PORT_PSELA) | 0x8000), PORT_PSELA); - ctrl_outw((ctrl_inw(PORT_HIZCRC) & ~0x4000), PORT_HIZCRC); - -#ifdef CONFIG_SH_MIGOR_RTA_WVGA - /* LCDC - WVGA - Enable RGB Interface signals */ - ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR); - ctrl_outw(0x0000, PORT_PHCR); - ctrl_outw(0x0000, PORT_PLCR); - ctrl_outw(0x0000, PORT_PMCR); - ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x000f, PORT_PRCR); - ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x000d) | 0x0400, PORT_PSELD); - ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0100, PORT_MSELCRB); - ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA); -#endif -#ifdef CONFIG_SH_MIGOR_QVGA - /* LCDC - QVGA - Enable SYS Interface signals */ - ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR); - ctrl_outw((ctrl_inw(PORT_PHCR) & ~0xcfff) | 0x0010, PORT_PHCR); - ctrl_outw(0x0000, PORT_PLCR); - ctrl_outw(0x0000, PORT_PMCR); - ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x030f, PORT_PRCR); - ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x0001) | 0x0420, PORT_PSELD); - ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x0100, PORT_MSELCRB); - ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA); -#endif - - /* CEU */ - ctrl_outw((ctrl_inw(PORT_PTCR) & ~0x03c3) | 0x0051, PORT_PTCR); - ctrl_outw(ctrl_inw(PORT_PUCR) & ~0x03ff, PORT_PUCR); - ctrl_outw(ctrl_inw(PORT_PVCR) & ~0x03ff, PORT_PVCR); - ctrl_outw(ctrl_inw(PORT_PWCR) & ~0x3c00, PORT_PWCR); - ctrl_outw(ctrl_inw(PORT_PSELC) | 0x0001, PORT_PSELC); - ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x2000, PORT_PSELD); - ctrl_outw(ctrl_inw(PORT_PSELE) | 0x000f, PORT_PSELE); - ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2200, PORT_MSELCRB); - ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x0a00, PORT_HIZCRA); - ctrl_outw(ctrl_inw(PORT_HIZCRB) & ~0x0003, PORT_HIZCRB); -} - -static struct sh_machine_vector mv_migor __initmv = { - .mv_name = "Migo-R", - .mv_setup = migor_setup, -}; diff --git a/arch/sh/boards/renesas/r7780rp/Kconfig b/arch/sh/boards/renesas/r7780rp/Kconfig deleted file mode 100644 index fc8f28e..0000000 --- a/arch/sh/boards/renesas/r7780rp/Kconfig +++ /dev/null @@ -1,24 +0,0 @@ -if SH_HIGHLANDER - -choice - prompt "Highlander options" - default SH_R7780MP - -config SH_R7780RP - bool "R7780RP-1 board support" - depends on CPU_SUBTYPE_SH7780 - -config SH_R7780MP - bool "R7780MP board support" - depends on CPU_SUBTYPE_SH7780 - help - Selecting this option will enable support for the mass-production - version of the R7780RP. If in doubt, say Y. - -config SH_R7785RP - bool "R7785RP board support" - depends on CPU_SUBTYPE_SH7785 - -endchoice - -endif diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile deleted file mode 100644 index 20a1008..0000000 --- a/arch/sh/boards/renesas/r7780rp/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# -# Makefile for the R7780RP-1 specific parts of the kernel -# -irqinit-$(CONFIG_SH_R7780MP) := irq-r7780mp.o -irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o -irqinit-$(CONFIG_SH_R7780RP) := irq-r7780rp.o -obj-y := setup.o $(irqinit-y) - -ifneq ($(CONFIG_SH_R7785RP),y) -obj-$(CONFIG_PUSH_SWITCH) += psw.o -endif diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c deleted file mode 100644 index ae1cfcb..0000000 --- a/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Renesas Solutions Highlander R7780MP Support. - * - * Copyright (C) 2002 Atom Create Engineering Co., Ltd. - * Copyright (C) 2006 Paul Mundt - * Copyright (C) 2007 Magnus Damm - * - * 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. - */ -#include <linux/init.h> -#include <linux/irq.h> -#include <linux/io.h> -#include <asm/r7780rp.h> - -enum { - UNUSED = 0, - - /* board specific interrupt sources */ - CF, /* Compact Flash */ - TP, /* Touch panel */ - SCIF1, /* FPGA SCIF1 */ - SCIF0, /* FPGA SCIF0 */ - SMBUS, /* SMBUS */ - RTC, /* RTC Alarm */ - AX88796, /* Ethernet controller */ - PSW, /* Push Switch */ - - /* external bus connector */ - EXT1, EXT2, EXT4, EXT5, EXT6, -}; - -static struct intc_vect vectors[] __initdata = { - INTC_IRQ(CF, IRQ_CF), - INTC_IRQ(TP, IRQ_TP), - INTC_IRQ(SCIF1, IRQ_SCIF1), - INTC_IRQ(SCIF0, IRQ_SCIF0), - INTC_IRQ(SMBUS, IRQ_SMBUS), - INTC_IRQ(RTC, IRQ_RTC), - INTC_IRQ(AX88796, IRQ_AX88796), - INTC_IRQ(PSW, IRQ_PSW), - - INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2), - INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5), - INTC_IRQ(EXT6, IRQ_EXT6), -}; - -static struct intc_mask_reg mask_registers[] __initdata = { - { 0xa4000000, 0, 16, /* IRLMSK */ - { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS, - 0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } }, -}; - -static unsigned char irl2irq[HL_NR_IRL] __initdata = { - 0, IRQ_CF, IRQ_TP, IRQ_SCIF1, - IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6, - IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1, - 0, IRQ_AX88796, IRQ_PSW, -}; - -static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors, - NULL, mask_registers, NULL, NULL); - -unsigned char * __init highlander_plat_irq_setup(void) -{ - if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) { - printk(KERN_INFO "Using r7780mp interrupt controller.\n"); - register_intc_controller(&intc_desc); - return irl2irq; - } - - return NULL; -} diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c deleted file mode 100644 index 9d3921f..0000000 --- a/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Renesas Solutions Highlander R7780RP-1 Support. - * - * Copyright (C) 2002 Atom Create Engineering Co., Ltd. - * Copyright (C) 2006 Paul Mundt - * Copyright (C) 2008 Magnus Damm - * - * 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. - */ -#include <linux/init.h> -#include <linux/irq.h> -#include <linux/io.h> -#include <asm/r7780rp.h> - -enum { - UNUSED = 0, - - /* board specific interrupt sources */ - - AX88796, /* Ethernet controller */ - PSW, /* Push Switch */ - CF, /* Compact Flash */ - - PCI_A, - PCI_B, - PCI_C, - PCI_D, -}; - -static struct intc_vect vectors[] __initdata = { - INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */ - INTC_IRQ(PCI_B, 66), - INTC_IRQ(PCI_C, 67), - INTC_IRQ(PCI_D, 68), - INTC_IRQ(CF, IRQ_CF), - INTC_IRQ(PSW, IRQ_PSW), - INTC_IRQ(AX88796, IRQ_AX88796), -}; - -static struct intc_mask_reg mask_registers[] __initdata = { - { 0xa5000000, 0, 16, /* IRLMSK */ - { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0, - 0, 0, 0, 0, 0, 0, PSW, AX88796 } }, -}; - -static unsigned char irl2irq[HL_NR_IRL] __initdata = { - 65, 66, 67, 68, - IRQ_CF, 0, 0, 0, - 0, 0, 0, 0, - IRQ_AX88796, IRQ_PSW -}; - -static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors, - NULL, mask_registers, NULL, NULL); - -unsigned char * __init highlander_plat_irq_setup(void) -{ - if (ctrl_inw(0xa5000600)) { - printk(KERN_INFO "Using r7780rp interrupt controller.\n"); - register_intc_controller(&intc_desc); - return irl2irq; - } - - return NULL; -} diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c deleted file mode 100644 index 896c045..0000000 --- a/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Renesas Solutions Highlander R7785RP Support. - * - * Copyright (C) 2002 Atom Create Engineering Co., Ltd. - * Copyright (C) 2006 - 2008 Paul Mundt - * Copyright (C) 2007 Magnus Damm - * - * 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. - */ -#include <linux/init.h> -#include <linux/irq.h> -#include <linux/io.h> -#include <asm/r7780rp.h> - -enum { - UNUSED = 0, - - /* FPGA specific interrupt sources */ - CF, /* Compact Flash */ - SMBUS, /* SMBUS */ - TP, /* Touch panel */ - RTC, /* RTC Alarm */ - TH_ALERT, /* Temperature sensor */ - AX88796, /* Ethernet controller */ - - /* external bus connector */ - EXT0, EXT1, EXT2, EXT3, EXT4, EXT5, EXT6, EXT7, -}; - -static struct intc_vect vectors[] __initdata = { - INTC_IRQ(CF, IRQ_CF), - INTC_IRQ(SMBUS, IRQ_SMBUS), - INTC_IRQ(TP, IRQ_TP), - INTC_IRQ(RTC, IRQ_RTC), - INTC_IRQ(TH_ALERT, IRQ_TH_ALERT), - - INTC_IRQ(EXT0, IRQ_EXT0), INTC_IRQ(EXT1, IRQ_EXT1), - INTC_IRQ(EXT2, IRQ_EXT2), INTC_IRQ(EXT3, IRQ_EXT3), - - INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5), - INTC_IRQ(EXT6, IRQ_EXT6), INTC_IRQ(EXT7, IRQ_EXT7), - - INTC_IRQ(AX88796, IRQ_AX88796), -}; - -static struct intc_mask_reg mask_registers[] __initdata = { - { 0xa4000010, 0, 16, /* IRLMCR1 */ - { 0, 0, 0, 0, CF, AX88796, SMBUS, TP, - RTC, 0, TH_ALERT, 0, 0, 0, 0, 0 } }, - { 0xa4000012, 0, 16, /* IRLMCR2 */ - { 0, 0, 0, 0, 0, 0, 0, 0, - EXT7, EXT6, EXT5, EXT4, EXT3, EXT2, EXT1, EXT0 } }, -}; - -static unsigned char irl2irq[HL_NR_IRL] __initdata = { - 0, IRQ_CF, IRQ_EXT4, IRQ_EXT5, - IRQ_EXT6, IRQ_EXT7, IRQ_SMBUS, IRQ_TP, - IRQ_RTC, IRQ_TH_ALERT, IRQ_AX88796, IRQ_EXT0, - IRQ_EXT1, IRQ_EXT2, IRQ_EXT3, -}; - -static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors, - NULL, mask_registers, NULL, NULL); - -unsigned char * __init highlander_plat_irq_setup(void) -{ - if ((ctrl_inw(0xa4000158) & 0xf000) != 0x1000) - return NULL; - - printk(KERN_INFO "Using r7785rp interrupt controller.\n"); - - ctrl_outw(0x0000, PA_IRLSSR1); /* FPGA IRLSSR1(CF_CD clear) */ - - /* Setup the FPGA IRL */ - ctrl_outw(0x0000, PA_IRLPRA); /* FPGA IRLA */ - ctrl_outw(0xe598, PA_IRLPRB); /* FPGA IRLB */ - ctrl_outw(0x7060, PA_IRLPRC); /* FPGA IRLC */ - ctrl_outw(0x0000, PA_IRLPRD); /* FPGA IRLD */ - ctrl_outw(0x4321, PA_IRLPRE); /* FPGA IRLE */ - ctrl_outw(0xdcba, PA_IRLPRF); /* FPGA IRLF */ - - register_intc_controller(&intc_desc); - return irl2irq; -} diff --git a/arch/sh/boards/renesas/r7780rp/psw.c b/arch/sh/boards/renesas/r7780rp/psw.c deleted file mode 100644 index 0b3e062..0000000 --- a/arch/sh/boards/renesas/r7780rp/psw.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * arch/sh/boards/renesas/r7780rp/psw.c - * - * push switch support for RDBRP-1/RDBREVRP-1 debug boards. - * - * Copyright (C) 2006 Paul Mundt - * - * 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. - */ -#include <linux/io.h> -#include <linux/init.h> -#include <linux/interrupt.h> -#include <linux/platform_device.h> -#include <mach/r7780rp.h> -#include <asm/push-switch.h> - -static irqreturn_t psw_irq_handler(int irq, void *arg) -{ - struct platform_device *pdev = arg; - struct push_switch *psw = platform_get_drvdata(pdev); - struct push_switch_platform_info *psw_info = pdev->dev.platform_data; - unsigned int l, mask; - int ret = 0; - - l = ctrl_inw(PA_DBSW); - - /* Nothing to do if there's no state change */ - if (psw->state) { - ret = 1; - goto out; - } - - mask = l & 0x70; - /* Figure out who raised it */ - if (mask & (1 << psw_info->bit)) { - psw->state = !!(mask & (1 << psw_info->bit)); - if (psw->state) /* debounce */ - mod_timer(&psw->debounce, jiffies + 50); - - ret = 1; - } - -out: - /* Clear the switch IRQs */ - l |= (0x7 << 12); - ctrl_outw(l, PA_DBSW); - - return IRQ_RETVAL(ret); -} - -static struct resource psw_resources[] = { - [0] = { - .start = IRQ_PSW, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct push_switch_platform_info s2_platform_data = { - .name = "s2", - .bit = 6, - .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | - IRQF_SHARED, - .irq_handler = psw_irq_handler, -}; - -static struct platform_device s2_switch_device = { - .name = "push-switch", - .id = 0, - .num_resources = ARRAY_SIZE(psw_resources), - .resource = psw_resources, - .dev = { - .platform_data = &s2_platform_data, - }, -}; - -static struct push_switch_platform_info s3_platform_data = { - .name = "s3", - .bit = 5, - .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | - IRQF_SHARED, - .irq_handler = psw_irq_handler, -}; - -static struct platform_device s3_switch_device = { - .name = "push-switch", - .id = 1, - .num_resources = ARRAY_SIZE(psw_resources), - .resource = psw_resources, - .dev = { - .platform_data = &s3_platform_data, - }, -}; - -static struct push_switch_platform_info s4_platform_data = { - .name = "s4", - .bit = 4, - .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | - IRQF_SHARED, - .irq_handler = psw_irq_handler, -}; - -static struct platform_device s4_switch_device = { - .name = "push-switch", - .id = 2, - .num_resources = ARRAY_SIZE(psw_resources), - .resource = psw_resources, - .dev = { - .platform_data = &s4_platform_data, - }, -}; - -static struct platform_device *psw_devices[] = { - &s2_switch_device, &s3_switch_device, &s4_switch_device, -}; - -static int __init psw_init(void) -{ - return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices)); -} -module_init(psw_init); diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c deleted file mode 100644 index bc79afb..0000000 --- a/arch/sh/boards/renesas/r7780rp/setup.c +++ /dev/null @@ -1,345 +0,0 @@ -/* - * arch/sh/boards/renesas/r7780rp/setup.c - * - * Renesas Solutions Highlander Support. - * - * Copyright (C) 2002 Atom Create Engineering Co., Ltd. - * Copyright (C) 2005 - 2008 Paul Mundt - * - * This contains support for the R7780RP-1, R7780MP, and R7785RP - * Highlander modules. - * - * 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. - */ -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/ata_platform.h> -#include <linux/types.h> -#include <linux/i2c.h> -#include <net/ax88796.h> -#include <asm/machvec.h> -#include <asm/r7780rp.h> -#include <asm/clock.h> -#include <asm/heartbeat.h> -#include <asm/io.h> -#include <asm/io_trapped.h> - -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, - }, -}; - -static struct platform_device r8a66597_usb_host_device = { - .name = "r8a66597_hcd", - .id = -1, - .dev = { - .dma_mask = NULL, /* don't use dma */ - .coherent_dma_mask = 0xffffffff, - }, - .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources), - .resource = r8a66597_usb_host_resources, -}; - -static struct resource m66592_usb_peripheral_resources[] = { - [0] = { - .name = "m66592_udc", - .start = 0xb0000000, - .end = 0xb00000FF, - .flags = IORESOURCE_MEM, - }, - [1] = { - .name = "m66592_udc", - .start = IRQ_EXT4, /* irq number */ - .end = IRQ_EXT4, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device m66592_usb_peripheral_device = { - .name = "m66592_udc", - .id = -1, - .dev = { - .dma_mask = NULL, /* don't use dma */ - .coherent_dma_mask = 0xffffffff, - }, - .num_resources = ARRAY_SIZE(m66592_usb_peripheral_resources), - .resource = m66592_usb_peripheral_resources, -}; - -static struct resource cf_ide_resources[] = { - [0] = { - .start = PA_AREA5_IO + 0x1000, - .end = PA_AREA5_IO + 0x1000 + 0x08 - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = PA_AREA5_IO + 0x80c, - .end = PA_AREA5_IO + 0x80c + 0x16 - 1, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = IRQ_CF, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct pata_platform_info pata_info = { - .ioport_shift = 1, -}; - -static struct platform_device cf_ide_device = { - .name = "pata_platform", - .id = -1, - .num_resources = ARRAY_SIZE(cf_ide_resources), - .resource = cf_ide_resources, - .dev = { - .platform_data = &pata_info, - }, -}; - -static struct resource heartbeat_resources[] = { - [0] = { - .start = PA_OBLED, - .end = PA_OBLED, - .flags = IORESOURCE_MEM, - }, -}; - -#ifndef CONFIG_SH_R7785RP -static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 }; - -static struct heartbeat_data heartbeat_data = { - .bit_pos = heartbeat_bit_pos, - .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), -}; -#endif - -static struct platform_device heartbeat_device = { - .name = "heartbeat", - .id = -1, - - /* R7785RP has a slightly more sensible FPGA.. */ -#ifndef CONFIG_SH_R7785RP - .dev = { - .platform_data = &heartbeat_data, - }, -#endif - .num_resources = ARRAY_SIZE(heartbeat_resources), - .resource = heartbeat_resources, -}; - -static struct ax_plat_data ax88796_platdata = { - .flags = AXFLG_HAS_93CX6, - .wordlength = 2, - .dcr_val = 0x1, - .rcr_val = 0x40, -}; - -static struct resource ax88796_resources[] = { - { -#ifdef CONFIG_SH_R7780RP - .start = 0xa5800400, - .end = 0xa5800400 + (0x20 * 0x2) - 1, -#else - .start = 0xa4100400, - .end = 0xa4100400 + (0x20 * 0x2) - 1, -#endif - .flags = IORESOURCE_MEM, - }, - { - .start = IRQ_AX88796, - .end = IRQ_AX88796, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device ax88796_device = { - .name = "ax88796", - .id = 0, - - .dev = { - .platform_data = &ax88796_platdata, - }, - - .num_resources = ARRAY_SIZE(ax88796_resources), - .resource = ax88796_resources, -}; - -static struct resource smbus_resources[] = { - [0] = { - .start = PA_SMCR, - .end = PA_SMCR + 0x100 - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IRQ_SMBUS, - .end = IRQ_SMBUS, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device smbus_device = { - .name = "i2c-highlander", - .id = 0, - .num_resources = ARRAY_SIZE(smbus_resources), - .resource = smbus_resources, -}; - -static struct i2c_board_info __initdata highlander_i2c_devices[] = { - { - I2C_BOARD_INFO("r2025sd", 0x32), - }, -}; - -static struct platform_device *r7780rp_devices[] __initdata = { - &r8a66597_usb_host_device, - &m66592_usb_peripheral_device, - &heartbeat_device, - &smbus_device, -#ifndef CONFIG_SH_R7780RP - &ax88796_device, -#endif -}; - -/* - * The CF is connected using a 16-bit bus where 8-bit operations are - * unsupported. The linux ata driver is however using 8-bit operations, so - * insert a trapped io filter to convert 8-bit operations into 16-bit. - */ -static struct trapped_io cf_trapped_io = { - .resource = cf_ide_resources, - .num_resources = 2, - .minimum_bus_width = 16, -}; - -static int __init r7780rp_devices_setup(void) -{ - int ret = 0; - -#ifndef CONFIG_SH_R7780RP - if (register_trapped_io(&cf_trapped_io) == 0) - ret |= platform_device_register(&cf_ide_device); -#endif - - ret |= platform_add_devices(r7780rp_devices, - ARRAY_SIZE(r7780rp_devices)); - - ret |= i2c_register_board_info(0, highlander_i2c_devices, - ARRAY_SIZE(highlander_i2c_devices)); - - return ret; -} -device_initcall(r7780rp_devices_setup); - -/* - * Platform specific clocks - */ -static void ivdr_clk_enable(struct clk *clk) -{ - ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL); -} - -static void ivdr_clk_disable(struct clk *clk) -{ - ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL); -} - -static struct clk_ops ivdr_clk_ops = { - .enable = ivdr_clk_enable, - .disable = ivdr_clk_disable, -}; - -static struct clk ivdr_clk = { - .name = "ivdr_clk", - .ops = &ivdr_clk_ops, -}; - -static struct clk *r7780rp_clocks[] = { - &ivdr_clk, -}; - -static void r7780rp_power_off(void) -{ - if (mach_is_r7780mp() || mach_is_r7785rp()) - ctrl_outw(0x0001, PA_POFF); -} - -/* - * Initialize the board - */ -static void __init highlander_setup(char **cmdline_p) -{ - u16 ver = ctrl_inw(PA_VERREG); - int i; - - printk(KERN_INFO "Renesas Solutions Highlander %s support.\n", - mach_is_r7780rp() ? "R7780RP-1" : - mach_is_r7780mp() ? "R7780MP" : - "R7785RP"); - - printk(KERN_INFO "Board version: %d (revision %d), " - "FPGA version: %d (revision %d)\n", - (ver >> 12) & 0xf, (ver >> 8) & 0xf, - (ver >> 4) & 0xf, ver & 0xf); - - /* - * Enable the important clocks right away.. - */ - for (i = 0; i < ARRAY_SIZE(r7780rp_clocks); i++) { - struct clk *clk = r7780rp_clocks[i]; - - clk_register(clk); - clk_enable(clk); - } - - ctrl_outw(0x0000, PA_OBLED); /* Clear LED. */ - - if (mach_is_r7780rp()) - ctrl_outw(0x0001, PA_SDPOW); /* SD Power ON */ - - ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL); /* Si13112 */ - - pm_power_off = r7780rp_power_off; -} - -static unsigned char irl2irq[HL_NR_IRL]; - -static int highlander_irq_demux(int irq) -{ - if (irq >= HL_NR_IRL || !irl2irq[irq]) - return irq; - - return irl2irq[irq]; -} - -static void __init highlander_init_irq(void) -{ - unsigned char *ucp = highlander_plat_irq_setup(); - - if (ucp) { - plat_irq_setup_pins(IRQ_MODE_IRL3210); - memcpy(irl2irq, ucp, HL_NR_IRL); - } -} - -/* - * The Machine Vector - */ -static struct sh_machine_vector mv_highlander __initmv = { - .mv_name = "Highlander", - .mv_setup = highlander_setup, - .mv_init_irq = highlander_init_irq, - .mv_irq_demux = highlander_irq_demux, -}; diff --git a/arch/sh/boards/renesas/rsk7203/Makefile b/arch/sh/boards/renesas/rsk7203/Makefile deleted file mode 100644 index f663768..0000000 --- a/arch/sh/boards/renesas/rsk7203/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y := setup.o diff --git a/arch/sh/boards/renesas/rsk7203/setup.c b/arch/sh/boards/renesas/rsk7203/setup.c deleted file mode 100644 index ffbedc5..0000000 --- a/arch/sh/boards/renesas/rsk7203/setup.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Renesas Technology Europe RSK+ 7203 Support. - * - * Copyright (C) 2008 Paul Mundt - * - * 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. - */ -#include <linux/init.h> -#include <linux/types.h> -#include <linux/platform_device.h> -#include <linux/interrupt.h> -#include <linux/mtd/mtd.h> -#include <linux/mtd/partitions.h> -#include <linux/mtd/physmap.h> -#include <linux/mtd/map.h> -#include <linux/smc911x.h> -#include <asm/machvec.h> -#include <asm/io.h> - -static struct smc911x_platdata smc911x_info = { - .flags = SMC911X_USE_16BIT, - .irq_flags = IRQF_TRIGGER_LOW, -}; - -static struct resource smc911x_resources[] = { - [0] = { - .start = 0x24000000, - .end = 0x24000000 + 0x100, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 64, - .end = 64, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device smc911x_device = { - .name = "smc911x", - .id = -1, - .num_resources = ARRAY_SIZE(smc911x_resources), - .resource = smc911x_resources, - .dev = { - .platform_data = &smc911x_info, - }, -}; - -static const char *probes[] = { "cmdlinepart", NULL }; - -static struct mtd_partition *parsed_partitions; - -static struct mtd_partition rsk7203_partitions[] = { - { - .name = "Bootloader", - .offset = 0x00000000, - .size = 0x00040000, - .mask_flags = MTD_WRITEABLE, - }, { - .name = "Kernel", - .offset = MTDPART_OFS_NXTBLK, - .size = 0x001c0000, - }, { - .name = "Flash_FS", - .offset = MTDPART_OFS_NXTBLK, - .size = MTDPART_SIZ_FULL, - } -}; - -static struct physmap_flash_data flash_data = { - .width = 2, -}; - -static struct resource flash_resource = { - .start = 0x20000000, - .end = 0x20400000, - .flags = IORESOURCE_MEM, -}; - -static struct platform_device flash_device = { - .name = "physmap-flash", - .id = -1, - .resource = &flash_resource, - .num_resources = 1, - .dev = { - .platform_data = &flash_data, - }, -}; - -static struct mtd_info *flash_mtd; - -static struct map_info rsk7203_flash_map = { - .name = "RSK+ Flash", - .size = 0x400000, - .bankwidth = 2, -}; - -static void __init set_mtd_partitions(void) -{ - int nr_parts = 0; - - simple_map_init(&rsk7203_flash_map); - flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map); - nr_parts = parse_mtd_partitions(flash_mtd, probes, - &parsed_partitions, 0); - /* If there is no partition table, used the hard coded table */ - if (nr_parts <= 0) { - flash_data.parts = rsk7203_partitions; - flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions); - } else { - flash_data.nr_parts = nr_parts; - flash_data.parts = parsed_partitions; - } -} - - -static struct platform_device *rsk7203_devices[] __initdata = { - &smc911x_device, - &flash_device, -}; - -static int __init rsk7203_devices_setup(void) -{ - set_mtd_partitions(); - return platform_add_devices(rsk7203_devices, - ARRAY_SIZE(rsk7203_devices)); -} -device_initcall(rsk7203_devices_setup); - -/* - * The Machine Vector - */ -static struct sh_machine_vector mv_rsk7203 __initmv = { - .mv_name = "RSK+7203", -}; diff --git a/arch/sh/boards/renesas/rts7751r2d/Kconfig b/arch/sh/boards/renesas/rts7751r2d/Kconfig deleted file mode 100644 index 8122a96..0000000 --- a/arch/sh/boards/renesas/rts7751r2d/Kconfig +++ /dev/null @@ -1,23 +0,0 @@ -if SH_RTS7751R2D - -menu "RTS7751R2D Board Revision" - -config RTS7751R2D_PLUS - bool "R2D-PLUS" - help - Selecting this option will configure the kernel for R2D-PLUS. - - R2D-PLUS is the smaller of the two R2D board versions, equipped - with a single PCI slot. - -config RTS7751R2D_1 - bool "R2D-1" - help - Selecting this option will configure the kernel for R2D-1. - - R2D-1 is the larger of the two R2D board versions, equipped - with two PCI slots. -endmenu - -endif - diff --git a/arch/sh/boards/renesas/rts7751r2d/Makefile b/arch/sh/boards/renesas/rts7751r2d/Makefile deleted file mode 100644 index 0d4c75a..0000000 --- a/arch/sh/boards/renesas/rts7751r2d/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# -# Makefile for the RTS7751R2D specific parts of the kernel -# - -obj-y := setup.o irq.o diff --git a/arch/sh/boards/renesas/rts7751r2d/irq.c b/arch/sh/boards/renesas/rts7751r2d/irq.c deleted file mode 100644 index 8e49f6e..0000000 --- a/arch/sh/boards/renesas/rts7751r2d/irq.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * linux/arch/sh/boards/renesas/rts7751r2d/irq.c - * - * Copyright (C) 2007 Magnus Damm - * Copyright (C) 2000 Kazumoto Kojima - * - * Renesas Technology Sales RTS7751R2D Support, R2D-PLUS and R2D-1. - * - * Modified for RTS7751R2D by - * Atom Create Engineering Co., Ltd. 2002. - */ -#include <linux/init.h> -#include <linux/irq.h> -#include <linux/interrupt.h> -#include <linux/io.h> -#include <asm/rts7751r2d.h> - -#define R2D_NR_IRL 13 - -enum { - UNUSED = 0, - - /* board specific interrupt sources (R2D-1 and R2D-PLUS) */ - EXT, /* EXT_INT0-3 */ - RTC_T, RTC_A, /* Real Time Clock */ - AX88796, /* Ethernet controller (R2D-1 board) */ - KEY, /* Key input (R2D-PLUS board) */ - SDCARD, /* SD Card */ - CF_CD, CF_IDE, /* CF Card Detect + CF IDE */ - SM501, /* SM501 aka Voyager */ - PCI_INTD_RTL8139, /* Ethernet controller */ - PCI_INTC_PCI1520, /* Cardbus/PCMCIA bridge */ - PCI_INTB_RTL8139, /* Ethernet controller with HUB (R2D-PLUS board) */ - PCI_INTB_SLOT, /* PCI Slot 3.3v (R2D-1 board) */ - PCI_INTA_SLOT, /* PCI Slot 3.3v */ - TP, /* Touch Panel */ -}; - -#ifdef CONFIG_RTS7751R2D_1 - -/* Vectors for R2D-1 */ -static struct intc_vect vectors_r2d_1[] __initdata = { - INTC_IRQ(EXT, IRQ_EXT), - INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A), - INTC_IRQ(AX88796, IRQ_AX88796), INTC_IRQ(SDCARD, IRQ_SDCARD), - INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE), /* ng */ - INTC_IRQ(SM501, IRQ_VOYAGER), - INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD), - INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC), - INTC_IRQ(PCI_INTB_SLOT, IRQ_PCI_INTB), - INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA), - INTC_IRQ(TP, IRQ_TP), -}; - -/* IRLMSK mask register layout for R2D-1 */ -static struct intc_mask_reg mask_registers_r2d_1[] __initdata = { - { 0xa4000000, 0, 16, /* IRLMSK */ - { TP, PCI_INTA_SLOT, PCI_INTB_SLOT, - PCI_INTC_PCI1520, PCI_INTD_RTL8139, - SM501, CF_IDE, CF_CD, SDCARD, AX88796, - RTC_A, RTC_T, 0, 0, 0, EXT } }, -}; - -/* IRLn to IRQ table for R2D-1 */ -static unsigned char irl2irq_r2d_1[R2D_NR_IRL] __initdata = { - IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC, - IRQ_VOYAGER, IRQ_AX88796, IRQ_RTC_A, IRQ_RTC_T, - IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT, - IRQ_TP, -}; - -static DECLARE_INTC_DESC(intc_desc_r2d_1, "r2d-1", vectors_r2d_1, - NULL, mask_registers_r2d_1, NULL, NULL); - -#endif /* CONFIG_RTS7751R2D_1 */ - -#ifdef CONFIG_RTS7751R2D_PLUS - -/* Vectors for R2D-PLUS */ -static struct intc_vect vectors_r2d_plus[] __initdata = { - INTC_IRQ(EXT, IRQ_EXT), - INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A), - INTC_IRQ(KEY, IRQ_KEY), INTC_IRQ(SDCARD, IRQ_SDCARD), - INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE), - INTC_IRQ(SM501, IRQ_VOYAGER), - INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD), - INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC), - INTC_IRQ(PCI_INTB_RTL8139, IRQ_PCI_INTB), - INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA), - INTC_IRQ(TP, IRQ_TP), -}; - -/* IRLMSK mask register layout for R2D-PLUS */ -static struct intc_mask_reg mask_registers_r2d_plus[] __initdata = { - { 0xa4000000, 0, 16, /* IRLMSK */ - { TP, PCI_INTA_SLOT, PCI_INTB_RTL8139, - PCI_INTC_PCI1520, PCI_INTD_RTL8139, - SM501, CF_IDE, CF_CD, SDCARD, KEY, - RTC_A, RTC_T, 0, 0, 0, EXT } }, -}; - -/* IRLn to IRQ table for R2D-PLUS */ -static unsigned char irl2irq_r2d_plus[R2D_NR_IRL] __initdata = { - IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC, - IRQ_VOYAGER, IRQ_KEY, IRQ_RTC_A, IRQ_RTC_T, - IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT, - IRQ_TP, -}; - -static DECLARE_INTC_DESC(intc_desc_r2d_plus, "r2d-plus", vectors_r2d_plus, - NULL, mask_registers_r2d_plus, NULL, NULL); - -#endif /* CONFIG_RTS7751R2D_PLUS */ - -static unsigned char irl2irq[R2D_NR_IRL]; - -int rts7751r2d_irq_demux(int irq) -{ - if (irq >= R2D_NR_IRL || !irl2irq[irq]) - return irq; - - return irl2irq[irq]; -} - -/* - * Initialize IRQ setting - */ -void __init init_rts7751r2d_IRQ(void) -{ - struct intc_desc *d; - - switch (ctrl_inw(PA_VERREG) & 0xf0) { -#ifdef CONFIG_RTS7751R2D_PLUS - case 0x10: - printk(KERN_INFO "Using R2D-PLUS interrupt controller.\n"); - d = &intc_desc_r2d_plus; - memcpy(irl2irq, irl2irq_r2d_plus, R2D_NR_IRL); - break; -#endif -#ifdef CONFIG_RTS7751R2D_1 - case 0x00: /* according to manual */ - case 0x30: /* in reality */ - printk(KERN_INFO "Using R2D-1 interrupt controller.\n"); - d = &intc_desc_r2d_1; - memcpy(irl2irq, irl2irq_r2d_1, R2D_NR_IRL); - break; -#endif - default: - printk(KERN_INFO "Unknown R2D interrupt controller 0x%04x\n", - ctrl_inw(PA_VERREG)); - return; - } - - register_intc_controller(d); -} diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c deleted file mode 100644 index 2308e87..0000000 --- a/arch/sh/boards/renesas/rts7751r2d/setup.c +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Renesas Technology Sales RTS7751R2D Support. - * - * Copyright (C) 2002 - 2006 Atom Create Engineering Co., Ltd. - * Copyright (C) 2004 - 2007 Paul Mundt - * - * 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. - */ -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/ata_platform.h> -#include <linux/sm501.h> -#include <linux/sm501-regs.h> -#include <linux/pm.h> -#include <linux/fb.h> -#include <linux/spi/spi.h> -#include <linux/spi/spi_bitbang.h> -#include <asm/machvec.h> -#include <asm/rts7751r2d.h> -#include <asm/io.h> -#include <asm/io_trapped.h> -#include <asm/spi.h> - -static struct resource cf_ide_resources[] = { - [0] = { - .start = PA_AREA5_IO + 0x1000, - .end = PA_AREA5_IO + 0x1000 + 0x10 - 0x2, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = PA_AREA5_IO + 0x80c, - .end = PA_AREA5_IO + 0x80c, - .flags = IORESOURCE_MEM, - }, -#ifndef CONFIG_RTS7751R2D_1 /* For R2D-1 polling is preferred */ - [2] = { - .start = IRQ_CF_IDE, - .flags = IORESOURCE_IRQ, - }, -#endif -}; - -static struct pata_platform_info pata_info = { - .ioport_shift = 1, -}; - -static struct platform_device cf_ide_device = { - .name = "pata_platform", - .id = -1, - .num_resources = ARRAY_SIZE(cf_ide_resources), - .resource = cf_ide_resources, - .dev = { - .platform_data = &pata_info, - }, -}; - -static struct spi_board_info spi_bus[] = { - { - .modalias = "rtc-r9701", - .max_speed_hz = 1000000, - .mode = SPI_MODE_3, - }, -}; - -static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state) -{ - BUG_ON(cs != 0); /* Single Epson RTC-9701JE attached on CS0 */ - ctrl_outw(state == BITBANG_CS_ACTIVE, PA_RTCCE); -} - -static struct sh_spi_info spi_info = { - .num_chipselect = 1, - .chip_select = r2d_chip_select, -}; - -static struct resource spi_sh_sci_resources[] = { - { - .start = 0xffe00000, - .end = 0xffe0001f, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device spi_sh_sci_device = { - .name = "spi_sh_sci", - .id = -1, - .num_resources = ARRAY_SIZE(spi_sh_sci_resources), - .resource = spi_sh_sci_resources, - .dev = { - .platform_data = &spi_info, - }, -}; - -static struct resource heartbeat_resources[] = { - [0] = { - .start = PA_OUTPORT, - .end = PA_OUTPORT, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device heartbeat_device = { - .name = "heartbeat", - .id = -1, - .num_resources = ARRAY_SIZE(heartbeat_resources), - .resource = heartbeat_resources, -}; - -static struct resource sm501_resources[] = { - [0] = { - .start = 0x10000000, - .end = 0x13e00000 - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 0x13e00000, - .end = 0x13ffffff, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = IRQ_VOYAGER, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct fb_videomode sm501_default_mode = { - .pixclock = 35714, - .xres = 640, - .yres = 480, - .left_margin = 105, - .right_margin = 50, - .upper_margin = 35, - .lower_margin = 0, - .hsync_len = 96, - .vsync_len = 2, - .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, -}; - -static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = { - .def_bpp = 16, - .def_mode = &sm501_default_mode, - .flags = SM501FB_FLAG_USE_INIT_MODE | - SM501FB_FLAG_USE_HWCURSOR | - SM501FB_FLAG_USE_HWACCEL | - SM501FB_FLAG_DISABLE_AT_EXIT, -}; - -static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = { - .flags = (SM501FB_FLAG_USE_INIT_MODE | - SM501FB_FLAG_USE_HWCURSOR | - SM501FB_FLAG_USE_HWACCEL | - SM501FB_FLAG_DISABLE_AT_EXIT), - -}; - -static struct sm501_platdata_fb sm501_fb_pdata = { - .fb_route = SM501_FB_OWN, - .fb_crt = &sm501_pdata_fbsub_crt, - .fb_pnl = &sm501_pdata_fbsub_pnl, - .flags = SM501_FBPD_SWAP_FB_ENDIAN, -}; - -static struct sm501_initdata sm501_initdata = { - .devices = SM501_USE_USB_HOST | SM501_USE_UART0, -}; - -static struct sm501_platdata sm501_platform_data = { - .init = &sm501_initdata, - .fb = &sm501_fb_pdata, -}; - -static struct platform_device sm501_device = { - .name = "sm501", - .id = -1, - .dev = { - .platform_data = &sm501_platform_data, - }, - .num_resources = ARRAY_SIZE(sm501_resources), - .resource = sm501_resources, -}; - -static struct platform_device *rts7751r2d_devices[] __initdata = { - &sm501_device, - &heartbeat_device, - &spi_sh_sci_device, -}; - -/* - * The CF is connected with a 16-bit bus where 8-bit operations are - * unsupported. The linux ata driver is however using 8-bit operations, so - * insert a trapped io filter to convert 8-bit operations into 16-bit. - */ -static struct trapped_io cf_trapped_io = { - .resource = cf_ide_resources, - .num_resources = 2, - .minimum_bus_width = 16, -}; - -static int __init rts7751r2d_devices_setup(void) -{ - if (register_trapped_io(&cf_trapped_io) == 0) - platform_device_register(&cf_ide_device); - - spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); - - return platform_add_devices(rts7751r2d_devices, - ARRAY_SIZE(rts7751r2d_devices)); -} -__initcall(rts7751r2d_devices_setup); - -static void rts7751r2d_power_off(void) -{ - ctrl_outw(0x0001, PA_POWOFF); -} - -/* - * Initialize the board - */ -static void __init rts7751r2d_setup(char **cmdline_p) -{ - void __iomem *sm501_reg; - u16 ver = ctrl_inw(PA_VERREG); - - printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n"); - - printk(KERN_INFO "FPGA version:%d (revision:%d)\n", - (ver >> 4) & 0xf, ver & 0xf); - - ctrl_outw(0x0000, PA_OUTPORT); - pm_power_off = rts7751r2d_power_off; - - /* sm501 dram configuration: - * ColSizeX = 11 - External Memory Column Size: 256 words. - * APX = 1 - External Memory Active to Pre-Charge Delay: 7 clocks. - * RstX = 1 - External Memory Reset: Normal. - * Rfsh = 1 - Local Memory Refresh to Command Delay: 12 clocks. - * BwC = 1 - Local Memory Block Write Cycle Time: 2 clocks. - * BwP = 1 - Local Memory Block Write to Pre-Charge Delay: 1 clock. - * AP = 1 - Internal Memory Active to Pre-Charge Delay: 7 clocks. - * Rst = 1 - Internal Memory Reset: Normal. - * RA = 1 - Internal Memory Remain in Active State: Do not remain. - */ - - sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL; - writel(readl(sm501_reg) | 0x00f107c0, sm501_reg); -} - -/* - * The Machine Vector - */ -static struct sh_machine_vector mv_rts7751r2d __initmv = { - .mv_name = "RTS7751R2D", - .mv_setup = rts7751r2d_setup, - .mv_init_irq = init_rts7751r2d_IRQ, - .mv_irq_demux = rts7751r2d_irq_demux, -}; diff --git a/arch/sh/boards/renesas/sdk7780/Kconfig b/arch/sh/boards/renesas/sdk7780/Kconfig deleted file mode 100644 index 065f1df..0000000 --- a/arch/sh/boards/renesas/sdk7780/Kconfig +++ /dev/null @@ -1,16 +0,0 @@ -if SH_SDK7780 - -choice - prompt "SDK7780 options" - default SH_SDK7780_BASE - -config SH_SDK7780_BASE - bool "SDK7780 with base-board support" - depends on CPU_SUBTYPE_SH7780 - help - Selecting this option will enable support for the expansion - baseboard devices. If in doubt, say Y. - -endchoice - -endif diff --git a/arch/sh/boards/renesas/sdk7780/Makefile b/arch/sh/boards/renesas/sdk7780/Makefile deleted file mode 100644 index 3d8f0be..0000000 --- a/arch/sh/boards/renesas/sdk7780/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# -# Makefile for the SDK7780 specific parts of the kernel -# -obj-y := setup.o irq.o - diff --git a/arch/sh/boards/renesas/sdk7780/irq.c b/arch/sh/boards/renesas/sdk7780/irq.c deleted file mode 100644 index 87cdc57..0000000 --- a/arch/sh/boards/renesas/sdk7780/irq.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * linux/arch/sh/boards/renesas/sdk7780/irq.c - * - * Renesas Technology Europe SDK7780 Support. - * - * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk> - * - * 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. - */ -#include <linux/init.h> -#include <linux/irq.h> -#include <linux/io.h> -#include <asm/sdk7780.h> - -enum { - UNUSED = 0, - /* board specific interrupt sources */ - SMC91C111, /* Ethernet controller */ -}; - -static struct intc_vect fpga_vectors[] __initdata = { - INTC_IRQ(SMC91C111, IRQ_ETHERNET), -}; - -static struct intc_mask_reg fpga_mask_registers[] __initdata = { - { 0, FPGA_IRQ0MR, 16, - { 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, SMC91C111, 0, 0, 0, 0 } }, -}; - -static DECLARE_INTC_DESC(fpga_intc_desc, "sdk7780-irq", fpga_vectors, - NULL, fpga_mask_registers, NULL, NULL); - -void __init init_sdk7780_IRQ(void) -{ - printk(KERN_INFO "Using SDK7780 interrupt controller.\n"); - - ctrl_outw(0xFFFF, FPGA_IRQ0MR); - /* Setup IRL 0-3 */ - ctrl_outw(0x0003, FPGA_IMSR); - plat_irq_setup_pins(IRQ_MODE_IRL3210); - - register_intc_controller(&fpga_intc_desc); -} diff --git a/arch/sh/boards/renesas/sdk7780/setup.c b/arch/sh/boards/renesas/sdk7780/setup.c deleted file mode 100644 index acc5932..0000000 --- a/arch/sh/boards/renesas/sdk7780/setup.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * arch/sh/boards/renesas/sdk7780/setup.c - * - * Renesas Solutions SH7780 SDK Support - * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk> - * - * 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. - */ -#include <linux/init.h> -#include <linux/types.h> -#include <linux/platform_device.h> -#include <linux/ata_platform.h> -#include <asm/machvec.h> -#include <asm/sdk7780.h> -#include <asm/heartbeat.h> -#include <asm/io.h> -#include <asm/addrspace.h> - -#define GPIO_PECR 0xFFEA0008 - -//* Heartbeat */ -static struct heartbeat_data heartbeat_data = { - .regsize = 16, -}; - -static struct resource heartbeat_resources[] = { - [0] = { - .start = PA_LED, - .end = PA_LED, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device heartbeat_device = { - .name = "heartbeat", - .id = -1, - .dev = { - .platform_data = &heartbeat_data, - }, - .num_resources = ARRAY_SIZE(heartbeat_resources), - .resource = heartbeat_resources, -}; - -/* SMC91x */ -static struct resource smc91x_eth_resources[] = { - [0] = { - .name = "smc91x-regs" , - .start = PA_LAN + 0x300, - .end = PA_LAN + 0x300 + 0x10 , - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IRQ_ETHERNET, - .end = IRQ_ETHERNET, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device smc91x_eth_device = { - .name = "smc91x", - .id = 0, - .dev = { - .dma_mask = NULL, /* don't use dma */ - .coherent_dma_mask = 0xffffffff, - }, - .num_resources = ARRAY_SIZE(smc91x_eth_resources), - .resource = smc91x_eth_resources, -}; - -static struct platform_device *sdk7780_devices[] __initdata = { - &heartbeat_device, - &smc91x_eth_device, -}; - -static int __init sdk7780_devices_setup(void) -{ - return platform_add_devices(sdk7780_devices, - ARRAY_SIZE(sdk7780_devices)); -} -device_initcall(sdk7780_devices_setup); - -static void __init sdk7780_setup(char **cmdline_p) -{ - u16 ver = ctrl_inw(FPGA_FPVERR); - u16 dateStamp = ctrl_inw(FPGA_FPDATER); - - printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n"); - printk(KERN_INFO "Board version: %d (revision %d), " - "FPGA version: %d (revision %d), datestamp : %d\n", - (ver >> 12) & 0xf, (ver >> 8) & 0xf, - (ver >> 4) & 0xf, ver & 0xf, - dateStamp); - - /* Setup pin mux'ing for PCIC */ - ctrl_outw(0x0000, GPIO_PECR); -} - -/* - * The Machine Vector - */ -static struct sh_machine_vector mv_se7780 __initmv = { - .mv_name = "Renesas SDK7780-R3" , - .mv_setup = sdk7780_setup, - .mv_nr_irqs = 111, - .mv_init_irq = init_sdk7780_IRQ, -}; - diff --git a/arch/sh/boards/renesas/sh7763rdp/Makefile b/arch/sh/boards/renesas/sh7763rdp/Makefile deleted file mode 100644 index f6c0b55..0000000 --- a/arch/sh/boards/renesas/sh7763rdp/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y := setup.o irq.o diff --git a/arch/sh/boards/renesas/sh7763rdp/irq.c b/arch/sh/boards/renesas/sh7763rdp/irq.c deleted file mode 100644 index fd850ba..0000000 --- a/arch/sh/boards/renesas/sh7763rdp/irq.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * linux/arch/sh/boards/renesas/sh7763rdp/irq.c - * - * Renesas Solutions SH7763RDP Support. - * - * Copyright (C) 2008 Renesas Solutions Corp. - * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> - * - * 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. - */ - -#include <linux/init.h> -#include <linux/irq.h> -#include <asm/io.h> -#include <asm/irq.h> -#include <asm/sh7763rdp.h> - -#define INTC_BASE (0xFFD00000) -#define INTC_INT2PRI7 (INTC_BASE+0x4001C) -#define INTC_INT2MSKCR (INTC_BASE+0x4003C) -#define INTC_INT2MSKCR1 (INTC_BASE+0x400D4) - -/* - * Initialize IRQ setting - */ -void __init init_sh7763rdp_IRQ(void) -{ - /* GPIO enabled */ - ctrl_outl(1 << 25, INTC_INT2MSKCR); - - /* enable GPIO interrupts */ - ctrl_outl((ctrl_inl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000, - INTC_INT2PRI7); - - /* USBH enabled */ - ctrl_outl(1 << 17, INTC_INT2MSKCR1); - - /* GETHER enabled */ - ctrl_outl(1 << 16, INTC_INT2MSKCR1); - - /* DMAC enabled */ - ctrl_outl(1 << 8, INTC_INT2MSKCR); -} diff --git a/arch/sh/boards/renesas/sh7763rdp/setup.c b/arch/sh/boards/renesas/sh7763rdp/setup.c deleted file mode 100644 index 925f16a..0000000 --- a/arch/sh/boards/renesas/sh7763rdp/setup.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * linux/arch/sh/boards/renesas/sh7763rdp/setup.c - * - * Renesas Solutions sh7763rdp board - * - * Copyright (C) 2008 Renesas Solutions Corp. - * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> - * - * 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. - */ -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/interrupt.h> -#include <linux/input.h> -#include <linux/mtd/physmap.h> -#include <asm/io.h> -#include <asm/sh7763rdp.h> - -/* NOR Flash */ -static struct mtd_partition sh7763rdp_nor_flash_partitions[] = { - { - .name = "U-Boot", - .offset = 0, - .size = (2 * 128 * 1024), - .mask_flags = MTD_WRITEABLE, /* Read-only */ - }, { - .name = "Linux-Kernel", - .offset = MTDPART_OFS_APPEND, - .size = (20 * 128 * 1024), - }, { - .name = "Root Filesystem", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - }, -}; - -static struct physmap_flash_data sh7763rdp_nor_flash_data = { - .width = 2, - .parts = sh7763rdp_nor_flash_partitions, - .nr_parts = ARRAY_SIZE(sh7763rdp_nor_flash_partitions), -}; - -static struct resource sh7763rdp_nor_flash_resources[] = { - [0] = { - .name = "NOR Flash", - .start = 0, - .end = (64 * 1024 * 1024), - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device sh7763rdp_nor_flash_device = { - .name = "physmap-flash", - .resource = sh7763rdp_nor_flash_resources, - .num_resources = ARRAY_SIZE(sh7763rdp_nor_flash_resources), - .dev = { - .platform_data = &sh7763rdp_nor_flash_data, - }, -}; - -static struct platform_device *sh7763rdp_devices[] __initdata = { - &sh7763rdp_nor_flash_device, -}; - -static int __init sh7763rdp_devices_setup(void) -{ - return platform_add_devices(sh7763rdp_devices, - ARRAY_SIZE(sh7763rdp_devices)); -} -__initcall(sh7763rdp_devices_setup); - -static void __init sh7763rdp_setup(char **cmdline_p) -{ - /* Board version check */ - if (ctrl_inw(CPLD_BOARD_ID_ERV_REG) == 0xECB1) - printk(KERN_INFO "RTE Standard Configuration\n"); - else - printk(KERN_INFO "RTA Standard Configuration\n"); - - /* USB pin select bits (clear bit 5-2 to 0) */ - ctrl_outw((ctrl_inw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2); - /* USBH setup port I controls to other (clear bits 4-9 to 0) */ - ctrl_outw(ctrl_inw(PORT_PICR) & 0xFC0F, PORT_PICR); - - /* Select USB Host controller */ - ctrl_outw(0x00, USB_USBHSC); - - /* For LCD */ - /* set PTJ7-1, bits 15-2 of PJCR to 0 */ - ctrl_outw(ctrl_inw(PORT_PJCR) & 0x0003, PORT_PJCR); - /* set PTI5, bits 11-10 of PICR to 0 */ - ctrl_outw(ctrl_inw(PORT_PICR) & 0xF3FF, PORT_PICR); - ctrl_outw(0, PORT_PKCR); - ctrl_outw(0, PORT_PLCR); - /* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */ - ctrl_outw((ctrl_inw(PORT_PSEL2) & 0x00C0), PORT_PSEL2); - /* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */ - ctrl_outw((ctrl_inw(PORT_PSEL3) & 0x0700), PORT_PSEL3); - - /* For HAC */ - /* bit3-0 0100:HAC & SSI1 enable */ - ctrl_outw((ctrl_inw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1); - /* bit14 1:SSI_HAC_CLK enable */ - ctrl_outw(ctrl_inw(PORT_PSEL4) | 0x4000, PORT_PSEL4); - - /* SH-Ether */ - ctrl_outw((ctrl_inw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1); - ctrl_outw(0x0, PORT_PFCR); - ctrl_outw(0x0, PORT_PFCR); - ctrl_outw(0x0, PORT_PFCR); - - /* MMC */ - /*selects SCIF and MMC other functions */ - ctrl_outw(0x0001, PORT_PSEL0); - /* MMC clock operates */ - ctrl_outl(ctrl_inl(MSTPCR1) & ~0x8, MSTPCR1); - ctrl_outw(ctrl_inw(PORT_PACR) & ~0x3000, PORT_PACR); - ctrl_outw(ctrl_inw(PORT_PCCR) & ~0xCFC3, PORT_PCCR); -} - -static struct sh_machine_vector mv_sh7763rdp __initmv = { - .mv_name = "sh7763drp", - .mv_setup = sh7763rdp_setup, - .mv_nr_irqs = 112, - .mv_init_irq = init_sh7763rdp_IRQ, -}; diff --git a/arch/sh/boards/renesas/sh7785lcr/Makefile b/arch/sh/boards/renesas/sh7785lcr/Makefile deleted file mode 100644 index 7703756..0000000 --- a/arch/sh/boards/renesas/sh7785lcr/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y := setup.o diff --git a/arch/sh/boards/renesas/sh7785lcr/setup.c b/arch/sh/boards/renesas/sh7785lcr/setup.c deleted file mode 100644 index b95d674..0000000 --- a/arch/sh/boards/renesas/sh7785lcr/setup.c +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Renesas Technology Corp. R0P7785LC0011RL Support. - * - * Copyright (C) 2008 Yoshihiro Shimoda - * - * 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. - */ - -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/sm501.h> -#include <linux/sm501-regs.h> -#include <linux/fb.h> -#include <linux/mtd/physmap.h> -#include <linux/delay.h> -#include <linux/i2c.h> -#include <linux/i2c-pca-platform.h> -#include <linux/i2c-algo-pca.h> -#include <asm/heartbeat.h> -#include <asm/sh7785lcr.h> - -/* - * NOTE: This board has 2 physical memory maps. - * Please look at include/asm-sh/sh7785lcr.h or hardware manual. - */ -static struct resource heartbeat_resources[] = { - [0] = { - .start = PLD_LEDCR, - .end = PLD_LEDCR, - .flags = IORESOURCE_MEM, - }, -}; - -static struct heartbeat_data heartbeat_data = { - .regsize = 8, -}; - -static struct platform_device heartbeat_device = { - .name = "heartbeat", - .id = -1, - .dev = { - .platform_data = &heartbeat_data, - }, - .num_resources = ARRAY_SIZE(heartbeat_resources), - .resource = heartbeat_resources, -}; - -static struct mtd_partition nor_flash_partitions[] = { - { - .name = "loader", - .offset = 0x00000000, - .size = 512 * 1024, - }, - { - .name = "bootenv", - .offset = MTDPART_OFS_APPEND, - .size = 512 * 1024, - }, - { - .name = "kernel", - .offset = MTDPART_OFS_APPEND, - .size = 4 * 1024 * 1024, - }, - { - .name = "data", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - }, -}; - -static struct physmap_flash_data nor_flash_data = { - .width = 4, - .parts = nor_flash_partitions, - .nr_parts = ARRAY_SIZE(nor_flash_partitions), -}; - -static struct resource nor_flash_resources[] = { - [0] = { - .start = NOR_FLASH_ADDR, - .end = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1, - .flags = IORESOURCE_MEM, - } -}; - -static struct platform_device nor_flash_device = { - .name = "physmap-flash", - .dev = { - .platform_data = &nor_flash_data, - }, - .num_resources = ARRAY_SIZE(nor_flash_resources), - .resource = nor_flash_resources, -}; - -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, - }, -}; - -static struct platform_device r8a66597_usb_host_device = { - .name = "r8a66597_hcd", - .id = -1, - .dev = { - .dma_mask = NULL, - .coherent_dma_mask = 0xffffffff, - }, - .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources), - .resource = r8a66597_usb_host_resources, -}; - -static struct resource sm501_resources[] = { - [0] = { - .start = SM107_MEM_ADDR, - .end = SM107_MEM_ADDR + SM107_MEM_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = SM107_REG_ADDR, - .end = SM107_REG_ADDR + SM107_REG_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = 10, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct fb_videomode sm501_default_mode_crt = { - .pixclock = 35714, /* 28MHz */ - .xres = 640, - .yres = 480, - .left_margin = 105, - .right_margin = 16, - .upper_margin = 33, - .lower_margin = 10, - .hsync_len = 39, - .vsync_len = 2, - .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, -}; - -static struct fb_videomode sm501_default_mode_pnl = { - .pixclock = 40000, /* 25MHz */ - .xres = 640, - .yres = 480, - .left_margin = 2, - .right_margin = 16, - .upper_margin = 33, - .lower_margin = 10, - .hsync_len = 39, - .vsync_len = 2, - .sync = 0, -}; - -static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = { - .def_bpp = 16, - .def_mode = &sm501_default_mode_pnl, - .flags = SM501FB_FLAG_USE_INIT_MODE | - SM501FB_FLAG_USE_HWCURSOR | - SM501FB_FLAG_USE_HWACCEL | - SM501FB_FLAG_DISABLE_AT_EXIT | - SM501FB_FLAG_PANEL_NO_VBIASEN, -}; - -static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = { - .def_bpp = 16, - .def_mode = &sm501_default_mode_crt, - .flags = SM501FB_FLAG_USE_INIT_MODE | - SM501FB_FLAG_USE_HWCURSOR | - SM501FB_FLAG_USE_HWACCEL | - SM501FB_FLAG_DISABLE_AT_EXIT, -}; - -static struct sm501_platdata_fb sm501_fb_pdata = { - .fb_route = SM501_FB_OWN, - .fb_crt = &sm501_pdata_fbsub_crt, - .fb_pnl = &sm501_pdata_fbsub_pnl, -}; - -static struct sm501_initdata sm501_initdata = { - .gpio_high = { - .set = 0x00001fe0, - .mask = 0x0, - }, - .devices = 0, - .mclk = 84 * 1000000, - .m1xclk = 112 * 1000000, -}; - -static struct sm501_platdata sm501_platform_data = { - .init = &sm501_initdata, - .fb = &sm501_fb_pdata, -}; - -static struct platform_device sm501_device = { - .name = "sm501", - .id = -1, - .dev = { - .platform_data = &sm501_platform_data, - }, - .num_resources = ARRAY_SIZE(sm501_resources), - .resource = sm501_resources, -}; - -static struct resource i2c_resources[] = { - [0] = { - .start = PCA9564_ADDR, - .end = PCA9564_ADDR + PCA9564_SIZE - 1, - .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, - }, - [1] = { - .start = 12, - .end = 12, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct i2c_pca9564_pf_platform_data i2c_platform_data = { - .gpio = 0, - .i2c_clock_speed = I2C_PCA_CON_330kHz, - .timeout = 100, -}; - -static struct platform_device i2c_device = { - .name = "i2c-pca-platform", - .id = -1, - .dev = { - .platform_data = &i2c_platform_data, - }, - .num_resources = ARRAY_SIZE(i2c_resources), - .resource = i2c_resources, -}; - -static struct platform_device *sh7785lcr_devices[] __initdata = { - &heartbeat_device, - &nor_flash_device, - &r8a66597_usb_host_device, - &sm501_device, - &i2c_device, -}; - -static struct i2c_board_info __initdata sh7785lcr_i2c_devices[] = { - { - I2C_BOARD_INFO("r2025sd", 0x32), - }, -}; - -static int __init sh7785lcr_devices_setup(void) -{ - i2c_register_board_info(0, sh7785lcr_i2c_devices, - ARRAY_SIZE(sh7785lcr_i2c_devices)); - - return platform_add_devices(sh7785lcr_devices, - ARRAY_SIZE(sh7785lcr_devices)); -} -__initcall(sh7785lcr_devices_setup); - -/* Initialize IRQ setting */ -void __init init_sh7785lcr_IRQ(void) -{ - plat_irq_setup_pins(IRQ_MODE_IRQ7654); - plat_irq_setup_pins(IRQ_MODE_IRQ3210); -} - -static void sh7785lcr_power_off(void) -{ - ctrl_outb(0x01, P2SEGADDR(PLD_POFCR)); -} - -/* Initialize the board */ -static void __init sh7785lcr_setup(char **cmdline_p) -{ - void __iomem *sm501_reg; - - printk(KERN_INFO "Renesas Technology Corp. R0P7785LC0011RL support.\n"); - - pm_power_off = sh7785lcr_power_off; - - /* sm501 DRAM configuration */ - sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL; - writel(0x000307c2, sm501_reg); -} - -/* - * The Machine Vector - */ -static struct sh_machine_vector mv_sh7785lcr __initmv = { - .mv_name = "SH7785LCR", - .mv_setup = sh7785lcr_setup, - .mv_init_irq = init_sh7785lcr_IRQ, -}; - diff --git a/arch/sh/boards/renesas/systemh/Makefile b/arch/sh/boards/renesas/systemh/Makefile deleted file mode 100644 index 2cc6a23..0000000 --- a/arch/sh/boards/renesas/systemh/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# -# Makefile for the SystemH specific parts of the kernel -# - -obj-y := setup.o irq.o io.o - -# XXX: This wants to be consolidated in arch/sh/drivers/pci, and more -# importantly, with the generic sh7751_pcic_init() code. For now, we'll -# just abuse the hell out of kbuild, because we can.. - -obj-$(CONFIG_PCI) += pci.o -pci-y := ../../se/7751/pci.o - diff --git a/arch/sh/boards/renesas/systemh/io.c b/arch/sh/boards/renesas/systemh/io.c deleted file mode 100644 index 1b767e1..0000000 --- a/arch/sh/boards/renesas/systemh/io.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * linux/arch/sh/boards/renesas/systemh/io.c - * - * Copyright (C) 2001 Ian da Silva, Jeremy Siegel - * Based largely on io_se.c. - * - * I/O routine for Hitachi 7751 Systemh. - */ -#include <linux/kernel.h> -#include <linux/types.h> -#include <linux/pci.h> -#include <asm/systemh7751.h> -#include <asm/addrspace.h> -#include <asm/io.h> - -#define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area - of smc lan chip*/ -static inline volatile __u16 * -port2adr(unsigned int port) -{ - if (port >= 0x2000) - return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); - maybebadio((unsigned long)port); - return (volatile __u16*)port; -} - -/* - * General outline: remap really low stuff [eventually] to SuperIO, - * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) - * is mapped through the PCI IO window. Stuff with high bits (PXSEG) - * should be way beyond the window, and is used w/o translation for - * compatibility. - */ -unsigned char sh7751systemh_inb(unsigned long port) -{ - if (PXSEG(port)) - return *(volatile unsigned char *)port; - else if (is_pci_ioaddr(port)) - return *(volatile unsigned char *)pci_ioaddr(port); - else if (port <= 0x3F1) - return *(volatile unsigned char *)ETHER_IOMAP(port); - else - return (*port2adr(port))&0xff; -} - -unsigned char sh7751systemh_inb_p(unsigned long port) -{ - unsigned char v; - - if (PXSEG(port)) - v = *(volatile unsigned char *)port; - else if (is_pci_ioaddr(port)) - v = *(volatile unsigned char *)pci_ioaddr(port); - else if (port <= 0x3F1) - v = *(volatile unsigned char *)ETHER_IOMAP(port); - else - v = (*port2adr(port))&0xff; - ctrl_delay(); - return v; -} - -unsigned short sh7751systemh_inw(unsigned long port) -{ - if (PXSEG(port)) - return *(volatile unsigned short *)port; - else if (is_pci_ioaddr(port)) - return *(volatile unsigned short *)pci_ioaddr(port); - else if (port >= 0x2000) - return *port2adr(port); - else if (port <= 0x3F1) - return *(volatile unsigned int *)ETHER_IOMAP(port); - else - maybebadio(port); - return 0; -} - -unsigned int sh7751systemh_inl(unsigned long port) -{ - if (PXSEG(port)) - return *(volatile unsigned long *)port; - else if (is_pci_ioaddr(port)) - return *(volatile unsigned int *)pci_ioaddr(port); - else if (port >= 0x2000) - return *port2adr(port); - else if (port <= 0x3F1) - return *(volatile unsigned int *)ETHER_IOMAP(port); - else - maybebadio(port); - return 0; -} - -void sh7751systemh_outb(unsigned char value, unsigned long port) -{ - - if (PXSEG(port)) - *(volatile unsigned char *)port = value; - else if (is_pci_ioaddr(port)) - *((unsigned char*)pci_ioaddr(port)) = value; - else if (port <= 0x3F1) - *(volatile unsigned char *)ETHER_IOMAP(port) = value; - else - *(port2adr(port)) = value; -} - -void sh7751systemh_outb_p(unsigned char value, unsigned long port) -{ - if (PXSEG(port)) - *(volatile unsigned char *)port = value; - else if (is_pci_ioaddr(port)) - *((unsigned char*)pci_ioaddr(port)) = value; - else if (port <= 0x3F1) - *(volatile unsigned char *)ETHER_IOMAP(port) = value; - else - *(port2adr(port)) = value; - ctrl_delay(); -} - -void sh7751systemh_outw(unsigned short value, unsigned long port) -{ - if (PXSEG(port)) - *(volatile unsigned short *)port = value; - else if (is_pci_ioaddr(port)) - *((unsigned short *)pci_ioaddr(port)) = value; - else if (port >= 0x2000) - *port2adr(port) = value; - else if (port <= 0x3F1) - *(volatile unsigned short *)ETHER_IOMAP(port) = value; - else - maybebadio(port); -} - -void sh7751systemh_outl(unsigned int value, unsigned long port) -{ - if (PXSEG(port)) - *(volatile unsigned long *)port = value; - else if (is_pci_ioaddr(port)) - *((unsigned long*)pci_ioaddr(port)) = value; - else - maybebadio(port); -} - -void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count) -{ - unsigned char *p = addr; - while (count--) *p++ = sh7751systemh_inb(port); -} - -void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count) -{ - unsigned short *p = addr; - while (count--) *p++ = sh7751systemh_inw(port); -} - -void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count) -{ - maybebadio(port); -} - -void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count) -{ - unsigned char *p = (unsigned char*)addr; - while (count--) sh7751systemh_outb(*p++, port); -} - -void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count) -{ - unsigned short *p = (unsigned short*)addr; - while (count--) sh7751systemh_outw(*p++, port); -} - -void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count) -{ - maybebadio(port); -} diff --git a/arch/sh/boards/renesas/systemh/irq.c b/arch/sh/boards/renesas/systemh/irq.c deleted file mode 100644 index 0ba2fe6..0000000 --- a/arch/sh/boards/renesas/systemh/irq.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * linux/arch/sh/boards/renesas/systemh/irq.c - * - * Copyright (C) 2000 Kazumoto Kojima - * - * Hitachi SystemH Support. - * - * Modified for 7751 SystemH by - * Jonathan Short. - */ - -#include <linux/init.h> -#include <linux/irq.h> - -#include <linux/hdreg.h> -#include <linux/ide.h> -#include <asm/io.h> -#include <asm/systemh7751.h> -#include <asm/smc37c93x.h> - -/* address of external interrupt mask register - * address must be set prior to use these (maybe in init_XXX_irq()) - * XXX : is it better to use .config than specifying it in code? */ -static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; -static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; - -/* forward declaration */ -static unsigned int startup_systemh_irq(unsigned int irq); -static void shutdown_systemh_irq(unsigned int irq); -static void enable_systemh_irq(unsigned int irq); -static void disable_systemh_irq(unsigned int irq); -static void mask_and_ack_systemh(unsigned int); -static void end_systemh_irq(unsigned int irq); - -/* hw_interrupt_type */ -static struct hw_interrupt_type systemh_irq_type = { - .typename = " SystemH Register", - .startup = startup_systemh_irq, - .shutdown = shutdown_systemh_irq, - .enable = enable_systemh_irq, - .disable = disable_systemh_irq, - .ack = mask_and_ack_systemh, - .end = end_systemh_irq -}; - -static unsigned int startup_systemh_irq(unsigned int irq) -{ - enable_systemh_irq(irq); - return 0; /* never anything pending */ -} - -static void shutdown_systemh_irq(unsigned int irq) -{ - disable_systemh_irq(irq); -} - -static void disable_systemh_irq(unsigned int irq) -{ - if (systemh_irq_mask_register) { - unsigned long val, mask = 0x01 << 1; - - /* Clear the "irq"th bit in the mask and set it in the request */ - val = ctrl_inl((unsigned long)systemh_irq_mask_register); - val &= ~mask; - ctrl_outl(val, (unsigned long)systemh_irq_mask_register); - - val = ctrl_inl((unsigned long)systemh_irq_request_register); - val |= mask; - ctrl_outl(val, (unsigned long)systemh_irq_request_register); - } -} - -static void enable_systemh_irq(unsigned int irq) -{ - if (systemh_irq_mask_register) { - unsigned long val, mask = 0x01 << 1; - - /* Set "irq"th bit in the mask register */ - val = ctrl_inl((unsigned long)systemh_irq_mask_register); - val |= mask; - ctrl_outl(val, (unsigned long)systemh_irq_mask_register); - } -} - -static void mask_and_ack_systemh(unsigned int irq) -{ - disable_systemh_irq(irq); -} - -static void end_systemh_irq(unsigned int irq) -{ - if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) - enable_systemh_irq(irq); -} - -void make_systemh_irq(unsigned int irq) -{ - disable_irq_nosync(irq); - irq_desc[irq].chip = &systemh_irq_type; - disable_systemh_irq(irq); -} - diff --git a/arch/sh/boards/renesas/systemh/setup.c b/arch/sh/boards/renesas/systemh/setup.c deleted file mode 100644 index ee78af8..0000000 --- a/arch/sh/boards/renesas/systemh/setup.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * linux/arch/sh/boards/renesas/systemh/setup.c - * - * Copyright (C) 2000 Kazumoto Kojima - * Copyright (C) 2003 Paul Mundt - * - * Hitachi SystemH Support. - * - * Modified for 7751 SystemH by Jonathan Short. - * - * Rewritten for 2.6 by Paul Mundt. - * - * 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. - */ -#include <linux/init.h> -#include <asm/machvec.h> -#include <asm/systemh7751.h> - -extern void make_systemh_irq(unsigned int irq); - -/* - * Initialize IRQ setting - */ -static void __init sh7751systemh_init_irq(void) -{ - make_systemh_irq(0xb); /* Ethernet interrupt */ -} - -static struct sh_machine_vector mv_7751systemh __initmv = { - .mv_name = "7751 SystemH", - .mv_nr_irqs = 72, - - .mv_inb = sh7751systemh_inb, - .mv_inw = sh7751systemh_inw, - .mv_inl = sh7751systemh_inl, - .mv_outb = sh7751systemh_outb, - .mv_outw = sh7751systemh_outw, - .mv_outl = sh7751systemh_outl, - - .mv_inb_p = sh7751systemh_inb_p, - .mv_inw_p = sh7751systemh_inw, - .mv_inl_p = sh7751systemh_inl, - .mv_outb_p = sh7751systemh_outb_p, - .mv_outw_p = sh7751systemh_outw, - .mv_outl_p = sh7751systemh_outl, - - .mv_insb = sh7751systemh_insb, - .mv_insw = sh7751systemh_insw, - .mv_insl = sh7751systemh_insl, - .mv_outsb = sh7751systemh_outsb, - .mv_outsw = sh7751systemh_outsw, - .mv_outsl = sh7751systemh_outsl, - - .mv_init_irq = sh7751systemh_init_irq, -}; diff --git a/arch/sh/boards/renesas/x3proto/Makefile b/arch/sh/boards/renesas/x3proto/Makefile deleted file mode 100644 index 983e455..0000000 --- a/arch/sh/boards/renesas/x3proto/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y += setup.o ilsel.o diff --git a/arch/sh/boards/renesas/x3proto/ilsel.c b/arch/sh/boards/renesas/x3proto/ilsel.c deleted file mode 100644 index b5c673c..0000000 --- a/arch/sh/boards/renesas/x3proto/ilsel.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * arch/sh/boards/renesas/x3proto/ilsel.c - * - * Helper routines for SH-X3 proto board ILSEL. - * - * Copyright (C) 2007 Paul Mundt - * - * 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. - */ -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/bitmap.h> -#include <linux/io.h> -#include <asm/ilsel.h> - -/* - * ILSEL is split across: - * - * ILSEL0 - 0xb8100004 [ Levels 1 - 4 ] - * ILSEL1 - 0xb8100006 [ Levels 5 - 8 ] - * ILSEL2 - 0xb8100008 [ Levels 9 - 12 ] - * ILSEL3 - 0xb810000a [ Levels 13 - 15 ] - * - * With each level being relative to an ilsel_source_t. - */ -#define ILSEL_BASE 0xb8100004 -#define ILSEL_LEVELS 15 - -/* - * ILSEL level map, in descending order from the highest level down. - * - * Supported levels are 1 - 15 spread across ILSEL0 - ILSEL4, mapping - * directly to IRLs. As the IRQs are numbered in reverse order relative - * to the interrupt level, the level map is carefully managed to ensure a - * 1:1 mapping between the bit position and the IRQ number. - * - * This careful constructions allows ilsel_enable*() to be referenced - * directly for hooking up an ILSEL set and getting back an IRQ which can - * subsequently be used for internal accounting in the (optional) disable - * path. - */ -static unsigned long ilsel_level_map; - -static inline unsigned int ilsel_offset(unsigned int bit) -{ - return ILSEL_LEVELS - bit - 1; -} - -static inline unsigned long mk_ilsel_addr(unsigned int bit) -{ - return ILSEL_BASE + ((ilsel_offset(bit) >> 1) & ~0x1); -} - -static inline unsigned int mk_ilsel_shift(unsigned int bit) -{ - return (ilsel_offset(bit) & 0x3) << 2; -} - -static void __ilsel_enable(ilsel_source_t set, unsigned int bit) -{ - unsigned int tmp, shift; - unsigned long addr; - - addr = mk_ilsel_addr(bit); - shift = mk_ilsel_shift(bit); - - pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n", - __func__, bit, addr, shift, set); - - tmp = ctrl_inw(addr); - tmp &= ~(0xf << shift); - tmp |= set << shift; - ctrl_outw(tmp, addr); -} - -/** - * ilsel_enable - Enable an ILSEL set. - * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h). - * - * Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest - * available interrupt level. Callers should take care to order callsites - * noting descending interrupt levels. Aliasing FPGA and external board - * IRQs need to use ilsel_enable_fixed(). - * - * The return value is an IRQ number that can later be taken down with - * ilsel_disable(). - */ -int ilsel_enable(ilsel_source_t set) -{ - unsigned int bit; - - /* Aliased sources must use ilsel_enable_fixed() */ - BUG_ON(set > ILSEL_KEY); - - do { - bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS); - } while (test_and_set_bit(bit, &ilsel_level_map)); - - __ilsel_enable(set, bit); - - return bit; -} -EXPORT_SYMBOL_GPL(ilsel_enable); - -/** - * ilsel_enable_fixed - Enable an ILSEL set at a fixed interrupt level - * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h). - * @level: Interrupt level (1 - 15) - * - * Enables a given ILSEL source at a fixed interrupt level. Necessary - * both for level reservation as well as for aliased sources that only - * exist on special ILSEL#s. - * - * Returns an IRQ number (as ilsel_enable()). - */ -int ilsel_enable_fixed(ilsel_source_t set, unsigned int level) -{ - unsigned int bit = ilsel_offset(level - 1); - - if (test_and_set_bit(bit, &ilsel_level_map)) - return -EBUSY; - - __ilsel_enable(set, bit); - - return bit; -} -EXPORT_SYMBOL_GPL(ilsel_enable_fixed); - -/** - * ilsel_disable - Disable an ILSEL set - * @irq: Bit position for ILSEL set value (retval from enable routines) - * - * Disable a previously enabled ILSEL set. - */ -void ilsel_disable(unsigned int irq) -{ - unsigned long addr; - unsigned int tmp; - - addr = mk_ilsel_addr(irq); - - tmp = ctrl_inw(addr); - tmp &= ~(0xf << mk_ilsel_shift(irq)); - ctrl_outw(tmp, addr); - - clear_bit(irq, &ilsel_level_map); -} -EXPORT_SYMBOL_GPL(ilsel_disable); diff --git a/arch/sh/boards/renesas/x3proto/setup.c b/arch/sh/boards/renesas/x3proto/setup.c deleted file mode 100644 index abc5b6d..0000000 --- a/arch/sh/boards/renesas/x3proto/setup.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * arch/sh/boards/renesas/x3proto/setup.c - * - * Renesas SH-X3 Prototype Board Support. - * - * Copyright (C) 2007 Paul Mundt - * - * 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. - */ -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/kernel.h> -#include <linux/io.h> -#include <asm/ilsel.h> - -static struct resource heartbeat_resources[] = { - [0] = { - .start = 0xb8140020, - .end = 0xb8140020, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device heartbeat_device = { - .name = "heartbeat", - .id = -1, - .num_resources = ARRAY_SIZE(heartbeat_resources), - .resource = heartbeat_resources, -}; - -static struct resource smc91x_resources[] = { - [0] = { - .start = 0x18000300, - .end = 0x18000300 + 0x10 - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - /* Filled in by ilsel */ - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device smc91x_device = { - .name = "smc91x", - .id = -1, - .resource = smc91x_resources, - .num_resources = ARRAY_SIZE(smc91x_resources), -}; - -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, - }, -}; - -static struct platform_device r8a66597_usb_host_device = { - .name = "r8a66597_hcd", - .id = -1, - .dev = { - .dma_mask = NULL, /* don't use dma */ - .coherent_dma_mask = 0xffffffff, - }, - .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources), - .resource = r8a66597_usb_host_resources, -}; - -static struct resource m66592_usb_peripheral_resources[] = { - [0] = { - .name = "m66592_udc", - .start = 0x18080000, - .end = 0x180c0000 - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .name = "m66592_udc", - /* Filled in by ilsel */ - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device m66592_usb_peripheral_device = { - .name = "m66592_udc", - .id = -1, - .dev = { - .dma_mask = NULL, /* don't use dma */ - .coherent_dma_mask = 0xffffffff, - }, - .num_resources = ARRAY_SIZE(m66592_usb_peripheral_resources), - .resource = m66592_usb_peripheral_resources, -}; - -static struct platform_device *x3proto_devices[] __initdata = { - &heartbeat_device, - &smc91x_device, - &r8a66597_usb_host_device, - &m66592_usb_peripheral_device, -}; - -static int __init x3proto_devices_setup(void) -{ - r8a66597_usb_host_resources[1].start = - r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I); - - m66592_usb_peripheral_resources[1].start = - m66592_usb_peripheral_resources[1].end = ilsel_enable(ILSEL_USBP_I); - - smc91x_resources[1].start = - smc91x_resources[1].end = ilsel_enable(ILSEL_LAN); - - return platform_add_devices(x3proto_devices, - ARRAY_SIZE(x3proto_devices)); -} -device_initcall(x3proto_devices_setup); - -static void __init x3proto_init_irq(void) -{ - plat_irq_setup_pins(IRQ_MODE_IRL3210); - - /* Set ICR0.LVLMODE */ - ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000); -} - -static struct sh_machine_vector mv_x3proto __initmv = { - .mv_name = "x3proto", - .mv_init_irq = x3proto_init_irq, -}; |