aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-05 10:46:16 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-05 10:46:16 -0700
commitb5ca3e2379e9f3a0117839e225f83b80dd85408c (patch)
tree9c9505f70e5c7e68ebeb644e03c926eeed8f8253
parentefd12536c82924a574a21dd19a37d6369f8105a0 (diff)
downloadltsi-kernel-b5ca3e2379e9f3a0117839e225f83b80dd85408c.tar.gz
Add sh7757lcr backport patches
-rw-r--r--patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch595
-rw-r--r--patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch57
-rw-r--r--patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch92
-rw-r--r--patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch85
-rw-r--r--patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch82
-rw-r--r--patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch54
-rw-r--r--patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch51
-rw-r--r--patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch57
-rw-r--r--patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch75
-rw-r--r--patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch46
-rw-r--r--patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch68
-rw-r--r--patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch48
-rw-r--r--patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch58
-rw-r--r--patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch44
-rw-r--r--patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch67
-rw-r--r--patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch82
-rw-r--r--patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch93
-rw-r--r--patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch48
-rw-r--r--patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch48
-rw-r--r--patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch63
-rw-r--r--patches.sh7757lcr/021-sh-kexec-add-physical_start.patch165
-rw-r--r--series21
22 files changed, 1999 insertions, 0 deletions
diff --git a/patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch b/patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch
new file mode 100644
index 00000000000000..1bc26a6c4c5641
--- /dev/null
+++ b/patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch
@@ -0,0 +1,595 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:46:52 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:46:46 +0900
+Subject: [LTSI-dev] [PATCH 01/21] spi: add support for Renesas RSPI
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC34986.1000802@renesas.com>
+
+
+>From 3516d99256cdaef9cbcf5c69b5a538713c006be1 Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Wed, 7 Mar 2012 14:46:25 +0900
+Subject: spi: add support for Renesas RSPI
+
+The SH7757 has RSPI module. This patch supports it.
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+(cherry picked from commit 0b2182ddac4b8837bbba996d03b7b28f4346db0a)
+
+Conflicts:
+
+ drivers/spi/Makefile
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ drivers/spi/Kconfig | 6 +
+ drivers/spi/Makefile | 1 +
+ drivers/spi/spi-rspi.c | 521 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 528 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/spi/spi-rspi.c
+
+diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
+index de35c3a..bf331ab 100644
+--- a/drivers/spi/Kconfig
++++ b/drivers/spi/Kconfig
+@@ -310,6 +310,12 @@ config SPI_PXA2XX
+ config SPI_PXA2XX_PCI
+ def_bool SPI_PXA2XX && X86_32 && PCI
+
++config SPI_RSPI
++ tristate "Renesas RSPI controller"
++ depends on SUPERH
++ help
++ SPI driver for Renesas RSPI blocks.
++
+ config SPI_S3C24XX
+ tristate "Samsung S3C24XX series SPI"
+ depends on ARCH_S3C2410 && EXPERIMENTAL
+diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
+index 0f8c69b..5997465 100644
+--- a/drivers/spi/Makefile
++++ b/drivers/spi/Makefile
+@@ -42,6 +42,7 @@ obj-$(CONFIG_SPI_FSL_LIB) += spi_fsl_lib.o
+ obj-$(CONFIG_SPI_FSL_ESPI) += spi_fsl_espi.o
+ obj-$(CONFIG_SPI_FSL_SPI) += spi_fsl_spi.o
+ obj-$(CONFIG_SPI_PPC4xx) += spi_ppc4xx.o
++obj-$(CONFIG_SPI_RSPI) += spi-rspi.o
+ obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o
+ obj-$(CONFIG_SPI_S3C24XX) += spi_s3c24xx_hw.o
+ obj-$(CONFIG_SPI_S3C64XX) += spi_s3c64xx.o
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+new file mode 100644
+index 0000000..354f170
+--- /dev/null
++++ b/drivers/spi/spi-rspi.c
+@@ -0,0 +1,521 @@
++/*
++ * SH RSPI driver
++ *
++ * Copyright (C) 2012 Renesas Solutions Corp.
++ *
++ * Based on spi-sh.c:
++ * Copyright (C) 2011 Renesas Solutions Corp.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; version 2 of the License.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/errno.h>
++#include <linux/list.h>
++#include <linux/workqueue.h>
++#include <linux/interrupt.h>
++#include <linux/platform_device.h>
++#include <linux/io.h>
++#include <linux/clk.h>
++#include <linux/spi/spi.h>
++
++#define RSPI_SPCR 0x00
++#define RSPI_SSLP 0x01
++#define RSPI_SPPCR 0x02
++#define RSPI_SPSR 0x03
++#define RSPI_SPDR 0x04
++#define RSPI_SPSCR 0x08
++#define RSPI_SPSSR 0x09
++#define RSPI_SPBR 0x0a
++#define RSPI_SPDCR 0x0b
++#define RSPI_SPCKD 0x0c
++#define RSPI_SSLND 0x0d
++#define RSPI_SPND 0x0e
++#define RSPI_SPCR2 0x0f
++#define RSPI_SPCMD0 0x10
++#define RSPI_SPCMD1 0x12
++#define RSPI_SPCMD2 0x14
++#define RSPI_SPCMD3 0x16
++#define RSPI_SPCMD4 0x18
++#define RSPI_SPCMD5 0x1a
++#define RSPI_SPCMD6 0x1c
++#define RSPI_SPCMD7 0x1e
++
++/* SPCR */
++#define SPCR_SPRIE 0x80
++#define SPCR_SPE 0x40
++#define SPCR_SPTIE 0x20
++#define SPCR_SPEIE 0x10
++#define SPCR_MSTR 0x08
++#define SPCR_MODFEN 0x04
++#define SPCR_TXMD 0x02
++#define SPCR_SPMS 0x01
++
++/* SSLP */
++#define SSLP_SSL1P 0x02
++#define SSLP_SSL0P 0x01
++
++/* SPPCR */
++#define SPPCR_MOIFE 0x20
++#define SPPCR_MOIFV 0x10
++#define SPPCR_SPOM 0x04
++#define SPPCR_SPLP2 0x02
++#define SPPCR_SPLP 0x01
++
++/* SPSR */
++#define SPSR_SPRF 0x80
++#define SPSR_SPTEF 0x20
++#define SPSR_PERF 0x08
++#define SPSR_MODF 0x04
++#define SPSR_IDLNF 0x02
++#define SPSR_OVRF 0x01
++
++/* SPSCR */
++#define SPSCR_SPSLN_MASK 0x07
++
++/* SPSSR */
++#define SPSSR_SPECM_MASK 0x70
++#define SPSSR_SPCP_MASK 0x07
++
++/* SPDCR */
++#define SPDCR_SPLW 0x20
++#define SPDCR_SPRDTD 0x10
++#define SPDCR_SLSEL1 0x08
++#define SPDCR_SLSEL0 0x04
++#define SPDCR_SLSEL_MASK 0x0c
++#define SPDCR_SPFC1 0x02
++#define SPDCR_SPFC0 0x01
++
++/* SPCKD */
++#define SPCKD_SCKDL_MASK 0x07
++
++/* SSLND */
++#define SSLND_SLNDL_MASK 0x07
++
++/* SPND */
++#define SPND_SPNDL_MASK 0x07
++
++/* SPCR2 */
++#define SPCR2_PTE 0x08
++#define SPCR2_SPIE 0x04
++#define SPCR2_SPOE 0x02
++#define SPCR2_SPPE 0x01
++
++/* SPCMDn */
++#define SPCMD_SCKDEN 0x8000
++#define SPCMD_SLNDEN 0x4000
++#define SPCMD_SPNDEN 0x2000
++#define SPCMD_LSBF 0x1000
++#define SPCMD_SPB_MASK 0x0f00
++#define SPCMD_SPB_8_TO_16(bit) (((bit - 1) << 8) & SPCMD_SPB_MASK)
++#define SPCMD_SPB_20BIT 0x0000
++#define SPCMD_SPB_24BIT 0x0100
++#define SPCMD_SPB_32BIT 0x0200
++#define SPCMD_SSLKP 0x0080
++#define SPCMD_SSLA_MASK 0x0030
++#define SPCMD_BRDV_MASK 0x000c
++#define SPCMD_CPOL 0x0002
++#define SPCMD_CPHA 0x0001
++
++struct rspi_data {
++ void __iomem *addr;
++ u32 max_speed_hz;
++ struct spi_master *master;
++ struct list_head queue;
++ struct work_struct ws;
++ wait_queue_head_t wait;
++ spinlock_t lock;
++ struct clk *clk;
++ unsigned char spsr;
++};
++
++static void rspi_write8(struct rspi_data *rspi, u8 data, u16 offset)
++{
++ iowrite8(data, rspi->addr + offset);
++}
++
++static void rspi_write16(struct rspi_data *rspi, u16 data, u16 offset)
++{
++ iowrite16(data, rspi->addr + offset);
++}
++
++static u8 rspi_read8(struct rspi_data *rspi, u16 offset)
++{
++ return ioread8(rspi->addr + offset);
++}
++
++static u16 rspi_read16(struct rspi_data *rspi, u16 offset)
++{
++ return ioread16(rspi->addr + offset);
++}
++
++static unsigned char rspi_calc_spbr(struct rspi_data *rspi)
++{
++ int tmp;
++ unsigned char spbr;
++
++ tmp = clk_get_rate(rspi->clk) / (2 * rspi->max_speed_hz) - 1;
++ spbr = clamp(tmp, 0, 255);
++
++ return spbr;
++}
++
++static void rspi_enable_irq(struct rspi_data *rspi, u8 enable)
++{
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | enable, RSPI_SPCR);
++}
++
++static void rspi_disable_irq(struct rspi_data *rspi, u8 disable)
++{
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~disable, RSPI_SPCR);
++}
++
++static int rspi_wait_for_interrupt(struct rspi_data *rspi, u8 wait_mask,
++ u8 enable_bit)
++{
++ int ret;
++
++ rspi->spsr = rspi_read8(rspi, RSPI_SPSR);
++ rspi_enable_irq(rspi, enable_bit);
++ ret = wait_event_timeout(rspi->wait, rspi->spsr & wait_mask, HZ);
++ if (ret == 0 && !(rspi->spsr & wait_mask))
++ return -ETIMEDOUT;
++
++ return 0;
++}
++
++static void rspi_assert_ssl(struct rspi_data *rspi)
++{
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_SPE, RSPI_SPCR);
++}
++
++static void rspi_negate_ssl(struct rspi_data *rspi)
++{
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR);
++}
++
++static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
++{
++ /* Sets output mode(CMOS) and MOSI signal(from previous transfer) */
++ rspi_write8(rspi, 0x00, RSPI_SPPCR);
++
++ /* Sets transfer bit rate */
++ rspi_write8(rspi, rspi_calc_spbr(rspi), RSPI_SPBR);
++
++ /* Sets number of frames to be used: 1 frame */
++ rspi_write8(rspi, 0x00, RSPI_SPDCR);
++
++ /* Sets RSPCK, SSL, next-access delay value */
++ rspi_write8(rspi, 0x00, RSPI_SPCKD);
++ rspi_write8(rspi, 0x00, RSPI_SSLND);
++ rspi_write8(rspi, 0x00, RSPI_SPND);
++
++ /* Sets parity, interrupt mask */
++ rspi_write8(rspi, 0x00, RSPI_SPCR2);
++
++ /* Sets SPCMD */
++ rspi_write16(rspi, SPCMD_SPB_8_TO_16(access_size) | SPCMD_SSLKP,
++ RSPI_SPCMD0);
++
++ /* Sets RSPI mode */
++ rspi_write8(rspi, SPCR_MSTR, RSPI_SPCR);
++
++ return 0;
++}
++
++static int rspi_send_pio(struct rspi_data *rspi, struct spi_message *mesg,
++ struct spi_transfer *t)
++{
++ int remain = t->len;
++ u8 *data;
++
++ data = (u8 *)t->tx_buf;
++ while (remain > 0) {
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_TXMD,
++ RSPI_SPCR);
++
++ if (rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE) < 0) {
++ dev_err(&rspi->master->dev,
++ "%s: tx empty timeout\n", __func__);
++ return -ETIMEDOUT;
++ }
++
++ rspi_write16(rspi, *data, RSPI_SPDR);
++ data++;
++ remain--;
++ }
++
++ /* Waiting for the last transmition */
++ rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE);
++
++ return 0;
++}
++
++static int rspi_receive_pio(struct rspi_data *rspi, struct spi_message *mesg,
++ struct spi_transfer *t)
++{
++ int remain = t->len;
++ u8 *data;
++ unsigned char spsr;
++
++ spsr = rspi_read8(rspi, RSPI_SPSR);
++ if (spsr & SPSR_SPRF)
++ rspi_read16(rspi, RSPI_SPDR); /* dummy read */
++ if (spsr & SPSR_OVRF)
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPSR) & ~SPSR_OVRF,
++ RSPI_SPCR);
++
++ data = (u8 *)t->rx_buf;
++ while (remain > 0) {
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_TXMD,
++ RSPI_SPCR);
++
++ if (rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE) < 0) {
++ dev_err(&rspi->master->dev,
++ "%s: tx empty timeout\n", __func__);
++ return -ETIMEDOUT;
++ }
++ /* dummy write for generate clock */
++ rspi_write16(rspi, 0x00, RSPI_SPDR);
++
++ if (rspi_wait_for_interrupt(rspi, SPSR_SPRF, SPCR_SPRIE) < 0) {
++ dev_err(&rspi->master->dev,
++ "%s: receive timeout\n", __func__);
++ return -ETIMEDOUT;
++ }
++ /* SPDR allows 16 or 32-bit access only */
++ *data = (u8)rspi_read16(rspi, RSPI_SPDR);
++
++ data++;
++ remain--;
++ }
++
++ return 0;
++}
++
++static void rspi_work(struct work_struct *work)
++{
++ struct rspi_data *rspi = container_of(work, struct rspi_data, ws);
++ struct spi_message *mesg;
++ struct spi_transfer *t;
++ unsigned long flags;
++ int ret;
++
++ spin_lock_irqsave(&rspi->lock, flags);
++ while (!list_empty(&rspi->queue)) {
++ mesg = list_entry(rspi->queue.next, struct spi_message, queue);
++ list_del_init(&mesg->queue);
++ spin_unlock_irqrestore(&rspi->lock, flags);
++
++ rspi_assert_ssl(rspi);
++
++ list_for_each_entry(t, &mesg->transfers, transfer_list) {
++ if (t->tx_buf) {
++ ret = rspi_send_pio(rspi, mesg, t);
++ if (ret < 0)
++ goto error;
++ }
++ if (t->rx_buf) {
++ ret = rspi_receive_pio(rspi, mesg, t);
++ if (ret < 0)
++ goto error;
++ }
++ mesg->actual_length += t->len;
++ }
++ rspi_negate_ssl(rspi);
++
++ mesg->status = 0;
++ mesg->complete(mesg->context);
++
++ spin_lock_irqsave(&rspi->lock, flags);
++ }
++
++ return;
++
++error:
++ mesg->status = ret;
++ mesg->complete(mesg->context);
++}
++
++static int rspi_setup(struct spi_device *spi)
++{
++ struct rspi_data *rspi = spi_master_get_devdata(spi->master);
++
++ if (!spi->bits_per_word)
++ spi->bits_per_word = 8;
++ rspi->max_speed_hz = spi->max_speed_hz;
++
++ rspi_set_config_register(rspi, 8);
++
++ return 0;
++}
++
++static int rspi_transfer(struct spi_device *spi, struct spi_message *mesg)
++{
++ struct rspi_data *rspi = spi_master_get_devdata(spi->master);
++ unsigned long flags;
++
++ mesg->actual_length = 0;
++ mesg->status = -EINPROGRESS;
++
++ spin_lock_irqsave(&rspi->lock, flags);
++ list_add_tail(&mesg->queue, &rspi->queue);
++ schedule_work(&rspi->ws);
++ spin_unlock_irqrestore(&rspi->lock, flags);
++
++ return 0;
++}
++
++static void rspi_cleanup(struct spi_device *spi)
++{
++}
++
++static irqreturn_t rspi_irq(int irq, void *_sr)
++{
++ struct rspi_data *rspi = (struct rspi_data *)_sr;
++ unsigned long spsr;
++ irqreturn_t ret = IRQ_NONE;
++ unsigned char disable_irq = 0;
++
++ rspi->spsr = spsr = rspi_read8(rspi, RSPI_SPSR);
++ if (spsr & SPSR_SPRF)
++ disable_irq |= SPCR_SPRIE;
++ if (spsr & SPSR_SPTEF)
++ disable_irq |= SPCR_SPTIE;
++
++ if (disable_irq) {
++ ret = IRQ_HANDLED;
++ rspi_disable_irq(rspi, disable_irq);
++ wake_up(&rspi->wait);
++ }
++
++ return ret;
++}
++
++static int __devexit rspi_remove(struct platform_device *pdev)
++{
++ struct rspi_data *rspi = dev_get_drvdata(&pdev->dev);
++
++ spi_unregister_master(rspi->master);
++ free_irq(platform_get_irq(pdev, 0), rspi);
++ clk_put(rspi->clk);
++ iounmap(rspi->addr);
++ spi_master_put(rspi->master);
++
++ return 0;
++}
++
++static int __devinit rspi_probe(struct platform_device *pdev)
++{
++ struct resource *res;
++ struct spi_master *master;
++ struct rspi_data *rspi;
++ int ret, irq;
++ char clk_name[16];
++
++ /* get base addr */
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (unlikely(res == NULL)) {
++ dev_err(&pdev->dev, "invalid resource\n");
++ return -EINVAL;
++ }
++
++ irq = platform_get_irq(pdev, 0);
++ if (irq < 0) {
++ dev_err(&pdev->dev, "platform_get_irq error\n");
++ return -ENODEV;
++ }
++
++ master = spi_alloc_master(&pdev->dev, sizeof(struct rspi_data));
++ if (master == NULL) {
++ dev_err(&pdev->dev, "spi_alloc_master error.\n");
++ return -ENOMEM;
++ }
++
++ rspi = spi_master_get_devdata(master);
++ dev_set_drvdata(&pdev->dev, rspi);
++
++ rspi->master = master;
++ rspi->addr = ioremap(res->start, resource_size(res));
++ if (rspi->addr == NULL) {
++ dev_err(&pdev->dev, "ioremap error.\n");
++ ret = -ENOMEM;
++ goto error1;
++ }
++
++ snprintf(clk_name, sizeof(clk_name), "rspi%d", pdev->id);
++ rspi->clk = clk_get(&pdev->dev, clk_name);
++ if (IS_ERR(rspi->clk)) {
++ dev_err(&pdev->dev, "cannot get clock\n");
++ ret = PTR_ERR(rspi->clk);
++ goto error2;
++ }
++ clk_enable(rspi->clk);
++
++ INIT_LIST_HEAD(&rspi->queue);
++ spin_lock_init(&rspi->lock);
++ INIT_WORK(&rspi->ws, rspi_work);
++ init_waitqueue_head(&rspi->wait);
++
++ master->num_chipselect = 2;
++ master->bus_num = pdev->id;
++ master->setup = rspi_setup;
++ master->transfer = rspi_transfer;
++ master->cleanup = rspi_cleanup;
++
++ ret = request_irq(irq, rspi_irq, 0, dev_name(&pdev->dev), rspi);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "request_irq error\n");
++ goto error3;
++ }
++
++ ret = spi_register_master(master);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "spi_register_master error.\n");
++ goto error4;
++ }
++
++ dev_info(&pdev->dev, "probed\n");
++
++ return 0;
++
++error4:
++ free_irq(irq, rspi);
++error3:
++ clk_put(rspi->clk);
++error2:
++ iounmap(rspi->addr);
++error1:
++ spi_master_put(master);
++
++ return ret;
++}
++
++static struct platform_driver rspi_driver = {
++ .probe = rspi_probe,
++ .remove = __devexit_p(rspi_remove),
++ .driver = {
++ .name = "rspi",
++ .owner = THIS_MODULE,
++ },
++};
++module_platform_driver(rspi_driver);
++
++MODULE_DESCRIPTION("Renesas RSPI bus driver");
++MODULE_LICENSE("GPL v2");
++MODULE_AUTHOR("Yoshihiro Shimoda");
++MODULE_ALIAS("platform:rspi");
+--
+1.7.1
+
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch b/patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch
new file mode 100644
index 00000000000000..76087d06c9b63b
--- /dev/null
+++ b/patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch
@@ -0,0 +1,57 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:46:54 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:46:50 +0900
+Subject: [LTSI-dev] [PATCH 02/21] spi: irq: Remove IRQF_DISABLED
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC3498A.2000303@renesas.com>
+
+
+>From 561d8e1807f2cc13d47f22c0caf210b123aea24d Mon Sep 17 00:00:00 2001
+From: Yong Zhang <yong.zhang0@gmail.com>
+Date: Sat, 22 Oct 2011 17:56:55 +0800
+Subject: spi: irq: Remove IRQF_DISABLED
+
+Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
+We run all interrupt handlers with interrupts disabled
+and we even check and yell when an interrupt handler
+returns with interrupts enabled (see commit [b738a50a:
+genirq: Warn when handler enables interrupts]).
+
+So now this flag is a NOOP and can be removed.
+
+Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
+Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+(cherry picked from commit 38ada214fad79ff5ebbed58932c5f0c9969d9c91)
+
+Conflicts:
+
+ drivers/spi/spi-bfin5xx.c
+ drivers/spi/spi-ppc4xx.c
+ drivers/spi/spi-coldfire-qspi.c
+ drivers/spi/spi-sh-msiof.c
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ drivers/spi/spi_sh.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c
+index 9eedd71..e0343d4 100644
+--- a/drivers/spi/spi_sh.c
++++ b/drivers/spi/spi_sh.c
+@@ -484,7 +484,7 @@ static int __devinit spi_sh_probe(struct platform_device *pdev)
+ goto error2;
+ }
+
+- ret = request_irq(irq, spi_sh_irq, IRQF_DISABLED, "spi_sh", ss);
++ ret = request_irq(irq, spi_sh_irq, 0, "spi_sh", ss);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "request_irq error\n");
+ goto error3;
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch b/patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch
new file mode 100644
index 00000000000000..760ab79cbaca7b
--- /dev/null
+++ b/patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch
@@ -0,0 +1,92 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:46:58 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:46:55 +0900
+Subject: [LTSI-dev] [PATCH 03/21] drivercore: Add helper macro for platform_driver boilerplate
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC3498F.9030400@renesas.com>
+
+
+>From 0ac87d22b5e2f88fcaf9888496c8e7b1100ee87c Mon Sep 17 00:00:00 2001
+From: Grant Likely <grant.likely@secretlab.ca>
+Date: Wed, 5 Oct 2011 11:29:49 -0600
+Subject: drivercore: Add helper macro for platform_driver boilerplate
+
+For simple modules that contain a single platform_driver without any
+additional setup code then ends up being a block of duplicated
+boilerplate. This patch adds a new macro, module_platform_driver(),
+which replaces the module_init()/module_exit() registrations with
+template functions.
+
+Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
+Reviewed-by: Magnus Damm <magnus.damm@gmail.com>
+Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
+(cherry picked from commit 940ab88962bc1aff3273a8356d64577a6e386736)
+
+Conflicts:
+
+ drivers/spi/spi-altera.c
+ drivers/spi/spi-ath79.c
+ drivers/spi/spi-atmel.c
+ drivers/spi/spi-bfin-sport.c
+ drivers/spi/spi-coldfire-qspi.c
+ drivers/spi/spi-davinci.c
+ drivers/spi/spi-dw-mmio.c
+ drivers/spi/spi-ep93xx.c
+ drivers/spi/spi-fsl-espi.c
+ drivers/spi/spi-gpio.c
+ drivers/spi/spi-imx.c
+ drivers/spi/spi-mpc512x-psc.c
+ drivers/spi/spi-mpc52xx-psc.c
+ drivers/spi/spi-mpc52xx.c
+ drivers/spi/spi-nuc900.c
+ drivers/spi/spi-oc-tiny.c
+ drivers/spi/spi-ppc4xx.c
+ drivers/spi/spi-s3c24xx.c
+ drivers/spi/spi-sh-msiof.c
+ drivers/spi/spi-sh-sci.c
+ drivers/spi/spi-stmp.c
+ drivers/spi/spi-tegra.c
+ drivers/spi/spi-ti-ssp.c
+ drivers/spi/spi-xilinx.c
+ drivers/tty/serial/of_serial.c
+ include/linux/platform_device.h
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ drivers/spi/spi_sh.c | 13 +------------
+ 1 files changed, 1 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c
+index e0343d4..70c8af9 100644
+--- a/drivers/spi/spi_sh.c
++++ b/drivers/spi/spi_sh.c
+@@ -524,18 +524,7 @@ static struct platform_driver spi_sh_driver = {
+ .owner = THIS_MODULE,
+ },
+ };
+-
+-static int __init spi_sh_init(void)
+-{
+- return platform_driver_register(&spi_sh_driver);
+-}
+-module_init(spi_sh_init);
+-
+-static void __exit spi_sh_exit(void)
+-{
+- platform_driver_unregister(&spi_sh_driver);
+-}
+-module_exit(spi_sh_exit);
++module_platform_driver(spi_sh_driver);
+
+ MODULE_DESCRIPTION("SH SPI bus driver");
+ MODULE_LICENSE("GPL");
+--
+1.7.1
+
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch b/patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch
new file mode 100644
index 00000000000000..694d166dffbd31
--- /dev/null
+++ b/patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch
@@ -0,0 +1,85 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:02 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:46:59 +0900
+Subject: [LTSI-dev] [PATCH 04/21] spi/spi-sh: add IORESOURCE_MEM_TYPE_MASK decoding for access size
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC34993.60503@renesas.com>
+
+
+>From 766fd7edb8a1479627d7819b220469a2fe985491 Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Wed, 7 Mar 2012 14:45:37 +0900
+Subject: spi/spi-sh: add IORESOURCE_MEM_TYPE_MASK decoding for access size
+
+This SPI controller's access size is 32, or 8-bit. The previous driver
+supported 32-bit only. So, this patch adds IORESOURCE_MEM_TYPE_MASK
+decoding, an then, the driver can handle the SPI controller of 8-bit.
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+(cherry picked from commit 0eb8880fac7b0f32ebab33f99e758c6b308e3aa1)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ drivers/spi/spi_sh.c | 25 +++++++++++++++++++++++--
+ 1 files changed, 23 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c
+index 70c8af9..79442c3 100644
+--- a/drivers/spi/spi_sh.c
++++ b/drivers/spi/spi_sh.c
+@@ -92,17 +92,26 @@ struct spi_sh_data {
+ unsigned long cr1;
+ wait_queue_head_t wait;
+ spinlock_t lock;
++ int width;
+ };
+
+ static void spi_sh_write(struct spi_sh_data *ss, unsigned long data,
+ unsigned long offset)
+ {
+- writel(data, ss->addr + offset);
++ if (ss->width == 8)
++ iowrite8(data, ss->addr + (offset >> 2));
++ else if (ss->width == 32)
++ iowrite32(data, ss->addr + offset);
+ }
+
+ static unsigned long spi_sh_read(struct spi_sh_data *ss, unsigned long offset)
+ {
+- return readl(ss->addr + offset);
++ if (ss->width == 8)
++ return ioread8(ss->addr + (offset >> 2));
++ else if (ss->width == 32)
++ return ioread32(ss->addr + offset);
++ else
++ return 0;
+ }
+
+ static void spi_sh_set_bit(struct spi_sh_data *ss, unsigned long val,
+@@ -464,6 +473,18 @@ static int __devinit spi_sh_probe(struct platform_device *pdev)
+ ss = spi_master_get_devdata(master);
+ dev_set_drvdata(&pdev->dev, ss);
+
++ switch (res->flags & IORESOURCE_MEM_TYPE_MASK) {
++ case IORESOURCE_MEM_8BIT:
++ ss->width = 8;
++ break;
++ case IORESOURCE_MEM_32BIT:
++ ss->width = 32;
++ break;
++ default:
++ dev_err(&pdev->dev, "No support width\n");
++ ret = -ENODEV;
++ goto error1;
++ }
+ ss->irq = irq;
+ ss->master = master;
+ ss->addr = ioremap(res->start, resource_size(res));
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch b/patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch
new file mode 100644
index 00000000000000..3e458e444f5498
--- /dev/null
+++ b/patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch
@@ -0,0 +1,82 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:07 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:03 +0900
+Subject: [LTSI-dev] [PATCH 05/21] sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC34997.7040605@renesas.com>
+
+
+>From f996c223aca0fc81406daff93810f530d6543399 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 6 Jul 2011 01:18:27 +0000
+Subject: sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 9b41757107a7fcabcf83bf2f04938dc8e596464c)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 35 +++++++------------------------
+ 1 files changed, 8 insertions(+), 27 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+index eedddad..86bf188 100644
+--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+@@ -102,6 +102,7 @@ static struct clk mstp_clks[MSTP_NR] = {
+ };
+
+ #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
++#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
+
+ static struct clk_lookup lookups[] = {
+ /* main clocks */
+@@ -116,33 +117,13 @@ static struct clk_lookup lookups[] = {
+ /* MSTP32 clocks */
+ CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]),
+ CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]),
+- {
+- /* TMU0 */
+- .dev_id = "sh_tmu.0",
+- .con_id = "tmu_fck",
+- .clk = &mstp_clks[MSTP113],
+- }, {
+- /* TMU1 */
+- .dev_id = "sh_tmu.1",
+- .con_id = "tmu_fck",
+- .clk = &mstp_clks[MSTP114],
+- },
+- {
+- /* SCIF4 (But, ID is 2) */
+- .dev_id = "sh-sci.2",
+- .con_id = "sci_fck",
+- .clk = &mstp_clks[MSTP112],
+- }, {
+- /* SCIF3 */
+- .dev_id = "sh-sci.1",
+- .con_id = "sci_fck",
+- .clk = &mstp_clks[MSTP111],
+- }, {
+- /* SCIF2 */
+- .dev_id = "sh-sci.0",
+- .con_id = "sci_fck",
+- .clk = &mstp_clks[MSTP110],
+- },
++
++ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]),
++ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]),
++ CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]),
++ CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
++ CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
++
+ CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
+ CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
+ };
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch b/patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch
new file mode 100644
index 00000000000000..2bb3628d80d58a
--- /dev/null
+++ b/patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch
@@ -0,0 +1,54 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:12 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:07 +0900
+Subject: [LTSI-dev] [PATCH 06/21] sh: move CLKDEV_xxx_ID macro to sh_clk.h
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC3499B.9050300@renesas.com>
+
+
+>From 540cdd813dd77275e44ec24701364e1895cd98bd Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 6 Jul 2011 02:54:11 +0000
+Subject: sh: move CLKDEV_xxx_ID macro to sh_clk.h
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 1522043bf73ef0e9e61dc512a0f3cdbec1cbf89f)
+
+Conflicts:
+
+ arch/sh/kernel/cpu/sh4a/clock-sh7343.c
+ arch/sh/kernel/cpu/sh4a/clock-sh7366.c
+ arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+ arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+ arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+ arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+ arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+ arch/sh/kernel/cpu/sh4a/clock-shx3.c
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 3 ---
+ 1 files changed, 0 insertions(+), 3 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+index 86bf188..3b097b0 100644
+--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+@@ -101,9 +101,6 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP220] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 20, 0),
+ };
+
+-#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
+-#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
+-
+ static struct clk_lookup lookups[] = {
+ /* main clocks */
+ CLKDEV_CON_ID("extal", &extal_clk),
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch b/patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch
new file mode 100644
index 00000000000000..ef2e2dd099ca21
--- /dev/null
+++ b/patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch
@@ -0,0 +1,51 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:15 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:11 +0900
+Subject: [LTSI-dev] [PATCH 07/21] sh: fix the compile error in setup-sh7757.c
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC3499F.9020208@renesas.com>
+
+
+>From 8912bc4c88e6690ff125f20a053961d71919c1be Mon Sep 17 00:00:00 2001
+From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Date: Tue, 23 Aug 2011 09:15:46 +0000
+Subject: sh: fix the compile error in setup-sh7757.c
+
+Fix the following build errors:
+
+ CC arch/sh/kernel/cpu/sh4a/setup-sh7757.o
+arch/sh/kernel/cpu/sh4a/setup-sh7757.c:681: error: implicit declaration of function ‘DMA_BIT_MASK’
+arch/sh/kernel/cpu/sh4a/setup-sh7757.c:681: error: initializer element is not constant
+arch/sh/kernel/cpu/sh4a/setup-sh7757.c:681: error: (near initialization for ‘usb_ehci_device.dev.coherent_dma_mask’)
+arch/sh/kernel/cpu/sh4a/setup-sh7757.c:705: error: initializer element is not constant
+arch/sh/kernel/cpu/sh4a/setup-sh7757.c:705: error: (near initialization for ‘usb_ohci_device.dev.coherent_dma_mask’)
+make[3]: *** [arch/sh/kernel/cpu/sh4a/setup-sh7757.o] Error 1
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 21d41f2b312231536cf981c960c83cc4493c0293)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+index e915dea..0555929 100644
+--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+@@ -15,6 +15,7 @@
+ #include <linux/serial_sci.h>
+ #include <linux/io.h>
+ #include <linux/mm.h>
++#include <linux/dma-mapping.h>
+ #include <linux/sh_timer.h>
+ #include <linux/sh_dma.h>
+
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch b/patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch
new file mode 100644
index 00000000000000..42a89bd59d7a58
--- /dev/null
+++ b/patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch
@@ -0,0 +1,57 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:19 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:15 +0900
+Subject: [LTSI-dev] [PATCH 08/21] sh: add parameters for EHCI and RIIC in clock-sh7757.c
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349A3.7010304@renesas.com>
+
+
+>From 93827b13e428bfc4e2323ab8006e170bc530906e Mon Sep 17 00:00:00 2001
+From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 26 Sep 2011 17:41:28 +0900
+Subject: sh: add parameters for EHCI and RIIC in clock-sh7757.c
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 5261b0a290a87fa448fd1fd125baeab42603a318)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 10 +++++++++-
+ 1 files changed, 9 insertions(+), 1 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+index 3b097b0..19222da 100644
+--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+@@ -113,7 +113,14 @@ static struct clk_lookup lookups[] = {
+
+ /* MSTP32 clocks */
+ CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]),
+- CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]),
++ CLKDEV_CON_ID("riic0", &mstp_clks[MSTP000]),
++ CLKDEV_CON_ID("riic1", &mstp_clks[MSTP000]),
++ CLKDEV_CON_ID("riic2", &mstp_clks[MSTP000]),
++ CLKDEV_CON_ID("riic3", &mstp_clks[MSTP000]),
++ CLKDEV_CON_ID("riic4", &mstp_clks[MSTP000]),
++ CLKDEV_CON_ID("riic5", &mstp_clks[MSTP000]),
++ CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]),
++ CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]),
+
+ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]),
+ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]),
+@@ -121,6 +128,7 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
+ CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
+
++ CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]),
+ CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
+ CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
+ };
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch b/patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch
new file mode 100644
index 00000000000000..4818a3ae21ecbf
--- /dev/null
+++ b/patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch
@@ -0,0 +1,75 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:24 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:20 +0900
+Subject: [LTSI-dev] [PATCH 09/21] sh: add a resource name for shdma
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349A8.5020108@renesas.com>
+
+
+>From 97de925e1dbf4faa708110d1441ea1d585d4a913 Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Tue, 10 Jan 2012 14:20:58 +0900
+Subject: sh: add a resource name for shdma
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit a4d5247310c993b6b30f1686be12ddacfc41142a)
+
+Conflicts:
+ arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+ arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+ arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+ arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+ arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 7 ++++---
+ 1 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+index 0555929..a7b2da6 100644
+--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+@@ -465,6 +465,7 @@ static struct resource sh7757_dmae0_resources[] = {
+ .flags = IORESOURCE_MEM,
+ },
+ {
++ .name = "error_irq",
+ .start = 34,
+ .end = 34,
+ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
+@@ -486,7 +487,7 @@ static struct resource sh7757_dmae1_resources[] = {
+ .flags = IORESOURCE_MEM,
+ },
+ {
+- /* DMA error */
++ .name = "error_irq",
+ .start = 34,
+ .end = 34,
+ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
+@@ -556,7 +557,7 @@ static struct resource sh7757_dmae2_resources[] = {
+ .flags = IORESOURCE_MEM,
+ },
+ {
+- /* DMA error */
++ .name = "error_irq",
+ .start = 323,
+ .end = 323,
+ .flags = IORESOURCE_IRQ,
+@@ -590,7 +591,7 @@ static struct resource sh7757_dmae3_resources[] = {
+ .flags = IORESOURCE_MEM,
+ },
+ {
+- /* DMA error */
++ .name = "error_irq",
+ .start = 324,
+ .end = 324,
+ .flags = IORESOURCE_IRQ,
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch b/patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch
new file mode 100644
index 00000000000000..42b4d3e8f0c0d5
--- /dev/null
+++ b/patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch
@@ -0,0 +1,46 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:27 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:23 +0900
+Subject: [LTSI-dev] [PATCH 10/21] sh: modify resource for SPI0 in setup-sh7757
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349AB.3020600@renesas.com>
+
+
+>From 8b983d13cd434f9ecaaf59bb4407ab7f212134d5 Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Thu, 26 Jan 2012 17:44:05 +0900
+Subject: sh: modify resource for SPI0 in setup-sh7757
+
+The new spi-sh driver decodes the IORESOURCE_MEM_TYPE_MASK. So, the
+resource needs the IORESOURCE_MEM_32BIT.
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 11c582e32c664f67e2518b9f97e6c91918617274)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+index a7b2da6..226d809 100644
+--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+@@ -133,7 +133,7 @@ static struct resource spi0_resources[] = {
+ [0] = {
+ .start = 0xfe002000,
+ .end = 0xfe0020ff,
+- .flags = IORESOURCE_MEM,
++ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ },
+ [1] = {
+ .start = 86,
+--
+1.7.1
+
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch b/patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch
new file mode 100644
index 00000000000000..8d28d66a1bc180
--- /dev/null
+++ b/patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch
@@ -0,0 +1,68 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:32 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:28 +0900
+Subject: [LTSI-dev] [PATCH 11/21] sh: add platform_device for SPI1 in setup-sh7757
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349B0.20603@renesas.com>
+
+
+>From 207bfa238e5788eed6ec68738127ddb5f702f70d Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Thu, 26 Jan 2012 17:44:07 +0900
+Subject: sh: add platform_device for SPI1 in setup-sh7757
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit a206c0087323337595de1284feb09a98c2a389d2)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 20 ++++++++++++++++++++
+ 1 files changed, 20 insertions(+), 0 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+index 226d809..2875e8b 100644
+--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+@@ -661,6 +661,25 @@ static struct platform_device spi0_device = {
+ .resource = spi0_resources,
+ };
+
++static struct resource spi1_resources[] = {
++ {
++ .start = 0xffd8ee70,
++ .end = 0xffd8eeff,
++ .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
++ },
++ {
++ .start = 54,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device spi1_device = {
++ .name = "sh_spi",
++ .id = 1,
++ .num_resources = ARRAY_SIZE(spi1_resources),
++ .resource = spi1_resources,
++};
++
+ static struct resource usb_ehci_resources[] = {
+ [0] = {
+ .start = 0xfe4f1000,
+@@ -720,6 +739,7 @@ static struct platform_device *sh7757_devices[] __initdata = {
+ &dma2_device,
+ &dma3_device,
+ &spi0_device,
++ &spi1_device,
+ &usb_ehci_device,
+ &usb_ohci_device,
+ };
+--
+1.7.1
+
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch b/patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch
new file mode 100644
index 00000000000000..9aa2bacfae77f9
--- /dev/null
+++ b/patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch
@@ -0,0 +1,48 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:36 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:32 +0900
+Subject: [LTSI-dev] [PATCH 12/21] sh: modify clock-sh7757 for renesas_usbhs
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349B4.1090603@renesas.com>
+
+
+>From 2f2fc2bf63c60852a8ddd817a29df482bd18486f Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Thu, 5 Jan 2012 14:08:03 +0900
+Subject: sh: modify clock-sh7757 for renesas_usbhs
+
+The renesas_usbhs driver doesn't use the clk functions. So, even if we
+adds "CLKDEV_DEV_ID("renesas_usbhs.0", ...)" only, we cannot use the USB
+controller because clk_late_init() will disable the clock by "usb0".
+So, the patch also removes the "CLKDEV_CON_ID("usb0", ...)".
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 1760e371a9038329190f0fdd051776ae76aca083)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+index 19222da..0fbff14 100644
+--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+@@ -129,7 +129,7 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
+
+ CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]),
+- CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
++ CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP102]),
+ CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
+ };
+
+--
+1.7.1
+
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch b/patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch
new file mode 100644
index 00000000000000..02152f203d74de
--- /dev/null
+++ b/patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch
@@ -0,0 +1,58 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:40 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:36 +0900
+Subject: [LTSI-dev] [PATCH 13/21] sh: add parameter for RSPI in clock-sh7757
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349B8.8010109@renesas.com>
+
+
+>From dc2ff8b7383140efe6afe755620137ea6a156602 Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Wed, 7 Mar 2012 14:46:38 +0900
+Subject: sh: add parameter for RSPI in clock-sh7757
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit fb4340656fda27bd38914ef382ee3235c23d8f58)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+index 0fbff14..0bd21c8 100644
+--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+@@ -79,7 +79,7 @@ struct clk div4_clks[DIV4_NR] = {
+ #define MSTPCR1 0xffc80034
+ #define MSTPCR2 0xffc10028
+
+-enum { MSTP004, MSTP000, MSTP114, MSTP113, MSTP112,
++enum { MSTP004, MSTP000, MSTP127, MSTP114, MSTP113, MSTP112,
+ MSTP111, MSTP110, MSTP103, MSTP102, MSTP220,
+ MSTP_NR };
+
+@@ -89,6 +89,7 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP000] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 0, 0),
+
+ /* MSTPCR1 */
++ [MSTP127] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 27, 0),
+ [MSTP114] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 14, 0),
+ [MSTP113] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 13, 0),
+ [MSTP112] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 12, 0),
+@@ -131,6 +132,7 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]),
+ CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP102]),
+ CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
++ CLKDEV_CON_ID("rspi2", &mstp_clks[MSTP127]),
+ };
+
+ int __init arch_clk_init(void)
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch b/patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch
new file mode 100644
index 00000000000000..56504b9e5726df
--- /dev/null
+++ b/patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch
@@ -0,0 +1,44 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:43 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:40 +0900
+Subject: [LTSI-dev] [PATCH 14/21] sh: modify the asm/sh_eth.h to linux/sh_eth.h in sh7757lcr
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349BC.6030503@renesas.com>
+
+
+>From 457c07a09f4564cc6051e2ab982520a26b236d4e Mon Sep 17 00:00:00 2001
+From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Date: Tue, 1 Nov 2011 14:54:38 +0900
+Subject: sh: modify the asm/sh_eth.h to linux/sh_eth.h in sh7757lcr
+
+Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 389cc10cbdde1a9225eac51318fb30e2039135ad)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/boards/board-sh7757lcr.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
+index fa2a208..ec8c84c 100644
+--- a/arch/sh/boards/board-sh7757lcr.c
++++ b/arch/sh/boards/board-sh7757lcr.c
+@@ -18,8 +18,8 @@
+ #include <linux/mmc/host.h>
+ #include <linux/mmc/sh_mmcif.h>
+ #include <linux/mmc/sh_mobile_sdhi.h>
++#include <linux/sh_eth.h>
+ #include <cpu/sh7757.h>
+-#include <asm/sh_eth.h>
+ #include <asm/heartbeat.h>
+
+ static struct resource heartbeat_resource = {
+--
+1.7.1
+
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch b/patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch
new file mode 100644
index 00000000000000..04bc589c4a397e
--- /dev/null
+++ b/patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch
@@ -0,0 +1,67 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:47 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:43 +0900
+Subject: [LTSI-dev] [PATCH 15/21] sh: add platform_device for RSPI in setup-sh7757
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349BF.3080703@renesas.com>
+
+
+>From 309c52cddb5ae308683d74591b6a00a25b2898fc Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Wed, 7 Mar 2012 14:46:41 +0900
+Subject: sh: add platform_device for RSPI in setup-sh7757
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 10a068f27ac2200c83f6d13f5e03f6e48cf06d10)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 20 ++++++++++++++++++++
+ 1 files changed, 20 insertions(+), 0 deletions(-)
+
+diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+index 2875e8b..c8836cf 100644
+--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
++++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+@@ -680,6 +680,25 @@ static struct platform_device spi1_device = {
+ .resource = spi1_resources,
+ };
+
++static struct resource rspi_resources[] = {
++ {
++ .start = 0xfe480000,
++ .end = 0xfe4800ff,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = 220,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device rspi_device = {
++ .name = "rspi",
++ .id = 2,
++ .num_resources = ARRAY_SIZE(rspi_resources),
++ .resource = rspi_resources,
++};
++
+ static struct resource usb_ehci_resources[] = {
+ [0] = {
+ .start = 0xfe4f1000,
+@@ -740,6 +759,7 @@ static struct platform_device *sh7757_devices[] __initdata = {
+ &dma3_device,
+ &spi0_device,
+ &spi1_device,
++ &rspi_device,
+ &usb_ehci_device,
+ &usb_ohci_device,
+ };
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch b/patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch
new file mode 100644
index 00000000000000..babac18bdb6691
--- /dev/null
+++ b/patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch
@@ -0,0 +1,82 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:50 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:46 +0900
+Subject: [LTSI-dev] [PATCH 16/21] sh: fix build warning in board-sh7757lcr
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349C2.9050303@renesas.com>
+
+
+>From 2df9254111cd82738d8dc57a989f67a998c5540d Mon Sep 17 00:00:00 2001
+From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Date: Fri, 18 Nov 2011 16:32:34 +0900
+Subject: sh: fix build warning in board-sh7757lcr
+
+This patch fixed the following build warnings:
+
+ CC arch/sh/boards/board-sh7757lcr.o
+arch/sh/boards/board-sh7757lcr.c:77: warning: initialization from incompatible pointer type
+arch/sh/boards/board-sh7757lcr.c:106: warning: initialization from incompatible pointer type
+arch/sh/boards/board-sh7757lcr.c:151: warning: initialization from incompatible pointer type
+arch/sh/boards/board-sh7757lcr.c:181: warning: initialization from incompatible pointer type
+arch/sh/boards/board-sh7757lcr.c:213: warning: missing braces around initializer
+arch/sh/boards/board-sh7757lcr.c:213: warning: (near initialization for ‘sh7757lcr_mmcif_dma.chan_priv_tx’)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 19d7ca2998e095086869318dd2ad966952f5ac82)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/boards/board-sh7757lcr.c | 16 ++++++++++------
+ 1 files changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
+index ec8c84c..895e337 100644
+--- a/arch/sh/boards/board-sh7757lcr.c
++++ b/arch/sh/boards/board-sh7757lcr.c
+@@ -50,9 +50,9 @@ static struct platform_device heartbeat_device = {
+ #define GBECONT 0xffc10100
+ #define GBECONT_RMII1 BIT(17)
+ #define GBECONT_RMII0 BIT(16)
+-static void sh7757_eth_set_mdio_gate(unsigned long addr)
++static void sh7757_eth_set_mdio_gate(void *addr)
+ {
+- if ((addr & 0x00000fff) < 0x0800)
++ if (((unsigned long)addr & 0x00000fff) < 0x0800)
+ writel(readl(GBECONT) | GBECONT_RMII0, GBECONT);
+ else
+ writel(readl(GBECONT) | GBECONT_RMII1, GBECONT);
+@@ -116,9 +116,9 @@ static struct platform_device sh7757_eth1_device = {
+ },
+ };
+
+-static void sh7757_eth_giga_set_mdio_gate(unsigned long addr)
++static void sh7757_eth_giga_set_mdio_gate(void *addr)
+ {
+- if ((addr & 0x00000fff) < 0x0800) {
++ if (((unsigned long)addr & 0x00000fff) < 0x0800) {
+ gpio_set_value(GPIO_PTT4, 1);
+ writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT);
+ } else {
+@@ -210,8 +210,12 @@ static struct resource sh_mmcif_resources[] = {
+ };
+
+ static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
+- .chan_priv_tx = SHDMA_SLAVE_MMCIF_TX,
+- .chan_priv_rx = SHDMA_SLAVE_MMCIF_RX,
++ .chan_priv_tx = {
++ .slave_id = SHDMA_SLAVE_MMCIF_TX,
++ },
++ .chan_priv_rx = {
++ .slave_id = SHDMA_SLAVE_MMCIF_RX,
++ }
+ };
+
+ static struct sh_mmcif_plat_data sh_mmcif_plat = {
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch b/patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch
new file mode 100644
index 00000000000000..8de58457816a12
--- /dev/null
+++ b/patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch
@@ -0,0 +1,93 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:54 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:49 +0900
+Subject: [LTSI-dev] [PATCH 17/21] sh: add platform_device for renesas_usbhs in board-sh7757lcr
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349C5.2080607@renesas.com>
+
+
+>From 88b6a3d039fde3e966f002b64afe8c3e833f2902 Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Thu, 5 Jan 2012 14:08:12 +0900
+Subject: sh: add platform_device for renesas_usbhs in board-sh7757lcr
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 7afb4e9a92e42e66124b7043405bbca82680aa96)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/boards/board-sh7757lcr.c | 39 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 39 insertions(+), 0 deletions(-)
+
+diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
+index 895e337..0838154 100644
+--- a/arch/sh/boards/board-sh7757lcr.c
++++ b/arch/sh/boards/board-sh7757lcr.c
+@@ -19,6 +19,7 @@
+ #include <linux/mmc/sh_mmcif.h>
+ #include <linux/mmc/sh_mobile_sdhi.h>
+ #include <linux/sh_eth.h>
++#include <linux/usb/renesas_usbhs.h>
+ #include <cpu/sh7757.h>
+ #include <asm/heartbeat.h>
+
+@@ -264,6 +265,43 @@ static struct platform_device sdhi_device = {
+ },
+ };
+
++static int usbhs0_get_id(struct platform_device *pdev)
++{
++ return USBHS_GADGET;
++}
++
++static struct renesas_usbhs_platform_info usb0_data = {
++ .platform_callback = {
++ .get_id = usbhs0_get_id,
++ },
++ .driver_param = {
++ .buswait_bwait = 5,
++ }
++};
++
++static struct resource usb0_resources[] = {
++ [0] = {
++ .start = 0xfe450000,
++ .end = 0xfe4501ff,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = 50,
++ .end = 50,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device usb0_device = {
++ .name = "renesas_usbhs",
++ .id = 0,
++ .dev = {
++ .platform_data = &usb0_data,
++ },
++ .num_resources = ARRAY_SIZE(usb0_resources),
++ .resource = usb0_resources,
++};
++
+ static struct platform_device *sh7757lcr_devices[] __initdata = {
+ &heartbeat_device,
+ &sh7757_eth0_device,
+@@ -272,6 +310,7 @@ static struct platform_device *sh7757lcr_devices[] __initdata = {
+ &sh7757_eth_giga1_device,
+ &sh_mmcif_device,
+ &sdhi_device,
++ &usb0_device,
+ };
+
+ static struct flash_platform_data spi_flash_data = {
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch b/patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch
new file mode 100644
index 00000000000000..e03925afd9d764
--- /dev/null
+++ b/patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch
@@ -0,0 +1,48 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:47:56 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:53 +0900
+Subject: [LTSI-dev] [PATCH 18/21] sh: fix the sh_mmcif_plat_data in board-sh7757lcr
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349C9.8000304@renesas.com>
+
+
+>From 6238a9aa21a471e435ff0bc6106d477edfbe6865 Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Tue, 17 Jan 2012 17:49:38 +0900
+Subject: sh: fix the sh_mmcif_plat_data in board-sh7757lcr
+
+The board has an eMMC chip, so we cannot remove the chip.
+In this case, we have to set the MMC_CAP_NONREMOVABLE to the caps
+parameter.
+
+Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 78da107a7ed14fbc6ef77ff4c41d92b11edc9036)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/boards/board-sh7757lcr.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
+index 0838154..33dc5b6 100644
+--- a/arch/sh/boards/board-sh7757lcr.c
++++ b/arch/sh/boards/board-sh7757lcr.c
+@@ -222,7 +222,8 @@ static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
+ static struct sh_mmcif_plat_data sh_mmcif_plat = {
+ .dma = &sh7757lcr_mmcif_dma,
+ .sup_pclk = 0x0f,
+- .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
++ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
++ MMC_CAP_NONREMOVABLE,
+ .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
+ };
+
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch b/patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch
new file mode 100644
index 00000000000000..536cd3bba908da
--- /dev/null
+++ b/patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch
@@ -0,0 +1,48 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:48:00 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:47:56 +0900
+Subject: [LTSI-dev] [PATCH 19/21] sh: modify a resource of sh_eth_giga1_resources in board-sh7757lcr
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349CC.9000006@renesas.com>
+
+
+>From c17794efb2da1484cf80a5421a55fd8e99951b60 Mon Sep 17 00:00:00 2001
+From: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 20 Feb 2012 17:26:50 +0900
+Subject: sh: modify a resource of sh_eth_giga1_resources in board-sh7757lcr
+
+The latest sh_eth driver needs a resource of TSU in the channel 1,
+if the controller has TSU registers. So, this patch adds the resource.
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit befe0756d5fa5841f02e2029bbcc77225b9a13bb)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/boards/board-sh7757lcr.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
+index 33dc5b6..14b0dae 100644
+--- a/arch/sh/boards/board-sh7757lcr.c
++++ b/arch/sh/boards/board-sh7757lcr.c
+@@ -169,6 +169,11 @@ static struct resource sh_eth_giga1_resources[] = {
+ .end = 0xfee00fff,
+ .flags = IORESOURCE_MEM,
+ }, {
++ /* TSU */
++ .start = 0xfee01800,
++ .end = 0xfee01fff,
++ .flags = IORESOURCE_MEM,
++ }, {
+ .start = 316,
+ .end = 316,
+ .flags = IORESOURCE_IRQ,
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch b/patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch
new file mode 100644
index 00000000000000..60836e96bbf428
--- /dev/null
+++ b/patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch
@@ -0,0 +1,63 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:48:04 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:48:00 +0900
+Subject: [LTSI-dev] [PATCH 20/21] sh: kexec: Register crashk_res
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349D0.4060007@renesas.com>
+
+
+>From c6776324925d4d939667e9a7dd28079b35349e98 Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms@verge.net.au>
+Date: Fri, 2 Sep 2011 03:47:12 +0000
+Subject: sh: kexec: Register crashk_res
+
+Register crashk_res so that it can be used by kexec-tools
+via /proc/iomem.
+
+The crash kernel resource needs to be requested the same as the
+other kernel resources due to the fact that it's handled during
+the common path for adding new memory ranges, so it's added in to
+__add_active_range() with the others. This ensures that the crash
+kernel is properly reserved regardless of which memory range it's
+placed in.
+
+Signed-off-by: Simon Horman <horms@verge.net.au>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit 41309b7a22805f1650c600723d729af453d52719)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/kernel/setup.c | 9 ++++++---
+ 1 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
+index 58bff45..1a0e946 100644
+--- a/arch/sh/kernel/setup.c
++++ b/arch/sh/kernel/setup.c
+@@ -211,13 +211,16 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
+ }
+
+ /*
+- * We don't know which RAM region contains kernel data,
+- * so we try it repeatedly and let the resource manager
+- * test it.
++ * We don't know which RAM region contains kernel data or
++ * the reserved crashkernel region, so try it repeatedly
++ * and let the resource manager test it.
+ */
+ request_resource(res, &code_resource);
+ request_resource(res, &data_resource);
+ request_resource(res, &bss_resource);
++#ifdef CONFIG_KEXEC
++ request_resource(res, &crashk_res);
++#endif
+
+ /*
+ * Also make sure that there is a PMB mapping that covers this
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/patches.sh7757lcr/021-sh-kexec-add-physical_start.patch b/patches.sh7757lcr/021-sh-kexec-add-physical_start.patch
new file mode 100644
index 00000000000000..b816516b597aed
--- /dev/null
+++ b/patches.sh7757lcr/021-sh-kexec-add-physical_start.patch
@@ -0,0 +1,165 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Mon May 28 02:48:07 2012
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 28 May 2012 18:48:04 +0900
+Subject: [LTSI-dev] [PATCH 21/21] sh: kexec: Add PHYSICAL_START
+To: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <4FC349D4.5090003@renesas.com>
+
+
+>From e5e6ee27709b81739b5c22123e5b4c2f81303570 Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms@verge.net.au>
+Date: Thu, 15 Sep 2011 20:13:00 +0900
+Subject: sh: kexec: Add PHYSICAL_START
+
+Add PHYSICAL_START kernel configuration parameter to set the address at
+which the kernel should be loaded.
+
+It has been observed on an sh7757lcr that simply modifying MEMORY_START
+does not achieve this goal for 32bit sh. This is due to MEMORY_OFFSET in
+arch/sh/kernel/vmlinux.lds.S bot being based on MEMORY_START on such
+systems.
+
+Signed-off-by: Simon Horman <horms@verge.net.au>
+Signed-off-by: Paul Mundt <lethal@linux-sh.org>
+(cherry picked from commit e66ac3f26aef131f5ca60350d25fba95f43acd0d)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+---
+ arch/sh/Kconfig | 13 ++++++++++++-
+ arch/sh/boot/Makefile | 6 ++++--
+ arch/sh/include/asm/page.h | 10 ++++++++++
+ arch/sh/kernel/vmlinux.lds.S | 2 +-
+ arch/sh/mm/init.c | 8 ++++----
+ 5 files changed, 31 insertions(+), 8 deletions(-)
+
+diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
+index bbdeb48..0d07d40 100644
+--- a/arch/sh/Kconfig
++++ b/arch/sh/Kconfig
+@@ -648,7 +648,7 @@ config CRASH_DUMP
+ a specially reserved region and then later executed after
+ a crash by kdump/kexec. The crash dump kernel must be compiled
+ to a memory address not used by the main kernel using
+- MEMORY_START.
++ PHYSICAL_START.
+
+ For more details see Documentation/kdump/kdump.txt
+
+@@ -659,6 +659,17 @@ config KEXEC_JUMP
+ Jump between original kernel and kexeced kernel and invoke
+ code via KEXEC
+
++config PHYSICAL_START
++ hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
++ default MEMORY_START
++ ---help---
++ This gives the physical address where the kernel is loaded
++ and is ordinarily the same as MEMORY_START.
++
++ Different values are primarily used in the case of kexec on panic
++ where the fail safe kernel needs to run at a different address
++ than the panic-ed kernel.
++
+ config SECCOMP
+ bool "Enable seccomp to safely compute untrusted bytecode"
+ depends on PROC_FS
+diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
+index ba515d8..e4ea31a 100644
+--- a/arch/sh/boot/Makefile
++++ b/arch/sh/boot/Makefile
+@@ -19,6 +19,7 @@ CONFIG_MEMORY_START ?= 0x0c000000
+ CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
+ CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
+ CONFIG_ENTRY_OFFSET ?= 0x00001000
++CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START)
+
+ suffix-y := bin
+ suffix-$(CONFIG_KERNEL_GZIP) := gz
+@@ -48,7 +49,7 @@ $(obj)/romimage/vmlinux: $(obj)/zImage FORCE
+ $(Q)$(MAKE) $(build)=$(obj)/romimage $@
+
+ KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
+- $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
++ $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]')
+
+ KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
+ $$[$(CONFIG_PAGE_OFFSET) + \
+@@ -114,4 +115,5 @@ $(obj)/uImage: $(obj)/uImage.$(suffix-y)
+ @echo ' Image $@ is ready'
+
+ export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
+- CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY suffix-y
++ CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
++ KERNEL_MEMORY suffix-y
+diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
+index abcc4dc..15d9703 100644
+--- a/arch/sh/include/asm/page.h
++++ b/arch/sh/include/asm/page.h
+@@ -113,6 +113,16 @@ typedef struct page *pgtable_t;
+ #define __MEMORY_SIZE CONFIG_MEMORY_SIZE
+
+ /*
++ * PHYSICAL_OFFSET is the offset in physical memory where the base
++ * of the kernel is loaded.
++ */
++#ifdef CONFIG_PHYSICAL_START
++#define PHYSICAL_OFFSET (CONFIG_PHYSICAL_START - __MEMORY_START)
++#else
++#define PHYSICAL_OFFSET 0
++#endif
++
++/*
+ * PAGE_OFFSET is the virtual address of the start of kernel address
+ * space.
+ */
+diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
+index 731c10c..c98905f 100644
+--- a/arch/sh/kernel/vmlinux.lds.S
++++ b/arch/sh/kernel/vmlinux.lds.S
+@@ -23,7 +23,7 @@ OUTPUT_ARCH(sh)
+ ENTRY(_start)
+ SECTIONS
+ {
+- . = PAGE_OFFSET + MEMORY_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
++ . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
+
+ _text = .; /* Text and read-only data */
+
+diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
+index 58a93fb..c9dbace 100644
+--- a/arch/sh/mm/init.c
++++ b/arch/sh/mm/init.c
+@@ -287,6 +287,8 @@ static void __init do_init_bootmem(void)
+ static void __init early_reserve_mem(void)
+ {
+ unsigned long start_pfn;
++ u32 zero_base = (u32)__MEMORY_START + (u32)PHYSICAL_OFFSET;
++ u32 start = zero_base + (u32)CONFIG_ZERO_PAGE_OFFSET;
+
+ /*
+ * Partially used pages are not usable - thus
+@@ -300,15 +302,13 @@ static void __init early_reserve_mem(void)
+ * this catches the (definitely buggy) case of us accidentally
+ * initializing the bootmem allocator with an invalid RAM area.
+ */
+- memblock_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET,
+- (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) -
+- (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET));
++ memblock_reserve(start, (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - start);
+
+ /*
+ * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET.
+ */
+ if (CONFIG_ZERO_PAGE_OFFSET != 0)
+- memblock_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET);
++ memblock_reserve(zero_base, CONFIG_ZERO_PAGE_OFFSET);
+
+ /*
+ * Handle additional early reservations
+--
+1.7.1
+_______________________________________________
+LTSI-dev mailing list
+LTSI-dev@lists.linuxfoundation.org
+https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev
+
diff --git a/series b/series
index c471c6a7b586a7..541730311cce0a 100644
--- a/series
+++ b/series
@@ -857,3 +857,24 @@ patches.kzm9g/0062-mach-shmobile-Emma-Mobile-EV2-GPIO-support-V3.patch
patches.kzm9g/0063-mach-shmobile-KZM9D-board-Ethernet-support-V3.patch
+patches.sh7757lcr/001-spi-add-support-for-renesas-rspi.patch
+patches.sh7757lcr/002-spi-irq-remove-irqf_disabled.patch
+patches.sh7757lcr/003-drivercore-add-helper-macro-for-platform_driver-boilerplate.patch
+patches.sh7757lcr/004-spi-spi-sh-add-ioresource_mem_type_mask-decoding-for-access-size.patch
+patches.sh7757lcr/005-sh-clock-sh7757-add-clkdev_ick_id-for-cleanup.patch
+patches.sh7757lcr/006-sh-move-clkdev_xxx_id-macro-to-sh_clk.h.patch
+patches.sh7757lcr/007-sh-fix-the-compile-error-in-setup-sh7757.c.patch
+patches.sh7757lcr/008-sh-add-parameters-for-ehci-and-riic-in-clock-sh7757.c.patch
+patches.sh7757lcr/009-sh-add-a-resource-name-for-shdma.patch
+patches.sh7757lcr/010-sh-modify-resource-for-spi0-in-setup-sh7757.patch
+patches.sh7757lcr/011-sh-add-platform_device-for-spi1-in-setup-sh7757.patch
+patches.sh7757lcr/012-sh-modify-clock-sh7757-for-renesas_usbhs.patch
+patches.sh7757lcr/013-sh-add-parameter-for-rspi-in-clock-sh7757.patch
+#patches.sh7757lcr/014-sh-modify-the-asm-sh_eth.h-to-linux-sh_eth.h-in-sh7757lcr.patch
+patches.sh7757lcr/015-sh-add-platform_device-for-rspi-in-setup-sh7757.patch
+patches.sh7757lcr/016-sh-fix-build-warning-in-board-sh7757lcr.patch
+patches.sh7757lcr/017-sh-add-platform_device-for-renesas_usbhs-in-board-sh7757lcr.patch
+patches.sh7757lcr/018-sh-fix-the-sh_mmcif_plat_data-in-board-sh7757lcr.patch
+patches.sh7757lcr/019-sh-modify-a-resource-of-sh_eth_giga1_resources-in-board-sh7757lcr.patch
+patches.sh7757lcr/020-sh-kexec-register-crashk_res.patch
+patches.sh7757lcr/021-sh-kexec-add-physical_start.patch