mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Merge branch 'next/boards2' into next/soc2
Dependency for more Renesas soc changes Signed-off-by: Arnd Bergmann <[email protected]>
This commit is contained in:
commit
889cf721d7
431 changed files with 4843 additions and 10525 deletions
|
|
@ -27,17 +27,17 @@ Start End Size Use
|
|||
-----------------------------------------------------------------------
|
||||
0000000000000000 0000007fffffffff 512GB user
|
||||
|
||||
ffffff8000000000 ffffffbbfffcffff ~240GB vmalloc
|
||||
ffffff8000000000 ffffffbbfffeffff ~240GB vmalloc
|
||||
|
||||
ffffffbbfffd0000 ffffffbcfffdffff 64KB [guard page]
|
||||
|
||||
ffffffbbfffe0000 ffffffbcfffeffff 64KB PCI I/O space
|
||||
|
||||
ffffffbbffff0000 ffffffbcffffffff 64KB [guard page]
|
||||
ffffffbbffff0000 ffffffbbffffffff 64KB [guard page]
|
||||
|
||||
ffffffbc00000000 ffffffbdffffffff 8GB vmemmap
|
||||
|
||||
ffffffbe00000000 ffffffbffbffffff ~8GB [guard, future vmmemap]
|
||||
ffffffbe00000000 ffffffbffbbfffff ~8GB [guard, future vmmemap]
|
||||
|
||||
ffffffbffbe00000 ffffffbffbe0ffff 64KB PCI I/O space
|
||||
|
||||
ffffffbbffff0000 ffffffbcffffffff ~2MB [guard]
|
||||
|
||||
ffffffbffc000000 ffffffbfffffffff 64MB modules
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
* EETI eGalax Multiple Touch Controller
|
||||
|
||||
Required properties:
|
||||
- compatible: must be "eeti,egalax_ts"
|
||||
- reg: i2c slave address
|
||||
- interrupt-parent: the phandle for the interrupt controller
|
||||
- interrupts: touch controller interrupt
|
||||
- wakeup-gpios: the gpio pin to be used for waking up the controller
|
||||
as well as uased as irq pin
|
||||
|
||||
Example:
|
||||
|
||||
egalax_ts@04 {
|
||||
compatible = "eeti,egalax_ts";
|
||||
reg = <0x04>;
|
||||
interrupt-parent = <&gpio1>;
|
||||
interrupts = <9 2>;
|
||||
wakeup-gpios = <&gpio1 9 0>;
|
||||
};
|
||||
|
|
@ -10,7 +10,7 @@ Supported chips:
|
|||
BIOS and Kernel Developer's Guide (BKDG) For AMD Family 15h Processors
|
||||
(not yet published)
|
||||
|
||||
Author: Andreas Herrmann <andreas.herrmann3@amd.com>
|
||||
Author: Andreas Herrmann <herrmann.der.user@googlemail.com>
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
|
|
|||
|
|
@ -503,7 +503,7 @@ F: include/linux/altera_uart.h
|
|||
F: include/linux/altera_jtaguart.h
|
||||
|
||||
AMD FAM15H PROCESSOR POWER MONITORING DRIVER
|
||||
M: Andreas Herrmann <andreas.herrmann3@amd.com>
|
||||
M: Andreas Herrmann <herrmann.der.user@googlemail.com>
|
||||
L: [email protected]
|
||||
S: Maintained
|
||||
F: Documentation/hwmon/fam15h_power
|
||||
|
|
@ -2507,6 +2507,7 @@ M: Joonyoung Shim <[email protected]>
|
|||
M: Seung-Woo Kim <[email protected]>
|
||||
M: Kyungmin Park <[email protected]>
|
||||
L: [email protected]
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git
|
||||
S: Supported
|
||||
F: drivers/gpu/drm/exynos
|
||||
F: include/drm/exynos*
|
||||
|
|
@ -5647,7 +5648,7 @@ S: Maintained
|
|||
F: drivers/pinctrl/spear/
|
||||
|
||||
PKTCDVD DRIVER
|
||||
M: Peter Osterlund <[email protected]>
|
||||
M: Jiri Kosina <[email protected]>
|
||||
S: Maintained
|
||||
F: drivers/block/pktcdvd.c
|
||||
F: include/linux/pktcdvd.h
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
VERSION = 3
|
||||
PATCHLEVEL = 7
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc3
|
||||
EXTRAVERSION = -rc5
|
||||
NAME = Terrified Chipmunk
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
|||
|
|
@ -77,7 +77,8 @@ dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
|
|||
dtb-$(CONFIG_ARCH_U8500) += snowball.dtb
|
||||
dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
|
||||
r8a7740-armadillo800eva.dtb \
|
||||
sh73a0-kzm9g.dtb
|
||||
sh73a0-kzm9g.dtb \
|
||||
sh7372-mackerel.dtb
|
||||
dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
|
||||
spear1340-evb.dtb
|
||||
dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Device Tree Source for the sh7377 SoC
|
||||
* Device Tree Source for the mackerel board
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Solutions Corp.
|
||||
*
|
||||
|
|
@ -8,14 +8,15 @@
|
|||
* kind, whether express or implied.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/include/ "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "renesas,sh7377";
|
||||
model = "Mackerel (AP4 EVM 2nd)";
|
||||
compatible = "renesas,mackerel";
|
||||
|
||||
cpus {
|
||||
cpu@0 {
|
||||
compatible = "arm,cortex-a8";
|
||||
};
|
||||
memory {
|
||||
device_type = "memory";
|
||||
reg = <0x40000000 0x10000000>;
|
||||
};
|
||||
};
|
||||
|
|
@ -7,6 +7,7 @@ CONFIG_LOG_BUF_SHIFT=16
|
|||
# CONFIG_IPC_NS is not set
|
||||
# CONFIG_PID_NS is not set
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_PERF_EVENTS=y
|
||||
CONFIG_SLAB=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
|
|
|
|||
|
|
@ -1,57 +0,0 @@
|
|||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=16
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_SLAB=y
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_IOSCHED_CFQ is not set
|
||||
CONFIG_ARCH_SHMOBILE=y
|
||||
CONFIG_ARCH_SH7367=y
|
||||
CONFIG_MACH_G3EVM=y
|
||||
CONFIG_AEABI=y
|
||||
# CONFIG_OABI_COMPAT is not set
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_CMDLINE="console=ttySC1,115200 earlyprintk=sh-sci.1,115200"
|
||||
CONFIG_KEXEC=y
|
||||
CONFIG_PM=y
|
||||
# CONFIG_SUSPEND is not set
|
||||
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
|
||||
# CONFIG_FIRMWARE_IN_KERNEL is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_CONCAT=y
|
||||
CONFIG_MTD_PARTITIONS=y
|
||||
CONFIG_MTD_CHAR=y
|
||||
CONFIG_MTD_BLOCK=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_CFI_INTELEXT=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_MTD_NAND=y
|
||||
# CONFIG_BLK_DEV is not set
|
||||
# CONFIG_MISC_DEVICES is not set
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_SERIAL_SH_SCI=y
|
||||
CONFIG_SERIAL_SH_SCI_NR_UARTS=8
|
||||
CONFIG_SERIAL_SH_SCI_CONSOLE=y
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
# CONFIG_HWMON is not set
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
# CONFIG_HID_SUPPORT is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
# CONFIG_DNOTIFY is not set
|
||||
# CONFIG_INOTIFY_USER is not set
|
||||
CONFIG_TMPFS=y
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
# CONFIG_DETECT_SOFTLOCKUP is not set
|
||||
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
|
||||
# CONFIG_FTRACE is not set
|
||||
# CONFIG_CRC32 is not set
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=16
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_SLAB=y
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_IOSCHED_CFQ is not set
|
||||
CONFIG_ARCH_SHMOBILE=y
|
||||
CONFIG_ARCH_SH7377=y
|
||||
CONFIG_MACH_G4EVM=y
|
||||
CONFIG_AEABI=y
|
||||
# CONFIG_OABI_COMPAT is not set
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_CMDLINE="console=ttySC4,115200 earlyprintk=sh-sci.4,115200"
|
||||
CONFIG_KEXEC=y
|
||||
CONFIG_PM=y
|
||||
# CONFIG_SUSPEND is not set
|
||||
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
|
||||
# CONFIG_FIRMWARE_IN_KERNEL is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_CONCAT=y
|
||||
CONFIG_MTD_PARTITIONS=y
|
||||
CONFIG_MTD_CHAR=y
|
||||
CONFIG_MTD_BLOCK=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_CFI_INTELEXT=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_MTD_NAND=y
|
||||
# CONFIG_BLK_DEV is not set
|
||||
# CONFIG_MISC_DEVICES is not set
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_SERIAL_SH_SCI=y
|
||||
CONFIG_SERIAL_SH_SCI_NR_UARTS=8
|
||||
CONFIG_SERIAL_SH_SCI_CONSOLE=y
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
# CONFIG_HWMON is not set
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
# CONFIG_HID_SUPPORT is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
# CONFIG_DNOTIFY is not set
|
||||
# CONFIG_INOTIFY_USER is not set
|
||||
CONFIG_TMPFS=y
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
# CONFIG_DETECT_SOFTLOCKUP is not set
|
||||
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
|
||||
# CONFIG_FTRACE is not set
|
||||
# CONFIG_CRC32 is not set
|
||||
|
|
@ -74,6 +74,8 @@ CONFIG_KEYBOARD_GPIO=y
|
|||
# CONFIG_INPUT_MOUSE is not set
|
||||
CONFIG_INPUT_TOUCHSCREEN=y
|
||||
CONFIG_TOUCHSCREEN_ST1232=y
|
||||
CONFIG_INPUT_MISC=y
|
||||
CONFIG_INPUT_ADXL34X=y
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
CONFIG_SERIAL_SH_SCI=y
|
||||
CONFIG_SERIAL_SH_SCI_NR_UARTS=9
|
||||
|
|
@ -119,6 +121,8 @@ CONFIG_DMADEVICES=y
|
|||
CONFIG_SH_DMAE=y
|
||||
CONFIG_ASYNC_TX_DMA=y
|
||||
CONFIG_STAGING=y
|
||||
CONFIG_SENSORS_AK8975=y
|
||||
CONFIG_IIO=y
|
||||
# CONFIG_DNOTIFY is not set
|
||||
CONFIG_INOTIFY_USER=y
|
||||
CONFIG_VFAT_FS=y
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ CONFIG_DEVTMPFS_MOUNT=y
|
|||
# CONFIG_STANDALONE is not set
|
||||
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
|
||||
# CONFIG_FW_LOADER is not set
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_NETDEVICES=y
|
||||
# CONFIG_NET_VENDOR_BROADCOM is not set
|
||||
# CONFIG_NET_VENDOR_FARADAY is not set
|
||||
|
|
@ -59,9 +61,8 @@ CONFIG_SMSC911X=y
|
|||
# CONFIG_NET_VENDOR_STMICRO is not set
|
||||
# CONFIG_WLAN is not set
|
||||
# CONFIG_INPUT_MOUSEDEV is not set
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO is not set
|
||||
# CONFIG_VT is not set
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_DEVKMEM is not set
|
||||
|
|
@ -69,14 +70,25 @@ CONFIG_SERIAL_SH_SCI=y
|
|||
CONFIG_SERIAL_SH_SCI_NR_UARTS=6
|
||||
CONFIG_SERIAL_SH_SCI_CONSOLE=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_RCAR=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_SH_HSPI=y
|
||||
CONFIG_GPIO_SYSFS=y
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_RCAR_THERMAL=y
|
||||
CONFIG_SSB=y
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_RCAR_PHY=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_SDHI=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_OHCI_HCD=y
|
||||
CONFIG_USB_OHCI_HCD_PLATFORM=y
|
||||
CONFIG_USB_EHCI_HCD_PLATFORM=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_UIO=y
|
||||
CONFIG_UIO_PDRV_GENIRQ=y
|
||||
# CONFIG_IOMMU_SUPPORT is not set
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen);
|
|||
static inline void __raw_writew(u16 val, volatile void __iomem *addr)
|
||||
{
|
||||
asm volatile("strh %1, %0"
|
||||
: "+Qo" (*(volatile u16 __force *)addr)
|
||||
: "+Q" (*(volatile u16 __force *)addr)
|
||||
: "r" (val));
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ static inline u16 __raw_readw(const volatile void __iomem *addr)
|
|||
{
|
||||
u16 val;
|
||||
asm volatile("ldrh %1, %0"
|
||||
: "+Qo" (*(volatile u16 __force *)addr),
|
||||
: "+Q" (*(volatile u16 __force *)addr),
|
||||
"=r" (val));
|
||||
return val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,5 @@
|
|||
|
||||
extern void sched_clock_postinit(void);
|
||||
extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
|
||||
extern void setup_sched_clock_needs_suspend(u32 (*read)(void), int bits,
|
||||
unsigned long rate);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@
|
|||
#if __LINUX_ARM_ARCH__ <= 6
|
||||
ldr \tmp, =elf_hwcap @ may not have MVFR regs
|
||||
ldr \tmp, [\tmp, #0]
|
||||
tst \tmp, #HWCAP_VFPv3D16
|
||||
ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
|
||||
addne \base, \base, #32*4 @ step over unused register space
|
||||
tst \tmp, #HWCAP_VFPD32
|
||||
ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
|
||||
addeq \base, \base, #32*4 @ step over unused register space
|
||||
#else
|
||||
VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
|
||||
and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
|
||||
|
|
@ -51,9 +51,9 @@
|
|||
#if __LINUX_ARM_ARCH__ <= 6
|
||||
ldr \tmp, =elf_hwcap @ may not have MVFR regs
|
||||
ldr \tmp, [\tmp, #0]
|
||||
tst \tmp, #HWCAP_VFPv3D16
|
||||
stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
|
||||
addne \base, \base, #32*4 @ step over unused register space
|
||||
tst \tmp, #HWCAP_VFPD32
|
||||
stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
|
||||
addeq \base, \base, #32*4 @ step over unused register space
|
||||
#else
|
||||
VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
|
||||
and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
|
||||
|
|
|
|||
|
|
@ -18,11 +18,12 @@
|
|||
#define HWCAP_THUMBEE (1 << 11)
|
||||
#define HWCAP_NEON (1 << 12)
|
||||
#define HWCAP_VFPv3 (1 << 13)
|
||||
#define HWCAP_VFPv3D16 (1 << 14)
|
||||
#define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */
|
||||
#define HWCAP_TLS (1 << 15)
|
||||
#define HWCAP_VFPv4 (1 << 16)
|
||||
#define HWCAP_IDIVA (1 << 17)
|
||||
#define HWCAP_IDIVT (1 << 18)
|
||||
#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */
|
||||
#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -107,13 +107,6 @@ static void sched_clock_poll(unsigned long wrap_ticks)
|
|||
update_sched_clock();
|
||||
}
|
||||
|
||||
void __init setup_sched_clock_needs_suspend(u32 (*read)(void), int bits,
|
||||
unsigned long rate)
|
||||
{
|
||||
setup_sched_clock(read, bits, rate);
|
||||
cd.needs_suspend = true;
|
||||
}
|
||||
|
||||
void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
|
||||
{
|
||||
unsigned long r, w;
|
||||
|
|
@ -189,18 +182,15 @@ void __init sched_clock_postinit(void)
|
|||
static int sched_clock_suspend(void)
|
||||
{
|
||||
sched_clock_poll(sched_clock_timer.data);
|
||||
if (cd.needs_suspend)
|
||||
cd.suspended = true;
|
||||
cd.suspended = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sched_clock_resume(void)
|
||||
{
|
||||
if (cd.needs_suspend) {
|
||||
cd.epoch_cyc = read_sched_clock();
|
||||
cd.epoch_cyc_copy = cd.epoch_cyc;
|
||||
cd.suspended = false;
|
||||
}
|
||||
cd.epoch_cyc = read_sched_clock();
|
||||
cd.epoch_cyc_copy = cd.epoch_cyc;
|
||||
cd.suspended = false;
|
||||
}
|
||||
|
||||
static struct syscore_ops sched_clock_ops = {
|
||||
|
|
|
|||
|
|
@ -2,18 +2,6 @@ if ARCH_SHMOBILE
|
|||
|
||||
comment "SH-Mobile System Type"
|
||||
|
||||
config ARCH_SH7367
|
||||
bool "SH-Mobile G3 (SH7367)"
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select CPU_V6
|
||||
select SH_CLK_CPG
|
||||
|
||||
config ARCH_SH7377
|
||||
bool "SH-Mobile G4 (SH7377)"
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select CPU_V7
|
||||
select SH_CLK_CPG
|
||||
|
||||
config ARCH_SH7372
|
||||
bool "SH-Mobile AP4 (SH7372)"
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
|
|
@ -41,6 +29,8 @@ config ARCH_R8A7779
|
|||
select ARM_GIC
|
||||
select CPU_V7
|
||||
select SH_CLK_CPG
|
||||
select USB_ARCH_HAS_EHCI
|
||||
select USB_ARCH_HAS_OHCI
|
||||
|
||||
config ARCH_EMEV2
|
||||
bool "Emma Mobile EV2"
|
||||
|
|
@ -50,17 +40,6 @@ config ARCH_EMEV2
|
|||
|
||||
comment "SH-Mobile Board Type"
|
||||
|
||||
config MACH_G3EVM
|
||||
bool "G3EVM board"
|
||||
depends on ARCH_SH7367
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
|
||||
config MACH_G4EVM
|
||||
bool "G4EVM board"
|
||||
depends on ARCH_SH7377
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select REGULATOR_FIXED_VOLTAGE if REGULATOR
|
||||
|
||||
config MACH_AP4EVB
|
||||
bool "AP4EVB board"
|
||||
depends on ARCH_SH7372
|
||||
|
|
@ -95,6 +74,7 @@ config MACH_MACKEREL
|
|||
select ARCH_REQUIRE_GPIOLIB
|
||||
select REGULATOR_FIXED_VOLTAGE if REGULATOR
|
||||
select SND_SOC_AK4642 if SND_SIMPLE_CARD
|
||||
select USE_OF
|
||||
|
||||
config MACH_KOTA2
|
||||
bool "KOTA2 board"
|
||||
|
|
@ -146,8 +126,7 @@ menu "Memory configuration"
|
|||
|
||||
config MEMORY_START
|
||||
hex "Physical memory start address"
|
||||
default "0x50000000" if MACH_G3EVM
|
||||
default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \
|
||||
default "0x40000000" if MACH_AP4EVB || MACH_AG5EVM || \
|
||||
MACH_MACKEREL || MACH_BONITO || \
|
||||
MACH_ARMADILLO800EVA
|
||||
default "0x41000000" if MACH_KOTA2
|
||||
|
|
@ -159,8 +138,6 @@ config MEMORY_START
|
|||
|
||||
config MEMORY_SIZE
|
||||
hex "Physical memory size"
|
||||
default "0x08000000" if MACH_G3EVM
|
||||
default "0x08000000" if MACH_G4EVM
|
||||
default "0x20000000" if MACH_AG5EVM || MACH_BONITO || \
|
||||
MACH_ARMADILLO800EVA
|
||||
default "0x1e000000" if MACH_KOTA2
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
obj-y := timer.o console.o clock.o
|
||||
|
||||
# CPU objects
|
||||
obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
|
||||
obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7377.o intc-sh7377.o
|
||||
obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o
|
||||
obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
|
||||
obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o
|
||||
|
|
@ -23,16 +21,12 @@ smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o
|
|||
|
||||
# Pinmux setup
|
||||
pfc-y :=
|
||||
pfc-$(CONFIG_ARCH_SH7367) += pfc-sh7367.o
|
||||
pfc-$(CONFIG_ARCH_SH7377) += pfc-sh7377.o
|
||||
pfc-$(CONFIG_ARCH_SH7372) += pfc-sh7372.o
|
||||
pfc-$(CONFIG_ARCH_SH73A0) += pfc-sh73a0.o
|
||||
pfc-$(CONFIG_ARCH_R8A7740) += pfc-r8a7740.o
|
||||
pfc-$(CONFIG_ARCH_R8A7779) += pfc-r8a7779.o
|
||||
|
||||
# IRQ objects
|
||||
obj-$(CONFIG_ARCH_SH7367) += entry-intc.o
|
||||
obj-$(CONFIG_ARCH_SH7377) += entry-intc.o
|
||||
obj-$(CONFIG_ARCH_SH7372) += entry-intc.o
|
||||
obj-$(CONFIG_ARCH_R8A7740) += entry-intc.o
|
||||
|
||||
|
|
@ -45,8 +39,6 @@ obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o
|
|||
obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
|
||||
|
||||
# Board objects
|
||||
obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o
|
||||
obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o
|
||||
obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
|
||||
obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o
|
||||
obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
|
||||
|
|
|
|||
|
|
@ -658,133 +658,16 @@ static struct platform_device lcdc_device = {
|
|||
|
||||
/* FSI */
|
||||
#define IRQ_FSI evt2irq(0x1840)
|
||||
static int __fsi_set_rate(struct clk *clk, long rate, int enable)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (rate <= 0)
|
||||
return ret;
|
||||
|
||||
if (enable) {
|
||||
ret = clk_set_rate(clk, rate);
|
||||
if (0 == ret)
|
||||
ret = clk_enable(clk);
|
||||
} else {
|
||||
clk_disable(clk);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
|
||||
{
|
||||
return __fsi_set_rate(clk, clk_round_rate(clk, rate), enable);
|
||||
}
|
||||
|
||||
static int fsi_ak4642_set_rate(struct device *dev, int rate, int enable)
|
||||
{
|
||||
struct clk *fsia_ick;
|
||||
struct clk *fsiack;
|
||||
int ret = -EIO;
|
||||
|
||||
fsia_ick = clk_get(dev, "icka");
|
||||
if (IS_ERR(fsia_ick))
|
||||
return PTR_ERR(fsia_ick);
|
||||
|
||||
/*
|
||||
* FSIACK is connected to AK4642,
|
||||
* and use external clock pin from it.
|
||||
* it is parent of fsia_ick now.
|
||||
*/
|
||||
fsiack = clk_get_parent(fsia_ick);
|
||||
if (!fsiack)
|
||||
goto fsia_ick_out;
|
||||
|
||||
/*
|
||||
* we get 1/1 divided clock by setting same rate to fsiack and fsia_ick
|
||||
*
|
||||
** FIXME **
|
||||
* Because the freq_table of external clk (fsiack) are all 0,
|
||||
* the return value of clk_round_rate became 0.
|
||||
* So, it use __fsi_set_rate here.
|
||||
*/
|
||||
ret = __fsi_set_rate(fsiack, rate, enable);
|
||||
if (ret < 0)
|
||||
goto fsiack_out;
|
||||
|
||||
ret = __fsi_set_round_rate(fsia_ick, rate, enable);
|
||||
if ((ret < 0) && enable)
|
||||
__fsi_set_round_rate(fsiack, rate, 0); /* disable FSI ACK */
|
||||
|
||||
fsiack_out:
|
||||
clk_put(fsiack);
|
||||
|
||||
fsia_ick_out:
|
||||
clk_put(fsia_ick);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable)
|
||||
{
|
||||
struct clk *fsib_clk;
|
||||
struct clk *fdiv_clk = &sh7372_fsidivb_clk;
|
||||
long fsib_rate = 0;
|
||||
long fdiv_rate = 0;
|
||||
int ackmd_bpfmd;
|
||||
int ret;
|
||||
|
||||
switch (rate) {
|
||||
case 44100:
|
||||
fsib_rate = rate * 256;
|
||||
ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
break;
|
||||
case 48000:
|
||||
fsib_rate = 85428000; /* around 48kHz x 256 x 7 */
|
||||
fdiv_rate = rate * 256;
|
||||
ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
break;
|
||||
default:
|
||||
pr_err("unsupported rate in FSI2 port B\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* FSI B setting */
|
||||
fsib_clk = clk_get(dev, "ickb");
|
||||
if (IS_ERR(fsib_clk))
|
||||
return -EIO;
|
||||
|
||||
ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable);
|
||||
if (ret < 0)
|
||||
goto fsi_set_rate_end;
|
||||
|
||||
/* FSI DIV setting */
|
||||
ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable);
|
||||
if (ret < 0) {
|
||||
/* disable FSI B */
|
||||
if (enable)
|
||||
__fsi_set_round_rate(fsib_clk, fsib_rate, 0);
|
||||
goto fsi_set_rate_end;
|
||||
}
|
||||
|
||||
ret = ackmd_bpfmd;
|
||||
|
||||
fsi_set_rate_end:
|
||||
clk_put(fsib_clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct sh_fsi_platform_info fsi_info = {
|
||||
.port_a = {
|
||||
.flags = SH_FSI_BRS_INV,
|
||||
.set_rate = fsi_ak4642_set_rate,
|
||||
},
|
||||
.port_b = {
|
||||
.flags = SH_FSI_BRS_INV |
|
||||
SH_FSI_BRM_INV |
|
||||
SH_FSI_LRS_INV |
|
||||
SH_FSI_CLK_CPG |
|
||||
SH_FSI_FMT_SPDIF,
|
||||
.set_rate = fsi_hdmi_set_rate,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -1144,25 +1027,6 @@ out:
|
|||
clk_put(hdmi_ick);
|
||||
}
|
||||
|
||||
static void __init fsi_init_pm_clock(void)
|
||||
{
|
||||
struct clk *fsia_ick;
|
||||
int ret;
|
||||
|
||||
fsia_ick = clk_get(&fsi_device.dev, "icka");
|
||||
if (IS_ERR(fsia_ick)) {
|
||||
ret = PTR_ERR(fsia_ick);
|
||||
pr_err("Cannot get FSI ICK: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = clk_set_parent(fsia_ick, &sh7372_fsiack_clk);
|
||||
if (ret < 0)
|
||||
pr_err("Cannot set FSI-A parent: %d\n", ret);
|
||||
|
||||
clk_put(fsia_ick);
|
||||
}
|
||||
|
||||
/* TouchScreen */
|
||||
#ifdef CONFIG_AP4EVB_QHD
|
||||
# define GPIO_TSC_IRQ GPIO_FN_IRQ28_123
|
||||
|
|
@ -1476,7 +1340,6 @@ static void __init ap4evb_init(void)
|
|||
ARRAY_SIZE(domain_devices));
|
||||
|
||||
hdmi_init_pm_clock();
|
||||
fsi_init_pm_clock();
|
||||
sh7372_pm_init();
|
||||
pm_clk_add(&fsi_device.dev, "spu2");
|
||||
pm_clk_add(&lcdc1_device.dev, "hdmi");
|
||||
|
|
|
|||
|
|
@ -768,32 +768,6 @@ static struct platform_device ceu0_device = {
|
|||
};
|
||||
|
||||
/* FSI */
|
||||
static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable)
|
||||
{
|
||||
struct clk *fsib;
|
||||
int ret;
|
||||
|
||||
/* it support 48KHz only */
|
||||
if (48000 != rate)
|
||||
return -EINVAL;
|
||||
|
||||
fsib = clk_get(dev, "ickb");
|
||||
if (IS_ERR(fsib))
|
||||
return -EINVAL;
|
||||
|
||||
if (enable) {
|
||||
ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
clk_enable(fsib);
|
||||
} else {
|
||||
ret = 0;
|
||||
clk_disable(fsib);
|
||||
}
|
||||
|
||||
clk_put(fsib);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct sh_fsi_platform_info fsi_info = {
|
||||
/* FSI-WM8978 */
|
||||
.port_a = {
|
||||
|
|
@ -802,8 +776,8 @@ static struct sh_fsi_platform_info fsi_info = {
|
|||
/* FSI-HDMI */
|
||||
.port_b = {
|
||||
.flags = SH_FSI_FMT_SPDIF |
|
||||
SH_FSI_ENABLE_STREAM_MODE,
|
||||
.set_rate = fsi_hdmi_set_rate,
|
||||
SH_FSI_ENABLE_STREAM_MODE |
|
||||
SH_FSI_CLK_CPG,
|
||||
.tx_id = SHDMA_SLAVE_FSIB_TX,
|
||||
}
|
||||
};
|
||||
|
|
@ -938,13 +912,11 @@ static void __init eva_clock_init(void)
|
|||
struct clk *xtal1 = clk_get(NULL, "extal1");
|
||||
struct clk *usb24s = clk_get(NULL, "usb24s");
|
||||
struct clk *fsibck = clk_get(NULL, "fsibck");
|
||||
struct clk *fsib = clk_get(&fsi_device.dev, "ickb");
|
||||
|
||||
if (IS_ERR(system) ||
|
||||
IS_ERR(xtal1) ||
|
||||
IS_ERR(usb24s) ||
|
||||
IS_ERR(fsibck) ||
|
||||
IS_ERR(fsib)) {
|
||||
IS_ERR(fsibck)) {
|
||||
pr_err("armadillo800eva board clock init failed\n");
|
||||
goto clock_error;
|
||||
}
|
||||
|
|
@ -956,9 +928,7 @@ static void __init eva_clock_init(void)
|
|||
clk_set_parent(usb24s, system);
|
||||
|
||||
/* FSIBCK is 12.288MHz, and it is parent of FSI-B */
|
||||
clk_set_parent(fsib, fsibck);
|
||||
clk_set_rate(fsibck, 12288000);
|
||||
clk_set_rate(fsib, 12288000);
|
||||
|
||||
clock_error:
|
||||
if (!IS_ERR(system))
|
||||
|
|
@ -969,8 +939,6 @@ clock_error:
|
|||
clk_put(usb24s);
|
||||
if (!IS_ERR(fsibck))
|
||||
clk_put(fsibck);
|
||||
if (!IS_ERR(fsib))
|
||||
clk_put(fsib);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1229,6 +1197,13 @@ static void __init eva_add_early_devices(void)
|
|||
shmobile_timer.init = eva_earlytimer_init;
|
||||
}
|
||||
|
||||
#define RESCNT2 IOMEM(0xe6188020)
|
||||
static void eva_restart(char mode, const char *cmd)
|
||||
{
|
||||
/* Do soft power on reset */
|
||||
writel((1 << 31), RESCNT2);
|
||||
}
|
||||
|
||||
static const char *eva_boards_compat_dt[] __initdata = {
|
||||
"renesas,armadillo800eva",
|
||||
NULL,
|
||||
|
|
@ -1243,4 +1218,5 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
|
|||
.init_late = shmobile_init_late,
|
||||
.timer = &shmobile_timer,
|
||||
.dt_compat = eva_boards_compat_dt,
|
||||
.restart = eva_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -1,343 +0,0 @@
|
|||
/*
|
||||
* G3EVM board support
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
* Copyright (C) 2008 Yoshihiro Shimoda
|
||||
*
|
||||
* 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/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/mtd/sh_flctl.h>
|
||||
#include <linux/usb/r8a66597.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/input/sh_keysc.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/sh7367.h>
|
||||
#include <mach/common.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
/*
|
||||
* IrDA
|
||||
*
|
||||
* S67: 5bit : ON power
|
||||
* : 6bit : ON remote control
|
||||
* OFF IrDA
|
||||
*/
|
||||
|
||||
static struct mtd_partition nor_flash_partitions[] = {
|
||||
{
|
||||
.name = "loader",
|
||||
.offset = 0x00000000,
|
||||
.size = 512 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "bootenv",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 512 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "kernel_ro",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 8 * 1024 * 1024,
|
||||
.mask_flags = MTD_WRITEABLE,
|
||||
},
|
||||
{
|
||||
.name = "kernel",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 8 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "data",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct physmap_flash_data nor_flash_data = {
|
||||
.width = 2,
|
||||
.parts = nor_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(nor_flash_partitions),
|
||||
};
|
||||
|
||||
static struct resource nor_flash_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x00000000,
|
||||
.end = 0x08000000 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device nor_flash_device = {
|
||||
.name = "physmap-flash",
|
||||
.dev = {
|
||||
.platform_data = &nor_flash_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(nor_flash_resources),
|
||||
.resource = nor_flash_resources,
|
||||
};
|
||||
|
||||
/* USBHS */
|
||||
static void usb_host_port_power(int port, int power)
|
||||
{
|
||||
if (!power) /* only power-on supported for now */
|
||||
return;
|
||||
|
||||
/* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
|
||||
__raw_writew(__raw_readw(IOMEM(0xe6890008)) | 0x600, IOMEM(0xe6890008));
|
||||
}
|
||||
|
||||
static struct r8a66597_platdata usb_host_data = {
|
||||
.on_chip = 1,
|
||||
.port_power = usb_host_port_power,
|
||||
};
|
||||
|
||||
static struct resource usb_host_resources[] = {
|
||||
[0] = {
|
||||
.name = "USBHS",
|
||||
.start = 0xe6890000,
|
||||
.end = 0xe68900e5,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0xa20), /* USBHS_USHI0 */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device usb_host_device = {
|
||||
.name = "r8a66597_hcd",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &usb_host_data,
|
||||
.dma_mask = NULL,
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(usb_host_resources),
|
||||
.resource = usb_host_resources,
|
||||
};
|
||||
|
||||
/* KEYSC */
|
||||
static struct sh_keysc_info keysc_info = {
|
||||
.mode = SH_KEYSC_MODE_5,
|
||||
.scan_timing = 3,
|
||||
.delay = 100,
|
||||
.keycodes = {
|
||||
KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
|
||||
KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
|
||||
KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
|
||||
KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
|
||||
KEY_WAKEUP, KEY_COFFEE, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4,
|
||||
KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource keysc_resources[] = {
|
||||
[0] = {
|
||||
.name = "KEYSC",
|
||||
.start = 0xe61b0000,
|
||||
.end = 0xe61b000f,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0xbe0), /* KEYSC_KEY */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device keysc_device = {
|
||||
.name = "sh_keysc",
|
||||
.num_resources = ARRAY_SIZE(keysc_resources),
|
||||
.resource = keysc_resources,
|
||||
.dev = {
|
||||
.platform_data = &keysc_info,
|
||||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition nand_partition_info[] = {
|
||||
{
|
||||
.name = "system",
|
||||
.offset = 0,
|
||||
.size = 64 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "userdata",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 128 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "cache",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 64 * 1024 * 1024,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource nand_flash_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xe6a30000,
|
||||
.end = 0xe6a3009b,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct sh_flctl_platform_data nand_flash_data = {
|
||||
.parts = nand_partition_info,
|
||||
.nr_parts = ARRAY_SIZE(nand_partition_info),
|
||||
.flcmncr_val = QTSEL_E | FCKSEL_E | TYPESEL_SET | NANWF_E
|
||||
| SHBUSSEL | SEL_16BIT,
|
||||
};
|
||||
|
||||
static struct platform_device nand_flash_device = {
|
||||
.name = "sh_flctl",
|
||||
.resource = nand_flash_resources,
|
||||
.num_resources = ARRAY_SIZE(nand_flash_resources),
|
||||
.dev = {
|
||||
.platform_data = &nand_flash_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource irda_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xE6D00000,
|
||||
.end = 0xE6D01FD4 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0x480), /* IRDA */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device irda_device = {
|
||||
.name = "sh_irda",
|
||||
.id = -1,
|
||||
.resource = irda_resources,
|
||||
.num_resources = ARRAY_SIZE(irda_resources),
|
||||
};
|
||||
|
||||
static struct platform_device *g3evm_devices[] __initdata = {
|
||||
&nor_flash_device,
|
||||
&usb_host_device,
|
||||
&keysc_device,
|
||||
&nand_flash_device,
|
||||
&irda_device,
|
||||
};
|
||||
|
||||
static void __init g3evm_init(void)
|
||||
{
|
||||
sh7367_pinmux_init();
|
||||
|
||||
/* Lit DS4 LED */
|
||||
gpio_request(GPIO_PORT22, NULL);
|
||||
gpio_direction_output(GPIO_PORT22, 1);
|
||||
gpio_export(GPIO_PORT22, 0);
|
||||
|
||||
/* Lit DS8 LED */
|
||||
gpio_request(GPIO_PORT23, NULL);
|
||||
gpio_direction_output(GPIO_PORT23, 1);
|
||||
gpio_export(GPIO_PORT23, 0);
|
||||
|
||||
/* Lit DS3 LED */
|
||||
gpio_request(GPIO_PORT24, NULL);
|
||||
gpio_direction_output(GPIO_PORT24, 1);
|
||||
gpio_export(GPIO_PORT24, 0);
|
||||
|
||||
/* SCIFA1 */
|
||||
gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
|
||||
gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
|
||||
gpio_request(GPIO_FN_SCIFA1_CTS, NULL);
|
||||
gpio_request(GPIO_FN_SCIFA1_RTS, NULL);
|
||||
|
||||
/* USBHS */
|
||||
gpio_request(GPIO_FN_VBUS0, NULL);
|
||||
gpio_request(GPIO_FN_PWEN, NULL);
|
||||
gpio_request(GPIO_FN_OVCN, NULL);
|
||||
gpio_request(GPIO_FN_OVCN2, NULL);
|
||||
gpio_request(GPIO_FN_EXTLP, NULL);
|
||||
gpio_request(GPIO_FN_IDIN, NULL);
|
||||
|
||||
/* setup USB phy */
|
||||
__raw_writew(0x0300, IOMEM(0xe605810a)); /* USBCR1 */
|
||||
__raw_writew(0x00e0, IOMEM(0xe60581c0)); /* CPFCH */
|
||||
__raw_writew(0x6010, IOMEM(0xe60581c6)); /* CGPOSR */
|
||||
__raw_writew(0x8a0a, IOMEM(0xe605810c)); /* USBCR2 */
|
||||
|
||||
/* KEYSC @ CN7 */
|
||||
gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL);
|
||||
gpio_request(GPIO_FN_PORT43_KEYOUT1, NULL);
|
||||
gpio_request(GPIO_FN_PORT44_KEYOUT2, NULL);
|
||||
gpio_request(GPIO_FN_PORT45_KEYOUT3, NULL);
|
||||
gpio_request(GPIO_FN_PORT46_KEYOUT4, NULL);
|
||||
gpio_request(GPIO_FN_PORT47_KEYOUT5, NULL);
|
||||
gpio_request(GPIO_FN_PORT48_KEYIN0_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT49_KEYIN1_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT50_KEYIN2_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT55_KEYIN3_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT56_KEYIN4_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT57_KEYIN5_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT58_KEYIN6_PU, NULL);
|
||||
|
||||
/* FLCTL */
|
||||
gpio_request(GPIO_FN_FCE0, NULL);
|
||||
gpio_request(GPIO_FN_D0_ED0_NAF0, NULL);
|
||||
gpio_request(GPIO_FN_D1_ED1_NAF1, NULL);
|
||||
gpio_request(GPIO_FN_D2_ED2_NAF2, NULL);
|
||||
gpio_request(GPIO_FN_D3_ED3_NAF3, NULL);
|
||||
gpio_request(GPIO_FN_D4_ED4_NAF4, NULL);
|
||||
gpio_request(GPIO_FN_D5_ED5_NAF5, NULL);
|
||||
gpio_request(GPIO_FN_D6_ED6_NAF6, NULL);
|
||||
gpio_request(GPIO_FN_D7_ED7_NAF7, NULL);
|
||||
gpio_request(GPIO_FN_D8_ED8_NAF8, NULL);
|
||||
gpio_request(GPIO_FN_D9_ED9_NAF9, NULL);
|
||||
gpio_request(GPIO_FN_D10_ED10_NAF10, NULL);
|
||||
gpio_request(GPIO_FN_D11_ED11_NAF11, NULL);
|
||||
gpio_request(GPIO_FN_D12_ED12_NAF12, NULL);
|
||||
gpio_request(GPIO_FN_D13_ED13_NAF13, NULL);
|
||||
gpio_request(GPIO_FN_D14_ED14_NAF14, NULL);
|
||||
gpio_request(GPIO_FN_D15_ED15_NAF15, NULL);
|
||||
gpio_request(GPIO_FN_WE0_XWR0_FWE, NULL);
|
||||
gpio_request(GPIO_FN_FRB, NULL);
|
||||
/* FOE, FCDE, FSC on dedicated pins */
|
||||
__raw_writel(__raw_readl(IOMEM(0xe6158048)) & ~(1 << 15), IOMEM(0xe6158048));
|
||||
|
||||
/* IrDA */
|
||||
gpio_request(GPIO_FN_IRDA_OUT, NULL);
|
||||
gpio_request(GPIO_FN_IRDA_IN, NULL);
|
||||
gpio_request(GPIO_FN_IRDA_FIRSEL, NULL);
|
||||
|
||||
sh7367_add_standard_devices();
|
||||
|
||||
platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices));
|
||||
}
|
||||
|
||||
MACHINE_START(G3EVM, "g3evm")
|
||||
.map_io = sh7367_map_io,
|
||||
.init_early = sh7367_add_early_devices,
|
||||
.init_irq = sh7367_init_irq,
|
||||
.handle_irq = shmobile_handle_irq_intc,
|
||||
.init_machine = g3evm_init,
|
||||
.init_late = shmobile_init_late,
|
||||
.timer = &shmobile_timer,
|
||||
MACHINE_END
|
||||
|
|
@ -1,384 +0,0 @@
|
|||
/*
|
||||
* G4EVM board support
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
* Copyright (C) 2008 Yoshihiro Shimoda
|
||||
*
|
||||
* 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/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/regulator/fixed.h>
|
||||
#include <linux/regulator/machine.h>
|
||||
#include <linux/usb/r8a66597.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/input/sh_keysc.h>
|
||||
#include <linux/mmc/host.h>
|
||||
#include <linux/mmc/sh_mobile_sdhi.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/sh7377.h>
|
||||
#include <mach/common.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
#include "sh-gpio.h"
|
||||
|
||||
/*
|
||||
* SDHI
|
||||
*
|
||||
* SDHI0 : card detection is possible
|
||||
* SDHI1 : card detection is impossible
|
||||
*
|
||||
* [G4-MAIN-BOARD]
|
||||
* JP74 : short # DBG_2V8A for SDHI0
|
||||
* JP75 : NC # DBG_3V3A for SDHI0
|
||||
* JP76 : NC # DBG_3V3A_SD for SDHI0
|
||||
* JP77 : NC # 3V3A_SDIO for SDHI1
|
||||
* JP78 : short # DBG_2V8A for SDHI1
|
||||
* JP79 : NC # DBG_3V3A for SDHI1
|
||||
* JP80 : NC # DBG_3V3A_SD for SDHI1
|
||||
*
|
||||
* [G4-CORE-BOARD]
|
||||
* S32 : all off # to dissever from G3-CORE_DBG board
|
||||
* S33 : all off # to dissever from G3-CORE_DBG board
|
||||
*
|
||||
* [G3-CORE_DBG-BOARD]
|
||||
* S1 : all off # to dissever from G3-CORE_DBG board
|
||||
* S3 : all off # to dissever from G3-CORE_DBG board
|
||||
* S4 : all off # to dissever from G3-CORE_DBG board
|
||||
*/
|
||||
|
||||
static struct mtd_partition nor_flash_partitions[] = {
|
||||
{
|
||||
.name = "loader",
|
||||
.offset = 0x00000000,
|
||||
.size = 512 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "bootenv",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 512 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "kernel_ro",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 8 * 1024 * 1024,
|
||||
.mask_flags = MTD_WRITEABLE,
|
||||
},
|
||||
{
|
||||
.name = "kernel",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 8 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "data",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct physmap_flash_data nor_flash_data = {
|
||||
.width = 2,
|
||||
.parts = nor_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(nor_flash_partitions),
|
||||
};
|
||||
|
||||
static struct resource nor_flash_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x00000000,
|
||||
.end = 0x08000000 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device nor_flash_device = {
|
||||
.name = "physmap-flash",
|
||||
.dev = {
|
||||
.platform_data = &nor_flash_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(nor_flash_resources),
|
||||
.resource = nor_flash_resources,
|
||||
};
|
||||
|
||||
/* USBHS */
|
||||
static void usb_host_port_power(int port, int power)
|
||||
{
|
||||
if (!power) /* only power-on supported for now */
|
||||
return;
|
||||
|
||||
/* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
|
||||
__raw_writew(__raw_readw(IOMEM(0xe6890008)) | 0x600, IOMEM(0xe6890008));
|
||||
}
|
||||
|
||||
static struct r8a66597_platdata usb_host_data = {
|
||||
.on_chip = 1,
|
||||
.port_power = usb_host_port_power,
|
||||
};
|
||||
|
||||
static struct resource usb_host_resources[] = {
|
||||
[0] = {
|
||||
.name = "USBHS",
|
||||
.start = 0xe6890000,
|
||||
.end = 0xe68900e5,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0x0a20), /* USBHS_USHI0 */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device usb_host_device = {
|
||||
.name = "r8a66597_hcd",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &usb_host_data,
|
||||
.dma_mask = NULL,
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(usb_host_resources),
|
||||
.resource = usb_host_resources,
|
||||
};
|
||||
|
||||
/* KEYSC */
|
||||
static struct sh_keysc_info keysc_info = {
|
||||
.mode = SH_KEYSC_MODE_5,
|
||||
.scan_timing = 3,
|
||||
.delay = 100,
|
||||
.keycodes = {
|
||||
KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F,
|
||||
KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L,
|
||||
KEY_M, KEY_N, KEY_U, KEY_P, KEY_Q, KEY_R,
|
||||
KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X,
|
||||
KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE,
|
||||
KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5,
|
||||
KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource keysc_resources[] = {
|
||||
[0] = {
|
||||
.name = "KEYSC",
|
||||
.start = 0xe61b0000,
|
||||
.end = 0xe61b000f,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0x0be0), /* KEYSC_KEY */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device keysc_device = {
|
||||
.name = "sh_keysc",
|
||||
.id = 0, /* keysc0 clock */
|
||||
.num_resources = ARRAY_SIZE(keysc_resources),
|
||||
.resource = keysc_resources,
|
||||
.dev = {
|
||||
.platform_data = &keysc_info,
|
||||
},
|
||||
};
|
||||
|
||||
/* Fixed 3.3V regulator to be used by SDHI0 and SDHI1 */
|
||||
static struct regulator_consumer_supply fixed3v3_power_consumers[] =
|
||||
{
|
||||
REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
|
||||
REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
|
||||
REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
|
||||
REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
|
||||
};
|
||||
|
||||
/* SDHI */
|
||||
static struct sh_mobile_sdhi_info sdhi0_info = {
|
||||
.tmio_caps = MMC_CAP_SDIO_IRQ,
|
||||
};
|
||||
|
||||
static struct resource sdhi0_resources[] = {
|
||||
[0] = {
|
||||
.name = "SDHI0",
|
||||
.start = 0xe6d50000,
|
||||
.end = 0xe6d500ff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0x0e00), /* SDHI0 */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device sdhi0_device = {
|
||||
.name = "sh_mobile_sdhi",
|
||||
.num_resources = ARRAY_SIZE(sdhi0_resources),
|
||||
.resource = sdhi0_resources,
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &sdhi0_info,
|
||||
},
|
||||
};
|
||||
|
||||
static struct sh_mobile_sdhi_info sdhi1_info = {
|
||||
.tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
|
||||
};
|
||||
|
||||
static struct resource sdhi1_resources[] = {
|
||||
[0] = {
|
||||
.name = "SDHI1",
|
||||
.start = 0xe6d60000,
|
||||
.end = 0xe6d600ff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0x0e80), /* SDHI1 */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device sdhi1_device = {
|
||||
.name = "sh_mobile_sdhi",
|
||||
.num_resources = ARRAY_SIZE(sdhi1_resources),
|
||||
.resource = sdhi1_resources,
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &sdhi1_info,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *g4evm_devices[] __initdata = {
|
||||
&nor_flash_device,
|
||||
&usb_host_device,
|
||||
&keysc_device,
|
||||
&sdhi0_device,
|
||||
&sdhi1_device,
|
||||
};
|
||||
|
||||
#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 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)
|
||||
{
|
||||
regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
|
||||
ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
|
||||
|
||||
sh7377_pinmux_init();
|
||||
|
||||
/* Lit DS14 LED */
|
||||
gpio_request(GPIO_PORT109, NULL);
|
||||
gpio_direction_output(GPIO_PORT109, 1);
|
||||
gpio_export(GPIO_PORT109, 1);
|
||||
|
||||
/* Lit DS15 LED */
|
||||
gpio_request(GPIO_PORT110, NULL);
|
||||
gpio_direction_output(GPIO_PORT110, 1);
|
||||
gpio_export(GPIO_PORT110, 1);
|
||||
|
||||
/* Lit DS16 LED */
|
||||
gpio_request(GPIO_PORT112, NULL);
|
||||
gpio_direction_output(GPIO_PORT112, 1);
|
||||
gpio_export(GPIO_PORT112, 1);
|
||||
|
||||
/* Lit DS17 LED */
|
||||
gpio_request(GPIO_PORT113, NULL);
|
||||
gpio_direction_output(GPIO_PORT113, 1);
|
||||
gpio_export(GPIO_PORT113, 1);
|
||||
|
||||
/* USBHS */
|
||||
gpio_request(GPIO_FN_VBUS_0, NULL);
|
||||
gpio_request(GPIO_FN_PWEN, NULL);
|
||||
gpio_request(GPIO_FN_OVCN, NULL);
|
||||
gpio_request(GPIO_FN_OVCN2, NULL);
|
||||
gpio_request(GPIO_FN_EXTLP, NULL);
|
||||
gpio_request(GPIO_FN_IDIN, NULL);
|
||||
|
||||
/* setup USB phy */
|
||||
__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);
|
||||
gpio_request(GPIO_FN_PORT61_KEYOUT4, NULL);
|
||||
gpio_request(GPIO_FN_PORT62_KEYOUT3, NULL);
|
||||
gpio_request(GPIO_FN_PORT63_KEYOUT2, NULL);
|
||||
gpio_request(GPIO_FN_PORT64_KEYOUT1, NULL);
|
||||
gpio_request(GPIO_FN_PORT65_KEYOUT0, NULL);
|
||||
gpio_request(GPIO_FN_PORT66_KEYIN0_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT67_KEYIN1_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT68_KEYIN2_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT69_KEYIN3_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT70_KEYIN4_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT71_KEYIN5_PU, NULL);
|
||||
gpio_request(GPIO_FN_PORT72_KEYIN6_PU, NULL);
|
||||
|
||||
/* SDHI0 */
|
||||
gpio_request(GPIO_FN_SDHICLK0, NULL);
|
||||
gpio_request(GPIO_FN_SDHICD0, NULL);
|
||||
gpio_request(GPIO_FN_SDHID0_0, NULL);
|
||||
gpio_request(GPIO_FN_SDHID0_1, NULL);
|
||||
gpio_request(GPIO_FN_SDHID0_2, NULL);
|
||||
gpio_request(GPIO_FN_SDHID0_3, NULL);
|
||||
gpio_request(GPIO_FN_SDHICMD0, NULL);
|
||||
gpio_request(GPIO_FN_SDHIWP0, NULL);
|
||||
gpio_request_pullup(GPIO_SDHID0_D0);
|
||||
gpio_request_pullup(GPIO_SDHID0_D1);
|
||||
gpio_request_pullup(GPIO_SDHID0_D2);
|
||||
gpio_request_pullup(GPIO_SDHID0_D3);
|
||||
gpio_request_pullup(GPIO_SDHICMD0);
|
||||
|
||||
/* SDHI1 */
|
||||
gpio_request(GPIO_FN_SDHICLK1, NULL);
|
||||
gpio_request(GPIO_FN_SDHID1_0, NULL);
|
||||
gpio_request(GPIO_FN_SDHID1_1, NULL);
|
||||
gpio_request(GPIO_FN_SDHID1_2, NULL);
|
||||
gpio_request(GPIO_FN_SDHID1_3, NULL);
|
||||
gpio_request(GPIO_FN_SDHICMD1, NULL);
|
||||
gpio_request_pullup(GPIO_SDHID1_D0);
|
||||
gpio_request_pullup(GPIO_SDHID1_D1);
|
||||
gpio_request_pullup(GPIO_SDHID1_D2);
|
||||
gpio_request_pullup(GPIO_SDHID1_D3);
|
||||
gpio_request_pullup(GPIO_SDHICMD1);
|
||||
|
||||
sh7377_add_standard_devices();
|
||||
|
||||
platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices));
|
||||
}
|
||||
|
||||
MACHINE_START(G4EVM, "g4evm")
|
||||
.map_io = sh7377_map_io,
|
||||
.init_early = sh7377_add_early_devices,
|
||||
.init_irq = sh7377_init_irq,
|
||||
.handle_irq = shmobile_handle_irq_intc,
|
||||
.init_machine = g4evm_init,
|
||||
.init_late = shmobile_init_late,
|
||||
.timer = &shmobile_timer,
|
||||
MACHINE_END
|
||||
|
|
@ -384,6 +384,8 @@ static struct regulator_consumer_supply fixed2v8_power_consumers[] =
|
|||
|
||||
/* SDHI */
|
||||
static struct sh_mobile_sdhi_info sdhi0_info = {
|
||||
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
|
||||
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
|
||||
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
|
||||
.tmio_caps = MMC_CAP_SD_HIGHSPEED,
|
||||
.tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
|
||||
|
|
@ -424,6 +426,8 @@ static struct platform_device sdhi0_device = {
|
|||
|
||||
/* Micro SD */
|
||||
static struct sh_mobile_sdhi_info sdhi2_info = {
|
||||
.dma_slave_tx = SHDMA_SLAVE_SDHI2_TX,
|
||||
.dma_slave_rx = SHDMA_SLAVE_SDHI2_RX,
|
||||
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
|
||||
TMIO_MMC_USE_GPIO_CD |
|
||||
TMIO_MMC_WRPROTECT_DISABLE,
|
||||
|
|
@ -557,7 +561,15 @@ static struct i2c_board_info i2c0_devices[] = {
|
|||
},
|
||||
{
|
||||
I2C_BOARD_INFO("r2025sd", 0x32),
|
||||
}
|
||||
},
|
||||
{
|
||||
I2C_BOARD_INFO("ak8975", 0x0c),
|
||||
.irq = intcs_evt2irq(0x3380), /* IRQ28 */
|
||||
},
|
||||
{
|
||||
I2C_BOARD_INFO("adxl34x", 0x1d),
|
||||
.irq = intcs_evt2irq(0x3340), /* IRQ26 */
|
||||
},
|
||||
};
|
||||
|
||||
static struct i2c_board_info i2c1_devices[] = {
|
||||
|
|
|
|||
|
|
@ -816,6 +816,8 @@ static struct platform_device usbhs1_device = {
|
|||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &usbhs1_private.info,
|
||||
.dma_mask = &usbhs1_device.dev.coherent_dma_mask,
|
||||
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(usbhs1_resources),
|
||||
.resource = usbhs1_resources,
|
||||
|
|
@ -860,76 +862,6 @@ static struct platform_device leds_device = {
|
|||
|
||||
/* FSI */
|
||||
#define IRQ_FSI evt2irq(0x1840)
|
||||
static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (rate <= 0)
|
||||
return 0;
|
||||
|
||||
if (!enable) {
|
||||
clk_disable(clk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = clk_set_rate(clk, clk_round_rate(clk, rate));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return clk_enable(clk);
|
||||
}
|
||||
|
||||
static int fsi_b_set_rate(struct device *dev, int rate, int enable)
|
||||
{
|
||||
struct clk *fsib_clk;
|
||||
struct clk *fdiv_clk = &sh7372_fsidivb_clk;
|
||||
long fsib_rate = 0;
|
||||
long fdiv_rate = 0;
|
||||
int ackmd_bpfmd;
|
||||
int ret;
|
||||
|
||||
/* clock start */
|
||||
switch (rate) {
|
||||
case 44100:
|
||||
fsib_rate = rate * 256;
|
||||
ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
break;
|
||||
case 48000:
|
||||
fsib_rate = 85428000; /* around 48kHz x 256 x 7 */
|
||||
fdiv_rate = rate * 256;
|
||||
ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
|
||||
break;
|
||||
default:
|
||||
pr_err("unsupported rate in FSI2 port B\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* FSI B setting */
|
||||
fsib_clk = clk_get(dev, "ickb");
|
||||
if (IS_ERR(fsib_clk))
|
||||
return -EIO;
|
||||
|
||||
/* fsib */
|
||||
ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable);
|
||||
if (ret < 0)
|
||||
goto fsi_set_rate_end;
|
||||
|
||||
/* FSI DIV */
|
||||
ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable);
|
||||
if (ret < 0) {
|
||||
/* disable FSI B */
|
||||
if (enable)
|
||||
__fsi_set_round_rate(fsib_clk, fsib_rate, 0);
|
||||
goto fsi_set_rate_end;
|
||||
}
|
||||
|
||||
ret = ackmd_bpfmd;
|
||||
|
||||
fsi_set_rate_end:
|
||||
clk_put(fsib_clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct sh_fsi_platform_info fsi_info = {
|
||||
.port_a = {
|
||||
.flags = SH_FSI_BRS_INV,
|
||||
|
|
@ -940,8 +872,8 @@ static struct sh_fsi_platform_info fsi_info = {
|
|||
.flags = SH_FSI_BRS_INV |
|
||||
SH_FSI_BRM_INV |
|
||||
SH_FSI_LRS_INV |
|
||||
SH_FSI_CLK_CPG |
|
||||
SH_FSI_FMT_SPDIF,
|
||||
.set_rate = fsi_b_set_rate,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1651,7 +1583,12 @@ static void __init mackerel_init(void)
|
|||
pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
|
||||
}
|
||||
|
||||
MACHINE_START(MACKEREL, "mackerel")
|
||||
static const char *mackerel_boards_compat_dt[] __initdata = {
|
||||
"renesas,mackerel",
|
||||
NULL,
|
||||
};
|
||||
|
||||
DT_MACHINE_START(MACKEREL_DT, "mackerel")
|
||||
.map_io = sh7372_map_io,
|
||||
.init_early = sh7372_add_early_devices,
|
||||
.init_irq = sh7372_init_irq,
|
||||
|
|
@ -1659,4 +1596,5 @@ MACHINE_START(MACKEREL, "mackerel")
|
|||
.init_machine = mackerel_init,
|
||||
.init_late = sh7372_pm_init_late,
|
||||
.timer = &shmobile_timer,
|
||||
.dt_compat = mackerel_boards_compat_dt,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -30,8 +30,14 @@
|
|||
#include <linux/regulator/fixed.h>
|
||||
#include <linux/regulator/machine.h>
|
||||
#include <linux/smsc911x.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/sh_hspi.h>
|
||||
#include <linux/mmc/sh_mobile_sdhi.h>
|
||||
#include <linux/mfd/tmio.h>
|
||||
#include <linux/usb/otg.h>
|
||||
#include <linux/usb/ehci_pdriver.h>
|
||||
#include <linux/usb/ohci_pdriver.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/r8a7779.h>
|
||||
#include <mach/common.h>
|
||||
|
|
@ -126,12 +132,201 @@ static struct platform_device thermal_device = {
|
|||
.num_resources = ARRAY_SIZE(thermal_resources),
|
||||
};
|
||||
|
||||
/* HSPI */
|
||||
static struct resource hspi_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xFFFC7000,
|
||||
.end = 0xFFFC7018 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device hspi_device = {
|
||||
.name = "sh-hspi",
|
||||
.id = 0,
|
||||
.resource = hspi_resources,
|
||||
.num_resources = ARRAY_SIZE(hspi_resources),
|
||||
};
|
||||
|
||||
/* USB PHY */
|
||||
static struct resource usb_phy_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xffe70000,
|
||||
.end = 0xffe70900 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = 0xfff70000,
|
||||
.end = 0xfff70900 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device usb_phy_device = {
|
||||
.name = "rcar_usb_phy",
|
||||
.resource = usb_phy_resources,
|
||||
.num_resources = ARRAY_SIZE(usb_phy_resources),
|
||||
};
|
||||
|
||||
static struct platform_device *marzen_devices[] __initdata = {
|
||||
ð_device,
|
||||
&sdhi0_device,
|
||||
&thermal_device,
|
||||
&hspi_device,
|
||||
&usb_phy_device,
|
||||
};
|
||||
|
||||
/* USB */
|
||||
static struct usb_phy *phy;
|
||||
static int usb_power_on(struct platform_device *pdev)
|
||||
{
|
||||
if (!phy)
|
||||
return -EIO;
|
||||
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
|
||||
usb_phy_init(phy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void usb_power_off(struct platform_device *pdev)
|
||||
{
|
||||
if (!phy)
|
||||
return;
|
||||
|
||||
usb_phy_shutdown(phy);
|
||||
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
}
|
||||
|
||||
static struct usb_ehci_pdata ehcix_pdata = {
|
||||
.power_on = usb_power_on,
|
||||
.power_off = usb_power_off,
|
||||
.power_suspend = usb_power_off,
|
||||
};
|
||||
|
||||
static struct resource ehci0_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xffe70000,
|
||||
.end = 0xffe70400 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(44),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device ehci0_device = {
|
||||
.name = "ehci-platform",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = &ehci0_device.dev.coherent_dma_mask,
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
.platform_data = &ehcix_pdata,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(ehci0_resources),
|
||||
.resource = ehci0_resources,
|
||||
};
|
||||
|
||||
static struct resource ehci1_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xfff70000,
|
||||
.end = 0xfff70400 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(45),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device ehci1_device = {
|
||||
.name = "ehci-platform",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.dma_mask = &ehci1_device.dev.coherent_dma_mask,
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
.platform_data = &ehcix_pdata,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(ehci1_resources),
|
||||
.resource = ehci1_resources,
|
||||
};
|
||||
|
||||
static struct usb_ohci_pdata ohcix_pdata = {
|
||||
.power_on = usb_power_on,
|
||||
.power_off = usb_power_off,
|
||||
.power_suspend = usb_power_off,
|
||||
};
|
||||
|
||||
static struct resource ohci0_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xffe70400,
|
||||
.end = 0xffe70800 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(44),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device ohci0_device = {
|
||||
.name = "ohci-platform",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = &ohci0_device.dev.coherent_dma_mask,
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
.platform_data = &ohcix_pdata,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(ohci0_resources),
|
||||
.resource = ohci0_resources,
|
||||
};
|
||||
|
||||
static struct resource ohci1_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xfff70400,
|
||||
.end = 0xfff70800 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gic_spi(45),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device ohci1_device = {
|
||||
.name = "ohci-platform",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.dma_mask = &ohci1_device.dev.coherent_dma_mask,
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
.platform_data = &ohcix_pdata,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(ohci1_resources),
|
||||
.resource = ohci1_resources,
|
||||
};
|
||||
|
||||
static struct platform_device *marzen_late_devices[] __initdata = {
|
||||
&ehci0_device,
|
||||
&ehci1_device,
|
||||
&ohci0_device,
|
||||
&ohci1_device,
|
||||
};
|
||||
|
||||
void __init marzen_init_late(void)
|
||||
{
|
||||
/* get usb phy */
|
||||
phy = usb_get_phy(USB_PHY_TYPE_USB2);
|
||||
|
||||
shmobile_init_late();
|
||||
platform_add_devices(marzen_late_devices,
|
||||
ARRAY_SIZE(marzen_late_devices));
|
||||
}
|
||||
|
||||
static void __init marzen_init(void)
|
||||
{
|
||||
regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
|
||||
|
|
@ -163,6 +358,20 @@ static void __init marzen_init(void)
|
|||
gpio_request(GPIO_FN_SD0_CD, NULL);
|
||||
gpio_request(GPIO_FN_SD0_WP, NULL);
|
||||
|
||||
/* HSPI 0 */
|
||||
gpio_request(GPIO_FN_HSPI_CLK0, NULL);
|
||||
gpio_request(GPIO_FN_HSPI_CS0, NULL);
|
||||
gpio_request(GPIO_FN_HSPI_TX0, NULL);
|
||||
gpio_request(GPIO_FN_HSPI_RX0, NULL);
|
||||
|
||||
/* USB (CN21) */
|
||||
gpio_request(GPIO_FN_USB_OVC0, NULL);
|
||||
gpio_request(GPIO_FN_USB_OVC1, NULL);
|
||||
gpio_request(GPIO_FN_USB_OVC2, NULL);
|
||||
|
||||
/* USB (CN22) */
|
||||
gpio_request(GPIO_FN_USB_PENC2, NULL);
|
||||
|
||||
r8a7779_add_standard_devices();
|
||||
platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
|
||||
}
|
||||
|
|
@ -175,6 +384,6 @@ MACHINE_START(MARZEN, "marzen")
|
|||
.init_irq = r8a7779_init_irq,
|
||||
.handle_irq = gic_handle_irq,
|
||||
.init_machine = marzen_init,
|
||||
.init_late = shmobile_init_late,
|
||||
.init_late = marzen_init_late,
|
||||
.timer = &shmobile_timer,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@
|
|||
#define SMSTPCR3 IOMEM(0xe615013c)
|
||||
#define SMSTPCR4 IOMEM(0xe6150140)
|
||||
|
||||
#define FSIDIVA IOMEM(0xFE1F8000)
|
||||
#define FSIDIVB IOMEM(0xFE1F8008)
|
||||
|
||||
/* Fixed 32 KHz root clock from EXTALR pin */
|
||||
static struct clk extalr_clk = {
|
||||
.rate = 32768,
|
||||
|
|
@ -188,6 +191,22 @@ static struct clk pllc1_div2_clk = {
|
|||
};
|
||||
|
||||
/* USB clock */
|
||||
/*
|
||||
* USBCKCR is controlling usb24 clock
|
||||
* bit[7] : parent clock
|
||||
* bit[6] : clock divide rate
|
||||
* And this bit[7] is used as a "usb24s" from other devices.
|
||||
* (Video clock / Sub clock / SPU clock)
|
||||
* You can controll this clock as a below.
|
||||
*
|
||||
* struct clk *usb24 = clk_get(dev, "usb24");
|
||||
* struct clk *usb24s = clk_get(NULL, "usb24s");
|
||||
* struct clk *system = clk_get(NULL, "system_clk");
|
||||
* int rate = clk_get_rate(system);
|
||||
*
|
||||
* clk_set_parent(usb24s, system); // for bit[7]
|
||||
* clk_set_rate(usb24, rate / 2); // for bit[6]
|
||||
*/
|
||||
static struct clk *usb24s_parents[] = {
|
||||
[0] = &system_clk,
|
||||
[1] = &extal2_clk
|
||||
|
|
@ -427,6 +446,14 @@ static struct clk *late_main_clks[] = {
|
|||
&hdmi2_clk,
|
||||
};
|
||||
|
||||
/* FSI DIV */
|
||||
enum { FSIDIV_A, FSIDIV_B, FSIDIV_REPARENT_NR };
|
||||
|
||||
static struct clk fsidivs[] = {
|
||||
[FSIDIV_A] = SH_CLK_FSIDIV(FSIDIVA, &div6_reparent_clks[DIV6_FSIA]),
|
||||
[FSIDIV_B] = SH_CLK_FSIDIV(FSIDIVB, &div6_reparent_clks[DIV6_FSIB]),
|
||||
};
|
||||
|
||||
/* MSTP */
|
||||
enum {
|
||||
DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_HP,
|
||||
|
|
@ -596,6 +623,10 @@ static struct clk_lookup lookups[] = {
|
|||
|
||||
CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
|
||||
CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
|
||||
CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]),
|
||||
CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]),
|
||||
CLKDEV_ICK_ID("xcka", "sh_fsi2", &fsiack_clk),
|
||||
CLKDEV_ICK_ID("xckb", "sh_fsi2", &fsibck_clk),
|
||||
};
|
||||
|
||||
void __init r8a7740_clock_init(u8 md_ck)
|
||||
|
|
@ -641,6 +672,9 @@ void __init r8a7740_clock_init(u8 md_ck)
|
|||
for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
|
||||
ret = clk_register(late_main_clks[k]);
|
||||
|
||||
if (!ret)
|
||||
ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR);
|
||||
|
||||
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
||||
|
||||
if (!ret)
|
||||
|
|
|
|||
|
|
@ -87,8 +87,11 @@ static struct clk div4_clks[DIV4_NR] = {
|
|||
};
|
||||
|
||||
enum { MSTP323, MSTP322, MSTP321, MSTP320,
|
||||
MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
|
||||
MSTP101, MSTP100,
|
||||
MSTP030,
|
||||
MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
|
||||
MSTP016, MSTP015, MSTP014,
|
||||
MSTP007,
|
||||
MSTP_NR };
|
||||
|
||||
static struct clk mstp_clks[MSTP_NR] = {
|
||||
|
|
@ -96,6 +99,12 @@ static struct clk mstp_clks[MSTP_NR] = {
|
|||
[MSTP322] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 22, 0), /* SDHI1 */
|
||||
[MSTP321] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 21, 0), /* SDHI2 */
|
||||
[MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 20, 0), /* SDHI3 */
|
||||
[MSTP101] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 1, 0), /* USB2 */
|
||||
[MSTP100] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 0, 0), /* USB0/1 */
|
||||
[MSTP030] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 30, 0), /* I2C0 */
|
||||
[MSTP029] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 29, 0), /* I2C1 */
|
||||
[MSTP028] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 28, 0), /* I2C2 */
|
||||
[MSTP027] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 27, 0), /* I2C3 */
|
||||
[MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), /* SCIF0 */
|
||||
[MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), /* SCIF1 */
|
||||
[MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), /* SCIF2 */
|
||||
|
|
@ -105,6 +114,7 @@ static struct clk mstp_clks[MSTP_NR] = {
|
|||
[MSTP016] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 16, 0), /* TMU0 */
|
||||
[MSTP015] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0), /* TMU1 */
|
||||
[MSTP014] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 14, 0), /* TMU2 */
|
||||
[MSTP007] = SH_CLK_MSTP32(&div4_clks[DIV4_S], MSTPCR0, 7, 0), /* HSPI */
|
||||
};
|
||||
|
||||
static unsigned long mul4_recalc(struct clk *clk)
|
||||
|
|
@ -146,14 +156,25 @@ static struct clk_lookup lookups[] = {
|
|||
CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]),
|
||||
|
||||
/* MSTP32 clocks */
|
||||
CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */
|
||||
CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */
|
||||
CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
|
||||
CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
|
||||
CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
|
||||
CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */
|
||||
CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
|
||||
CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
|
||||
CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */
|
||||
CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */
|
||||
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
|
||||
CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
|
||||
CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
|
||||
CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
|
||||
CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
|
||||
CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
|
||||
CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
|
||||
CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
|
||||
CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */
|
||||
CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */
|
||||
CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */
|
||||
CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */
|
||||
|
|
|
|||
|
|
@ -1,355 +0,0 @@
|
|||
/*
|
||||
* SH7367 clock framework support
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
*
|
||||
* 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/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sh_clk.h>
|
||||
#include <linux/clkdev.h>
|
||||
#include <mach/common.h>
|
||||
|
||||
/* SH7367 registers */
|
||||
#define RTFRQCR IOMEM(0xe6150000)
|
||||
#define SYFRQCR IOMEM(0xe6150004)
|
||||
#define CMFRQCR IOMEM(0xe61500E0)
|
||||
#define VCLKCR1 IOMEM(0xe6150008)
|
||||
#define VCLKCR2 IOMEM(0xe615000C)
|
||||
#define VCLKCR3 IOMEM(0xe615001C)
|
||||
#define SCLKACR IOMEM(0xe6150010)
|
||||
#define SCLKBCR IOMEM(0xe6150014)
|
||||
#define SUBUSBCKCR IOMEM(0xe6158080)
|
||||
#define SPUCKCR IOMEM(0xe6150084)
|
||||
#define MSUCKCR IOMEM(0xe6150088)
|
||||
#define MVI3CKCR IOMEM(0xe6150090)
|
||||
#define VOUCKCR IOMEM(0xe6150094)
|
||||
#define MFCK1CR IOMEM(0xe6150098)
|
||||
#define MFCK2CR IOMEM(0xe615009C)
|
||||
#define PLLC1CR IOMEM(0xe6150028)
|
||||
#define PLLC2CR IOMEM(0xe615002C)
|
||||
#define RTMSTPCR0 IOMEM(0xe6158030)
|
||||
#define RTMSTPCR2 IOMEM(0xe6158038)
|
||||
#define SYMSTPCR0 IOMEM(0xe6158040)
|
||||
#define SYMSTPCR2 IOMEM(0xe6158048)
|
||||
#define CMMSTPCR0 IOMEM(0xe615804c)
|
||||
|
||||
/* Fixed 32 KHz root clock from EXTALR pin */
|
||||
static struct clk r_clk = {
|
||||
.rate = 32768,
|
||||
};
|
||||
|
||||
/*
|
||||
* 26MHz default rate for the EXTALB1 root input clock.
|
||||
* If needed, reset this with clk_set_rate() from the platform code.
|
||||
*/
|
||||
struct clk sh7367_extalb1_clk = {
|
||||
.rate = 26666666,
|
||||
};
|
||||
|
||||
/*
|
||||
* 48MHz default rate for the EXTAL2 root input clock.
|
||||
* If needed, reset this with clk_set_rate() from the platform code.
|
||||
*/
|
||||
struct clk sh7367_extal2_clk = {
|
||||
.rate = 48000000,
|
||||
};
|
||||
|
||||
/* A fixed divide-by-2 block */
|
||||
static unsigned long div2_recalc(struct clk *clk)
|
||||
{
|
||||
return clk->parent->rate / 2;
|
||||
}
|
||||
|
||||
static struct sh_clk_ops div2_clk_ops = {
|
||||
.recalc = div2_recalc,
|
||||
};
|
||||
|
||||
/* Divide extalb1 by two */
|
||||
static struct clk extalb1_div2_clk = {
|
||||
.ops = &div2_clk_ops,
|
||||
.parent = &sh7367_extalb1_clk,
|
||||
};
|
||||
|
||||
/* Divide extal2 by two */
|
||||
static struct clk extal2_div2_clk = {
|
||||
.ops = &div2_clk_ops,
|
||||
.parent = &sh7367_extal2_clk,
|
||||
};
|
||||
|
||||
/* PLLC1 */
|
||||
static unsigned long pllc1_recalc(struct clk *clk)
|
||||
{
|
||||
unsigned long mult = 1;
|
||||
|
||||
if (__raw_readl(PLLC1CR) & (1 << 14))
|
||||
mult = (((__raw_readl(RTFRQCR) >> 24) & 0x3f) + 1) * 2;
|
||||
|
||||
return clk->parent->rate * mult;
|
||||
}
|
||||
|
||||
static struct sh_clk_ops pllc1_clk_ops = {
|
||||
.recalc = pllc1_recalc,
|
||||
};
|
||||
|
||||
static struct clk pllc1_clk = {
|
||||
.ops = &pllc1_clk_ops,
|
||||
.flags = CLK_ENABLE_ON_INIT,
|
||||
.parent = &extalb1_div2_clk,
|
||||
};
|
||||
|
||||
/* Divide PLLC1 by two */
|
||||
static struct clk pllc1_div2_clk = {
|
||||
.ops = &div2_clk_ops,
|
||||
.parent = &pllc1_clk,
|
||||
};
|
||||
|
||||
/* PLLC2 */
|
||||
static unsigned long pllc2_recalc(struct clk *clk)
|
||||
{
|
||||
unsigned long mult = 1;
|
||||
|
||||
if (__raw_readl(PLLC2CR) & (1 << 31))
|
||||
mult = (((__raw_readl(PLLC2CR) >> 24) & 0x3f) + 1) * 2;
|
||||
|
||||
return clk->parent->rate * mult;
|
||||
}
|
||||
|
||||
static struct sh_clk_ops pllc2_clk_ops = {
|
||||
.recalc = pllc2_recalc,
|
||||
};
|
||||
|
||||
static struct clk pllc2_clk = {
|
||||
.ops = &pllc2_clk_ops,
|
||||
.flags = CLK_ENABLE_ON_INIT,
|
||||
.parent = &extalb1_div2_clk,
|
||||
};
|
||||
|
||||
static struct clk *main_clks[] = {
|
||||
&r_clk,
|
||||
&sh7367_extalb1_clk,
|
||||
&sh7367_extal2_clk,
|
||||
&extalb1_div2_clk,
|
||||
&extal2_div2_clk,
|
||||
&pllc1_clk,
|
||||
&pllc1_div2_clk,
|
||||
&pllc2_clk,
|
||||
};
|
||||
|
||||
static void div4_kick(struct clk *clk)
|
||||
{
|
||||
unsigned long value;
|
||||
|
||||
/* set KICK bit in SYFRQCR to update hardware setting */
|
||||
value = __raw_readl(SYFRQCR);
|
||||
value |= (1 << 31);
|
||||
__raw_writel(value, SYFRQCR);
|
||||
}
|
||||
|
||||
static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
|
||||
24, 32, 36, 48, 0, 72, 0, 0 };
|
||||
|
||||
static struct clk_div_mult_table div4_div_mult_table = {
|
||||
.divisors = divisors,
|
||||
.nr_divisors = ARRAY_SIZE(divisors),
|
||||
};
|
||||
|
||||
static struct clk_div4_table div4_table = {
|
||||
.div_mult_table = &div4_div_mult_table,
|
||||
.kick = div4_kick,
|
||||
};
|
||||
|
||||
enum { DIV4_I, DIV4_G, DIV4_S, DIV4_B,
|
||||
DIV4_ZX, DIV4_ZT, DIV4_Z, DIV4_ZD, DIV4_HP,
|
||||
DIV4_ZS, DIV4_ZB, DIV4_ZB3, DIV4_CP, DIV4_NR };
|
||||
|
||||
#define DIV4(_reg, _bit, _mask, _flags) \
|
||||
SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags)
|
||||
|
||||
static struct clk div4_clks[DIV4_NR] = {
|
||||
[DIV4_I] = DIV4(RTFRQCR, 20, 0x6fff, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_G] = DIV4(RTFRQCR, 16, 0x6fff, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_S] = DIV4(RTFRQCR, 12, 0x6fff, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_B] = DIV4(RTFRQCR, 8, 0x6fff, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_ZX] = DIV4(SYFRQCR, 20, 0x6fff, 0),
|
||||
[DIV4_ZT] = DIV4(SYFRQCR, 16, 0x6fff, 0),
|
||||
[DIV4_Z] = DIV4(SYFRQCR, 12, 0x6fff, 0),
|
||||
[DIV4_ZD] = DIV4(SYFRQCR, 8, 0x6fff, 0),
|
||||
[DIV4_HP] = DIV4(SYFRQCR, 4, 0x6fff, 0),
|
||||
[DIV4_ZS] = DIV4(CMFRQCR, 12, 0x6fff, 0),
|
||||
[DIV4_ZB] = DIV4(CMFRQCR, 8, 0x6fff, 0),
|
||||
[DIV4_ZB3] = DIV4(CMFRQCR, 4, 0x6fff, 0),
|
||||
[DIV4_CP] = DIV4(CMFRQCR, 0, 0x6fff, 0),
|
||||
};
|
||||
|
||||
enum { DIV6_SUB, DIV6_SIUA, DIV6_SIUB, DIV6_MSU, DIV6_SPU,
|
||||
DIV6_MVI3, DIV6_MF1, DIV6_MF2,
|
||||
DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_VOU,
|
||||
DIV6_NR };
|
||||
|
||||
static struct clk div6_clks[DIV6_NR] = {
|
||||
[DIV6_SUB] = SH_CLK_DIV6(&sh7367_extal2_clk, SUBUSBCKCR, 0),
|
||||
[DIV6_SIUA] = SH_CLK_DIV6(&pllc1_div2_clk, SCLKACR, 0),
|
||||
[DIV6_SIUB] = SH_CLK_DIV6(&pllc1_div2_clk, SCLKBCR, 0),
|
||||
[DIV6_MSU] = SH_CLK_DIV6(&pllc1_div2_clk, MSUCKCR, 0),
|
||||
[DIV6_SPU] = SH_CLK_DIV6(&pllc1_div2_clk, SPUCKCR, 0),
|
||||
[DIV6_MVI3] = SH_CLK_DIV6(&pllc1_div2_clk, MVI3CKCR, 0),
|
||||
[DIV6_MF1] = SH_CLK_DIV6(&pllc1_div2_clk, MFCK1CR, 0),
|
||||
[DIV6_MF2] = SH_CLK_DIV6(&pllc1_div2_clk, MFCK2CR, 0),
|
||||
[DIV6_VCK1] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR1, 0),
|
||||
[DIV6_VCK2] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR2, 0),
|
||||
[DIV6_VCK3] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR3, 0),
|
||||
[DIV6_VOU] = SH_CLK_DIV6(&pllc1_div2_clk, VOUCKCR, 0),
|
||||
};
|
||||
|
||||
enum { RTMSTP001,
|
||||
RTMSTP231, RTMSTP230, RTMSTP229, RTMSTP228, RTMSTP226,
|
||||
RTMSTP216, RTMSTP206, RTMSTP205, RTMSTP201,
|
||||
SYMSTP023, SYMSTP007, SYMSTP006, SYMSTP004,
|
||||
SYMSTP003, SYMSTP002, SYMSTP001, SYMSTP000,
|
||||
SYMSTP231, SYMSTP229, SYMSTP225, SYMSTP223, SYMSTP222,
|
||||
SYMSTP215, SYMSTP214, SYMSTP213, SYMSTP211,
|
||||
CMMSTP003,
|
||||
MSTP_NR };
|
||||
|
||||
#define MSTP(_parent, _reg, _bit, _flags) \
|
||||
SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
|
||||
|
||||
static struct clk mstp_clks[MSTP_NR] = {
|
||||
[RTMSTP001] = MSTP(&div6_clks[DIV6_SUB], RTMSTPCR0, 1, 0), /* IIC2 */
|
||||
[RTMSTP231] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 31, 0), /* VEU3 */
|
||||
[RTMSTP230] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 30, 0), /* VEU2 */
|
||||
[RTMSTP229] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 29, 0), /* VEU1 */
|
||||
[RTMSTP228] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 28, 0), /* VEU0 */
|
||||
[RTMSTP226] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 26, 0), /* VEU2H */
|
||||
[RTMSTP216] = MSTP(&div6_clks[DIV6_SUB], RTMSTPCR2, 16, 0), /* IIC0 */
|
||||
[RTMSTP206] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 6, 0), /* JPU */
|
||||
[RTMSTP205] = MSTP(&div6_clks[DIV6_VOU], RTMSTPCR2, 5, 0), /* VOU */
|
||||
[RTMSTP201] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 1, 0), /* VPU */
|
||||
[SYMSTP023] = MSTP(&div6_clks[DIV6_SPU], SYMSTPCR0, 23, 0), /* SPU1 */
|
||||
[SYMSTP007] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 7, 0), /* SCIFA5 */
|
||||
[SYMSTP006] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 6, 0), /* SCIFB */
|
||||
[SYMSTP004] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 4, 0), /* SCIFA0 */
|
||||
[SYMSTP003] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 3, 0), /* SCIFA1 */
|
||||
[SYMSTP002] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 2, 0), /* SCIFA2 */
|
||||
[SYMSTP001] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 1, 0), /* SCIFA3 */
|
||||
[SYMSTP000] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 0, 0), /* SCIFA4 */
|
||||
[SYMSTP231] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR2, 31, 0), /* SIU */
|
||||
[SYMSTP229] = MSTP(&r_clk, SYMSTPCR2, 29, 0), /* CMT10 */
|
||||
[SYMSTP225] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR2, 25, 0), /* IRDA */
|
||||
[SYMSTP223] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR2, 23, 0), /* IIC1 */
|
||||
[SYMSTP222] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR2, 22, 0), /* USBHS */
|
||||
[SYMSTP215] = MSTP(&div4_clks[DIV4_HP], SYMSTPCR2, 15, 0), /* FLCTL */
|
||||
[SYMSTP214] = MSTP(&div4_clks[DIV4_HP], SYMSTPCR2, 14, 0), /* SDHI0 */
|
||||
[SYMSTP213] = MSTP(&div4_clks[DIV4_HP], SYMSTPCR2, 13, 0), /* SDHI1 */
|
||||
[SYMSTP211] = MSTP(&div4_clks[DIV4_HP], SYMSTPCR2, 11, 0), /* SDHI2 */
|
||||
[CMMSTP003] = MSTP(&r_clk, CMMSTPCR0, 3, 0), /* KEYSC */
|
||||
};
|
||||
|
||||
static struct clk_lookup lookups[] = {
|
||||
/* main clocks */
|
||||
CLKDEV_CON_ID("r_clk", &r_clk),
|
||||
CLKDEV_CON_ID("extalb1", &sh7367_extalb1_clk),
|
||||
CLKDEV_CON_ID("extal2", &sh7367_extal2_clk),
|
||||
CLKDEV_CON_ID("extalb1_div2_clk", &extalb1_div2_clk),
|
||||
CLKDEV_CON_ID("extal2_div2_clk", &extal2_div2_clk),
|
||||
CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
|
||||
CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
|
||||
CLKDEV_CON_ID("pllc2_clk", &pllc2_clk),
|
||||
|
||||
/* DIV4 clocks */
|
||||
CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
|
||||
CLKDEV_CON_ID("g_clk", &div4_clks[DIV4_G]),
|
||||
CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]),
|
||||
CLKDEV_CON_ID("zx_clk", &div4_clks[DIV4_ZX]),
|
||||
CLKDEV_CON_ID("zt_clk", &div4_clks[DIV4_ZT]),
|
||||
CLKDEV_CON_ID("z_clk", &div4_clks[DIV4_Z]),
|
||||
CLKDEV_CON_ID("zd_clk", &div4_clks[DIV4_ZD]),
|
||||
CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]),
|
||||
CLKDEV_CON_ID("zs_clk", &div4_clks[DIV4_ZS]),
|
||||
CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]),
|
||||
CLKDEV_CON_ID("zb3_clk", &div4_clks[DIV4_ZB3]),
|
||||
CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]),
|
||||
|
||||
/* DIV6 clocks */
|
||||
CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]),
|
||||
CLKDEV_CON_ID("siua_clk", &div6_clks[DIV6_SIUA]),
|
||||
CLKDEV_CON_ID("siub_clk", &div6_clks[DIV6_SIUB]),
|
||||
CLKDEV_CON_ID("msu_clk", &div6_clks[DIV6_MSU]),
|
||||
CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]),
|
||||
CLKDEV_CON_ID("mvi3_clk", &div6_clks[DIV6_MVI3]),
|
||||
CLKDEV_CON_ID("mf1_clk", &div6_clks[DIV6_MF1]),
|
||||
CLKDEV_CON_ID("mf2_clk", &div6_clks[DIV6_MF2]),
|
||||
CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]),
|
||||
CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]),
|
||||
CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]),
|
||||
CLKDEV_CON_ID("vou_clk", &div6_clks[DIV6_VOU]),
|
||||
|
||||
/* MSTP32 clocks */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[RTMSTP001]), /* IIC2 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[RTMSTP231]), /* VEU3 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[RTMSTP230]), /* VEU2 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[RTMSTP229]), /* VEU1 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[RTMSTP228]), /* VEU0 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[RTMSTP226]), /* VEU2H */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[RTMSTP216]), /* IIC0 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[RTMSTP206]), /* JPU */
|
||||
CLKDEV_DEV_ID("sh-vou", &mstp_clks[RTMSTP205]), /* VOU */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[RTMSTP201]), /* VPU */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[SYMSTP023]), /* SPU1 */
|
||||
CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[SYMSTP007]), /* SCIFA5 */
|
||||
CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[SYMSTP006]), /* SCIFB */
|
||||
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[SYMSTP004]), /* SCIFA0 */
|
||||
CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[SYMSTP003]), /* SCIFA1 */
|
||||
CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[SYMSTP002]), /* SCIFA2 */
|
||||
CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[SYMSTP001]), /* SCIFA3 */
|
||||
CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[SYMSTP000]), /* SCIFA4 */
|
||||
CLKDEV_DEV_ID("sh_siu", &mstp_clks[SYMSTP231]), /* SIU */
|
||||
CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[SYMSTP229]), /* CMT10 */
|
||||
CLKDEV_DEV_ID("sh_irda", &mstp_clks[SYMSTP225]), /* IRDA */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[SYMSTP223]), /* IIC1 */
|
||||
CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[SYMSTP222]), /* USBHS */
|
||||
CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[SYMSTP222]), /* USBHS */
|
||||
CLKDEV_DEV_ID("sh_flctl", &mstp_clks[SYMSTP215]), /* FLCTL */
|
||||
CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[SYMSTP214]), /* SDHI0 */
|
||||
CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[SYMSTP213]), /* SDHI1 */
|
||||
CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[SYMSTP211]), /* SDHI2 */
|
||||
CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[CMMSTP003]), /* KEYSC */
|
||||
};
|
||||
|
||||
void __init sh7367_clock_init(void)
|
||||
{
|
||||
int k, ret = 0;
|
||||
|
||||
for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
|
||||
ret = clk_register(main_clks[k]);
|
||||
|
||||
if (!ret)
|
||||
ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
|
||||
|
||||
if (!ret)
|
||||
ret = sh_clk_div6_register(div6_clks, DIV6_NR);
|
||||
|
||||
if (!ret)
|
||||
ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
|
||||
|
||||
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
||||
|
||||
if (!ret)
|
||||
shmobile_clk_init();
|
||||
else
|
||||
panic("failed to setup sh7367 clocks\n");
|
||||
}
|
||||
|
|
@ -420,87 +420,11 @@ static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
|
|||
};
|
||||
|
||||
/* FSI DIV */
|
||||
static unsigned long fsidiv_recalc(struct clk *clk)
|
||||
{
|
||||
unsigned long value;
|
||||
enum { FSIDIV_A, FSIDIV_B, FSIDIV_REPARENT_NR };
|
||||
|
||||
value = __raw_readl(clk->mapping->base);
|
||||
|
||||
value >>= 16;
|
||||
if (value < 2)
|
||||
return 0;
|
||||
|
||||
return clk->parent->rate / value;
|
||||
}
|
||||
|
||||
static long fsidiv_round_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
return clk_rate_div_range_round(clk, 2, 0xffff, rate);
|
||||
}
|
||||
|
||||
static void fsidiv_disable(struct clk *clk)
|
||||
{
|
||||
__raw_writel(0, clk->mapping->base);
|
||||
}
|
||||
|
||||
static int fsidiv_enable(struct clk *clk)
|
||||
{
|
||||
unsigned long value;
|
||||
|
||||
value = __raw_readl(clk->mapping->base) >> 16;
|
||||
if (value < 2)
|
||||
return -EIO;
|
||||
|
||||
__raw_writel((value << 16) | 0x3, clk->mapping->base);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fsidiv_set_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
int idx;
|
||||
|
||||
idx = (clk->parent->rate / rate) & 0xffff;
|
||||
if (idx < 2)
|
||||
return -EINVAL;
|
||||
|
||||
__raw_writel(idx << 16, clk->mapping->base);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct sh_clk_ops fsidiv_clk_ops = {
|
||||
.recalc = fsidiv_recalc,
|
||||
.round_rate = fsidiv_round_rate,
|
||||
.set_rate = fsidiv_set_rate,
|
||||
.enable = fsidiv_enable,
|
||||
.disable = fsidiv_disable,
|
||||
};
|
||||
|
||||
static struct clk_mapping fsidiva_clk_mapping = {
|
||||
.phys = FSIDIVA,
|
||||
.len = 8,
|
||||
};
|
||||
|
||||
struct clk sh7372_fsidiva_clk = {
|
||||
.ops = &fsidiv_clk_ops,
|
||||
.parent = &div6_reparent_clks[DIV6_FSIA], /* late install */
|
||||
.mapping = &fsidiva_clk_mapping,
|
||||
};
|
||||
|
||||
static struct clk_mapping fsidivb_clk_mapping = {
|
||||
.phys = FSIDIVB,
|
||||
.len = 8,
|
||||
};
|
||||
|
||||
struct clk sh7372_fsidivb_clk = {
|
||||
.ops = &fsidiv_clk_ops,
|
||||
.parent = &div6_reparent_clks[DIV6_FSIB], /* late install */
|
||||
.mapping = &fsidivb_clk_mapping,
|
||||
};
|
||||
|
||||
static struct clk *late_main_clks[] = {
|
||||
&sh7372_fsidiva_clk,
|
||||
&sh7372_fsidivb_clk,
|
||||
static struct clk fsidivs[] = {
|
||||
[FSIDIV_A] = SH_CLK_FSIDIV(FSIDIVA, &div6_reparent_clks[DIV6_FSIA]),
|
||||
[FSIDIV_B] = SH_CLK_FSIDIV(FSIDIVB, &div6_reparent_clks[DIV6_FSIB]),
|
||||
};
|
||||
|
||||
enum { MSTP001, MSTP000,
|
||||
|
|
@ -583,6 +507,8 @@ static struct clk_lookup lookups[] = {
|
|||
CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
|
||||
CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
|
||||
CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk),
|
||||
CLKDEV_CON_ID("fsidiva", &fsidivs[FSIDIV_A]),
|
||||
CLKDEV_CON_ID("fsidivb", &fsidivs[FSIDIV_B]),
|
||||
|
||||
/* DIV4 clocks */
|
||||
CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
|
||||
|
|
@ -678,6 +604,10 @@ static struct clk_lookup lookups[] = {
|
|||
CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
|
||||
CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
|
||||
CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]),
|
||||
CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]),
|
||||
CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]),
|
||||
CLKDEV_ICK_ID("xcka", "sh_fsi2", &sh7372_fsiack_clk),
|
||||
CLKDEV_ICK_ID("xckb", "sh_fsi2", &sh7372_fsibck_clk),
|
||||
};
|
||||
|
||||
void __init sh7372_clock_init(void)
|
||||
|
|
@ -706,8 +636,8 @@ void __init sh7372_clock_init(void)
|
|||
if (!ret)
|
||||
ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
|
||||
|
||||
for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
|
||||
ret = clk_register(late_main_clks[k]);
|
||||
if (!ret)
|
||||
ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR);
|
||||
|
||||
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,366 +0,0 @@
|
|||
/*
|
||||
* SH7377 clock framework support
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
*
|
||||
* 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; either 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sh_clk.h>
|
||||
#include <linux/clkdev.h>
|
||||
#include <mach/common.h>
|
||||
|
||||
/* SH7377 registers */
|
||||
#define RTFRQCR IOMEM(0xe6150000)
|
||||
#define SYFRQCR IOMEM(0xe6150004)
|
||||
#define CMFRQCR IOMEM(0xe61500E0)
|
||||
#define VCLKCR1 IOMEM(0xe6150008)
|
||||
#define VCLKCR2 IOMEM(0xe615000C)
|
||||
#define VCLKCR3 IOMEM(0xe615001C)
|
||||
#define FMSICKCR IOMEM(0xe6150010)
|
||||
#define FMSOCKCR IOMEM(0xe6150014)
|
||||
#define FSICKCR IOMEM(0xe6150018)
|
||||
#define PLLC1CR IOMEM(0xe6150028)
|
||||
#define PLLC2CR IOMEM(0xe615002C)
|
||||
#define SUBUSBCKCR IOMEM(0xe6150080)
|
||||
#define SPUCKCR IOMEM(0xe6150084)
|
||||
#define MSUCKCR IOMEM(0xe6150088)
|
||||
#define MVI3CKCR IOMEM(0xe6150090)
|
||||
#define HDMICKCR IOMEM(0xe6150094)
|
||||
#define MFCK1CR IOMEM(0xe6150098)
|
||||
#define MFCK2CR IOMEM(0xe615009C)
|
||||
#define DSITCKCR IOMEM(0xe6150060)
|
||||
#define DSIPCKCR IOMEM(0xe6150064)
|
||||
#define SMSTPCR0 IOMEM(0xe6150130)
|
||||
#define SMSTPCR1 IOMEM(0xe6150134)
|
||||
#define SMSTPCR2 IOMEM(0xe6150138)
|
||||
#define SMSTPCR3 IOMEM(0xe615013C)
|
||||
#define SMSTPCR4 IOMEM(0xe6150140)
|
||||
|
||||
/* Fixed 32 KHz root clock from EXTALR pin */
|
||||
static struct clk r_clk = {
|
||||
.rate = 32768,
|
||||
};
|
||||
|
||||
/*
|
||||
* 26MHz default rate for the EXTALC1 root input clock.
|
||||
* If needed, reset this with clk_set_rate() from the platform code.
|
||||
*/
|
||||
struct clk sh7377_extalc1_clk = {
|
||||
.rate = 26666666,
|
||||
};
|
||||
|
||||
/*
|
||||
* 48MHz default rate for the EXTAL2 root input clock.
|
||||
* If needed, reset this with clk_set_rate() from the platform code.
|
||||
*/
|
||||
struct clk sh7377_extal2_clk = {
|
||||
.rate = 48000000,
|
||||
};
|
||||
|
||||
/* A fixed divide-by-2 block */
|
||||
static unsigned long div2_recalc(struct clk *clk)
|
||||
{
|
||||
return clk->parent->rate / 2;
|
||||
}
|
||||
|
||||
static struct sh_clk_ops div2_clk_ops = {
|
||||
.recalc = div2_recalc,
|
||||
};
|
||||
|
||||
/* Divide extalc1 by two */
|
||||
static struct clk extalc1_div2_clk = {
|
||||
.ops = &div2_clk_ops,
|
||||
.parent = &sh7377_extalc1_clk,
|
||||
};
|
||||
|
||||
/* Divide extal2 by two */
|
||||
static struct clk extal2_div2_clk = {
|
||||
.ops = &div2_clk_ops,
|
||||
.parent = &sh7377_extal2_clk,
|
||||
};
|
||||
|
||||
/* Divide extal2 by four */
|
||||
static struct clk extal2_div4_clk = {
|
||||
.ops = &div2_clk_ops,
|
||||
.parent = &extal2_div2_clk,
|
||||
};
|
||||
|
||||
/* PLLC1 */
|
||||
static unsigned long pllc1_recalc(struct clk *clk)
|
||||
{
|
||||
unsigned long mult = 1;
|
||||
|
||||
if (__raw_readl(PLLC1CR) & (1 << 14))
|
||||
mult = (((__raw_readl(RTFRQCR) >> 24) & 0x3f) + 1) * 2;
|
||||
|
||||
return clk->parent->rate * mult;
|
||||
}
|
||||
|
||||
static struct sh_clk_ops pllc1_clk_ops = {
|
||||
.recalc = pllc1_recalc,
|
||||
};
|
||||
|
||||
static struct clk pllc1_clk = {
|
||||
.ops = &pllc1_clk_ops,
|
||||
.flags = CLK_ENABLE_ON_INIT,
|
||||
.parent = &extalc1_div2_clk,
|
||||
};
|
||||
|
||||
/* Divide PLLC1 by two */
|
||||
static struct clk pllc1_div2_clk = {
|
||||
.ops = &div2_clk_ops,
|
||||
.parent = &pllc1_clk,
|
||||
};
|
||||
|
||||
/* PLLC2 */
|
||||
static unsigned long pllc2_recalc(struct clk *clk)
|
||||
{
|
||||
unsigned long mult = 1;
|
||||
|
||||
if (__raw_readl(PLLC2CR) & (1 << 31))
|
||||
mult = (((__raw_readl(PLLC2CR) >> 24) & 0x3f) + 1) * 2;
|
||||
|
||||
return clk->parent->rate * mult;
|
||||
}
|
||||
|
||||
static struct sh_clk_ops pllc2_clk_ops = {
|
||||
.recalc = pllc2_recalc,
|
||||
};
|
||||
|
||||
static struct clk pllc2_clk = {
|
||||
.ops = &pllc2_clk_ops,
|
||||
.flags = CLK_ENABLE_ON_INIT,
|
||||
.parent = &extalc1_div2_clk,
|
||||
};
|
||||
|
||||
static struct clk *main_clks[] = {
|
||||
&r_clk,
|
||||
&sh7377_extalc1_clk,
|
||||
&sh7377_extal2_clk,
|
||||
&extalc1_div2_clk,
|
||||
&extal2_div2_clk,
|
||||
&extal2_div4_clk,
|
||||
&pllc1_clk,
|
||||
&pllc1_div2_clk,
|
||||
&pllc2_clk,
|
||||
};
|
||||
|
||||
static void div4_kick(struct clk *clk)
|
||||
{
|
||||
unsigned long value;
|
||||
|
||||
/* set KICK bit in SYFRQCR to update hardware setting */
|
||||
value = __raw_readl(SYFRQCR);
|
||||
value |= (1 << 31);
|
||||
__raw_writel(value, SYFRQCR);
|
||||
}
|
||||
|
||||
static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
|
||||
24, 32, 36, 48, 0, 72, 96, 0 };
|
||||
|
||||
static struct clk_div_mult_table div4_div_mult_table = {
|
||||
.divisors = divisors,
|
||||
.nr_divisors = ARRAY_SIZE(divisors),
|
||||
};
|
||||
|
||||
static struct clk_div4_table div4_table = {
|
||||
.div_mult_table = &div4_div_mult_table,
|
||||
.kick = div4_kick,
|
||||
};
|
||||
|
||||
enum { DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_CSIR,
|
||||
DIV4_ZTR, DIV4_ZT, DIV4_Z, DIV4_HP,
|
||||
DIV4_ZS, DIV4_ZB, DIV4_ZB3, DIV4_CP, DIV4_NR };
|
||||
|
||||
#define DIV4(_reg, _bit, _mask, _flags) \
|
||||
SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags)
|
||||
|
||||
static struct clk div4_clks[DIV4_NR] = {
|
||||
[DIV4_I] = DIV4(RTFRQCR, 20, 0x6fff, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_ZG] = DIV4(RTFRQCR, 16, 0x6fff, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_B] = DIV4(RTFRQCR, 8, 0x6fff, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_M1] = DIV4(RTFRQCR, 4, 0x6fff, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_CSIR] = DIV4(RTFRQCR, 0, 0x6fff, 0),
|
||||
[DIV4_ZTR] = DIV4(SYFRQCR, 20, 0x6fff, 0),
|
||||
[DIV4_ZT] = DIV4(SYFRQCR, 16, 0x6fff, 0),
|
||||
[DIV4_Z] = DIV4(SYFRQCR, 12, 0x6fff, 0),
|
||||
[DIV4_HP] = DIV4(SYFRQCR, 4, 0x6fff, 0),
|
||||
[DIV4_ZS] = DIV4(CMFRQCR, 12, 0x6fff, 0),
|
||||
[DIV4_ZB] = DIV4(CMFRQCR, 8, 0x6fff, 0),
|
||||
[DIV4_ZB3] = DIV4(CMFRQCR, 4, 0x6fff, 0),
|
||||
[DIV4_CP] = DIV4(CMFRQCR, 0, 0x6fff, 0),
|
||||
};
|
||||
|
||||
enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_FMSI, DIV6_FMSO,
|
||||
DIV6_FSI, DIV6_SUB, DIV6_SPU, DIV6_MSU, DIV6_MVI3, DIV6_HDMI,
|
||||
DIV6_MF1, DIV6_MF2, DIV6_DSIT, DIV6_DSIP,
|
||||
DIV6_NR };
|
||||
|
||||
static struct clk div6_clks[] = {
|
||||
[DIV6_VCK1] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR1, 0),
|
||||
[DIV6_VCK2] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR2, 0),
|
||||
[DIV6_VCK3] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR3, 0),
|
||||
[DIV6_FMSI] = SH_CLK_DIV6(&pllc1_div2_clk, FMSICKCR, 0),
|
||||
[DIV6_FMSO] = SH_CLK_DIV6(&pllc1_div2_clk, FMSOCKCR, 0),
|
||||
[DIV6_FSI] = SH_CLK_DIV6(&pllc1_div2_clk, FSICKCR, 0),
|
||||
[DIV6_SUB] = SH_CLK_DIV6(&sh7377_extal2_clk, SUBUSBCKCR, 0),
|
||||
[DIV6_SPU] = SH_CLK_DIV6(&pllc1_div2_clk, SPUCKCR, 0),
|
||||
[DIV6_MSU] = SH_CLK_DIV6(&pllc1_div2_clk, MSUCKCR, 0),
|
||||
[DIV6_MVI3] = SH_CLK_DIV6(&pllc1_div2_clk, MVI3CKCR, 0),
|
||||
[DIV6_HDMI] = SH_CLK_DIV6(&pllc1_div2_clk, HDMICKCR, 0),
|
||||
[DIV6_MF1] = SH_CLK_DIV6(&pllc1_div2_clk, MFCK1CR, 0),
|
||||
[DIV6_MF2] = SH_CLK_DIV6(&pllc1_div2_clk, MFCK2CR, 0),
|
||||
[DIV6_DSIT] = SH_CLK_DIV6(&pllc1_div2_clk, DSITCKCR, 0),
|
||||
[DIV6_DSIP] = SH_CLK_DIV6(&pllc1_div2_clk, DSIPCKCR, 0),
|
||||
};
|
||||
|
||||
enum { MSTP001,
|
||||
MSTP131, MSTP130, MSTP129, MSTP128, MSTP116, MSTP106, MSTP101,
|
||||
MSTP223, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
|
||||
MSTP331, MSTP329, MSTP325, MSTP323, MSTP322,
|
||||
MSTP315, MSTP314, MSTP313,
|
||||
MSTP403,
|
||||
MSTP_NR };
|
||||
|
||||
#define MSTP(_parent, _reg, _bit, _flags) \
|
||||
SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
|
||||
|
||||
static struct clk mstp_clks[] = {
|
||||
[MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */
|
||||
[MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */
|
||||
[MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */
|
||||
[MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */
|
||||
[MSTP128] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 28, 0), /* VEU0 */
|
||||
[MSTP116] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 16, 0), /* IIC0 */
|
||||
[MSTP106] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 6, 0), /* JPU */
|
||||
[MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */
|
||||
[MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */
|
||||
[MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
|
||||
[MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
|
||||
[MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
|
||||
[MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */
|
||||
[MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */
|
||||
[MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */
|
||||
[MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
|
||||
[MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */
|
||||
[MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
|
||||
[MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IRDA */
|
||||
[MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
|
||||
[MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */
|
||||
[MSTP315] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 15, 0), /* FLCTL */
|
||||
[MSTP314] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
|
||||
[MSTP313] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */
|
||||
[MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
|
||||
};
|
||||
|
||||
static struct clk_lookup lookups[] = {
|
||||
/* main clocks */
|
||||
CLKDEV_CON_ID("r_clk", &r_clk),
|
||||
CLKDEV_CON_ID("extalc1", &sh7377_extalc1_clk),
|
||||
CLKDEV_CON_ID("extal2", &sh7377_extal2_clk),
|
||||
CLKDEV_CON_ID("extalc1_div2_clk", &extalc1_div2_clk),
|
||||
CLKDEV_CON_ID("extal2_div2_clk", &extal2_div2_clk),
|
||||
CLKDEV_CON_ID("extal2_div4_clk", &extal2_div4_clk),
|
||||
CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
|
||||
CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
|
||||
CLKDEV_CON_ID("pllc2_clk", &pllc2_clk),
|
||||
|
||||
/* DIV4 clocks */
|
||||
CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
|
||||
CLKDEV_CON_ID("zg_clk", &div4_clks[DIV4_ZG]),
|
||||
CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]),
|
||||
CLKDEV_CON_ID("m1_clk", &div4_clks[DIV4_M1]),
|
||||
CLKDEV_CON_ID("csir_clk", &div4_clks[DIV4_CSIR]),
|
||||
CLKDEV_CON_ID("ztr_clk", &div4_clks[DIV4_ZTR]),
|
||||
CLKDEV_CON_ID("zt_clk", &div4_clks[DIV4_ZT]),
|
||||
CLKDEV_CON_ID("z_clk", &div4_clks[DIV4_Z]),
|
||||
CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]),
|
||||
CLKDEV_CON_ID("zs_clk", &div4_clks[DIV4_ZS]),
|
||||
CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]),
|
||||
CLKDEV_CON_ID("zb3_clk", &div4_clks[DIV4_ZB3]),
|
||||
CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]),
|
||||
|
||||
/* DIV6 clocks */
|
||||
CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]),
|
||||
CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]),
|
||||
CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]),
|
||||
CLKDEV_CON_ID("fmsi_clk", &div6_clks[DIV6_FMSI]),
|
||||
CLKDEV_CON_ID("fmso_clk", &div6_clks[DIV6_FMSO]),
|
||||
CLKDEV_CON_ID("fsi_clk", &div6_clks[DIV6_FSI]),
|
||||
CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]),
|
||||
CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]),
|
||||
CLKDEV_CON_ID("msu_clk", &div6_clks[DIV6_MSU]),
|
||||
CLKDEV_CON_ID("mvi3_clk", &div6_clks[DIV6_MVI3]),
|
||||
CLKDEV_CON_ID("hdmi_clk", &div6_clks[DIV6_HDMI]),
|
||||
CLKDEV_CON_ID("mf1_clk", &div6_clks[DIV6_MF1]),
|
||||
CLKDEV_CON_ID("mf2_clk", &div6_clks[DIV6_MF2]),
|
||||
CLKDEV_CON_ID("dsit_clk", &div6_clks[DIV6_DSIT]),
|
||||
CLKDEV_CON_ID("dsip_clk", &div6_clks[DIV6_DSIP]),
|
||||
|
||||
/* MSTP32 clocks */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[MSTP128]), /* VEU0 */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */
|
||||
CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */
|
||||
CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
|
||||
CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP206]), /* SCIFB */
|
||||
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
|
||||
CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */
|
||||
CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */
|
||||
CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */
|
||||
CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
|
||||
CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
|
||||
CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
|
||||
CLKDEV_DEV_ID("sh_irda", &mstp_clks[MSTP325]), /* IRDA */
|
||||
CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */
|
||||
CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USBHS */
|
||||
CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USBHS */
|
||||
CLKDEV_DEV_ID("sh_flctl", &mstp_clks[MSTP315]), /* FLCTL */
|
||||
CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
|
||||
CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
|
||||
CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
|
||||
};
|
||||
|
||||
void __init sh7377_clock_init(void)
|
||||
{
|
||||
int k, ret = 0;
|
||||
|
||||
for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
|
||||
ret = clk_register(main_clks[k]);
|
||||
|
||||
if (!ret)
|
||||
ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
|
||||
|
||||
if (!ret)
|
||||
ret = sh_clk_div6_register(div6_clks, DIV6_NR);
|
||||
|
||||
if (!ret)
|
||||
ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
|
||||
|
||||
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
||||
|
||||
if (!ret)
|
||||
shmobile_clk_init();
|
||||
else
|
||||
panic("failed to setup sh7377 clocks\n");
|
||||
}
|
||||
|
|
@ -18,24 +18,6 @@ extern int shmobile_enter_wfi(struct cpuidle_device *dev,
|
|||
struct cpuidle_driver *drv, int index);
|
||||
extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
|
||||
|
||||
extern void sh7367_init_irq(void);
|
||||
extern void sh7367_map_io(void);
|
||||
extern void sh7367_add_early_devices(void);
|
||||
extern void sh7367_add_standard_devices(void);
|
||||
extern void sh7367_clock_init(void);
|
||||
extern void sh7367_pinmux_init(void);
|
||||
extern struct clk sh7367_extalb1_clk;
|
||||
extern struct clk sh7367_extal2_clk;
|
||||
|
||||
extern void sh7377_init_irq(void);
|
||||
extern void sh7377_map_io(void);
|
||||
extern void sh7377_add_early_devices(void);
|
||||
extern void sh7377_add_standard_devices(void);
|
||||
extern void sh7377_clock_init(void);
|
||||
extern void sh7377_pinmux_init(void);
|
||||
extern struct clk sh7377_extalc1_clk;
|
||||
extern struct clk sh7377_extal2_clk;
|
||||
|
||||
extern void sh7372_init_irq(void);
|
||||
extern void sh7372_map_io(void);
|
||||
extern void sh7372_add_early_devices(void);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ enum {
|
|||
GPIO_FN_A19,
|
||||
|
||||
/* IPSR0 */
|
||||
GPIO_FN_PENC2, GPIO_FN_SCK0, GPIO_FN_PWM1, GPIO_FN_PWMFSW0,
|
||||
GPIO_FN_USB_PENC2, GPIO_FN_SCK0, GPIO_FN_PWM1, GPIO_FN_PWMFSW0,
|
||||
GPIO_FN_SCIF_CLK, GPIO_FN_TCLK0_C, GPIO_FN_BS, GPIO_FN_SD1_DAT2,
|
||||
GPIO_FN_MMC0_D2, GPIO_FN_FD2, GPIO_FN_ATADIR0, GPIO_FN_SDSELF,
|
||||
GPIO_FN_HCTS1, GPIO_FN_TX4_C, GPIO_FN_A0, GPIO_FN_SD1_DAT3,
|
||||
|
|
|
|||
|
|
@ -1,332 +0,0 @@
|
|||
#ifndef __ASM_SH7367_H__
|
||||
#define __ASM_SH7367_H__
|
||||
|
||||
/* Pin Function Controller:
|
||||
* GPIO_FN_xx - GPIO used to select pin function
|
||||
* GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
|
||||
*/
|
||||
enum {
|
||||
/* 49-1 -> 49-6 (GPIO) */
|
||||
GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
|
||||
GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
|
||||
|
||||
GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
|
||||
GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
|
||||
|
||||
GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
|
||||
GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
|
||||
|
||||
GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
|
||||
GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
|
||||
|
||||
GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
|
||||
GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
|
||||
|
||||
GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
|
||||
GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
|
||||
|
||||
GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
|
||||
GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
|
||||
|
||||
GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
|
||||
GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
|
||||
|
||||
GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
|
||||
GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
|
||||
|
||||
GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
|
||||
GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
|
||||
|
||||
GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
|
||||
GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
|
||||
|
||||
GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
|
||||
GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118, GPIO_PORT119,
|
||||
|
||||
GPIO_PORT120, GPIO_PORT121, GPIO_PORT122, GPIO_PORT123, GPIO_PORT124,
|
||||
GPIO_PORT125, GPIO_PORT126, GPIO_PORT127, GPIO_PORT128, GPIO_PORT129,
|
||||
|
||||
GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
|
||||
GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
|
||||
|
||||
GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
|
||||
GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
|
||||
|
||||
GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
|
||||
GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
|
||||
|
||||
GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
|
||||
GPIO_PORT165, GPIO_PORT166, GPIO_PORT167, GPIO_PORT168, GPIO_PORT169,
|
||||
|
||||
GPIO_PORT170, GPIO_PORT171, GPIO_PORT172, GPIO_PORT173, GPIO_PORT174,
|
||||
GPIO_PORT175, GPIO_PORT176, GPIO_PORT177, GPIO_PORT178, GPIO_PORT179,
|
||||
|
||||
GPIO_PORT180, GPIO_PORT181, GPIO_PORT182, GPIO_PORT183, GPIO_PORT184,
|
||||
GPIO_PORT185, GPIO_PORT186, GPIO_PORT187, GPIO_PORT188, GPIO_PORT189,
|
||||
|
||||
GPIO_PORT190, GPIO_PORT191, GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
|
||||
GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
|
||||
|
||||
GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
|
||||
GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
|
||||
|
||||
GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
|
||||
GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
|
||||
|
||||
GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
|
||||
GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
|
||||
|
||||
GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
|
||||
GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
|
||||
|
||||
GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
|
||||
GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
|
||||
|
||||
GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
|
||||
GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
|
||||
|
||||
GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
|
||||
GPIO_PORT265, GPIO_PORT266, GPIO_PORT267, GPIO_PORT268, GPIO_PORT269,
|
||||
|
||||
GPIO_PORT270, GPIO_PORT271, GPIO_PORT272,
|
||||
|
||||
/* Special Pull-up / Pull-down Functions */
|
||||
GPIO_FN_PORT48_KEYIN0_PU, GPIO_FN_PORT49_KEYIN1_PU,
|
||||
GPIO_FN_PORT50_KEYIN2_PU, GPIO_FN_PORT55_KEYIN3_PU,
|
||||
GPIO_FN_PORT56_KEYIN4_PU, GPIO_FN_PORT57_KEYIN5_PU,
|
||||
GPIO_FN_PORT58_KEYIN6_PU,
|
||||
|
||||
/* 49-1 (FN) */
|
||||
GPIO_FN_VBUS0, GPIO_FN_CPORT0, GPIO_FN_CPORT1, GPIO_FN_CPORT2,
|
||||
GPIO_FN_CPORT3, GPIO_FN_CPORT4, GPIO_FN_CPORT5, GPIO_FN_CPORT6,
|
||||
GPIO_FN_CPORT7, GPIO_FN_CPORT8, GPIO_FN_CPORT9, GPIO_FN_CPORT10,
|
||||
GPIO_FN_CPORT11, GPIO_FN_SIN2, GPIO_FN_CPORT12, GPIO_FN_XCTS2,
|
||||
GPIO_FN_CPORT13, GPIO_FN_RFSPO4, GPIO_FN_CPORT14, GPIO_FN_RFSPO5,
|
||||
GPIO_FN_CPORT15, GPIO_FN_CPORT16, GPIO_FN_CPORT17, GPIO_FN_SOUT2,
|
||||
GPIO_FN_CPORT18, GPIO_FN_XRTS2, GPIO_FN_CPORT19, GPIO_FN_CPORT20,
|
||||
GPIO_FN_RFSPO6, GPIO_FN_CPORT21, GPIO_FN_STATUS0, GPIO_FN_CPORT22,
|
||||
GPIO_FN_STATUS1, GPIO_FN_CPORT23, GPIO_FN_STATUS2, GPIO_FN_RFSPO7,
|
||||
GPIO_FN_MPORT0, GPIO_FN_MPORT1, GPIO_FN_B_SYNLD1, GPIO_FN_B_SYNLD2,
|
||||
GPIO_FN_XMAINPS, GPIO_FN_XDIVPS, GPIO_FN_XIDRST, GPIO_FN_IDCLK,
|
||||
GPIO_FN_IDIO, GPIO_FN_SOUT1, GPIO_FN_SCIFA4_TXD,
|
||||
GPIO_FN_M02_BERDAT, GPIO_FN_SIN1, GPIO_FN_SCIFA4_RXD, GPIO_FN_XWUP,
|
||||
GPIO_FN_XRTS1, GPIO_FN_SCIFA4_RTS, GPIO_FN_M03_BERCLK,
|
||||
GPIO_FN_XCTS1, GPIO_FN_SCIFA4_CTS,
|
||||
|
||||
/* 49-2 (FN) */
|
||||
GPIO_FN_HSU_IQ_AGC6, GPIO_FN_MFG2_IN2, GPIO_FN_MSIOF2_MCK0,
|
||||
GPIO_FN_HSU_IQ_AGC5, GPIO_FN_MFG2_IN1, GPIO_FN_MSIOF2_MCK1,
|
||||
GPIO_FN_HSU_IQ_AGC4, GPIO_FN_MSIOF2_RSYNC,
|
||||
GPIO_FN_HSU_IQ_AGC3, GPIO_FN_MFG2_OUT1, GPIO_FN_MSIOF2_RSCK,
|
||||
GPIO_FN_HSU_IQ_AGC2, GPIO_FN_PORT42_KEYOUT0,
|
||||
GPIO_FN_HSU_IQ_AGC1, GPIO_FN_PORT43_KEYOUT1,
|
||||
GPIO_FN_HSU_IQ_AGC0, GPIO_FN_PORT44_KEYOUT2,
|
||||
GPIO_FN_HSU_IQ_AGC_ST, GPIO_FN_PORT45_KEYOUT3,
|
||||
GPIO_FN_HSU_IQ_PDO, GPIO_FN_PORT46_KEYOUT4,
|
||||
GPIO_FN_HSU_IQ_PYO, GPIO_FN_PORT47_KEYOUT5,
|
||||
GPIO_FN_HSU_EN_TXMUX_G3MO, GPIO_FN_PORT48_KEYIN0,
|
||||
GPIO_FN_HSU_I_TXMUX_G3MO, GPIO_FN_PORT49_KEYIN1,
|
||||
GPIO_FN_HSU_Q_TXMUX_G3MO, GPIO_FN_PORT50_KEYIN2,
|
||||
GPIO_FN_HSU_SYO, GPIO_FN_PORT51_MSIOF2_TSYNC,
|
||||
GPIO_FN_HSU_SDO, GPIO_FN_PORT52_MSIOF2_TSCK,
|
||||
GPIO_FN_HSU_TGTTI_G3MO, GPIO_FN_PORT53_MSIOF2_TXD,
|
||||
GPIO_FN_B_TIME_STAMP, GPIO_FN_PORT54_MSIOF2_RXD,
|
||||
GPIO_FN_HSU_SDI, GPIO_FN_PORT55_KEYIN3,
|
||||
GPIO_FN_HSU_SCO, GPIO_FN_PORT56_KEYIN4,
|
||||
GPIO_FN_HSU_DREQ, GPIO_FN_PORT57_KEYIN5,
|
||||
GPIO_FN_HSU_DACK, GPIO_FN_PORT58_KEYIN6,
|
||||
GPIO_FN_HSU_CLK61M, GPIO_FN_PORT59_MSIOF2_SS1,
|
||||
GPIO_FN_HSU_XRST, GPIO_FN_PORT60_MSIOF2_SS2,
|
||||
GPIO_FN_PCMCLKO, GPIO_FN_SYNC8KO, GPIO_FN_DNPCM_A, GPIO_FN_UPPCM_A,
|
||||
GPIO_FN_XTALB1L,
|
||||
GPIO_FN_GPS_AGC1, GPIO_FN_SCIFA0_RTS,
|
||||
GPIO_FN_GPS_AGC2, GPIO_FN_SCIFA0_SCK,
|
||||
GPIO_FN_GPS_AGC3, GPIO_FN_SCIFA0_TXD,
|
||||
GPIO_FN_GPS_AGC4, GPIO_FN_SCIFA0_RXD,
|
||||
GPIO_FN_GPS_PWRD, GPIO_FN_SCIFA0_CTS,
|
||||
GPIO_FN_GPS_IM, GPIO_FN_GPS_IS, GPIO_FN_GPS_QM, GPIO_FN_GPS_QS,
|
||||
GPIO_FN_SIUBOMC, GPIO_FN_TPU2TO0,
|
||||
GPIO_FN_SIUCKB, GPIO_FN_TPU2TO1,
|
||||
GPIO_FN_SIUBOLR, GPIO_FN_BBIF2_TSYNC, GPIO_FN_TPU2TO2,
|
||||
GPIO_FN_SIUBOBT, GPIO_FN_BBIF2_TSCK, GPIO_FN_TPU2TO3,
|
||||
GPIO_FN_SIUBOSLD, GPIO_FN_BBIF2_TXD, GPIO_FN_TPU3TO0,
|
||||
GPIO_FN_SIUBILR, GPIO_FN_TPU3TO1,
|
||||
GPIO_FN_SIUBIBT, GPIO_FN_TPU3TO2,
|
||||
GPIO_FN_SIUBISLD, GPIO_FN_TPU3TO3,
|
||||
GPIO_FN_NMI, GPIO_FN_TPU4TO0,
|
||||
GPIO_FN_DNPCM_M, GPIO_FN_TPU4TO1, GPIO_FN_TPU4TO2, GPIO_FN_TPU4TO3,
|
||||
GPIO_FN_IRQ_TMPB,
|
||||
GPIO_FN_PWEN, GPIO_FN_MFG1_OUT1,
|
||||
GPIO_FN_OVCN, GPIO_FN_MFG1_IN1,
|
||||
GPIO_FN_OVCN2, GPIO_FN_MFG1_IN2,
|
||||
|
||||
/* 49-3 (FN) */
|
||||
GPIO_FN_RFSPO1, GPIO_FN_RFSPO2, GPIO_FN_RFSPO3, GPIO_FN_PORT93_VIO_CKO2,
|
||||
GPIO_FN_USBTERM, GPIO_FN_EXTLP, GPIO_FN_IDIN,
|
||||
GPIO_FN_SCIFA5_CTS, GPIO_FN_MFG0_IN1,
|
||||
GPIO_FN_SCIFA5_RTS, GPIO_FN_MFG0_IN2,
|
||||
GPIO_FN_SCIFA5_RXD,
|
||||
GPIO_FN_SCIFA5_TXD,
|
||||
GPIO_FN_SCIFA5_SCK, GPIO_FN_MFG0_OUT1,
|
||||
GPIO_FN_A0_EA0, GPIO_FN_BS,
|
||||
GPIO_FN_A14_EA14, GPIO_FN_PORT102_KEYOUT0,
|
||||
GPIO_FN_A15_EA15, GPIO_FN_PORT103_KEYOUT1, GPIO_FN_DV_CLKOL,
|
||||
GPIO_FN_A16_EA16, GPIO_FN_PORT104_KEYOUT2,
|
||||
GPIO_FN_DV_VSYNCL, GPIO_FN_MSIOF0_SS1,
|
||||
GPIO_FN_A17_EA17, GPIO_FN_PORT105_KEYOUT3,
|
||||
GPIO_FN_DV_HSYNCL, GPIO_FN_MSIOF0_TSYNC,
|
||||
GPIO_FN_A18_EA18, GPIO_FN_PORT106_KEYOUT4,
|
||||
GPIO_FN_DV_DL0, GPIO_FN_MSIOF0_TSCK,
|
||||
GPIO_FN_A19_EA19, GPIO_FN_PORT107_KEYOUT5,
|
||||
GPIO_FN_DV_DL1, GPIO_FN_MSIOF0_TXD,
|
||||
GPIO_FN_A20_EA20, GPIO_FN_PORT108_KEYIN0,
|
||||
GPIO_FN_DV_DL2, GPIO_FN_MSIOF0_RSCK,
|
||||
GPIO_FN_A21_EA21, GPIO_FN_PORT109_KEYIN1,
|
||||
GPIO_FN_DV_DL3, GPIO_FN_MSIOF0_RSYNC,
|
||||
GPIO_FN_A22_EA22, GPIO_FN_PORT110_KEYIN2,
|
||||
GPIO_FN_DV_DL4, GPIO_FN_MSIOF0_MCK0,
|
||||
GPIO_FN_A23_EA23, GPIO_FN_PORT111_KEYIN3,
|
||||
GPIO_FN_DV_DL5, GPIO_FN_MSIOF0_MCK1,
|
||||
GPIO_FN_A24_EA24, GPIO_FN_PORT112_KEYIN4,
|
||||
GPIO_FN_DV_DL6, GPIO_FN_MSIOF0_RXD,
|
||||
GPIO_FN_A25_EA25, GPIO_FN_PORT113_KEYIN5,
|
||||
GPIO_FN_DV_DL7, GPIO_FN_MSIOF0_SS2,
|
||||
GPIO_FN_A26, GPIO_FN_PORT113_KEYIN6, GPIO_FN_DV_CLKIL,
|
||||
GPIO_FN_D0_ED0_NAF0, GPIO_FN_D1_ED1_NAF1, GPIO_FN_D2_ED2_NAF2,
|
||||
GPIO_FN_D3_ED3_NAF3, GPIO_FN_D4_ED4_NAF4, GPIO_FN_D5_ED5_NAF5,
|
||||
GPIO_FN_D6_ED6_NAF6, GPIO_FN_D7_ED7_NAF7, GPIO_FN_D8_ED8_NAF8,
|
||||
GPIO_FN_D9_ED9_NAF9, GPIO_FN_D10_ED10_NAF10, GPIO_FN_D11_ED11_NAF11,
|
||||
GPIO_FN_D12_ED12_NAF12, GPIO_FN_D13_ED13_NAF13,
|
||||
GPIO_FN_D14_ED14_NAF14, GPIO_FN_D15_ED15_NAF15,
|
||||
GPIO_FN_CS4, GPIO_FN_CS5A, GPIO_FN_CS5B, GPIO_FN_FCE1,
|
||||
GPIO_FN_CS6B, GPIO_FN_XCS2, GPIO_FN_FCE0, GPIO_FN_CS6A,
|
||||
GPIO_FN_DACK0, GPIO_FN_WAIT, GPIO_FN_DREQ0, GPIO_FN_RD_XRD,
|
||||
GPIO_FN_A27, GPIO_FN_RDWR_XWE, GPIO_FN_WE0_XWR0_FWE,
|
||||
GPIO_FN_WE1_XWR1, GPIO_FN_FRB, GPIO_FN_CKO,
|
||||
GPIO_FN_NBRSTOUT, GPIO_FN_NBRST,
|
||||
|
||||
/* 49-4 (FN) */
|
||||
GPIO_FN_RFSPO0, GPIO_FN_PORT146_VIO_CKO2, GPIO_FN_TSTMD,
|
||||
GPIO_FN_VIO_VD, GPIO_FN_VIO_HD,
|
||||
GPIO_FN_VIO_D0, GPIO_FN_VIO_D1, GPIO_FN_VIO_D2,
|
||||
GPIO_FN_VIO_D3, GPIO_FN_VIO_D4, GPIO_FN_VIO_D5,
|
||||
GPIO_FN_VIO_D6, GPIO_FN_VIO_D7, GPIO_FN_VIO_D8,
|
||||
GPIO_FN_VIO_D9, GPIO_FN_VIO_D10, GPIO_FN_VIO_D11,
|
||||
GPIO_FN_VIO_D12, GPIO_FN_VIO_D13, GPIO_FN_VIO_D14,
|
||||
GPIO_FN_VIO_D15, GPIO_FN_VIO_CLK, GPIO_FN_VIO_FIELD,
|
||||
GPIO_FN_VIO_CKO,
|
||||
GPIO_FN_MFG3_IN1, GPIO_FN_MFG3_IN2,
|
||||
GPIO_FN_M9_SLCD_A01, GPIO_FN_MFG3_OUT1, GPIO_FN_TPU0TO0,
|
||||
GPIO_FN_M10_SLCD_CK1, GPIO_FN_MFG4_IN1, GPIO_FN_TPU0TO1,
|
||||
GPIO_FN_M11_SLCD_SO1, GPIO_FN_MFG4_IN2, GPIO_FN_TPU0TO2,
|
||||
GPIO_FN_M12_SLCD_CE1, GPIO_FN_MFG4_OUT1, GPIO_FN_TPU0TO3,
|
||||
GPIO_FN_LCDD0, GPIO_FN_PORT175_KEYOUT0, GPIO_FN_DV_D0,
|
||||
GPIO_FN_SIUCKA, GPIO_FN_MFG0_OUT2,
|
||||
GPIO_FN_LCDD1, GPIO_FN_PORT176_KEYOUT1, GPIO_FN_DV_D1,
|
||||
GPIO_FN_SIUAOLR, GPIO_FN_BBIF2_TSYNC1,
|
||||
GPIO_FN_LCDD2, GPIO_FN_PORT177_KEYOUT2, GPIO_FN_DV_D2,
|
||||
GPIO_FN_SIUAOBT, GPIO_FN_BBIF2_TSCK1,
|
||||
GPIO_FN_LCDD3, GPIO_FN_PORT178_KEYOUT3, GPIO_FN_DV_D3,
|
||||
GPIO_FN_SIUAOSLD, GPIO_FN_BBIF2_TXD1,
|
||||
GPIO_FN_LCDD4, GPIO_FN_PORT179_KEYOUT4, GPIO_FN_DV_D4,
|
||||
GPIO_FN_SIUAISPD, GPIO_FN_MFG1_OUT2,
|
||||
GPIO_FN_LCDD5, GPIO_FN_PORT180_KEYOUT5, GPIO_FN_DV_D5,
|
||||
GPIO_FN_SIUAILR, GPIO_FN_MFG2_OUT2,
|
||||
GPIO_FN_LCDD6, GPIO_FN_DV_D6,
|
||||
GPIO_FN_SIUAIBT, GPIO_FN_MFG3_OUT2, GPIO_FN_XWR2,
|
||||
GPIO_FN_LCDD7, GPIO_FN_DV_D7,
|
||||
GPIO_FN_SIUAISLD, GPIO_FN_MFG4_OUT2, GPIO_FN_XWR3,
|
||||
GPIO_FN_LCDD8, GPIO_FN_DV_D8, GPIO_FN_D16, GPIO_FN_ED16,
|
||||
GPIO_FN_LCDD9, GPIO_FN_DV_D9, GPIO_FN_D17, GPIO_FN_ED17,
|
||||
GPIO_FN_LCDD10, GPIO_FN_DV_D10, GPIO_FN_D18, GPIO_FN_ED18,
|
||||
GPIO_FN_LCDD11, GPIO_FN_DV_D11, GPIO_FN_D19, GPIO_FN_ED19,
|
||||
GPIO_FN_LCDD12, GPIO_FN_DV_D12, GPIO_FN_D20, GPIO_FN_ED20,
|
||||
GPIO_FN_LCDD13, GPIO_FN_DV_D13, GPIO_FN_D21, GPIO_FN_ED21,
|
||||
GPIO_FN_LCDD14, GPIO_FN_DV_D14, GPIO_FN_D22, GPIO_FN_ED22,
|
||||
GPIO_FN_LCDD15, GPIO_FN_DV_D15, GPIO_FN_D23, GPIO_FN_ED23,
|
||||
GPIO_FN_LCDD16, GPIO_FN_DV_HSYNC, GPIO_FN_D24, GPIO_FN_ED24,
|
||||
GPIO_FN_LCDD17, GPIO_FN_DV_VSYNC, GPIO_FN_D25, GPIO_FN_ED25,
|
||||
GPIO_FN_LCDD18, GPIO_FN_DREQ2, GPIO_FN_MSIOF0L_TSCK,
|
||||
GPIO_FN_D26, GPIO_FN_ED26,
|
||||
GPIO_FN_LCDD19, GPIO_FN_MSIOF0L_TSYNC,
|
||||
GPIO_FN_D27, GPIO_FN_ED27,
|
||||
GPIO_FN_LCDD20, GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0,
|
||||
GPIO_FN_D28, GPIO_FN_ED28,
|
||||
GPIO_FN_LCDD21, GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1,
|
||||
GPIO_FN_D29, GPIO_FN_ED29,
|
||||
GPIO_FN_LCDD22, GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_SS1,
|
||||
GPIO_FN_D30, GPIO_FN_ED30,
|
||||
GPIO_FN_LCDD23, GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_SS2,
|
||||
GPIO_FN_D31, GPIO_FN_ED31,
|
||||
GPIO_FN_LCDDCK, GPIO_FN_LCDWR, GPIO_FN_DV_CKO, GPIO_FN_SIUAOSPD,
|
||||
GPIO_FN_LCDRD, GPIO_FN_DACK2, GPIO_FN_MSIOF0L_RSYNC,
|
||||
|
||||
|
||||
/* 49-5 (FN) */
|
||||
GPIO_FN_LCDHSYN, GPIO_FN_LCDCS, GPIO_FN_LCDCS2, GPIO_FN_DACK3,
|
||||
GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_RSCK,
|
||||
GPIO_FN_LCDCSYN, GPIO_FN_LCDCSYN2, GPIO_FN_DV_CKI,
|
||||
GPIO_FN_LCDLCLK, GPIO_FN_DREQ1, GPIO_FN_MSIOF0L_RXD,
|
||||
GPIO_FN_LCDDON, GPIO_FN_LCDDON2, GPIO_FN_DACK1, GPIO_FN_MSIOF0L_TXD,
|
||||
GPIO_FN_VIO_DR0, GPIO_FN_VIO_DR1, GPIO_FN_VIO_DR2, GPIO_FN_VIO_DR3,
|
||||
GPIO_FN_VIO_DR4, GPIO_FN_VIO_DR5, GPIO_FN_VIO_DR6, GPIO_FN_VIO_DR7,
|
||||
GPIO_FN_VIO_VDR, GPIO_FN_VIO_HDR,
|
||||
GPIO_FN_VIO_CLKR, GPIO_FN_VIO_CKOR,
|
||||
GPIO_FN_SCIFA1_TXD, GPIO_FN_GPS_PGFA0,
|
||||
GPIO_FN_SCIFA1_SCK, GPIO_FN_GPS_PGFA1,
|
||||
GPIO_FN_SCIFA1_RTS, GPIO_FN_GPS_EPPSINMON,
|
||||
GPIO_FN_SCIFA1_RXD, GPIO_FN_SCIFA1_CTS,
|
||||
GPIO_FN_MSIOF1_TXD, GPIO_FN_SCIFA1_TXD2, GPIO_FN_GPS_TXD,
|
||||
GPIO_FN_MSIOF1_TSYNC, GPIO_FN_SCIFA1_CTS2, GPIO_FN_I2C_SDA2,
|
||||
GPIO_FN_MSIOF1_TSCK, GPIO_FN_SCIFA1_SCK2,
|
||||
GPIO_FN_MSIOF1_RXD, GPIO_FN_SCIFA1_RXD2, GPIO_FN_GPS_RXD,
|
||||
GPIO_FN_MSIOF1_RSCK, GPIO_FN_SCIFA1_RTS2,
|
||||
GPIO_FN_MSIOF1_RSYNC, GPIO_FN_I2C_SCL2,
|
||||
GPIO_FN_MSIOF1_MCK0, GPIO_FN_MSIOF1_MCK1,
|
||||
GPIO_FN_MSIOF1_SS1, GPIO_FN_EDBGREQ3,
|
||||
GPIO_FN_MSIOF1_SS2,
|
||||
GPIO_FN_PORT236_IROUT, GPIO_FN_IRDA_OUT,
|
||||
GPIO_FN_IRDA_IN, GPIO_FN_IRDA_FIRSEL,
|
||||
GPIO_FN_TPU1TO0, GPIO_FN_TS_SPSYNC3,
|
||||
GPIO_FN_TPU1TO1, GPIO_FN_TS_SDAT3,
|
||||
GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT241_MSIOF2_SS1,
|
||||
GPIO_FN_TPU1TO3, GPIO_FN_PORT242_MSIOF2_TSCK,
|
||||
GPIO_FN_M13_BSW, GPIO_FN_PORT243_MSIOF2_TSYNC,
|
||||
GPIO_FN_M14_GSW, GPIO_FN_PORT244_MSIOF2_TXD,
|
||||
GPIO_FN_PORT245_IROUT, GPIO_FN_M15_RSW,
|
||||
GPIO_FN_SOUT3, GPIO_FN_SCIFA2_TXD1,
|
||||
GPIO_FN_SIN3, GPIO_FN_SCIFA2_RXD1,
|
||||
GPIO_FN_XRTS3, GPIO_FN_SCIFA2_RTS1, GPIO_FN_PORT248_MSIOF2_SS2,
|
||||
GPIO_FN_XCTS3, GPIO_FN_SCIFA2_CTS1, GPIO_FN_PORT249_MSIOF2_RXD,
|
||||
GPIO_FN_DINT, GPIO_FN_SCIFA2_SCK1, GPIO_FN_TS_SCK3,
|
||||
GPIO_FN_SDHICLK0, GPIO_FN_TCK2,
|
||||
GPIO_FN_SDHICD0,
|
||||
GPIO_FN_SDHID0_0, GPIO_FN_TMS2,
|
||||
GPIO_FN_SDHID0_1, GPIO_FN_TDO2,
|
||||
GPIO_FN_SDHID0_2, GPIO_FN_TDI2,
|
||||
GPIO_FN_SDHID0_3, GPIO_FN_RTCK2,
|
||||
|
||||
/* 49-6 (FN) */
|
||||
GPIO_FN_SDHICMD0, GPIO_FN_TRST2,
|
||||
GPIO_FN_SDHIWP0, GPIO_FN_EDBGREQ2,
|
||||
GPIO_FN_SDHICLK1, GPIO_FN_TCK3,
|
||||
GPIO_FN_SDHID1_0, GPIO_FN_M11_SLCD_SO2,
|
||||
GPIO_FN_TS_SPSYNC2, GPIO_FN_TMS3,
|
||||
GPIO_FN_SDHID1_1, GPIO_FN_M9_SLCD_AO2,
|
||||
GPIO_FN_TS_SDAT2, GPIO_FN_TDO3,
|
||||
GPIO_FN_SDHID1_2, GPIO_FN_M10_SLCD_CK2,
|
||||
GPIO_FN_TS_SDEN2, GPIO_FN_TDI3,
|
||||
GPIO_FN_SDHID1_3, GPIO_FN_M12_SLCD_CE2,
|
||||
GPIO_FN_TS_SCK2, GPIO_FN_RTCK3,
|
||||
GPIO_FN_SDHICMD1, GPIO_FN_TRST3,
|
||||
GPIO_FN_SDHICLK2, GPIO_FN_SCIFB_SCK,
|
||||
GPIO_FN_SDHID2_0, GPIO_FN_SCIFB_TXD,
|
||||
GPIO_FN_SDHID2_1, GPIO_FN_SCIFB_CTS,
|
||||
GPIO_FN_SDHID2_2, GPIO_FN_SCIFB_RXD,
|
||||
GPIO_FN_SDHID2_3, GPIO_FN_SCIFB_RTS,
|
||||
GPIO_FN_SDHICMD2,
|
||||
GPIO_FN_RESETOUTS,
|
||||
GPIO_FN_DIVLOCK,
|
||||
};
|
||||
|
||||
#endif /* __ASM_SH7367_H__ */
|
||||
|
|
@ -452,6 +452,10 @@ enum {
|
|||
SHDMA_SLAVE_SCIF5_RX,
|
||||
SHDMA_SLAVE_SCIF6_TX,
|
||||
SHDMA_SLAVE_SCIF6_RX,
|
||||
SHDMA_SLAVE_FLCTL0_TX,
|
||||
SHDMA_SLAVE_FLCTL0_RX,
|
||||
SHDMA_SLAVE_FLCTL1_TX,
|
||||
SHDMA_SLAVE_FLCTL1_RX,
|
||||
SHDMA_SLAVE_SDHI0_RX,
|
||||
SHDMA_SLAVE_SDHI0_TX,
|
||||
SHDMA_SLAVE_SDHI1_RX,
|
||||
|
|
@ -475,8 +479,6 @@ extern struct clk sh7372_dv_clki_div2_clk;
|
|||
extern struct clk sh7372_pllc2_clk;
|
||||
extern struct clk sh7372_fsiack_clk;
|
||||
extern struct clk sh7372_fsibck_clk;
|
||||
extern struct clk sh7372_fsidiva_clk;
|
||||
extern struct clk sh7372_fsidivb_clk;
|
||||
|
||||
extern void sh7372_intcs_suspend(void);
|
||||
extern void sh7372_intcs_resume(void);
|
||||
|
|
|
|||
|
|
@ -1,360 +0,0 @@
|
|||
#ifndef __ASM_SH7377_H__
|
||||
#define __ASM_SH7377_H__
|
||||
|
||||
/* Pin Function Controller:
|
||||
* GPIO_FN_xx - GPIO used to select pin function
|
||||
* GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
|
||||
*/
|
||||
enum {
|
||||
/* 55-1 -> 55-5 (GPIO) */
|
||||
GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
|
||||
GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
|
||||
|
||||
GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
|
||||
GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
|
||||
|
||||
GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
|
||||
GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
|
||||
|
||||
GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
|
||||
GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
|
||||
|
||||
GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
|
||||
GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
|
||||
|
||||
GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
|
||||
GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
|
||||
|
||||
GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
|
||||
GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
|
||||
|
||||
GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
|
||||
GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
|
||||
|
||||
GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
|
||||
GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
|
||||
|
||||
GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
|
||||
GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
|
||||
|
||||
GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
|
||||
GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
|
||||
|
||||
GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
|
||||
GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118,
|
||||
|
||||
GPIO_PORT128, GPIO_PORT129,
|
||||
|
||||
GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
|
||||
GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
|
||||
|
||||
GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
|
||||
GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
|
||||
|
||||
GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
|
||||
GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
|
||||
|
||||
GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
|
||||
|
||||
GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
|
||||
GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
|
||||
|
||||
GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
|
||||
GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
|
||||
|
||||
GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
|
||||
GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
|
||||
|
||||
GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
|
||||
GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
|
||||
|
||||
GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
|
||||
GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
|
||||
|
||||
GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
|
||||
GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
|
||||
|
||||
GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
|
||||
GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
|
||||
|
||||
GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
|
||||
|
||||
/* Special Pull-up / Pull-down Functions */
|
||||
GPIO_FN_PORT66_KEYIN0_PU, GPIO_FN_PORT67_KEYIN1_PU,
|
||||
GPIO_FN_PORT68_KEYIN2_PU, GPIO_FN_PORT69_KEYIN3_PU,
|
||||
GPIO_FN_PORT70_KEYIN4_PU, GPIO_FN_PORT71_KEYIN5_PU,
|
||||
GPIO_FN_PORT72_KEYIN6_PU,
|
||||
|
||||
/* 55-1 (FN) */
|
||||
GPIO_FN_VBUS_0,
|
||||
GPIO_FN_CPORT0,
|
||||
GPIO_FN_CPORT1,
|
||||
GPIO_FN_CPORT2,
|
||||
GPIO_FN_CPORT3,
|
||||
GPIO_FN_CPORT4,
|
||||
GPIO_FN_CPORT5,
|
||||
GPIO_FN_CPORT6,
|
||||
GPIO_FN_CPORT7,
|
||||
GPIO_FN_CPORT8,
|
||||
GPIO_FN_CPORT9,
|
||||
GPIO_FN_CPORT10,
|
||||
GPIO_FN_CPORT11, GPIO_FN_SIN2,
|
||||
GPIO_FN_CPORT12, GPIO_FN_XCTS2,
|
||||
GPIO_FN_CPORT13, GPIO_FN_RFSPO4,
|
||||
GPIO_FN_CPORT14, GPIO_FN_RFSPO5,
|
||||
GPIO_FN_CPORT15, GPIO_FN_SCIFA0_SCK, GPIO_FN_GPS_AGC2,
|
||||
GPIO_FN_CPORT16, GPIO_FN_SCIFA0_TXD, GPIO_FN_GPS_AGC3,
|
||||
GPIO_FN_CPORT17_IC_OE, GPIO_FN_SOUT2,
|
||||
GPIO_FN_CPORT18, GPIO_FN_XRTS2, GPIO_FN_PORT19_VIO_CKO2,
|
||||
GPIO_FN_CPORT19_MPORT1,
|
||||
GPIO_FN_CPORT20, GPIO_FN_RFSPO6,
|
||||
GPIO_FN_CPORT21, GPIO_FN_STATUS0,
|
||||
GPIO_FN_CPORT22, GPIO_FN_STATUS1,
|
||||
GPIO_FN_CPORT23, GPIO_FN_STATUS2, GPIO_FN_RFSPO7,
|
||||
GPIO_FN_B_SYNLD1,
|
||||
GPIO_FN_B_SYNLD2, GPIO_FN_SYSENMSK,
|
||||
GPIO_FN_XMAINPS,
|
||||
GPIO_FN_XDIVPS,
|
||||
GPIO_FN_XIDRST,
|
||||
GPIO_FN_IDCLK, GPIO_FN_IC_DP,
|
||||
GPIO_FN_IDIO, GPIO_FN_IC_DM,
|
||||
GPIO_FN_SOUT1, GPIO_FN_SCIFA4_TXD, GPIO_FN_M02_BERDAT,
|
||||
GPIO_FN_SIN1, GPIO_FN_SCIFA4_RXD, GPIO_FN_XWUP,
|
||||
GPIO_FN_XRTS1, GPIO_FN_SCIFA4_RTS, GPIO_FN_M03_BERCLK,
|
||||
GPIO_FN_XCTS1, GPIO_FN_SCIFA4_CTS,
|
||||
GPIO_FN_PCMCLKO,
|
||||
GPIO_FN_SYNC8KO,
|
||||
|
||||
/* 55-2 (FN) */
|
||||
GPIO_FN_DNPCM_A,
|
||||
GPIO_FN_UPPCM_A,
|
||||
GPIO_FN_VACK,
|
||||
GPIO_FN_XTALB1L,
|
||||
GPIO_FN_GPS_AGC1, GPIO_FN_SCIFA0_RTS,
|
||||
GPIO_FN_GPS_AGC4, GPIO_FN_SCIFA0_RXD,
|
||||
GPIO_FN_GPS_PWRDOWN, GPIO_FN_SCIFA0_CTS,
|
||||
GPIO_FN_GPS_IM,
|
||||
GPIO_FN_GPS_IS,
|
||||
GPIO_FN_GPS_QM,
|
||||
GPIO_FN_GPS_QS,
|
||||
GPIO_FN_FMSOCK, GPIO_FN_PORT49_IRDA_OUT, GPIO_FN_PORT49_IROUT,
|
||||
GPIO_FN_FMSOOLR, GPIO_FN_BBIF2_TSYNC2, GPIO_FN_TPU2TO2, GPIO_FN_IPORT3,
|
||||
GPIO_FN_FMSIOLR,
|
||||
GPIO_FN_FMSOOBT, GPIO_FN_BBIF2_TSCK2, GPIO_FN_TPU2TO3, GPIO_FN_OPORT1,
|
||||
GPIO_FN_FMSIOBT,
|
||||
GPIO_FN_FMSOSLD, GPIO_FN_BBIF2_TXD2, GPIO_FN_OPORT2,
|
||||
GPIO_FN_FMSOILR, GPIO_FN_PORT53_IRDA_IN, GPIO_FN_TPU3TO3,
|
||||
GPIO_FN_OPORT3, GPIO_FN_FMSIILR,
|
||||
GPIO_FN_FMSOIBT, GPIO_FN_PORT54_IRDA_FIRSEL, GPIO_FN_TPU3TO2,
|
||||
GPIO_FN_FMSIIBT,
|
||||
GPIO_FN_FMSISLD, GPIO_FN_MFG0_OUT1, GPIO_FN_TPU0TO0,
|
||||
GPIO_FN_A0_EA0, GPIO_FN_BS,
|
||||
GPIO_FN_A12_EA12, GPIO_FN_PORT58_VIO_CKOR, GPIO_FN_TPU4TO2,
|
||||
GPIO_FN_A13_EA13, GPIO_FN_PORT59_IROUT, GPIO_FN_MFG0_OUT2,
|
||||
GPIO_FN_TPU0TO1,
|
||||
GPIO_FN_A14_EA14, GPIO_FN_PORT60_KEYOUT5,
|
||||
GPIO_FN_A15_EA15, GPIO_FN_PORT61_KEYOUT4,
|
||||
GPIO_FN_A16_EA16, GPIO_FN_PORT62_KEYOUT3, GPIO_FN_MSIOF0_SS1,
|
||||
GPIO_FN_A17_EA17, GPIO_FN_PORT63_KEYOUT2, GPIO_FN_MSIOF0_TSYNC,
|
||||
GPIO_FN_A18_EA18, GPIO_FN_PORT64_KEYOUT1, GPIO_FN_MSIOF0_TSCK,
|
||||
GPIO_FN_A19_EA19, GPIO_FN_PORT65_KEYOUT0, GPIO_FN_MSIOF0_TXD,
|
||||
GPIO_FN_A20_EA20, GPIO_FN_PORT66_KEYIN0, GPIO_FN_MSIOF0_RSCK,
|
||||
GPIO_FN_A21_EA21, GPIO_FN_PORT67_KEYIN1, GPIO_FN_MSIOF0_RSYNC,
|
||||
GPIO_FN_A22_EA22, GPIO_FN_PORT68_KEYIN2, GPIO_FN_MSIOF0_MCK0,
|
||||
GPIO_FN_A23_EA23, GPIO_FN_PORT69_KEYIN3, GPIO_FN_MSIOF0_MCK1,
|
||||
GPIO_FN_A24_EA24, GPIO_FN_PORT70_KEYIN4, GPIO_FN_MSIOF0_RXD,
|
||||
GPIO_FN_A25_EA25, GPIO_FN_PORT71_KEYIN5, GPIO_FN_MSIOF0_SS2,
|
||||
GPIO_FN_A26, GPIO_FN_PORT72_KEYIN6,
|
||||
GPIO_FN_D0_ED0_NAF0,
|
||||
GPIO_FN_D1_ED1_NAF1,
|
||||
GPIO_FN_D2_ED2_NAF2,
|
||||
GPIO_FN_D3_ED3_NAF3,
|
||||
GPIO_FN_D4_ED4_NAF4,
|
||||
GPIO_FN_D5_ED5_NAF5,
|
||||
GPIO_FN_D6_ED6_NAF6,
|
||||
GPIO_FN_D7_ED7_NAF7,
|
||||
GPIO_FN_D8_ED8_NAF8,
|
||||
GPIO_FN_D9_ED9_NAF9,
|
||||
GPIO_FN_D10_ED10_NAF10,
|
||||
GPIO_FN_D11_ED11_NAF11,
|
||||
GPIO_FN_D12_ED12_NAF12,
|
||||
GPIO_FN_D13_ED13_NAF13,
|
||||
GPIO_FN_D14_ED14_NAF14,
|
||||
GPIO_FN_D15_ED15_NAF15,
|
||||
GPIO_FN_CS4,
|
||||
GPIO_FN_CS5A, GPIO_FN_FMSICK,
|
||||
GPIO_FN_CS5B, GPIO_FN_FCE1,
|
||||
|
||||
/* 55-3 (FN) */
|
||||
GPIO_FN_CS6B, GPIO_FN_XCS2, GPIO_FN_CS6A, GPIO_FN_DACK0,
|
||||
GPIO_FN_FCE0,
|
||||
GPIO_FN_WAIT, GPIO_FN_DREQ0,
|
||||
GPIO_FN_RD_XRD,
|
||||
GPIO_FN_WE0_XWR0_FWE,
|
||||
GPIO_FN_WE1_XWR1,
|
||||
GPIO_FN_FRB,
|
||||
GPIO_FN_CKO,
|
||||
GPIO_FN_NBRSTOUT,
|
||||
GPIO_FN_NBRST,
|
||||
GPIO_FN_GPS_EPPSIN,
|
||||
GPIO_FN_LATCHPULSE,
|
||||
GPIO_FN_LTESIGNAL,
|
||||
GPIO_FN_LEGACYSTATE,
|
||||
GPIO_FN_TCKON,
|
||||
GPIO_FN_VIO_VD, GPIO_FN_PORT128_KEYOUT0, GPIO_FN_IPORT0,
|
||||
GPIO_FN_VIO_HD, GPIO_FN_PORT129_KEYOUT1, GPIO_FN_IPORT1,
|
||||
GPIO_FN_VIO_D0, GPIO_FN_PORT130_KEYOUT2, GPIO_FN_PORT130_MSIOF2_RXD,
|
||||
GPIO_FN_VIO_D1, GPIO_FN_PORT131_KEYOUT3, GPIO_FN_PORT131_MSIOF2_SS1,
|
||||
GPIO_FN_VIO_D2, GPIO_FN_PORT132_KEYOUT4, GPIO_FN_PORT132_MSIOF2_SS2,
|
||||
GPIO_FN_VIO_D3, GPIO_FN_PORT133_KEYOUT5, GPIO_FN_PORT133_MSIOF2_TSYNC,
|
||||
GPIO_FN_VIO_D4, GPIO_FN_PORT134_KEYIN0, GPIO_FN_PORT134_MSIOF2_TXD,
|
||||
GPIO_FN_VIO_D5, GPIO_FN_PORT135_KEYIN1, GPIO_FN_PORT135_MSIOF2_TSCK,
|
||||
GPIO_FN_VIO_D6, GPIO_FN_PORT136_KEYIN2,
|
||||
GPIO_FN_VIO_D7, GPIO_FN_PORT137_KEYIN3,
|
||||
GPIO_FN_VIO_D8, GPIO_FN_M9_SLCD_A01, GPIO_FN_PORT138_FSIAOMC,
|
||||
GPIO_FN_VIO_D9, GPIO_FN_M10_SLCD_CK1, GPIO_FN_PORT139_FSIAOLR,
|
||||
GPIO_FN_VIO_D10, GPIO_FN_M11_SLCD_SO1, GPIO_FN_TPU0TO2,
|
||||
GPIO_FN_PORT140_FSIAOBT,
|
||||
GPIO_FN_VIO_D11, GPIO_FN_M12_SLCD_CE1, GPIO_FN_TPU0TO3,
|
||||
GPIO_FN_PORT141_FSIAOSLD,
|
||||
GPIO_FN_VIO_D12, GPIO_FN_M13_BSW, GPIO_FN_PORT142_FSIACK,
|
||||
GPIO_FN_VIO_D13, GPIO_FN_M14_GSW, GPIO_FN_PORT143_FSIAILR,
|
||||
GPIO_FN_VIO_D14, GPIO_FN_M15_RSW, GPIO_FN_PORT144_FSIAIBT,
|
||||
GPIO_FN_VIO_D15, GPIO_FN_TPU1TO3, GPIO_FN_PORT145_FSIAISLD,
|
||||
GPIO_FN_VIO_CLK, GPIO_FN_PORT146_KEYIN4, GPIO_FN_IPORT2,
|
||||
GPIO_FN_VIO_FIELD, GPIO_FN_PORT147_KEYIN5,
|
||||
GPIO_FN_VIO_CKO, GPIO_FN_PORT148_KEYIN6,
|
||||
GPIO_FN_A27, GPIO_FN_RDWR_XWE, GPIO_FN_MFG0_IN1,
|
||||
GPIO_FN_MFG0_IN2,
|
||||
GPIO_FN_TS_SPSYNC3, GPIO_FN_MSIOF2_RSCK,
|
||||
GPIO_FN_TS_SDAT3, GPIO_FN_MSIOF2_RSYNC,
|
||||
GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT153_MSIOF2_SS1,
|
||||
GPIO_FN_SOUT3, GPIO_FN_SCIFA2_TXD1, GPIO_FN_MSIOF2_MCK0,
|
||||
GPIO_FN_SIN3, GPIO_FN_SCIFA2_RXD1, GPIO_FN_MSIOF2_MCK1,
|
||||
GPIO_FN_XRTS3, GPIO_FN_SCIFA2_RTS1, GPIO_FN_PORT156_MSIOF2_SS2,
|
||||
GPIO_FN_XCTS3, GPIO_FN_SCIFA2_CTS1, GPIO_FN_PORT157_MSIOF2_RXD,
|
||||
|
||||
/* 55-4 (FN) */
|
||||
GPIO_FN_DINT, GPIO_FN_SCIFA2_SCK1, GPIO_FN_TS_SCK3,
|
||||
GPIO_FN_PORT159_SCIFB_SCK, GPIO_FN_PORT159_SCIFA5_SCK, GPIO_FN_NMI,
|
||||
GPIO_FN_PORT160_SCIFB_TXD, GPIO_FN_PORT160_SCIFA5_TXD, GPIO_FN_SOUT0,
|
||||
GPIO_FN_PORT161_SCIFB_CTS, GPIO_FN_PORT161_SCIFA5_CTS, GPIO_FN_XCTS0,
|
||||
GPIO_FN_MFG3_IN2,
|
||||
GPIO_FN_PORT162_SCIFB_RXD, GPIO_FN_PORT162_SCIFA5_RXD, GPIO_FN_SIN0,
|
||||
GPIO_FN_MFG3_IN1,
|
||||
GPIO_FN_PORT163_SCIFB_RTS, GPIO_FN_PORT163_SCIFA5_RTS, GPIO_FN_XRTS0,
|
||||
GPIO_FN_MFG3_OUT1,
|
||||
GPIO_FN_TPU3TO0,
|
||||
GPIO_FN_LCDD0, GPIO_FN_PORT192_KEYOUT0, GPIO_FN_EXT_CKI,
|
||||
GPIO_FN_LCDD1, GPIO_FN_PORT193_KEYOUT1, GPIO_FN_PORT193_SCIFA5_CTS,
|
||||
GPIO_FN_BBIF2_TSYNC1,
|
||||
GPIO_FN_LCDD2, GPIO_FN_PORT194_KEYOUT2, GPIO_FN_PORT194_SCIFA5_RTS,
|
||||
GPIO_FN_BBIF2_TSCK1,
|
||||
GPIO_FN_LCDD3, GPIO_FN_PORT195_KEYOUT3, GPIO_FN_PORT195_SCIFA5_RXD,
|
||||
GPIO_FN_BBIF2_TXD1,
|
||||
GPIO_FN_LCDD4, GPIO_FN_PORT196_KEYOUT4, GPIO_FN_PORT196_SCIFA5_TXD,
|
||||
GPIO_FN_LCDD5, GPIO_FN_PORT197_KEYOUT5, GPIO_FN_PORT197_SCIFA5_SCK,
|
||||
GPIO_FN_MFG2_OUT2, GPIO_FN_TPU2TO1,
|
||||
GPIO_FN_LCDD6, GPIO_FN_XWR2,
|
||||
GPIO_FN_LCDD7, GPIO_FN_TPU4TO1, GPIO_FN_MFG4_OUT2, GPIO_FN_XWR3,
|
||||
GPIO_FN_LCDD8, GPIO_FN_PORT200_KEYIN0, GPIO_FN_VIO_DR0, GPIO_FN_D16,
|
||||
GPIO_FN_ED16,
|
||||
GPIO_FN_LCDD9, GPIO_FN_PORT201_KEYIN1, GPIO_FN_VIO_DR1, GPIO_FN_D17,
|
||||
GPIO_FN_ED17,
|
||||
GPIO_FN_LCDD10, GPIO_FN_PORT202_KEYIN2, GPIO_FN_VIO_DR2, GPIO_FN_D18,
|
||||
GPIO_FN_ED18,
|
||||
GPIO_FN_LCDD11, GPIO_FN_PORT203_KEYIN3, GPIO_FN_VIO_DR3, GPIO_FN_D19,
|
||||
GPIO_FN_ED19,
|
||||
GPIO_FN_LCDD12, GPIO_FN_PORT204_KEYIN4, GPIO_FN_VIO_DR4, GPIO_FN_D20,
|
||||
GPIO_FN_ED20,
|
||||
GPIO_FN_LCDD13, GPIO_FN_PORT205_KEYIN5, GPIO_FN_VIO_DR5, GPIO_FN_D21,
|
||||
GPIO_FN_ED21,
|
||||
GPIO_FN_LCDD14, GPIO_FN_PORT206_KEYIN6, GPIO_FN_VIO_DR6, GPIO_FN_D22,
|
||||
GPIO_FN_ED22,
|
||||
GPIO_FN_LCDD15, GPIO_FN_PORT207_MSIOF0L_SS1, GPIO_FN_PORT207_KEYOUT0,
|
||||
GPIO_FN_VIO_DR7,
|
||||
GPIO_FN_D23, GPIO_FN_ED23,
|
||||
GPIO_FN_LCDD16, GPIO_FN_PORT208_MSIOF0L_SS2, GPIO_FN_PORT208_KEYOUT1,
|
||||
GPIO_FN_VIO_VDR,
|
||||
GPIO_FN_D24, GPIO_FN_ED24,
|
||||
GPIO_FN_LCDD17, GPIO_FN_PORT209_KEYOUT2, GPIO_FN_VIO_HDR, GPIO_FN_D25,
|
||||
GPIO_FN_ED25,
|
||||
GPIO_FN_LCDD18, GPIO_FN_DREQ2, GPIO_FN_PORT210_MSIOF0L_SS1, GPIO_FN_D26,
|
||||
GPIO_FN_ED26,
|
||||
GPIO_FN_LCDD19, GPIO_FN_PORT211_MSIOF0L_SS2, GPIO_FN_D27, GPIO_FN_ED27,
|
||||
GPIO_FN_LCDD20, GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0, GPIO_FN_D28,
|
||||
GPIO_FN_ED28,
|
||||
GPIO_FN_LCDD21, GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1, GPIO_FN_D29,
|
||||
GPIO_FN_ED29,
|
||||
GPIO_FN_LCDD22, GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_RSCK, GPIO_FN_D30,
|
||||
GPIO_FN_ED30,
|
||||
GPIO_FN_LCDD23, GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_RSYNC, GPIO_FN_D31,
|
||||
GPIO_FN_ED31,
|
||||
GPIO_FN_LCDDCK, GPIO_FN_LCDWR, GPIO_FN_PORT216_KEYOUT3,
|
||||
GPIO_FN_VIO_CLKR,
|
||||
GPIO_FN_LCDRD, GPIO_FN_DACK2, GPIO_FN_MSIOF0L_TSYNC,
|
||||
GPIO_FN_LCDHSYN, GPIO_FN_LCDCS, GPIO_FN_LCDCS2, GPIO_FN_DACK3,
|
||||
GPIO_FN_PORT218_VIO_CKOR, GPIO_FN_PORT218_KEYOUT4,
|
||||
GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_TSCK,
|
||||
GPIO_FN_LCDVSYN, GPIO_FN_LCDVSYN2, GPIO_FN_PORT220_KEYOUT5,
|
||||
GPIO_FN_LCDLCLK, GPIO_FN_DREQ1, GPIO_FN_PWEN, GPIO_FN_MSIOF0L_RXD,
|
||||
GPIO_FN_LCDDON, GPIO_FN_LCDDON2, GPIO_FN_DACK1, GPIO_FN_OVCN,
|
||||
GPIO_FN_MSIOF0L_TXD,
|
||||
GPIO_FN_SCIFA1_TXD, GPIO_FN_OVCN2,
|
||||
GPIO_FN_EXTLP, GPIO_FN_SCIFA1_SCK, GPIO_FN_USBTERM,
|
||||
GPIO_FN_PORT226_VIO_CKO2,
|
||||
GPIO_FN_SCIFA1_RTS, GPIO_FN_IDIN,
|
||||
GPIO_FN_SCIFA1_RXD,
|
||||
GPIO_FN_SCIFA1_CTS, GPIO_FN_MFG1_IN1,
|
||||
GPIO_FN_MSIOF1_TXD, GPIO_FN_SCIFA2_TXD2, GPIO_FN_PORT230_FSIAOMC,
|
||||
GPIO_FN_MSIOF1_TSYNC, GPIO_FN_SCIFA2_CTS2, GPIO_FN_PORT231_FSIAOLR,
|
||||
GPIO_FN_MSIOF1_TSCK, GPIO_FN_SCIFA2_SCK2, GPIO_FN_PORT232_FSIAOBT,
|
||||
GPIO_FN_MSIOF1_RXD, GPIO_FN_SCIFA2_RXD2, GPIO_FN_GPS_VCOTRIG,
|
||||
GPIO_FN_PORT233_FSIACK,
|
||||
GPIO_FN_MSIOF1_RSCK, GPIO_FN_SCIFA2_RTS2, GPIO_FN_PORT234_FSIAOSLD,
|
||||
GPIO_FN_MSIOF1_RSYNC, GPIO_FN_OPORT0, GPIO_FN_MFG1_IN2,
|
||||
GPIO_FN_PORT235_FSIAILR,
|
||||
GPIO_FN_MSIOF1_MCK0, GPIO_FN_I2C_SDA2, GPIO_FN_PORT236_FSIAIBT,
|
||||
GPIO_FN_MSIOF1_MCK1, GPIO_FN_I2C_SCL2, GPIO_FN_PORT237_FSIAISLD,
|
||||
GPIO_FN_MSIOF1_SS1, GPIO_FN_EDBGREQ3,
|
||||
|
||||
/* 55-5 (FN) */
|
||||
GPIO_FN_MSIOF1_SS2,
|
||||
GPIO_FN_SCIFA6_TXD,
|
||||
GPIO_FN_PORT241_IRDA_OUT, GPIO_FN_PORT241_IROUT, GPIO_FN_MFG4_OUT1,
|
||||
GPIO_FN_TPU4TO0,
|
||||
GPIO_FN_PORT242_IRDA_IN, GPIO_FN_MFG4_IN2,
|
||||
GPIO_FN_PORT243_IRDA_FIRSEL, GPIO_FN_PORT243_VIO_CKO2,
|
||||
GPIO_FN_PORT244_SCIFA5_CTS, GPIO_FN_MFG2_IN1, GPIO_FN_PORT244_SCIFB_CTS,
|
||||
GPIO_FN_PORT244_MSIOF2_RXD,
|
||||
GPIO_FN_PORT245_SCIFA5_RTS, GPIO_FN_MFG2_IN2, GPIO_FN_PORT245_SCIFB_RTS,
|
||||
GPIO_FN_PORT245_MSIOF2_TXD,
|
||||
GPIO_FN_PORT246_SCIFA5_RXD, GPIO_FN_MFG1_OUT1,
|
||||
GPIO_FN_PORT246_SCIFB_RXD, GPIO_FN_TPU1TO0,
|
||||
GPIO_FN_PORT247_SCIFA5_TXD, GPIO_FN_MFG3_OUT2,
|
||||
GPIO_FN_PORT247_SCIFB_TXD, GPIO_FN_TPU3TO1,
|
||||
GPIO_FN_PORT248_SCIFA5_SCK, GPIO_FN_MFG2_OUT1,
|
||||
GPIO_FN_PORT248_SCIFB_SCK, GPIO_FN_TPU2TO0,
|
||||
GPIO_FN_PORT248_MSIOF2_TSCK,
|
||||
GPIO_FN_PORT249_IROUT, GPIO_FN_MFG4_IN1, GPIO_FN_PORT249_MSIOF2_TSYNC,
|
||||
GPIO_FN_SDHICLK0, GPIO_FN_TCK2_SWCLK_MC0,
|
||||
GPIO_FN_SDHICD0,
|
||||
GPIO_FN_SDHID0_0, GPIO_FN_TMS2_SWDIO_MC0,
|
||||
GPIO_FN_SDHID0_1, GPIO_FN_TDO2_SWO0_MC0,
|
||||
GPIO_FN_SDHID0_2, GPIO_FN_TDI2,
|
||||
GPIO_FN_SDHID0_3, GPIO_FN_RTCK2_SWO1_MC0,
|
||||
GPIO_FN_SDHICMD0, GPIO_FN_TRST2,
|
||||
GPIO_FN_SDHIWP0, GPIO_FN_EDBGREQ2,
|
||||
GPIO_FN_SDHICLK1, GPIO_FN_TCK3_SWCLK_MC1,
|
||||
GPIO_FN_SDHID1_0, GPIO_FN_M11_SLCD_SO2, GPIO_FN_TS_SPSYNC2,
|
||||
GPIO_FN_TMS3_SWDIO_MC1,
|
||||
GPIO_FN_SDHID1_1, GPIO_FN_M9_SLCD_A02, GPIO_FN_TS_SDAT2,
|
||||
GPIO_FN_TDO3_SWO0_MC1,
|
||||
GPIO_FN_SDHID1_2, GPIO_FN_M10_SLCD_CK2, GPIO_FN_TS_SDEN2, GPIO_FN_TDI3,
|
||||
GPIO_FN_SDHID1_3, GPIO_FN_M12_SLCD_CE2, GPIO_FN_TS_SCK2,
|
||||
GPIO_FN_RTCK3_SWO1_MC1,
|
||||
GPIO_FN_SDHICMD1, GPIO_FN_TRST3,
|
||||
GPIO_FN_RESETOUTS,
|
||||
};
|
||||
|
||||
#endif /* __ASM_SH7377_H__ */
|
||||
|
|
@ -1,413 +0,0 @@
|
|||
/*
|
||||
* sh7367 processor support - INTC hardware block
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
*
|
||||
* 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/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sh_intc.h>
|
||||
#include <mach/intc.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
enum {
|
||||
UNUSED_INTCA = 0,
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
|
||||
/* interrupt sources INTCA */
|
||||
DIRC,
|
||||
CRYPT1_ERR, CRYPT2_STD,
|
||||
IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
|
||||
ARM11_IRQPMU, ARM11_COMMTX, ARM11_COMMRX,
|
||||
ETM11_ACQCMP, ETM11_FULL,
|
||||
MFI_MFIM, MFI_MFIS,
|
||||
BBIF1, BBIF2,
|
||||
USBDMAC_USHDMI,
|
||||
USBHS_USHI0, USBHS_USHI1,
|
||||
CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
|
||||
KEYSC_KEY,
|
||||
SCIFA0, SCIFA1, SCIFA2, SCIFA3,
|
||||
MSIOF2, MSIOF1,
|
||||
SCIFA4, SCIFA5, SCIFB,
|
||||
FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
|
||||
SDHI0,
|
||||
SDHI1,
|
||||
MSU_MSU, MSU_MSU2,
|
||||
IREM,
|
||||
SIU,
|
||||
SPU,
|
||||
IRDA,
|
||||
TPU0, TPU1, TPU2, TPU3, TPU4,
|
||||
LCRC,
|
||||
PINT1, PINT2,
|
||||
TTI20,
|
||||
MISTY,
|
||||
DDM,
|
||||
SDHI2,
|
||||
RWDT0, RWDT1,
|
||||
DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
|
||||
DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
|
||||
DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
|
||||
DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
|
||||
DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
|
||||
DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
|
||||
|
||||
/* interrupt groups INTCA */
|
||||
DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2,
|
||||
ETM11, ARM11, USBHS, FLCTL, IIC1
|
||||
};
|
||||
|
||||
static struct intc_vect intca_vectors[] __initdata = {
|
||||
INTC_VECT(DIRC, 0x0560),
|
||||
INTC_VECT(CRYPT1_ERR, 0x05e0),
|
||||
INTC_VECT(CRYPT2_STD, 0x0700),
|
||||
INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
|
||||
INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
|
||||
INTC_VECT(ARM11_IRQPMU, 0x0800), INTC_VECT(ARM11_COMMTX, 0x0840),
|
||||
INTC_VECT(ARM11_COMMRX, 0x0860),
|
||||
INTC_VECT(ETM11_ACQCMP, 0x0880), INTC_VECT(ETM11_FULL, 0x08a0),
|
||||
INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
|
||||
INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
|
||||
INTC_VECT(USBDMAC_USHDMI, 0x0a00),
|
||||
INTC_VECT(USBHS_USHI0, 0x0a20), INTC_VECT(USBHS_USHI1, 0x0a40),
|
||||
INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
|
||||
INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
|
||||
INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
|
||||
INTC_VECT(KEYSC_KEY, 0x0be0),
|
||||
INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
|
||||
INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
|
||||
INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
|
||||
INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
|
||||
INTC_VECT(SCIFB, 0x0d60),
|
||||
INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
|
||||
INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
|
||||
INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
|
||||
INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
|
||||
INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
|
||||
INTC_VECT(SDHI1, 0x0ec0), INTC_VECT(SDHI1, 0x0ee0),
|
||||
INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
|
||||
INTC_VECT(IREM, 0x0f60),
|
||||
INTC_VECT(SIU, 0x0fa0),
|
||||
INTC_VECT(SPU, 0x0fc0),
|
||||
INTC_VECT(IRDA, 0x0480),
|
||||
INTC_VECT(TPU0, 0x04a0), INTC_VECT(TPU1, 0x04c0),
|
||||
INTC_VECT(TPU2, 0x04e0), INTC_VECT(TPU3, 0x0500),
|
||||
INTC_VECT(TPU4, 0x0520),
|
||||
INTC_VECT(LCRC, 0x0540),
|
||||
INTC_VECT(PINT1, 0x1000), INTC_VECT(PINT2, 0x1020),
|
||||
INTC_VECT(TTI20, 0x1100),
|
||||
INTC_VECT(MISTY, 0x1120),
|
||||
INTC_VECT(DDM, 0x1140),
|
||||
INTC_VECT(SDHI2, 0x1200), INTC_VECT(SDHI2, 0x1220),
|
||||
INTC_VECT(SDHI2, 0x1240), INTC_VECT(SDHI2, 0x1260),
|
||||
INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
|
||||
INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
|
||||
INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
|
||||
INTC_VECT(DMAC_2_DEI4, 0x2080), INTC_VECT(DMAC_2_DEI5, 0x20a0),
|
||||
INTC_VECT(DMAC_2_DADERR, 0x20c0),
|
||||
INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
|
||||
INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
|
||||
INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
|
||||
INTC_VECT(DMAC2_2_DADERR, 0x21c0),
|
||||
INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
|
||||
INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
|
||||
INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
|
||||
INTC_VECT(DMAC3_2_DADERR, 0x22c0),
|
||||
};
|
||||
|
||||
static struct intc_group intca_groups[] __initdata = {
|
||||
INTC_GROUP(DMAC_1, DMAC_1_DEI0,
|
||||
DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3),
|
||||
INTC_GROUP(DMAC_2, DMAC_2_DEI4,
|
||||
DMAC_2_DEI5, DMAC_2_DADERR),
|
||||
INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
|
||||
DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
|
||||
INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
|
||||
DMAC2_2_DEI5, DMAC2_2_DADERR),
|
||||
INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
|
||||
DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
|
||||
INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
|
||||
DMAC3_2_DEI5, DMAC3_2_DADERR),
|
||||
INTC_GROUP(ETM11, ETM11_ACQCMP, ETM11_FULL),
|
||||
INTC_GROUP(ARM11, ARM11_IRQPMU, ARM11_COMMTX, ARM11_COMMTX),
|
||||
INTC_GROUP(USBHS, USBHS_USHI0, USBHS_USHI1),
|
||||
INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
|
||||
FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
|
||||
INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
|
||||
};
|
||||
|
||||
static struct intc_mask_reg intca_mask_registers[] __initdata = {
|
||||
{ 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
|
||||
{ DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
|
||||
ARM11_IRQPMU, 0, ARM11_COMMTX, ARM11_COMMRX } },
|
||||
{ 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
|
||||
{ CRYPT1_ERR, CRYPT2_STD, DIRC, 0,
|
||||
DMAC_1_DEI3, DMAC_1_DEI2, DMAC_1_DEI1, DMAC_1_DEI0 } },
|
||||
{ 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
|
||||
{ PINT1, PINT2, 0, 0,
|
||||
BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
|
||||
{ 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
|
||||
{ DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
|
||||
DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
|
||||
{ 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
|
||||
{ DDM, 0, 0, 0,
|
||||
0, 0, ETM11_FULL, ETM11_ACQCMP } },
|
||||
{ 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
|
||||
{ KEYSC_KEY, DMAC_2_DADERR, DMAC_2_DEI5, DMAC_2_DEI4,
|
||||
SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
|
||||
{ 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
|
||||
{ SCIFB, SCIFA5, SCIFA4, MSIOF1,
|
||||
0, 0, MSIOF2, 0 } },
|
||||
{ 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
|
||||
{ DISABLED, ENABLED, ENABLED, ENABLED,
|
||||
FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
|
||||
{ 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
|
||||
{ DISABLED, ENABLED, ENABLED, ENABLED,
|
||||
TTI20, USBDMAC_USHDMI, SPU, SIU } },
|
||||
{ 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
|
||||
{ CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
|
||||
CMT2, USBHS_USHI1, USBHS_USHI0, 0 } },
|
||||
{ 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
|
||||
{ 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
|
||||
{ IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
|
||||
LCRC, MSU_MSU2, IREM, MSU_MSU } },
|
||||
{ 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
|
||||
{ 0, 0, TPU0, TPU1,
|
||||
TPU2, TPU3, TPU4, 0 } },
|
||||
{ 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
|
||||
{ DISABLED, ENABLED, ENABLED, ENABLED,
|
||||
MISTY, CMT3, RWDT1, RWDT0 } },
|
||||
};
|
||||
|
||||
static struct intc_prio_reg intca_prio_registers[] __initdata = {
|
||||
{ 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, LCRC } },
|
||||
{ 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, ETM11, BBIF1, BBIF2 } },
|
||||
{ 0xe6940008, 0, 16, 4, /* IPRCA */ { CRYPT1_ERR, CRYPT2_STD,
|
||||
CMT1_CMT11, ARM11 } },
|
||||
{ 0xe694000c, 0, 16, 4, /* IPRDA */ { PINT1, PINT2,
|
||||
CMT1_CMT12, TPU4 } },
|
||||
{ 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC_1, MFI_MFIS,
|
||||
MFI_MFIM, USBHS } },
|
||||
{ 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC_2,
|
||||
0, CMT1_CMT10 } },
|
||||
{ 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
|
||||
SCIFA2, SCIFA3 } },
|
||||
{ 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBDMAC_USHDMI,
|
||||
FLCTL, SDHI0 } },
|
||||
{ 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, MSU_MSU, IIC1 } },
|
||||
{ 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, SIU, TTI20 } },
|
||||
{ 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IREM, SDHI1 } },
|
||||
{ 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, TPU1, TPU2, TPU3 } },
|
||||
{ 0xe6940030, 0, 16, 4, /* IPRMA */ { MISTY, CMT3, RWDT1, RWDT0 } },
|
||||
{ 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, SPU, DDM } },
|
||||
{ 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } },
|
||||
};
|
||||
|
||||
static struct intc_desc intca_desc __initdata = {
|
||||
.name = "sh7367-intca",
|
||||
.force_enable = ENABLED,
|
||||
.force_disable = DISABLED,
|
||||
.hw = INTC_HW_DESC(intca_vectors, intca_groups,
|
||||
intca_mask_registers, intca_prio_registers,
|
||||
NULL, NULL),
|
||||
};
|
||||
|
||||
INTC_IRQ_PINS_16(intca_irq_pins, 0xe6900000,
|
||||
INTC_VECT, "sh7367-intca-irq-pins");
|
||||
|
||||
enum {
|
||||
UNUSED_INTCS = 0,
|
||||
|
||||
INTCS,
|
||||
|
||||
/* interrupt sources INTCS */
|
||||
VIO2_VEU0, VIO2_VEU1, VIO2_VEU2, VIO2_VEU3,
|
||||
VIO3_VOU,
|
||||
RTDMAC_1_DEI0, RTDMAC_1_DEI1, RTDMAC_1_DEI2, RTDMAC_1_DEI3,
|
||||
VIO1_CEU, VIO1_BEU0, VIO1_BEU1, VIO1_BEU2,
|
||||
VPU,
|
||||
SGX530,
|
||||
_2DDMAC_2DDM0, _2DDMAC_2DDM1, _2DDMAC_2DDM2, _2DDMAC_2DDM3,
|
||||
IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
|
||||
IPMMU_IPMMUB, IPMMU_IPMMUS,
|
||||
RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR,
|
||||
MSIOF,
|
||||
IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0,
|
||||
TMU_TUNI0, TMU_TUNI1, TMU_TUNI2,
|
||||
CMT,
|
||||
TSIF,
|
||||
IPMMUI,
|
||||
MVI3,
|
||||
ICB,
|
||||
PEP,
|
||||
ASA,
|
||||
BEM,
|
||||
VE2HO,
|
||||
HQE,
|
||||
JPEG,
|
||||
LCDC,
|
||||
|
||||
/* interrupt groups INTCS */
|
||||
_2DDMAC, RTDMAC_1, RTDMAC_2, VEU, BEU, IIC0, IPMMU, IIC2,
|
||||
};
|
||||
|
||||
static struct intc_vect intcs_vectors[] = {
|
||||
INTCS_VECT(VIO2_VEU0, 0x700), INTCS_VECT(VIO2_VEU1, 0x720),
|
||||
INTCS_VECT(VIO2_VEU2, 0x740), INTCS_VECT(VIO2_VEU3, 0x760),
|
||||
INTCS_VECT(VIO3_VOU, 0x780),
|
||||
INTCS_VECT(RTDMAC_1_DEI0, 0x800), INTCS_VECT(RTDMAC_1_DEI1, 0x820),
|
||||
INTCS_VECT(RTDMAC_1_DEI2, 0x840), INTCS_VECT(RTDMAC_1_DEI3, 0x860),
|
||||
INTCS_VECT(VIO1_CEU, 0x880), INTCS_VECT(VIO1_BEU0, 0x8a0),
|
||||
INTCS_VECT(VIO1_BEU1, 0x8c0), INTCS_VECT(VIO1_BEU2, 0x8e0),
|
||||
INTCS_VECT(VPU, 0x980),
|
||||
INTCS_VECT(SGX530, 0x9e0),
|
||||
INTCS_VECT(_2DDMAC_2DDM0, 0xa00), INTCS_VECT(_2DDMAC_2DDM1, 0xa20),
|
||||
INTCS_VECT(_2DDMAC_2DDM2, 0xa40), INTCS_VECT(_2DDMAC_2DDM3, 0xa60),
|
||||
INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0),
|
||||
INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0),
|
||||
INTCS_VECT(IPMMU_IPMMUB, 0xb20), INTCS_VECT(IPMMU_IPMMUS, 0xb60),
|
||||
INTCS_VECT(RTDMAC_2_DEI4, 0xb80), INTCS_VECT(RTDMAC_2_DEI5, 0xba0),
|
||||
INTCS_VECT(RTDMAC_2_DADERR, 0xbc0),
|
||||
INTCS_VECT(MSIOF, 0xd20),
|
||||
INTCS_VECT(IIC0_ALI0, 0xe00), INTCS_VECT(IIC0_TACKI0, 0xe20),
|
||||
INTCS_VECT(IIC0_WAITI0, 0xe40), INTCS_VECT(IIC0_DTEI0, 0xe60),
|
||||
INTCS_VECT(TMU_TUNI0, 0xe80), INTCS_VECT(TMU_TUNI1, 0xea0),
|
||||
INTCS_VECT(TMU_TUNI2, 0xec0),
|
||||
INTCS_VECT(CMT, 0xf00),
|
||||
INTCS_VECT(TSIF, 0xf20),
|
||||
INTCS_VECT(IPMMUI, 0xf60),
|
||||
INTCS_VECT(MVI3, 0x420),
|
||||
INTCS_VECT(ICB, 0x480),
|
||||
INTCS_VECT(PEP, 0x4a0),
|
||||
INTCS_VECT(ASA, 0x4c0),
|
||||
INTCS_VECT(BEM, 0x4e0),
|
||||
INTCS_VECT(VE2HO, 0x520),
|
||||
INTCS_VECT(HQE, 0x540),
|
||||
INTCS_VECT(JPEG, 0x560),
|
||||
INTCS_VECT(LCDC, 0x580),
|
||||
|
||||
INTC_VECT(INTCS, 0xf80),
|
||||
};
|
||||
|
||||
static struct intc_group intcs_groups[] __initdata = {
|
||||
INTC_GROUP(_2DDMAC, _2DDMAC_2DDM0, _2DDMAC_2DDM1,
|
||||
_2DDMAC_2DDM2, _2DDMAC_2DDM3),
|
||||
INTC_GROUP(RTDMAC_1, RTDMAC_1_DEI0, RTDMAC_1_DEI1,
|
||||
RTDMAC_1_DEI2, RTDMAC_1_DEI3),
|
||||
INTC_GROUP(RTDMAC_2, RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR),
|
||||
INTC_GROUP(VEU, VIO2_VEU0, VIO2_VEU1, VIO2_VEU2, VIO2_VEU3),
|
||||
INTC_GROUP(BEU, VIO1_BEU0, VIO1_BEU1, VIO1_BEU2),
|
||||
INTC_GROUP(IIC0, IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0),
|
||||
INTC_GROUP(IPMMU, IPMMU_IPMMUS, IPMMU_IPMMUB),
|
||||
INTC_GROUP(IIC2, IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2),
|
||||
};
|
||||
|
||||
static struct intc_mask_reg intcs_mask_registers[] = {
|
||||
{ 0xffd20184, 0xffd201c4, 8, /* IMR1SA / IMCR1SA */
|
||||
{ VIO1_BEU2, VIO1_BEU1, VIO1_BEU0, VIO1_CEU,
|
||||
VIO2_VEU3, VIO2_VEU2, VIO2_VEU1, VIO2_VEU0 } },
|
||||
{ 0xffd20188, 0xffd201c8, 8, /* IMR2SA / IMCR2SA */
|
||||
{ VIO3_VOU, 0, VE2HO, VPU,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xffd2018c, 0xffd201cc, 8, /* IMR3SA / IMCR3SA */
|
||||
{ _2DDMAC_2DDM3, _2DDMAC_2DDM2, _2DDMAC_2DDM1, _2DDMAC_2DDM0,
|
||||
BEM, ASA, PEP, ICB } },
|
||||
{ 0xffd20190, 0xffd201d0, 8, /* IMR4SA / IMCR4SA */
|
||||
{ 0, 0, MVI3, 0,
|
||||
JPEG, HQE, 0, LCDC } },
|
||||
{ 0xffd20194, 0xffd201d4, 8, /* IMR5SA / IMCR5SA */
|
||||
{ 0, RTDMAC_2_DADERR, RTDMAC_2_DEI5, RTDMAC_2_DEI4,
|
||||
RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } },
|
||||
{ 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */
|
||||
{ 0, 0, MSIOF, 0,
|
||||
SGX530, 0, 0, 0 } },
|
||||
{ 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */
|
||||
{ 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xffd201a4, 0xffd201e4, 8, /* IMR9SA / IMCR9SA */
|
||||
{ 0, 0, 0, CMT,
|
||||
IIC2_DTEI2, IIC2_WAITI2, IIC2_TACKI2, IIC2_ALI2 } },
|
||||
{ 0xffd201a8, 0xffd201e8, 8, /* IMR10SA / IMCR10SA */
|
||||
{ IPMMU_IPMMUS, 0, IPMMU_IPMMUB, 0,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xffd201ac, 0xffd201ec, 8, /* IMR11SA / IMCR11SA */
|
||||
{ IIC0_DTEI0, IIC0_WAITI0, IIC0_TACKI0, IIC0_ALI0,
|
||||
0, 0, IPMMUI, TSIF } },
|
||||
{ 0xffd20104, 0, 16, /* INTAMASK */
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, INTCS } },
|
||||
};
|
||||
|
||||
/* Priority is needed for INTCA to receive the INTCS interrupt */
|
||||
static struct intc_prio_reg intcs_prio_registers[] = {
|
||||
{ 0xffd20000, 0, 16, 4, /* IPRAS */ { 0, MVI3, _2DDMAC, ICB } },
|
||||
{ 0xffd20004, 0, 16, 4, /* IPRBS */ { JPEG, LCDC, 0, 0 } },
|
||||
{ 0xffd20008, 0, 16, 4, /* IPRCS */ { BBIF2, 0, 0, 0 } },
|
||||
{ 0xffd20010, 0, 16, 4, /* IPRES */ { RTDMAC_1, VIO1_CEU, 0, VPU } },
|
||||
{ 0xffd20014, 0, 16, 4, /* IPRFS */ { 0, RTDMAC_2, 0, CMT } },
|
||||
{ 0xffd20018, 0, 16, 4, /* IPRGS */ { TMU_TUNI0, TMU_TUNI1,
|
||||
TMU_TUNI2, 0 } },
|
||||
{ 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, VIO3_VOU, VEU, BEU } },
|
||||
{ 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF, IIC0 } },
|
||||
{ 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, SGX530, 0, 0 } },
|
||||
{ 0xffd20028, 0, 16, 4, /* IPRKS */ { BEM, ASA, IPMMUI, PEP } },
|
||||
{ 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, VE2HO, HQE } },
|
||||
{ 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } },
|
||||
};
|
||||
|
||||
static struct resource intcs_resources[] __initdata = {
|
||||
[0] = {
|
||||
.start = 0xffd20000,
|
||||
.end = 0xffd2ffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct intc_desc intcs_desc __initdata = {
|
||||
.name = "sh7367-intcs",
|
||||
.resource = intcs_resources,
|
||||
.num_resources = ARRAY_SIZE(intcs_resources),
|
||||
.hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
|
||||
intcs_prio_registers, NULL, NULL),
|
||||
};
|
||||
|
||||
static void intcs_demux(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
void __iomem *reg = (void *)irq_get_handler_data(irq);
|
||||
unsigned int evtcodeas = ioread32(reg);
|
||||
|
||||
generic_handle_irq(intcs_evt2irq(evtcodeas));
|
||||
}
|
||||
|
||||
void __init sh7367_init_irq(void)
|
||||
{
|
||||
void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
|
||||
|
||||
register_intc_controller(&intca_desc);
|
||||
register_intc_controller(&intca_irq_pins_desc);
|
||||
register_intc_controller(&intcs_desc);
|
||||
|
||||
/* demux using INTEVTSA */
|
||||
irq_set_handler_data(evt2irq(0xf80), (void *)intevtsa);
|
||||
irq_set_chained_handler(evt2irq(0xf80), intcs_demux);
|
||||
}
|
||||
|
|
@ -1,592 +0,0 @@
|
|||
/*
|
||||
* sh7377 processor support - INTC hardware block
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
*
|
||||
* 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/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sh_intc.h>
|
||||
#include <mach/intc.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
enum {
|
||||
UNUSED_INTCA = 0,
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
|
||||
/* interrupt sources INTCA */
|
||||
DIRC,
|
||||
_2DG,
|
||||
CRYPT_STD,
|
||||
IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
|
||||
AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX,
|
||||
MFI_MFIM, MFI_MFIS,
|
||||
BBIF1, BBIF2,
|
||||
USBDMAC_USHDMI,
|
||||
USBHS_USHI0, USBHS_USHI1,
|
||||
_3DG_SGX540,
|
||||
CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
|
||||
KEYSC_KEY,
|
||||
SCIFA0, SCIFA1, SCIFA2, SCIFA3,
|
||||
MSIOF2, MSIOF1,
|
||||
SCIFA4, SCIFA5, SCIFB,
|
||||
FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
|
||||
SDHI0,
|
||||
SDHI1,
|
||||
MSU_MSU, MSU_MSU2,
|
||||
IRREM,
|
||||
MSUG,
|
||||
IRDA,
|
||||
TPU0, TPU1, TPU2, TPU3, TPU4,
|
||||
LCRC,
|
||||
PINTCA_PINT1, PINTCA_PINT2,
|
||||
TTI20,
|
||||
MISTY,
|
||||
DDM,
|
||||
RWDT0, RWDT1,
|
||||
DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
|
||||
DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
|
||||
DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
|
||||
DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
|
||||
DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
|
||||
DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
|
||||
SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM,
|
||||
ICUSB_ICUSB0, ICUSB_ICUSB1,
|
||||
ICUDMC_ICUDMC1, ICUDMC_ICUDMC2,
|
||||
SPU2_SPU0, SPU2_SPU1,
|
||||
FSI,
|
||||
FMSI,
|
||||
SCUV,
|
||||
IPMMU_IPMMUB,
|
||||
AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, AP_ARM_DMAIRQ, AP_ARM_DMASIRQ,
|
||||
MFIS2,
|
||||
CPORTR2S,
|
||||
CMT14, CMT15,
|
||||
SCIFA6,
|
||||
|
||||
/* interrupt groups INTCA */
|
||||
DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
|
||||
AP_ARM1, AP_ARM2, USBHS, SPU2, FLCTL, IIC1,
|
||||
ICUSB, ICUDMC
|
||||
};
|
||||
|
||||
static struct intc_vect intca_vectors[] __initdata = {
|
||||
INTC_VECT(DIRC, 0x0560),
|
||||
INTC_VECT(_2DG, 0x05e0),
|
||||
INTC_VECT(CRYPT_STD, 0x0700),
|
||||
INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
|
||||
INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
|
||||
INTC_VECT(AP_ARM_IRQPMU, 0x0800), INTC_VECT(AP_ARM_COMMTX, 0x0840),
|
||||
INTC_VECT(AP_ARM_COMMRX, 0x0860),
|
||||
INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
|
||||
INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
|
||||
INTC_VECT(USBDMAC_USHDMI, 0x0a00),
|
||||
INTC_VECT(USBHS_USHI0, 0x0a20), INTC_VECT(USBHS_USHI1, 0x0a40),
|
||||
INTC_VECT(_3DG_SGX540, 0x0a60),
|
||||
INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
|
||||
INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
|
||||
INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
|
||||
INTC_VECT(KEYSC_KEY, 0x0be0),
|
||||
INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
|
||||
INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
|
||||
INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
|
||||
INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
|
||||
INTC_VECT(SCIFB, 0x0d60),
|
||||
INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
|
||||
INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
|
||||
INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
|
||||
INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
|
||||
INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
|
||||
INTC_VECT(SDHI1, 0x0ec0), INTC_VECT(SDHI1, 0x0ee0),
|
||||
INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
|
||||
INTC_VECT(IRREM, 0x0f60),
|
||||
INTC_VECT(MSUG, 0x0fa0),
|
||||
INTC_VECT(IRDA, 0x0480),
|
||||
INTC_VECT(TPU0, 0x04a0), INTC_VECT(TPU1, 0x04c0),
|
||||
INTC_VECT(TPU2, 0x04e0), INTC_VECT(TPU3, 0x0500),
|
||||
INTC_VECT(TPU4, 0x0520),
|
||||
INTC_VECT(LCRC, 0x0540),
|
||||
INTC_VECT(PINTCA_PINT1, 0x1000), INTC_VECT(PINTCA_PINT2, 0x1020),
|
||||
INTC_VECT(TTI20, 0x1100),
|
||||
INTC_VECT(MISTY, 0x1120),
|
||||
INTC_VECT(DDM, 0x1140),
|
||||
INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
|
||||
INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
|
||||
INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
|
||||
INTC_VECT(DMAC_2_DEI4, 0x2080), INTC_VECT(DMAC_2_DEI5, 0x20a0),
|
||||
INTC_VECT(DMAC_2_DADERR, 0x20c0),
|
||||
INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
|
||||
INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
|
||||
INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
|
||||
INTC_VECT(DMAC2_2_DADERR, 0x21c0),
|
||||
INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
|
||||
INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
|
||||
INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
|
||||
INTC_VECT(DMAC3_2_DADERR, 0x22c0),
|
||||
INTC_VECT(SHWYSTAT_RT, 0x1300), INTC_VECT(SHWYSTAT_HS, 0x1d20),
|
||||
INTC_VECT(SHWYSTAT_COM, 0x1340),
|
||||
INTC_VECT(ICUSB_ICUSB0, 0x1700), INTC_VECT(ICUSB_ICUSB1, 0x1720),
|
||||
INTC_VECT(ICUDMC_ICUDMC1, 0x1780), INTC_VECT(ICUDMC_ICUDMC2, 0x17a0),
|
||||
INTC_VECT(SPU2_SPU0, 0x1800), INTC_VECT(SPU2_SPU1, 0x1820),
|
||||
INTC_VECT(FSI, 0x1840),
|
||||
INTC_VECT(FMSI, 0x1860),
|
||||
INTC_VECT(SCUV, 0x1880),
|
||||
INTC_VECT(IPMMU_IPMMUB, 0x1900),
|
||||
INTC_VECT(AP_ARM_CTIIRQ, 0x1980),
|
||||
INTC_VECT(AP_ARM_DMAEXTERRIRQ, 0x19a0),
|
||||
INTC_VECT(AP_ARM_DMAIRQ, 0x19c0),
|
||||
INTC_VECT(AP_ARM_DMASIRQ, 0x19e0),
|
||||
INTC_VECT(MFIS2, 0x1a00),
|
||||
INTC_VECT(CPORTR2S, 0x1a20),
|
||||
INTC_VECT(CMT14, 0x1a40), INTC_VECT(CMT15, 0x1a60),
|
||||
INTC_VECT(SCIFA6, 0x1a80),
|
||||
};
|
||||
|
||||
static struct intc_group intca_groups[] __initdata = {
|
||||
INTC_GROUP(DMAC_1, DMAC_1_DEI0,
|
||||
DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3),
|
||||
INTC_GROUP(DMAC_2, DMAC_2_DEI4,
|
||||
DMAC_2_DEI5, DMAC_2_DADERR),
|
||||
INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
|
||||
DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
|
||||
INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
|
||||
DMAC2_2_DEI5, DMAC2_2_DADERR),
|
||||
INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
|
||||
DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
|
||||
INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
|
||||
DMAC3_2_DEI5, DMAC3_2_DADERR),
|
||||
INTC_GROUP(AP_ARM1, AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMTX),
|
||||
INTC_GROUP(USBHS, USBHS_USHI0, USBHS_USHI1),
|
||||
INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1),
|
||||
INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
|
||||
FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
|
||||
INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
|
||||
INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
|
||||
INTC_GROUP(ICUSB, ICUSB_ICUSB0, ICUSB_ICUSB1),
|
||||
INTC_GROUP(ICUDMC, ICUDMC_ICUDMC1, ICUDMC_ICUDMC2),
|
||||
};
|
||||
|
||||
static struct intc_mask_reg intca_mask_registers[] __initdata = {
|
||||
{ 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
|
||||
{ DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
|
||||
AP_ARM_IRQPMU, 0, AP_ARM_COMMTX, AP_ARM_COMMRX } },
|
||||
{ 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
|
||||
{ _2DG, CRYPT_STD, DIRC, 0,
|
||||
DMAC_1_DEI3, DMAC_1_DEI2, DMAC_1_DEI1, DMAC_1_DEI0 } },
|
||||
{ 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
|
||||
{ PINTCA_PINT1, PINTCA_PINT2, 0, 0,
|
||||
BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
|
||||
{ 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
|
||||
{ DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
|
||||
DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
|
||||
{ 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
|
||||
{ DDM, 0, 0, 0,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
|
||||
{ KEYSC_KEY, DMAC_2_DADERR, DMAC_2_DEI5, DMAC_2_DEI4,
|
||||
SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
|
||||
{ 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
|
||||
{ SCIFB, SCIFA5, SCIFA4, MSIOF1,
|
||||
0, 0, MSIOF2, 0 } },
|
||||
{ 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
|
||||
{ DISABLED, ENABLED, ENABLED, ENABLED,
|
||||
FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
|
||||
{ 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
|
||||
{ DISABLED, ENABLED, ENABLED, ENABLED,
|
||||
TTI20, USBDMAC_USHDMI, 0, MSUG } },
|
||||
{ 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
|
||||
{ CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
|
||||
CMT2, USBHS_USHI1, USBHS_USHI0, _3DG_SGX540 } },
|
||||
{ 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
|
||||
{ 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
|
||||
{ IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
|
||||
LCRC, MSU_MSU2, IRREM, MSU_MSU } },
|
||||
{ 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
|
||||
{ 0, 0, TPU0, TPU1,
|
||||
TPU2, TPU3, TPU4, 0 } },
|
||||
{ 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
|
||||
{ 0, 0, 0, 0,
|
||||
MISTY, CMT3, RWDT1, RWDT0 } },
|
||||
{ 0xe6950080, 0xe69500c0, 8, /* IMR0A3 / IMCR0A3 */
|
||||
{ SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xe6950090, 0xe69500d0, 8, /* IMR4A3 / IMCR4A3 */
|
||||
{ ICUSB_ICUSB0, ICUSB_ICUSB1, 0, 0,
|
||||
ICUDMC_ICUDMC1, ICUDMC_ICUDMC2, 0, 0 } },
|
||||
{ 0xe6950094, 0xe69500d4, 8, /* IMR5A3 / IMCR5A3 */
|
||||
{ SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
|
||||
SCUV, 0, 0, 0 } },
|
||||
{ 0xe6950098, 0xe69500d8, 8, /* IMR6A3 / IMCR6A3 */
|
||||
{ IPMMU_IPMMUB, 0, 0, 0,
|
||||
AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
|
||||
AP_ARM_DMAIRQ, AP_ARM_DMASIRQ } },
|
||||
{ 0xe695009c, 0xe69500dc, 8, /* IMR7A3 / IMCR7A3 */
|
||||
{ MFIS2, CPORTR2S, CMT14, CMT15,
|
||||
SCIFA6, 0, 0, 0 } },
|
||||
};
|
||||
|
||||
static struct intc_prio_reg intca_prio_registers[] __initdata = {
|
||||
{ 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, LCRC } },
|
||||
{ 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } },
|
||||
{ 0xe6940008, 0, 16, 4, /* IPRCA */ { _2DG, CRYPT_STD,
|
||||
CMT1_CMT11, AP_ARM1 } },
|
||||
{ 0xe694000c, 0, 16, 4, /* IPRDA */ { PINTCA_PINT1, PINTCA_PINT2,
|
||||
CMT1_CMT12, TPU4 } },
|
||||
{ 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC_1, MFI_MFIS,
|
||||
MFI_MFIM, USBHS } },
|
||||
{ 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC_2,
|
||||
_3DG_SGX540, CMT1_CMT10 } },
|
||||
{ 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
|
||||
SCIFA2, SCIFA3 } },
|
||||
{ 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBDMAC_USHDMI,
|
||||
FLCTL, SDHI0 } },
|
||||
{ 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, MSU_MSU, IIC1 } },
|
||||
{ 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, MSUG, TTI20 } },
|
||||
{ 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IRREM, SDHI1 } },
|
||||
{ 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, TPU1, TPU2, TPU3 } },
|
||||
{ 0xe6940030, 0, 16, 4, /* IPRMA */ { MISTY, CMT3, RWDT1, RWDT0 } },
|
||||
{ 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } },
|
||||
{ 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, 0 } },
|
||||
{ 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } },
|
||||
{ 0xe6950020, 0, 16, 4, /* IPRIA3 */ { ICUSB, 0, 0, 0 } },
|
||||
{ 0xe6950024, 0, 16, 4, /* IPRJA3 */ { ICUDMC, 0, 0, 0 } },
|
||||
{ 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } },
|
||||
{ 0xe695002c, 0, 16, 4, /* IPRLA3 */ { SCUV, 0, 0, 0 } },
|
||||
{ 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU_IPMMUB, 0, 0, 0 } },
|
||||
{ 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } },
|
||||
{ 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S,
|
||||
CMT14, CMT15 } },
|
||||
{ 0xe694003c, 0, 16, 4, /* IPRPA3 */ { SCIFA6, 0, 0, 0 } },
|
||||
};
|
||||
|
||||
static struct intc_desc intca_desc __initdata = {
|
||||
.name = "sh7377-intca",
|
||||
.force_enable = ENABLED,
|
||||
.force_disable = DISABLED,
|
||||
.hw = INTC_HW_DESC(intca_vectors, intca_groups,
|
||||
intca_mask_registers, intca_prio_registers,
|
||||
NULL, NULL),
|
||||
};
|
||||
|
||||
INTC_IRQ_PINS_32(intca_irq_pins, 0xe6900000,
|
||||
INTC_VECT, "sh7377-intca-irq-pins");
|
||||
|
||||
/* this macro ignore entry which is also in INTCA */
|
||||
#define __IGNORE(a...)
|
||||
#define __IGNORE0(a...) 0
|
||||
|
||||
enum {
|
||||
UNUSED_INTCS = 0,
|
||||
|
||||
INTCS,
|
||||
|
||||
/* interrupt sources INTCS */
|
||||
VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3,
|
||||
RTDMAC1_1_DEI0, RTDMAC1_1_DEI1, RTDMAC1_1_DEI2, RTDMAC1_1_DEI3,
|
||||
CEU,
|
||||
BEU_BEU0, BEU_BEU1, BEU_BEU2,
|
||||
__IGNORE(MFI)
|
||||
__IGNORE(BBIF2)
|
||||
VPU,
|
||||
TSIF1,
|
||||
__IGNORE(SGX540)
|
||||
_2DDMAC,
|
||||
IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
|
||||
IPMMU_IPMMUR, IPMMU_IPMMUR2,
|
||||
RTDMAC1_2_DEI4, RTDMAC1_2_DEI5, RTDMAC1_2_DADERR,
|
||||
__IGNORE(KEYSC)
|
||||
__IGNORE(TTI20)
|
||||
__IGNORE(MSIOF)
|
||||
IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0,
|
||||
TMU_TUNI0, TMU_TUNI1, TMU_TUNI2,
|
||||
CMT0,
|
||||
TSIF0,
|
||||
__IGNORE(CMT2)
|
||||
LMB,
|
||||
__IGNORE(MSUG)
|
||||
__IGNORE(MSU_MSU, MSU_MSU2)
|
||||
__IGNORE(CTI)
|
||||
MVI3,
|
||||
__IGNORE(RWDT0)
|
||||
__IGNORE(RWDT1)
|
||||
ICB,
|
||||
PEP,
|
||||
ASA,
|
||||
__IGNORE(_2DG)
|
||||
HQE,
|
||||
JPU,
|
||||
LCDC0,
|
||||
__IGNORE(LCRC)
|
||||
RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3,
|
||||
RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR,
|
||||
FRC,
|
||||
LCDC1,
|
||||
CSIRX,
|
||||
DSITX_DSITX0, DSITX_DSITX1,
|
||||
__IGNORE(SPU2_SPU0, SPU2_SPU1)
|
||||
__IGNORE(FSI)
|
||||
__IGNORE(FMSI)
|
||||
__IGNORE(SCUV)
|
||||
TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12,
|
||||
TSIF2,
|
||||
CMT4,
|
||||
__IGNORE(MFIS2)
|
||||
CPORTS2R,
|
||||
|
||||
/* interrupt groups INTCS */
|
||||
RTDMAC1_1, RTDMAC1_2, VEU, BEU, IIC0, __IGNORE(MSU) IPMMU,
|
||||
IIC2, RTDMAC2_1, RTDMAC2_2, DSITX, __IGNORE(SPU2) TMU1,
|
||||
};
|
||||
|
||||
#define INTCS_INTVECT 0x0F80
|
||||
static struct intc_vect intcs_vectors[] __initdata = {
|
||||
INTCS_VECT(VEU_VEU0, 0x0700), INTCS_VECT(VEU_VEU1, 0x0720),
|
||||
INTCS_VECT(VEU_VEU2, 0x0740), INTCS_VECT(VEU_VEU3, 0x0760),
|
||||
INTCS_VECT(RTDMAC1_1_DEI0, 0x0800), INTCS_VECT(RTDMAC1_1_DEI1, 0x0820),
|
||||
INTCS_VECT(RTDMAC1_1_DEI2, 0x0840), INTCS_VECT(RTDMAC1_1_DEI3, 0x0860),
|
||||
INTCS_VECT(CEU, 0x0880),
|
||||
INTCS_VECT(BEU_BEU0, 0x08A0),
|
||||
INTCS_VECT(BEU_BEU1, 0x08C0),
|
||||
INTCS_VECT(BEU_BEU2, 0x08E0),
|
||||
__IGNORE(INTCS_VECT(MFI, 0x0900))
|
||||
__IGNORE(INTCS_VECT(BBIF2, 0x0960))
|
||||
INTCS_VECT(VPU, 0x0980),
|
||||
INTCS_VECT(TSIF1, 0x09A0),
|
||||
__IGNORE(INTCS_VECT(SGX540, 0x09E0))
|
||||
INTCS_VECT(_2DDMAC, 0x0A00),
|
||||
INTCS_VECT(IIC2_ALI2, 0x0A80), INTCS_VECT(IIC2_TACKI2, 0x0AA0),
|
||||
INTCS_VECT(IIC2_WAITI2, 0x0AC0), INTCS_VECT(IIC2_DTEI2, 0x0AE0),
|
||||
INTCS_VECT(IPMMU_IPMMUR, 0x0B00), INTCS_VECT(IPMMU_IPMMUR2, 0x0B20),
|
||||
INTCS_VECT(RTDMAC1_2_DEI4, 0x0B80),
|
||||
INTCS_VECT(RTDMAC1_2_DEI5, 0x0BA0),
|
||||
INTCS_VECT(RTDMAC1_2_DADERR, 0x0BC0),
|
||||
__IGNORE(INTCS_VECT(KEYSC 0x0BE0))
|
||||
__IGNORE(INTCS_VECT(TTI20, 0x0C80))
|
||||
__IGNORE(INTCS_VECT(MSIOF, 0x0D20))
|
||||
INTCS_VECT(IIC0_ALI0, 0x0E00), INTCS_VECT(IIC0_TACKI0, 0x0E20),
|
||||
INTCS_VECT(IIC0_WAITI0, 0x0E40), INTCS_VECT(IIC0_DTEI0, 0x0E60),
|
||||
INTCS_VECT(TMU_TUNI0, 0x0E80),
|
||||
INTCS_VECT(TMU_TUNI1, 0x0EA0),
|
||||
INTCS_VECT(TMU_TUNI2, 0x0EC0),
|
||||
INTCS_VECT(CMT0, 0x0F00),
|
||||
INTCS_VECT(TSIF0, 0x0F20),
|
||||
__IGNORE(INTCS_VECT(CMT2, 0x0F40))
|
||||
INTCS_VECT(LMB, 0x0F60),
|
||||
__IGNORE(INTCS_VECT(MSUG, 0x0F80))
|
||||
__IGNORE(INTCS_VECT(MSU_MSU, 0x0FA0))
|
||||
__IGNORE(INTCS_VECT(MSU_MSU2, 0x0FC0))
|
||||
__IGNORE(INTCS_VECT(CTI, 0x0400))
|
||||
INTCS_VECT(MVI3, 0x0420),
|
||||
__IGNORE(INTCS_VECT(RWDT0, 0x0440))
|
||||
__IGNORE(INTCS_VECT(RWDT1, 0x0460))
|
||||
INTCS_VECT(ICB, 0x0480),
|
||||
INTCS_VECT(PEP, 0x04A0),
|
||||
INTCS_VECT(ASA, 0x04C0),
|
||||
__IGNORE(INTCS_VECT(_2DG, 0x04E0))
|
||||
INTCS_VECT(HQE, 0x0540),
|
||||
INTCS_VECT(JPU, 0x0560),
|
||||
INTCS_VECT(LCDC0, 0x0580),
|
||||
__IGNORE(INTCS_VECT(LCRC, 0x05A0))
|
||||
INTCS_VECT(RTDMAC2_1_DEI0, 0x1300), INTCS_VECT(RTDMAC2_1_DEI1, 0x1320),
|
||||
INTCS_VECT(RTDMAC2_1_DEI2, 0x1340), INTCS_VECT(RTDMAC2_1_DEI3, 0x1360),
|
||||
INTCS_VECT(RTDMAC2_2_DEI4, 0x1380), INTCS_VECT(RTDMAC2_2_DEI5, 0x13A0),
|
||||
INTCS_VECT(RTDMAC2_2_DADERR, 0x13C0),
|
||||
INTCS_VECT(FRC, 0x1700),
|
||||
INTCS_VECT(LCDC1, 0x1780),
|
||||
INTCS_VECT(CSIRX, 0x17A0),
|
||||
INTCS_VECT(DSITX_DSITX0, 0x17C0), INTCS_VECT(DSITX_DSITX1, 0x17E0),
|
||||
__IGNORE(INTCS_VECT(SPU2_SPU0, 0x1800))
|
||||
__IGNORE(INTCS_VECT(SPU2_SPU1, 0x1820))
|
||||
__IGNORE(INTCS_VECT(FSI, 0x1840))
|
||||
__IGNORE(INTCS_VECT(FMSI, 0x1860))
|
||||
__IGNORE(INTCS_VECT(SCUV, 0x1880))
|
||||
INTCS_VECT(TMU1_TUNI10, 0x1900), INTCS_VECT(TMU1_TUNI11, 0x1920),
|
||||
INTCS_VECT(TMU1_TUNI12, 0x1940),
|
||||
INTCS_VECT(TSIF2, 0x1960),
|
||||
INTCS_VECT(CMT4, 0x1980),
|
||||
__IGNORE(INTCS_VECT(MFIS2, 0x1A00))
|
||||
INTCS_VECT(CPORTS2R, 0x1A20),
|
||||
|
||||
INTC_VECT(INTCS, INTCS_INTVECT),
|
||||
};
|
||||
|
||||
static struct intc_group intcs_groups[] __initdata = {
|
||||
INTC_GROUP(RTDMAC1_1,
|
||||
RTDMAC1_1_DEI0, RTDMAC1_1_DEI1,
|
||||
RTDMAC1_1_DEI2, RTDMAC1_1_DEI3),
|
||||
INTC_GROUP(RTDMAC1_2,
|
||||
RTDMAC1_2_DEI4, RTDMAC1_2_DEI5, RTDMAC1_2_DADERR),
|
||||
INTC_GROUP(VEU, VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3),
|
||||
INTC_GROUP(BEU, BEU_BEU0, BEU_BEU1, BEU_BEU2),
|
||||
INTC_GROUP(IIC0, IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0),
|
||||
__IGNORE(INTC_GROUP(MSU, MSU_MSU, MSU_MSU2))
|
||||
INTC_GROUP(IPMMU, IPMMU_IPMMUR, IPMMU_IPMMUR2),
|
||||
INTC_GROUP(IIC2, IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2),
|
||||
INTC_GROUP(RTDMAC2_1,
|
||||
RTDMAC2_1_DEI0, RTDMAC2_1_DEI1,
|
||||
RTDMAC2_1_DEI2, RTDMAC2_1_DEI3),
|
||||
INTC_GROUP(RTDMAC2_2, RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR),
|
||||
INTC_GROUP(DSITX, DSITX_DSITX0, DSITX_DSITX1),
|
||||
__IGNORE(INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1))
|
||||
INTC_GROUP(TMU1, TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12),
|
||||
};
|
||||
|
||||
static struct intc_mask_reg intcs_mask_registers[] __initdata = {
|
||||
{ 0xE6940184, 0xE69401C4, 8, /* IMR1AS / IMCR1AS */
|
||||
{ BEU_BEU2, BEU_BEU1, BEU_BEU0, CEU,
|
||||
VEU_VEU3, VEU_VEU2, VEU_VEU1, VEU_VEU0 } },
|
||||
{ 0xE6940188, 0xE69401C8, 8, /* IMR2AS / IMCR2AS */
|
||||
{ 0, 0, 0, VPU,
|
||||
__IGNORE0(BBIF2), 0, 0, __IGNORE0(MFI) } },
|
||||
{ 0xE694018C, 0xE69401CC, 8, /* IMR3AS / IMCR3AS */
|
||||
{ 0, 0, 0, _2DDMAC,
|
||||
__IGNORE0(_2DG), ASA, PEP, ICB } },
|
||||
{ 0xE6940190, 0xE69401D0, 8, /* IMR4AS / IMCR4AS */
|
||||
{ 0, 0, MVI3, __IGNORE0(CTI),
|
||||
JPU, HQE, __IGNORE0(LCRC), LCDC0 } },
|
||||
{ 0xE6940194, 0xE69401D4, 8, /* IMR5AS / IMCR5AS */
|
||||
{ __IGNORE0(KEYSC), RTDMAC1_2_DADERR, RTDMAC1_2_DEI5, RTDMAC1_2_DEI4,
|
||||
RTDMAC1_1_DEI3, RTDMAC1_1_DEI2, RTDMAC1_1_DEI1, RTDMAC1_1_DEI0 } },
|
||||
__IGNORE({ 0xE6940198, 0xE69401D8, 8, /* IMR6AS / IMCR6AS */
|
||||
{ 0, 0, MSIOF, 0,
|
||||
SGX540, 0, TTI20, 0 } })
|
||||
{ 0xE694019C, 0xE69401DC, 8, /* IMR7AS / IMCR7AS */
|
||||
{ 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
|
||||
0, 0, 0, 0 } },
|
||||
__IGNORE({ 0xE69401A0, 0xE69401E0, 8, /* IMR8AS / IMCR8AS */
|
||||
{ 0, 0, 0, 0,
|
||||
0, MSU_MSU, MSU_MSU2, MSUG } })
|
||||
{ 0xE69401A4, 0xE69401E4, 8, /* IMR9AS / IMCR9AS */
|
||||
{ __IGNORE0(RWDT1), __IGNORE0(RWDT0), __IGNORE0(CMT2), CMT0,
|
||||
IIC2_DTEI2, IIC2_WAITI2, IIC2_TACKI2, IIC2_ALI2 } },
|
||||
{ 0xE69401A8, 0xE69401E8, 8, /* IMR10AS / IMCR10AS */
|
||||
{ 0, 0, IPMMU_IPMMUR, IPMMU_IPMMUR2,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xE69401AC, 0xE69401EC, 8, /* IMR11AS / IMCR11AS */
|
||||
{ IIC0_DTEI0, IIC0_WAITI0, IIC0_TACKI0, IIC0_ALI0,
|
||||
0, TSIF1, LMB, TSIF0 } },
|
||||
{ 0xE6950180, 0xE69501C0, 8, /* IMR0AS3 / IMCR0AS3 */
|
||||
{ RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3,
|
||||
RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR, 0 } },
|
||||
{ 0xE6950190, 0xE69501D0, 8, /* IMR4AS3 / IMCR4AS3 */
|
||||
{ FRC, 0, 0, 0,
|
||||
LCDC1, CSIRX, DSITX_DSITX0, DSITX_DSITX1 } },
|
||||
__IGNORE({ 0xE6950194, 0xE69501D4, 8, /* IMR5AS3 / IMCR5AS3 */
|
||||
{SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
|
||||
SCUV, 0, 0, 0 } })
|
||||
{ 0xE6950198, 0xE69501D8, 8, /* IMR6AS3 / IMCR6AS3 */
|
||||
{ TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12, TSIF2,
|
||||
CMT4, 0, 0, 0 } },
|
||||
{ 0xE695019C, 0xE69501DC, 8, /* IMR7AS3 / IMCR7AS3 */
|
||||
{ __IGNORE0(MFIS2), CPORTS2R, 0, 0,
|
||||
0, 0, 0, 0 } },
|
||||
{ 0xFFD20104, 0, 16, /* INTAMASK */
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, INTCS } }
|
||||
};
|
||||
|
||||
static struct intc_prio_reg intcs_prio_registers[] __initdata = {
|
||||
/* IPRAS */
|
||||
{ 0xFFD20000, 0, 16, 4, { __IGNORE0(CTI), MVI3, _2DDMAC, ICB } },
|
||||
/* IPRBS */
|
||||
{ 0xFFD20004, 0, 16, 4, { JPU, LCDC0, 0, __IGNORE0(LCRC) } },
|
||||
/* IPRCS */
|
||||
__IGNORE({ 0xFFD20008, 0, 16, 4, { BBIF2, 0, 0, 0 } })
|
||||
/* IPRES */
|
||||
{ 0xFFD20010, 0, 16, 4, { RTDMAC1_1, CEU, __IGNORE0(MFI), VPU } },
|
||||
/* IPRFS */
|
||||
{ 0xFFD20014, 0, 16, 4,
|
||||
{ __IGNORE0(KEYSC), RTDMAC1_2, __IGNORE0(CMT2), CMT0 } },
|
||||
/* IPRGS */
|
||||
{ 0xFFD20018, 0, 16, 4, { TMU_TUNI0, TMU_TUNI1, TMU_TUNI2, TSIF1 } },
|
||||
/* IPRHS */
|
||||
{ 0xFFD2001C, 0, 16, 4, { __IGNORE0(TTI20), 0, VEU, BEU } },
|
||||
/* IPRIS */
|
||||
{ 0xFFD20020, 0, 16, 4, { 0, __IGNORE0(MSIOF), TSIF0, IIC0 } },
|
||||
/* IPRJS */
|
||||
__IGNORE({ 0xFFD20024, 0, 16, 4, { 0, SGX540, MSUG, MSU } })
|
||||
/* IPRKS */
|
||||
{ 0xFFD20028, 0, 16, 4, { __IGNORE0(_2DG), ASA, LMB, PEP } },
|
||||
/* IPRLS */
|
||||
{ 0xFFD2002C, 0, 16, 4, { IPMMU, 0, 0, HQE } },
|
||||
/* IPRMS */
|
||||
{ 0xFFD20030, 0, 16, 4,
|
||||
{ IIC2, 0, __IGNORE0(RWDT1), __IGNORE0(RWDT0) } },
|
||||
/* IPRAS3 */
|
||||
{ 0xFFD50000, 0, 16, 4, { RTDMAC2_1, 0, 0, 0 } },
|
||||
/* IPRBS3 */
|
||||
{ 0xFFD50004, 0, 16, 4, { RTDMAC2_2, 0, 0, 0 } },
|
||||
/* IPRIS3 */
|
||||
{ 0xFFD50020, 0, 16, 4, { FRC, 0, 0, 0 } },
|
||||
/* IPRJS3 */
|
||||
{ 0xFFD50024, 0, 16, 4, { LCDC1, CSIRX, DSITX, 0 } },
|
||||
/* IPRKS3 */
|
||||
__IGNORE({ 0xFFD50028, 0, 16, 4, { SPU2, 0, FSI, FMSI } })
|
||||
/* IPRLS3 */
|
||||
__IGNORE({ 0xFFD5002C, 0, 16, 4, { SCUV, 0, 0, 0 } })
|
||||
/* IPRMS3 */
|
||||
{ 0xFFD50030, 0, 16, 4, { TMU1, 0, 0, TSIF2 } },
|
||||
/* IPRNS3 */
|
||||
{ 0xFFD50034, 0, 16, 4, { CMT4, 0, 0, 0 } },
|
||||
/* IPROS3 */
|
||||
{ 0xFFD50038, 0, 16, 4, { __IGNORE0(MFIS2), CPORTS2R, 0, 0 } },
|
||||
};
|
||||
|
||||
static struct resource intcs_resources[] __initdata = {
|
||||
[0] = {
|
||||
.start = 0xffd20000,
|
||||
.end = 0xffd500ff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct intc_desc intcs_desc __initdata = {
|
||||
.name = "sh7377-intcs",
|
||||
.resource = intcs_resources,
|
||||
.num_resources = ARRAY_SIZE(intcs_resources),
|
||||
.hw = INTC_HW_DESC(intcs_vectors, intcs_groups,
|
||||
intcs_mask_registers, intcs_prio_registers,
|
||||
NULL, NULL),
|
||||
};
|
||||
|
||||
static void intcs_demux(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
void __iomem *reg = (void *)irq_get_handler_data(irq);
|
||||
unsigned int evtcodeas = ioread32(reg);
|
||||
|
||||
generic_handle_irq(intcs_evt2irq(evtcodeas));
|
||||
}
|
||||
|
||||
#define INTEVTSA 0xFFD20100
|
||||
void __init sh7377_init_irq(void)
|
||||
{
|
||||
void __iomem *intevtsa = ioremap_nocache(INTEVTSA, PAGE_SIZE);
|
||||
|
||||
register_intc_controller(&intca_desc);
|
||||
register_intc_controller(&intca_irq_pins_desc);
|
||||
register_intc_controller(&intcs_desc);
|
||||
|
||||
/* demux using INTEVTSA */
|
||||
irq_set_handler_data(evt2irq(INTCS_INTVECT), (void *)intevtsa);
|
||||
irq_set_chained_handler(evt2irq(INTCS_INTVECT), intcs_demux);
|
||||
}
|
||||
|
|
@ -140,7 +140,7 @@ enum {
|
|||
FN_IP7_3_2, FN_IP7_6_4, FN_IP7_9_7, FN_IP7_12_10,
|
||||
FN_IP7_14_13, FN_IP2_7_4, FN_IP2_11_8, FN_IP2_15_12,
|
||||
FN_IP1_28_25, FN_IP2_3_0, FN_IP8_3_0, FN_IP8_7_4,
|
||||
FN_IP8_11_8, FN_IP8_15_12, FN_PENC0, FN_PENC1,
|
||||
FN_IP8_11_8, FN_IP8_15_12, FN_USB_PENC0, FN_USB_PENC1,
|
||||
FN_IP0_2_0, FN_IP8_17_16, FN_IP8_18, FN_IP8_19,
|
||||
|
||||
/* GPSR5 */
|
||||
|
|
@ -176,7 +176,7 @@ enum {
|
|||
FN_A0, FN_SD1_DAT3, FN_MMC0_D3, FN_FD3,
|
||||
FN_BS, FN_SD1_DAT2, FN_MMC0_D2, FN_FD2,
|
||||
FN_ATADIR0, FN_SDSELF, FN_HCTS1, FN_TX4_C,
|
||||
FN_PENC2, FN_SCK0, FN_PWM1, FN_PWMFSW0,
|
||||
FN_USB_PENC2, FN_SCK0, FN_PWM1, FN_PWMFSW0,
|
||||
FN_SCIF_CLK, FN_TCLK0_C,
|
||||
|
||||
/* IPSR1 */
|
||||
|
|
@ -447,7 +447,7 @@ enum {
|
|||
A0_MARK, SD1_DAT3_MARK, MMC0_D3_MARK, FD3_MARK,
|
||||
BS_MARK, SD1_DAT2_MARK, MMC0_D2_MARK, FD2_MARK,
|
||||
ATADIR0_MARK, SDSELF_MARK, HCTS1_MARK, TX4_C_MARK,
|
||||
PENC2_MARK, SCK0_MARK, PWM1_MARK, PWMFSW0_MARK,
|
||||
USB_PENC2_MARK, SCK0_MARK, PWM1_MARK, PWMFSW0_MARK,
|
||||
SCIF_CLK_MARK, TCLK0_C_MARK,
|
||||
|
||||
EX_CS0_MARK, RX3_C_IRDA_RX_C_MARK, MMC0_D6_MARK,
|
||||
|
|
@ -658,7 +658,7 @@ static pinmux_enum_t pinmux_data[] = {
|
|||
PINMUX_DATA(A18_MARK, FN_A18),
|
||||
PINMUX_DATA(A19_MARK, FN_A19),
|
||||
|
||||
PINMUX_IPSR_DATA(IP0_2_0, PENC2),
|
||||
PINMUX_IPSR_DATA(IP0_2_0, USB_PENC2),
|
||||
PINMUX_IPSR_MODSEL_DATA(IP0_2_0, SCK0, SEL_SCIF0_0),
|
||||
PINMUX_IPSR_DATA(IP0_2_0, PWM1),
|
||||
PINMUX_IPSR_MODSEL_DATA(IP0_2_0, PWMFSW0, SEL_PWMFSW_0),
|
||||
|
|
@ -1456,7 +1456,7 @@ static struct pinmux_gpio pinmux_gpios[] = {
|
|||
GPIO_FN(A19),
|
||||
|
||||
/* IPSR0 */
|
||||
GPIO_FN(PENC2), GPIO_FN(SCK0), GPIO_FN(PWM1), GPIO_FN(PWMFSW0),
|
||||
GPIO_FN(USB_PENC2), GPIO_FN(SCK0), GPIO_FN(PWM1), GPIO_FN(PWMFSW0),
|
||||
GPIO_FN(SCIF_CLK), GPIO_FN(TCLK0_C), GPIO_FN(BS), GPIO_FN(SD1_DAT2),
|
||||
GPIO_FN(MMC0_D2), GPIO_FN(FD2), GPIO_FN(ATADIR0), GPIO_FN(SDSELF),
|
||||
GPIO_FN(HCTS1), GPIO_FN(TX4_C), GPIO_FN(A0), GPIO_FN(SD1_DAT3),
|
||||
|
|
@ -1865,8 +1865,8 @@ static struct pinmux_cfg_reg pinmux_config_regs[] = {
|
|||
GP_4_30_FN, FN_IP8_18,
|
||||
GP_4_29_FN, FN_IP8_17_16,
|
||||
GP_4_28_FN, FN_IP0_2_0,
|
||||
GP_4_27_FN, FN_PENC1,
|
||||
GP_4_26_FN, FN_PENC0,
|
||||
GP_4_27_FN, FN_USB_PENC1,
|
||||
GP_4_26_FN, FN_USB_PENC0,
|
||||
GP_4_25_FN, FN_IP8_15_12,
|
||||
GP_4_24_FN, FN_IP8_11_8,
|
||||
GP_4_23_FN, FN_IP8_7_4,
|
||||
|
|
@ -1981,7 +1981,7 @@ static struct pinmux_cfg_reg pinmux_config_regs[] = {
|
|||
FN_BS, FN_SD1_DAT2, FN_MMC0_D2, FN_FD2,
|
||||
FN_ATADIR0, FN_SDSELF, FN_HCTS1, FN_TX4_C,
|
||||
/* IP0_2_0 [3] */
|
||||
FN_PENC2, FN_SCK0, FN_PWM1, FN_PWMFSW0,
|
||||
FN_USB_PENC2, FN_SCK0, FN_PWM1, FN_PWMFSW0,
|
||||
FN_SCIF_CLK, FN_TCLK0_C, 0, 0 }
|
||||
},
|
||||
{ PINMUX_CFG_REG_VAR("IPSR1", 0xfffc0024, 32,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
|
|||
.num_resources = ARRAY_SIZE(i2c1_resources),
|
||||
};
|
||||
|
||||
static struct resource pmu_resources[] = {
|
||||
[0] = {
|
||||
.start = evt2irq(0x19a0),
|
||||
.end = evt2irq(0x19a0),
|
||||
.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 *r8a7740_late_devices[] __initdata = {
|
||||
&i2c0_device,
|
||||
&i2c1_device,
|
||||
|
|
@ -597,6 +612,7 @@ static struct platform_device *r8a7740_late_devices[] __initdata = {
|
|||
&dma1_device,
|
||||
&dma2_device,
|
||||
&usb_dma_device,
|
||||
&pmu_device,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -747,7 +763,7 @@ static const char *r8a7740_boards_compat_dt[] __initdata = {
|
|||
NULL,
|
||||
};
|
||||
|
||||
DT_MACHINE_START(SH7372_DT, "Generic R8A7740 (Flattened Device Tree)")
|
||||
DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
|
||||
.map_io = r8a7740_map_io,
|
||||
.init_early = r8a7740_add_early_devices_dt,
|
||||
.init_irq = r8a7740_init_irq,
|
||||
|
|
|
|||
|
|
@ -229,6 +229,79 @@ static struct platform_device tmu01_device = {
|
|||
.num_resources = ARRAY_SIZE(tmu01_resources),
|
||||
};
|
||||
|
||||
/* I2C */
|
||||
static struct resource rcar_i2c0_res[] = {
|
||||
{
|
||||
.start = 0xffc70000,
|
||||
.end = 0xffc70fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = gic_spi(79),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c0_device = {
|
||||
.name = "i2c-rcar",
|
||||
.id = 0,
|
||||
.resource = rcar_i2c0_res,
|
||||
.num_resources = ARRAY_SIZE(rcar_i2c0_res),
|
||||
};
|
||||
|
||||
static struct resource rcar_i2c1_res[] = {
|
||||
{
|
||||
.start = 0xffc71000,
|
||||
.end = 0xffc71fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = gic_spi(82),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c1_device = {
|
||||
.name = "i2c-rcar",
|
||||
.id = 1,
|
||||
.resource = rcar_i2c1_res,
|
||||
.num_resources = ARRAY_SIZE(rcar_i2c1_res),
|
||||
};
|
||||
|
||||
static struct resource rcar_i2c2_res[] = {
|
||||
{
|
||||
.start = 0xffc72000,
|
||||
.end = 0xffc72fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = gic_spi(80),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c2_device = {
|
||||
.name = "i2c-rcar",
|
||||
.id = 2,
|
||||
.resource = rcar_i2c2_res,
|
||||
.num_resources = ARRAY_SIZE(rcar_i2c2_res),
|
||||
};
|
||||
|
||||
static struct resource rcar_i2c3_res[] = {
|
||||
{
|
||||
.start = 0xffc73000,
|
||||
.end = 0xffc73fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = gic_spi(81),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c3_device = {
|
||||
.name = "i2c-rcar",
|
||||
.id = 3,
|
||||
.resource = rcar_i2c3_res,
|
||||
.num_resources = ARRAY_SIZE(rcar_i2c3_res),
|
||||
};
|
||||
|
||||
static struct platform_device *r8a7779_early_devices[] __initdata = {
|
||||
&scif0_device,
|
||||
&scif1_device,
|
||||
|
|
@ -238,6 +311,10 @@ static struct platform_device *r8a7779_early_devices[] __initdata = {
|
|||
&scif5_device,
|
||||
&tmu00_device,
|
||||
&tmu01_device,
|
||||
&i2c0_device,
|
||||
&i2c1_device,
|
||||
&i2c2_device,
|
||||
&i2c3_device,
|
||||
};
|
||||
|
||||
static struct platform_device *r8a7779_late_devices[] __initdata = {
|
||||
|
|
|
|||
|
|
@ -1,481 +0,0 @@
|
|||
/*
|
||||
* sh7367 processor support
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
* Copyright (C) 2008 Yoshihiro Shimoda
|
||||
*
|
||||
* 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/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/uio_driver.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/serial_sci.h>
|
||||
#include <linux/sh_timer.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/mach/time.h>
|
||||
|
||||
static struct map_desc sh7367_io_desc[] __initdata = {
|
||||
/* create a 1:1 entity map for 0xe6xxxxxx
|
||||
* used by CPGA, INTC and PFC.
|
||||
*/
|
||||
{
|
||||
.virtual = 0xe6000000,
|
||||
.pfn = __phys_to_pfn(0xe6000000),
|
||||
.length = 256 << 20,
|
||||
.type = MT_DEVICE_NONSHARED
|
||||
},
|
||||
};
|
||||
|
||||
void __init sh7367_map_io(void)
|
||||
{
|
||||
iotable_init(sh7367_io_desc, ARRAY_SIZE(sh7367_io_desc));
|
||||
}
|
||||
|
||||
/* SCIFA0 */
|
||||
static struct plat_sci_port scif0_platform_data = {
|
||||
.mapbase = 0xe6c40000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xc00), evt2irq(0xc00),
|
||||
evt2irq(0xc00), evt2irq(0xc00) },
|
||||
};
|
||||
|
||||
static struct platform_device scif0_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &scif0_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA1 */
|
||||
static struct plat_sci_port scif1_platform_data = {
|
||||
.mapbase = 0xe6c50000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xc20), evt2irq(0xc20),
|
||||
evt2irq(0xc20), evt2irq(0xc20) },
|
||||
};
|
||||
|
||||
static struct platform_device scif1_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &scif1_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA2 */
|
||||
static struct plat_sci_port scif2_platform_data = {
|
||||
.mapbase = 0xe6c60000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xc40), evt2irq(0xc40),
|
||||
evt2irq(0xc40), evt2irq(0xc40) },
|
||||
};
|
||||
|
||||
static struct platform_device scif2_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 2,
|
||||
.dev = {
|
||||
.platform_data = &scif2_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA3 */
|
||||
static struct plat_sci_port scif3_platform_data = {
|
||||
.mapbase = 0xe6c70000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xc60), evt2irq(0xc60),
|
||||
evt2irq(0xc60), evt2irq(0xc60) },
|
||||
};
|
||||
|
||||
static struct platform_device scif3_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 3,
|
||||
.dev = {
|
||||
.platform_data = &scif3_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA4 */
|
||||
static struct plat_sci_port scif4_platform_data = {
|
||||
.mapbase = 0xe6c80000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xd20), evt2irq(0xd20),
|
||||
evt2irq(0xd20), evt2irq(0xd20) },
|
||||
};
|
||||
|
||||
static struct platform_device scif4_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 4,
|
||||
.dev = {
|
||||
.platform_data = &scif4_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA5 */
|
||||
static struct plat_sci_port scif5_platform_data = {
|
||||
.mapbase = 0xe6cb0000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xd40), evt2irq(0xd40),
|
||||
evt2irq(0xd40), evt2irq(0xd40) },
|
||||
};
|
||||
|
||||
static struct platform_device scif5_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 5,
|
||||
.dev = {
|
||||
.platform_data = &scif5_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFB */
|
||||
static struct plat_sci_port scif6_platform_data = {
|
||||
.mapbase = 0xe6c30000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFB,
|
||||
.irqs = { evt2irq(0xd60), evt2irq(0xd60),
|
||||
evt2irq(0xd60), evt2irq(0xd60) },
|
||||
};
|
||||
|
||||
static struct platform_device scif6_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 6,
|
||||
.dev = {
|
||||
.platform_data = &scif6_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct sh_timer_config cmt10_platform_data = {
|
||||
.name = "CMT10",
|
||||
.channel_offset = 0x10,
|
||||
.timer_bit = 0,
|
||||
.clockevent_rating = 125,
|
||||
.clocksource_rating = 125,
|
||||
};
|
||||
|
||||
static struct resource cmt10_resources[] = {
|
||||
[0] = {
|
||||
.name = "CMT10",
|
||||
.start = 0xe6138010,
|
||||
.end = 0xe613801b,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0xb00), /* CMT1_CMT10 */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device cmt10_device = {
|
||||
.name = "sh_cmt",
|
||||
.id = 10,
|
||||
.dev = {
|
||||
.platform_data = &cmt10_platform_data,
|
||||
},
|
||||
.resource = cmt10_resources,
|
||||
.num_resources = ARRAY_SIZE(cmt10_resources),
|
||||
};
|
||||
|
||||
/* VPU */
|
||||
static struct uio_info vpu_platform_data = {
|
||||
.name = "VPU5",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x980),
|
||||
};
|
||||
|
||||
static struct resource vpu_resources[] = {
|
||||
[0] = {
|
||||
.name = "VPU",
|
||||
.start = 0xfe900000,
|
||||
.end = 0xfe902807,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device vpu_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &vpu_platform_data,
|
||||
},
|
||||
.resource = vpu_resources,
|
||||
.num_resources = ARRAY_SIZE(vpu_resources),
|
||||
};
|
||||
|
||||
/* VEU0 */
|
||||
static struct uio_info veu0_platform_data = {
|
||||
.name = "VEU0",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x700),
|
||||
};
|
||||
|
||||
static struct resource veu0_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU0",
|
||||
.start = 0xfe920000,
|
||||
.end = 0xfe9200b7,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu0_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &veu0_platform_data,
|
||||
},
|
||||
.resource = veu0_resources,
|
||||
.num_resources = ARRAY_SIZE(veu0_resources),
|
||||
};
|
||||
|
||||
/* VEU1 */
|
||||
static struct uio_info veu1_platform_data = {
|
||||
.name = "VEU1",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x720),
|
||||
};
|
||||
|
||||
static struct resource veu1_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU1",
|
||||
.start = 0xfe924000,
|
||||
.end = 0xfe9240b7,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu1_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 2,
|
||||
.dev = {
|
||||
.platform_data = &veu1_platform_data,
|
||||
},
|
||||
.resource = veu1_resources,
|
||||
.num_resources = ARRAY_SIZE(veu1_resources),
|
||||
};
|
||||
|
||||
/* VEU2 */
|
||||
static struct uio_info veu2_platform_data = {
|
||||
.name = "VEU2",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x740),
|
||||
};
|
||||
|
||||
static struct resource veu2_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU2",
|
||||
.start = 0xfe928000,
|
||||
.end = 0xfe9280b7,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu2_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 3,
|
||||
.dev = {
|
||||
.platform_data = &veu2_platform_data,
|
||||
},
|
||||
.resource = veu2_resources,
|
||||
.num_resources = ARRAY_SIZE(veu2_resources),
|
||||
};
|
||||
|
||||
/* VEU3 */
|
||||
static struct uio_info veu3_platform_data = {
|
||||
.name = "VEU3",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x760),
|
||||
};
|
||||
|
||||
static struct resource veu3_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU3",
|
||||
.start = 0xfe92c000,
|
||||
.end = 0xfe92c0b7,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu3_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 4,
|
||||
.dev = {
|
||||
.platform_data = &veu3_platform_data,
|
||||
},
|
||||
.resource = veu3_resources,
|
||||
.num_resources = ARRAY_SIZE(veu3_resources),
|
||||
};
|
||||
|
||||
/* VEU2H */
|
||||
static struct uio_info veu2h_platform_data = {
|
||||
.name = "VEU2H",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x520),
|
||||
};
|
||||
|
||||
static struct resource veu2h_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU2H",
|
||||
.start = 0xfe93c000,
|
||||
.end = 0xfe93c27b,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu2h_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 5,
|
||||
.dev = {
|
||||
.platform_data = &veu2h_platform_data,
|
||||
},
|
||||
.resource = veu2h_resources,
|
||||
.num_resources = ARRAY_SIZE(veu2h_resources),
|
||||
};
|
||||
|
||||
/* JPU */
|
||||
static struct uio_info jpu_platform_data = {
|
||||
.name = "JPU",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x560),
|
||||
};
|
||||
|
||||
static struct resource jpu_resources[] = {
|
||||
[0] = {
|
||||
.name = "JPU",
|
||||
.start = 0xfe980000,
|
||||
.end = 0xfe9902d3,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device jpu_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 6,
|
||||
.dev = {
|
||||
.platform_data = &jpu_platform_data,
|
||||
},
|
||||
.resource = jpu_resources,
|
||||
.num_resources = ARRAY_SIZE(jpu_resources),
|
||||
};
|
||||
|
||||
/* SPU1 */
|
||||
static struct uio_info spu1_platform_data = {
|
||||
.name = "SPU1",
|
||||
.version = "0",
|
||||
.irq = evt2irq(0xfc0),
|
||||
};
|
||||
|
||||
static struct resource spu1_resources[] = {
|
||||
[0] = {
|
||||
.name = "SPU1",
|
||||
.start = 0xfe300000,
|
||||
.end = 0xfe3fffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device spu1_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 7,
|
||||
.dev = {
|
||||
.platform_data = &spu1_platform_data,
|
||||
},
|
||||
.resource = spu1_resources,
|
||||
.num_resources = ARRAY_SIZE(spu1_resources),
|
||||
};
|
||||
|
||||
static struct platform_device *sh7367_early_devices[] __initdata = {
|
||||
&scif0_device,
|
||||
&scif1_device,
|
||||
&scif2_device,
|
||||
&scif3_device,
|
||||
&scif4_device,
|
||||
&scif5_device,
|
||||
&scif6_device,
|
||||
&cmt10_device,
|
||||
};
|
||||
|
||||
static struct platform_device *sh7367_devices[] __initdata = {
|
||||
&vpu_device,
|
||||
&veu0_device,
|
||||
&veu1_device,
|
||||
&veu2_device,
|
||||
&veu3_device,
|
||||
&veu2h_device,
|
||||
&jpu_device,
|
||||
&spu1_device,
|
||||
};
|
||||
|
||||
void __init sh7367_add_standard_devices(void)
|
||||
{
|
||||
platform_add_devices(sh7367_early_devices,
|
||||
ARRAY_SIZE(sh7367_early_devices));
|
||||
|
||||
platform_add_devices(sh7367_devices,
|
||||
ARRAY_SIZE(sh7367_devices));
|
||||
}
|
||||
|
||||
static void __init sh7367_earlytimer_init(void)
|
||||
{
|
||||
sh7367_clock_init();
|
||||
shmobile_earlytimer_init();
|
||||
}
|
||||
|
||||
#define SYMSTPCR2 IOMEM(0xe6158048)
|
||||
#define SYMSTPCR2_CMT1 (1 << 29)
|
||||
|
||||
void __init sh7367_add_early_devices(void)
|
||||
{
|
||||
/* enable clock to CMT1 */
|
||||
__raw_writel(__raw_readl(SYMSTPCR2) & ~SYMSTPCR2_CMT1, SYMSTPCR2);
|
||||
|
||||
early_platform_add_devices(sh7367_early_devices,
|
||||
ARRAY_SIZE(sh7367_early_devices));
|
||||
|
||||
/* setup early console here as well */
|
||||
shmobile_setup_console();
|
||||
|
||||
/* override timer setup with soc-specific code */
|
||||
shmobile_timer.init = sh7367_earlytimer_init;
|
||||
}
|
||||
|
|
@ -407,6 +407,26 @@ static const struct sh_dmae_slave_config sh7372_dmae_slaves[] = {
|
|||
.addr = 0xe6c30060,
|
||||
.chcr = CHCR_RX(XMIT_SZ_8BIT),
|
||||
.mid_rid = 0x3e,
|
||||
}, {
|
||||
.slave_id = SHDMA_SLAVE_FLCTL0_TX,
|
||||
.addr = 0xe6a30050,
|
||||
.chcr = CHCR_TX(XMIT_SZ_32BIT),
|
||||
.mid_rid = 0x83,
|
||||
}, {
|
||||
.slave_id = SHDMA_SLAVE_FLCTL0_RX,
|
||||
.addr = 0xe6a30050,
|
||||
.chcr = CHCR_RX(XMIT_SZ_32BIT),
|
||||
.mid_rid = 0x83,
|
||||
}, {
|
||||
.slave_id = SHDMA_SLAVE_FLCTL1_TX,
|
||||
.addr = 0xe6a30060,
|
||||
.chcr = CHCR_TX(XMIT_SZ_32BIT),
|
||||
.mid_rid = 0x87,
|
||||
}, {
|
||||
.slave_id = SHDMA_SLAVE_FLCTL1_RX,
|
||||
.addr = 0xe6a30060,
|
||||
.chcr = CHCR_RX(XMIT_SZ_32BIT),
|
||||
.mid_rid = 0x87,
|
||||
}, {
|
||||
.slave_id = SHDMA_SLAVE_SDHI0_TX,
|
||||
.addr = 0xe6850030,
|
||||
|
|
|
|||
|
|
@ -1,549 +0,0 @@
|
|||
/*
|
||||
* sh7377 processor support
|
||||
*
|
||||
* Copyright (C) 2010 Magnus Damm
|
||||
* Copyright (C) 2008 Yoshihiro Shimoda
|
||||
*
|
||||
* 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/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/uio_driver.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/serial_sci.h>
|
||||
#include <linux/sh_intc.h>
|
||||
#include <linux/sh_timer.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/common.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/time.h>
|
||||
|
||||
static struct map_desc sh7377_io_desc[] __initdata = {
|
||||
/* create a 1:1 entity map for 0xe6xxxxxx
|
||||
* used by CPGA, INTC and PFC.
|
||||
*/
|
||||
{
|
||||
.virtual = 0xe6000000,
|
||||
.pfn = __phys_to_pfn(0xe6000000),
|
||||
.length = 256 << 20,
|
||||
.type = MT_DEVICE_NONSHARED
|
||||
},
|
||||
};
|
||||
|
||||
void __init sh7377_map_io(void)
|
||||
{
|
||||
iotable_init(sh7377_io_desc, ARRAY_SIZE(sh7377_io_desc));
|
||||
}
|
||||
|
||||
/* SCIFA0 */
|
||||
static struct plat_sci_port scif0_platform_data = {
|
||||
.mapbase = 0xe6c40000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xc00), evt2irq(0xc00),
|
||||
evt2irq(0xc00), evt2irq(0xc00) },
|
||||
};
|
||||
|
||||
static struct platform_device scif0_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &scif0_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA1 */
|
||||
static struct plat_sci_port scif1_platform_data = {
|
||||
.mapbase = 0xe6c50000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xc20), evt2irq(0xc20),
|
||||
evt2irq(0xc20), evt2irq(0xc20) },
|
||||
};
|
||||
|
||||
static struct platform_device scif1_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &scif1_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA2 */
|
||||
static struct plat_sci_port scif2_platform_data = {
|
||||
.mapbase = 0xe6c60000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xc40), evt2irq(0xc40),
|
||||
evt2irq(0xc40), evt2irq(0xc40) },
|
||||
};
|
||||
|
||||
static struct platform_device scif2_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 2,
|
||||
.dev = {
|
||||
.platform_data = &scif2_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA3 */
|
||||
static struct plat_sci_port scif3_platform_data = {
|
||||
.mapbase = 0xe6c70000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xc60), evt2irq(0xc60),
|
||||
evt2irq(0xc60), evt2irq(0xc60) },
|
||||
};
|
||||
|
||||
static struct platform_device scif3_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 3,
|
||||
.dev = {
|
||||
.platform_data = &scif3_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA4 */
|
||||
static struct plat_sci_port scif4_platform_data = {
|
||||
.mapbase = 0xe6c80000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xd20), evt2irq(0xd20),
|
||||
evt2irq(0xd20), evt2irq(0xd20) },
|
||||
};
|
||||
|
||||
static struct platform_device scif4_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 4,
|
||||
.dev = {
|
||||
.platform_data = &scif4_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA5 */
|
||||
static struct plat_sci_port scif5_platform_data = {
|
||||
.mapbase = 0xe6cb0000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { evt2irq(0xd40), evt2irq(0xd40),
|
||||
evt2irq(0xd40), evt2irq(0xd40) },
|
||||
};
|
||||
|
||||
static struct platform_device scif5_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 5,
|
||||
.dev = {
|
||||
.platform_data = &scif5_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFA6 */
|
||||
static struct plat_sci_port scif6_platform_data = {
|
||||
.mapbase = 0xe6cc0000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFA,
|
||||
.irqs = { intcs_evt2irq(0x1a80), intcs_evt2irq(0x1a80),
|
||||
intcs_evt2irq(0x1a80), intcs_evt2irq(0x1a80) },
|
||||
};
|
||||
|
||||
static struct platform_device scif6_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 6,
|
||||
.dev = {
|
||||
.platform_data = &scif6_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* SCIFB */
|
||||
static struct plat_sci_port scif7_platform_data = {
|
||||
.mapbase = 0xe6c30000,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.scscr = SCSCR_RE | SCSCR_TE,
|
||||
.scbrr_algo_id = SCBRR_ALGO_4,
|
||||
.type = PORT_SCIFB,
|
||||
.irqs = { evt2irq(0xd60), evt2irq(0xd60),
|
||||
evt2irq(0xd60), evt2irq(0xd60) },
|
||||
};
|
||||
|
||||
static struct platform_device scif7_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 7,
|
||||
.dev = {
|
||||
.platform_data = &scif7_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct sh_timer_config cmt10_platform_data = {
|
||||
.name = "CMT10",
|
||||
.channel_offset = 0x10,
|
||||
.timer_bit = 0,
|
||||
.clockevent_rating = 125,
|
||||
.clocksource_rating = 125,
|
||||
};
|
||||
|
||||
static struct resource cmt10_resources[] = {
|
||||
[0] = {
|
||||
.name = "CMT10",
|
||||
.start = 0xe6138010,
|
||||
.end = 0xe613801b,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = evt2irq(0xb00), /* CMT1_CMT10 */
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device cmt10_device = {
|
||||
.name = "sh_cmt",
|
||||
.id = 10,
|
||||
.dev = {
|
||||
.platform_data = &cmt10_platform_data,
|
||||
},
|
||||
.resource = cmt10_resources,
|
||||
.num_resources = ARRAY_SIZE(cmt10_resources),
|
||||
};
|
||||
|
||||
/* VPU */
|
||||
static struct uio_info vpu_platform_data = {
|
||||
.name = "VPU5HG",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x980),
|
||||
};
|
||||
|
||||
static struct resource vpu_resources[] = {
|
||||
[0] = {
|
||||
.name = "VPU",
|
||||
.start = 0xfe900000,
|
||||
.end = 0xfe900157,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device vpu_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &vpu_platform_data,
|
||||
},
|
||||
.resource = vpu_resources,
|
||||
.num_resources = ARRAY_SIZE(vpu_resources),
|
||||
};
|
||||
|
||||
/* VEU0 */
|
||||
static struct uio_info veu0_platform_data = {
|
||||
.name = "VEU0",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x700),
|
||||
};
|
||||
|
||||
static struct resource veu0_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU0",
|
||||
.start = 0xfe920000,
|
||||
.end = 0xfe9200cb,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu0_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &veu0_platform_data,
|
||||
},
|
||||
.resource = veu0_resources,
|
||||
.num_resources = ARRAY_SIZE(veu0_resources),
|
||||
};
|
||||
|
||||
/* VEU1 */
|
||||
static struct uio_info veu1_platform_data = {
|
||||
.name = "VEU1",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x720),
|
||||
};
|
||||
|
||||
static struct resource veu1_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU1",
|
||||
.start = 0xfe924000,
|
||||
.end = 0xfe9240cb,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu1_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 2,
|
||||
.dev = {
|
||||
.platform_data = &veu1_platform_data,
|
||||
},
|
||||
.resource = veu1_resources,
|
||||
.num_resources = ARRAY_SIZE(veu1_resources),
|
||||
};
|
||||
|
||||
/* VEU2 */
|
||||
static struct uio_info veu2_platform_data = {
|
||||
.name = "VEU2",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x740),
|
||||
};
|
||||
|
||||
static struct resource veu2_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU2",
|
||||
.start = 0xfe928000,
|
||||
.end = 0xfe928307,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu2_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 3,
|
||||
.dev = {
|
||||
.platform_data = &veu2_platform_data,
|
||||
},
|
||||
.resource = veu2_resources,
|
||||
.num_resources = ARRAY_SIZE(veu2_resources),
|
||||
};
|
||||
|
||||
/* VEU3 */
|
||||
static struct uio_info veu3_platform_data = {
|
||||
.name = "VEU3",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x760),
|
||||
};
|
||||
|
||||
static struct resource veu3_resources[] = {
|
||||
[0] = {
|
||||
.name = "VEU3",
|
||||
.start = 0xfe92c000,
|
||||
.end = 0xfe92c307,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device veu3_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 4,
|
||||
.dev = {
|
||||
.platform_data = &veu3_platform_data,
|
||||
},
|
||||
.resource = veu3_resources,
|
||||
.num_resources = ARRAY_SIZE(veu3_resources),
|
||||
};
|
||||
|
||||
/* JPU */
|
||||
static struct uio_info jpu_platform_data = {
|
||||
.name = "JPU",
|
||||
.version = "0",
|
||||
.irq = intcs_evt2irq(0x560),
|
||||
};
|
||||
|
||||
static struct resource jpu_resources[] = {
|
||||
[0] = {
|
||||
.name = "JPU",
|
||||
.start = 0xfe980000,
|
||||
.end = 0xfe9902d3,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device jpu_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 5,
|
||||
.dev = {
|
||||
.platform_data = &jpu_platform_data,
|
||||
},
|
||||
.resource = jpu_resources,
|
||||
.num_resources = ARRAY_SIZE(jpu_resources),
|
||||
};
|
||||
|
||||
/* SPU2DSP0 */
|
||||
static struct uio_info spu0_platform_data = {
|
||||
.name = "SPU2DSP0",
|
||||
.version = "0",
|
||||
.irq = evt2irq(0x1800),
|
||||
};
|
||||
|
||||
static struct resource spu0_resources[] = {
|
||||
[0] = {
|
||||
.name = "SPU2DSP0",
|
||||
.start = 0xfe200000,
|
||||
.end = 0xfe2fffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device spu0_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 6,
|
||||
.dev = {
|
||||
.platform_data = &spu0_platform_data,
|
||||
},
|
||||
.resource = spu0_resources,
|
||||
.num_resources = ARRAY_SIZE(spu0_resources),
|
||||
};
|
||||
|
||||
/* SPU2DSP1 */
|
||||
static struct uio_info spu1_platform_data = {
|
||||
.name = "SPU2DSP1",
|
||||
.version = "0",
|
||||
.irq = evt2irq(0x1820),
|
||||
};
|
||||
|
||||
static struct resource spu1_resources[] = {
|
||||
[0] = {
|
||||
.name = "SPU2DSP1",
|
||||
.start = 0xfe300000,
|
||||
.end = 0xfe3fffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device spu1_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 7,
|
||||
.dev = {
|
||||
.platform_data = &spu1_platform_data,
|
||||
},
|
||||
.resource = spu1_resources,
|
||||
.num_resources = ARRAY_SIZE(spu1_resources),
|
||||
};
|
||||
|
||||
static struct platform_device *sh7377_early_devices[] __initdata = {
|
||||
&scif0_device,
|
||||
&scif1_device,
|
||||
&scif2_device,
|
||||
&scif3_device,
|
||||
&scif4_device,
|
||||
&scif5_device,
|
||||
&scif6_device,
|
||||
&scif7_device,
|
||||
&cmt10_device,
|
||||
};
|
||||
|
||||
static struct platform_device *sh7377_devices[] __initdata = {
|
||||
&vpu_device,
|
||||
&veu0_device,
|
||||
&veu1_device,
|
||||
&veu2_device,
|
||||
&veu3_device,
|
||||
&jpu_device,
|
||||
&spu0_device,
|
||||
&spu1_device,
|
||||
};
|
||||
|
||||
void __init sh7377_add_standard_devices(void)
|
||||
{
|
||||
platform_add_devices(sh7377_early_devices,
|
||||
ARRAY_SIZE(sh7377_early_devices));
|
||||
|
||||
platform_add_devices(sh7377_devices,
|
||||
ARRAY_SIZE(sh7377_devices));
|
||||
}
|
||||
|
||||
static void __init sh7377_earlytimer_init(void)
|
||||
{
|
||||
sh7377_clock_init();
|
||||
shmobile_earlytimer_init();
|
||||
}
|
||||
|
||||
#define SMSTPCR3 IOMEM(0xe615013c)
|
||||
#define SMSTPCR3_CMT1 (1 << 29)
|
||||
|
||||
void __init sh7377_add_early_devices(void)
|
||||
{
|
||||
/* enable clock to CMT1 */
|
||||
__raw_writel(__raw_readl(SMSTPCR3) & ~SMSTPCR3_CMT1, SMSTPCR3);
|
||||
|
||||
early_platform_add_devices(sh7377_early_devices,
|
||||
ARRAY_SIZE(sh7377_early_devices));
|
||||
|
||||
/* setup early console here as well */
|
||||
shmobile_setup_console();
|
||||
|
||||
/* override timer setup with soc-specific code */
|
||||
shmobile_timer.init = sh7377_earlytimer_init;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USE_OF
|
||||
|
||||
void __init sh7377_add_early_devices_dt(void)
|
||||
{
|
||||
shmobile_setup_delay(600, 1, 3); /* Cortex-A8 @ 600MHz */
|
||||
|
||||
early_platform_add_devices(sh7377_early_devices,
|
||||
ARRAY_SIZE(sh7377_early_devices));
|
||||
|
||||
/* setup early console here as well */
|
||||
shmobile_setup_console();
|
||||
}
|
||||
|
||||
static const struct of_dev_auxdata sh7377_auxdata_lookup[] __initconst = {
|
||||
{ }
|
||||
};
|
||||
|
||||
void __init sh7377_add_standard_devices_dt(void)
|
||||
{
|
||||
/* clocks are setup late during boot in the case of DT */
|
||||
sh7377_clock_init();
|
||||
|
||||
platform_add_devices(sh7377_early_devices,
|
||||
ARRAY_SIZE(sh7377_early_devices));
|
||||
|
||||
of_platform_populate(NULL, of_default_bus_match_table,
|
||||
sh7377_auxdata_lookup, NULL);
|
||||
}
|
||||
|
||||
static const char *sh7377_boards_compat_dt[] __initdata = {
|
||||
"renesas,sh7377",
|
||||
NULL,
|
||||
};
|
||||
|
||||
DT_MACHINE_START(SH7377_DT, "Generic SH7377 (Flattened Device Tree)")
|
||||
.map_io = sh7377_map_io,
|
||||
.init_early = sh7377_add_early_devices_dt,
|
||||
.init_irq = sh7377_init_irq,
|
||||
.handle_irq = shmobile_handle_irq_intc,
|
||||
.init_machine = sh7377_add_standard_devices_dt,
|
||||
.timer = &shmobile_timer,
|
||||
.dt_compat = sh7377_boards_compat_dt,
|
||||
MACHINE_END
|
||||
|
||||
#endif /* CONFIG_USE_OF */
|
||||
|
|
@ -32,24 +32,8 @@
|
|||
|
||||
#define EMEV2_SCU_BASE 0x1e000000
|
||||
|
||||
static DEFINE_SPINLOCK(scu_lock);
|
||||
static void __iomem *scu_base;
|
||||
|
||||
static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
/* we assume this code is running on a different cpu
|
||||
* than the one that is changing coherency setting */
|
||||
spin_lock(&scu_lock);
|
||||
tmp = readl(scu_base + 8);
|
||||
tmp &= ~clr;
|
||||
tmp |= set;
|
||||
writel(tmp, scu_base + 8);
|
||||
spin_unlock(&scu_lock);
|
||||
|
||||
}
|
||||
|
||||
static unsigned int __init emev2_get_core_count(void)
|
||||
{
|
||||
if (!scu_base) {
|
||||
|
|
@ -95,7 +79,7 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *
|
|||
cpu = cpu_logical_map(cpu);
|
||||
|
||||
/* enable cache coherency */
|
||||
modify_scu_cpu_psr(0, 3 << (cpu * 8));
|
||||
scu_power_mode(scu_base, 0);
|
||||
|
||||
/* Tell ROM loader about our vector (in headsmp.S) */
|
||||
emev2_set_boot_vector(__pa(shmobile_secondary_vector));
|
||||
|
|
@ -106,12 +90,10 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *
|
|||
|
||||
static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
|
||||
{
|
||||
int cpu = cpu_logical_map(0);
|
||||
|
||||
scu_enable(scu_base);
|
||||
|
||||
/* enable cache coherency on CPU0 */
|
||||
modify_scu_cpu_psr(0, 3 << (cpu * 8));
|
||||
scu_power_mode(scu_base, 0);
|
||||
}
|
||||
|
||||
static void __init emev2_smp_init_cpus(void)
|
||||
|
|
|
|||
|
|
@ -61,9 +61,6 @@ static void __iomem *scu_base_addr(void)
|
|||
return (void __iomem *)0xf0000000;
|
||||
}
|
||||
|
||||
static DEFINE_SPINLOCK(scu_lock);
|
||||
static unsigned long tmp;
|
||||
|
||||
#ifdef CONFIG_HAVE_ARM_TWD
|
||||
static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);
|
||||
|
||||
|
|
@ -73,20 +70,6 @@ void __init r8a7779_register_twd(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
|
||||
{
|
||||
void __iomem *scu_base = scu_base_addr();
|
||||
|
||||
spin_lock(&scu_lock);
|
||||
tmp = __raw_readl(scu_base + 8);
|
||||
tmp &= ~clr;
|
||||
tmp |= set;
|
||||
spin_unlock(&scu_lock);
|
||||
|
||||
/* disable cache coherency after releasing the lock */
|
||||
__raw_writel(tmp, scu_base + 8);
|
||||
}
|
||||
|
||||
static unsigned int __init r8a7779_get_core_count(void)
|
||||
{
|
||||
void __iomem *scu_base = scu_base_addr();
|
||||
|
|
@ -102,7 +85,7 @@ static int r8a7779_platform_cpu_kill(unsigned int cpu)
|
|||
cpu = cpu_logical_map(cpu);
|
||||
|
||||
/* disable cache coherency */
|
||||
modify_scu_cpu_psr(3 << (cpu * 8), 0);
|
||||
scu_power_mode(scu_base_addr(), 3);
|
||||
|
||||
if (cpu < ARRAY_SIZE(r8a7779_ch_cpu))
|
||||
ch = r8a7779_ch_cpu[cpu];
|
||||
|
|
@ -145,7 +128,7 @@ static int __cpuinit r8a7779_boot_secondary(unsigned int cpu, struct task_struct
|
|||
cpu = cpu_logical_map(cpu);
|
||||
|
||||
/* enable cache coherency */
|
||||
modify_scu_cpu_psr(0, 3 << (cpu * 8));
|
||||
scu_power_mode(scu_base_addr(), 0);
|
||||
|
||||
if (cpu < ARRAY_SIZE(r8a7779_ch_cpu))
|
||||
ch = r8a7779_ch_cpu[cpu];
|
||||
|
|
@ -158,15 +141,13 @@ static int __cpuinit r8a7779_boot_secondary(unsigned int cpu, struct task_struct
|
|||
|
||||
static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
|
||||
{
|
||||
int cpu = cpu_logical_map(0);
|
||||
|
||||
scu_enable(scu_base_addr());
|
||||
|
||||
/* Map the reset vector (in headsmp.S) */
|
||||
__raw_writel(__pa(shmobile_secondary_vector), AVECR);
|
||||
|
||||
/* enable cache coherency on CPU0 */
|
||||
modify_scu_cpu_psr(0, 3 << (cpu * 8));
|
||||
scu_power_mode(scu_base_addr(), 0);
|
||||
|
||||
r8a7779_pm_init();
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,6 @@ static void __iomem *scu_base_addr(void)
|
|||
return (void __iomem *)0xf0000000;
|
||||
}
|
||||
|
||||
static DEFINE_SPINLOCK(scu_lock);
|
||||
static unsigned long tmp;
|
||||
|
||||
#ifdef CONFIG_HAVE_ARM_TWD
|
||||
static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);
|
||||
void __init sh73a0_register_twd(void)
|
||||
|
|
@ -52,20 +49,6 @@ void __init sh73a0_register_twd(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
|
||||
{
|
||||
void __iomem *scu_base = scu_base_addr();
|
||||
|
||||
spin_lock(&scu_lock);
|
||||
tmp = __raw_readl(scu_base + 8);
|
||||
tmp &= ~clr;
|
||||
tmp |= set;
|
||||
spin_unlock(&scu_lock);
|
||||
|
||||
/* disable cache coherency after releasing the lock */
|
||||
__raw_writel(tmp, scu_base + 8);
|
||||
}
|
||||
|
||||
static unsigned int __init sh73a0_get_core_count(void)
|
||||
{
|
||||
void __iomem *scu_base = scu_base_addr();
|
||||
|
|
@ -83,7 +66,7 @@ static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct
|
|||
cpu = cpu_logical_map(cpu);
|
||||
|
||||
/* enable cache coherency */
|
||||
modify_scu_cpu_psr(0, 3 << (cpu * 8));
|
||||
scu_power_mode(scu_base_addr(), 0);
|
||||
|
||||
if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3)
|
||||
__raw_writel(1 << cpu, WUPCR); /* wake up */
|
||||
|
|
@ -95,8 +78,6 @@ static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct
|
|||
|
||||
static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
|
||||
{
|
||||
int cpu = cpu_logical_map(0);
|
||||
|
||||
scu_enable(scu_base_addr());
|
||||
|
||||
/* Map the reset vector (in headsmp.S) */
|
||||
|
|
@ -104,7 +85,7 @@ static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
|
|||
__raw_writel(__pa(shmobile_secondary_vector), SBAR);
|
||||
|
||||
/* enable cache coherency on CPU0 */
|
||||
modify_scu_cpu_psr(0, 3 << (cpu * 8));
|
||||
scu_power_mode(scu_base_addr(), 0);
|
||||
}
|
||||
|
||||
static void __init sh73a0_smp_init_cpus(void)
|
||||
|
|
|
|||
|
|
@ -745,7 +745,7 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,
|
|||
static int
|
||||
do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
|
||||
{
|
||||
union offset_union offset;
|
||||
union offset_union uninitialized_var(offset);
|
||||
unsigned long instr = 0, instrptr;
|
||||
int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);
|
||||
unsigned int type;
|
||||
|
|
|
|||
|
|
@ -701,11 +701,14 @@ static int __init vfp_init(void)
|
|||
elf_hwcap |= HWCAP_VFPv3;
|
||||
|
||||
/*
|
||||
* Check for VFPv3 D16. CPUs in this configuration
|
||||
* only have 16 x 64bit registers.
|
||||
* Check for VFPv3 D16 and VFPv4 D16. CPUs in
|
||||
* this configuration only have 16 x 64bit
|
||||
* registers.
|
||||
*/
|
||||
if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK)) == 1)
|
||||
elf_hwcap |= HWCAP_VFPv3D16;
|
||||
elf_hwcap |= HWCAP_VFPv3D16; /* also v4-D16 */
|
||||
else
|
||||
elf_hwcap |= HWCAP_VFPD32;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -166,3 +166,14 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
|
|||
*pages = NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(free_xenballooned_pages);
|
||||
|
||||
/* In the hypervisor.S file. */
|
||||
EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
|
||||
EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
|
||||
EXPORT_SYMBOL_GPL(HYPERVISOR_xen_version);
|
||||
EXPORT_SYMBOL_GPL(HYPERVISOR_console_io);
|
||||
EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op);
|
||||
EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op);
|
||||
EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
|
||||
EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
|
||||
EXPORT_SYMBOL_GPL(privcmd_call);
|
||||
|
|
|
|||
|
|
@ -48,20 +48,16 @@
|
|||
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/assembler.h>
|
||||
#include <asm/opcodes-virt.h>
|
||||
#include <xen/interface/xen.h>
|
||||
|
||||
|
||||
/* HVC 0xEA1 */
|
||||
#ifdef CONFIG_THUMB2_KERNEL
|
||||
#define xen_hvc .word 0xf7e08ea1
|
||||
#else
|
||||
#define xen_hvc .word 0xe140ea71
|
||||
#endif
|
||||
#define XEN_IMM 0xEA1
|
||||
|
||||
#define HYPERCALL_SIMPLE(hypercall) \
|
||||
ENTRY(HYPERVISOR_##hypercall) \
|
||||
mov r12, #__HYPERVISOR_##hypercall; \
|
||||
xen_hvc; \
|
||||
__HVC(XEN_IMM); \
|
||||
mov pc, lr; \
|
||||
ENDPROC(HYPERVISOR_##hypercall)
|
||||
|
||||
|
|
@ -76,7 +72,7 @@ ENTRY(HYPERVISOR_##hypercall) \
|
|||
stmdb sp!, {r4} \
|
||||
ldr r4, [sp, #4] \
|
||||
mov r12, #__HYPERVISOR_##hypercall; \
|
||||
xen_hvc \
|
||||
__HVC(XEN_IMM); \
|
||||
ldm sp!, {r4} \
|
||||
mov pc, lr \
|
||||
ENDPROC(HYPERVISOR_##hypercall)
|
||||
|
|
@ -100,7 +96,7 @@ ENTRY(privcmd_call)
|
|||
mov r2, r3
|
||||
ldr r3, [sp, #8]
|
||||
ldr r4, [sp, #4]
|
||||
xen_hvc
|
||||
__HVC(XEN_IMM)
|
||||
ldm sp!, {r4}
|
||||
mov pc, lr
|
||||
ENDPROC(privcmd_call);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
config ARM64
|
||||
def_bool y
|
||||
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
|
||||
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select GENERIC_HARDIRQS_NO_DEPRECATED
|
||||
select GENERIC_IOMAP
|
||||
|
|
|
|||
|
|
@ -25,12 +25,10 @@
|
|||
#include <asm/user.h>
|
||||
|
||||
typedef unsigned long elf_greg_t;
|
||||
typedef unsigned long elf_freg_t[3];
|
||||
|
||||
#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
|
||||
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
||||
|
||||
typedef struct user_fp elf_fpregset_t;
|
||||
typedef struct user_fpsimd_state elf_fpregset_t;
|
||||
|
||||
#define EM_AARCH64 183
|
||||
|
||||
|
|
@ -87,7 +85,6 @@ typedef struct user_fp elf_fpregset_t;
|
|||
#define R_AARCH64_MOVW_PREL_G2_NC 292
|
||||
#define R_AARCH64_MOVW_PREL_G3 293
|
||||
|
||||
|
||||
/*
|
||||
* These are used to set parameters in the core dumps.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,9 +25,8 @@
|
|||
* - FPSR and FPCR
|
||||
* - 32 128-bit data registers
|
||||
*
|
||||
* Note that user_fp forms a prefix of this structure, which is relied
|
||||
* upon in the ptrace FP/SIMD accessors. struct user_fpsimd_state must
|
||||
* form a prefix of struct fpsimd_state.
|
||||
* Note that user_fpsimd forms a prefix of this structure, which is
|
||||
* relied upon in the ptrace FP/SIMD accessors.
|
||||
*/
|
||||
struct fpsimd_state {
|
||||
union {
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
|
|||
* I/O port access primitives.
|
||||
*/
|
||||
#define IO_SPACE_LIMIT 0xffff
|
||||
#define PCI_IOBASE ((void __iomem *)0xffffffbbfffe0000UL)
|
||||
#define PCI_IOBASE ((void __iomem *)(MODULES_VADDR - SZ_2M))
|
||||
|
||||
static inline u8 inb(unsigned long addr)
|
||||
{
|
||||
|
|
@ -225,9 +225,9 @@ extern void __iounmap(volatile void __iomem *addr);
|
|||
#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_XN | PTE_ATTRINDX(MT_DEVICE_nGnRE))
|
||||
#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC))
|
||||
|
||||
#define ioremap(addr, size) __ioremap((addr), (size), PROT_DEVICE_nGnRE)
|
||||
#define ioremap_nocache(addr, size) __ioremap((addr), (size), PROT_DEVICE_nGnRE)
|
||||
#define ioremap_wc(addr, size) __ioremap((addr), (size), PROT_NORMAL_NC)
|
||||
#define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
|
||||
#define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
|
||||
#define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
|
||||
#define iounmap __iounmap
|
||||
|
||||
#define ARCH_HAS_IOREMAP_WC
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@
|
|||
#else
|
||||
#define STACK_TOP STACK_TOP_MAX
|
||||
#endif /* CONFIG_COMPAT */
|
||||
|
||||
#define ARCH_LOW_ADDRESS_LIMIT PHYS_MASK
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
struct debug_info {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifdef CONFIG_COMPAT
|
||||
#define __ARCH_WANT_COMPAT_IPC_PARSE_VERSION
|
||||
#define __ARCH_WANT_COMPAT_STAT64
|
||||
#define __ARCH_WANT_SYS_GETHOSTNAME
|
||||
#define __ARCH_WANT_SYS_PAUSE
|
||||
|
|
|
|||
|
|
@ -613,17 +613,11 @@ enum armv8_pmuv3_perf_types {
|
|||
ARMV8_PMUV3_PERFCTR_BUS_ACCESS = 0x19,
|
||||
ARMV8_PMUV3_PERFCTR_MEM_ERROR = 0x1A,
|
||||
ARMV8_PMUV3_PERFCTR_BUS_CYCLES = 0x1D,
|
||||
|
||||
/*
|
||||
* This isn't an architected event.
|
||||
* We detect this event number and use the cycle counter instead.
|
||||
*/
|
||||
ARMV8_PMUV3_PERFCTR_CPU_CYCLES = 0xFF,
|
||||
};
|
||||
|
||||
/* PMUv3 HW events mapping. */
|
||||
static const unsigned armv8_pmuv3_perf_map[PERF_COUNT_HW_MAX] = {
|
||||
[PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CPU_CYCLES,
|
||||
[PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES,
|
||||
[PERF_COUNT_HW_INSTRUCTIONS] = ARMV8_PMUV3_PERFCTR_INSTR_EXECUTED,
|
||||
[PERF_COUNT_HW_CACHE_REFERENCES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_ACCESS,
|
||||
[PERF_COUNT_HW_CACHE_MISSES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_REFILL,
|
||||
|
|
@ -1106,7 +1100,7 @@ static int armv8pmu_get_event_idx(struct pmu_hw_events *cpuc,
|
|||
unsigned long evtype = event->config_base & ARMV8_EVTYPE_EVENT;
|
||||
|
||||
/* Always place a cycle counter into the cycle counter. */
|
||||
if (evtype == ARMV8_PMUV3_PERFCTR_CPU_CYCLES) {
|
||||
if (evtype == ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES) {
|
||||
if (test_and_set_bit(ARMV8_IDX_CYCLE_COUNTER, cpuc->used_mask))
|
||||
return -EAGAIN;
|
||||
|
||||
|
|
|
|||
|
|
@ -309,24 +309,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
|
|||
return last;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill in the task's elfregs structure for a core dump.
|
||||
*/
|
||||
int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs)
|
||||
{
|
||||
elf_core_copy_regs(elfregs, task_pt_regs(t));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* fill in the fpe structure for a core dump...
|
||||
*/
|
||||
int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(dump_fpu);
|
||||
|
||||
/*
|
||||
* Shuffle the argument into the correct register before calling the
|
||||
* thread function. x1 is the thread argument, x2 is the pointer to
|
||||
|
|
|
|||
|
|
@ -211,8 +211,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
|
|||
* before we continue.
|
||||
*/
|
||||
set_cpu_online(cpu, true);
|
||||
while (!cpu_active(cpu))
|
||||
cpu_relax();
|
||||
complete(&cpu_running);
|
||||
|
||||
/*
|
||||
* OK, it's off to the idle thread for us
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
|
|||
#ifdef CONFIG_ZONE_DMA32
|
||||
/* 4GB maximum for 32-bit only capable devices */
|
||||
max_dma32 = min(max, MAX_DMA32_PFN);
|
||||
zone_size[ZONE_DMA32] = max_dma32 - min;
|
||||
zone_size[ZONE_DMA32] = max(min, max_dma32) - min;
|
||||
#endif
|
||||
zone_size[ZONE_NORMAL] = max - max_dma32;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ config FRV
|
|||
select GENERIC_CPU_DEVICES
|
||||
select ARCH_WANT_IPC_PARSE_VERSION
|
||||
select GENERIC_KERNEL_THREAD
|
||||
select GENERIC_KERNEL_EXECVE
|
||||
|
||||
config ZONE_DMA
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ PARAMS_PHYS = 0x0207c000
|
|||
INITRD_PHYS = 0x02180000
|
||||
INITRD_VIRT = 0x02180000
|
||||
|
||||
OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment
|
||||
|
||||
#
|
||||
# If you don't define ZRELADDR above,
|
||||
# then it defaults to ZTEXTADDR
|
||||
|
|
@ -32,18 +34,18 @@ Image: $(obj)/Image
|
|||
targets: $(obj)/Image
|
||||
|
||||
$(obj)/Image: vmlinux FORCE
|
||||
$(OBJCOPY) -O binary -R .note -R .comment -S vmlinux $@
|
||||
$(OBJCOPY) $(OBJCOPYFLAGS) -S vmlinux $@
|
||||
|
||||
#$(obj)/Image: $(CONFIGURE) $(SYSTEM)
|
||||
# $(OBJCOPY) -O binary -R .note -R .comment -g -S $(SYSTEM) $@
|
||||
# $(OBJCOPY) $(OBJCOPYFLAGS) -g -S $(SYSTEM) $@
|
||||
|
||||
bzImage: zImage
|
||||
|
||||
zImage: $(CONFIGURE) compressed/$(LINUX)
|
||||
$(OBJCOPY) -O binary -R .note -R .comment -S compressed/$(LINUX) $@
|
||||
$(OBJCOPY) $(OBJCOPYFLAGS) -S compressed/$(LINUX) $@
|
||||
|
||||
bootpImage: bootp/bootp
|
||||
$(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
|
||||
$(OBJCOPY) $(OBJCOPYFLAGS) -S bootp/bootp $@
|
||||
|
||||
compressed/$(LINUX): $(LINUX) dep
|
||||
@$(MAKE) -C compressed $(LINUX)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#define __ARCH_WANT_SYS_RT_SIGACTION
|
||||
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
|
||||
#define __ARCH_WANT_SYS_EXECVE
|
||||
#define __ARCH_WANT_KERNEL_EXECVE
|
||||
|
||||
/*
|
||||
* "Conditional" syscalls
|
||||
|
|
|
|||
|
|
@ -869,11 +869,6 @@ ret_from_kernel_thread:
|
|||
call schedule_tail
|
||||
calll.p @(gr21,gr0)
|
||||
or gr20,gr20,gr8
|
||||
bra sys_exit
|
||||
|
||||
.globl ret_from_kernel_execve
|
||||
ret_from_kernel_execve:
|
||||
ori gr28,0,sp
|
||||
bra __syscall_exit
|
||||
|
||||
###################################################################################################
|
||||
|
|
@ -1080,27 +1075,10 @@ __entry_return_from_kernel_interrupt:
|
|||
subicc gr5,#0,gr0,icc0
|
||||
beq icc0,#0,__entry_return_direct
|
||||
|
||||
__entry_preempt_need_resched:
|
||||
ldi @(gr15,#TI_FLAGS),gr4
|
||||
andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0
|
||||
beq icc0,#1,__entry_return_direct
|
||||
|
||||
setlos #PREEMPT_ACTIVE,gr5
|
||||
sti gr5,@(gr15,#TI_FLAGS)
|
||||
|
||||
andi gr23,#~PSR_PIL,gr23
|
||||
movgs gr23,psr
|
||||
|
||||
call schedule
|
||||
sti gr0,@(gr15,#TI_PRE_COUNT)
|
||||
|
||||
movsg psr,gr23
|
||||
ori gr23,#PSR_PIL_14,gr23
|
||||
movgs gr23,psr
|
||||
bra __entry_preempt_need_resched
|
||||
#else
|
||||
bra __entry_return_direct
|
||||
subcc gr0,gr0,gr0,icc2 /* set Z and clear C */
|
||||
call preempt_schedule_irq
|
||||
#endif
|
||||
bra __entry_return_direct
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
|
|
|||
|
|
@ -181,6 +181,9 @@ int copy_thread(unsigned long clone_flags,
|
|||
childregs = (struct pt_regs *)
|
||||
(task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE);
|
||||
|
||||
/* set up the userspace frame (the only place that the USP is stored) */
|
||||
*childregs = *__kernel_frame0_ptr;
|
||||
|
||||
p->set_child_tid = p->clear_child_tid = NULL;
|
||||
|
||||
p->thread.frame = childregs;
|
||||
|
|
@ -191,10 +194,8 @@ int copy_thread(unsigned long clone_flags,
|
|||
p->thread.frame0 = childregs;
|
||||
|
||||
if (unlikely(!regs)) {
|
||||
memset(childregs, 0, sizeof(struct pt_regs));
|
||||
childregs->gr9 = usp; /* function */
|
||||
childregs->gr8 = arg;
|
||||
childregs->psr = PSR_S;
|
||||
p->thread.pc = (unsigned long) ret_from_kernel_thread;
|
||||
save_user_regs(p->thread.user);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/pci.h>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
#define __ARCH_H8300_CACHE_H
|
||||
|
||||
/* bytes per L1 cache line */
|
||||
#define L1_CACHE_BYTES 4
|
||||
#define L1_CACHE_SHIFT 2
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
/* m68k-elf-gcc 2.95.2 doesn't like these */
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
#define LPM_ANYPATH 0xff
|
||||
#define __MAX_CSSID 0
|
||||
#define __MAX_SUBCHANNEL 65535
|
||||
#define __MAX_SSID 3
|
||||
|
||||
#include <asm/scsw.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -506,12 +506,15 @@ static inline int pud_bad(pud_t pud)
|
|||
|
||||
static inline int pmd_present(pmd_t pmd)
|
||||
{
|
||||
return (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) != 0UL;
|
||||
unsigned long mask = _SEGMENT_ENTRY_INV | _SEGMENT_ENTRY_RO;
|
||||
return (pmd_val(pmd) & mask) == _HPAGE_TYPE_NONE ||
|
||||
!(pmd_val(pmd) & _SEGMENT_ENTRY_INV);
|
||||
}
|
||||
|
||||
static inline int pmd_none(pmd_t pmd)
|
||||
{
|
||||
return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) != 0UL;
|
||||
return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) &&
|
||||
!(pmd_val(pmd) & _SEGMENT_ENTRY_RO);
|
||||
}
|
||||
|
||||
static inline int pmd_large(pmd_t pmd)
|
||||
|
|
@ -1223,6 +1226,11 @@ static inline void __pmd_idte(unsigned long address, pmd_t *pmdp)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
|
||||
#define SEGMENT_NONE __pgprot(_HPAGE_TYPE_NONE)
|
||||
#define SEGMENT_RO __pgprot(_HPAGE_TYPE_RO)
|
||||
#define SEGMENT_RW __pgprot(_HPAGE_TYPE_RW)
|
||||
|
||||
#define __HAVE_ARCH_PGTABLE_DEPOSIT
|
||||
extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pgtable_t pgtable);
|
||||
|
||||
|
|
@ -1242,16 +1250,15 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
|
|||
|
||||
static inline unsigned long massage_pgprot_pmd(pgprot_t pgprot)
|
||||
{
|
||||
unsigned long pgprot_pmd = 0;
|
||||
|
||||
if (pgprot_val(pgprot) & _PAGE_INVALID) {
|
||||
if (pgprot_val(pgprot) & _PAGE_SWT)
|
||||
pgprot_pmd |= _HPAGE_TYPE_NONE;
|
||||
pgprot_pmd |= _SEGMENT_ENTRY_INV;
|
||||
}
|
||||
if (pgprot_val(pgprot) & _PAGE_RO)
|
||||
pgprot_pmd |= _SEGMENT_ENTRY_RO;
|
||||
return pgprot_pmd;
|
||||
/*
|
||||
* pgprot is PAGE_NONE, PAGE_RO, or PAGE_RW (see __Pxxx / __Sxxx)
|
||||
* Convert to segment table entry format.
|
||||
*/
|
||||
if (pgprot_val(pgprot) == pgprot_val(PAGE_NONE))
|
||||
return pgprot_val(SEGMENT_NONE);
|
||||
if (pgprot_val(pgprot) == pgprot_val(PAGE_RO))
|
||||
return pgprot_val(SEGMENT_RO);
|
||||
return pgprot_val(SEGMENT_RW);
|
||||
}
|
||||
|
||||
static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
|
||||
|
|
@ -1269,7 +1276,9 @@ static inline pmd_t pmd_mkhuge(pmd_t pmd)
|
|||
|
||||
static inline pmd_t pmd_mkwrite(pmd_t pmd)
|
||||
{
|
||||
pmd_val(pmd) &= ~_SEGMENT_ENTRY_RO;
|
||||
/* Do not clobber _HPAGE_TYPE_NONE pages! */
|
||||
if (!(pmd_val(pmd) & _SEGMENT_ENTRY_INV))
|
||||
pmd_val(pmd) &= ~_SEGMENT_ENTRY_RO;
|
||||
return pmd;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,12 @@ _sclp_wait_int:
|
|||
#endif
|
||||
mvc .LoldpswS1-.LbaseS1(16,%r13),0(%r8)
|
||||
mvc 0(16,%r8),0(%r9)
|
||||
#ifdef CONFIG_64BIT
|
||||
epsw %r6,%r7 # set current addressing mode
|
||||
nill %r6,0x1 # in new psw (31 or 64 bit mode)
|
||||
nilh %r7,0x8000
|
||||
stm %r6,%r7,0(%r8)
|
||||
#endif
|
||||
lhi %r6,0x0200 # cr mask for ext int (cr0.54)
|
||||
ltr %r2,%r2
|
||||
jz .LsetctS1
|
||||
|
|
@ -87,7 +93,7 @@ _sclp_wait_int:
|
|||
.long 0x00080000, 0x80000000+.LwaitS1 # PSW to handle ext int
|
||||
#ifdef CONFIG_64BIT
|
||||
.LextpswS1_64:
|
||||
.quad 0x0000000180000000, .LwaitS1 # PSW to handle ext int, 64 bit
|
||||
.quad 0, .LwaitS1 # PSW to handle ext int, 64 bit
|
||||
#endif
|
||||
.LwaitpswS1:
|
||||
.long 0x010a0000, 0x00000000+.LloopS1 # PSW to wait for ext int
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ static __always_inline unsigned long follow_table(struct mm_struct *mm,
|
|||
pmd = pmd_offset(pud, addr);
|
||||
if (pmd_none(*pmd))
|
||||
return -0x10UL;
|
||||
if (pmd_huge(*pmd)) {
|
||||
if (pmd_large(*pmd)) {
|
||||
if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO))
|
||||
return -0x04UL;
|
||||
return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK);
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ static inline int gup_pmd_range(pud_t *pudp, pud_t pud, unsigned long addr,
|
|||
*/
|
||||
if (pmd_none(pmd) || pmd_trans_splitting(pmd))
|
||||
return 0;
|
||||
if (unlikely(pmd_huge(pmd))) {
|
||||
if (unlikely(pmd_large(pmd))) {
|
||||
if (!gup_huge_pmd(pmdp, pmd, addr, next,
|
||||
write, pages, nr))
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ config SPARC
|
|||
select HAVE_ARCH_TRACEHOOK
|
||||
select SYSCTL_EXCEPTION_TRACE
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
|
||||
select RTC_CLASS
|
||||
select RTC_DRV_M48T59
|
||||
select HAVE_IRQ_WORK
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ obj-$(CONFIG_CRYPTO_DES_SPARC64) += camellia-sparc64.o
|
|||
|
||||
obj-$(CONFIG_CRYPTO_CRC32C_SPARC64) += crc32c-sparc64.o
|
||||
|
||||
sha1-sparc64-y := sha1_asm.o sha1_glue.o crop_devid.o
|
||||
sha256-sparc64-y := sha256_asm.o sha256_glue.o crop_devid.o
|
||||
sha512-sparc64-y := sha512_asm.o sha512_glue.o crop_devid.o
|
||||
md5-sparc64-y := md5_asm.o md5_glue.o crop_devid.o
|
||||
sha1-sparc64-y := sha1_asm.o sha1_glue.o
|
||||
sha256-sparc64-y := sha256_asm.o sha256_glue.o
|
||||
sha512-sparc64-y := sha512_asm.o sha512_glue.o
|
||||
md5-sparc64-y := md5_asm.o md5_glue.o
|
||||
|
||||
aes-sparc64-y := aes_asm.o aes_glue.o crop_devid.o
|
||||
des-sparc64-y := des_asm.o des_glue.o crop_devid.o
|
||||
camellia-sparc64-y := camellia_asm.o camellia_glue.o crop_devid.o
|
||||
aes-sparc64-y := aes_asm.o aes_glue.o
|
||||
des-sparc64-y := des_asm.o des_glue.o
|
||||
camellia-sparc64-y := camellia_asm.o camellia_glue.o
|
||||
|
||||
crc32c-sparc64-y := crc32c_asm.o crc32c_glue.o crop_devid.o
|
||||
crc32c-sparc64-y := crc32c_asm.o crc32c_glue.o
|
||||
|
|
|
|||
|
|
@ -475,3 +475,5 @@ MODULE_LICENSE("GPL");
|
|||
MODULE_DESCRIPTION("AES Secure Hash Algorithm, sparc64 aes opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("aes");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
|
|
|||
|
|
@ -320,3 +320,5 @@ MODULE_LICENSE("GPL");
|
|||
MODULE_DESCRIPTION("Camellia Cipher Algorithm, sparc64 camellia opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("aes");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
|
|
|||
|
|
@ -177,3 +177,5 @@ MODULE_LICENSE("GPL");
|
|||
MODULE_DESCRIPTION("CRC32c (Castagnoli), sparc64 crc32c opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("crc32c");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
|
|
|||
|
|
@ -527,3 +527,5 @@ MODULE_LICENSE("GPL");
|
|||
MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms, sparc64 des opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("des");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
|
|
|||
|
|
@ -186,3 +186,5 @@ MODULE_LICENSE("GPL");
|
|||
MODULE_DESCRIPTION("MD5 Secure Hash Algorithm, sparc64 md5 opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("md5");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
|
|
|||
|
|
@ -181,3 +181,5 @@ MODULE_LICENSE("GPL");
|
|||
MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, sparc64 sha1 opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("sha1");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
|
|
|||
|
|
@ -239,3 +239,5 @@ MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm, sparc64 sha256 op
|
|||
|
||||
MODULE_ALIAS("sha224");
|
||||
MODULE_ALIAS("sha256");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
|
|
|||
|
|
@ -224,3 +224,5 @@ MODULE_DESCRIPTION("SHA-384 and SHA-512 Secure Hash Algorithm, sparc64 sha512 op
|
|||
|
||||
MODULE_ALIAS("sha384");
|
||||
MODULE_ALIAS("sha512");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* atomic.h: Thankfully the V9 is at least reasonable for this
|
||||
* stuff.
|
||||
*
|
||||
* Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com)
|
||||
* Copyright (C) 1996, 1997, 2000, 2012 David S. Miller (davem@redhat.com)
|
||||
*/
|
||||
|
||||
#ifndef __ARCH_SPARC64_ATOMIC__
|
||||
|
|
@ -106,6 +106,8 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u)
|
|||
|
||||
#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
|
||||
|
||||
extern long atomic64_dec_if_positive(atomic64_t *v);
|
||||
|
||||
/* Atomic operations are already serializing */
|
||||
#define smp_mb__before_atomic_dec() barrier()
|
||||
#define smp_mb__after_atomic_dec() barrier()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,46 @@
|
|||
#ifndef _SPARC64_BACKOFF_H
|
||||
#define _SPARC64_BACKOFF_H
|
||||
|
||||
/* The macros in this file implement an exponential backoff facility
|
||||
* for atomic operations.
|
||||
*
|
||||
* When multiple threads compete on an atomic operation, it is
|
||||
* possible for one thread to be continually denied a successful
|
||||
* completion of the compare-and-swap instruction. Heavily
|
||||
* threaded cpu implementations like Niagara can compound this
|
||||
* problem even further.
|
||||
*
|
||||
* When an atomic operation fails and needs to be retried, we spin a
|
||||
* certain number of times. At each subsequent failure of the same
|
||||
* operation we double the spin count, realizing an exponential
|
||||
* backoff.
|
||||
*
|
||||
* When we spin, we try to use an operation that will cause the
|
||||
* current cpu strand to block, and therefore make the core fully
|
||||
* available to any other other runnable strands. There are two
|
||||
* options, based upon cpu capabilities.
|
||||
*
|
||||
* On all cpus prior to SPARC-T4 we do three dummy reads of the
|
||||
* condition code register. Each read blocks the strand for something
|
||||
* between 40 and 50 cpu cycles.
|
||||
*
|
||||
* For SPARC-T4 and later we have a special "pause" instruction
|
||||
* available. This is implemented using writes to register %asr27.
|
||||
* The cpu will block the number of cycles written into the register,
|
||||
* unless a disrupting trap happens first. SPARC-T4 specifically
|
||||
* implements pause with a granularity of 8 cycles. Each strand has
|
||||
* an internal pause counter which decrements every 8 cycles. So the
|
||||
* chip shifts the %asr27 value down by 3 bits, and writes the result
|
||||
* into the pause counter. If a value smaller than 8 is written, the
|
||||
* chip blocks for 1 cycle.
|
||||
*
|
||||
* To achieve the same amount of backoff as the three %ccr reads give
|
||||
* on earlier chips, we shift the backoff value up by 7 bits. (Three
|
||||
* %ccr reads block for about 128 cycles, 1 << 7 == 128) We write the
|
||||
* whole amount we want to block into the pause register, rather than
|
||||
* loop writing 128 each time.
|
||||
*/
|
||||
|
||||
#define BACKOFF_LIMIT (4 * 1024)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
|
@ -11,16 +51,25 @@
|
|||
#define BACKOFF_LABEL(spin_label, continue_label) \
|
||||
spin_label
|
||||
|
||||
#define BACKOFF_SPIN(reg, tmp, label) \
|
||||
mov reg, tmp; \
|
||||
88: brnz,pt tmp, 88b; \
|
||||
sub tmp, 1, tmp; \
|
||||
set BACKOFF_LIMIT, tmp; \
|
||||
cmp reg, tmp; \
|
||||
bg,pn %xcc, label; \
|
||||
nop; \
|
||||
ba,pt %xcc, label; \
|
||||
sllx reg, 1, reg;
|
||||
#define BACKOFF_SPIN(reg, tmp, label) \
|
||||
mov reg, tmp; \
|
||||
88: rd %ccr, %g0; \
|
||||
rd %ccr, %g0; \
|
||||
rd %ccr, %g0; \
|
||||
.section .pause_3insn_patch,"ax";\
|
||||
.word 88b; \
|
||||
sllx tmp, 7, tmp; \
|
||||
wr tmp, 0, %asr27; \
|
||||
clr tmp; \
|
||||
.previous; \
|
||||
brnz,pt tmp, 88b; \
|
||||
sub tmp, 1, tmp; \
|
||||
set BACKOFF_LIMIT, tmp; \
|
||||
cmp reg, tmp; \
|
||||
bg,pn %xcc, label; \
|
||||
nop; \
|
||||
ba,pt %xcc, label; \
|
||||
sllx reg, 1, reg;
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
|||
|
|
@ -232,9 +232,10 @@ static inline void __user *arch_compat_alloc_user_space(long len)
|
|||
struct pt_regs *regs = current_thread_info()->kregs;
|
||||
unsigned long usp = regs->u_regs[UREG_I6];
|
||||
|
||||
if (!(test_thread_flag(TIF_32BIT)))
|
||||
if (test_thread_64bit_stack(usp))
|
||||
usp += STACK_BIAS;
|
||||
else
|
||||
|
||||
if (test_thread_flag(TIF_32BIT))
|
||||
usp &= 0xffffffffUL;
|
||||
|
||||
usp -= len;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,22 @@ extern unsigned long get_wchan(struct task_struct *task);
|
|||
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc)
|
||||
#define KSTK_ESP(tsk) (task_pt_regs(tsk)->u_regs[UREG_FP])
|
||||
|
||||
#define cpu_relax() barrier()
|
||||
/* Please see the commentary in asm/backoff.h for a description of
|
||||
* what these instructions are doing and how they have been choosen.
|
||||
* To make a long story short, we are trying to yield the current cpu
|
||||
* strand during busy loops.
|
||||
*/
|
||||
#define cpu_relax() asm volatile("\n99:\n\t" \
|
||||
"rd %%ccr, %%g0\n\t" \
|
||||
"rd %%ccr, %%g0\n\t" \
|
||||
"rd %%ccr, %%g0\n\t" \
|
||||
".section .pause_3insn_patch,\"ax\"\n\t"\
|
||||
".word 99b\n\t" \
|
||||
"wr %%g0, 128, %%asr27\n\t" \
|
||||
"nop\n\t" \
|
||||
"nop\n\t" \
|
||||
".previous" \
|
||||
::: "memory")
|
||||
|
||||
/* Prefetch support. This is tuned for UltraSPARC-III and later.
|
||||
* UltraSPARC-I will treat these as nops, and UltraSPARC-II has
|
||||
|
|
|
|||
|
|
@ -63,5 +63,10 @@ extern char *of_console_options;
|
|||
extern void irq_trans_init(struct device_node *dp);
|
||||
extern char *build_path_component(struct device_node *dp);
|
||||
|
||||
/* SPARC has a local implementation */
|
||||
extern int of_address_to_resource(struct device_node *dev, int index,
|
||||
struct resource *r);
|
||||
#define of_address_to_resource of_address_to_resource
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _SPARC_PROM_H */
|
||||
|
|
|
|||
|
|
@ -259,6 +259,11 @@ static inline bool test_and_clear_restore_sigmask(void)
|
|||
|
||||
#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
|
||||
|
||||
#define thread32_stack_is_64bit(__SP) (((__SP) & 0x1) != 0)
|
||||
#define test_thread_64bit_stack(__SP) \
|
||||
((test_thread_flag(TIF_32BIT) && !thread32_stack_is_64bit(__SP)) ? \
|
||||
false : true)
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
|
|
|||
|
|
@ -372,7 +372,9 @@ etrap_spill_fixup_64bit: \
|
|||
|
||||
/* Normal 32bit spill */
|
||||
#define SPILL_2_GENERIC(ASI) \
|
||||
srl %sp, 0, %sp; \
|
||||
and %sp, 1, %g3; \
|
||||
brnz,pn %g3, (. - (128 + 4)); \
|
||||
srl %sp, 0, %sp; \
|
||||
stwa %l0, [%sp + %g0] ASI; \
|
||||
mov 0x04, %g3; \
|
||||
stwa %l1, [%sp + %g3] ASI; \
|
||||
|
|
@ -398,14 +400,16 @@ etrap_spill_fixup_64bit: \
|
|||
stwa %i6, [%g1 + %g0] ASI; \
|
||||
stwa %i7, [%g1 + %g3] ASI; \
|
||||
saved; \
|
||||
retry; nop; nop; \
|
||||
retry; \
|
||||
b,a,pt %xcc, spill_fixup_dax; \
|
||||
b,a,pt %xcc, spill_fixup_mna; \
|
||||
b,a,pt %xcc, spill_fixup;
|
||||
|
||||
#define SPILL_2_GENERIC_ETRAP \
|
||||
etrap_user_spill_32bit: \
|
||||
srl %sp, 0, %sp; \
|
||||
and %sp, 1, %g3; \
|
||||
brnz,pn %g3, etrap_user_spill_64bit; \
|
||||
srl %sp, 0, %sp; \
|
||||
stwa %l0, [%sp + 0x00] %asi; \
|
||||
stwa %l1, [%sp + 0x04] %asi; \
|
||||
stwa %l2, [%sp + 0x08] %asi; \
|
||||
|
|
@ -427,7 +431,7 @@ etrap_user_spill_32bit: \
|
|||
ba,pt %xcc, etrap_save; \
|
||||
wrpr %g1, %cwp; \
|
||||
nop; nop; nop; nop; \
|
||||
nop; nop; nop; nop; \
|
||||
nop; nop; \
|
||||
ba,a,pt %xcc, etrap_spill_fixup_32bit; \
|
||||
ba,a,pt %xcc, etrap_spill_fixup_32bit; \
|
||||
ba,a,pt %xcc, etrap_spill_fixup_32bit;
|
||||
|
|
@ -592,7 +596,9 @@ user_rtt_fill_64bit: \
|
|||
|
||||
/* Normal 32bit fill */
|
||||
#define FILL_2_GENERIC(ASI) \
|
||||
srl %sp, 0, %sp; \
|
||||
and %sp, 1, %g3; \
|
||||
brnz,pn %g3, (. - (128 + 4)); \
|
||||
srl %sp, 0, %sp; \
|
||||
lduwa [%sp + %g0] ASI, %l0; \
|
||||
mov 0x04, %g2; \
|
||||
mov 0x08, %g3; \
|
||||
|
|
@ -616,14 +622,16 @@ user_rtt_fill_64bit: \
|
|||
lduwa [%g1 + %g3] ASI, %i6; \
|
||||
lduwa [%g1 + %g5] ASI, %i7; \
|
||||
restored; \
|
||||
retry; nop; nop; nop; nop; \
|
||||
retry; nop; nop; \
|
||||
b,a,pt %xcc, fill_fixup_dax; \
|
||||
b,a,pt %xcc, fill_fixup_mna; \
|
||||
b,a,pt %xcc, fill_fixup;
|
||||
|
||||
#define FILL_2_GENERIC_RTRAP \
|
||||
user_rtt_fill_32bit: \
|
||||
srl %sp, 0, %sp; \
|
||||
and %sp, 1, %g3; \
|
||||
brnz,pn %g3, user_rtt_fill_64bit; \
|
||||
srl %sp, 0, %sp; \
|
||||
lduwa [%sp + 0x00] %asi, %l0; \
|
||||
lduwa [%sp + 0x04] %asi, %l1; \
|
||||
lduwa [%sp + 0x08] %asi, %l2; \
|
||||
|
|
@ -643,7 +651,7 @@ user_rtt_fill_32bit: \
|
|||
ba,pt %xcc, user_rtt_pre_restore; \
|
||||
restored; \
|
||||
nop; nop; nop; nop; nop; \
|
||||
nop; nop; nop; nop; nop; \
|
||||
nop; nop; nop; \
|
||||
ba,a,pt %xcc, user_rtt_fill_fixup; \
|
||||
ba,a,pt %xcc, user_rtt_fill_fixup; \
|
||||
ba,a,pt %xcc, user_rtt_fill_fixup;
|
||||
|
|
|
|||
|
|
@ -405,8 +405,13 @@
|
|||
#define __NR_setns 337
|
||||
#define __NR_process_vm_readv 338
|
||||
#define __NR_process_vm_writev 339
|
||||
#define __NR_kern_features 340
|
||||
#define __NR_kcmp 341
|
||||
|
||||
#define NR_syscalls 340
|
||||
#define NR_syscalls 342
|
||||
|
||||
/* Bitmask values returned from kern_features system call. */
|
||||
#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001
|
||||
|
||||
#ifdef __32bit_syscall_numbers__
|
||||
/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
|
||||
|
|
|
|||
|
|
@ -59,6 +59,13 @@ struct popc_6insn_patch_entry {
|
|||
extern struct popc_6insn_patch_entry __popc_6insn_patch,
|
||||
__popc_6insn_patch_end;
|
||||
|
||||
struct pause_patch_entry {
|
||||
unsigned int addr;
|
||||
unsigned int insns[3];
|
||||
};
|
||||
extern struct pause_patch_entry __pause_3insn_patch,
|
||||
__pause_3insn_patch_end;
|
||||
|
||||
extern void __init per_cpu_patch(void);
|
||||
extern void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *,
|
||||
struct sun4v_1insn_patch_entry *);
|
||||
|
|
|
|||
|
|
@ -56,11 +56,13 @@ static inline unsigned int leon_eirq_get(int cpu)
|
|||
static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
unsigned int eirq;
|
||||
struct irq_bucket *p;
|
||||
int cpu = sparc_leon3_cpuid();
|
||||
|
||||
eirq = leon_eirq_get(cpu);
|
||||
if ((eirq & 0x10) && irq_map[eirq]->irq) /* bit4 tells if IRQ happened */
|
||||
generic_handle_irq(irq_map[eirq]->irq);
|
||||
p = irq_map[eirq];
|
||||
if ((eirq & 0x10) && p && p->irq) /* bit4 tells if IRQ happened */
|
||||
generic_handle_irq(p->irq);
|
||||
}
|
||||
|
||||
/* The extended IRQ controller has been found, this function registers it */
|
||||
|
|
|
|||
|
|
@ -1762,15 +1762,25 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
|
|||
|
||||
ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
|
||||
do {
|
||||
struct sparc_stackf32 *usf, sf;
|
||||
unsigned long pc;
|
||||
|
||||
usf = (struct sparc_stackf32 *) ufp;
|
||||
if (__copy_from_user_inatomic(&sf, usf, sizeof(sf)))
|
||||
break;
|
||||
if (thread32_stack_is_64bit(ufp)) {
|
||||
struct sparc_stackf *usf, sf;
|
||||
|
||||
pc = sf.callers_pc;
|
||||
ufp = (unsigned long)sf.fp;
|
||||
ufp += STACK_BIAS;
|
||||
usf = (struct sparc_stackf *) ufp;
|
||||
if (__copy_from_user_inatomic(&sf, usf, sizeof(sf)))
|
||||
break;
|
||||
pc = sf.callers_pc & 0xffffffff;
|
||||
ufp = ((unsigned long) sf.fp) & 0xffffffff;
|
||||
} else {
|
||||
struct sparc_stackf32 *usf, sf;
|
||||
usf = (struct sparc_stackf32 *) ufp;
|
||||
if (__copy_from_user_inatomic(&sf, usf, sizeof(sf)))
|
||||
break;
|
||||
pc = sf.callers_pc;
|
||||
ufp = (unsigned long)sf.fp;
|
||||
}
|
||||
perf_callchain_store(entry, pc);
|
||||
} while (entry->nr < PERF_MAX_STACK_DEPTH);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -452,13 +452,16 @@ void flush_thread(void)
|
|||
/* It's a bit more tricky when 64-bit tasks are involved... */
|
||||
static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
|
||||
{
|
||||
bool stack_64bit = test_thread_64bit_stack(psp);
|
||||
unsigned long fp, distance, rval;
|
||||
|
||||
if (!(test_thread_flag(TIF_32BIT))) {
|
||||
if (stack_64bit) {
|
||||
csp += STACK_BIAS;
|
||||
psp += STACK_BIAS;
|
||||
__get_user(fp, &(((struct reg_window __user *)psp)->ins[6]));
|
||||
fp += STACK_BIAS;
|
||||
if (test_thread_flag(TIF_32BIT))
|
||||
fp &= 0xffffffff;
|
||||
} else
|
||||
__get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6]));
|
||||
|
||||
|
|
@ -472,7 +475,7 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
|
|||
rval = (csp - distance);
|
||||
if (copy_in_user((void __user *) rval, (void __user *) psp, distance))
|
||||
rval = 0;
|
||||
else if (test_thread_flag(TIF_32BIT)) {
|
||||
else if (!stack_64bit) {
|
||||
if (put_user(((u32)csp),
|
||||
&(((struct reg_window32 __user *)rval)->ins[6])))
|
||||
rval = 0;
|
||||
|
|
@ -507,18 +510,18 @@ void synchronize_user_stack(void)
|
|||
|
||||
flush_user_windows();
|
||||
if ((window = get_thread_wsaved()) != 0) {
|
||||
int winsize = sizeof(struct reg_window);
|
||||
int bias = 0;
|
||||
|
||||
if (test_thread_flag(TIF_32BIT))
|
||||
winsize = sizeof(struct reg_window32);
|
||||
else
|
||||
bias = STACK_BIAS;
|
||||
|
||||
window -= 1;
|
||||
do {
|
||||
unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
|
||||
struct reg_window *rwin = &t->reg_window[window];
|
||||
int winsize = sizeof(struct reg_window);
|
||||
unsigned long sp;
|
||||
|
||||
sp = t->rwbuf_stkptrs[window];
|
||||
|
||||
if (test_thread_64bit_stack(sp))
|
||||
sp += STACK_BIAS;
|
||||
else
|
||||
winsize = sizeof(struct reg_window32);
|
||||
|
||||
if (!copy_to_user((char __user *)sp, rwin, winsize)) {
|
||||
shift_window_buffer(window, get_thread_wsaved() - 1, t);
|
||||
|
|
@ -544,13 +547,6 @@ void fault_in_user_windows(void)
|
|||
{
|
||||
struct thread_info *t = current_thread_info();
|
||||
unsigned long window;
|
||||
int winsize = sizeof(struct reg_window);
|
||||
int bias = 0;
|
||||
|
||||
if (test_thread_flag(TIF_32BIT))
|
||||
winsize = sizeof(struct reg_window32);
|
||||
else
|
||||
bias = STACK_BIAS;
|
||||
|
||||
flush_user_windows();
|
||||
window = get_thread_wsaved();
|
||||
|
|
@ -558,8 +554,16 @@ void fault_in_user_windows(void)
|
|||
if (likely(window != 0)) {
|
||||
window -= 1;
|
||||
do {
|
||||
unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
|
||||
struct reg_window *rwin = &t->reg_window[window];
|
||||
int winsize = sizeof(struct reg_window);
|
||||
unsigned long sp;
|
||||
|
||||
sp = t->rwbuf_stkptrs[window];
|
||||
|
||||
if (test_thread_64bit_stack(sp))
|
||||
sp += STACK_BIAS;
|
||||
else
|
||||
winsize = sizeof(struct reg_window32);
|
||||
|
||||
if (unlikely(sp & 0x7UL))
|
||||
stack_unaligned(sp);
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ static int regwindow64_get(struct task_struct *target,
|
|||
{
|
||||
unsigned long rw_addr = regs->u_regs[UREG_I6];
|
||||
|
||||
if (test_tsk_thread_flag(current, TIF_32BIT)) {
|
||||
if (!test_thread_64bit_stack(rw_addr)) {
|
||||
struct reg_window32 win32;
|
||||
int i;
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ static int regwindow64_set(struct task_struct *target,
|
|||
{
|
||||
unsigned long rw_addr = regs->u_regs[UREG_I6];
|
||||
|
||||
if (test_tsk_thread_flag(current, TIF_32BIT)) {
|
||||
if (!test_thread_64bit_stack(rw_addr)) {
|
||||
struct reg_window32 win32;
|
||||
int i;
|
||||
|
||||
|
|
|
|||
|
|
@ -316,6 +316,25 @@ static void __init popc_patch(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void __init pause_patch(void)
|
||||
{
|
||||
struct pause_patch_entry *p;
|
||||
|
||||
p = &__pause_3insn_patch;
|
||||
while (p < &__pause_3insn_patch_end) {
|
||||
unsigned long i, addr = p->addr;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
*(unsigned int *) (addr + (i * 4)) = p->insns[i];
|
||||
wmb();
|
||||
__asm__ __volatile__("flush %0"
|
||||
: : "r" (addr + (i * 4)));
|
||||
}
|
||||
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
void __init boot_cpu_id_too_large(int cpu)
|
||||
{
|
||||
|
|
@ -528,6 +547,8 @@ static void __init init_sparc64_elf_hwcap(void)
|
|||
|
||||
if (sparc64_elf_hwcap & AV_SPARC_POPC)
|
||||
popc_patch();
|
||||
if (sparc64_elf_hwcap & AV_SPARC_PAUSE)
|
||||
pause_patch();
|
||||
}
|
||||
|
||||
void __init setup_arch(char **cmdline_p)
|
||||
|
|
|
|||
|
|
@ -751,3 +751,8 @@ int kernel_execve(const char *filename,
|
|||
: "cc");
|
||||
return __res;
|
||||
}
|
||||
|
||||
asmlinkage long sys_kern_features(void)
|
||||
{
|
||||
return KERN_FEATURE_MIXED_MODE_STACK;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue