#include <asm/mach/arch.h>
#include <asm/setup.h>
+#include "sh-gpio.h"
+
/*
* Address Interface BusWidth note
* ------------------------------------------------------------------
return;
/* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
- __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
+ __raw_writew(__raw_readw(IOMEM(0xE68B0008)) | 0x600, IOMEM(0xE68B0008));
}
static struct r8a66597_platdata usb1_host_data = {
};
- #define GPIO_PORT9CR 0xE6051009
- #define GPIO_PORT10CR 0xE605100A
- #define USCCR1 0xE6058144
+ #define GPIO_PORT9CR IOMEM(0xE6051009)
+ #define GPIO_PORT10CR IOMEM(0xE605100A)
+ #define USCCR1 IOMEM(0xE6058144)
static void __init ap4evb_init(void)
{
u32 srcr4;
gpio_request(GPIO_FN_OVCN2_1, NULL);
/* setup USB phy */
- __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */
+ __raw_writew(0x8a0a, IOMEM(0xE6058130)); /* USBCR4 */
/* enable FSI2 port A (ak4643) */
gpio_request(GPIO_FN_FSIAIBT, NULL);
gpio_request(GPIO_FN_HDMI_CEC, NULL);
/* Reset HDMI, must be held at least one EXTALR (32768Hz) period */
- #define SRCR4 0xe61580bc
+ #define SRCR4 IOMEM(0xe61580bc)
srcr4 = __raw_readl(SRCR4);
__raw_writel(srcr4 | (1 << 13), SRCR4);
udelay(50);
#include <sound/sh_fsi.h>
#include <sound/simple_card.h>
+#include "sh-gpio.h"
+
/*
* CON1 Camera Module
* CON2 Extension Bus
* usbhsf_power_ctrl()
*/
#define IRQ7 evt2irq(0x02e0)
- #define USBCR1 0xe605810a
+ #define USBCR1 IOMEM(0xe605810a)
#define USBH 0xC6700000
#define USBH_USBCTR 0x10834
/*
* board init
*/
- #define GPIO_PORT7CR 0xe6050007
- #define GPIO_PORT8CR 0xe6050008
+ #define GPIO_PORT7CR IOMEM(0xe6050007)
+ #define GPIO_PORT8CR IOMEM(0xe6050008)
static void __init eva_init(void)
{
struct platform_device *usb = NULL;
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
+#include "sh-gpio.h"
+
/*
* SDHI
*
return;
/* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
- __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008);
+ __raw_writew(__raw_readw(IOMEM(0xe6890008)) | 0x600, IOMEM(0xe6890008));
}
static struct r8a66597_platdata usb_host_data = {
&sdhi1_device,
};
- #define GPIO_SDHID0_D0 0xe60520fc
- #define GPIO_SDHID0_D1 0xe60520fd
- #define GPIO_SDHID0_D2 0xe60520fe
- #define GPIO_SDHID0_D3 0xe60520ff
- #define GPIO_SDHICMD0 0xe6052100
+ #define GPIO_SDHID0_D0 IOMEM(0xe60520fc)
+ #define GPIO_SDHID0_D1 IOMEM(0xe60520fd)
+ #define GPIO_SDHID0_D2 IOMEM(0xe60520fe)
+ #define GPIO_SDHID0_D3 IOMEM(0xe60520ff)
+ #define GPIO_SDHICMD0 IOMEM(0xe6052100)
- #define GPIO_SDHID1_D0 0xe6052103
- #define GPIO_SDHID1_D1 0xe6052104
- #define GPIO_SDHID1_D2 0xe6052105
- #define GPIO_SDHID1_D3 0xe6052106
- #define GPIO_SDHICMD1 0xe6052107
+ #define GPIO_SDHID1_D0 IOMEM(0xe6052103)
+ #define GPIO_SDHID1_D1 IOMEM(0xe6052104)
+ #define GPIO_SDHID1_D2 IOMEM(0xe6052105)
+ #define GPIO_SDHID1_D3 IOMEM(0xe6052106)
+ #define GPIO_SDHICMD1 IOMEM(0xe6052107)
static void __init g4evm_init(void)
{
gpio_request(GPIO_FN_IDIN, NULL);
/* setup USB phy */
- __raw_writew(0x0200, 0xe605810a); /* USBCR1 */
- __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */
- __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */
- __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */
+ __raw_writew(0x0200, IOMEM(0xe605810a)); /* USBCR1 */
+ __raw_writew(0x00e0, IOMEM(0xe60581c0)); /* CPFCH */
+ __raw_writew(0x6010, IOMEM(0xe60581c6)); /* CGPOSR */
+ __raw_writew(0x8a0a, IOMEM(0xe605810c)); /* USBCR2 */
/* KEYSC @ CN31 */
gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL);
/* USB Func CN17 */
struct usbhs_private {
- unsigned int phy;
- unsigned int cr2;
+ void __iomem *phy;
+ void __iomem *cr2;
struct renesas_usbhs_platform_info info;
};
};
static struct usbhs_private usbhs_private = {
- .phy = 0xe60781e0, /* USBPHYINT */
- .cr2 = 0xe605810c, /* USBCR2 */
+ .phy = IOMEM(0xe60781e0), /* USBPHYINT */
+ .cr2 = IOMEM(0xe605810c), /* USBCR2 */
.info = {
.platform_callback = {
.hardware_init = usbhs_hardware_init,
platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
}
+static void kzm9g_restart(char mode, const char *cmd)
+{
+#define RESCNT2 0xe6188020
+ /* Do soft power on reset */
+ writel((1 << 31), RESCNT2);
+}
+
static const char *kzm9g_boards_compat_dt[] __initdata = {
"renesas,kzm9g",
NULL,
};
DT_MACHINE_START(KZM9G_DT, "kzm9g")
+ .smp = smp_ops(sh73a0_smp_ops),
.map_io = sh73a0_map_io,
.init_early = sh73a0_add_early_devices,
.nr_irqs = NR_IRQS_LEGACY,
.init_machine = kzm_init,
.init_late = shmobile_init_late,
.timer = &shmobile_timer,
+ .restart = kzm9g_restart,
.dt_compat = kzm9g_boards_compat_dt,
MACHINE_END
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
+#include "sh-gpio.h"
+
/*
* Address Interface BusWidth note
* ------------------------------------------------------------------
#define USBHS0_POLL_INTERVAL (HZ * 5)
struct usbhs_private {
- unsigned int usbphyaddr;
- unsigned int usbcrcaddr;
+ void __iomem *usbphyaddr;
+ void __iomem *usbcrcaddr;
struct renesas_usbhs_platform_info info;
struct delayed_work work;
struct platform_device *pdev;
}
static struct usbhs_private usbhs0_private = {
- .usbcrcaddr = 0xe605810c, /* USBCR2 */
+ .usbcrcaddr = IOMEM(0xe605810c), /* USBCR2 */
.info = {
.platform_callback = {
.hardware_init = usbhs0_hardware_init,
};
static struct usbhs_private usbhs1_private = {
- .usbphyaddr = 0xe60581e2, /* USBPHY1INTAP */
- .usbcrcaddr = 0xe6058130, /* USBCR4 */
+ .usbphyaddr = IOMEM(0xe60581e2), /* USBPHY1INTAP */
+ .usbcrcaddr = IOMEM(0xe6058130), /* USBCR4 */
.info = {
.platform_callback = {
.hardware_init = usbhs1_hardware_init,
},
};
- #define GPIO_PORT9CR 0xE6051009
- #define GPIO_PORT10CR 0xE605100A
- #define GPIO_PORT167CR 0xE60520A7
- #define GPIO_PORT168CR 0xE60520A8
- #define SRCR4 0xe61580bc
- #define USCCR1 0xE6058144
+ #define GPIO_PORT9CR IOMEM(0xE6051009)
+ #define GPIO_PORT10CR IOMEM(0xE605100A)
+ #define GPIO_PORT167CR IOMEM(0xE60520A7)
+ #define GPIO_PORT168CR IOMEM(0xE60520A8)
+ #define SRCR4 IOMEM(0xe61580bc)
+ #define USCCR1 IOMEM(0xE6058144)
static void __init mackerel_init(void)
{
u32 srcr4;
},
};
+static struct resource pmu_resources[] = {
+ [0] = {
+ .start = gic_spi(55),
+ .end = gic_spi(55),
+ .flags = IORESOURCE_IRQ,
+ },
+ [1] = {
+ .start = gic_spi(56),
+ .end = gic_spi(56),
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device pmu_device = {
+ .name = "arm-pmu",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(pmu_resources),
+ .resource = pmu_resources,
+};
+
static struct platform_device *sh73a0_early_devices[] __initdata = {
&scif0_device,
&scif1_device,
&i2c4_device,
&dma0_device,
&mpdma0_device,
+ &pmu_device,
};
- #define SRCR2 0xe61580b0
+ #define SRCR2 IOMEM(0xe61580b0)
void __init sh73a0_add_standard_devices(void)
{
--- /dev/null
- static inline void __init gpio_direction_none(u32 addr)
+/*
+ * Generic GPIO API and pinmux table support
+ *
+ * Copyright (c) 2008 Magnus Damm
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#ifndef __ASM_ARCH_GPIO_H
+#define __ASM_ARCH_GPIO_H
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+
+/*
+ * FIXME !!
+ *
+ * current gpio frame work doesn't have
+ * the method to control only pull up/down/free.
+ * this function should be replaced by correct gpio function
+ */
- static inline void __init gpio_request_pullup(u32 addr)
++static inline void __init gpio_direction_none(void __iomem * addr)
+{
+ __raw_writeb(0x00, addr);
+}
+
- static inline void __init gpio_request_pulldown(u32 addr)
++static inline void __init gpio_request_pullup(void __iomem * addr)
+{
+ u8 data = __raw_readb(addr);
+
+ data &= 0x0F;
+ data |= 0xC0;
+ __raw_writeb(data, addr);
+}
+
++static inline void __init gpio_request_pulldown(void __iomem * addr)
+{
+ u8 data = __raw_readb(addr);
+
+ data &= 0x0F;
+ data |= 0xA0;
+
+ __raw_writeb(data, addr);
+}
+
+#endif /* __ASM_ARCH_GPIO_H */