Merge branches 'sh/memchunk' and 'common/mmcif' into sh-latest
authorPaul Mundt <lethal@linux-sh.org>
Tue, 11 Jan 2011 04:05:15 +0000 (13:05 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 11 Jan 2011 04:05:15 +0000 (13:05 +0900)
18 files changed:
arch/sh/boards/board-edosk7705.c
arch/sh/boards/board-edosk7760.c
arch/sh/boards/board-sh7785lcr.c
arch/sh/boards/mach-cayman/setup.c
arch/sh/boards/mach-landisk/irq.c
arch/sh/boards/mach-landisk/setup.c
arch/sh/boards/mach-r2d/setup.c
arch/sh/boards/mach-sdk7786/setup.c
arch/sh/boards/mach-se/7206/setup.c
arch/sh/boards/mach-se/7751/setup.c
arch/sh/boards/mach-sh03/setup.c
arch/sh/boot/romimage/mmcif-sh7724.c
arch/sh/configs/sh7757lcr_defconfig
arch/sh/drivers/pci/fixups-landisk.c
arch/sh/include/asm/io.h
arch/sh/include/mach-landisk/mach/iodata_landisk.h
arch/sh/kernel/cpu/sh4/probe.c
include/linux/mmc/sh_mmcif.h

index 4cb3bb74c36fbf3499f79a3f78aed06e68f831c1..541d8a28103538e2fa82706f9352a0875769e47c 100644 (file)
@@ -66,7 +66,7 @@ static int __init init_edosk7705_devices(void)
        return platform_add_devices(edosk7705_devices,
                                    ARRAY_SIZE(edosk7705_devices));
 }
-__initcall(init_edosk7705_devices);
+device_initcall(init_edosk7705_devices);
 
 /*
  * The Machine Vector
index 35dc0994875d5f0e1196a37e6015b971f311459f..f47ac82da87636d4993b65d4adc66acded83257c 100644 (file)
@@ -182,7 +182,7 @@ static int __init init_edosk7760_devices(void)
        return platform_add_devices(edosk7760_devices,
                                    ARRAY_SIZE(edosk7760_devices));
 }
-__initcall(init_edosk7760_devices);
+device_initcall(init_edosk7760_devices);
 
 /*
  * The Machine Vector
index fe7e686c94ac004fc19bc569df8ee271aad932f1..ee65ff05c558d401ce844fed329ee2cc24be683f 100644 (file)
@@ -284,7 +284,7 @@ static int __init sh7785lcr_devices_setup(void)
        return platform_add_devices(sh7785lcr_devices,
                                    ARRAY_SIZE(sh7785lcr_devices));
 }
-__initcall(sh7785lcr_devices_setup);
+device_initcall(sh7785lcr_devices_setup);
 
 /* Initialize IRQ setting */
 void __init init_sh7785lcr_IRQ(void)
index 7e8216ac31bda3cf263faad31ab3105e7afd0b0f..e89e8e122a26850ab4ec4f31c0398b4d4973406e 100644 (file)
@@ -165,7 +165,7 @@ static int __init smsc_superio_setup(void)
 
        return 0;
 }
-__initcall(smsc_superio_setup);
+device_initcall(smsc_superio_setup);
 
 static void __iomem *cayman_ioport_map(unsigned long port, unsigned int len)
 {
index e79412a4049094a2610dbefc554da89384cfbce8..c00ace38db3f6e0913e35ac218a7731dcc522870 100644 (file)
@@ -1,9 +1,10 @@
 /*
- * arch/sh/boards/landisk/irq.c
+ * arch/sh/boards/mach-landisk/irq.c
  *
  * I-O DATA Device, Inc. LANDISK Support
  *
  * Copyright (C) 2005-2007 kogiidena
+ * Copyright (C) 2011 Nobuhiro Iwamatsu
  *
  * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
  * Based largely on io_se.c.
  * 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/interrupt.h>
 #include <linux/io.h>
 #include <mach-landisk/mach/iodata_landisk.h>
 
-static void disable_landisk_irq(struct irq_data *data)
-{
-       unsigned char mask = 0xff ^ (0x01 << (data->irq - 5));
+enum {
+       UNUSED = 0,
 
-       __raw_writeb(__raw_readb(PA_IMASK) & mask, PA_IMASK);
-}
-
-static void enable_landisk_irq(struct irq_data *data)
-{
-       unsigned char value = (0x01 << (data->irq - 5));
+       PCI_INTA, /* PCI int A */
+       PCI_INTB, /* PCI int B */
+       PCI_INTC, /* PCI int C */
+       PCI_INTD, /* PCI int D */
+       ATA,      /* ATA */
+       FATA,     /* CF */
+       POWER,    /* Power swtich */
+       BUTTON,   /* Button swtich */
+};
 
-       __raw_writeb(__raw_readb(PA_IMASK) | value, PA_IMASK);
-}
+/* Vectors for LANDISK */
+static struct intc_vect vectors_landisk[] __initdata = {
+       INTC_IRQ(PCI_INTA, IRQ_PCIINTA),
+       INTC_IRQ(PCI_INTB, IRQ_PCIINTB),
+       INTC_IRQ(PCI_INTC, IRQ_PCIINTC),
+       INTC_IRQ(PCI_INTD, IRQ_PCIINTD),
+       INTC_IRQ(ATA, IRQ_ATA),
+       INTC_IRQ(FATA, IRQ_FATA),
+       INTC_IRQ(POWER, IRQ_POWER),
+       INTC_IRQ(BUTTON, IRQ_BUTTON),
+};
 
-static struct irq_chip landisk_irq_chip __read_mostly = {
-       .name           = "LANDISK",
-       .irq_mask       = disable_landisk_irq,
-       .irq_unmask     = enable_landisk_irq,
+/* IRLMSK mask register layout for LANDISK */
+static struct intc_mask_reg mask_registers_landisk[] __initdata = {
+       { PA_IMASK, 0, 8, /* IRLMSK */
+         {  BUTTON, POWER, FATA, ATA,
+            PCI_INTD, PCI_INTC, PCI_INTB, PCI_INTA,
+         }
+       },
 };
 
+static DECLARE_INTC_DESC(intc_desc_landisk, "landisk", vectors_landisk, NULL,
+                       mask_registers_landisk, NULL, NULL);
 /*
  * Initialize IRQ setting
  */
 void __init init_landisk_IRQ(void)
 {
-       int i;
-
-       for (i = 5; i < 14; i++) {
-               disable_irq_nosync(i);
-               set_irq_chip_and_handler_name(i, &landisk_irq_chip,
-                                             handle_level_irq, "level");
-               enable_landisk_irq(irq_get_irq_data(i));
-       }
+       register_intc_controller(&intc_desc_landisk);
        __raw_writeb(0x00, PA_PWRINT_CLR);
 }
index 50337acc18c5aa9d80b9e0fa832c7c9da57a7487..94186cf079b635a882620eadb1e3ce88b4359a30 100644 (file)
@@ -21,8 +21,6 @@
 #include <mach-landisk/mach/iodata_landisk.h>
 #include <asm/io.h>
 
-void init_landisk_IRQ(void);
-
 static void landisk_power_off(void)
 {
         __raw_writeb(0x01, PA_SHUTDOWN);
@@ -83,7 +81,7 @@ static int __init landisk_devices_setup(void)
                                    ARRAY_SIZE(landisk_devices));
 }
 
-__initcall(landisk_devices_setup);
+device_initcall(landisk_devices_setup);
 
 static void __init landisk_setup(char **cmdline_p)
 {
index b84df6a3a93c3af0c225c21fb3a3e594c4bffa6c..4b98a5251f833f5e2eda2013e656a95a5fb3c81a 100644 (file)
@@ -258,7 +258,7 @@ static int __init rts7751r2d_devices_setup(void)
        return platform_add_devices(rts7751r2d_devices,
                                    ARRAY_SIZE(rts7751r2d_devices));
 }
-__initcall(rts7751r2d_devices_setup);
+device_initcall(rts7751r2d_devices_setup);
 
 static void rts7751r2d_power_off(void)
 {
index 75e4ddbbec3e238c0c04caf91ab745e2552d7ef6..1521aa75ee3ac0517a2094c27bb448e31ccbbd99 100644 (file)
 #include <linux/i2c.h>
 #include <linux/irq.h>
 #include <linux/clk.h>
+#include <linux/clkdev.h>
 #include <mach/fpga.h>
 #include <mach/irq.h>
 #include <asm/machvec.h>
 #include <asm/heartbeat.h>
 #include <asm/sizes.h>
 #include <asm/clock.h>
-#include <asm/clkdev.h>
 #include <asm/reboot.h>
 #include <asm/smp-ops.h>
 
@@ -135,7 +135,7 @@ static int __init sdk7786_devices_setup(void)
 
        return sdk7786_i2c_setup();
 }
-__initcall(sdk7786_devices_setup);
+device_initcall(sdk7786_devices_setup);
 
 static int sdk7786_mode_pins(void)
 {
index 33039e0dc5680f24de1b07e9107639bc1b63c116..8ab8330e3fd12f2551a6166e743c78b4ae3f3bfb 100644 (file)
@@ -77,7 +77,7 @@ static int __init se7206_devices_setup(void)
 {
        return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
 }
-__initcall(se7206_devices_setup);
+device_initcall(se7206_devices_setup);
 
 static int se7206_mode_pins(void)
 {
index 9fbc51beb1812dfafd10a91cf7b6c02c1cabfdce..4ed60c5e221f07a03e5a1df5124fcaec7fe29922 100644 (file)
@@ -48,7 +48,7 @@ static int __init se7751_devices_setup(void)
 {
        return platform_add_devices(se7751_devices, ARRAY_SIZE(se7751_devices));
 }
-__initcall(se7751_devices_setup);
+device_initcall(se7751_devices_setup);
 
 /*
  * The Machine Vector
index af4a0c012a9648e6d01954a8c3cb1069081d4cc5..d4f79b2a6514a6a04dca6c45edccdb855c8054e9 100644 (file)
@@ -96,7 +96,7 @@ static int __init sh03_devices_setup(void)
 
        return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
 }
-__initcall(sh03_devices_setup);
+device_initcall(sh03_devices_setup);
 
 static struct sh_machine_vector mv_sh03 __initmv = {
        .mv_name                = "Interface (CTP/PCI-SH03)",
index 14863d7292cb7d81035fcc692c844412717fdff5..c84e7831018dc12023a1f5a316b7ac9444be3598 100644 (file)
@@ -21,9 +21,6 @@
 #define HIZCRC         0xa405015c
 #define DRVCRA         0xa405018a
 
-enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT,
-       MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE };
-
 /* SH7724 specific MMCIF loader
  *
  * loads the romImage from an MMC card starting from block 512
@@ -63,7 +60,9 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes)
        mmcif_update_progress(MMCIF_PROGRESS_LOAD);
 
        /* load kernel via MMCIF interface */
-       sh_mmcif_boot_slurp(MMCIF_BASE, buf, no_bytes);
+       sh_mmcif_boot_do_read(MMCIF_BASE, 512,
+                             (no_bytes + SH_MMCIF_BBS - 1) / SH_MMCIF_BBS,
+                             buf);
 
        /* disable clock to the MMCIF hardware block */
        __raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2);
index 273f3fa198f74004f17b438b13b6b7f1fea5ef17..5f7f667b9f3b94e49e3a5ccb13cd911369629500 100644 (file)
@@ -39,21 +39,15 @@ CONFIG_IPV6=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 # CONFIG_FW_LOADER is not set
 CONFIG_BLK_DEV_RAM=y
-# CONFIG_MISC_DEVICES is not set
 CONFIG_NETDEVICES=y
-CONFIG_PHYLIB=y
 CONFIG_VITESSE_PHY=y
-CONFIG_MDIO_BITBANG=y
 CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
+CONFIG_SH_ETH=y
 # CONFIG_NETDEV_10000 is not set
 # CONFIG_WLAN is not set
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_SERIO is not set
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=2
 CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=3
 CONFIG_SERIAL_SH_SCI_CONSOLE=y
@@ -63,7 +57,6 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
 # CONFIG_USB_SUPPORT is not set
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
-CONFIG_INOTIFY=y
 CONFIG_ISO9660_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_PROC_KCORE=y
@@ -76,10 +69,8 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_932=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_DEBUG_KERNEL=y
-# CONFIG_DETECT_SOFTLOCKUP is not set
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_DEBUG_INFO=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 # CONFIG_FTRACE is not set
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
index bb1a6bb5149edac820e6714256e94acae4001085..95c6e2d94a0a2b283568b5090b0d92be6dfa1da3 100644 (file)
@@ -1,9 +1,10 @@
 /*
- * arch/sh/drivers/pci/ops-landisk.c
+ * arch/sh/drivers/pci/fixups-landisk.c
  *
  * PCI initialization for the I-O DATA Device, Inc. LANDISK board
  *
  * Copyright (C) 2006 kogiidena
+ * Copyright (C) 2010 Nobuhiro Iwamatsu
  *
  * May be copied or modified under the terms of the GNU General Public
  * License.  See linux/COPYING for more information.
@@ -15,6 +16,9 @@
 #include <linux/pci.h>
 #include "pci-sh4.h"
 
+#define PCIMCR_MRSET_OFF       0xBFFFFFFF
+#define PCIMCR_RFSH_OFF                0xFFFFFFFB
+
 int pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
 {
        /*
@@ -26,9 +30,29 @@ int pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
        int irq = ((slot + pin - 1) & 0x3) + 5;
 
        if ((slot | (pin - 1)) > 0x3) {
-               printk("PCI: Bad IRQ mapping request for slot %d pin %c\n",
+               printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n",
                       slot, pin - 1 + 'A');
                return -1;
        }
        return irq;
 }
+
+int pci_fixup_pcic(struct pci_channel *chan)
+{
+       unsigned long bcr1, mcr;
+
+       bcr1 = __raw_readl(SH7751_BCR1);
+       bcr1 |= 0x40080000;     /* Enable Bit 19 BREQEN, set PCIC to slave */
+       pci_write_reg(chan, bcr1, SH4_PCIBCR1);
+
+       mcr = __raw_readl(SH7751_MCR);
+       mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF;
+       pci_write_reg(chan, mcr, SH4_PCIMCR);
+
+       pci_write_reg(chan, 0x0c000000, SH7751_PCICONF5);
+       pci_write_reg(chan, 0xd0000000, SH7751_PCICONF6);
+       pci_write_reg(chan, 0x0c000000, SH4_PCILAR0);
+       pci_write_reg(chan, 0x00000000, SH4_PCILAR1);
+
+       return 0;
+}
index 89ab2c57a4c284f9b450ed4e0b95675f373e72d3..70c1186b508893216bbae1c19ece1860e45964f8 100644 (file)
  *
  * While read{b,w,l,q} and write{b,w,l,q} contain memory barriers
  * automatically, there are also __raw versions, which do not.
- *
- * Historically, we have also had ctrl_in{b,w,l,q}/ctrl_out{b,w,l,q} for
- * SuperH specific I/O (raw I/O to on-chip CPU peripherals). In practice
- * these have the same semantics as the __raw variants, and as such, all
- * new code should be using the __raw versions.
  */
 #include <linux/errno.h>
 #include <asm/cache.h>
@@ -231,52 +226,6 @@ __BUILD_IOPORT_STRING(q, u64)
 
 #endif
 
-/*
- * Legacy SuperH on-chip I/O functions
- *
- * These are all deprecated, all new (and especially cross-platform) code
- * should be using the __raw_xxx() routines directly.
- */
-static inline u8 __deprecated ctrl_inb(unsigned long addr)
-{
-       return __raw_readb(addr);
-}
-
-static inline u16 __deprecated ctrl_inw(unsigned long addr)
-{
-       return __raw_readw(addr);
-}
-
-static inline u32 __deprecated ctrl_inl(unsigned long addr)
-{
-       return __raw_readl(addr);
-}
-
-static inline u64 __deprecated ctrl_inq(unsigned long addr)
-{
-       return __raw_readq(addr);
-}
-
-static inline void __deprecated ctrl_outb(u8 v, unsigned long addr)
-{
-       __raw_writeb(v, addr);
-}
-
-static inline void __deprecated ctrl_outw(u16 v, unsigned long addr)
-{
-       __raw_writew(v, addr);
-}
-
-static inline void __deprecated ctrl_outl(u32 v, unsigned long addr)
-{
-       __raw_writel(v, addr);
-}
-
-static inline void __deprecated ctrl_outq(u64 v, unsigned long addr)
-{
-       __raw_writeq(v, addr);
-}
-
 #define IO_SPACE_LIMIT 0xffffffff
 
 /* synco on SH-4A, otherwise a nop */
index 6fb04ab38b9f2283ebd672f10f51f4a0ab5cc613..f432773a957187e93524ca2b5222056632d26f3c 100644 (file)
@@ -2,7 +2,7 @@
 #define __ASM_SH_IODATA_LANDISK_H
 
 /*
- * linux/include/asm-sh/landisk/iodata_landisk.h
+ * arch/sh/include/mach-landisk/mach/iodata_landisk.h
  *
  * Copyright (C) 2000  Atom Create Engineering Co., Ltd.
  *
@@ -27,7 +27,7 @@
 
 #define IRQ_PCIINTA    5               /* PCI INTA IRQ */
 #define IRQ_PCIINTB    6               /* PCI INTB IRQ */
-#define IRQ_PCIINDC    7               /* PCI INTC IRQ */
+#define IRQ_PCIINTC    7               /* PCI INTC IRQ */
 #define IRQ_PCIINTD    8               /* PCI INTD IRQ */
 #define IRQ_ATA                9               /* ATA IRQ */
 #define IRQ_FATA       10              /* FATA IRQ */
@@ -35,6 +35,8 @@
 #define IRQ_BUTTON     12              /* USL-5P Button IRQ */
 #define IRQ_FAULT      13              /* USL-5P Fault  IRQ */
 
+void init_landisk_IRQ(void);
+
 #define __IO_PREFIX landisk
 #include <asm/io_generic.h>
 
index b93458f33b74bad99e7a29721a0f2c25e78194a5..b1edc90d482bbcf51468a7bb5301ec597ba34212 100644 (file)
@@ -151,6 +151,7 @@ void __cpuinit cpu_probe(void)
                        boot_cpu_data.flags |= CPU_HAS_L2_CACHE;
                        break;
                case 0x10:
+               case 0x11:
                        boot_cpu_data.type = CPU_SH7757;
                        break;
                }
index 44fc5348fd5d7c33dec9f28f1c3227904f8776c1..bf173502d74418784c0c12128b43419a1242ceb3 100644 (file)
@@ -104,6 +104,9 @@ static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val)
 
 #define SH_MMCIF_BBS 512 /* boot block size */
 
+enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT,
+       MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE };
+
 static inline void sh_mmcif_boot_cmd_send(void __iomem *base,
                                          unsigned long cmd, unsigned long arg)
 {
@@ -166,6 +169,17 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base,
        unsigned long k;
        int ret = 0;
 
+       /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
+       sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
+                       CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
+                       SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
+
+       /* CMD9 - Get CSD */
+       sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
+
+       /* CMD7 - Select the card */
+       sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000);
+
        /* CMD16 - Set the block size */
        sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS);
 
@@ -209,27 +223,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
        sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
 }
 
-static inline void sh_mmcif_boot_slurp(void __iomem *base,
-                                      unsigned char *buf,
-                                      unsigned long no_bytes)
-{
-       unsigned long tmp;
-
-       /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
-       sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
-                       CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
-                       SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
-
-       /* CMD9 - Get CSD */
-       sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
-
-       /* CMD7 - Select the card */
-       sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000);
-
-       tmp = no_bytes / SH_MMCIF_BBS;
-       tmp += (no_bytes % SH_MMCIF_BBS) ? 1 : 0;
-
-       sh_mmcif_boot_do_read(base, 512, tmp, buf);
-}
-
 #endif /* __SH_MMCIF_H__ */