Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull arm-soc board specific changes from Olof Johansson:
"While we generally attempt to get rid of board specific files and
replace them with device tree based descriptions, a lot of platforms
have not come that far:

In shmobile, we add two new board files because their recently started
effort to add DT support has not proceeded enough to use it for all of
the important hardware.

In Kirkwood, we are adding support for new boards with a combination
of DT and board file contents in multiple cases.

pxa/mmp and imx are extending support for existing board files but not
adding new ones."

Fix up trivial conflicts in arch/arm/mach-{mmp/ttc_dkb.c,shmobile/{Kconfig,Makefile}}

* tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (94 commits)
ARM: shmobile: fix smp build
ARM: kirkwood: Add support for RaidSonic IB-NAS6210/6220 using devicetree
kirkwood: Add iconnect support
orion/kirkwood: create a generic function for gpio led blinking
kirkwood/orion: fix orion_gpio_set_blink
ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt
kirkwood: Allow nand to be configured via. devicetree
mtd: Add orion_nand devicetree bindings
ARM: kirkwood: Basic support for DNS-320 and DNS-325
ARM: mach-shmobile: Use DT_MACHINE for armadillo 800 eva
ARM: mach-shmobile: Use DT_MACHINE for KZM9G
ARM: pxa: hx4700: Add Synaptics NavPoint touchpad
ARM: pxa: Use REGULATOR_SUPPLY macro
ARM: mach-shmobile: kzm9g: enable SMP boot
ARM: mach-shmobile: kzm9g: defconfig update
ARM: mach-shmobile: kzm9g: add PCF8757 gpio-key
ARM: mach-shmobile: kzm9g: add SDHI support
ARM: mach-shmobile: kzm9g: add MMCIF support
ARM: mach-shmobile: kzm9g: correct screen direction
ARM: mach-shmobile: sh73a0.h: add GPIO_NR
...

+4391 -821
+50
Documentation/devicetree/bindings/mtd/orion-nand.txt
··· 1 + NAND support for Marvell Orion SoC platforms 2 + 3 + Required properties: 4 + - compatible : "mrvl,orion-nand". 5 + - reg : Base physical address of the NAND and length of memory mapped 6 + region 7 + 8 + Optional properties: 9 + - cle : Address line number connected to CLE. Default is 0 10 + - ale : Address line number connected to ALE. Default is 1 11 + - bank-width : Width in bytes of the device. Default is 1 12 + - chip-delay : Chip dependent delay for transferring data from array to read 13 + registers in usecs 14 + 15 + The device tree may optionally contain sub-nodes describing partitions of the 16 + address space. See partition.txt for more detail. 17 + 18 + Example: 19 + 20 + nand@f4000000 { 21 + #address-cells = <1>; 22 + #size-cells = <1>; 23 + cle = <0>; 24 + ale = <1>; 25 + bank-width = <1>; 26 + chip-delay = <25>; 27 + compatible = "mrvl,orion-nand"; 28 + reg = <0xf4000000 0x400>; 29 + 30 + partition@0 { 31 + label = "u-boot"; 32 + reg = <0x0000000 0x100000>; 33 + read-only; 34 + }; 35 + 36 + partition@100000 { 37 + label = "uImage"; 38 + reg = <0x0100000 0x200000>; 39 + }; 40 + 41 + partition@300000 { 42 + label = "dtb"; 43 + reg = <0x0300000 0x100000>; 44 + }; 45 + 46 + partition@400000 { 47 + label = "root"; 48 + reg = <0x0400000 0x7d00000>; 49 + }; 50 + };
+64
arch/arm/boot/dts/kirkwood-dns320.dts
··· 1 + /dts-v1/; 2 + 3 + /include/ "kirkwood.dtsi" 4 + 5 + / { 6 + model = "D-Link DNS-320 NAS (Rev A1)"; 7 + compatible = "dlink,dns-320-a1", "dlink,dns-320", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood"; 8 + 9 + memory { 10 + device_type = "memory"; 11 + reg = <0x00000000 0x8000000>; 12 + }; 13 + 14 + chosen { 15 + bootargs = "console=ttyS0,115200n8 earlyprintk"; 16 + }; 17 + 18 + ocp@f1000000 { 19 + serial@12000 { 20 + clock-frequency = <166666667>; 21 + status = "okay"; 22 + }; 23 + 24 + serial@12100 { 25 + clock-frequency = <166666667>; 26 + status = "okay"; 27 + }; 28 + 29 + nand@3000000 { 30 + status = "okay"; 31 + 32 + partition@0 { 33 + label = "u-boot"; 34 + reg = <0x0000000 0x100000>; 35 + read-only; 36 + }; 37 + 38 + partition@100000 { 39 + label = "uImage"; 40 + reg = <0x0100000 0x500000>; 41 + }; 42 + 43 + partition@600000 { 44 + label = "ramdisk"; 45 + reg = <0x0600000 0x500000>; 46 + }; 47 + 48 + partition@b00000 { 49 + label = "image"; 50 + reg = <0x0b00000 0x6600000>; 51 + }; 52 + 53 + partition@7100000 { 54 + label = "mini firmware"; 55 + reg = <0x7100000 0xa00000>; 56 + }; 57 + 58 + partition@7b00000 { 59 + label = "config"; 60 + reg = <0x7b00000 0x500000>; 61 + }; 62 + }; 63 + }; 64 + };
+59
arch/arm/boot/dts/kirkwood-dns325.dts
··· 1 + /dts-v1/; 2 + 3 + /include/ "kirkwood.dtsi" 4 + 5 + / { 6 + model = "D-Link DNS-325 NAS (Rev A1)"; 7 + compatible = "dlink,dns-325-a1", "dlink,dns-325", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood"; 8 + 9 + memory { 10 + device_type = "memory"; 11 + reg = <0x00000000 0x10000000>; 12 + }; 13 + 14 + chosen { 15 + bootargs = "console=ttyS0,115200n8 earlyprintk"; 16 + }; 17 + 18 + ocp@f1000000 { 19 + serial@12000 { 20 + clock-frequency = <200000000>; 21 + status = "okay"; 22 + }; 23 + 24 + nand@3000000 { 25 + status = "okay"; 26 + 27 + partition@0 { 28 + label = "u-boot"; 29 + reg = <0x0000000 0x100000>; 30 + read-only; 31 + }; 32 + 33 + partition@100000 { 34 + label = "uImage"; 35 + reg = <0x0100000 0x500000>; 36 + }; 37 + 38 + partition@600000 { 39 + label = "ramdisk"; 40 + reg = <0x0600000 0x500000>; 41 + }; 42 + 43 + partition@b00000 { 44 + label = "image"; 45 + reg = <0x0b00000 0x6600000>; 46 + }; 47 + 48 + partition@7100000 { 49 + label = "mini firmware"; 50 + reg = <0x7100000 0xa00000>; 51 + }; 52 + 53 + partition@7b00000 { 54 + label = "config"; 55 + reg = <0x7b00000 0x500000>; 56 + }; 57 + }; 58 + }; 59 + };
+44
arch/arm/boot/dts/kirkwood-ib62x0.dts
··· 1 + /dts-v1/; 2 + 3 + /include/ "kirkwood.dtsi" 4 + 5 + / { 6 + model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)"; 7 + compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0", "mrvl,kirkwood-88f6281", "mrvl,kirkwood"; 8 + 9 + memory { 10 + device_type = "memory"; 11 + reg = <0x00000000 0x10000000>; 12 + }; 13 + 14 + chosen { 15 + bootargs = "console=ttyS0,115200n8 earlyprintk"; 16 + }; 17 + 18 + ocp@f1000000 { 19 + serial@12000 { 20 + clock-frequency = <200000000>; 21 + status = "okay"; 22 + }; 23 + 24 + nand@3000000 { 25 + status = "okay"; 26 + 27 + partition@0 { 28 + label = "u-boot"; 29 + reg = <0x0000000 0x100000>; 30 + }; 31 + 32 + partition@100000 { 33 + label = "uImage"; 34 + reg = <0x0100000 0x600000>; 35 + }; 36 + 37 + partition@700000 { 38 + label = "root"; 39 + reg = <0x0700000 0xf900000>; 40 + }; 41 + 42 + }; 43 + }; 44 + };
+26
arch/arm/boot/dts/kirkwood-iconnect.dts
··· 1 + /dts-v1/; 2 + 3 + /include/ "kirkwood.dtsi" 4 + 5 + / { 6 + model = "Iomega Iconnect"; 7 + compatible = "iom,iconnect-1.1", "iom,iconnect", "mrvl,kirkwood-88f6281", "mrvl,kirkwood"; 8 + 9 + memory { 10 + device_type = "memory"; 11 + reg = <0x00000000 0x10000000>; 12 + }; 13 + 14 + chosen { 15 + bootargs = "console=ttyS0,115200n8 earlyprintk mtdparts=orion_nand:0xc0000@0x0(uboot),0x20000@0xa0000(env),0x300000@0x100000(zImage),0x300000@0x540000(initrd),0x1f400000@0x980000(boot)"; 16 + linux,initrd-start = <0x4500040>; 17 + linux,initrd-end = <0x4800000>; 18 + }; 19 + 20 + ocp@f1000000 { 21 + serial@12000 { 22 + clock-frequency = <200000000>; 23 + status = "ok"; 24 + }; 25 + }; 26 + };
+14 -1
arch/arm/boot/dts/kirkwood.dtsi
··· 5 5 6 6 ocp@f1000000 { 7 7 compatible = "simple-bus"; 8 - ranges = <0 0xf1000000 0x1000000>; 8 + ranges = <0 0xf1000000 0x4000000>; 9 9 #address-cells = <1>; 10 10 #size-cells = <1>; 11 11 ··· 31 31 compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc"; 32 32 reg = <0x10300 0x20>; 33 33 interrupts = <53>; 34 + }; 35 + 36 + nand@3000000 { 37 + #address-cells = <1>; 38 + #size-cells = <1>; 39 + cle = <0>; 40 + ale = <1>; 41 + bank-width = <1>; 42 + compatible = "mrvl,orion-nand"; 43 + reg = <0x3000000 0x400>; 44 + chip-delay = <25>; 45 + /* set partition map and/or chip-delay in board dts */ 46 + status = "disabled"; 34 47 }; 35 48 }; 36 49 };
+22
arch/arm/boot/dts/r8a7740-armadillo800eva.dts
··· 1 + /* 2 + * Device Tree Source for the armadillo 800 eva board 3 + * 4 + * Copyright (C) 2012 Renesas Solutions Corp. 5 + * 6 + * This file is licensed under the terms of the GNU General Public License 7 + * version 2. This program is licensed "as is" without any warranty of any 8 + * kind, whether express or implied. 9 + */ 10 + 11 + /dts-v1/; 12 + /include/ "skeleton.dtsi" 13 + 14 + / { 15 + model = "armadillo 800 eva"; 16 + compatible = "renesas,armadillo800eva"; 17 + 18 + memory { 19 + device_type = "memory"; 20 + reg = <0x40000000 0x20000000>; 21 + }; 22 + };
+22
arch/arm/boot/dts/sh73a0-kzm9g.dts
··· 1 + /* 2 + * Device Tree Source for the KZM-A9-GT board 3 + * 4 + * Copyright (C) 2012 Renesas Solutions Corp. 5 + * 6 + * This file is licensed under the terms of the GNU General Public License 7 + * version 2. This program is licensed "as is" without any warranty of any 8 + * kind, whether express or implied. 9 + */ 10 + 11 + /dts-v1/; 12 + /include/ "skeleton.dtsi" 13 + 14 + / { 15 + model = "KZM-A9-GT"; 16 + compatible = "renesas,kzm9g", "renesas,sh73a0"; 17 + 18 + memory { 19 + device_type = "memory"; 20 + reg = <0x41000000 0x1e800000>; 21 + }; 22 + };
+142
arch/arm/configs/armadillo800eva_defconfig
··· 1 + CONFIG_EXPERIMENTAL=y 2 + CONFIG_SYSVIPC=y 3 + CONFIG_IKCONFIG=y 4 + CONFIG_IKCONFIG_PROC=y 5 + CONFIG_LOG_BUF_SHIFT=16 6 + # CONFIG_UTS_NS is not set 7 + # CONFIG_IPC_NS is not set 8 + # CONFIG_USER_NS is not set 9 + # CONFIG_PID_NS is not set 10 + CONFIG_SYSFS_DEPRECATED=y 11 + CONFIG_SYSFS_DEPRECATED_V2=y 12 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 13 + CONFIG_SLAB=y 14 + CONFIG_MODULES=y 15 + CONFIG_MODULE_UNLOAD=y 16 + CONFIG_MODULE_FORCE_UNLOAD=y 17 + # CONFIG_BLK_DEV_BSG is not set 18 + # CONFIG_IOSCHED_DEADLINE is not set 19 + # CONFIG_IOSCHED_CFQ is not set 20 + CONFIG_ARCH_SHMOBILE=y 21 + CONFIG_ARCH_R8A7740=y 22 + CONFIG_MACH_ARMADILLO800EVA=y 23 + # CONFIG_SH_TIMER_TMU is not set 24 + # CONFIG_ARM_THUMB is not set 25 + CONFIG_CPU_BPREDICT_DISABLE=y 26 + # CONFIG_CACHE_L2X0 is not set 27 + CONFIG_ARM_ERRATA_430973=y 28 + CONFIG_ARM_ERRATA_458693=y 29 + CONFIG_ARM_ERRATA_460075=y 30 + CONFIG_ARM_ERRATA_720789=y 31 + CONFIG_ARM_ERRATA_743622=y 32 + CONFIG_ARM_ERRATA_751472=y 33 + CONFIG_ARM_ERRATA_754322=y 34 + CONFIG_AEABI=y 35 + # CONFIG_OABI_COMPAT is not set 36 + CONFIG_FORCE_MAX_ZONEORDER=13 37 + CONFIG_ZBOOT_ROM_TEXT=0x0 38 + CONFIG_ZBOOT_ROM_BSS=0x0 39 + CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096" 40 + CONFIG_CMDLINE_FORCE=y 41 + CONFIG_KEXEC=y 42 + # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 43 + # CONFIG_SUSPEND is not set 44 + CONFIG_NET=y 45 + CONFIG_PACKET=y 46 + CONFIG_UNIX=y 47 + CONFIG_INET=y 48 + CONFIG_IP_PNP=y 49 + CONFIG_IP_PNP_DHCP=y 50 + # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 51 + # CONFIG_INET_XFRM_MODE_TUNNEL is not set 52 + # CONFIG_INET_XFRM_MODE_BEET is not set 53 + # CONFIG_INET_LRO is not set 54 + # CONFIG_INET_DIAG is not set 55 + # CONFIG_IPV6 is not set 56 + # CONFIG_WIRELESS is not set 57 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 58 + CONFIG_SCSI=y 59 + CONFIG_BLK_DEV_SD=y 60 + CONFIG_MD=y 61 + CONFIG_BLK_DEV_DM=y 62 + CONFIG_NETDEVICES=y 63 + # CONFIG_NET_VENDOR_BROADCOM is not set 64 + # CONFIG_NET_VENDOR_CHELSIO is not set 65 + # CONFIG_NET_VENDOR_CIRRUS is not set 66 + # CONFIG_NET_VENDOR_FARADAY is not set 67 + # CONFIG_NET_VENDOR_INTEL is not set 68 + # CONFIG_NET_VENDOR_MARVELL is not set 69 + # CONFIG_NET_VENDOR_MICREL is not set 70 + # CONFIG_NET_VENDOR_NATSEMI is not set 71 + CONFIG_SH_ETH=y 72 + # CONFIG_NET_VENDOR_SEEQ is not set 73 + # CONFIG_NET_VENDOR_SMSC is not set 74 + # CONFIG_NET_VENDOR_STMICRO is not set 75 + # CONFIG_WLAN is not set 76 + # CONFIG_INPUT_MOUSEDEV_PSAUX is not set 77 + CONFIG_INPUT_EVDEV=y 78 + # CONFIG_KEYBOARD_ATKBD is not set 79 + CONFIG_KEYBOARD_GPIO=y 80 + # CONFIG_INPUT_MOUSE is not set 81 + CONFIG_INPUT_TOUCHSCREEN=y 82 + CONFIG_TOUCHSCREEN_ST1232=y 83 + # CONFIG_SERIO is not set 84 + # CONFIG_LEGACY_PTYS is not set 85 + CONFIG_SERIAL_SH_SCI=y 86 + CONFIG_SERIAL_SH_SCI_NR_UARTS=8 87 + CONFIG_SERIAL_SH_SCI_CONSOLE=y 88 + # CONFIG_HW_RANDOM is not set 89 + CONFIG_I2C=y 90 + CONFIG_I2C_SH_MOBILE=y 91 + # CONFIG_HWMON is not set 92 + CONFIG_FB=y 93 + CONFIG_FB_MODE_HELPERS=y 94 + CONFIG_FB_SH_MOBILE_LCDC=y 95 + CONFIG_LCD_CLASS_DEVICE=y 96 + CONFIG_FRAMEBUFFER_CONSOLE=y 97 + CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y 98 + CONFIG_LOGO=y 99 + # CONFIG_LOGO_LINUX_MONO is not set 100 + # CONFIG_LOGO_LINUX_VGA16 is not set 101 + CONFIG_SOUND=y 102 + CONFIG_SND=y 103 + # CONFIG_SND_SUPPORT_OLD_API is not set 104 + # CONFIG_SND_VERBOSE_PROCFS is not set 105 + # CONFIG_SND_DRIVERS is not set 106 + # CONFIG_SND_ARM is not set 107 + CONFIG_SND_SOC=y 108 + CONFIG_SND_SOC_SH4_FSI=y 109 + # CONFIG_HID_SUPPORT is not set 110 + CONFIG_USB=y 111 + # CONFIG_USB_DEVICE_CLASS is not set 112 + CONFIG_USB_RENESAS_USBHS=y 113 + CONFIG_USB_GADGET=y 114 + CONFIG_USB_RENESAS_USBHS_UDC=y 115 + CONFIG_USB_ETH=m 116 + CONFIG_MMC=y 117 + CONFIG_MMC_SDHI=y 118 + CONFIG_MMC_SH_MMCIF=y 119 + CONFIG_UIO=y 120 + CONFIG_UIO_PDRV_GENIRQ=y 121 + # CONFIG_DNOTIFY is not set 122 + CONFIG_MSDOS_FS=y 123 + CONFIG_VFAT_FS=y 124 + CONFIG_TMPFS=y 125 + # CONFIG_MISC_FILESYSTEMS is not set 126 + CONFIG_NFS_FS=y 127 + CONFIG_NFS_V3=y 128 + CONFIG_NFS_V3_ACL=y 129 + CONFIG_NFS_V4=y 130 + CONFIG_NFS_V4_1=y 131 + CONFIG_ROOT_NFS=y 132 + CONFIG_NLS_CODEPAGE_437=y 133 + CONFIG_NLS_ISO8859_1=y 134 + # CONFIG_ENABLE_WARN_DEPRECATED is not set 135 + # CONFIG_ENABLE_MUST_CHECK is not set 136 + # CONFIG_ARM_UNWIND is not set 137 + CONFIG_CRYPTO=y 138 + CONFIG_CRYPTO_CBC=y 139 + CONFIG_CRYPTO_MD5=y 140 + CONFIG_CRYPTO_DES=y 141 + CONFIG_CRYPTO_ANSI_CPRNG=y 142 + CONFIG_XZ_DEC=y
+3 -1
arch/arm/configs/imx_v4_v5_defconfig
··· 92 92 # CONFIG_INPUT_MOUSE is not set 93 93 CONFIG_INPUT_TOUCHSCREEN=y 94 94 CONFIG_TOUCHSCREEN_ADS7846=m 95 + CONFIG_TOUCHSCREEN_MC13783=m 95 96 # CONFIG_SERIO is not set 96 97 # CONFIG_LEGACY_PTYS is not set 97 98 CONFIG_SERIAL_8250=m ··· 108 107 CONFIG_W1=y 109 108 CONFIG_W1_MASTER_MXC=y 110 109 CONFIG_W1_SLAVE_THERM=y 111 - # CONFIG_HWMON is not set 110 + CONFIG_HWMON=m 111 + CONFIG_SENSORS_MC13783_ADC=m 112 112 CONFIG_WATCHDOG=y 113 113 CONFIG_IMX2_WDT=y 114 114 CONFIG_MFD_MC13XXX=y
+139
arch/arm/configs/kzm9g_defconfig
··· 1 + # CONFIG_ARM_PATCH_PHYS_VIRT is not set 2 + CONFIG_EXPERIMENTAL=y 3 + # CONFIG_LOCALVERSION_AUTO is not set 4 + CONFIG_SYSVIPC=y 5 + CONFIG_IKCONFIG=y 6 + CONFIG_IKCONFIG_PROC=y 7 + CONFIG_LOG_BUF_SHIFT=16 8 + CONFIG_NAMESPACES=y 9 + # CONFIG_UTS_NS is not set 10 + # CONFIG_IPC_NS is not set 11 + # CONFIG_USER_NS is not set 12 + # CONFIG_PID_NS is not set 13 + # CONFIG_NET_NS is not set 14 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 15 + CONFIG_SYSCTL_SYSCALL=y 16 + CONFIG_EMBEDDED=y 17 + CONFIG_SLAB=y 18 + CONFIG_MODULES=y 19 + CONFIG_MODULE_FORCE_LOAD=y 20 + CONFIG_MODULE_UNLOAD=y 21 + # CONFIG_BLK_DEV_BSG is not set 22 + # CONFIG_IOSCHED_DEADLINE is not set 23 + # CONFIG_IOSCHED_CFQ is not set 24 + CONFIG_ARCH_SHMOBILE=y 25 + CONFIG_KEYBOARD_GPIO_POLLED=y 26 + CONFIG_ARCH_SH73A0=y 27 + CONFIG_MACH_KZM9G=y 28 + CONFIG_MEMORY_START=0x41000000 29 + CONFIG_MEMORY_SIZE=0x1f000000 30 + CONFIG_ARM_ERRATA_743622=y 31 + CONFIG_ARM_ERRATA_754322=y 32 + CONFIG_NO_HZ=y 33 + CONFIG_HIGH_RES_TIMERS=y 34 + CONFIG_SMP=y 35 + CONFIG_SCHED_MC=y 36 + CONFIG_PREEMPT=y 37 + CONFIG_AEABI=y 38 + # CONFIG_OABI_COMPAT is not set 39 + CONFIG_HIGHMEM=y 40 + CONFIG_ZBOOT_ROM_TEXT=0x0 41 + CONFIG_ZBOOT_ROM_BSS=0x0 42 + CONFIG_CMDLINE="console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200" 43 + CONFIG_KEXEC=y 44 + CONFIG_VFP=y 45 + CONFIG_NEON=y 46 + # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 47 + CONFIG_PM_RUNTIME=y 48 + CONFIG_NET=y 49 + CONFIG_PACKET=y 50 + CONFIG_UNIX=y 51 + CONFIG_INET=y 52 + CONFIG_IP_PNP=y 53 + CONFIG_IP_PNP_DHCP=y 54 + # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 55 + # CONFIG_INET_XFRM_MODE_TUNNEL is not set 56 + # CONFIG_INET_XFRM_MODE_BEET is not set 57 + # CONFIG_INET_LRO is not set 58 + # CONFIG_INET_DIAG is not set 59 + # CONFIG_IPV6 is not set 60 + CONFIG_IRDA=y 61 + CONFIG_SH_IRDA=y 62 + # CONFIG_WIRELESS is not set 63 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 64 + CONFIG_SCSI=y 65 + CONFIG_BLK_DEV_SD=y 66 + CONFIG_NETDEVICES=y 67 + CONFIG_SMSC911X=y 68 + # CONFIG_WLAN is not set 69 + CONFIG_INPUT_SPARSEKMAP=y 70 + # CONFIG_INPUT_MOUSEDEV is not set 71 + CONFIG_INPUT_EVDEV=y 72 + # CONFIG_KEYBOARD_ATKBD is not set 73 + # CONFIG_INPUT_MOUSE is not set 74 + CONFIG_INPUT_TOUCHSCREEN=y 75 + CONFIG_TOUCHSCREEN_ST1232=y 76 + # CONFIG_LEGACY_PTYS is not set 77 + CONFIG_SERIAL_SH_SCI=y 78 + CONFIG_SERIAL_SH_SCI_NR_UARTS=9 79 + CONFIG_SERIAL_SH_SCI_CONSOLE=y 80 + # CONFIG_HW_RANDOM is not set 81 + CONFIG_I2C_CHARDEV=y 82 + CONFIG_I2C_SH_MOBILE=y 83 + CONFIG_GPIO_PCF857X=y 84 + # CONFIG_HWMON is not set 85 + CONFIG_FB=y 86 + CONFIG_FB_SH_MOBILE_LCDC=y 87 + CONFIG_FRAMEBUFFER_CONSOLE=y 88 + CONFIG_LOGO=y 89 + CONFIG_FB_SH_MOBILE_MERAM=y 90 + CONFIG_SOUND=y 91 + CONFIG_SND=y 92 + # CONFIG_SND_SUPPORT_OLD_API is not set 93 + # CONFIG_SND_VERBOSE_PROCFS is not set 94 + # CONFIG_SND_DRIVERS is not set 95 + # CONFIG_SND_ARM is not set 96 + # CONFIG_SND_USB is not set 97 + CONFIG_SND_SOC=y 98 + CONFIG_SND_SOC_SH4_FSI=y 99 + # CONFIG_HID_SUPPORT is not set 100 + CONFIG_USB=y 101 + CONFIG_USB_DEVICEFS=y 102 + CONFIG_USB_R8A66597_HCD=y 103 + CONFIG_USB_STORAGE=y 104 + CONFIG_MMC=y 105 + # CONFIG_MMC_BLOCK_BOUNCE is not set 106 + CONFIG_MMC_SDHI=y 107 + CONFIG_MMC_SH_MMCIF=y 108 + CONFIG_NEW_LEDS=y 109 + CONFIG_LEDS_CLASS=y 110 + CONFIG_RTC_CLASS=y 111 + CONFIG_DMADEVICES=y 112 + CONFIG_SH_DMAE=y 113 + CONFIG_ASYNC_TX_DMA=y 114 + CONFIG_STAGING=y 115 + # CONFIG_DNOTIFY is not set 116 + # CONFIG_INOTIFY_USER is not set 117 + CONFIG_VFAT_FS=y 118 + CONFIG_TMPFS=y 119 + # CONFIG_MISC_FILESYSTEMS is not set 120 + CONFIG_NFS_FS=y 121 + CONFIG_NFS_V3=y 122 + CONFIG_NFS_V3_ACL=y 123 + CONFIG_NFS_V4=y 124 + CONFIG_NFS_V4_1=y 125 + CONFIG_ROOT_NFS=y 126 + CONFIG_NLS_CODEPAGE_437=y 127 + CONFIG_NLS_ISO8859_1=y 128 + # CONFIG_ENABLE_WARN_DEPRECATED is not set 129 + # CONFIG_ENABLE_MUST_CHECK is not set 130 + # CONFIG_SCHED_DEBUG is not set 131 + # CONFIG_DEBUG_PREEMPT is not set 132 + # CONFIG_DEBUG_BUGVERBOSE is not set 133 + # CONFIG_FTRACE is not set 134 + # CONFIG_ARM_UNWIND is not set 135 + CONFIG_CRYPTO=y 136 + CONFIG_CRYPTO_CBC=y 137 + CONFIG_CRYPTO_MD5=y 138 + CONFIG_CRYPTO_DES=y 139 + CONFIG_CRC16=y
+2
arch/arm/configs/omap2plus_defconfig
··· 98 98 CONFIG_LIBERTAS_SDIO=m 99 99 CONFIG_LIBERTAS_DEBUG=y 100 100 CONFIG_USB_USBNET=y 101 + CONFIG_USB_NET_SMSC95XX=y 101 102 CONFIG_USB_ALI_M5632=y 102 103 CONFIG_USB_AN2720=y 103 104 CONFIG_USB_EPSON2888=y ··· 176 175 CONFIG_USB_DEVICEFS=y 177 176 CONFIG_USB_SUSPEND=y 178 177 CONFIG_USB_MON=y 178 + CONFIG_USB_EHCI_HCD=y 179 179 CONFIG_USB_WDM=y 180 180 CONFIG_USB_STORAGE=y 181 181 CONFIG_USB_LIBUSUAL=y
+9
arch/arm/mach-exynos/Kconfig
··· 200 200 select S3C_DEV_HSMMC2 201 201 select S3C_DEV_HSMMC3 202 202 select SAMSUNG_DEV_BACKLIGHT 203 + select EXYNOS_DEV_DRM 203 204 select EXYNOS4_DEV_AHCI 204 205 select SAMSUNG_DEV_KEYPAD 205 206 select EXYNOS4_DEV_DMA ··· 256 255 select S5P_DEV_ONENAND 257 256 select S5P_DEV_TV 258 257 select EXYNOS4_DEV_DMA 258 + select EXYNOS_DEV_DRM 259 259 select EXYNOS4_SETUP_FIMD0 260 260 select EXYNOS4_SETUP_I2C1 261 261 select EXYNOS4_SETUP_I2C3 ··· 293 291 select S5P_DEV_USB_EHCI 294 292 select S5P_SETUP_MIPIPHY 295 293 select EXYNOS4_DEV_DMA 294 + select EXYNOS_DEV_DRM 296 295 select EXYNOS4_SETUP_FIMC 297 296 select EXYNOS4_SETUP_FIMD0 298 297 select EXYNOS4_SETUP_I2C1 ··· 328 325 select S5P_DEV_USB_EHCI 329 326 select SAMSUNG_DEV_BACKLIGHT 330 327 select SAMSUNG_DEV_PWM 328 + select EXYNOS_DEV_DRM 331 329 select EXYNOS4_DEV_DMA 332 330 select EXYNOS4_DEV_USB_OHCI 333 331 select EXYNOS4_SETUP_FIMD0 ··· 349 345 select S3C_DEV_I2C7 350 346 select S3C_DEV_RTC 351 347 select S3C_DEV_WDT 348 + select S5P_DEV_FIMC0 349 + select S5P_DEV_FIMC1 350 + select S5P_DEV_FIMC2 351 + select S5P_DEV_FIMC3 352 + select S5P_DEV_MFC 352 353 select SAMSUNG_DEV_BACKLIGHT 353 354 select SAMSUNG_DEV_KEYPAD 354 355 select SAMSUNG_DEV_PWM
+33
arch/arm/mach-exynos/mach-nuri.c
··· 25 25 #include <linux/mmc/host.h> 26 26 #include <linux/fb.h> 27 27 #include <linux/pwm_backlight.h> 28 + #include <drm/exynos_drm.h> 28 29 29 30 #include <video/platform_lcd.h> 30 31 #include <media/m5mols.h> ··· 211 210 }, 212 211 }; 213 212 213 + #ifdef CONFIG_DRM_EXYNOS 214 + static struct exynos_drm_fimd_pdata drm_fimd_pdata = { 215 + .panel = { 216 + .timing = { 217 + .xres = 1024, 218 + .yres = 600, 219 + .hsync_len = 40, 220 + .left_margin = 79, 221 + .right_margin = 200, 222 + .vsync_len = 10, 223 + .upper_margin = 10, 224 + .lower_margin = 11, 225 + .refresh = 60, 226 + }, 227 + }, 228 + .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB | 229 + VIDCON0_CLKSEL_LCD, 230 + .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 231 + .default_win = 3, 232 + .bpp = 32, 233 + }; 234 + 235 + #else 214 236 /* Frame Buffer */ 215 237 static struct s3c_fb_pd_win nuri_fb_win0 = { 216 238 .win_mode = { ··· 260 236 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 261 237 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 262 238 }; 239 + #endif 263 240 264 241 static void nuri_lcd_power_on(struct plat_lcd_data *pd, unsigned int power) 265 242 { ··· 1324 1299 &cam_vdda_fixed_rdev, 1325 1300 &cam_8m_12v_fixed_rdev, 1326 1301 &exynos4_bus_devfreq, 1302 + #ifdef CONFIG_DRM_EXYNOS 1303 + &exynos_device_drm, 1304 + #endif 1327 1305 }; 1328 1306 1329 1307 static void __init nuri_map_io(void) ··· 1359 1331 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); 1360 1332 s3c_i2c6_set_platdata(&nuri_i2c6_platdata); 1361 1333 1334 + #ifdef CONFIG_DRM_EXYNOS 1335 + s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata; 1336 + exynos4_fimd0_gpio_setup_24bpp(); 1337 + #else 1362 1338 s5p_fimd0_set_platdata(&nuri_fb_pdata); 1339 + #endif 1363 1340 1364 1341 nuri_camera_init(); 1365 1342
+34 -1
arch/arm/mach-exynos/mach-origen.c
··· 45 45 #include <mach/ohci.h> 46 46 #include <mach/map.h> 47 47 48 + #include <drm/exynos_drm.h> 48 49 #include "common.h" 49 50 50 51 /* Following are default values for UCON, ULCON and UFCON UART registers */ ··· 582 581 .dev.platform_data = &origen_lcd_hv070wsa_data, 583 582 }; 584 583 584 + #ifdef CONFIG_DRM_EXYNOS 585 + static struct exynos_drm_fimd_pdata drm_fimd_pdata = { 586 + .panel = { 587 + .timing = { 588 + .left_margin = 64, 589 + .right_margin = 16, 590 + .upper_margin = 64, 591 + .lower_margin = 16, 592 + .hsync_len = 48, 593 + .vsync_len = 3, 594 + .xres = 1024, 595 + .yres = 600, 596 + }, 597 + }, 598 + .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, 599 + .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC | 600 + VIDCON1_INV_VCLK, 601 + .default_win = 0, 602 + .bpp = 32, 603 + }; 604 + #else 585 605 static struct s3c_fb_pd_win origen_fb_win0 = { 586 606 .win_mode = { 587 607 .left_margin = 64, ··· 616 594 }, 617 595 .max_bpp = 32, 618 596 .default_bpp = 24, 597 + .virtual_x = 1024, 598 + .virtual_y = 2 * 600, 619 599 }; 620 600 621 601 static struct s3c_fb_platdata origen_lcd_pdata __initdata = { ··· 627 603 VIDCON1_INV_VCLK, 628 604 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 629 605 }; 606 + #endif 630 607 631 608 /* Bluetooth rfkill gpio platform data */ 632 - struct rfkill_gpio_platform_data origen_bt_pdata = { 609 + static struct rfkill_gpio_platform_data origen_bt_pdata = { 633 610 .reset_gpio = EXYNOS4_GPX2(2), 634 611 .shutdown_gpio = -1, 635 612 .type = RFKILL_TYPE_BLUETOOTH, ··· 667 642 &s5p_device_mfc_l, 668 643 &s5p_device_mfc_r, 669 644 &s5p_device_mixer, 645 + #ifdef CONFIG_DRM_EXYNOS 646 + &exynos_device_drm, 647 + #endif 670 648 &exynos4_device_ohci, 671 649 &origen_device_gpiokeys, 672 650 &origen_lcd_hv070wsa, ··· 745 717 s5p_tv_setup(); 746 718 s5p_i2c_hdmiphy_set_platdata(NULL); 747 719 720 + #ifdef CONFIG_DRM_EXYNOS 721 + s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata; 722 + exynos4_fimd0_gpio_setup_24bpp(); 723 + #else 748 724 s5p_fimd0_set_platdata(&origen_lcd_pdata); 725 + #endif 749 726 750 727 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices)); 751 728
+16
arch/arm/mach-exynos/mach-smdk4x12.c
··· 31 31 #include <plat/gpio-cfg.h> 32 32 #include <plat/iic.h> 33 33 #include <plat/keypad.h> 34 + #include <plat/mfc.h> 34 35 #include <plat/regs-serial.h> 35 36 #include <plat/sdhci.h> 36 37 ··· 243 242 &s3c_device_i2c7, 244 243 &s3c_device_rtc, 245 244 &s3c_device_wdt, 245 + &s5p_device_fimc0, 246 + &s5p_device_fimc1, 247 + &s5p_device_fimc2, 248 + &s5p_device_fimc3, 249 + &s5p_device_fimc_md, 250 + &s5p_device_mfc, 251 + &s5p_device_mfc_l, 252 + &s5p_device_mfc_r, 246 253 &samsung_device_keypad, 247 254 }; 248 255 ··· 261 252 exynos_init_io(NULL, 0); 262 253 s3c24xx_init_clocks(clk_xusbxti.rate); 263 254 s3c24xx_init_uarts(smdk4x12_uartcfgs, ARRAY_SIZE(smdk4x12_uartcfgs)); 255 + } 256 + 257 + static void __init smdk4x12_reserve(void) 258 + { 259 + s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20); 264 260 } 265 261 266 262 static void __init smdk4x12_machine_init(void) ··· 305 291 .init_machine = smdk4x12_machine_init, 306 292 .timer = &exynos4_timer, 307 293 .restart = exynos4_restart, 294 + .reserve = &smdk4x12_reserve, 308 295 MACHINE_END 309 296 310 297 MACHINE_START(SMDK4412, "SMDK4412") ··· 318 303 .init_machine = smdk4x12_machine_init, 319 304 .timer = &exynos4_timer, 320 305 .restart = exynos4_restart, 306 + .reserve = &smdk4x12_reserve, 321 307 MACHINE_END
+30
arch/arm/mach-exynos/mach-smdkv310.c
··· 44 44 #include <mach/map.h> 45 45 #include <mach/ohci.h> 46 46 47 + #include <drm/exynos_drm.h> 47 48 #include "common.h" 48 49 49 50 /* Following are default values for UCON, ULCON and UFCON UART registers */ ··· 157 156 .dev.platform_data = &smdkv310_lcd_lte480wv_data, 158 157 }; 159 158 159 + #ifdef CONFIG_DRM_EXYNOS 160 + static struct exynos_drm_fimd_pdata drm_fimd_pdata = { 161 + .panel = { 162 + .timing = { 163 + .left_margin = 13, 164 + .right_margin = 8, 165 + .upper_margin = 7, 166 + .lower_margin = 5, 167 + .hsync_len = 3, 168 + .vsync_len = 1, 169 + .xres = 800, 170 + .yres = 480, 171 + }, 172 + }, 173 + .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, 174 + .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 175 + .default_win = 0, 176 + .bpp = 32, 177 + }; 178 + #else 160 179 static struct s3c_fb_pd_win smdkv310_fb_win0 = { 161 180 .win_mode = { 162 181 .left_margin = 13, ··· 198 177 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 199 178 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 200 179 }; 180 + #endif 201 181 202 182 static struct resource smdkv310_smsc911x_resources[] = { 203 183 [0] = DEFINE_RES_MEM(EXYNOS4_PA_SROM_BANK(1), SZ_64K), ··· 284 262 &s5p_device_fimc_md, 285 263 &s5p_device_g2d, 286 264 &s5p_device_jpeg, 265 + #ifdef CONFIG_DRM_EXYNOS 266 + &exynos_device_drm, 267 + #endif 287 268 &exynos4_device_ac97, 288 269 &exynos4_device_i2s0, 289 270 &exynos4_device_ohci, ··· 378 353 samsung_keypad_set_platdata(&smdkv310_keypad_data); 379 354 380 355 samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data); 356 + #ifdef CONFIG_DRM_EXYNOS 357 + s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata; 358 + exynos4_fimd0_gpio_setup_24bpp(); 359 + #else 381 360 s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata); 361 + #endif 382 362 383 363 smdkv310_ehci_init(); 384 364 smdkv310_ohci_init();
+33
arch/arm/mach-exynos/mach-universal_c210.c
··· 23 23 #include <linux/i2c-gpio.h> 24 24 #include <linux/i2c/mcs.h> 25 25 #include <linux/i2c/atmel_mxt_ts.h> 26 + #include <drm/exynos_drm.h> 26 27 27 28 #include <asm/mach/arch.h> 28 29 #include <asm/hardware/gic.h> ··· 812 811 /* Gyro, To be updated */ 813 812 }; 814 813 814 + #ifdef CONFIG_DRM_EXYNOS 815 + static struct exynos_drm_fimd_pdata drm_fimd_pdata = { 816 + .panel = { 817 + .timing = { 818 + .left_margin = 16, 819 + .right_margin = 16, 820 + .upper_margin = 2, 821 + .lower_margin = 28, 822 + .hsync_len = 2, 823 + .vsync_len = 1, 824 + .xres = 480, 825 + .yres = 800, 826 + .refresh = 55, 827 + }, 828 + }, 829 + .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB | 830 + VIDCON0_CLKSEL_LCD, 831 + .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN 832 + | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 833 + .default_win = 3, 834 + .bpp = 32, 835 + }; 836 + #else 815 837 /* Frame Buffer */ 816 838 static struct s3c_fb_pd_win universal_fb_win0 = { 817 839 .win_mode = { ··· 862 838 | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 863 839 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 864 840 }; 841 + #endif 865 842 866 843 static struct regulator_consumer_supply cam_vt_dio_supply = 867 844 REGULATOR_SUPPLY("vdd_core", "0-003c"); ··· 1072 1047 &s5p_device_onenand, 1073 1048 &s5p_device_fimd0, 1074 1049 &s5p_device_jpeg, 1050 + #ifdef CONFIG_DRM_EXYNOS 1051 + &exynos_device_drm, 1052 + #endif 1075 1053 &s5p_device_mfc, 1076 1054 &s5p_device_mfc_l, 1077 1055 &s5p_device_mfc_r, ··· 1122 1094 s5p_i2c_hdmiphy_set_platdata(NULL); 1123 1095 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); 1124 1096 1097 + #ifdef CONFIG_DRM_EXYNOS 1098 + s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata; 1099 + exynos4_fimd0_gpio_setup_24bpp(); 1100 + #else 1125 1101 s5p_fimd0_set_platdata(&universal_lcd_pdata); 1102 + #endif 1126 1103 1127 1104 universal_touchkey_init(); 1128 1105 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs,
+5 -30
arch/arm/mach-imx/Kconfig
··· 163 163 select SOC_IMX25 164 164 select IMX_HAVE_PLATFORM_FLEXCAN 165 165 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 166 + select IMX_HAVE_PLATFORM_IMX2_WDT 166 167 select IMX_HAVE_PLATFORM_IMXDI_RTC 167 168 select IMX_HAVE_PLATFORM_IMX_FB 168 169 select IMX_HAVE_PLATFORM_IMX_I2C ··· 182 181 bool "Eukrea MBIMXSD development board" 183 182 select IMX_HAVE_PLATFORM_GPIO_KEYS 184 183 select IMX_HAVE_PLATFORM_IMX_SSI 184 + select IMX_HAVE_PLATFORM_SPI_IMX 185 185 select LEDS_GPIO_REGISTER 186 186 help 187 187 This adds board specific devices that can be found on Eukrea's ··· 610 608 select IMX_HAVE_PLATFORM_GPIO_KEYS 611 609 select IMX_HAVE_PLATFORM_IMX_SSI 612 610 select IMX_HAVE_PLATFORM_IPU_CORE 611 + select IMX_HAVE_PLATFORM_SPI_IMX 613 612 select LEDS_GPIO_REGISTER 614 613 help 615 614 This adds board specific devices that can be found on Eukrea's ··· 687 684 Include support for MX51PDK (3DS) platform. This includes specific 688 685 configurations for the board and its peripherals. 689 686 690 - config MACH_EUKREA_CPUIMX51 691 - bool "Support Eukrea CPUIMX51 module" 692 - select SOC_IMX51 693 - select IMX_HAVE_PLATFORM_FSL_USB2_UDC 694 - select IMX_HAVE_PLATFORM_IMX_I2C 695 - select IMX_HAVE_PLATFORM_IMX_UART 696 - select IMX_HAVE_PLATFORM_MXC_EHCI 697 - select IMX_HAVE_PLATFORM_MXC_NAND 698 - select IMX_HAVE_PLATFORM_SPI_IMX 699 - help 700 - Include support for Eukrea CPUIMX51 platform. This includes 701 - specific configurations for the module and its peripherals. 702 - 703 - choice 704 - prompt "Baseboard" 705 - depends on MACH_EUKREA_CPUIMX51 706 - default MACH_EUKREA_MBIMX51_BASEBOARD 707 - 708 - config MACH_EUKREA_MBIMX51_BASEBOARD 709 - prompt "Eukrea MBIMX51 development board" 710 - bool 711 - select IMX_HAVE_PLATFORM_IMX_KEYPAD 712 - select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 713 - select LEDS_GPIO_REGISTER 714 - help 715 - This adds board specific devices that can be found on Eukrea's 716 - MBIMX51 evaluation board. 717 - 718 - endchoice 719 - 720 687 config MACH_EUKREA_CPUIMX51SD 721 688 bool "Support Eukrea CPUIMX51SD module" 722 689 select SOC_IMX51 723 690 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 724 691 select IMX_HAVE_PLATFORM_IMX_I2C 725 692 select IMX_HAVE_PLATFORM_IMX_UART 693 + select IMX_HAVE_PLATFORM_IMX2_WDT 726 694 select IMX_HAVE_PLATFORM_MXC_EHCI 727 695 select IMX_HAVE_PLATFORM_MXC_NAND 728 696 select IMX_HAVE_PLATFORM_SPI_IMX ··· 709 735 config MACH_EUKREA_MBIMXSD51_BASEBOARD 710 736 prompt "Eukrea MBIMXSD development board" 711 737 bool 738 + select IMX_HAVE_PLATFORM_IMX_SSI 712 739 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 713 740 select LEDS_GPIO_REGISTER 714 741 help
+1 -3
arch/arm/mach-imx/Makefile
··· 83 83 obj-$(CONFIG_MACH_MX53_SMD) += mach-mx53_smd.o 84 84 obj-$(CONFIG_MACH_MX53_LOCO) += mach-mx53_loco.o 85 85 obj-$(CONFIG_MACH_MX53_ARD) += mach-mx53_ard.o 86 - obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += mach-cpuimx51.o 87 - obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o 88 86 obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o 89 - obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o 87 + obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd51-baseboard.o 90 88 obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o 91 89 obj-$(CONFIG_MACH_MX51_EFIKAMX) += mach-mx51_efikamx.o 92 90 obj-$(CONFIG_MACH_MX51_EFIKASB) += mach-mx51_efikasb.o
-206
arch/arm/mach-imx/eukrea_mbimx51-baseboard.c
··· 1 - /* 2 - * 3 - * Copyright (C) 2010 Eric Bénard <eric@eukrea.com> 4 - * 5 - * The code contained herein is licensed under the GNU General Public 6 - * License. You may obtain a copy of the GNU General Public License 7 - * Version 2 or later at the following locations: 8 - * 9 - * http://www.opensource.org/licenses/gpl-license.html 10 - * http://www.gnu.org/copyleft/gpl.html 11 - */ 12 - 13 - #include <linux/init.h> 14 - #include <linux/platform_device.h> 15 - #include <linux/serial_8250.h> 16 - #include <linux/i2c.h> 17 - #include <linux/gpio.h> 18 - #include <linux/io.h> 19 - #include <linux/interrupt.h> 20 - #include <linux/irq.h> 21 - #include <linux/i2c/tsc2007.h> 22 - #include <linux/leds.h> 23 - 24 - #include <mach/common.h> 25 - #include <mach/hardware.h> 26 - #include <mach/iomux-mx51.h> 27 - 28 - #include <asm/mach/arch.h> 29 - 30 - #include "devices-imx51.h" 31 - 32 - #define MBIMX51_TSC2007_GPIO IMX_GPIO_NR(3, 30) 33 - #define MBIMX51_LED0 IMX_GPIO_NR(3, 5) 34 - #define MBIMX51_LED1 IMX_GPIO_NR(3, 6) 35 - #define MBIMX51_LED2 IMX_GPIO_NR(3, 7) 36 - #define MBIMX51_LED3 IMX_GPIO_NR(3, 8) 37 - 38 - static const struct gpio_led mbimx51_leds[] __initconst = { 39 - { 40 - .name = "led0", 41 - .default_trigger = "heartbeat", 42 - .active_low = 1, 43 - .gpio = MBIMX51_LED0, 44 - }, 45 - { 46 - .name = "led1", 47 - .default_trigger = "nand-disk", 48 - .active_low = 1, 49 - .gpio = MBIMX51_LED1, 50 - }, 51 - { 52 - .name = "led2", 53 - .default_trigger = "mmc0", 54 - .active_low = 1, 55 - .gpio = MBIMX51_LED2, 56 - }, 57 - { 58 - .name = "led3", 59 - .default_trigger = "default-on", 60 - .active_low = 1, 61 - .gpio = MBIMX51_LED3, 62 - }, 63 - }; 64 - 65 - static const struct gpio_led_platform_data mbimx51_leds_info __initconst = { 66 - .leds = mbimx51_leds, 67 - .num_leds = ARRAY_SIZE(mbimx51_leds), 68 - }; 69 - 70 - static iomux_v3_cfg_t mbimx51_pads[] = { 71 - /* UART2 */ 72 - MX51_PAD_UART2_RXD__UART2_RXD, 73 - MX51_PAD_UART2_TXD__UART2_TXD, 74 - 75 - /* UART3 */ 76 - MX51_PAD_UART3_RXD__UART3_RXD, 77 - MX51_PAD_UART3_TXD__UART3_TXD, 78 - MX51_PAD_KEY_COL4__UART3_RTS, 79 - MX51_PAD_KEY_COL5__UART3_CTS, 80 - 81 - /* TSC2007 IRQ */ 82 - MX51_PAD_NANDF_D10__GPIO3_30, 83 - 84 - /* LEDS */ 85 - MX51_PAD_DISPB2_SER_DIN__GPIO3_5, 86 - MX51_PAD_DISPB2_SER_DIO__GPIO3_6, 87 - MX51_PAD_DISPB2_SER_CLK__GPIO3_7, 88 - MX51_PAD_DISPB2_SER_RS__GPIO3_8, 89 - 90 - /* KPP */ 91 - MX51_PAD_KEY_ROW0__KEY_ROW0, 92 - MX51_PAD_KEY_ROW1__KEY_ROW1, 93 - MX51_PAD_KEY_ROW2__KEY_ROW2, 94 - MX51_PAD_KEY_ROW3__KEY_ROW3, 95 - MX51_PAD_KEY_COL0__KEY_COL0, 96 - MX51_PAD_KEY_COL1__KEY_COL1, 97 - MX51_PAD_KEY_COL2__KEY_COL2, 98 - MX51_PAD_KEY_COL3__KEY_COL3, 99 - 100 - /* SD 1 */ 101 - MX51_PAD_SD1_CMD__SD1_CMD, 102 - MX51_PAD_SD1_CLK__SD1_CLK, 103 - MX51_PAD_SD1_DATA0__SD1_DATA0, 104 - MX51_PAD_SD1_DATA1__SD1_DATA1, 105 - MX51_PAD_SD1_DATA2__SD1_DATA2, 106 - MX51_PAD_SD1_DATA3__SD1_DATA3, 107 - 108 - /* SD 2 */ 109 - MX51_PAD_SD2_CMD__SD2_CMD, 110 - MX51_PAD_SD2_CLK__SD2_CLK, 111 - MX51_PAD_SD2_DATA0__SD2_DATA0, 112 - MX51_PAD_SD2_DATA1__SD2_DATA1, 113 - MX51_PAD_SD2_DATA2__SD2_DATA2, 114 - MX51_PAD_SD2_DATA3__SD2_DATA3, 115 - }; 116 - 117 - static const struct imxuart_platform_data uart_pdata __initconst = { 118 - .flags = IMXUART_HAVE_RTSCTS, 119 - }; 120 - 121 - static int mbimx51_keymap[] = { 122 - KEY(0, 0, KEY_1), 123 - KEY(0, 1, KEY_2), 124 - KEY(0, 2, KEY_3), 125 - KEY(0, 3, KEY_UP), 126 - 127 - KEY(1, 0, KEY_4), 128 - KEY(1, 1, KEY_5), 129 - KEY(1, 2, KEY_6), 130 - KEY(1, 3, KEY_LEFT), 131 - 132 - KEY(2, 0, KEY_7), 133 - KEY(2, 1, KEY_8), 134 - KEY(2, 2, KEY_9), 135 - KEY(2, 3, KEY_RIGHT), 136 - 137 - KEY(3, 0, KEY_0), 138 - KEY(3, 1, KEY_DOWN), 139 - KEY(3, 2, KEY_ESC), 140 - KEY(3, 3, KEY_ENTER), 141 - }; 142 - 143 - static const struct matrix_keymap_data mbimx51_map_data __initconst = { 144 - .keymap = mbimx51_keymap, 145 - .keymap_size = ARRAY_SIZE(mbimx51_keymap), 146 - }; 147 - 148 - static int tsc2007_get_pendown_state(void) 149 - { 150 - return !gpio_get_value(MBIMX51_TSC2007_GPIO); 151 - } 152 - 153 - struct tsc2007_platform_data tsc2007_data = { 154 - .model = 2007, 155 - .x_plate_ohms = 180, 156 - .get_pendown_state = tsc2007_get_pendown_state, 157 - }; 158 - 159 - static struct i2c_board_info mbimx51_i2c_devices[] = { 160 - { 161 - I2C_BOARD_INFO("tsc2007", 0x49), 162 - .irq = IMX_GPIO_TO_IRQ(MBIMX51_TSC2007_GPIO), 163 - .platform_data = &tsc2007_data, 164 - }, { 165 - I2C_BOARD_INFO("tlv320aic23", 0x1a), 166 - }, 167 - }; 168 - 169 - /* 170 - * baseboard initialization. 171 - */ 172 - void __init eukrea_mbimx51_baseboard_init(void) 173 - { 174 - mxc_iomux_v3_setup_multiple_pads(mbimx51_pads, 175 - ARRAY_SIZE(mbimx51_pads)); 176 - 177 - imx51_add_imx_uart(1, NULL); 178 - imx51_add_imx_uart(2, &uart_pdata); 179 - 180 - gpio_request(MBIMX51_LED0, "LED0"); 181 - gpio_direction_output(MBIMX51_LED0, 1); 182 - gpio_free(MBIMX51_LED0); 183 - gpio_request(MBIMX51_LED1, "LED1"); 184 - gpio_direction_output(MBIMX51_LED1, 1); 185 - gpio_free(MBIMX51_LED1); 186 - gpio_request(MBIMX51_LED2, "LED2"); 187 - gpio_direction_output(MBIMX51_LED2, 1); 188 - gpio_free(MBIMX51_LED2); 189 - gpio_request(MBIMX51_LED3, "LED3"); 190 - gpio_direction_output(MBIMX51_LED3, 1); 191 - gpio_free(MBIMX51_LED3); 192 - 193 - gpio_led_register_device(-1, &mbimx51_leds_info); 194 - 195 - imx51_add_imx_keypad(&mbimx51_map_data); 196 - 197 - gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq"); 198 - gpio_direction_input(MBIMX51_TSC2007_GPIO); 199 - irq_set_irq_type(gpio_to_irq(MBIMX51_TSC2007_GPIO), 200 - IRQF_TRIGGER_FALLING); 201 - i2c_register_board_info(1, mbimx51_i2c_devices, 202 - ARRAY_SIZE(mbimx51_i2c_devices)); 203 - 204 - imx51_add_sdhci_esdhc_imx(0, NULL); 205 - imx51_add_sdhci_esdhc_imx(1, NULL); 206 - }
+102 -16
arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
··· 28 28 #include <linux/platform_device.h> 29 29 #include <linux/input.h> 30 30 #include <linux/i2c.h> 31 + #include <video/platform_lcd.h> 32 + #include <linux/backlight.h> 31 33 32 34 #include <asm/mach-types.h> 33 35 #include <asm/mach/arch.h> ··· 42 40 43 41 #include "devices-imx51.h" 44 42 45 - static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { 43 + static iomux_v3_cfg_t eukrea_mbimxsd51_pads[] = { 46 44 /* LED */ 47 45 MX51_PAD_NANDF_D10__GPIO3_30, 48 46 /* SWITCH */ ··· 68 66 NEW_PAD_CTRL(MX51_PAD_GPIO1_0__SD1_CD, PAD_CTL_PUS_22K_UP | 69 67 PAD_CTL_PKE | PAD_CTL_SRE_FAST | 70 68 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), 69 + /* SSI */ 70 + MX51_PAD_AUD3_BB_TXD__AUD3_TXD, 71 + MX51_PAD_AUD3_BB_RXD__AUD3_RXD, 72 + MX51_PAD_AUD3_BB_CK__AUD3_TXC, 73 + MX51_PAD_AUD3_BB_FS__AUD3_TXFS, 74 + /* LCD Backlight */ 75 + MX51_PAD_DI1_D1_CS__GPIO3_4, 76 + /* LCD RST */ 77 + MX51_PAD_CSI1_D9__GPIO3_13, 71 78 }; 72 79 73 80 #define GPIO_LED1 IMX_GPIO_NR(3, 30) 74 81 #define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) 82 + #define GPIO_LCDRST IMX_GPIO_NR(3, 13) 83 + #define GPIO_LCDBL IMX_GPIO_NR(3, 4) 75 84 76 - static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = { 85 + static void eukrea_mbimxsd51_lcd_power_set(struct plat_lcd_data *pd, 86 + unsigned int power) 87 + { 88 + if (power) 89 + gpio_direction_output(GPIO_LCDRST, 1); 90 + else 91 + gpio_direction_output(GPIO_LCDRST, 0); 92 + } 93 + 94 + static struct plat_lcd_data eukrea_mbimxsd51_lcd_power_data = { 95 + .set_power = eukrea_mbimxsd51_lcd_power_set, 96 + }; 97 + 98 + static struct platform_device eukrea_mbimxsd51_lcd_powerdev = { 99 + .name = "platform-lcd", 100 + .dev.platform_data = &eukrea_mbimxsd51_lcd_power_data, 101 + }; 102 + 103 + static void eukrea_mbimxsd51_bl_set_intensity(int intensity) 104 + { 105 + if (intensity) 106 + gpio_direction_output(GPIO_LCDBL, 1); 107 + else 108 + gpio_direction_output(GPIO_LCDBL, 0); 109 + } 110 + 111 + static struct generic_bl_info eukrea_mbimxsd51_bl_info = { 112 + .name = "eukrea_mbimxsd51-bl", 113 + .max_intensity = 0xff, 114 + .default_intensity = 0xff, 115 + .set_bl_intensity = eukrea_mbimxsd51_bl_set_intensity, 116 + }; 117 + 118 + static struct platform_device eukrea_mbimxsd51_bl_dev = { 119 + .name = "generic-bl", 120 + .id = 1, 121 + .dev = { 122 + .platform_data = &eukrea_mbimxsd51_bl_info, 123 + }, 124 + }; 125 + 126 + static const struct gpio_led eukrea_mbimxsd51_leds[] __initconst = { 77 127 { 78 128 .name = "led1", 79 129 .default_trigger = "heartbeat", ··· 135 81 }; 136 82 137 83 static const struct gpio_led_platform_data 138 - eukrea_mbimxsd_led_info __initconst = { 139 - .leds = eukrea_mbimxsd_leds, 140 - .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), 84 + eukrea_mbimxsd51_led_info __initconst = { 85 + .leds = eukrea_mbimxsd51_leds, 86 + .num_leds = ARRAY_SIZE(eukrea_mbimxsd51_leds), 141 87 }; 142 88 143 - static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { 89 + static struct gpio_keys_button eukrea_mbimxsd51_gpio_buttons[] = { 144 90 { 145 91 .gpio = GPIO_SWITCH1, 146 92 .code = BTN_0, ··· 151 97 }; 152 98 153 99 static const struct gpio_keys_platform_data 154 - eukrea_mbimxsd_button_data __initconst = { 155 - .buttons = eukrea_mbimxsd_gpio_buttons, 156 - .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons), 100 + eukrea_mbimxsd51_button_data __initconst = { 101 + .buttons = eukrea_mbimxsd51_gpio_buttons, 102 + .nbuttons = ARRAY_SIZE(eukrea_mbimxsd51_gpio_buttons), 157 103 }; 158 104 159 105 static const struct imxuart_platform_data uart_pdata __initconst = { 160 106 .flags = IMXUART_HAVE_RTSCTS, 161 107 }; 162 108 163 - static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { 109 + static struct i2c_board_info eukrea_mbimxsd51_i2c_devices[] = { 164 110 { 165 111 I2C_BOARD_INFO("tlv320aic23", 0x1a), 166 112 }, 167 113 }; 114 + 115 + static const 116 + struct imx_ssi_platform_data eukrea_mbimxsd51_ssi_pdata __initconst = { 117 + .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, 118 + }; 119 + 120 + static int screen_type; 121 + 122 + static int __init eukrea_mbimxsd51_screen_type(char *options) 123 + { 124 + if (!strcmp(options, "dvi")) 125 + screen_type = 1; 126 + else if (!strcmp(options, "tft")) 127 + screen_type = 0; 128 + 129 + return 0; 130 + } 131 + __setup("screen_type=", eukrea_mbimxsd51_screen_type); 168 132 169 133 /* 170 134 * system init for baseboard usage. Will be called by cpuimx51sd init. ··· 192 120 */ 193 121 void __init eukrea_mbimxsd51_baseboard_init(void) 194 122 { 195 - if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd_pads, 196 - ARRAY_SIZE(eukrea_mbimxsd_pads))) 123 + if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd51_pads, 124 + ARRAY_SIZE(eukrea_mbimxsd51_pads))) 197 125 printk(KERN_ERR "error setting mbimxsd pads !\n"); 198 126 199 127 imx51_add_imx_uart(1, NULL); 200 128 imx51_add_imx_uart(2, &uart_pdata); 201 129 202 130 imx51_add_sdhci_esdhc_imx(0, NULL); 131 + 132 + imx51_add_imx_ssi(0, &eukrea_mbimxsd51_ssi_pdata); 203 133 204 134 gpio_request(GPIO_LED1, "LED1"); 205 135 gpio_direction_output(GPIO_LED1, 1); ··· 211 137 gpio_direction_input(GPIO_SWITCH1); 212 138 gpio_free(GPIO_SWITCH1); 213 139 214 - i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, 215 - ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 140 + gpio_request(GPIO_LCDRST, "LCDRST"); 141 + gpio_direction_output(GPIO_LCDRST, 0); 142 + gpio_request(GPIO_LCDBL, "LCDBL"); 143 + gpio_direction_output(GPIO_LCDBL, 0); 144 + if (!screen_type) { 145 + platform_device_register(&eukrea_mbimxsd51_bl_dev); 146 + platform_device_register(&eukrea_mbimxsd51_lcd_powerdev); 147 + } else { 148 + gpio_free(GPIO_LCDRST); 149 + gpio_free(GPIO_LCDBL); 150 + } 216 151 217 - gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); 218 - imx_add_gpio_keys(&eukrea_mbimxsd_button_data); 152 + i2c_register_board_info(0, eukrea_mbimxsd51_i2c_devices, 153 + ARRAY_SIZE(eukrea_mbimxsd51_i2c_devices)); 154 + 155 + gpio_led_register_device(-1, &eukrea_mbimxsd51_led_info); 156 + imx_add_gpio_keys(&eukrea_mbimxsd51_button_data); 219 157 }
+46 -5
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
··· 23 23 #include <linux/leds.h> 24 24 #include <linux/platform_device.h> 25 25 #include <linux/input.h> 26 + #include <linux/spi/spi.h> 26 27 #include <video/platform_lcd.h> 27 28 28 29 #include <mach/hardware.h> ··· 88 87 /* CAN */ 89 88 MX25_PAD_GPIO_D__CAN2_RX, 90 89 MX25_PAD_GPIO_C__CAN2_TX, 90 + /* SPI1 */ 91 + MX25_PAD_CSPI1_MOSI__CSPI1_MOSI, 92 + MX25_PAD_CSPI1_MISO__CSPI1_MISO, 93 + MX25_PAD_CSPI1_SS0__GPIO_1_16, 94 + MX25_PAD_CSPI1_SS1__GPIO_1_17, 95 + MX25_PAD_CSPI1_SCLK__CSPI1_SCLK, 96 + MX25_PAD_CSPI1_RDY__GPIO_2_22, 91 97 }; 92 98 93 - #define GPIO_LED1 83 94 - #define GPIO_SWITCH1 82 95 - #define GPIO_SD1CD 52 96 - #define GPIO_LCDPWR 26 99 + #define GPIO_LED1 IMX_GPIO_NR(3, 19) 100 + #define GPIO_SWITCH1 IMX_GPIO_NR(3, 18) 101 + #define GPIO_SD1CD IMX_GPIO_NR(2, 20) 102 + #define GPIO_LCDPWR IMX_GPIO_NR(1, 26) 103 + #define GPIO_SPI1_SS0 IMX_GPIO_NR(1, 16) 104 + #define GPIO_SPI1_SS1 IMX_GPIO_NR(1, 17) 105 + #define GPIO_SPI1_IRQ IMX_GPIO_NR(2, 22) 97 106 98 107 static struct imx_fb_videomode eukrea_mximxsd_modes[] = { 99 108 { ··· 239 228 .wp_type = ESDHC_WP_NONE, 240 229 }; 241 230 231 + static struct spi_board_info eukrea_mbimxsd25_spi_board_info[] __initdata = { 232 + { 233 + .modalias = "spidev", 234 + .max_speed_hz = 20000000, 235 + .bus_num = 0, 236 + .chip_select = 0, 237 + .mode = SPI_MODE_0, 238 + }, 239 + { 240 + .modalias = "spidev", 241 + .max_speed_hz = 20000000, 242 + .bus_num = 0, 243 + .chip_select = 1, 244 + .mode = SPI_MODE_0, 245 + }, 246 + }; 247 + 248 + static int eukrea_mbimxsd25_spi_cs[] = {GPIO_SPI1_SS0, GPIO_SPI1_SS1}; 249 + 250 + static const struct spi_imx_master eukrea_mbimxsd25_spi0_data __initconst = { 251 + .chipselect = eukrea_mbimxsd25_spi_cs, 252 + .num_chipselect = ARRAY_SIZE(eukrea_mbimxsd25_spi_cs), 253 + }; 254 + 242 255 /* 243 256 * system init for baseboard usage. Will be called by cpuimx25 init. 244 257 * ··· 292 257 293 258 gpio_request(GPIO_LCDPWR, "LCDPWR"); 294 259 gpio_direction_output(GPIO_LCDPWR, 1); 295 - gpio_free(GPIO_SWITCH1); 296 260 297 261 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, 298 262 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 263 + 264 + gpio_request(GPIO_SPI1_IRQ, "SPI1_IRQ"); 265 + gpio_direction_input(GPIO_SPI1_IRQ); 266 + gpio_free(GPIO_SPI1_IRQ); 267 + imx25_add_spi_imx0(&eukrea_mbimxsd25_spi0_data); 268 + spi_register_board_info(eukrea_mbimxsd25_spi_board_info, 269 + ARRAY_SIZE(eukrea_mbimxsd25_spi_board_info)); 299 270 300 271 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 301 272 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
+42
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
··· 27 27 #include <linux/leds.h> 28 28 #include <linux/platform_device.h> 29 29 #include <linux/input.h> 30 + #include <linux/spi/spi.h> 30 31 #include <video/platform_lcd.h> 31 32 #include <linux/i2c.h> 32 33 ··· 159 158 MX35_PAD_SD1_DATA3__ESDHC1_DAT3, 160 159 /* SD1 CD */ 161 160 MX35_PAD_LD18__GPIO3_24, 161 + /* SPI */ 162 + MX35_PAD_CSPI1_MOSI__CSPI1_MOSI, 163 + MX35_PAD_CSPI1_MISO__CSPI1_MISO, 164 + MX35_PAD_CSPI1_SS0__GPIO1_18, 165 + MX35_PAD_CSPI1_SS1__GPIO1_19, 166 + MX35_PAD_CSPI1_SCLK__CSPI1_SCLK, 167 + MX35_PAD_CSPI1_SPI_RDY__GPIO3_5, 162 168 }; 163 169 164 170 #define GPIO_LED1 IMX_GPIO_NR(3, 29) 165 171 #define GPIO_SWITCH1 IMX_GPIO_NR(3, 25) 166 172 #define GPIO_LCDPWR IMX_GPIO_NR(1, 4) 167 173 #define GPIO_SD1CD IMX_GPIO_NR(3, 24) 174 + #define GPIO_SPI1_SS0 IMX_GPIO_NR(1, 18) 175 + #define GPIO_SPI1_SS1 IMX_GPIO_NR(1, 19) 176 + #define GPIO_SPI1_IRQ IMX_GPIO_NR(3, 5) 168 177 169 178 static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd, 170 179 unsigned int power) ··· 250 239 .wp_type = ESDHC_WP_NONE, 251 240 }; 252 241 242 + static struct spi_board_info eukrea_mbimxsd35_spi_board_info[] __initdata = { 243 + { 244 + .modalias = "spidev", 245 + .max_speed_hz = 20000000, 246 + .bus_num = 0, 247 + .chip_select = 0, 248 + .mode = SPI_MODE_0, 249 + }, 250 + { 251 + .modalias = "spidev", 252 + .max_speed_hz = 20000000, 253 + .bus_num = 0, 254 + .chip_select = 1, 255 + .mode = SPI_MODE_0, 256 + }, 257 + }; 258 + 259 + static int eukrea_mbimxsd35_spi_cs[] = {GPIO_SPI1_SS0, GPIO_SPI1_SS1}; 260 + 261 + static const struct spi_imx_master eukrea_mbimxsd35_spi0_data __initconst = { 262 + .chipselect = eukrea_mbimxsd35_spi_cs, 263 + .num_chipselect = ARRAY_SIZE(eukrea_mbimxsd35_spi_cs), 264 + }; 265 + 253 266 /* 254 267 * system init for baseboard usage. Will be called by cpuimx35 init. 255 268 * ··· 308 273 309 274 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, 310 275 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 276 + 277 + gpio_request(GPIO_SPI1_IRQ, "SPI1_IRQ"); 278 + gpio_direction_input(GPIO_SPI1_IRQ); 279 + gpio_free(GPIO_SPI1_IRQ); 280 + imx35_add_spi_imx0(&eukrea_mbimxsd35_spi0_data); 281 + spi_register_board_info(eukrea_mbimxsd35_spi_board_info, 282 + ARRAY_SIZE(eukrea_mbimxsd35_spi_board_info)); 311 283 312 284 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 313 285 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
-301
arch/arm/mach-imx/mach-cpuimx51.c
··· 1 - /* 2 - * 3 - * Copyright (C) 2010 Eric Bénard <eric@eukrea.com> 4 - * 5 - * based on board-mx51_babbage.c which is 6 - * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved. 7 - * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> 8 - * 9 - * The code contained herein is licensed under the GNU General Public 10 - * License. You may obtain a copy of the GNU General Public License 11 - * Version 2 or later at the following locations: 12 - * 13 - * http://www.opensource.org/licenses/gpl-license.html 14 - * http://www.gnu.org/copyleft/gpl.html 15 - */ 16 - 17 - #include <linux/init.h> 18 - #include <linux/platform_device.h> 19 - #include <linux/serial_8250.h> 20 - #include <linux/i2c.h> 21 - #include <linux/gpio.h> 22 - #include <linux/delay.h> 23 - #include <linux/io.h> 24 - #include <linux/interrupt.h> 25 - 26 - #include <mach/eukrea-baseboards.h> 27 - #include <mach/common.h> 28 - #include <mach/hardware.h> 29 - #include <mach/iomux-mx51.h> 30 - 31 - #include <asm/setup.h> 32 - #include <asm/mach-types.h> 33 - #include <asm/mach/arch.h> 34 - #include <asm/mach/time.h> 35 - 36 - #include "devices-imx51.h" 37 - 38 - #define CPUIMX51_USBH1_STP IMX_GPIO_NR(1, 27) 39 - #define CPUIMX51_QUARTA_GPIO IMX_GPIO_NR(3, 28) 40 - #define CPUIMX51_QUARTB_GPIO IMX_GPIO_NR(3, 25) 41 - #define CPUIMX51_QUARTC_GPIO IMX_GPIO_NR(3, 26) 42 - #define CPUIMX51_QUARTD_GPIO IMX_GPIO_NR(3, 27) 43 - #define CPUIMX51_QUART_XTAL 14745600 44 - #define CPUIMX51_QUART_REGSHIFT 17 45 - 46 - /* USB_CTRL_1 */ 47 - #define MX51_USB_CTRL_1_OFFSET 0x10 48 - #define MX51_USB_CTRL_UH1_EXT_CLK_EN (1 << 25) 49 - 50 - #define MX51_USB_PLLDIV_12_MHZ 0x00 51 - #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 52 - #define MX51_USB_PLL_DIV_24_MHZ 0x02 53 - 54 - static struct plat_serial8250_port serial_platform_data[] = { 55 - { 56 - .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000), 57 - .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTA_GPIO), 58 - .irqflags = IRQF_TRIGGER_HIGH, 59 - .uartclk = CPUIMX51_QUART_XTAL, 60 - .regshift = CPUIMX51_QUART_REGSHIFT, 61 - .iotype = UPIO_MEM, 62 - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 63 - }, { 64 - .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x800000), 65 - .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTB_GPIO), 66 - .irqflags = IRQF_TRIGGER_HIGH, 67 - .uartclk = CPUIMX51_QUART_XTAL, 68 - .regshift = CPUIMX51_QUART_REGSHIFT, 69 - .iotype = UPIO_MEM, 70 - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 71 - }, { 72 - .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x1000000), 73 - .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTC_GPIO), 74 - .irqflags = IRQF_TRIGGER_HIGH, 75 - .uartclk = CPUIMX51_QUART_XTAL, 76 - .regshift = CPUIMX51_QUART_REGSHIFT, 77 - .iotype = UPIO_MEM, 78 - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 79 - }, { 80 - .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000), 81 - .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTD_GPIO), 82 - .irqflags = IRQF_TRIGGER_HIGH, 83 - .uartclk = CPUIMX51_QUART_XTAL, 84 - .regshift = CPUIMX51_QUART_REGSHIFT, 85 - .iotype = UPIO_MEM, 86 - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 87 - }, { 88 - } 89 - }; 90 - 91 - static struct platform_device serial_device = { 92 - .name = "serial8250", 93 - .id = 0, 94 - .dev = { 95 - .platform_data = serial_platform_data, 96 - }, 97 - }; 98 - 99 - static struct platform_device *devices[] __initdata = { 100 - &serial_device, 101 - }; 102 - 103 - static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = { 104 - /* UART1 */ 105 - MX51_PAD_UART1_RXD__UART1_RXD, 106 - MX51_PAD_UART1_TXD__UART1_TXD, 107 - MX51_PAD_UART1_RTS__UART1_RTS, 108 - MX51_PAD_UART1_CTS__UART1_CTS, 109 - 110 - /* I2C2 */ 111 - MX51_PAD_GPIO1_2__I2C2_SCL, 112 - MX51_PAD_GPIO1_3__I2C2_SDA, 113 - MX51_PAD_NANDF_D10__GPIO3_30, 114 - 115 - /* QUART IRQ */ 116 - MX51_PAD_NANDF_D15__GPIO3_25, 117 - MX51_PAD_NANDF_D14__GPIO3_26, 118 - MX51_PAD_NANDF_D13__GPIO3_27, 119 - MX51_PAD_NANDF_D12__GPIO3_28, 120 - 121 - /* USB HOST1 */ 122 - MX51_PAD_USBH1_CLK__USBH1_CLK, 123 - MX51_PAD_USBH1_DIR__USBH1_DIR, 124 - MX51_PAD_USBH1_NXT__USBH1_NXT, 125 - MX51_PAD_USBH1_DATA0__USBH1_DATA0, 126 - MX51_PAD_USBH1_DATA1__USBH1_DATA1, 127 - MX51_PAD_USBH1_DATA2__USBH1_DATA2, 128 - MX51_PAD_USBH1_DATA3__USBH1_DATA3, 129 - MX51_PAD_USBH1_DATA4__USBH1_DATA4, 130 - MX51_PAD_USBH1_DATA5__USBH1_DATA5, 131 - MX51_PAD_USBH1_DATA6__USBH1_DATA6, 132 - MX51_PAD_USBH1_DATA7__USBH1_DATA7, 133 - MX51_PAD_USBH1_STP__USBH1_STP, 134 - }; 135 - 136 - static const struct mxc_nand_platform_data 137 - eukrea_cpuimx51_nand_board_info __initconst = { 138 - .width = 1, 139 - .hw_ecc = 1, 140 - .flash_bbt = 1, 141 - }; 142 - 143 - static const struct imxuart_platform_data uart_pdata __initconst = { 144 - .flags = IMXUART_HAVE_RTSCTS, 145 - }; 146 - 147 - static const 148 - struct imxi2c_platform_data eukrea_cpuimx51_i2c_data __initconst = { 149 - .bitrate = 100000, 150 - }; 151 - 152 - static struct i2c_board_info eukrea_cpuimx51_i2c_devices[] = { 153 - { 154 - I2C_BOARD_INFO("pcf8563", 0x51), 155 - }, 156 - }; 157 - 158 - /* This function is board specific as the bit mask for the plldiv will also 159 - be different for other Freescale SoCs, thus a common bitmask is not 160 - possible and cannot get place in /plat-mxc/ehci.c.*/ 161 - static int initialize_otg_port(struct platform_device *pdev) 162 - { 163 - u32 v; 164 - void __iomem *usb_base; 165 - void __iomem *usbother_base; 166 - 167 - usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K); 168 - if (!usb_base) 169 - return -ENOMEM; 170 - usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 171 - 172 - /* Set the PHY clock to 19.2MHz */ 173 - v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); 174 - v &= ~MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK; 175 - v |= MX51_USB_PLL_DIV_19_2_MHZ; 176 - __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); 177 - iounmap(usb_base); 178 - 179 - mdelay(10); 180 - 181 - return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY); 182 - } 183 - 184 - static int initialize_usbh1_port(struct platform_device *pdev) 185 - { 186 - u32 v; 187 - void __iomem *usb_base; 188 - void __iomem *usbother_base; 189 - 190 - usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K); 191 - if (!usb_base) 192 - return -ENOMEM; 193 - usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 194 - 195 - /* The clock for the USBH1 ULPI port will come externally from the PHY. */ 196 - v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET); 197 - __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET); 198 - iounmap(usb_base); 199 - 200 - mdelay(10); 201 - 202 - return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED | 203 - MXC_EHCI_ITC_NO_THRESHOLD); 204 - } 205 - 206 - static const struct mxc_usbh_platform_data dr_utmi_config __initconst = { 207 - .init = initialize_otg_port, 208 - .portsc = MXC_EHCI_UTMI_16BIT, 209 - }; 210 - 211 - static const struct fsl_usb2_platform_data usb_pdata __initconst = { 212 - .operating_mode = FSL_USB2_DR_DEVICE, 213 - .phy_mode = FSL_USB2_PHY_UTMI_WIDE, 214 - }; 215 - 216 - static const struct mxc_usbh_platform_data usbh1_config __initconst = { 217 - .init = initialize_usbh1_port, 218 - .portsc = MXC_EHCI_MODE_ULPI, 219 - }; 220 - 221 - static int otg_mode_host; 222 - 223 - static int __init eukrea_cpuimx51_otg_mode(char *options) 224 - { 225 - if (!strcmp(options, "host")) 226 - otg_mode_host = 1; 227 - else if (!strcmp(options, "device")) 228 - otg_mode_host = 0; 229 - else 230 - pr_info("otg_mode neither \"host\" nor \"device\". " 231 - "Defaulting to device\n"); 232 - return 0; 233 - } 234 - __setup("otg_mode=", eukrea_cpuimx51_otg_mode); 235 - 236 - /* 237 - * Board specific initialization. 238 - */ 239 - static void __init eukrea_cpuimx51_init(void) 240 - { 241 - imx51_soc_init(); 242 - 243 - mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads, 244 - ARRAY_SIZE(eukrea_cpuimx51_pads)); 245 - 246 - imx51_add_imx_uart(0, &uart_pdata); 247 - imx51_add_mxc_nand(&eukrea_cpuimx51_nand_board_info); 248 - 249 - gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq"); 250 - gpio_direction_input(CPUIMX51_QUARTA_GPIO); 251 - gpio_free(CPUIMX51_QUARTA_GPIO); 252 - gpio_request(CPUIMX51_QUARTB_GPIO, "quartb_irq"); 253 - gpio_direction_input(CPUIMX51_QUARTB_GPIO); 254 - gpio_free(CPUIMX51_QUARTB_GPIO); 255 - gpio_request(CPUIMX51_QUARTC_GPIO, "quartc_irq"); 256 - gpio_direction_input(CPUIMX51_QUARTC_GPIO); 257 - gpio_free(CPUIMX51_QUARTC_GPIO); 258 - gpio_request(CPUIMX51_QUARTD_GPIO, "quartd_irq"); 259 - gpio_direction_input(CPUIMX51_QUARTD_GPIO); 260 - gpio_free(CPUIMX51_QUARTD_GPIO); 261 - 262 - imx51_add_fec(NULL); 263 - platform_add_devices(devices, ARRAY_SIZE(devices)); 264 - 265 - imx51_add_imx_i2c(1, &eukrea_cpuimx51_i2c_data); 266 - i2c_register_board_info(1, eukrea_cpuimx51_i2c_devices, 267 - ARRAY_SIZE(eukrea_cpuimx51_i2c_devices)); 268 - 269 - if (otg_mode_host) 270 - imx51_add_mxc_ehci_otg(&dr_utmi_config); 271 - else { 272 - initialize_otg_port(NULL); 273 - imx51_add_fsl_usb2_udc(&usb_pdata); 274 - } 275 - imx51_add_mxc_ehci_hs(1, &usbh1_config); 276 - 277 - #ifdef CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD 278 - eukrea_mbimx51_baseboard_init(); 279 - #endif 280 - } 281 - 282 - static void __init eukrea_cpuimx51_timer_init(void) 283 - { 284 - mx51_clocks_init(32768, 24000000, 22579200, 0); 285 - } 286 - 287 - static struct sys_timer mxc_timer = { 288 - .init = eukrea_cpuimx51_timer_init, 289 - }; 290 - 291 - MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module") 292 - /* Maintainer: Eric Bénard <eric@eukrea.com> */ 293 - .atag_offset = 0x100, 294 - .map_io = mx51_map_io, 295 - .init_early = imx51_init_early, 296 - .init_irq = mx51_init_irq, 297 - .handle_irq = imx51_handle_irq, 298 - .timer = &mxc_timer, 299 - .init_machine = eukrea_cpuimx51_init, 300 - .restart = mxc_restart, 301 - MACHINE_END
+42 -8
arch/arm/mach-imx/mach-cpuimx51sd.c
··· 41 41 42 42 #define USBH1_RST IMX_GPIO_NR(2, 28) 43 43 #define ETH_RST IMX_GPIO_NR(2, 31) 44 - #define TSC2007_IRQGPIO IMX_GPIO_NR(3, 12) 44 + #define TSC2007_IRQGPIO_REV2 IMX_GPIO_NR(3, 12) 45 + #define TSC2007_IRQGPIO_REV3 IMX_GPIO_NR(4, 0) 45 46 #define CAN_IRQGPIO IMX_GPIO_NR(1, 1) 46 47 #define CAN_RST IMX_GPIO_NR(4, 15) 47 48 #define CAN_NCS IMX_GPIO_NR(4, 24) 48 - #define CAN_RXOBF IMX_GPIO_NR(1, 4) 49 + #define CAN_RXOBF_REV2 IMX_GPIO_NR(1, 4) 50 + #define CAN_RXOBF_REV3 IMX_GPIO_NR(3, 12) 49 51 #define CAN_RX1BF IMX_GPIO_NR(1, 6) 50 52 #define CAN_TXORTS IMX_GPIO_NR(1, 7) 51 53 #define CAN_TX1RTS IMX_GPIO_NR(1, 8) ··· 92 90 MX51_PAD_I2C1_CLK__GPIO4_16, 93 91 MX51_PAD_I2C1_DAT__GPIO4_17, 94 92 93 + /* I2C1 */ 94 + MX51_PAD_SD2_CMD__I2C1_SCL, 95 + MX51_PAD_SD2_CLK__I2C1_SDA, 96 + 95 97 /* CAN */ 96 98 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI, 97 99 MX51_PAD_CSPI1_MISO__ECSPI1_MISO, ··· 114 108 NEW_PAD_CTRL(MX51_PAD_GPIO_NAND__GPIO_NAND, PAD_CTL_PUS_22K_UP | 115 109 PAD_CTL_PKE | PAD_CTL_SRE_FAST | 116 110 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), 111 + NEW_PAD_CTRL(MX51_PAD_NANDF_D8__GPIO4_0, PAD_CTL_PUS_22K_UP | 112 + PAD_CTL_PKE | PAD_CTL_SRE_FAST | 113 + PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), 117 114 }; 118 115 119 116 static const struct imxuart_platform_data uart_pdata __initconst = { 120 117 .flags = IMXUART_HAVE_RTSCTS, 121 118 }; 122 119 120 + static int tsc2007_get_pendown_state(void) 121 + { 122 + if (mx51_revision() < IMX_CHIP_REVISION_3_0) 123 + return !gpio_get_value(TSC2007_IRQGPIO_REV2); 124 + else 125 + return !gpio_get_value(TSC2007_IRQGPIO_REV3); 126 + } 127 + 123 128 static struct tsc2007_platform_data tsc2007_info = { 124 129 .model = 2007, 125 130 .x_plate_ohms = 180, 131 + .get_pendown_state = tsc2007_get_pendown_state, 126 132 }; 127 133 128 134 static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = { ··· 144 126 I2C_BOARD_INFO("tsc2007", 0x49), 145 127 .type = "tsc2007", 146 128 .platform_data = &tsc2007_info, 147 - .irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO), 148 129 }, 149 130 }; 150 131 ··· 272 255 .num_chipselect = ARRAY_SIZE(cpuimx51sd_spi1_cs), 273 256 }; 274 257 275 - static struct platform_device *platform_devices[] __initdata = { 258 + static struct platform_device *rev2_platform_devices[] __initdata = { 276 259 &hsi2c_gpio_device, 260 + }; 261 + 262 + static const struct imxi2c_platform_data cpuimx51sd_i2c_data __initconst = { 263 + .bitrate = 100000, 277 264 }; 278 265 279 266 static void __init eukrea_cpuimx51sd_init(void) ··· 293 272 294 273 imx51_add_imx_uart(0, &uart_pdata); 295 274 imx51_add_mxc_nand(&eukrea_cpuimx51sd_nand_board_info); 275 + imx51_add_imx2_wdt(0, NULL); 296 276 297 277 gpio_request(ETH_RST, "eth_rst"); 298 278 gpio_set_value(ETH_RST, 1); ··· 313 291 spi_register_board_info(cpuimx51sd_spi_device, 314 292 ARRAY_SIZE(cpuimx51sd_spi_device)); 315 293 316 - gpio_request(TSC2007_IRQGPIO, "tsc2007_irq"); 317 - gpio_direction_input(TSC2007_IRQGPIO); 318 - gpio_free(TSC2007_IRQGPIO); 294 + if (mx51_revision() < IMX_CHIP_REVISION_3_0) { 295 + eukrea_cpuimx51sd_i2c_devices[1].irq = 296 + gpio_to_irq(TSC2007_IRQGPIO_REV2), 297 + platform_add_devices(rev2_platform_devices, 298 + ARRAY_SIZE(rev2_platform_devices)); 299 + gpio_request(TSC2007_IRQGPIO_REV2, "tsc2007_irq"); 300 + gpio_direction_input(TSC2007_IRQGPIO_REV2); 301 + gpio_free(TSC2007_IRQGPIO_REV2); 302 + } else { 303 + eukrea_cpuimx51sd_i2c_devices[1].irq = 304 + gpio_to_irq(TSC2007_IRQGPIO_REV3), 305 + imx51_add_imx_i2c(0, &cpuimx51sd_i2c_data); 306 + gpio_request(TSC2007_IRQGPIO_REV3, "tsc2007_irq"); 307 + gpio_direction_input(TSC2007_IRQGPIO_REV3); 308 + gpio_free(TSC2007_IRQGPIO_REV3); 309 + } 319 310 320 311 i2c_register_board_info(0, eukrea_cpuimx51sd_i2c_devices, 321 312 ARRAY_SIZE(eukrea_cpuimx51sd_i2c_devices)); 322 - platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 323 313 324 314 if (otg_mode_host) 325 315 imx51_add_mxc_ehci_otg(&dr_utmi_config);
+2
arch/arm/mach-imx/mach-eukrea_cpuimx25.c
··· 106 106 static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 107 107 .operating_mode = FSL_USB2_DR_DEVICE, 108 108 .phy_mode = FSL_USB2_PHY_UTMI, 109 + .workaround = FLS_USB2_WORKAROUND_ENGCM09152, 109 110 }; 110 111 111 112 static int otg_mode_host; ··· 136 135 imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info); 137 136 imx25_add_imxdi_rtc(NULL); 138 137 imx25_add_fec(&mx25_fec_pdata); 138 + imx25_add_imx2_wdt(NULL); 139 139 140 140 i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices, 141 141 ARRAY_SIZE(eukrea_cpuimx25_i2c_devices));
+55
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
··· 38 38 #include <asm/mach-types.h> 39 39 #include <asm/mach/arch.h> 40 40 #include <asm/mach/time.h> 41 + #include <asm/system.h> 41 42 #include <mach/common.h> 42 43 #include <mach/iomux-mx27.h> 43 44 ··· 48 47 #define TVP5150_PWDN (GPIO_PORTC + 19) 49 48 #define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) 50 49 #define SDHC1_IRQ IRQ_GPIOB(25) 50 + 51 + #define MOTHERBOARD_BIT2 (GPIO_PORTD + 31) 52 + #define MOTHERBOARD_BIT1 (GPIO_PORTD + 30) 53 + #define MOTHERBOARD_BIT0 (GPIO_PORTD + 29) 54 + 55 + #define EXPBOARD_BIT2 (GPIO_PORTD + 25) 56 + #define EXPBOARD_BIT1 (GPIO_PORTD + 27) 57 + #define EXPBOARD_BIT0 (GPIO_PORTD + 28) 51 58 52 59 static const int visstrim_m10_pins[] __initconst = { 53 60 /* UART1 (console) */ ··· 128 119 PB19_PF_CSI_D7, 129 120 PB20_PF_CSI_VSYNC, 130 121 PB21_PF_CSI_HSYNC, 122 + /* mother board version */ 123 + MOTHERBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 124 + MOTHERBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 125 + MOTHERBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 126 + /* expansion board version */ 127 + EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 128 + EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 129 + EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 130 + }; 131 + 132 + static struct gpio visstrim_m10_version_gpios[] = { 133 + { EXPBOARD_BIT0, GPIOF_IN, "exp-version-0" }, 134 + { EXPBOARD_BIT1, GPIOF_IN, "exp-version-1" }, 135 + { EXPBOARD_BIT2, GPIOF_IN, "exp-version-2" }, 136 + { MOTHERBOARD_BIT0, GPIOF_IN, "mother-version-0" }, 137 + { MOTHERBOARD_BIT1, GPIOF_IN, "mother-version-1" }, 138 + { MOTHERBOARD_BIT2, GPIOF_IN, "mother-version-2" }, 131 139 }; 132 140 133 141 /* Camera */ ··· 395 369 .flags = IMX_SSI_DMA | IMX_SSI_SYN, 396 370 }; 397 371 372 + static void __init visstrim_m10_revision(void) 373 + { 374 + int exp_version = 0; 375 + int mo_version = 0; 376 + int ret; 377 + 378 + ret = gpio_request_array(visstrim_m10_version_gpios, 379 + ARRAY_SIZE(visstrim_m10_version_gpios)); 380 + if (ret) { 381 + pr_err("Failed to request version gpios"); 382 + return; 383 + } 384 + 385 + /* Get expansion board version (negative logic) */ 386 + exp_version |= !gpio_get_value(EXPBOARD_BIT2) << 2; 387 + exp_version |= !gpio_get_value(EXPBOARD_BIT1) << 1; 388 + exp_version |= !gpio_get_value(EXPBOARD_BIT0); 389 + 390 + /* Get mother board version (negative logic) */ 391 + mo_version |= !gpio_get_value(MOTHERBOARD_BIT2) << 2; 392 + mo_version |= !gpio_get_value(MOTHERBOARD_BIT1) << 1; 393 + mo_version |= !gpio_get_value(MOTHERBOARD_BIT0); 394 + 395 + system_rev = 0x27000; 396 + system_rev |= (mo_version << 4); 397 + system_rev |= exp_version; 398 + } 399 + 398 400 static void __init visstrim_m10_board_init(void) 399 401 { 400 402 int ret; 401 403 402 404 imx27_soc_init(); 405 + visstrim_m10_revision(); 403 406 404 407 ret = mxc_gpio_setup_multiple_pins(visstrim_m10_pins, 405 408 ARRAY_SIZE(visstrim_m10_pins), "VISSTRIM_M10");
+193
arch/arm/mach-imx/mach-mx35_3ds.c
··· 34 34 #include <linux/usb/otg.h> 35 35 36 36 #include <linux/mtd/physmap.h> 37 + #include <linux/mfd/mc13892.h> 38 + #include <linux/regulator/machine.h> 37 39 38 40 #include <asm/mach-types.h> 39 41 #include <asm/mach/arch.h> ··· 255 253 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK, 256 254 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK, 257 255 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC, 256 + /*PMIC IRQ*/ 257 + MX35_PAD_GPIO2_0__GPIO2_0, 258 258 }; 259 259 260 260 /* ··· 320 316 .platform_data = &iclink_ov2640, 321 317 }, 322 318 }; 319 + 320 + static struct regulator_consumer_supply sw1_consumers[] = { 321 + { 322 + .supply = "cpu_vcc", 323 + } 324 + }; 325 + 326 + static struct regulator_consumer_supply vcam_consumers[] = { 327 + /* sgtl5000 */ 328 + REGULATOR_SUPPLY("VDDA", "0-000a"), 329 + }; 330 + 331 + static struct regulator_consumer_supply vaudio_consumers[] = { 332 + REGULATOR_SUPPLY("cmos_vio", "soc-camera-pdrv.0"), 333 + }; 334 + 335 + static struct regulator_init_data sw1_init = { 336 + .constraints = { 337 + .name = "SW1", 338 + .min_uV = 600000, 339 + .max_uV = 1375000, 340 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 341 + .valid_modes_mask = 0, 342 + .always_on = 1, 343 + .boot_on = 1, 344 + }, 345 + .num_consumer_supplies = ARRAY_SIZE(sw1_consumers), 346 + .consumer_supplies = sw1_consumers, 347 + }; 348 + 349 + static struct regulator_init_data sw2_init = { 350 + .constraints = { 351 + .name = "SW2", 352 + .always_on = 1, 353 + .boot_on = 1, 354 + } 355 + }; 356 + 357 + static struct regulator_init_data sw3_init = { 358 + .constraints = { 359 + .name = "SW3", 360 + .always_on = 1, 361 + .boot_on = 1, 362 + } 363 + }; 364 + 365 + static struct regulator_init_data sw4_init = { 366 + .constraints = { 367 + .name = "SW4", 368 + .always_on = 1, 369 + .boot_on = 1, 370 + } 371 + }; 372 + 373 + static struct regulator_init_data viohi_init = { 374 + .constraints = { 375 + .name = "VIOHI", 376 + .boot_on = 1, 377 + } 378 + }; 379 + 380 + static struct regulator_init_data vusb_init = { 381 + .constraints = { 382 + .name = "VUSB", 383 + .boot_on = 1, 384 + } 385 + }; 386 + 387 + static struct regulator_init_data vdig_init = { 388 + .constraints = { 389 + .name = "VDIG", 390 + .boot_on = 1, 391 + } 392 + }; 393 + 394 + static struct regulator_init_data vpll_init = { 395 + .constraints = { 396 + .name = "VPLL", 397 + .boot_on = 1, 398 + } 399 + }; 400 + 401 + static struct regulator_init_data vusb2_init = { 402 + .constraints = { 403 + .name = "VUSB2", 404 + .boot_on = 1, 405 + } 406 + }; 407 + 408 + static struct regulator_init_data vvideo_init = { 409 + .constraints = { 410 + .name = "VVIDEO", 411 + .boot_on = 1 412 + } 413 + }; 414 + 415 + static struct regulator_init_data vaudio_init = { 416 + .constraints = { 417 + .name = "VAUDIO", 418 + .min_uV = 2300000, 419 + .max_uV = 3000000, 420 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 421 + .boot_on = 1 422 + }, 423 + .num_consumer_supplies = ARRAY_SIZE(vaudio_consumers), 424 + .consumer_supplies = vaudio_consumers, 425 + }; 426 + 427 + static struct regulator_init_data vcam_init = { 428 + .constraints = { 429 + .name = "VCAM", 430 + .min_uV = 2500000, 431 + .max_uV = 3000000, 432 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 433 + REGULATOR_CHANGE_MODE, 434 + .valid_modes_mask = REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL, 435 + .boot_on = 1 436 + }, 437 + .num_consumer_supplies = ARRAY_SIZE(vcam_consumers), 438 + .consumer_supplies = vcam_consumers, 439 + }; 440 + 441 + static struct regulator_init_data vgen1_init = { 442 + .constraints = { 443 + .name = "VGEN1", 444 + } 445 + }; 446 + 447 + static struct regulator_init_data vgen2_init = { 448 + .constraints = { 449 + .name = "VGEN2", 450 + .boot_on = 1, 451 + } 452 + }; 453 + 454 + static struct regulator_init_data vgen3_init = { 455 + .constraints = { 456 + .name = "VGEN3", 457 + } 458 + }; 459 + 460 + static struct mc13xxx_regulator_init_data mx35_3ds_regulators[] = { 461 + { .id = MC13892_SW1, .init_data = &sw1_init }, 462 + { .id = MC13892_SW2, .init_data = &sw2_init }, 463 + { .id = MC13892_SW3, .init_data = &sw3_init }, 464 + { .id = MC13892_SW4, .init_data = &sw4_init }, 465 + { .id = MC13892_VIOHI, .init_data = &viohi_init }, 466 + { .id = MC13892_VPLL, .init_data = &vpll_init }, 467 + { .id = MC13892_VDIG, .init_data = &vdig_init }, 468 + { .id = MC13892_VUSB2, .init_data = &vusb2_init }, 469 + { .id = MC13892_VVIDEO, .init_data = &vvideo_init }, 470 + { .id = MC13892_VAUDIO, .init_data = &vaudio_init }, 471 + { .id = MC13892_VCAM, .init_data = &vcam_init }, 472 + { .id = MC13892_VGEN1, .init_data = &vgen1_init }, 473 + { .id = MC13892_VGEN2, .init_data = &vgen2_init }, 474 + { .id = MC13892_VGEN3, .init_data = &vgen3_init }, 475 + { .id = MC13892_VUSB, .init_data = &vusb_init }, 476 + }; 477 + 478 + static struct mc13xxx_platform_data mx35_3ds_mc13892_data = { 479 + .flags = MC13XXX_USE_RTC | MC13XXX_USE_TOUCHSCREEN, 480 + .regulators = { 481 + .num_regulators = ARRAY_SIZE(mx35_3ds_regulators), 482 + .regulators = mx35_3ds_regulators, 483 + }, 484 + }; 485 + 486 + #define GPIO_PMIC_INT IMX_GPIO_NR(2, 0) 487 + 488 + static struct i2c_board_info mx35_3ds_i2c_mc13892 = { 489 + 490 + I2C_BOARD_INFO("mc13892", 0x08), 491 + .platform_data = &mx35_3ds_mc13892_data, 492 + .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT), 493 + }; 494 + 495 + static void __init imx35_3ds_init_mc13892(void) 496 + { 497 + int ret = gpio_request_one(GPIO_PMIC_INT, GPIOF_DIR_IN, "pmic irq"); 498 + 499 + if (ret) { 500 + pr_err("failed to get pmic irq: %d\n", ret); 501 + return; 502 + } 503 + 504 + i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1); 505 + } 323 506 324 507 static int mx35_3ds_otg_init(struct platform_device *pdev) 325 508 { ··· 603 412 imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata); 604 413 mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev; 605 414 platform_device_register(&mx35_3ds_lcd); 415 + 416 + imx35_3ds_init_mc13892(); 606 417 } 607 418 608 419 static void __init mx35pdk_timer_init(void)
+22
arch/arm/mach-kirkwood/Kconfig
··· 58 58 Say 'Y' here if you want your kernel to support the 59 59 Marvell DreamPlug (Flattened Device Tree). 60 60 61 + config MACH_ICONNECT_DT 62 + bool "Iomega Iconnect (Flattened Device Tree)" 63 + select ARCH_KIRKWOOD_DT 64 + help 65 + Say 'Y' here to enable Iomega Iconnect support. 66 + 67 + config MACH_DLINK_KIRKWOOD_DT 68 + bool "D-Link Kirkwood-based NAS (Flattened Device Tree)" 69 + select ARCH_KIRKWOOD_DT 70 + help 71 + Say 'Y' here if you want your kernel to support the 72 + Kirkwood-based D-Link NASes such as DNS-320 & DNS-325, 73 + using Flattened Device Tree. 74 + 75 + config MACH_IB62X0_DT 76 + bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)" 77 + select ARCH_KIRKWOOD_DT 78 + help 79 + Say 'Y' here if you want your kernel to support the 80 + RaidSonic IB-NAS6210 & IB-NAS6220 devices, using 81 + Flattened Device Tree. 82 + 61 83 config MACH_TS219 62 84 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 63 85 help
+3
arch/arm/mach-kirkwood/Makefile
··· 22 22 obj-$(CONFIG_CPU_IDLE) += cpuidle.o 23 23 obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 24 24 obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o 25 + obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o 26 + obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o 27 + obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o
+4
arch/arm/mach-kirkwood/Makefile.boot
··· 3 3 initrd_phys-y := 0x00800000 4 4 5 5 dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb 6 + dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb 7 + dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb 8 + dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb 9 + dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
+275
arch/arm/mach-kirkwood/board-dnskw.c
··· 1 + /* 2 + * Copyright 2012 (C), Jamie Lentin <jm@lentin.co.uk> 3 + * 4 + * arch/arm/mach-kirkwood/board-dnskw.c 5 + * 6 + * D-link DNS-320 & DNS-325 NAS Init for drivers not converted to 7 + * flattened device tree yet. 8 + * 9 + * This file is licensed under the terms of the GNU General Public 10 + * License version 2. This program is licensed "as is" without any 11 + * warranty of any kind, whether express or implied. 12 + */ 13 + 14 + #include <linux/kernel.h> 15 + #include <linux/init.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/i2c.h> 18 + #include <linux/ata_platform.h> 19 + #include <linux/mv643xx_eth.h> 20 + #include <linux/of.h> 21 + #include <linux/gpio.h> 22 + #include <linux/input.h> 23 + #include <linux/gpio_keys.h> 24 + #include <linux/gpio-fan.h> 25 + #include <linux/leds.h> 26 + #include <asm/mach-types.h> 27 + #include <asm/mach/arch.h> 28 + #include <asm/mach/map.h> 29 + #include <mach/kirkwood.h> 30 + #include <mach/bridge-regs.h> 31 + #include "common.h" 32 + #include "mpp.h" 33 + 34 + static struct mv643xx_eth_platform_data dnskw_ge00_data = { 35 + .phy_addr = MV643XX_ETH_PHY_ADDR(8), 36 + }; 37 + 38 + static struct mv_sata_platform_data dnskw_sata_data = { 39 + .n_ports = 2, 40 + }; 41 + 42 + static unsigned int dnskw_mpp_config[] __initdata = { 43 + MPP13_UART1_TXD, /* Custom ... */ 44 + MPP14_UART1_RXD, /* ... Controller (DNS-320 only) */ 45 + MPP20_SATA1_ACTn, /* LED: White Right HDD */ 46 + MPP21_SATA0_ACTn, /* LED: White Left HDD */ 47 + MPP24_GPIO, 48 + MPP25_GPIO, 49 + MPP26_GPIO, /* LED: Power */ 50 + MPP27_GPIO, /* LED: Red Right HDD */ 51 + MPP28_GPIO, /* LED: Red Left HDD */ 52 + MPP29_GPIO, /* LED: Red USB (DNS-325 only) */ 53 + MPP30_GPIO, 54 + MPP31_GPIO, 55 + MPP32_GPIO, 56 + MPP33_GPO, 57 + MPP34_GPIO, /* Button: Front power */ 58 + MPP35_GPIO, /* LED: Red USB (DNS-320 only) */ 59 + MPP36_GPIO, /* Power: Turn off board */ 60 + MPP37_GPIO, /* Power: Turn back on after power failure */ 61 + MPP38_GPIO, 62 + MPP39_GPIO, /* Power: SATA0 */ 63 + MPP40_GPIO, /* Power: SATA1 */ 64 + MPP41_GPIO, /* SATA0 present */ 65 + MPP42_GPIO, /* SATA1 present */ 66 + MPP43_GPIO, /* LED: White USB */ 67 + MPP44_GPIO, /* Fan: Tachometer Pin */ 68 + MPP45_GPIO, /* Fan: high speed */ 69 + MPP46_GPIO, /* Fan: low speed */ 70 + MPP47_GPIO, /* Button: Back unmount */ 71 + MPP48_GPIO, /* Button: Back reset */ 72 + MPP49_GPIO, /* Temp Alarm (DNS-325) Pin of U5 (DNS-320) */ 73 + 0 74 + }; 75 + 76 + static struct gpio_led dns325_led_pins[] = { 77 + { 78 + .name = "dns325:white:power", 79 + .gpio = 26, 80 + .active_low = 1, 81 + .default_trigger = "default-on", 82 + }, 83 + { 84 + .name = "dns325:white:usb", 85 + .gpio = 43, 86 + .active_low = 1, 87 + }, 88 + { 89 + .name = "dns325:red:l_hdd", 90 + .gpio = 28, 91 + .active_low = 1, 92 + }, 93 + { 94 + .name = "dns325:red:r_hdd", 95 + .gpio = 27, 96 + .active_low = 1, 97 + }, 98 + { 99 + .name = "dns325:red:usb", 100 + .gpio = 29, 101 + .active_low = 1, 102 + }, 103 + }; 104 + 105 + static struct gpio_led_platform_data dns325_led_data = { 106 + .num_leds = ARRAY_SIZE(dns325_led_pins), 107 + .leds = dns325_led_pins, 108 + }; 109 + 110 + static struct platform_device dns325_led_device = { 111 + .name = "leds-gpio", 112 + .id = -1, 113 + .dev = { 114 + .platform_data = &dns325_led_data, 115 + }, 116 + }; 117 + 118 + static struct gpio_led dns320_led_pins[] = { 119 + { 120 + .name = "dns320:blue:power", 121 + .gpio = 26, 122 + .active_low = 1, 123 + .default_trigger = "default-on", 124 + }, 125 + { 126 + .name = "dns320:blue:usb", 127 + .gpio = 43, 128 + .active_low = 1, 129 + }, 130 + { 131 + .name = "dns320:orange:l_hdd", 132 + .gpio = 28, 133 + .active_low = 1, 134 + }, 135 + { 136 + .name = "dns320:orange:r_hdd", 137 + .gpio = 27, 138 + .active_low = 1, 139 + }, 140 + { 141 + .name = "dns320:orange:usb", 142 + .gpio = 35, 143 + .active_low = 1, 144 + }, 145 + }; 146 + 147 + static struct gpio_led_platform_data dns320_led_data = { 148 + .num_leds = ARRAY_SIZE(dns320_led_pins), 149 + .leds = dns320_led_pins, 150 + }; 151 + 152 + static struct platform_device dns320_led_device = { 153 + .name = "leds-gpio", 154 + .id = -1, 155 + .dev = { 156 + .platform_data = &dns320_led_data, 157 + }, 158 + }; 159 + 160 + static struct i2c_board_info dns325_i2c_board_info[] __initdata = { 161 + { 162 + I2C_BOARD_INFO("lm75", 0x48), 163 + }, 164 + /* Something at 0x0c also */ 165 + }; 166 + 167 + static struct gpio_keys_button dnskw_button_pins[] = { 168 + { 169 + .code = KEY_POWER, 170 + .gpio = 34, 171 + .desc = "Power button", 172 + .active_low = 1, 173 + }, 174 + { 175 + .code = KEY_EJECTCD, 176 + .gpio = 47, 177 + .desc = "USB unmount button", 178 + .active_low = 1, 179 + }, 180 + { 181 + .code = KEY_RESTART, 182 + .gpio = 48, 183 + .desc = "Reset button", 184 + .active_low = 1, 185 + }, 186 + }; 187 + 188 + static struct gpio_keys_platform_data dnskw_button_data = { 189 + .buttons = dnskw_button_pins, 190 + .nbuttons = ARRAY_SIZE(dnskw_button_pins), 191 + }; 192 + 193 + static struct platform_device dnskw_button_device = { 194 + .name = "gpio-keys", 195 + .id = -1, 196 + .num_resources = 0, 197 + .dev = { 198 + .platform_data = &dnskw_button_data, 199 + } 200 + }; 201 + 202 + /* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */ 203 + static struct gpio_fan_speed dnskw_fan_speed[] = { 204 + { 0, 0 }, 205 + { 3000, 1 }, 206 + { 6000, 2 }, 207 + }; 208 + static unsigned dnskw_fan_pins[] = {46, 45}; 209 + 210 + static struct gpio_fan_platform_data dnskw_fan_data = { 211 + .num_ctrl = ARRAY_SIZE(dnskw_fan_pins), 212 + .ctrl = dnskw_fan_pins, 213 + .num_speed = ARRAY_SIZE(dnskw_fan_speed), 214 + .speed = dnskw_fan_speed, 215 + }; 216 + 217 + static struct platform_device dnskw_fan_device = { 218 + .name = "gpio-fan", 219 + .id = -1, 220 + .dev = { 221 + .platform_data = &dnskw_fan_data, 222 + }, 223 + }; 224 + 225 + static void dnskw_power_off(void) 226 + { 227 + gpio_set_value(36, 1); 228 + } 229 + 230 + /* Register any GPIO for output and set the value */ 231 + static void __init dnskw_gpio_register(unsigned gpio, char *name, int def) 232 + { 233 + if (gpio_request(gpio, name) == 0 && 234 + gpio_direction_output(gpio, 0) == 0) { 235 + gpio_set_value(gpio, def); 236 + if (gpio_export(gpio, 0) != 0) 237 + pr_err("dnskw: Failed to export GPIO %s\n", name); 238 + } else 239 + pr_err("dnskw: Failed to register %s\n", name); 240 + } 241 + 242 + void __init dnskw_init(void) 243 + { 244 + kirkwood_mpp_conf(dnskw_mpp_config); 245 + 246 + kirkwood_ehci_init(); 247 + kirkwood_ge00_init(&dnskw_ge00_data); 248 + kirkwood_sata_init(&dnskw_sata_data); 249 + kirkwood_i2c_init(); 250 + 251 + platform_device_register(&dnskw_button_device); 252 + platform_device_register(&dnskw_fan_device); 253 + 254 + if (of_machine_is_compatible("dlink,dns-325")) { 255 + i2c_register_board_info(0, dns325_i2c_board_info, 256 + ARRAY_SIZE(dns325_i2c_board_info)); 257 + platform_device_register(&dns325_led_device); 258 + 259 + } else if (of_machine_is_compatible("dlink,dns-320")) 260 + platform_device_register(&dns320_led_device); 261 + 262 + /* Register power-off GPIO. */ 263 + if (gpio_request(36, "dnskw:power:off") == 0 264 + && gpio_direction_output(36, 0) == 0) 265 + pm_power_off = dnskw_power_off; 266 + else 267 + pr_err("dnskw: failed to configure power-off GPIO\n"); 268 + 269 + /* Ensure power is supplied to both HDDs */ 270 + dnskw_gpio_register(39, "dnskw:power:sata0", 1); 271 + dnskw_gpio_register(40, "dnskw:power:sata1", 1); 272 + 273 + /* Set NAS to turn back on after a power failure */ 274 + dnskw_gpio_register(37, "dnskw:power:recover", 1); 275 + }
+13
arch/arm/mach-kirkwood/board-dt.c
··· 56 56 if (of_machine_is_compatible("globalscale,dreamplug")) 57 57 dreamplug_init(); 58 58 59 + if (of_machine_is_compatible("dlink,dns-kirkwood")) 60 + dnskw_init(); 61 + 62 + if (of_machine_is_compatible("iom,iconnect")) 63 + iconnect_init(); 64 + 65 + if (of_machine_is_compatible("raidsonic,ib-nas62x0")) 66 + ib62x0_init(); 67 + 59 68 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL); 60 69 } 61 70 62 71 static const char *kirkwood_dt_board_compat[] = { 63 72 "globalscale,dreamplug", 73 + "dlink,dns-320", 74 + "dlink,dns-325", 75 + "iom,iconnect", 76 + "raidsonic,ib-nas62x0", 64 77 NULL 65 78 }; 66 79
+143
arch/arm/mach-kirkwood/board-ib62x0.c
··· 1 + /* 2 + * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com> 3 + * 4 + * arch/arm/mach-kirkwood/board-ib62x0.c 5 + * 6 + * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 init for drivers not 7 + * converted to flattened device tree yet. 8 + * 9 + * This file is licensed under the terms of the GNU General Public 10 + * License version 2. This program is licensed "as is" without any 11 + * warranty of any kind, whether express or implied. 12 + */ 13 + 14 + #include <linux/kernel.h> 15 + #include <linux/init.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/mtd/partitions.h> 18 + #include <linux/ata_platform.h> 19 + #include <linux/mv643xx_eth.h> 20 + #include <linux/gpio.h> 21 + #include <linux/gpio_keys.h> 22 + #include <linux/input.h> 23 + #include <linux/leds.h> 24 + #include <asm/mach-types.h> 25 + #include <asm/mach/arch.h> 26 + #include <mach/kirkwood.h> 27 + #include "common.h" 28 + #include "mpp.h" 29 + 30 + #define IB62X0_GPIO_POWER_OFF 24 31 + 32 + static struct mv643xx_eth_platform_data ib62x0_ge00_data = { 33 + .phy_addr = MV643XX_ETH_PHY_ADDR(8), 34 + }; 35 + 36 + static struct mv_sata_platform_data ib62x0_sata_data = { 37 + .n_ports = 2, 38 + }; 39 + 40 + static unsigned int ib62x0_mpp_config[] __initdata = { 41 + MPP0_NF_IO2, 42 + MPP1_NF_IO3, 43 + MPP2_NF_IO4, 44 + MPP3_NF_IO5, 45 + MPP4_NF_IO6, 46 + MPP5_NF_IO7, 47 + MPP18_NF_IO0, 48 + MPP19_NF_IO1, 49 + MPP22_GPIO, /* OS LED red */ 50 + MPP24_GPIO, /* Power off device */ 51 + MPP25_GPIO, /* OS LED green */ 52 + MPP27_GPIO, /* USB transfer LED */ 53 + MPP28_GPIO, /* Reset button */ 54 + MPP29_GPIO, /* USB Copy button */ 55 + 0 56 + }; 57 + 58 + static struct gpio_led ib62x0_led_pins[] = { 59 + { 60 + .name = "ib62x0:green:os", 61 + .default_trigger = "default-on", 62 + .gpio = 25, 63 + .active_low = 0, 64 + }, 65 + { 66 + .name = "ib62x0:red:os", 67 + .default_trigger = "none", 68 + .gpio = 22, 69 + .active_low = 0, 70 + }, 71 + { 72 + .name = "ib62x0:red:usb_copy", 73 + .default_trigger = "none", 74 + .gpio = 27, 75 + .active_low = 0, 76 + }, 77 + }; 78 + 79 + static struct gpio_led_platform_data ib62x0_led_data = { 80 + .leds = ib62x0_led_pins, 81 + .num_leds = ARRAY_SIZE(ib62x0_led_pins), 82 + }; 83 + 84 + static struct platform_device ib62x0_led_device = { 85 + .name = "leds-gpio", 86 + .id = -1, 87 + .dev = { 88 + .platform_data = &ib62x0_led_data, 89 + } 90 + }; 91 + 92 + static struct gpio_keys_button ib62x0_button_pins[] = { 93 + { 94 + .code = KEY_COPY, 95 + .gpio = 29, 96 + .desc = "USB Copy", 97 + .active_low = 1, 98 + }, 99 + { 100 + .code = KEY_RESTART, 101 + .gpio = 28, 102 + .desc = "Reset", 103 + .active_low = 1, 104 + }, 105 + }; 106 + 107 + static struct gpio_keys_platform_data ib62x0_button_data = { 108 + .buttons = ib62x0_button_pins, 109 + .nbuttons = ARRAY_SIZE(ib62x0_button_pins), 110 + }; 111 + 112 + static struct platform_device ib62x0_button_device = { 113 + .name = "gpio-keys", 114 + .id = -1, 115 + .num_resources = 0, 116 + .dev = { 117 + .platform_data = &ib62x0_button_data, 118 + } 119 + }; 120 + 121 + static void ib62x0_power_off(void) 122 + { 123 + gpio_set_value(IB62X0_GPIO_POWER_OFF, 1); 124 + } 125 + 126 + void __init ib62x0_init(void) 127 + { 128 + /* 129 + * Basic setup. Needs to be called early. 130 + */ 131 + kirkwood_mpp_conf(ib62x0_mpp_config); 132 + 133 + kirkwood_ehci_init(); 134 + kirkwood_ge00_init(&ib62x0_ge00_data); 135 + kirkwood_sata_init(&ib62x0_sata_data); 136 + platform_device_register(&ib62x0_led_device); 137 + platform_device_register(&ib62x0_button_device); 138 + if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 && 139 + gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0) 140 + pm_power_off = ib62x0_power_off; 141 + else 142 + pr_err("board-ib62x0: failed to configure power-off GPIO\n"); 143 + }
+165
arch/arm/mach-kirkwood/board-iconnect.c
··· 1 + /* 2 + * arch/arm/mach-kirkwood/board-iconnect.c 3 + * 4 + * Iomega i-connect Board Setup 5 + * 6 + * This file is licensed under the terms of the GNU General Public 7 + * License version 2. This program is licensed "as is" without any 8 + * warranty of any kind, whether express or implied. 9 + */ 10 + 11 + #include <linux/kernel.h> 12 + #include <linux/init.h> 13 + #include <linux/platform_device.h> 14 + #include <linux/of.h> 15 + #include <linux/of_address.h> 16 + #include <linux/of_fdt.h> 17 + #include <linux/of_irq.h> 18 + #include <linux/of_platform.h> 19 + #include <linux/mtd/partitions.h> 20 + #include <linux/mv643xx_eth.h> 21 + #include <linux/gpio.h> 22 + #include <linux/leds.h> 23 + #include <linux/spi/flash.h> 24 + #include <linux/spi/spi.h> 25 + #include <linux/spi/orion_spi.h> 26 + #include <linux/i2c.h> 27 + #include <linux/input.h> 28 + #include <linux/gpio_keys.h> 29 + #include <asm/mach/arch.h> 30 + #include <mach/kirkwood.h> 31 + #include "common.h" 32 + #include "mpp.h" 33 + 34 + static struct mv643xx_eth_platform_data iconnect_ge00_data = { 35 + .phy_addr = MV643XX_ETH_PHY_ADDR(11), 36 + }; 37 + 38 + static struct gpio_led iconnect_led_pins[] = { 39 + { 40 + .name = "led_level", 41 + .gpio = 41, 42 + .default_trigger = "default-on", 43 + }, { 44 + .name = "power:blue", 45 + .gpio = 42, 46 + .default_trigger = "timer", 47 + }, { 48 + .name = "power:red", 49 + .gpio = 43, 50 + }, { 51 + .name = "usb1:blue", 52 + .gpio = 44, 53 + }, { 54 + .name = "usb2:blue", 55 + .gpio = 45, 56 + }, { 57 + .name = "usb3:blue", 58 + .gpio = 46, 59 + }, { 60 + .name = "usb4:blue", 61 + .gpio = 47, 62 + }, { 63 + .name = "otb:blue", 64 + .gpio = 48, 65 + }, 66 + }; 67 + 68 + static struct gpio_led_platform_data iconnect_led_data = { 69 + .leds = iconnect_led_pins, 70 + .num_leds = ARRAY_SIZE(iconnect_led_pins), 71 + .gpio_blink_set = orion_gpio_led_blink_set, 72 + }; 73 + 74 + static struct platform_device iconnect_leds = { 75 + .name = "leds-gpio", 76 + .id = -1, 77 + .dev = { 78 + .platform_data = &iconnect_led_data, 79 + } 80 + }; 81 + 82 + static unsigned int iconnect_mpp_config[] __initdata = { 83 + MPP12_GPIO, 84 + MPP35_GPIO, 85 + MPP41_GPIO, 86 + MPP42_GPIO, 87 + MPP43_GPIO, 88 + MPP44_GPIO, 89 + MPP45_GPIO, 90 + MPP46_GPIO, 91 + MPP47_GPIO, 92 + MPP48_GPIO, 93 + 0 94 + }; 95 + 96 + static struct i2c_board_info __initdata iconnect_board_info[] = { 97 + { 98 + I2C_BOARD_INFO("lm63", 0x4c), 99 + }, 100 + }; 101 + 102 + static struct mtd_partition iconnect_nand_parts[] = { 103 + { 104 + .name = "flash", 105 + .offset = 0, 106 + .size = MTDPART_SIZ_FULL, 107 + }, 108 + }; 109 + 110 + /* yikes... theses are the original input buttons */ 111 + /* but I'm not convinced by the sw event choices */ 112 + static struct gpio_keys_button iconnect_buttons[] = { 113 + { 114 + .type = EV_SW, 115 + .code = SW_LID, 116 + .gpio = 12, 117 + .desc = "Reset Button", 118 + .active_low = 1, 119 + .debounce_interval = 100, 120 + }, { 121 + .type = EV_SW, 122 + .code = SW_TABLET_MODE, 123 + .gpio = 35, 124 + .desc = "OTB Button", 125 + .active_low = 1, 126 + .debounce_interval = 100, 127 + }, 128 + }; 129 + 130 + static struct gpio_keys_platform_data iconnect_button_data = { 131 + .buttons = iconnect_buttons, 132 + .nbuttons = ARRAY_SIZE(iconnect_buttons), 133 + }; 134 + 135 + static struct platform_device iconnect_button_device = { 136 + .name = "gpio-keys", 137 + .id = -1, 138 + .num_resources = 0, 139 + .dev = { 140 + .platform_data = &iconnect_button_data, 141 + }, 142 + }; 143 + 144 + void __init iconnect_init(void) 145 + { 146 + kirkwood_mpp_conf(iconnect_mpp_config); 147 + kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25); 148 + kirkwood_i2c_init(); 149 + i2c_register_board_info(0, iconnect_board_info, 150 + ARRAY_SIZE(iconnect_board_info)); 151 + 152 + kirkwood_ehci_init(); 153 + kirkwood_ge00_init(&iconnect_ge00_data); 154 + 155 + platform_device_register(&iconnect_button_device); 156 + platform_device_register(&iconnect_leds); 157 + } 158 + 159 + static int __init iconnect_pci_init(void) 160 + { 161 + if (of_machine_is_compatible("iom,iconnect")) 162 + kirkwood_pcie_init(KW_PCIE0); 163 + return 0; 164 + } 165 + subsys_initcall(iconnect_pci_init);
+12
arch/arm/mach-kirkwood/common.c
··· 15 15 #include <linux/ata_platform.h> 16 16 #include <linux/mtd/nand.h> 17 17 #include <linux/dma-mapping.h> 18 + #include <linux/of.h> 18 19 #include <net/dsa.h> 19 20 #include <asm/page.h> 20 21 #include <asm/timex.h> ··· 483 482 unsigned int curr = readl(CLOCK_GATING_CTRL); 484 483 u32 dev, rev; 485 484 485 + #ifdef CONFIG_OF 486 + struct device_node *np; 487 + #endif 486 488 kirkwood_pcie_id(&dev, &rev); 487 489 printk(KERN_DEBUG "Gating clock of unused units\n"); 488 490 printk(KERN_DEBUG "before: 0x%08x\n", curr); 489 491 490 492 /* Make sure those units are accessible */ 491 493 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL); 494 + 495 + #ifdef CONFIG_OF 496 + np = of_find_compatible_node(NULL, NULL, "mrvl,orion-nand"); 497 + if (np && of_device_is_available(np)) { 498 + kirkwood_clk_ctrl |= CGC_RUNIT; 499 + of_node_put(np); 500 + } 501 + #endif 492 502 493 503 /* For SATA: first shutdown the phy */ 494 504 if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
+18
arch/arm/mach-kirkwood/common.h
··· 58 58 static inline void dreamplug_init(void) {}; 59 59 #endif 60 60 61 + #ifdef CONFIG_MACH_DLINK_KIRKWOOD_DT 62 + void dnskw_init(void); 63 + #else 64 + static inline void dnskw_init(void) {}; 65 + #endif 66 + 67 + #ifdef CONFIG_MACH_ICONNECT_DT 68 + void iconnect_init(void); 69 + #else 70 + static inline void iconnect_init(void) {}; 71 + #endif 72 + 73 + #ifdef CONFIG_MACH_IB62X0_DT 74 + void ib62x0_init(void); 75 + #else 76 + static inline void ib62x0_init(void) {}; 77 + #endif 78 + 61 79 /* early init functions not converted to fdt yet */ 62 80 char *kirkwood_id(void); 63 81 void kirkwood_l2_init(void);
+7
arch/arm/mach-mmp/Kconfig
··· 122 122 select CPU_PJ4 123 123 help 124 124 Select code specific to MMP2. MMP2 is ARMv7 compatible. 125 + 126 + config USB_EHCI_MV_U2O 127 + bool "EHCI support for PXA USB OTG controller" 128 + depends on USB_EHCI_MV 129 + help 130 + Enables support for OTG controller which can be switched to host mode. 131 + 125 132 endif
+20
arch/arm/mach-mmp/aspenite.c
··· 17 17 #include <linux/mtd/partitions.h> 18 18 #include <linux/mtd/nand.h> 19 19 #include <linux/interrupt.h> 20 + #include <linux/platform_data/mv_usb.h> 20 21 21 22 #include <asm/mach-types.h> 22 23 #include <asm/mach/arch.h> ··· 222 221 .debounce_interval = 30, 223 222 }; 224 223 224 + #if defined(CONFIG_USB_EHCI_MV) 225 + static char *pxa168_sph_clock_name[] = { 226 + [0] = "PXA168-USBCLK", 227 + }; 228 + 229 + static struct mv_usb_platform_data pxa168_sph_pdata = { 230 + .clknum = 1, 231 + .clkname = pxa168_sph_clock_name, 232 + .mode = MV_USB_MODE_HOST, 233 + .phy_init = pxa_usb_phy_init, 234 + .phy_deinit = pxa_usb_phy_deinit, 235 + .set_vbus = NULL, 236 + }; 237 + #endif 238 + 225 239 static void __init common_init(void) 226 240 { 227 241 mfp_config(ARRAY_AND_SIZE(common_pin_config)); ··· 252 236 253 237 /* off-chip devices */ 254 238 platform_device_register(&smc91x_device); 239 + 240 + #if defined(CONFIG_USB_EHCI_MV) 241 + pxa168_add_usb_host(&pxa168_sph_pdata); 242 + #endif 255 243 } 256 244 257 245 MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
+282
arch/arm/mach-mmp/devices.c
··· 9 9 #include <linux/init.h> 10 10 #include <linux/platform_device.h> 11 11 #include <linux/dma-mapping.h> 12 + #include <linux/delay.h> 12 13 13 14 #include <asm/irq.h> 15 + #include <mach/irqs.h> 14 16 #include <mach/devices.h> 17 + #include <mach/cputype.h> 18 + #include <mach/regs-usb.h> 15 19 16 20 int __init pxa_register_device(struct pxa_device_desc *desc, 17 21 void *data, size_t size) ··· 71 67 72 68 return platform_device_add(pdev); 73 69 } 70 + 71 + #if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET) 72 + 73 + /***************************************************************************** 74 + * The registers read/write routines 75 + *****************************************************************************/ 76 + 77 + static unsigned int u2o_get(void __iomem *base, unsigned int offset) 78 + { 79 + return readl_relaxed(base + offset); 80 + } 81 + 82 + static void u2o_set(void __iomem *base, unsigned int offset, 83 + unsigned int value) 84 + { 85 + u32 reg; 86 + 87 + reg = readl_relaxed(base + offset); 88 + reg |= value; 89 + writel_relaxed(reg, base + offset); 90 + readl_relaxed(base + offset); 91 + } 92 + 93 + static void u2o_clear(void __iomem *base, unsigned int offset, 94 + unsigned int value) 95 + { 96 + u32 reg; 97 + 98 + reg = readl_relaxed(base + offset); 99 + reg &= ~value; 100 + writel_relaxed(reg, base + offset); 101 + readl_relaxed(base + offset); 102 + } 103 + 104 + static void u2o_write(void __iomem *base, unsigned int offset, 105 + unsigned int value) 106 + { 107 + writel_relaxed(value, base + offset); 108 + readl_relaxed(base + offset); 109 + } 110 + 111 + #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV) 112 + 113 + #if defined(CONFIG_CPU_PXA910) || defined(CONFIG_CPU_PXA168) 114 + 115 + static DEFINE_MUTEX(phy_lock); 116 + static int phy_init_cnt; 117 + 118 + static int usb_phy_init_internal(void __iomem *base) 119 + { 120 + int loops; 121 + 122 + pr_info("Init usb phy!!!\n"); 123 + 124 + /* Initialize the USB PHY power */ 125 + if (cpu_is_pxa910()) { 126 + u2o_set(base, UTMI_CTRL, (1<<UTMI_CTRL_INPKT_DELAY_SOF_SHIFT) 127 + | (1<<UTMI_CTRL_PU_REF_SHIFT)); 128 + } 129 + 130 + u2o_set(base, UTMI_CTRL, 1<<UTMI_CTRL_PLL_PWR_UP_SHIFT); 131 + u2o_set(base, UTMI_CTRL, 1<<UTMI_CTRL_PWR_UP_SHIFT); 132 + 133 + /* UTMI_PLL settings */ 134 + u2o_clear(base, UTMI_PLL, UTMI_PLL_PLLVDD18_MASK 135 + | UTMI_PLL_PLLVDD12_MASK | UTMI_PLL_PLLCALI12_MASK 136 + | UTMI_PLL_FBDIV_MASK | UTMI_PLL_REFDIV_MASK 137 + | UTMI_PLL_ICP_MASK | UTMI_PLL_KVCO_MASK); 138 + 139 + u2o_set(base, UTMI_PLL, 0xee<<UTMI_PLL_FBDIV_SHIFT 140 + | 0xb<<UTMI_PLL_REFDIV_SHIFT | 3<<UTMI_PLL_PLLVDD18_SHIFT 141 + | 3<<UTMI_PLL_PLLVDD12_SHIFT | 3<<UTMI_PLL_PLLCALI12_SHIFT 142 + | 1<<UTMI_PLL_ICP_SHIFT | 3<<UTMI_PLL_KVCO_SHIFT); 143 + 144 + /* UTMI_TX */ 145 + u2o_clear(base, UTMI_TX, UTMI_TX_REG_EXT_FS_RCAL_EN_MASK 146 + | UTMI_TX_TXVDD12_MASK | UTMI_TX_CK60_PHSEL_MASK 147 + | UTMI_TX_IMPCAL_VTH_MASK | UTMI_TX_REG_EXT_FS_RCAL_MASK 148 + | UTMI_TX_AMP_MASK); 149 + u2o_set(base, UTMI_TX, 3<<UTMI_TX_TXVDD12_SHIFT 150 + | 4<<UTMI_TX_CK60_PHSEL_SHIFT | 4<<UTMI_TX_IMPCAL_VTH_SHIFT 151 + | 8<<UTMI_TX_REG_EXT_FS_RCAL_SHIFT | 3<<UTMI_TX_AMP_SHIFT); 152 + 153 + /* UTMI_RX */ 154 + u2o_clear(base, UTMI_RX, UTMI_RX_SQ_THRESH_MASK 155 + | UTMI_REG_SQ_LENGTH_MASK); 156 + u2o_set(base, UTMI_RX, 7<<UTMI_RX_SQ_THRESH_SHIFT 157 + | 2<<UTMI_REG_SQ_LENGTH_SHIFT); 158 + 159 + /* UTMI_IVREF */ 160 + if (cpu_is_pxa168()) 161 + /* fixing Microsoft Altair board interface with NEC hub issue - 162 + * Set UTMI_IVREF from 0x4a3 to 0x4bf */ 163 + u2o_write(base, UTMI_IVREF, 0x4bf); 164 + 165 + /* toggle VCOCAL_START bit of UTMI_PLL */ 166 + udelay(200); 167 + u2o_set(base, UTMI_PLL, VCOCAL_START); 168 + udelay(40); 169 + u2o_clear(base, UTMI_PLL, VCOCAL_START); 170 + 171 + /* toggle REG_RCAL_START bit of UTMI_TX */ 172 + udelay(400); 173 + u2o_set(base, UTMI_TX, REG_RCAL_START); 174 + udelay(40); 175 + u2o_clear(base, UTMI_TX, REG_RCAL_START); 176 + udelay(400); 177 + 178 + /* Make sure PHY PLL is ready */ 179 + loops = 0; 180 + while ((u2o_get(base, UTMI_PLL) & PLL_READY) == 0) { 181 + mdelay(1); 182 + loops++; 183 + if (loops > 100) { 184 + printk(KERN_WARNING "calibrate timeout, UTMI_PLL %x\n", 185 + u2o_get(base, UTMI_PLL)); 186 + break; 187 + } 188 + } 189 + 190 + if (cpu_is_pxa168()) { 191 + u2o_set(base, UTMI_RESERVE, 1 << 5); 192 + /* Turn on UTMI PHY OTG extension */ 193 + u2o_write(base, UTMI_OTG_ADDON, 1); 194 + } 195 + 196 + return 0; 197 + } 198 + 199 + static int usb_phy_deinit_internal(void __iomem *base) 200 + { 201 + pr_info("Deinit usb phy!!!\n"); 202 + 203 + if (cpu_is_pxa168()) 204 + u2o_clear(base, UTMI_OTG_ADDON, UTMI_OTG_ADDON_OTG_ON); 205 + 206 + u2o_clear(base, UTMI_CTRL, UTMI_CTRL_RXBUF_PDWN); 207 + u2o_clear(base, UTMI_CTRL, UTMI_CTRL_TXBUF_PDWN); 208 + u2o_clear(base, UTMI_CTRL, UTMI_CTRL_USB_CLK_EN); 209 + u2o_clear(base, UTMI_CTRL, 1<<UTMI_CTRL_PWR_UP_SHIFT); 210 + u2o_clear(base, UTMI_CTRL, 1<<UTMI_CTRL_PLL_PWR_UP_SHIFT); 211 + 212 + return 0; 213 + } 214 + 215 + int pxa_usb_phy_init(void __iomem *phy_reg) 216 + { 217 + mutex_lock(&phy_lock); 218 + if (phy_init_cnt++ == 0) 219 + usb_phy_init_internal(phy_reg); 220 + mutex_unlock(&phy_lock); 221 + return 0; 222 + } 223 + 224 + void pxa_usb_phy_deinit(void __iomem *phy_reg) 225 + { 226 + WARN_ON(phy_init_cnt == 0); 227 + 228 + mutex_lock(&phy_lock); 229 + if (--phy_init_cnt == 0) 230 + usb_phy_deinit_internal(phy_reg); 231 + mutex_unlock(&phy_lock); 232 + } 233 + #endif 234 + #endif 235 + #endif 236 + 237 + #ifdef CONFIG_USB_SUPPORT 238 + static u64 usb_dma_mask = ~(u32)0; 239 + 240 + #ifdef CONFIG_USB_MV_UDC 241 + struct resource pxa168_u2o_resources[] = { 242 + /* regbase */ 243 + [0] = { 244 + .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET, 245 + .end = PXA168_U2O_REGBASE + USB_REG_RANGE, 246 + .flags = IORESOURCE_MEM, 247 + .name = "capregs", 248 + }, 249 + /* phybase */ 250 + [1] = { 251 + .start = PXA168_U2O_PHYBASE, 252 + .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE, 253 + .flags = IORESOURCE_MEM, 254 + .name = "phyregs", 255 + }, 256 + [2] = { 257 + .start = IRQ_PXA168_USB1, 258 + .end = IRQ_PXA168_USB1, 259 + .flags = IORESOURCE_IRQ, 260 + }, 261 + }; 262 + 263 + struct platform_device pxa168_device_u2o = { 264 + .name = "mv-udc", 265 + .id = -1, 266 + .resource = pxa168_u2o_resources, 267 + .num_resources = ARRAY_SIZE(pxa168_u2o_resources), 268 + .dev = { 269 + .dma_mask = &usb_dma_mask, 270 + .coherent_dma_mask = 0xffffffff, 271 + } 272 + }; 273 + #endif /* CONFIG_USB_MV_UDC */ 274 + 275 + #ifdef CONFIG_USB_EHCI_MV_U2O 276 + struct resource pxa168_u2oehci_resources[] = { 277 + /* regbase */ 278 + [0] = { 279 + .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET, 280 + .end = PXA168_U2O_REGBASE + USB_REG_RANGE, 281 + .flags = IORESOURCE_MEM, 282 + .name = "capregs", 283 + }, 284 + /* phybase */ 285 + [1] = { 286 + .start = PXA168_U2O_PHYBASE, 287 + .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE, 288 + .flags = IORESOURCE_MEM, 289 + .name = "phyregs", 290 + }, 291 + [2] = { 292 + .start = IRQ_PXA168_USB1, 293 + .end = IRQ_PXA168_USB1, 294 + .flags = IORESOURCE_IRQ, 295 + }, 296 + }; 297 + 298 + struct platform_device pxa168_device_u2oehci = { 299 + .name = "pxa-u2oehci", 300 + .id = -1, 301 + .dev = { 302 + .dma_mask = &usb_dma_mask, 303 + .coherent_dma_mask = 0xffffffff, 304 + }, 305 + 306 + .num_resources = ARRAY_SIZE(pxa168_u2oehci_resources), 307 + .resource = pxa168_u2oehci_resources, 308 + }; 309 + #endif 310 + 311 + #if defined(CONFIG_USB_MV_OTG) 312 + struct resource pxa168_u2ootg_resources[] = { 313 + /* regbase */ 314 + [0] = { 315 + .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET, 316 + .end = PXA168_U2O_REGBASE + USB_REG_RANGE, 317 + .flags = IORESOURCE_MEM, 318 + .name = "capregs", 319 + }, 320 + /* phybase */ 321 + [1] = { 322 + .start = PXA168_U2O_PHYBASE, 323 + .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE, 324 + .flags = IORESOURCE_MEM, 325 + .name = "phyregs", 326 + }, 327 + [2] = { 328 + .start = IRQ_PXA168_USB1, 329 + .end = IRQ_PXA168_USB1, 330 + .flags = IORESOURCE_IRQ, 331 + }, 332 + }; 333 + 334 + struct platform_device pxa168_device_u2ootg = { 335 + .name = "mv-otg", 336 + .id = -1, 337 + .dev = { 338 + .dma_mask = &usb_dma_mask, 339 + .coherent_dma_mask = 0xffffffff, 340 + }, 341 + 342 + .num_resources = ARRAY_SIZE(pxa168_u2ootg_resources), 343 + .resource = pxa168_u2ootg_resources, 344 + }; 345 + #endif /* CONFIG_USB_MV_OTG */ 346 + 347 + #endif
+3
arch/arm/mach-mmp/include/mach/devices.h
··· 50 50 } 51 51 52 52 extern int pxa_register_device(struct pxa_device_desc *, void *, size_t); 53 + extern int pxa_usb_phy_init(void __iomem *phy_reg); 54 + extern void pxa_usb_phy_deinit(void __iomem *phy_reg); 55 + 53 56 #endif /* __MACH_DEVICE_H */
+3 -5
arch/arm/mach-mmp/include/mach/pxa168.h
··· 16 16 #include <plat/pxa27x_keypad.h> 17 17 #include <mach/cputype.h> 18 18 #include <linux/pxa168_eth.h> 19 + #include <linux/platform_data/mv_usb.h> 19 20 20 21 extern struct pxa_device_desc pxa168_device_uart1; 21 22 extern struct pxa_device_desc pxa168_device_uart2; ··· 37 36 extern struct pxa_device_desc pxa168_device_keypad; 38 37 extern struct pxa_device_desc pxa168_device_eth; 39 38 40 - struct pxa168_usb_pdata { 41 - /* If NULL, default phy init routine for PXA168 would be called */ 42 - int (*phy_init)(void __iomem *usb_phy_reg_base); 43 - }; 44 39 /* pdata can be NULL */ 45 - int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata); 40 + extern int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata); 41 + 46 42 47 43 extern struct platform_device pxa168_device_gpio; 48 44
+3
arch/arm/mach-mmp/include/mach/pxa910.h
··· 20 20 extern struct pxa_device_desc pxa910_device_pwm3; 21 21 extern struct pxa_device_desc pxa910_device_pwm4; 22 22 extern struct pxa_device_desc pxa910_device_nand; 23 + extern struct platform_device pxa168_device_u2o; 24 + extern struct platform_device pxa168_device_u2ootg; 25 + extern struct platform_device pxa168_device_u2oehci; 23 26 24 27 extern struct platform_device pxa910_device_gpio; 25 28 extern struct platform_device pxa910_device_rtc;
+253
arch/arm/mach-mmp/include/mach/regs-usb.h
··· 1 + /* 2 + * Copyright (C) 2011 Marvell International Ltd. All rights reserved. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 + * option) any later version. 8 + */ 9 + 10 + #ifndef __ASM_ARCH_REGS_USB_H 11 + #define __ASM_ARCH_REGS_USB_H 12 + 13 + #define PXA168_U2O_REGBASE (0xd4208000) 14 + #define PXA168_U2O_PHYBASE (0xd4207000) 15 + 16 + #define PXA168_U2H_REGBASE (0xd4209000) 17 + #define PXA168_U2H_PHYBASE (0xd4206000) 18 + 19 + #define MMP3_HSIC1_REGBASE (0xf0001000) 20 + #define MMP3_HSIC1_PHYBASE (0xf0001800) 21 + 22 + #define MMP3_HSIC2_REGBASE (0xf0002000) 23 + #define MMP3_HSIC2_PHYBASE (0xf0002800) 24 + 25 + #define MMP3_FSIC_REGBASE (0xf0003000) 26 + #define MMP3_FSIC_PHYBASE (0xf0003800) 27 + 28 + 29 + #define USB_REG_RANGE (0x1ff) 30 + #define USB_PHY_RANGE (0xff) 31 + 32 + /* registers */ 33 + #define U2x_CAPREGS_OFFSET 0x100 34 + 35 + /* phy regs */ 36 + #define UTMI_REVISION 0x0 37 + #define UTMI_CTRL 0x4 38 + #define UTMI_PLL 0x8 39 + #define UTMI_TX 0xc 40 + #define UTMI_RX 0x10 41 + #define UTMI_IVREF 0x14 42 + #define UTMI_T0 0x18 43 + #define UTMI_T1 0x1c 44 + #define UTMI_T2 0x20 45 + #define UTMI_T3 0x24 46 + #define UTMI_T4 0x28 47 + #define UTMI_T5 0x2c 48 + #define UTMI_RESERVE 0x30 49 + #define UTMI_USB_INT 0x34 50 + #define UTMI_DBG_CTL 0x38 51 + #define UTMI_OTG_ADDON 0x3c 52 + 53 + /* For UTMICTRL Register */ 54 + #define UTMI_CTRL_USB_CLK_EN (1 << 31) 55 + /* pxa168 */ 56 + #define UTMI_CTRL_SUSPEND_SET1 (1 << 30) 57 + #define UTMI_CTRL_SUSPEND_SET2 (1 << 29) 58 + #define UTMI_CTRL_RXBUF_PDWN (1 << 24) 59 + #define UTMI_CTRL_TXBUF_PDWN (1 << 11) 60 + 61 + #define UTMI_CTRL_INPKT_DELAY_SHIFT 30 62 + #define UTMI_CTRL_INPKT_DELAY_SOF_SHIFT 28 63 + #define UTMI_CTRL_PU_REF_SHIFT 20 64 + #define UTMI_CTRL_ARC_PULLDN_SHIFT 12 65 + #define UTMI_CTRL_PLL_PWR_UP_SHIFT 1 66 + #define UTMI_CTRL_PWR_UP_SHIFT 0 67 + 68 + /* For UTMI_PLL Register */ 69 + #define UTMI_PLL_PLLCALI12_SHIFT 29 70 + #define UTMI_PLL_PLLCALI12_MASK (0x3 << 29) 71 + 72 + #define UTMI_PLL_PLLVDD18_SHIFT 27 73 + #define UTMI_PLL_PLLVDD18_MASK (0x3 << 27) 74 + 75 + #define UTMI_PLL_PLLVDD12_SHIFT 25 76 + #define UTMI_PLL_PLLVDD12_MASK (0x3 << 25) 77 + 78 + #define UTMI_PLL_CLK_BLK_EN_SHIFT 24 79 + #define CLK_BLK_EN (0x1 << 24) 80 + #define PLL_READY (0x1 << 23) 81 + #define KVCO_EXT (0x1 << 22) 82 + #define VCOCAL_START (0x1 << 21) 83 + 84 + #define UTMI_PLL_KVCO_SHIFT 15 85 + #define UTMI_PLL_KVCO_MASK (0x7 << 15) 86 + 87 + #define UTMI_PLL_ICP_SHIFT 12 88 + #define UTMI_PLL_ICP_MASK (0x7 << 12) 89 + 90 + #define UTMI_PLL_FBDIV_SHIFT 4 91 + #define UTMI_PLL_FBDIV_MASK (0xFF << 4) 92 + 93 + #define UTMI_PLL_REFDIV_SHIFT 0 94 + #define UTMI_PLL_REFDIV_MASK (0xF << 0) 95 + 96 + /* For UTMI_TX Register */ 97 + #define UTMI_TX_REG_EXT_FS_RCAL_SHIFT 27 98 + #define UTMI_TX_REG_EXT_FS_RCAL_MASK (0xf << 27) 99 + 100 + #define UTMI_TX_REG_EXT_FS_RCAL_EN_SHIFT 26 101 + #define UTMI_TX_REG_EXT_FS_RCAL_EN_MASK (0x1 << 26) 102 + 103 + #define UTMI_TX_TXVDD12_SHIFT 22 104 + #define UTMI_TX_TXVDD12_MASK (0x3 << 22) 105 + 106 + #define UTMI_TX_CK60_PHSEL_SHIFT 17 107 + #define UTMI_TX_CK60_PHSEL_MASK (0xf << 17) 108 + 109 + #define UTMI_TX_IMPCAL_VTH_SHIFT 14 110 + #define UTMI_TX_IMPCAL_VTH_MASK (0x7 << 14) 111 + 112 + #define REG_RCAL_START (0x1 << 12) 113 + 114 + #define UTMI_TX_LOW_VDD_EN_SHIFT 11 115 + 116 + #define UTMI_TX_AMP_SHIFT 0 117 + #define UTMI_TX_AMP_MASK (0x7 << 0) 118 + 119 + /* For UTMI_RX Register */ 120 + #define UTMI_REG_SQ_LENGTH_SHIFT 15 121 + #define UTMI_REG_SQ_LENGTH_MASK (0x3 << 15) 122 + 123 + #define UTMI_RX_SQ_THRESH_SHIFT 4 124 + #define UTMI_RX_SQ_THRESH_MASK (0xf << 4) 125 + 126 + #define UTMI_OTG_ADDON_OTG_ON (1 << 0) 127 + 128 + /* For MMP3 USB Phy */ 129 + #define USB2_PLL_REG0 0x4 130 + #define USB2_PLL_REG1 0x8 131 + #define USB2_TX_REG0 0x10 132 + #define USB2_TX_REG1 0x14 133 + #define USB2_TX_REG2 0x18 134 + #define USB2_RX_REG0 0x20 135 + #define USB2_RX_REG1 0x24 136 + #define USB2_RX_REG2 0x28 137 + #define USB2_ANA_REG0 0x30 138 + #define USB2_ANA_REG1 0x34 139 + #define USB2_ANA_REG2 0x38 140 + #define USB2_DIG_REG0 0x3C 141 + #define USB2_DIG_REG1 0x40 142 + #define USB2_DIG_REG2 0x44 143 + #define USB2_DIG_REG3 0x48 144 + #define USB2_TEST_REG0 0x4C 145 + #define USB2_TEST_REG1 0x50 146 + #define USB2_TEST_REG2 0x54 147 + #define USB2_CHARGER_REG0 0x58 148 + #define USB2_OTG_REG0 0x5C 149 + #define USB2_PHY_MON0 0x60 150 + #define USB2_RESETVE_REG0 0x64 151 + #define USB2_ICID_REG0 0x78 152 + #define USB2_ICID_REG1 0x7C 153 + 154 + /* USB2_PLL_REG0 */ 155 + /* This is for Ax stepping */ 156 + #define USB2_PLL_FBDIV_SHIFT_MMP3 0 157 + #define USB2_PLL_FBDIV_MASK_MMP3 (0xFF << 0) 158 + 159 + #define USB2_PLL_REFDIV_SHIFT_MMP3 8 160 + #define USB2_PLL_REFDIV_MASK_MMP3 (0xF << 8) 161 + 162 + #define USB2_PLL_VDD12_SHIFT_MMP3 12 163 + #define USB2_PLL_VDD18_SHIFT_MMP3 14 164 + 165 + /* This is for B0 stepping */ 166 + #define USB2_PLL_FBDIV_SHIFT_MMP3_B0 0 167 + #define USB2_PLL_REFDIV_SHIFT_MMP3_B0 9 168 + #define USB2_PLL_VDD18_SHIFT_MMP3_B0 14 169 + #define USB2_PLL_FBDIV_MASK_MMP3_B0 0x01FF 170 + #define USB2_PLL_REFDIV_MASK_MMP3_B0 0x3E00 171 + 172 + #define USB2_PLL_CAL12_SHIFT_MMP3 0 173 + #define USB2_PLL_CALI12_MASK_MMP3 (0x3 << 0) 174 + 175 + #define USB2_PLL_VCOCAL_START_SHIFT_MMP3 2 176 + 177 + #define USB2_PLL_KVCO_SHIFT_MMP3 4 178 + #define USB2_PLL_KVCO_MASK_MMP3 (0x7<<4) 179 + 180 + #define USB2_PLL_ICP_SHIFT_MMP3 8 181 + #define USB2_PLL_ICP_MASK_MMP3 (0x7<<8) 182 + 183 + #define USB2_PLL_LOCK_BYPASS_SHIFT_MMP3 12 184 + 185 + #define USB2_PLL_PU_PLL_SHIFT_MMP3 13 186 + #define USB2_PLL_PU_PLL_MASK (0x1 << 13) 187 + 188 + #define USB2_PLL_READY_MASK_MMP3 (0x1 << 15) 189 + 190 + /* USB2_TX_REG0 */ 191 + #define USB2_TX_IMPCAL_VTH_SHIFT_MMP3 8 192 + #define USB2_TX_IMPCAL_VTH_MASK_MMP3 (0x7 << 8) 193 + 194 + #define USB2_TX_RCAL_START_SHIFT_MMP3 13 195 + 196 + /* USB2_TX_REG1 */ 197 + #define USB2_TX_CK60_PHSEL_SHIFT_MMP3 0 198 + #define USB2_TX_CK60_PHSEL_MASK_MMP3 (0xf << 0) 199 + 200 + #define USB2_TX_AMP_SHIFT_MMP3 4 201 + #define USB2_TX_AMP_MASK_MMP3 (0x7 << 4) 202 + 203 + #define USB2_TX_VDD12_SHIFT_MMP3 8 204 + #define USB2_TX_VDD12_MASK_MMP3 (0x3 << 8) 205 + 206 + /* USB2_TX_REG2 */ 207 + #define USB2_TX_DRV_SLEWRATE_SHIFT 10 208 + 209 + /* USB2_RX_REG0 */ 210 + #define USB2_RX_SQ_THRESH_SHIFT_MMP3 4 211 + #define USB2_RX_SQ_THRESH_MASK_MMP3 (0xf << 4) 212 + 213 + #define USB2_RX_SQ_LENGTH_SHIFT_MMP3 10 214 + #define USB2_RX_SQ_LENGTH_MASK_MMP3 (0x3 << 10) 215 + 216 + /* USB2_ANA_REG1*/ 217 + #define USB2_ANA_PU_ANA_SHIFT_MMP3 14 218 + 219 + /* USB2_OTG_REG0 */ 220 + #define USB2_OTG_PU_OTG_SHIFT_MMP3 3 221 + 222 + /* fsic registers */ 223 + #define FSIC_MISC 0x4 224 + #define FSIC_INT 0x28 225 + #define FSIC_CTRL 0x30 226 + 227 + /* HSIC registers */ 228 + #define HSIC_PAD_CTRL 0x4 229 + 230 + #define HSIC_CTRL 0x8 231 + #define HSIC_CTRL_HSIC_ENABLE (1<<7) 232 + #define HSIC_CTRL_PLL_BYPASS (1<<4) 233 + 234 + #define TEST_GRP_0 0xc 235 + #define TEST_GRP_1 0x10 236 + 237 + #define HSIC_INT 0x14 238 + #define HSIC_INT_READY_INT_EN (1<<10) 239 + #define HSIC_INT_CONNECT_INT_EN (1<<9) 240 + #define HSIC_INT_CORE_INT_EN (1<<8) 241 + #define HSIC_INT_HS_READY (1<<2) 242 + #define HSIC_INT_CONNECT (1<<1) 243 + #define HSIC_INT_CORE (1<<0) 244 + 245 + #define HSIC_CONFIG 0x18 246 + #define USBHSIC_CTRL 0x20 247 + 248 + #define HSIC_USB_CTRL 0x28 249 + #define HSIC_USB_CTRL_CLKEN 1 250 + #define HSIC_USB_CLK_PHY 0x0 251 + #define HSIC_USB_CLK_PMU 0x1 252 + 253 + #endif /* __ASM_ARCH_PXA_U2O_H */
+11 -9
arch/arm/mach-mmp/pxa168.c
··· 14 14 #include <linux/io.h> 15 15 #include <linux/clk.h> 16 16 #include <linux/platform_device.h> 17 + #include <linux/platform_data/mv_usb.h> 17 18 18 19 #include <asm/mach/time.h> 19 20 #include <asm/system_misc.h> ··· 28 27 #include <mach/mfp.h> 29 28 #include <linux/dma-mapping.h> 30 29 #include <mach/pxa168.h> 30 + #include <mach/regs-usb.h> 31 31 32 32 #include "common.h" 33 33 #include "clock.h" ··· 95 93 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), 96 94 INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), 97 95 INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), 98 - INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"), 96 + INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"), 99 97 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), 100 98 }; 101 99 ··· 186 184 struct resource pxa168_usb_host_resources[] = { 187 185 /* USB Host conroller register base */ 188 186 [0] = { 189 - .start = 0xd4209000, 190 - .end = 0xd4209000 + 0x200, 187 + .start = PXA168_U2H_REGBASE + U2x_CAPREGS_OFFSET, 188 + .end = PXA168_U2H_REGBASE + USB_REG_RANGE, 191 189 .flags = IORESOURCE_MEM, 192 - .name = "pxa168-usb-host", 190 + .name = "capregs", 193 191 }, 194 192 /* USB PHY register base */ 195 193 [1] = { 196 - .start = 0xd4206000, 197 - .end = 0xd4206000 + 0xff, 194 + .start = PXA168_U2H_PHYBASE, 195 + .end = PXA168_U2H_PHYBASE + USB_PHY_RANGE, 198 196 .flags = IORESOURCE_MEM, 199 - .name = "pxa168-usb-phy", 197 + .name = "phyregs", 200 198 }, 201 199 [2] = { 202 200 .start = IRQ_PXA168_USB2, ··· 207 205 208 206 static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32); 209 207 struct platform_device pxa168_device_usb_host = { 210 - .name = "pxa168-ehci", 208 + .name = "pxa-sph", 211 209 .id = -1, 212 210 .dev = { 213 211 .dma_mask = &pxa168_usb_host_dmamask, ··· 218 216 .resource = pxa168_usb_host_resources, 219 217 }; 220 218 221 - int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata) 219 + int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata) 222 220 { 223 221 pxa168_device_usb_host.dev.platform_data = pdata; 224 222 return platform_device_register(&pxa168_device_usb_host);
+1 -1
arch/arm/mach-mmp/pxa910.c
··· 109 109 INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), 110 110 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), 111 111 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), 112 - INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), 112 + INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"), 113 113 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), 114 114 }; 115 115
+37
arch/arm/mach-mmp/ttc_dkb.c
··· 18 18 #include <linux/i2c/pca953x.h> 19 19 #include <linux/gpio.h> 20 20 #include <linux/mfd/88pm860x.h> 21 + #include <linux/platform_data/mv_usb.h> 21 22 22 23 #include <asm/mach-types.h> 23 24 #include <asm/mach/arch.h> ··· 27 26 #include <mach/mfp-pxa910.h> 28 27 #include <mach/pxa910.h> 29 28 #include <mach/irqs.h> 29 + #include <mach/regs-usb.h> 30 30 31 31 #include "common.h" 32 32 ··· 157 155 }, 158 156 }; 159 157 158 + #ifdef CONFIG_USB_SUPPORT 159 + #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O) 160 + 161 + static char *pxa910_usb_clock_name[] = { 162 + [0] = "U2OCLK", 163 + }; 164 + 165 + static struct mv_usb_platform_data ttc_usb_pdata = { 166 + .clknum = 1, 167 + .clkname = pxa910_usb_clock_name, 168 + .vbus = NULL, 169 + .mode = MV_USB_MODE_OTG, 170 + .otg_force_a_bus_req = 1, 171 + .phy_init = pxa_usb_phy_init, 172 + .phy_deinit = pxa_usb_phy_deinit, 173 + .set_vbus = NULL, 174 + }; 175 + #endif 176 + #endif 177 + 160 178 static void __init ttc_dkb_init(void) 161 179 { 162 180 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); ··· 187 165 /* off-chip devices */ 188 166 pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info)); 189 167 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); 168 + 169 + #ifdef CONFIG_USB_MV_UDC 170 + pxa168_device_u2o.dev.platform_data = &ttc_usb_pdata; 171 + platform_device_register(&pxa168_device_u2o); 172 + #endif 173 + 174 + #ifdef CONFIG_USB_EHCI_MV_U2O 175 + pxa168_device_u2oehci.dev.platform_data = &ttc_usb_pdata; 176 + platform_device_register(&pxa168_device_u2oehci); 177 + #endif 178 + 179 + #ifdef CONFIG_USB_MV_OTG 180 + pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata; 181 + platform_device_register(&pxa168_device_u2ootg); 182 + #endif 190 183 } 191 184 192 185 MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
+1
arch/arm/mach-omap2/Kconfig
··· 17 17 select MENELAUS if ARCH_OMAP2 18 18 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4 19 19 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4 20 + select HIGHMEM 20 21 help 21 22 Compile a kernel suitable for booting most boards 22 23
+9 -1
arch/arm/mach-omap2/board-4430sdp.c
··· 384 384 .id = -1, 385 385 }; 386 386 387 + static struct platform_device sdp4430_hdmi_audio_codec = { 388 + .name = "hdmi-audio-codec", 389 + .id = -1, 390 + }; 391 + 387 392 static struct omap_abe_twl6040_data sdp4430_abe_audio_data = { 388 393 .card_name = "SDP4430", 389 394 .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, ··· 423 418 &sdp4430_vbat, 424 419 &sdp4430_dmic_codec, 425 420 &sdp4430_abe_audio, 421 + &sdp4430_hdmi_audio_codec, 426 422 }; 427 423 428 424 static struct omap_musb_board_data musb_board_data = { ··· 577 571 TWL_COMMON_REGULATOR_VANA | 578 572 TWL_COMMON_REGULATOR_VCXIO | 579 573 TWL_COMMON_REGULATOR_VUSB | 580 - TWL_COMMON_REGULATOR_CLK32KG); 574 + TWL_COMMON_REGULATOR_CLK32KG | 575 + TWL_COMMON_REGULATOR_V1V8 | 576 + TWL_COMMON_REGULATOR_V2V1); 581 577 omap4_pmic_init("twl6030", &sdp4430_twldata, 582 578 &twl6040_data, OMAP44XX_IRQ_SYS_2N); 583 579 omap_register_i2c_bus(2, 400, NULL, 0);
+2
arch/arm/mach-omap2/board-am3517crane.c
··· 30 30 #include "common.h" 31 31 #include <plat/usb.h> 32 32 33 + #include "am35xx-emac.h" 33 34 #include "mux.h" 34 35 #include "control.h" 35 36 ··· 91 90 } 92 91 93 92 usbhs_init(&usbhs_bdata); 93 + am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1); 94 94 } 95 95 96 96 MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
+5
arch/arm/mach-omap2/board-cm-t35.c
··· 476 476 .setup = cm_t35_twl_gpio_setup, 477 477 }; 478 478 479 + static struct twl4030_power_data cm_t35_power_data = { 480 + .use_poweroff = true, 481 + }; 482 + 479 483 static struct twl4030_platform_data cm_t35_twldata = { 480 484 /* platform_data for children goes here */ 481 485 .keypad = &cm_t35_kp_data, ··· 487 483 .vmmc1 = &cm_t35_vmmc1, 488 484 .vsim = &cm_t35_vsim, 489 485 .vio = &cm_t35_vio, 486 + .power = &cm_t35_power_data, 490 487 }; 491 488 492 489 static void __init cm_t35_init_i2c(void)
+2 -2
arch/arm/mach-omap2/board-flash.c
··· 87 87 .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ 88 88 }; 89 89 90 - static void 90 + void 91 91 __init board_onenand_init(struct mtd_partition *onenand_parts, 92 92 u8 nr_parts, u8 cs) 93 93 { ··· 98 98 gpmc_onenand_init(&board_onenand_data); 99 99 } 100 100 #else 101 - static void 101 + void 102 102 __init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) 103 103 { 104 104 }
+11
arch/arm/mach-omap2/board-flash.h
··· 47 47 { 48 48 } 49 49 #endif 50 + 51 + #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 52 + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) 53 + extern void board_onenand_init(struct mtd_partition *nand_parts, 54 + u8 nr_parts, u8 cs); 55 + #else 56 + static inline void board_onenand_init(struct mtd_partition *nand_parts, 57 + u8 nr_parts, u8 cs) 58 + { 59 + } 60 + #endif
+30 -42
arch/arm/mach-omap2/board-igep0020.c
··· 24 24 #include <linux/i2c/twl.h> 25 25 #include <linux/mmc/host.h> 26 26 27 + #include <linux/mtd/nand.h> 28 + 27 29 #include <asm/mach-types.h> 28 30 #include <asm/mach/arch.h> 29 31 ··· 41 39 #include "hsmmc.h" 42 40 #include "sdram-numonyx-m65kxxxxam.h" 43 41 #include "common-board-devices.h" 42 + #include "board-flash.h" 43 + #include "control.h" 44 44 45 45 #define IGEP2_SMSC911X_CS 5 46 46 #define IGEP2_SMSC911X_GPIO 176 ··· 63 59 #define IGEP3_GPIO_LED0_RED 53 64 60 #define IGEP3_GPIO_LED1_RED 16 65 61 #define IGEP3_GPIO_USBH_NRESET 183 62 + 63 + #define IGEP_SYSBOOT_MASK 0x1f 64 + #define IGEP_SYSBOOT_NAND 0x0f 65 + #define IGEP_SYSBOOT_ONENAND 0x10 66 66 67 67 /* 68 68 * IGEP2 Hardware Revision Table ··· 118 110 gpio_free(IGEP2_GPIO_LED1_RED); 119 111 } 120 112 121 - #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 122 - defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) 113 + #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 114 + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || \ 115 + defined(CONFIG_MTD_NAND_OMAP2) || \ 116 + defined(CONFIG_MTD_NAND_OMAP2_MODULE) 123 117 124 118 #define ONENAND_MAP 0x20000000 125 119 ··· 133 123 * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048) 134 124 */ 135 125 136 - static struct mtd_partition igep_onenand_partitions[] = { 126 + static struct mtd_partition igep_flash_partitions[] = { 137 127 { 138 128 .name = "X-Loader", 139 129 .offset = 0, ··· 161 151 }, 162 152 }; 163 153 164 - static struct omap_onenand_platform_data igep_onenand_data = { 165 - .parts = igep_onenand_partitions, 166 - .nr_parts = ARRAY_SIZE(igep_onenand_partitions), 167 - .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ 168 - }; 169 - 170 - static struct platform_device igep_onenand_device = { 171 - .name = "omap2-onenand", 172 - .id = -1, 173 - .dev = { 174 - .platform_data = &igep_onenand_data, 175 - }, 176 - }; 154 + static inline u32 igep_get_sysboot_value(void) 155 + { 156 + return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK; 157 + } 177 158 178 159 static void __init igep_flash_init(void) 179 160 { 180 - u8 cs = 0; 181 - u8 onenandcs = GPMC_CS_NUM + 1; 161 + u32 mux; 162 + mux = igep_get_sysboot_value(); 182 163 183 - for (cs = 0; cs < GPMC_CS_NUM; cs++) { 184 - u32 ret; 185 - ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); 186 - 187 - /* Check if NAND/oneNAND is configured */ 188 - if ((ret & 0xC00) == 0x800) 189 - /* NAND found */ 190 - pr_err("IGEP: Unsupported NAND found\n"); 191 - else { 192 - ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); 193 - if ((ret & 0x3F) == (ONENAND_MAP >> 24)) 194 - /* ONENAND found */ 195 - onenandcs = cs; 196 - } 164 + if (mux == IGEP_SYSBOOT_NAND) { 165 + pr_info("IGEP: initializing NAND memory device\n"); 166 + board_nand_init(igep_flash_partitions, 167 + ARRAY_SIZE(igep_flash_partitions), 168 + 0, NAND_BUSWIDTH_16); 169 + } else if (mux == IGEP_SYSBOOT_ONENAND) { 170 + pr_info("IGEP: initializing OneNAND memory device\n"); 171 + board_onenand_init(igep_flash_partitions, 172 + ARRAY_SIZE(igep_flash_partitions), 0); 173 + } else { 174 + pr_err("IGEP: Flash: unsupported sysboot sequence found\n"); 197 175 } 198 - 199 - if (onenandcs > GPMC_CS_NUM) { 200 - pr_err("IGEP: Unable to find configuration in GPMC\n"); 201 - return; 202 - } 203 - 204 - igep_onenand_data.cs = onenandcs; 205 - 206 - if (platform_device_register(&igep_onenand_device) < 0) 207 - pr_err("IGEP: Unable to register OneNAND device\n"); 208 176 } 209 177 210 178 #else
+6 -1
arch/arm/mach-omap2/board-omap3beagle.c
··· 83 83 int usb_pwr_level; 84 84 int reset_gpio; 85 85 int usr_button_gpio; 86 + int mmc_caps; 86 87 } beagle_config = { 87 88 .mmc1_gpio_wp = -EINVAL, 88 89 .usb_pwr_level = GPIOF_OUT_INIT_LOW, 89 90 .reset_gpio = 129, 90 91 .usr_button_gpio = 4, 92 + .mmc_caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 91 93 }; 92 94 93 95 static struct gpio omap3_beagle_rev_gpios[] __initdata = { ··· 147 145 printk(KERN_INFO "OMAP3 Beagle Rev: xM Ax/Bx\n"); 148 146 omap3_beagle_version = OMAP3BEAGLE_BOARD_XM; 149 147 beagle_config.usb_pwr_level = GPIOF_OUT_INIT_HIGH; 148 + beagle_config.mmc_caps &= ~MMC_CAP_8_BIT_DATA; 150 149 break; 151 150 case 2: 152 151 printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n"); 153 152 omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC; 153 + beagle_config.mmc_caps &= ~MMC_CAP_8_BIT_DATA; 154 154 break; 155 155 default: 156 156 printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev); ··· 229 225 static struct omap2_hsmmc_info mmc[] = { 230 226 { 231 227 .mmc = 1, 232 - .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 228 + .caps = MMC_CAP_4_BIT_DATA, 233 229 .gpio_wp = -EINVAL, 234 230 .deferred = true, 235 231 }, ··· 501 497 502 498 if (beagle_config.mmc1_gpio_wp != -EINVAL) 503 499 omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT); 500 + mmc[0].caps = beagle_config.mmc_caps; 504 501 omap_hsmmc_init(mmc); 505 502 506 503 omap3_beagle_i2c_init();
+25 -1
arch/arm/mach-omap2/board-omap3logic.c
··· 4 4 * Copyright (C) 2010 Li-Pro.Net 5 5 * Stephan Linz <linz@li-pro.net> 6 6 * 7 - * Copyright (C) 2010 Logic Product Development, Inc. 7 + * Copyright (C) 2010-2012 Logic Product Development, Inc. 8 8 * Peter Barada <peter.barada@logicpd.com> 9 + * Ashwin BIhari <ashwin.bihari@logicpd.com> 9 10 * 10 11 * Modified from Beagle, EVM, and RX51 11 12 * ··· 46 45 #include <plat/gpmc-smsc911x.h> 47 46 #include <plat/gpmc.h> 48 47 #include <plat/sdrc.h> 48 + #include <plat/usb.h> 49 49 50 50 #define OMAP3LOGIC_SMSC911X_CS 1 51 51 ··· 87 85 | BIT(13) | BIT(15) | BIT(16) | BIT(17), 88 86 }; 89 87 88 + static struct twl4030_usb_data omap3logic_usb_data = { 89 + .usb_mode = T2_USB_MODE_ULPI, 90 + }; 91 + 92 + 90 93 static struct twl4030_platform_data omap3logic_twldata = { 91 94 .irq_base = TWL4030_IRQ_BASE, 92 95 .irq_end = TWL4030_IRQ_END, ··· 99 92 /* platform_data for children goes here */ 100 93 .gpio = &omap3logic_gpio_data, 101 94 .vmmc1 = &omap3logic_vmmc1, 95 + .usb = &omap3logic_usb_data, 102 96 }; 103 97 104 98 static int __init omap3logic_i2c_init(void) ··· 193 185 194 186 #ifdef CONFIG_OMAP_MUX 195 187 static struct omap_board_mux board_mux[] __initdata = { 188 + /* mUSB */ 189 + OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 190 + OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 191 + OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 192 + OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 193 + OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 194 + OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 195 + OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 196 + OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 197 + OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 198 + OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 199 + OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 200 + OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 201 + 196 202 { .reg_offset = OMAP_MUX_TERMINATOR }, 197 203 }; 198 204 #endif ··· 226 204 omap_sdrc_init(NULL, NULL); 227 205 board_mmc_init(); 228 206 board_smsc911x_init(); 207 + 208 + usb_musb_init(NULL); 229 209 230 210 /* Ensure SDRC pins are mux'd for self-refresh */ 231 211 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
+21 -3
arch/arm/mach-omap2/board-omap4panda.c
··· 28 28 #include <linux/mfd/twl6040.h> 29 29 #include <linux/regulator/machine.h> 30 30 #include <linux/regulator/fixed.h> 31 + #include <linux/ti_wilink_st.h> 31 32 #include <linux/wl12xx.h> 32 33 #include <linux/platform_data/omap-abe-twl6040.h> 33 34 ··· 59 58 #define HDMI_GPIO_HPD 63 /* Hotplug detect */ 60 59 61 60 /* wl127x BT, FM, GPS connectivity chip */ 62 - static int wl1271_gpios[] = {46, -1, -1}; 61 + static struct ti_st_plat_data wilink_platform_data = { 62 + .nshutdown_gpio = 46, 63 + .dev_name = "/dev/ttyO1", 64 + .flow_cntrl = 1, 65 + .baud_rate = 3000000, 66 + .chip_enable = NULL, 67 + .suspend = NULL, 68 + .resume = NULL, 69 + }; 70 + 63 71 static struct platform_device wl1271_device = { 64 72 .name = "kim", 65 73 .id = -1, 66 74 .dev = { 67 - .platform_data = &wl1271_gpios, 75 + .platform_data = &wilink_platform_data, 68 76 }, 69 77 }; 70 78 ··· 127 117 }, 128 118 }; 129 119 120 + static struct platform_device panda_hdmi_audio_codec = { 121 + .name = "hdmi-audio-codec", 122 + .id = -1, 123 + }; 124 + 130 125 static struct platform_device btwilink_device = { 131 126 .name = "btwilink", 132 127 .id = -1, ··· 141 126 &leds_gpio, 142 127 &wl1271_device, 143 128 &panda_abe_audio, 129 + &panda_hdmi_audio_codec, 144 130 &btwilink_device, 145 131 }; 146 132 ··· 290 274 TWL_COMMON_REGULATOR_VANA | 291 275 TWL_COMMON_REGULATOR_VCXIO | 292 276 TWL_COMMON_REGULATOR_VUSB | 293 - TWL_COMMON_REGULATOR_CLK32KG); 277 + TWL_COMMON_REGULATOR_CLK32KG | 278 + TWL_COMMON_REGULATOR_V1V8 | 279 + TWL_COMMON_REGULATOR_V2V1); 294 280 omap4_pmic_init("twl6030", &omap4_panda_twldata, 295 281 &twl6040_data, OMAP44XX_IRQ_SYS_2N); 296 282 omap_register_i2c_bus(2, 400, NULL, 0);
+87 -1
arch/arm/mach-omap2/board-rx51-peripherals.c
··· 44 44 #include <linux/leds-lp5523.h> 45 45 46 46 #include <../drivers/staging/iio/light/tsl2563.h> 47 + #include <linux/lis3lv02d.h> 47 48 48 49 #include "mux.h" 49 50 #include "hsmmc.h" ··· 64 63 #define RX51_TSC2005_RESET_GPIO 104 65 64 #define RX51_TSC2005_IRQ_GPIO 100 66 65 66 + #define LIS302_IRQ1_GPIO 181 67 + #define LIS302_IRQ2_GPIO 180 /* Not yet in use */ 68 + 67 69 /* list all spi devices here */ 68 70 enum { 69 71 RX51_SPI_WL1251, ··· 76 72 77 73 static struct wl12xx_platform_data wl1251_pdata; 78 74 static struct tsc2005_platform_data tsc2005_pdata; 75 + 76 + #if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE) 77 + static int lis302_setup(void) 78 + { 79 + int err; 80 + int irq1 = LIS302_IRQ1_GPIO; 81 + int irq2 = LIS302_IRQ2_GPIO; 82 + 83 + /* gpio for interrupt pin 1 */ 84 + err = gpio_request(irq1, "lis3lv02dl_irq1"); 85 + if (err) { 86 + printk(KERN_ERR "lis3lv02dl: gpio request failed\n"); 87 + goto out; 88 + } 89 + 90 + /* gpio for interrupt pin 2 */ 91 + err = gpio_request(irq2, "lis3lv02dl_irq2"); 92 + if (err) { 93 + gpio_free(irq1); 94 + printk(KERN_ERR "lis3lv02dl: gpio request failed\n"); 95 + goto out; 96 + } 97 + 98 + gpio_direction_input(irq1); 99 + gpio_direction_input(irq2); 100 + 101 + out: 102 + return err; 103 + } 104 + 105 + static int lis302_release(void) 106 + { 107 + gpio_free(LIS302_IRQ1_GPIO); 108 + gpio_free(LIS302_IRQ2_GPIO); 109 + 110 + return 0; 111 + } 112 + 113 + static struct lis3lv02d_platform_data rx51_lis3lv02d_data = { 114 + .click_flags = LIS3_CLICK_SINGLE_X | LIS3_CLICK_SINGLE_Y | 115 + LIS3_CLICK_SINGLE_Z, 116 + /* Limits are 0.5g * value */ 117 + .click_thresh_x = 8, 118 + .click_thresh_y = 8, 119 + .click_thresh_z = 10, 120 + /* Click must be longer than time limit */ 121 + .click_time_limit = 9, 122 + /* Kind of debounce filter */ 123 + .click_latency = 50, 124 + 125 + /* Limits for all axis. millig-value / 18 to get HW values */ 126 + .wakeup_flags = LIS3_WAKEUP_X_HI | LIS3_WAKEUP_Y_HI, 127 + .wakeup_thresh = 800 / 18, 128 + .wakeup_flags2 = LIS3_WAKEUP_Z_HI , 129 + .wakeup_thresh2 = 900 / 18, 130 + 131 + .hipass_ctrl = LIS3_HIPASS1_DISABLE | LIS3_HIPASS2_DISABLE, 132 + 133 + /* Interrupt line 2 for click detection, line 1 for thresholds */ 134 + .irq_cfg = LIS3_IRQ2_CLICK | LIS3_IRQ1_FF_WU_12, 135 + 136 + .axis_x = LIS3_DEV_X, 137 + .axis_y = LIS3_INV_DEV_Y, 138 + .axis_z = LIS3_INV_DEV_Z, 139 + .setup_resources = lis302_setup, 140 + .release_resources = lis302_release, 141 + .st_min_limits = {-32, 3, 3}, 142 + .st_max_limits = {-3, 32, 32}, 143 + .irq2 = OMAP_GPIO_IRQ(LIS302_IRQ2_GPIO), 144 + }; 145 + #endif 79 146 80 147 #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE) 81 148 static struct tsl2563_platform_data rx51_tsl2563_platform_data = { ··· 1025 950 } 1026 951 }; 1027 952 953 + static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_3[] = { 954 + #if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE) 955 + { 956 + I2C_BOARD_INFO("lis3lv02d", 0x1d), 957 + .platform_data = &rx51_lis3lv02d_data, 958 + .irq = OMAP_GPIO_IRQ(LIS302_IRQ1_GPIO), 959 + }, 960 + #endif 961 + }; 962 + 1028 963 static int __init rx51_i2c_init(void) 1029 964 { 1030 965 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) || ··· 1056 971 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); 1057 972 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, 1058 973 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 1059 - omap_register_i2c_bus(3, 400, NULL, 0); 974 + omap_register_i2c_bus(3, 400, rx51_peripherals_i2c_board_info_3, 975 + ARRAY_SIZE(rx51_peripherals_i2c_board_info_3)); 1060 976 return 0; 1061 977 } 1062 978
+31
arch/arm/mach-omap2/devices.c
··· 354 354 static inline void omap_init_dmic(void) {} 355 355 #endif 356 356 357 + #if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \ 358 + defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE) 359 + 360 + static struct platform_device omap_hdmi_audio = { 361 + .name = "omap-hdmi-audio", 362 + .id = -1, 363 + }; 364 + 365 + static void __init omap_init_hdmi_audio(void) 366 + { 367 + struct omap_hwmod *oh; 368 + struct platform_device *pdev; 369 + 370 + oh = omap_hwmod_lookup("dss_hdmi"); 371 + if (!oh) { 372 + printk(KERN_ERR "Could not look up dss_hdmi hw_mod\n"); 373 + return; 374 + } 375 + 376 + pdev = omap_device_build("omap-hdmi-audio-dai", 377 + -1, oh, NULL, 0, NULL, 0, 0); 378 + WARN(IS_ERR(pdev), 379 + "Can't build omap_device for omap-hdmi-audio-dai.\n"); 380 + 381 + platform_device_register(&omap_hdmi_audio); 382 + } 383 + #else 384 + static inline void omap_init_hdmi_audio(void) {} 385 + #endif 386 + 357 387 #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) 358 388 359 389 #include <plat/mcspi.h> ··· 731 701 */ 732 702 omap_init_audio(); 733 703 omap_init_camera(); 704 + omap_init_hdmi_audio(); 734 705 omap_init_mbox(); 735 706 /* If dtb is there, the devices will be created dynamically */ 736 707 if (!of_have_populated_dt()) {
+43
arch/arm/mach-omap2/twl-common.c
··· 266 266 .valid_ops_mask = REGULATOR_CHANGE_MODE 267 267 | REGULATOR_CHANGE_STATUS, 268 268 }, 269 + .supply_regulator = "V2V1", 269 270 }; 270 271 271 272 static struct regulator_init_data omap4_vaux2_idata = { ··· 357 356 }, 358 357 .num_consumer_supplies = ARRAY_SIZE(omap4_vcxio_supply), 359 358 .consumer_supplies = omap4_vcxio_supply, 359 + .supply_regulator = "V2V1", 360 360 }; 361 361 362 362 static struct regulator_init_data omap4_vusb_idata = { ··· 441 439 .set_voltage = twl_set_voltage, 442 440 }; 443 441 442 + static struct regulator_consumer_supply omap4_v1v8_supply[] = { 443 + REGULATOR_SUPPLY("vio", "1-004b"), 444 + }; 445 + 446 + static struct regulator_init_data omap4_v1v8_idata = { 447 + .constraints = { 448 + .min_uV = 1800000, 449 + .max_uV = 1800000, 450 + .valid_modes_mask = REGULATOR_MODE_NORMAL 451 + | REGULATOR_MODE_STANDBY, 452 + .valid_ops_mask = REGULATOR_CHANGE_MODE 453 + | REGULATOR_CHANGE_STATUS, 454 + .always_on = true, 455 + }, 456 + .num_consumer_supplies = ARRAY_SIZE(omap4_v1v8_supply), 457 + .consumer_supplies = omap4_v1v8_supply, 458 + }; 459 + 460 + static struct regulator_consumer_supply omap4_v2v1_supply[] = { 461 + REGULATOR_SUPPLY("v2v1", "1-004b"), 462 + }; 463 + 464 + static struct regulator_init_data omap4_v2v1_idata = { 465 + .constraints = { 466 + .min_uV = 2100000, 467 + .max_uV = 2100000, 468 + .valid_modes_mask = REGULATOR_MODE_NORMAL 469 + | REGULATOR_MODE_STANDBY, 470 + .valid_ops_mask = REGULATOR_CHANGE_MODE 471 + | REGULATOR_CHANGE_STATUS, 472 + }, 473 + .num_consumer_supplies = ARRAY_SIZE(omap4_v2v1_supply), 474 + .consumer_supplies = omap4_v2v1_supply, 475 + }; 476 + 444 477 void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, 445 478 u32 pdata_flags, u32 regulators_flags) 446 479 { ··· 534 497 if (regulators_flags & TWL_COMMON_REGULATOR_CLK32KG && 535 498 !pmic_data->clk32kg) 536 499 pmic_data->clk32kg = &omap4_clk32kg_idata; 500 + 501 + if (regulators_flags & TWL_COMMON_REGULATOR_V1V8 && !pmic_data->v1v8) 502 + pmic_data->v1v8 = &omap4_v1v8_idata; 503 + 504 + if (regulators_flags & TWL_COMMON_REGULATOR_V2V1 && !pmic_data->v2v1) 505 + pmic_data->v2v1 = &omap4_v2v1_idata; 537 506 } 538 507 #endif /* CONFIG_ARCH_OMAP4 */
+2
arch/arm/mach-omap2/twl-common.h
··· 22 22 #define TWL_COMMON_REGULATOR_VCXIO (1 << 8) 23 23 #define TWL_COMMON_REGULATOR_VUSB (1 << 9) 24 24 #define TWL_COMMON_REGULATOR_CLK32KG (1 << 10) 25 + #define TWL_COMMON_REGULATOR_V1V8 (1 << 11) 26 + #define TWL_COMMON_REGULATOR_V2V1 (1 << 12) 25 27 26 28 /* TWL4030 LDO regulators */ 27 29 #define TWL_COMMON_REGULATOR_VPLL1 (1 << 4)
+2 -23
arch/arm/mach-orion5x/dns323-setup.c
··· 252 252 * GPIO LEDs (simple - doesn't use hardware blinking support) 253 253 */ 254 254 255 - #define ORION_BLINK_HALF_PERIOD 100 /* ms */ 256 - 257 - static int dns323_gpio_blink_set(unsigned gpio, int state, 258 - unsigned long *delay_on, unsigned long *delay_off) 259 - { 260 - 261 - if (delay_on && delay_off && !*delay_on && !*delay_off) 262 - *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD; 263 - 264 - switch(state) { 265 - case GPIO_LED_NO_BLINK_LOW: 266 - case GPIO_LED_NO_BLINK_HIGH: 267 - orion_gpio_set_blink(gpio, 0); 268 - gpio_set_value(gpio, state); 269 - break; 270 - case GPIO_LED_BLINK: 271 - orion_gpio_set_blink(gpio, 1); 272 - } 273 - return 0; 274 - } 275 - 276 255 static struct gpio_led dns323ab_leds[] = { 277 256 { 278 257 .name = "power:blue", ··· 290 311 static struct gpio_led_platform_data dns323ab_led_data = { 291 312 .num_leds = ARRAY_SIZE(dns323ab_leds), 292 313 .leds = dns323ab_leds, 293 - .gpio_blink_set = dns323_gpio_blink_set, 314 + .gpio_blink_set = orion_gpio_led_blink_set, 294 315 }; 295 316 296 317 static struct gpio_led_platform_data dns323c_led_data = { 297 318 .num_leds = ARRAY_SIZE(dns323c_leds), 298 319 .leds = dns323c_leds, 299 - .gpio_blink_set = dns323_gpio_blink_set, 320 + .gpio_blink_set = orion_gpio_led_blink_set, 300 321 }; 301 322 302 323 static struct platform_device dns323_gpio_leds = {
+1 -3
arch/arm/mach-pxa/balloon3.c
··· 732 732 #if defined(CONFIG_REGULATOR_MAX1586) || \ 733 733 defined(CONFIG_REGULATOR_MAX1586_MODULE) 734 734 static struct regulator_consumer_supply balloon3_max1587a_consumers[] = { 735 - { 736 - .supply = "vcc_core", 737 - } 735 + REGULATOR_SUPPLY("vcc_core", NULL), 738 736 }; 739 737 740 738 static struct regulator_init_data balloon3_max1587a_v3_info = {
+1 -3
arch/arm/mach-pxa/cm-x300.c
··· 713 713 }; 714 714 715 715 static struct regulator_consumer_supply buck2_consumers[] = { 716 - { 717 - .supply = "vcc_core", 718 - }, 716 + REGULATOR_SUPPLY("vcc_core", NULL), 719 717 }; 720 718 721 719 static struct regulator_init_data buck2_data = {
+1 -4
arch/arm/mach-pxa/em-x270.c
··· 1085 1085 /* DA9030 related initializations */ 1086 1086 #define REGULATOR_CONSUMER(_name, _dev_name, _supply) \ 1087 1087 static struct regulator_consumer_supply _name##_consumers[] = { \ 1088 - { \ 1089 - .dev_name = _dev_name, \ 1090 - .supply = _supply, \ 1091 - }, \ 1088 + REGULATOR_SUPPLY(_supply, _dev_name), \ 1092 1089 } 1093 1090 1094 1091 REGULATOR_CONSUMER(ldo3, "reg-userspace-consumer.0", "vcc gps");
+35 -12
arch/arm/mach-pxa/hx4700.c
··· 22 22 #include <linux/gpio.h> 23 23 #include <linux/gpio_keys.h> 24 24 #include <linux/input.h> 25 + #include <linux/input/navpoint.h> 25 26 #include <linux/lcd.h> 26 27 #include <linux/mfd/htc-egpio.h> 27 28 #include <linux/mfd/asic3.h> ··· 103 102 GPIO44_BTUART_CTS, 104 103 GPIO45_BTUART_RTS_LPM_LOW, 105 104 105 + /* STUART (IRDA) */ 106 + GPIO46_STUART_RXD, 107 + GPIO47_STUART_TXD, 108 + 106 109 /* PWM 1 (Backlight) */ 107 110 GPIO17_PWM1_OUT, 108 111 ··· 118 113 GPIO113_I2S_SYSCLK, 119 114 120 115 /* SSP 1 (NavPoint) */ 121 - GPIO23_SSP1_SCLK, 116 + GPIO23_SSP1_SCLK_IN, 122 117 GPIO24_SSP1_SFRM, 123 118 GPIO25_SSP1_TXD, 124 119 GPIO26_SSP1_RXD, ··· 130 125 GPIO88_GPIO, 131 126 132 127 /* HX4700 specific input GPIOs */ 133 - GPIO12_GPIO, /* ASIC3_IRQ */ 128 + GPIO12_GPIO | WAKEUP_ON_EDGE_RISE, /* ASIC3_IRQ */ 134 129 GPIO13_GPIO, /* W3220_IRQ */ 135 130 GPIO14_GPIO, /* nWLAN_IRQ */ 131 + 132 + /* HX4700 specific output GPIOs */ 133 + GPIO102_GPIO | MFP_LPM_DRIVE_LOW, /* SYNAPTICS_POWER_ON */ 136 134 137 135 GPIO10_GPIO, /* GSM_IRQ */ 138 136 GPIO13_GPIO, /* CPLD_IRQ */ ··· 191 183 }; 192 184 193 185 /* 186 + * Synaptics NavPoint connected to SSP1 187 + */ 188 + 189 + static struct navpoint_platform_data navpoint_platform_data = { 190 + .port = 1, 191 + .gpio = GPIO102_HX4700_SYNAPTICS_POWER_ON, 192 + }; 193 + 194 + static struct platform_device navpoint = { 195 + .name = "navpoint", 196 + .id = -1, 197 + .dev = { 198 + .platform_data = &navpoint_platform_data, 199 + }, 200 + }; 201 + 202 + /* 194 203 * ASIC3 195 204 */ 196 205 ··· 252 227 ASIC3_GPIOC0_LED0, /* red */ 253 228 ASIC3_GPIOC1_LED1, /* green */ 254 229 ASIC3_GPIOC2_LED2, /* blue */ 255 - ASIC3_GPIOC4_CF_nCD, 256 230 ASIC3_GPIOC5_nCIOW, 257 231 ASIC3_GPIOC6_nCIOR, 258 232 ASIC3_GPIOC7_nPCE_1, ··· 265 241 ASIC3_GPIOC15_nPIOR, 266 242 267 243 /* GPIOD: input GPIOs, CF */ 244 + ASIC3_GPIOD4_CF_nCD, 268 245 ASIC3_GPIOD11_nCIOIS16, 269 246 ASIC3_GPIOD12_nCWAIT, 270 247 ASIC3_GPIOD15_nPIOW, ··· 316 291 .gpio_config_num = ARRAY_SIZE(asic3_gpio_config), 317 292 .irq_base = IRQ_BOARD_START, 318 293 .gpio_base = HX4700_ASIC3_GPIO_BASE, 294 + .clock_rate = 4000000, 319 295 .leds = asic3_leds, 320 296 }; 321 297 ··· 706 680 */ 707 681 708 682 static struct regulator_consumer_supply bq24022_consumers[] = { 709 - { 710 - .supply = "vbus_draw", 711 - }, 712 - { 713 - .supply = "ac_draw", 714 - }, 683 + REGULATOR_SUPPLY("vbus_draw", NULL), 684 + REGULATOR_SUPPLY("ac_draw", NULL), 715 685 }; 716 686 717 687 static struct regulator_init_data bq24022_init_data = { ··· 786 764 * Maxim MAX1587A on PI2C 787 765 */ 788 766 789 - static struct regulator_consumer_supply max1587a_consumer = { 790 - .supply = "vcc_core", 791 - }; 767 + static struct regulator_consumer_supply max1587a_consumer = 768 + REGULATOR_SUPPLY("vcc_core", NULL); 792 769 793 770 static struct regulator_init_data max1587a_v3_info = { 794 771 .constraints = { ··· 849 828 static struct platform_device *devices[] __initdata = { 850 829 &asic3, 851 830 &gpio_keys, 831 + &navpoint, 852 832 &backlight, 853 833 &w3220, 854 834 &hx4700_lcd, ··· 881 859 int ret; 882 860 883 861 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config)); 862 + gpio_set_wake(GPIO12_HX4700_ASIC3_IRQ, 1); 884 863 ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios)); 885 864 if (ret) 886 865 pr_err ("hx4700: Failed to request GPIOs.\n");
+1
arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
··· 208 208 #define GPIO113_I2S_SYSCLK MFP_CFG_OUT(GPIO113, AF1, DRIVE_LOW) 209 209 210 210 /* SSP 1 */ 211 + #define GPIO23_SSP1_SCLK_IN MFP_CFG_IN(GPIO23, AF2) 211 212 #define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW) 212 213 #define GPIO29_SSP1_SCLK MFP_CFG_IN(GPIO29, AF3) 213 214 #define GPIO27_SSP1_SYSCLK MFP_CFG_OUT(GPIO27, AF1, DRIVE_LOW)
+3
arch/arm/mach-pxa/include/mach/mioa701.h
··· 61 61 #define GPIO93_KEY_VOLUME_UP 93 62 62 #define GPIO94_KEY_VOLUME_DOWN 94 63 63 64 + /* Camera */ 65 + #define GPIO56_MT9M111_nOE 56 66 + 64 67 extern struct input_dev *mioa701_evdev; 65 68 extern void mioa701_gpio_lpm_set(unsigned long mfp_pin); 66 69
+2 -66
arch/arm/mach-pxa/include/mach/pcm990_baseboard.h
··· 31 31 #define PCM990_CTRL_INT_IRQ PXA_GPIO_TO_IRQ(PCM990_CTRL_INT_IRQ_GPIO) 32 32 #define PCM990_CTRL_INT_IRQ_EDGE IRQ_TYPE_EDGE_RISING 33 33 #define PCM990_CTRL_PHYS PXA_CS1_PHYS /* 16-Bit */ 34 - #define PCM990_CTRL_BASE 0xea000000 35 34 #define PCM990_CTRL_SIZE (1*1024*1024) 36 35 37 36 #define PCM990_CTRL_PWR_IRQ_GPIO 14 ··· 68 69 #define PCM990_CTRL_MMC2DE 0x0004 /* R MMC2 Card detect */ 69 70 #define PCM990_CTRL_MMC2WP 0x0008 /* R MMC2 Card write protect */ 70 71 71 - #define PCM990_CTRL_REG6 0x000C /* Interrupt Clear REGISTER */ 72 + #define PCM990_CTRL_INTSETCLR 0x000C /* Interrupt Clear REGISTER */ 72 73 #define PCM990_CTRL_INTC0 0x0001 /* Clear Reg BT Detect */ 73 74 #define PCM990_CTRL_INTC1 0x0002 /* Clear Reg FR RI */ 74 75 #define PCM990_CTRL_INTC2 0x0004 /* Clear Reg MMC1 Detect */ 75 76 #define PCM990_CTRL_INTC3 0x0008 /* Clear Reg PM_5V off */ 76 77 77 - #define PCM990_CTRL_REG7 0x000E /* Interrupt Enable REGISTER */ 78 + #define PCM990_CTRL_INTMSKENA 0x000E /* Interrupt Enable REGISTER */ 78 79 #define PCM990_CTRL_ENAINT0 0x0001 /* Enable Int BT Detect */ 79 80 #define PCM990_CTRL_ENAINT1 0x0002 /* Enable Int FR RI */ 80 81 #define PCM990_CTRL_ENAINT2 0x0004 /* Enable Int MMC1 Detect */ ··· 100 101 #define PCM990_CTRL_ACSEL 0x0002 /* Charge Akku -> DC Enable */ 101 102 #define PCM990_CTRL_ACPRES 0x0004 /* DC Present */ 102 103 #define PCM990_CTRL_ACALARM 0x0008 /* Error Akku */ 103 - 104 - #define PCM990_CTRL_P2V(x) ((x) - PCM990_CTRL_PHYS + PCM990_CTRL_BASE) 105 - #define PCM990_CTRL_V2P(x) ((x) - PCM990_CTRL_BASE + PCM990_CTRL_PHYS) 106 - 107 - #ifndef __ASSEMBLY__ 108 - # define __PCM990_CTRL_REG(x) \ 109 - (*((volatile unsigned char *)PCM990_CTRL_P2V(x))) 110 - #else 111 - # define __PCM990_CTRL_REG(x) PCM990_CTRL_P2V(x) 112 - #endif 113 - 114 - #define PCM990_INTMSKENA __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG7) 115 - #define PCM990_INTSETCLR __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG6) 116 - #define PCM990_CTRL0 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG0) 117 - #define PCM990_CTRL1 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG1) 118 - #define PCM990_CTRL2 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG2) 119 - #define PCM990_CTRL3 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) 120 - #define PCM990_CTRL4 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG4) 121 - #define PCM990_CTRL5 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5) 122 - #define PCM990_CTRL6 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG6) 123 - #define PCM990_CTRL7 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG7) 124 - #define PCM990_CTRL8 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG8) 125 - #define PCM990_CTRL9 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG9) 126 - #define PCM990_CTRL10 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG10) 127 - #define PCM990_CTRL11 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG11) 128 - 129 104 130 105 /* 131 106 * IDE ··· 139 166 #define PCM990_IDE_PLD_P2V(x) ((x) - PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_BASE) 140 167 #define PCM990_IDE_PLD_V2P(x) ((x) - PCM990_IDE_PLD_BASE + PCM990_IDE_PLD_PHYS) 141 168 142 - #ifndef __ASSEMBLY__ 143 - # define __PCM990_IDE_PLD_REG(x) \ 144 - (*((volatile unsigned char *)PCM990_IDE_PLD_P2V(x))) 145 - #else 146 - # define __PCM990_IDE_PLD_REG(x) PCM990_IDE_PLD_P2V(x) 147 - #endif 148 - 149 - #define PCM990_IDE0 \ 150 - __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG0) 151 - #define PCM990_IDE1 \ 152 - __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG1) 153 - #define PCM990_IDE2 \ 154 - __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG2) 155 - #define PCM990_IDE3 \ 156 - __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG3) 157 - #define PCM990_IDE4 \ 158 - __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG4) 159 - 160 169 /* 161 170 * Compact Flash 162 171 */ ··· 151 196 #define PCM990_CF_CD_EDGE IRQ_TYPE_EDGE_RISING 152 197 153 198 #define PCM990_CF_PLD_PHYS 0x30000000 /* 16 bit wide */ 154 - #define PCM990_CF_PLD_BASE 0xef000000 155 - #define PCM990_CF_PLD_SIZE (1*1024*1024) 156 - #define PCM990_CF_PLD_P2V(x) ((x) - PCM990_CF_PLD_PHYS + PCM990_CF_PLD_BASE) 157 - #define PCM990_CF_PLD_V2P(x) ((x) - PCM990_CF_PLD_BASE + PCM990_CF_PLD_PHYS) 158 199 159 200 /* visible CPLD (U6) registers */ 160 201 #define PCM990_CF_PLD_REG0 0x1000 /* OFFSET CF REGISTER 0 */ ··· 189 238 #define PCM990_CF_PLD_REG6 0x100C /* OFFSET CF REGISTER 6 */ 190 239 #define PCM990_CF_REG6_CD1 0x0001 /* R CF Card_Detect1 */ 191 240 #define PCM990_CF_REG6_CD2 0x0002 /* R CF Card_Detect2 */ 192 - 193 - #ifndef __ASSEMBLY__ 194 - # define __PCM990_CF_PLD_REG(x) \ 195 - (*((volatile unsigned char *)PCM990_CF_PLD_P2V(x))) 196 - #else 197 - # define __PCM990_CF_PLD_REG(x) PCM990_CF_PLD_P2V(x) 198 - #endif 199 - 200 - #define PCM990_CF0 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG0) 201 - #define PCM990_CF1 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG1) 202 - #define PCM990_CF2 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG2) 203 - #define PCM990_CF3 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG3) 204 - #define PCM990_CF4 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG4) 205 - #define PCM990_CF5 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG5) 206 - #define PCM990_CF6 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG6) 207 241 208 242 /* 209 243 * Wolfson AC97 Touch
+2 -6
arch/arm/mach-pxa/magician.c
··· 579 579 */ 580 580 581 581 static struct regulator_consumer_supply bq24022_consumers[] = { 582 - { 583 - .supply = "vbus_draw", 584 - }, 585 - { 586 - .supply = "ac_draw", 587 - }, 582 + REGULATOR_SUPPLY("vbus_draw", NULL), 583 + REGULATOR_SUPPLY("ac_draw", NULL), 588 584 }; 589 585 590 586 static struct regulator_init_data bq24022_init_data = {
+3 -3
arch/arm/mach-pxa/mioa701.c
··· 103 103 GPIO82_CIF_DD_5, 104 104 GPIO84_CIF_FV, 105 105 GPIO85_CIF_LV, 106 + MIO_CFG_OUT(GPIO56_MT9M111_nOE, AF0, DRIVE_LOW), 106 107 107 108 /* Bluetooth */ 108 109 MIO_CFG_IN(GPIO14_BT_nACTIVITY, AF0), ··· 582 581 * Voltage regulation 583 582 */ 584 583 static struct regulator_consumer_supply max1586_consumers[] = { 585 - { 586 - .supply = "vcc_core", 587 - } 584 + REGULATOR_SUPPLY("vcc_core", NULL), 588 585 }; 589 586 590 587 static struct regulator_init_data max1586_v3_info = { ··· 704 705 { GPIO9_CHARGE_EN, GPIOF_OUT_INIT_HIGH, "Charger enable" }, 705 706 { GPIO18_POWEROFF, GPIOF_OUT_INIT_LOW, "Power Off" }, 706 707 { GPIO87_LCD_POWER, GPIOF_OUT_INIT_LOW, "LCD Power" }, 708 + { GPIO56_MT9M111_nOE, GPIOF_OUT_INIT_LOW, "Camera nOE" }, 707 709 }; 708 710 709 711 static void __init mioa701_machine_init(void)
+1 -3
arch/arm/mach-pxa/palm27x.c
··· 429 429 #if defined(CONFIG_REGULATOR_MAX1586) || \ 430 430 defined(CONFIG_REGULATOR_MAX1586_MODULE) 431 431 static struct regulator_consumer_supply palm27x_max1587a_consumers[] = { 432 - { 433 - .supply = "vcc_core", 434 - } 432 + REGULATOR_SUPPLY("vcc_core", NULL), 435 433 }; 436 434 437 435 static struct regulator_init_data palm27x_max1587a_v3_info = {
+50 -33
arch/arm/mach-pxa/pcm990-baseboard.c
··· 65 65 GPIO31_AC97_SYNC, 66 66 }; 67 67 68 + static void __iomem *pcm990_cpld_base; 69 + 70 + static u8 pcm990_cpld_readb(unsigned int reg) 71 + { 72 + return readb(pcm990_cpld_base + reg); 73 + } 74 + 75 + static void pcm990_cpld_writeb(u8 value, unsigned int reg) 76 + { 77 + writeb(value, pcm990_cpld_base + reg); 78 + } 79 + 68 80 /* 69 81 * pcm990_lcd_power - control power supply to the LCD 70 82 * @on: 0 = switch off, 1 = switch on ··· 90 78 /* enable LCD-Latches 91 79 * power on LCD 92 80 */ 93 - __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = 94 - PCM990_CTRL_LCDPWR + PCM990_CTRL_LCDON; 81 + pcm990_cpld_writeb(PCM990_CTRL_LCDPWR + PCM990_CTRL_LCDON, 82 + PCM990_CTRL_REG3); 95 83 } else { 96 84 /* disable LCD-Latches 97 85 * power off LCD 98 86 */ 99 - __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = 0x00; 87 + pcm990_cpld_writeb(0, PCM990_CTRL_REG3); 100 88 } 101 89 } 102 90 #endif ··· 255 243 static void pcm990_mask_ack_irq(struct irq_data *d) 256 244 { 257 245 int pcm990_irq = (d->irq - PCM027_IRQ(0)); 258 - PCM990_INTMSKENA = (pcm990_irq_enabled &= ~(1 << pcm990_irq)); 246 + 247 + pcm990_irq_enabled &= ~(1 << pcm990_irq); 248 + 249 + pcm990_cpld_writeb(pcm990_irq_enabled, PCM990_CTRL_INTMSKENA); 259 250 } 260 251 261 252 static void pcm990_unmask_irq(struct irq_data *d) 262 253 { 263 254 int pcm990_irq = (d->irq - PCM027_IRQ(0)); 255 + u8 val; 256 + 264 257 /* the irq can be acknowledged only if deasserted, so it's done here */ 265 - PCM990_INTSETCLR |= 1 << pcm990_irq; 266 - PCM990_INTMSKENA = (pcm990_irq_enabled |= (1 << pcm990_irq)); 258 + 259 + pcm990_irq_enabled |= (1 << pcm990_irq); 260 + 261 + val = pcm990_cpld_readb(PCM990_CTRL_INTSETCLR); 262 + val |= 1 << pcm990_irq; 263 + pcm990_cpld_writeb(val, PCM990_CTRL_INTSETCLR); 264 + 265 + pcm990_cpld_writeb(pcm990_irq_enabled, PCM990_CTRL_INTMSKENA); 267 266 } 268 267 269 268 static struct irq_chip pcm990_irq_chip = { ··· 284 261 285 262 static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc) 286 263 { 287 - unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 264 + unsigned long pending; 265 + 266 + pending = ~pcm990_cpld_readb(PCM990_CTRL_INTSETCLR); 267 + pending &= pcm990_irq_enabled; 288 268 289 269 do { 290 270 /* clear our parent IRQ */ ··· 296 270 irq = PCM027_IRQ(0) + __ffs(pending); 297 271 generic_handle_irq(irq); 298 272 } 299 - pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 273 + pending = ~pcm990_cpld_readb(PCM990_CTRL_INTSETCLR); 274 + pending &= pcm990_irq_enabled; 300 275 } while (pending); 301 276 } 302 277 ··· 312 285 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 313 286 } 314 287 315 - PCM990_INTMSKENA = 0x00; /* disable all Interrupts */ 316 - PCM990_INTSETCLR = 0xFF; 288 + /* disable all Interrupts */ 289 + pcm990_cpld_writeb(0x0, PCM990_CTRL_INTMSKENA); 290 + pcm990_cpld_writeb(0xff, PCM990_CTRL_INTSETCLR); 317 291 318 292 irq_set_chained_handler(PCM990_CTRL_INT_IRQ, pcm990_irq_handler); 319 293 irq_set_irq_type(PCM990_CTRL_INT_IRQ, PCM990_CTRL_INT_IRQ_EDGE); ··· 337 309 static void pcm990_mci_setpower(struct device *dev, unsigned int vdd) 338 310 { 339 311 struct pxamci_platform_data *p_d = dev->platform_data; 312 + u8 val; 313 + 314 + val = pcm990_cpld_readb(PCM990_CTRL_REG5); 340 315 341 316 if ((1 << vdd) & p_d->ocr_mask) 342 - __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5) = 343 - PCM990_CTRL_MMC2PWR; 317 + val |= PCM990_CTRL_MMC2PWR; 344 318 else 345 - __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5) = 346 - ~PCM990_CTRL_MMC2PWR; 319 + val &= ~PCM990_CTRL_MMC2PWR; 320 + 321 + pcm990_cpld_writeb(PCM990_CTRL_MMC2PWR, PCM990_CTRL_REG5); 347 322 } 348 323 349 324 static void pcm990_mci_exit(struct device *dev, void *data) ··· 512 481 #endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */ 513 482 514 483 /* 515 - * enable generic access to the base board control CPLDs U6 and U7 516 - */ 517 - static struct map_desc pcm990_io_desc[] __initdata = { 518 - { 519 - .virtual = PCM990_CTRL_BASE, 520 - .pfn = __phys_to_pfn(PCM990_CTRL_PHYS), 521 - .length = PCM990_CTRL_SIZE, 522 - .type = MT_DEVICE /* CPLD */ 523 - }, { 524 - .virtual = PCM990_CF_PLD_BASE, 525 - .pfn = __phys_to_pfn(PCM990_CF_PLD_PHYS), 526 - .length = PCM990_CF_PLD_SIZE, 527 - .type = MT_DEVICE /* CPLD */ 528 - } 529 - }; 530 - 531 - /* 532 484 * system init for baseboard usage. Will be called by pcm027 init. 533 485 * 534 486 * Add platform devices present on this baseboard and init ··· 521 507 { 522 508 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_pin_config)); 523 509 524 - /* register CPLD access */ 525 - iotable_init(ARRAY_AND_SIZE(pcm990_io_desc)); 510 + pcm990_cpld_base = ioremap(PCM990_CTRL_PHYS, PCM990_CTRL_SIZE); 511 + if (!pcm990_cpld_base) { 512 + pr_err("pcm990: failed to ioremap cpld\n"); 513 + return; 514 + } 526 515 527 516 /* register CPLD's IRQ controller */ 528 517 pcm990_init_irq();
+1 -3
arch/arm/mach-pxa/spitz.c
··· 877 877 }; 878 878 879 879 static struct regulator_consumer_supply isl6271a_consumers[] = { 880 - { 881 - .supply = "vcc_core", 882 - } 880 + REGULATOR_SUPPLY("vcc_core", NULL), 883 881 }; 884 882 885 883 static struct regulator_init_data isl6271a_info[] = {
+1 -4
arch/arm/mach-pxa/stargate2.c
··· 151 151 }; 152 152 153 153 static struct regulator_consumer_supply stargate2_sensor_3_con[] = { 154 - { 155 - .dev_name = "sht15", 156 - .supply = "vcc", 157 - }, 154 + REGULATOR_SUPPLY("vcc", "sht15"), 158 155 }; 159 156 160 157 enum stargate2_ldos{
+1 -3
arch/arm/mach-pxa/vpac270.c
··· 640 640 #if defined(CONFIG_REGULATOR_MAX1586) || \ 641 641 defined(CONFIG_REGULATOR_MAX1586_MODULE) 642 642 static struct regulator_consumer_supply vpac270_max1587a_consumers[] = { 643 - { 644 - .supply = "vcc_core", 645 - } 643 + REGULATOR_SUPPLY("vcc_core", NULL), 646 644 }; 647 645 648 646 static struct regulator_init_data vpac270_max1587a_v3_info = {
+1 -3
arch/arm/mach-pxa/z2.c
··· 615 615 #if defined(CONFIG_REGULATOR_TPS65023) || \ 616 616 defined(CONFIG_REGULATOR_TPS65023_MODULE) 617 617 static struct regulator_consumer_supply z2_tps65021_consumers[] = { 618 - { 619 - .supply = "vcc_core", 620 - } 618 + REGULATOR_SUPPLY("vcc_core", NULL), 621 619 }; 622 620 623 621 static struct regulator_init_data z2_tps65021_info[] = {
+18
arch/arm/mach-s3c64xx/mach-crag6410.c
··· 290 290 REGULATOR_SUPPLY("SPKVDD2", "1-001a"), 291 291 REGULATOR_SUPPLY("SPKVDDL", "1-001a"), 292 292 REGULATOR_SUPPLY("SPKVDDR", "1-001a"), 293 + 294 + REGULATOR_SUPPLY("DC1VDD", "0-0034"), 295 + REGULATOR_SUPPLY("DC2VDD", "0-0034"), 296 + REGULATOR_SUPPLY("DC3VDD", "0-0034"), 297 + REGULATOR_SUPPLY("LDO1VDD", "0-0034"), 298 + REGULATOR_SUPPLY("LDO2VDD", "0-0034"), 299 + REGULATOR_SUPPLY("LDO4VDD", "0-0034"), 300 + REGULATOR_SUPPLY("LDO5VDD", "0-0034"), 301 + REGULATOR_SUPPLY("LDO6VDD", "0-0034"), 302 + REGULATOR_SUPPLY("LDO7VDD", "0-0034"), 303 + REGULATOR_SUPPLY("LDO8VDD", "0-0034"), 304 + REGULATOR_SUPPLY("LDO9VDD", "0-0034"), 305 + REGULATOR_SUPPLY("LDO10VDD", "0-0034"), 306 + REGULATOR_SUPPLY("LDO11VDD", "0-0034"), 307 + 308 + REGULATOR_SUPPLY("DC1VDD", "1-0034"), 309 + REGULATOR_SUPPLY("DC2VDD", "1-0034"), 310 + REGULATOR_SUPPLY("DC3VDD", "1-0034"), 293 311 }; 294 312 295 313 static struct regulator_init_data wallvdd_data = {
+16 -2
arch/arm/mach-shmobile/Kconfig
··· 99 99 select ARCH_REQUIRE_GPIOLIB 100 100 depends on ARCH_R8A7740 101 101 102 + config MACH_ARMADILLO800EVA 103 + bool "Armadillo-800 EVA board" 104 + depends on ARCH_R8A7740 105 + select ARCH_REQUIRE_GPIOLIB 106 + select USE_OF 107 + 102 108 config MACH_MARZEN 103 109 bool "MARZEN board" 104 110 depends on ARCH_R8A7779 ··· 113 107 config MACH_KZM9D 114 108 bool "KZM9D board" 115 109 depends on ARCH_EMEV2 110 + select USE_OF 111 + 112 + config MACH_KZM9G 113 + bool "KZM-A9-GT board" 114 + depends on ARCH_SH73A0 115 + select ARCH_REQUIRE_GPIOLIB 116 116 select USE_OF 117 117 118 118 comment "SH-Mobile System Configuration" ··· 133 121 hex "Physical memory start address" 134 122 default "0x50000000" if MACH_G3EVM 135 123 default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \ 136 - MACH_MACKEREL || MACH_BONITO 124 + MACH_MACKEREL || MACH_BONITO || \ 125 + MACH_ARMADILLO800EVA 137 126 default "0x41000000" if MACH_KOTA2 138 127 default "0x00000000" 139 128 ---help--- ··· 146 133 hex "Physical memory size" 147 134 default "0x08000000" if MACH_G3EVM 148 135 default "0x08000000" if MACH_G4EVM 149 - default "0x20000000" if MACH_AG5EVM || MACH_BONITO 136 + default "0x20000000" if MACH_AG5EVM || MACH_BONITO || \ 137 + MACH_ARMADILLO800EVA 150 138 default "0x1e000000" if MACH_KOTA2 151 139 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL 152 140 default "0x04000000"
+2
arch/arm/mach-shmobile/Makefile
··· 51 51 obj-$(CONFIG_MACH_KOTA2) += board-kota2.o 52 52 obj-$(CONFIG_MACH_BONITO) += board-bonito.o 53 53 obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 54 + obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o 54 55 obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o 56 + obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o 55 57 56 58 # Framework support 57 59 obj-$(CONFIG_SMP) += $(smp-y)
+2
arch/arm/mach-shmobile/board-ap4evb.c
··· 997 997 998 998 static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 999 999 .flags = SH_CEU_FLAG_USE_8BIT_BUS, 1000 + .max_width = 8188, 1001 + .max_height = 8188, 1000 1002 .csi2 = &csi2, 1001 1003 }; 1002 1004
+784
arch/arm/mach-shmobile/board-armadillo800eva.c
··· 1 + /* 2 + * armadillo 800 eva board support 3 + * 4 + * Copyright (C) 2012 Renesas Solutions Corp. 5 + * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License as published by 9 + * the Free Software Foundation; version 2 of the License. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + * You should have received a copy of the GNU General Public License 17 + * along with this program; if not, write to the Free Software 18 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 + * 20 + */ 21 + 22 + #include <linux/clk.h> 23 + #include <linux/delay.h> 24 + #include <linux/err.h> 25 + #include <linux/kernel.h> 26 + #include <linux/input.h> 27 + #include <linux/irq.h> 28 + #include <linux/platform_device.h> 29 + #include <linux/gpio.h> 30 + #include <linux/gpio_keys.h> 31 + #include <linux/sh_eth.h> 32 + #include <linux/videodev2.h> 33 + #include <linux/usb/renesas_usbhs.h> 34 + #include <linux/mfd/tmio.h> 35 + #include <linux/mmc/host.h> 36 + #include <linux/mmc/sh_mmcif.h> 37 + #include <linux/mmc/sh_mobile_sdhi.h> 38 + #include <mach/common.h> 39 + #include <mach/irqs.h> 40 + #include <asm/page.h> 41 + #include <asm/mach-types.h> 42 + #include <asm/mach/arch.h> 43 + #include <asm/mach/map.h> 44 + #include <asm/mach/time.h> 45 + #include <asm/hardware/cache-l2x0.h> 46 + #include <mach/r8a7740.h> 47 + #include <video/sh_mobile_lcdc.h> 48 + 49 + /* 50 + * CON1 Camera Module 51 + * CON2 Extension Bus 52 + * CON3 HDMI Output 53 + * CON4 Composite Video Output 54 + * CON5 H-UDI JTAG 55 + * CON6 ARM JTAG 56 + * CON7 SD1 57 + * CON8 SD2 58 + * CON9 RTC BackUp 59 + * CON10 Monaural Mic Input 60 + * CON11 Stereo Headphone Output 61 + * CON12 Audio Line Output(L) 62 + * CON13 Audio Line Output(R) 63 + * CON14 AWL13 Module 64 + * CON15 Extension 65 + * CON16 LCD1 66 + * CON17 LCD2 67 + * CON19 Power Input 68 + * CON20 USB1 69 + * CON21 USB2 70 + * CON22 Serial 71 + * CON23 LAN 72 + * CON24 USB3 73 + * LED1 Camera LED(Yellow) 74 + * LED2 Power LED (Green) 75 + * ED3-LED6 User LED(Yellow) 76 + * LED7 LAN link LED(Green) 77 + * LED8 LAN activity LED(Yellow) 78 + */ 79 + 80 + /* 81 + * DipSwitch 82 + * 83 + * SW1 84 + * 85 + * -12345678-+---------------+---------------------------- 86 + * 1 | boot | hermit 87 + * 0 | boot | OS auto boot 88 + * -12345678-+---------------+---------------------------- 89 + * 00 | boot device | eMMC 90 + * 10 | boot device | SDHI0 (CON7) 91 + * 01 | boot device | - 92 + * 11 | boot device | Extension Buss (CS0) 93 + * -12345678-+---------------+---------------------------- 94 + * 0 | Extension Bus | D8-D15 disable, eMMC enable 95 + * 1 | Extension Bus | D8-D15 enable, eMMC disable 96 + * -12345678-+---------------+---------------------------- 97 + * 0 | SDHI1 | COM8 disable, COM14 enable 98 + * 1 | SDHI1 | COM8 enable, COM14 disable 99 + * -12345678-+---------------+---------------------------- 100 + * 0 | USB0 | COM20 enable, COM24 disable 101 + * 1 | USB0 | COM20 disable, COM24 enable 102 + * -12345678-+---------------+---------------------------- 103 + * 00 | JTAG | SH-X2 104 + * 10 | JTAG | ARM 105 + * 01 | JTAG | - 106 + * 11 | JTAG | Boundary Scan 107 + *-----------+---------------+---------------------------- 108 + */ 109 + 110 + /* 111 + * USB function 112 + * 113 + * When you use USB Function, 114 + * set SW1.6 ON, and connect cable to CN24. 115 + * 116 + * USBF needs workaround on R8A7740 chip. 117 + * These are a little bit complex. 118 + * see 119 + * usbhsf_power_ctrl() 120 + * 121 + * CAUTION 122 + * 123 + * It uses autonomy mode for USB hotplug at this point 124 + * (= usbhs_private.platform_callback.get_vbus is NULL), 125 + * since we don't know what's happen on PM control 126 + * on this workaround. 127 + */ 128 + #define USBCR1 0xe605810a 129 + #define USBH 0xC6700000 130 + #define USBH_USBCTR 0x10834 131 + 132 + struct usbhsf_private { 133 + struct clk *phy; 134 + struct clk *usb24; 135 + struct clk *pci; 136 + struct clk *func; 137 + struct clk *host; 138 + void __iomem *usbh_base; 139 + struct renesas_usbhs_platform_info info; 140 + }; 141 + 142 + #define usbhsf_get_priv(pdev) \ 143 + container_of(renesas_usbhs_get_info(pdev), \ 144 + struct usbhsf_private, info) 145 + 146 + static int usbhsf_get_id(struct platform_device *pdev) 147 + { 148 + return USBHS_GADGET; 149 + } 150 + 151 + static void usbhsf_power_ctrl(struct platform_device *pdev, 152 + void __iomem *base, int enable) 153 + { 154 + struct usbhsf_private *priv = usbhsf_get_priv(pdev); 155 + 156 + /* 157 + * Work around for USB Function. 158 + * It needs USB host clock, and settings 159 + */ 160 + if (enable) { 161 + /* 162 + * enable all the related usb clocks 163 + * for usb workaround 164 + */ 165 + clk_enable(priv->usb24); 166 + clk_enable(priv->pci); 167 + clk_enable(priv->host); 168 + clk_enable(priv->func); 169 + clk_enable(priv->phy); 170 + 171 + /* 172 + * set USBCR1 173 + * 174 + * Port1 is driven by USB function, 175 + * Port2 is driven by USB HOST 176 + * One HOST (Port1 or Port2 is HOST) 177 + * USB PLL input clock = 24MHz 178 + */ 179 + __raw_writew(0xd750, USBCR1); 180 + mdelay(1); 181 + 182 + /* 183 + * start USB Host 184 + */ 185 + __raw_writel(0x0000000c, priv->usbh_base + USBH_USBCTR); 186 + __raw_writel(0x00000008, priv->usbh_base + USBH_USBCTR); 187 + mdelay(10); 188 + 189 + /* 190 + * USB PHY Power ON 191 + */ 192 + __raw_writew(0xd770, USBCR1); 193 + __raw_writew(0x4000, base + 0x102); /* USBF :: SUSPMODE */ 194 + 195 + } else { 196 + __raw_writel(0x0000010f, priv->usbh_base + USBH_USBCTR); 197 + __raw_writew(0xd7c0, USBCR1); /* GPIO */ 198 + 199 + clk_disable(priv->phy); 200 + clk_disable(priv->func); /* usb work around */ 201 + clk_disable(priv->host); /* usb work around */ 202 + clk_disable(priv->pci); /* usb work around */ 203 + clk_disable(priv->usb24); /* usb work around */ 204 + } 205 + } 206 + 207 + static void usbhsf_hardware_exit(struct platform_device *pdev) 208 + { 209 + struct usbhsf_private *priv = usbhsf_get_priv(pdev); 210 + 211 + if (!IS_ERR(priv->phy)) 212 + clk_put(priv->phy); 213 + if (!IS_ERR(priv->usb24)) 214 + clk_put(priv->usb24); 215 + if (!IS_ERR(priv->pci)) 216 + clk_put(priv->pci); 217 + if (!IS_ERR(priv->host)) 218 + clk_put(priv->host); 219 + if (!IS_ERR(priv->func)) 220 + clk_put(priv->func); 221 + if (priv->usbh_base) 222 + iounmap(priv->usbh_base); 223 + 224 + priv->phy = NULL; 225 + priv->usb24 = NULL; 226 + priv->pci = NULL; 227 + priv->host = NULL; 228 + priv->func = NULL; 229 + priv->usbh_base = NULL; 230 + } 231 + 232 + static int usbhsf_hardware_init(struct platform_device *pdev) 233 + { 234 + struct usbhsf_private *priv = usbhsf_get_priv(pdev); 235 + 236 + priv->phy = clk_get(&pdev->dev, "phy"); 237 + priv->usb24 = clk_get(&pdev->dev, "usb24"); 238 + priv->pci = clk_get(&pdev->dev, "pci"); 239 + priv->func = clk_get(&pdev->dev, "func"); 240 + priv->host = clk_get(&pdev->dev, "host"); 241 + priv->usbh_base = ioremap_nocache(USBH, 0x20000); 242 + 243 + if (IS_ERR(priv->phy) || 244 + IS_ERR(priv->usb24) || 245 + IS_ERR(priv->pci) || 246 + IS_ERR(priv->host) || 247 + IS_ERR(priv->func) || 248 + !priv->usbh_base) { 249 + dev_err(&pdev->dev, "USB clock setting failed\n"); 250 + usbhsf_hardware_exit(pdev); 251 + return -EIO; 252 + } 253 + 254 + /* usb24 use 1/1 of parent clock (= usb24s = 24MHz) */ 255 + clk_set_rate(priv->usb24, 256 + clk_get_rate(clk_get_parent(priv->usb24))); 257 + 258 + return 0; 259 + } 260 + 261 + static struct usbhsf_private usbhsf_private = { 262 + .info = { 263 + .platform_callback = { 264 + .get_id = usbhsf_get_id, 265 + .hardware_init = usbhsf_hardware_init, 266 + .hardware_exit = usbhsf_hardware_exit, 267 + .power_ctrl = usbhsf_power_ctrl, 268 + }, 269 + .driver_param = { 270 + .buswait_bwait = 5, 271 + .detection_delay = 5, 272 + }, 273 + } 274 + }; 275 + 276 + static struct resource usbhsf_resources[] = { 277 + { 278 + .name = "USBHS", 279 + .start = 0xe6890000, 280 + .end = 0xe6890104 - 1, 281 + .flags = IORESOURCE_MEM, 282 + }, 283 + { 284 + .start = evt2irq(0x0A20), 285 + .flags = IORESOURCE_IRQ, 286 + }, 287 + }; 288 + 289 + static struct platform_device usbhsf_device = { 290 + .name = "renesas_usbhs", 291 + .dev = { 292 + .platform_data = &usbhsf_private.info, 293 + }, 294 + .id = -1, 295 + .num_resources = ARRAY_SIZE(usbhsf_resources), 296 + .resource = usbhsf_resources, 297 + }; 298 + 299 + /* Ether */ 300 + static struct sh_eth_plat_data sh_eth_platdata = { 301 + .phy = 0x00, /* LAN8710A */ 302 + .edmac_endian = EDMAC_LITTLE_ENDIAN, 303 + .register_type = SH_ETH_REG_GIGABIT, 304 + .phy_interface = PHY_INTERFACE_MODE_MII, 305 + }; 306 + 307 + static struct resource sh_eth_resources[] = { 308 + { 309 + .start = 0xe9a00000, 310 + .end = 0xe9a00800 - 1, 311 + .flags = IORESOURCE_MEM, 312 + }, { 313 + .start = 0xe9a01800, 314 + .end = 0xe9a02000 - 1, 315 + .flags = IORESOURCE_MEM, 316 + }, { 317 + .start = evt2irq(0x0500), 318 + .flags = IORESOURCE_IRQ, 319 + }, 320 + }; 321 + 322 + static struct platform_device sh_eth_device = { 323 + .name = "sh-eth", 324 + .id = -1, 325 + .dev = { 326 + .platform_data = &sh_eth_platdata, 327 + }, 328 + .resource = sh_eth_resources, 329 + .num_resources = ARRAY_SIZE(sh_eth_resources), 330 + }; 331 + 332 + /* LCDC */ 333 + static struct fb_videomode lcdc0_mode = { 334 + .name = "AMPIER/AM-800480", 335 + .xres = 800, 336 + .yres = 480, 337 + .left_margin = 88, 338 + .right_margin = 40, 339 + .hsync_len = 128, 340 + .upper_margin = 20, 341 + .lower_margin = 5, 342 + .vsync_len = 5, 343 + .sync = 0, 344 + }; 345 + 346 + static struct sh_mobile_lcdc_info lcdc0_info = { 347 + .clock_source = LCDC_CLK_BUS, 348 + .ch[0] = { 349 + .chan = LCDC_CHAN_MAINLCD, 350 + .fourcc = V4L2_PIX_FMT_RGB565, 351 + .interface_type = RGB24, 352 + .clock_divider = 5, 353 + .flags = 0, 354 + .lcd_modes = &lcdc0_mode, 355 + .num_modes = 1, 356 + .panel_cfg = { 357 + .width = 111, 358 + .height = 68, 359 + }, 360 + }, 361 + }; 362 + 363 + static struct resource lcdc0_resources[] = { 364 + [0] = { 365 + .name = "LCD0", 366 + .start = 0xfe940000, 367 + .end = 0xfe943fff, 368 + .flags = IORESOURCE_MEM, 369 + }, 370 + [1] = { 371 + .start = intcs_evt2irq(0x580), 372 + .flags = IORESOURCE_IRQ, 373 + }, 374 + }; 375 + 376 + static struct platform_device lcdc0_device = { 377 + .name = "sh_mobile_lcdc_fb", 378 + .num_resources = ARRAY_SIZE(lcdc0_resources), 379 + .resource = lcdc0_resources, 380 + .id = 0, 381 + .dev = { 382 + .platform_data = &lcdc0_info, 383 + .coherent_dma_mask = ~0, 384 + }, 385 + }; 386 + 387 + /* GPIO KEY */ 388 + #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 } 389 + 390 + static struct gpio_keys_button gpio_buttons[] = { 391 + GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW1"), 392 + GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW2"), 393 + GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW3"), 394 + GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW4"), 395 + }; 396 + 397 + static struct gpio_keys_platform_data gpio_key_info = { 398 + .buttons = gpio_buttons, 399 + .nbuttons = ARRAY_SIZE(gpio_buttons), 400 + }; 401 + 402 + static struct platform_device gpio_keys_device = { 403 + .name = "gpio-keys", 404 + .id = -1, 405 + .dev = { 406 + .platform_data = &gpio_key_info, 407 + }, 408 + }; 409 + 410 + /* SDHI0 */ 411 + /* 412 + * FIXME 413 + * 414 + * It use polling mode here, since 415 + * CD (= Card Detect) pin is not connected to SDHI0_CD. 416 + * We can use IRQ31 as card detect irq, 417 + * but it needs chattering removal operation 418 + */ 419 + #define IRQ31 evt2irq(0x33E0) 420 + static struct sh_mobile_sdhi_info sdhi0_info = { 421 + .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |\ 422 + MMC_CAP_NEEDS_POLL, 423 + .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 424 + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, 425 + }; 426 + 427 + static struct resource sdhi0_resources[] = { 428 + { 429 + .name = "SDHI0", 430 + .start = 0xe6850000, 431 + .end = 0xe6850100 - 1, 432 + .flags = IORESOURCE_MEM, 433 + }, 434 + /* 435 + * no SH_MOBILE_SDHI_IRQ_CARD_DETECT here 436 + */ 437 + { 438 + .name = SH_MOBILE_SDHI_IRQ_SDCARD, 439 + .start = evt2irq(0x0E20), 440 + .flags = IORESOURCE_IRQ, 441 + }, 442 + { 443 + .name = SH_MOBILE_SDHI_IRQ_SDIO, 444 + .start = evt2irq(0x0E40), 445 + .flags = IORESOURCE_IRQ, 446 + }, 447 + }; 448 + 449 + static struct platform_device sdhi0_device = { 450 + .name = "sh_mobile_sdhi", 451 + .id = 0, 452 + .dev = { 453 + .platform_data = &sdhi0_info, 454 + }, 455 + .num_resources = ARRAY_SIZE(sdhi0_resources), 456 + .resource = sdhi0_resources, 457 + }; 458 + 459 + /* SDHI1 */ 460 + static struct sh_mobile_sdhi_info sdhi1_info = { 461 + .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, 462 + .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 463 + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, 464 + }; 465 + 466 + static struct resource sdhi1_resources[] = { 467 + [0] = { 468 + .name = "SDHI1", 469 + .start = 0xe6860000, 470 + .end = 0xe6860100 - 1, 471 + .flags = IORESOURCE_MEM, 472 + }, 473 + [1] = { 474 + .start = evt2irq(0x0E80), 475 + .flags = IORESOURCE_IRQ, 476 + }, 477 + [2] = { 478 + .start = evt2irq(0x0EA0), 479 + .flags = IORESOURCE_IRQ, 480 + }, 481 + [3] = { 482 + .start = evt2irq(0x0EC0), 483 + .flags = IORESOURCE_IRQ, 484 + }, 485 + }; 486 + 487 + static struct platform_device sdhi1_device = { 488 + .name = "sh_mobile_sdhi", 489 + .id = 1, 490 + .dev = { 491 + .platform_data = &sdhi1_info, 492 + }, 493 + .num_resources = ARRAY_SIZE(sdhi1_resources), 494 + .resource = sdhi1_resources, 495 + }; 496 + 497 + /* MMCIF */ 498 + static struct sh_mmcif_plat_data sh_mmcif_plat = { 499 + .sup_pclk = 0, 500 + .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 501 + .caps = MMC_CAP_4_BIT_DATA | 502 + MMC_CAP_8_BIT_DATA | 503 + MMC_CAP_NONREMOVABLE, 504 + }; 505 + 506 + static struct resource sh_mmcif_resources[] = { 507 + [0] = { 508 + .name = "MMCIF", 509 + .start = 0xe6bd0000, 510 + .end = 0xe6bd0100 - 1, 511 + .flags = IORESOURCE_MEM, 512 + }, 513 + [1] = { 514 + /* MMC ERR */ 515 + .start = evt2irq(0x1AC0), 516 + .flags = IORESOURCE_IRQ, 517 + }, 518 + [2] = { 519 + /* MMC NOR */ 520 + .start = evt2irq(0x1AE0), 521 + .flags = IORESOURCE_IRQ, 522 + }, 523 + }; 524 + 525 + static struct platform_device sh_mmcif_device = { 526 + .name = "sh_mmcif", 527 + .id = -1, 528 + .dev = { 529 + .platform_data = &sh_mmcif_plat, 530 + }, 531 + .num_resources = ARRAY_SIZE(sh_mmcif_resources), 532 + .resource = sh_mmcif_resources, 533 + }; 534 + 535 + /* I2C */ 536 + static struct i2c_board_info i2c0_devices[] = { 537 + { 538 + I2C_BOARD_INFO("st1232-ts", 0x55), 539 + .irq = evt2irq(0x0340), 540 + }, 541 + }; 542 + 543 + /* 544 + * board devices 545 + */ 546 + static struct platform_device *eva_devices[] __initdata = { 547 + &lcdc0_device, 548 + &gpio_keys_device, 549 + &sh_eth_device, 550 + &sdhi0_device, 551 + &sh_mmcif_device, 552 + }; 553 + 554 + static void __init eva_clock_init(void) 555 + { 556 + struct clk *system = clk_get(NULL, "system_clk"); 557 + struct clk *xtal1 = clk_get(NULL, "extal1"); 558 + struct clk *usb24s = clk_get(NULL, "usb24s"); 559 + 560 + if (IS_ERR(system) || 561 + IS_ERR(xtal1) || 562 + IS_ERR(usb24s)) { 563 + pr_err("armadillo800eva board clock init failed\n"); 564 + goto clock_error; 565 + } 566 + 567 + /* armadillo 800 eva extal1 is 24MHz */ 568 + clk_set_rate(xtal1, 24000000); 569 + 570 + /* usb24s use extal1 (= system) clock (= 24MHz) */ 571 + clk_set_parent(usb24s, system); 572 + 573 + clock_error: 574 + if (!IS_ERR(system)) 575 + clk_put(system); 576 + if (!IS_ERR(xtal1)) 577 + clk_put(xtal1); 578 + if (!IS_ERR(usb24s)) 579 + clk_put(usb24s); 580 + } 581 + 582 + /* 583 + * board init 584 + */ 585 + static void __init eva_init(void) 586 + { 587 + eva_clock_init(); 588 + 589 + r8a7740_pinmux_init(); 590 + 591 + /* SCIFA1 */ 592 + gpio_request(GPIO_FN_SCIFA1_RXD, NULL); 593 + gpio_request(GPIO_FN_SCIFA1_TXD, NULL); 594 + 595 + /* LCDC0 */ 596 + gpio_request(GPIO_FN_LCDC0_SELECT, NULL); 597 + gpio_request(GPIO_FN_LCD0_D0, NULL); 598 + gpio_request(GPIO_FN_LCD0_D1, NULL); 599 + gpio_request(GPIO_FN_LCD0_D2, NULL); 600 + gpio_request(GPIO_FN_LCD0_D3, NULL); 601 + gpio_request(GPIO_FN_LCD0_D4, NULL); 602 + gpio_request(GPIO_FN_LCD0_D5, NULL); 603 + gpio_request(GPIO_FN_LCD0_D6, NULL); 604 + gpio_request(GPIO_FN_LCD0_D7, NULL); 605 + gpio_request(GPIO_FN_LCD0_D8, NULL); 606 + gpio_request(GPIO_FN_LCD0_D9, NULL); 607 + gpio_request(GPIO_FN_LCD0_D10, NULL); 608 + gpio_request(GPIO_FN_LCD0_D11, NULL); 609 + gpio_request(GPIO_FN_LCD0_D12, NULL); 610 + gpio_request(GPIO_FN_LCD0_D13, NULL); 611 + gpio_request(GPIO_FN_LCD0_D14, NULL); 612 + gpio_request(GPIO_FN_LCD0_D15, NULL); 613 + gpio_request(GPIO_FN_LCD0_D16, NULL); 614 + gpio_request(GPIO_FN_LCD0_D17, NULL); 615 + gpio_request(GPIO_FN_LCD0_D18_PORT40, NULL); 616 + gpio_request(GPIO_FN_LCD0_D19_PORT4, NULL); 617 + gpio_request(GPIO_FN_LCD0_D20_PORT3, NULL); 618 + gpio_request(GPIO_FN_LCD0_D21_PORT2, NULL); 619 + gpio_request(GPIO_FN_LCD0_D22_PORT0, NULL); 620 + gpio_request(GPIO_FN_LCD0_D23_PORT1, NULL); 621 + gpio_request(GPIO_FN_LCD0_DCK, NULL); 622 + gpio_request(GPIO_FN_LCD0_VSYN, NULL); 623 + gpio_request(GPIO_FN_LCD0_HSYN, NULL); 624 + gpio_request(GPIO_FN_LCD0_DISP, NULL); 625 + gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL); 626 + 627 + gpio_request(GPIO_PORT61, NULL); /* LCDDON */ 628 + gpio_direction_output(GPIO_PORT61, 1); 629 + 630 + gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */ 631 + gpio_direction_output(GPIO_PORT202, 0); 632 + 633 + /* Touchscreen */ 634 + gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */ 635 + gpio_request(GPIO_PORT166, NULL); /* TP_RST_B */ 636 + gpio_direction_output(GPIO_PORT166, 1); 637 + 638 + /* GETHER */ 639 + gpio_request(GPIO_FN_ET_CRS, NULL); 640 + gpio_request(GPIO_FN_ET_MDC, NULL); 641 + gpio_request(GPIO_FN_ET_MDIO, NULL); 642 + gpio_request(GPIO_FN_ET_TX_ER, NULL); 643 + gpio_request(GPIO_FN_ET_RX_ER, NULL); 644 + gpio_request(GPIO_FN_ET_ERXD0, NULL); 645 + gpio_request(GPIO_FN_ET_ERXD1, NULL); 646 + gpio_request(GPIO_FN_ET_ERXD2, NULL); 647 + gpio_request(GPIO_FN_ET_ERXD3, NULL); 648 + gpio_request(GPIO_FN_ET_TX_CLK, NULL); 649 + gpio_request(GPIO_FN_ET_TX_EN, NULL); 650 + gpio_request(GPIO_FN_ET_ETXD0, NULL); 651 + gpio_request(GPIO_FN_ET_ETXD1, NULL); 652 + gpio_request(GPIO_FN_ET_ETXD2, NULL); 653 + gpio_request(GPIO_FN_ET_ETXD3, NULL); 654 + gpio_request(GPIO_FN_ET_PHY_INT, NULL); 655 + gpio_request(GPIO_FN_ET_COL, NULL); 656 + gpio_request(GPIO_FN_ET_RX_DV, NULL); 657 + gpio_request(GPIO_FN_ET_RX_CLK, NULL); 658 + 659 + gpio_request(GPIO_PORT18, NULL); /* PHY_RST */ 660 + gpio_direction_output(GPIO_PORT18, 1); 661 + 662 + /* USB */ 663 + gpio_request(GPIO_PORT159, NULL); /* USB_DEVICE_MODE */ 664 + gpio_direction_input(GPIO_PORT159); 665 + 666 + if (gpio_get_value(GPIO_PORT159)) { 667 + /* USB Host */ 668 + } else { 669 + /* USB Func */ 670 + gpio_request(GPIO_FN_VBUS, NULL); 671 + platform_device_register(&usbhsf_device); 672 + } 673 + 674 + /* SDHI0 */ 675 + gpio_request(GPIO_FN_SDHI0_CMD, NULL); 676 + gpio_request(GPIO_FN_SDHI0_CLK, NULL); 677 + gpio_request(GPIO_FN_SDHI0_D0, NULL); 678 + gpio_request(GPIO_FN_SDHI0_D1, NULL); 679 + gpio_request(GPIO_FN_SDHI0_D2, NULL); 680 + gpio_request(GPIO_FN_SDHI0_D3, NULL); 681 + gpio_request(GPIO_FN_SDHI0_WP, NULL); 682 + 683 + gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */ 684 + gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */ 685 + gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */ 686 + gpio_direction_output(GPIO_PORT17, 0); 687 + gpio_direction_output(GPIO_PORT74, 1); 688 + gpio_direction_output(GPIO_PORT75, 1); 689 + 690 + /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */ 691 + 692 + /* 693 + * MMCIF 694 + * 695 + * Here doesn't care SW1.4 status, 696 + * since CON2 is not mounted. 697 + */ 698 + gpio_request(GPIO_FN_MMC1_CLK_PORT103, NULL); 699 + gpio_request(GPIO_FN_MMC1_CMD_PORT104, NULL); 700 + gpio_request(GPIO_FN_MMC1_D0_PORT149, NULL); 701 + gpio_request(GPIO_FN_MMC1_D1_PORT148, NULL); 702 + gpio_request(GPIO_FN_MMC1_D2_PORT147, NULL); 703 + gpio_request(GPIO_FN_MMC1_D3_PORT146, NULL); 704 + gpio_request(GPIO_FN_MMC1_D4_PORT145, NULL); 705 + gpio_request(GPIO_FN_MMC1_D5_PORT144, NULL); 706 + gpio_request(GPIO_FN_MMC1_D6_PORT143, NULL); 707 + gpio_request(GPIO_FN_MMC1_D7_PORT142, NULL); 708 + 709 + /* 710 + * CAUTION 711 + * 712 + * DBGMD/LCDC0/FSIA MUX 713 + * DBGMD_SELECT_B should be set after setting PFC Function. 714 + */ 715 + gpio_request(GPIO_PORT176, NULL); 716 + gpio_direction_output(GPIO_PORT176, 1); 717 + 718 + /* 719 + * We can switch CON8/CON14 by SW1.5, 720 + * but it needs after DBGMD_SELECT_B 721 + */ 722 + gpio_request(GPIO_PORT6, NULL); 723 + gpio_direction_input(GPIO_PORT6); 724 + if (gpio_get_value(GPIO_PORT6)) { 725 + /* CON14 enable */ 726 + } else { 727 + /* CON8 (SDHI1) enable */ 728 + gpio_request(GPIO_FN_SDHI1_CLK, NULL); 729 + gpio_request(GPIO_FN_SDHI1_CMD, NULL); 730 + gpio_request(GPIO_FN_SDHI1_D0, NULL); 731 + gpio_request(GPIO_FN_SDHI1_D1, NULL); 732 + gpio_request(GPIO_FN_SDHI1_D2, NULL); 733 + gpio_request(GPIO_FN_SDHI1_D3, NULL); 734 + gpio_request(GPIO_FN_SDHI1_CD, NULL); 735 + gpio_request(GPIO_FN_SDHI1_WP, NULL); 736 + 737 + gpio_request(GPIO_PORT16, NULL); /* SDSLOT2_PON */ 738 + gpio_direction_output(GPIO_PORT16, 1); 739 + 740 + platform_device_register(&sdhi1_device); 741 + } 742 + 743 + 744 + #ifdef CONFIG_CACHE_L2X0 745 + /* Early BRESP enable, Shared attribute override enable, 32K*8way */ 746 + l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff); 747 + #endif 748 + 749 + i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); 750 + 751 + r8a7740_add_standard_devices(); 752 + 753 + platform_add_devices(eva_devices, 754 + ARRAY_SIZE(eva_devices)); 755 + } 756 + 757 + static void __init eva_earlytimer_init(void) 758 + { 759 + r8a7740_clock_init(MD_CK0 | MD_CK2); 760 + shmobile_earlytimer_init(); 761 + } 762 + 763 + static void __init eva_add_early_devices(void) 764 + { 765 + r8a7740_add_early_devices(); 766 + 767 + /* override timer setup with board-specific code */ 768 + shmobile_timer.init = eva_earlytimer_init; 769 + } 770 + 771 + static const char *eva_boards_compat_dt[] __initdata = { 772 + "renesas,armadillo800eva", 773 + NULL, 774 + }; 775 + 776 + DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva") 777 + .map_io = r8a7740_map_io, 778 + .init_early = eva_add_early_devices, 779 + .init_irq = r8a7740_init_irq, 780 + .handle_irq = shmobile_handle_irq_intc, 781 + .init_machine = eva_init, 782 + .timer = &shmobile_timer, 783 + .dt_compat = eva_boards_compat_dt, 784 + MACHINE_END
+1 -1
arch/arm/mach-shmobile/board-bonito.c
··· 486 486 shmobile_earlytimer_init(); 487 487 } 488 488 489 - void __init bonito_add_early_devices(void) 489 + static void __init bonito_add_early_devices(void) 490 490 { 491 491 r8a7740_add_early_devices(); 492 492
+460
arch/arm/mach-shmobile/board-kzm9g.c
··· 1 + /* 2 + * KZM-A9-GT board support 3 + * 4 + * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; version 2 of the License. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU General Public License 16 + * along with this program; if not, write to the Free Software 17 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 + */ 19 + 20 + #include <linux/delay.h> 21 + #include <linux/gpio.h> 22 + #include <linux/gpio_keys.h> 23 + #include <linux/io.h> 24 + #include <linux/irq.h> 25 + #include <linux/i2c.h> 26 + #include <linux/i2c/pcf857x.h> 27 + #include <linux/input.h> 28 + #include <linux/mmc/host.h> 29 + #include <linux/mmc/sh_mmcif.h> 30 + #include <linux/mmc/sh_mobile_sdhi.h> 31 + #include <linux/mfd/tmio.h> 32 + #include <linux/platform_device.h> 33 + #include <linux/smsc911x.h> 34 + #include <linux/usb/r8a66597.h> 35 + #include <linux/videodev2.h> 36 + #include <mach/irqs.h> 37 + #include <mach/sh73a0.h> 38 + #include <mach/common.h> 39 + #include <asm/hardware/cache-l2x0.h> 40 + #include <asm/hardware/gic.h> 41 + #include <asm/mach-types.h> 42 + #include <asm/mach/arch.h> 43 + #include <video/sh_mobile_lcdc.h> 44 + 45 + /* 46 + * external GPIO 47 + */ 48 + #define GPIO_PCF8575_BASE (GPIO_NR) 49 + #define GPIO_PCF8575_PORT10 (GPIO_NR + 8) 50 + #define GPIO_PCF8575_PORT11 (GPIO_NR + 9) 51 + #define GPIO_PCF8575_PORT12 (GPIO_NR + 10) 52 + #define GPIO_PCF8575_PORT13 (GPIO_NR + 11) 53 + #define GPIO_PCF8575_PORT14 (GPIO_NR + 12) 54 + #define GPIO_PCF8575_PORT15 (GPIO_NR + 13) 55 + #define GPIO_PCF8575_PORT16 (GPIO_NR + 14) 56 + 57 + /* SMSC 9221 */ 58 + static struct resource smsc9221_resources[] = { 59 + [0] = { 60 + .start = 0x10000000, /* CS4 */ 61 + .end = 0x100000ff, 62 + .flags = IORESOURCE_MEM, 63 + }, 64 + [1] = { 65 + .start = intcs_evt2irq(0x260), /* IRQ3 */ 66 + .flags = IORESOURCE_IRQ, 67 + }, 68 + }; 69 + 70 + static struct smsc911x_platform_config smsc9221_platdata = { 71 + .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, 72 + .phy_interface = PHY_INTERFACE_MODE_MII, 73 + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 74 + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 75 + }; 76 + 77 + static struct platform_device smsc_device = { 78 + .name = "smsc911x", 79 + .dev = { 80 + .platform_data = &smsc9221_platdata, 81 + }, 82 + .resource = smsc9221_resources, 83 + .num_resources = ARRAY_SIZE(smsc9221_resources), 84 + }; 85 + 86 + /* USB external chip */ 87 + static struct r8a66597_platdata usb_host_data = { 88 + .on_chip = 0, 89 + .xtal = R8A66597_PLATDATA_XTAL_48MHZ, 90 + }; 91 + 92 + static struct resource usb_resources[] = { 93 + [0] = { 94 + .start = 0x10010000, 95 + .end = 0x1001ffff - 1, 96 + .flags = IORESOURCE_MEM, 97 + }, 98 + [1] = { 99 + .start = intcs_evt2irq(0x220), /* IRQ1 */ 100 + .flags = IORESOURCE_IRQ, 101 + }, 102 + }; 103 + 104 + static struct platform_device usb_host_device = { 105 + .name = "r8a66597_hcd", 106 + .dev = { 107 + .platform_data = &usb_host_data, 108 + .dma_mask = NULL, 109 + .coherent_dma_mask = 0xffffffff, 110 + }, 111 + .num_resources = ARRAY_SIZE(usb_resources), 112 + .resource = usb_resources, 113 + }; 114 + 115 + /* LCDC */ 116 + static struct fb_videomode kzm_lcdc_mode = { 117 + .name = "WVGA Panel", 118 + .xres = 800, 119 + .yres = 480, 120 + .left_margin = 220, 121 + .right_margin = 110, 122 + .hsync_len = 70, 123 + .upper_margin = 20, 124 + .lower_margin = 5, 125 + .vsync_len = 5, 126 + .sync = 0, 127 + }; 128 + 129 + static struct sh_mobile_lcdc_info lcdc_info = { 130 + .clock_source = LCDC_CLK_BUS, 131 + .ch[0] = { 132 + .chan = LCDC_CHAN_MAINLCD, 133 + .fourcc = V4L2_PIX_FMT_RGB565, 134 + .interface_type = RGB24, 135 + .lcd_modes = &kzm_lcdc_mode, 136 + .num_modes = 1, 137 + .clock_divider = 5, 138 + .flags = 0, 139 + .panel_cfg = { 140 + .width = 152, 141 + .height = 91, 142 + }, 143 + } 144 + }; 145 + 146 + static struct resource lcdc_resources[] = { 147 + [0] = { 148 + .name = "LCDC", 149 + .start = 0xfe940000, 150 + .end = 0xfe943fff, 151 + .flags = IORESOURCE_MEM, 152 + }, 153 + [1] = { 154 + .start = intcs_evt2irq(0x580), 155 + .flags = IORESOURCE_IRQ, 156 + }, 157 + }; 158 + 159 + static struct platform_device lcdc_device = { 160 + .name = "sh_mobile_lcdc_fb", 161 + .num_resources = ARRAY_SIZE(lcdc_resources), 162 + .resource = lcdc_resources, 163 + .dev = { 164 + .platform_data = &lcdc_info, 165 + .coherent_dma_mask = ~0, 166 + }, 167 + }; 168 + 169 + /* MMCIF */ 170 + static struct resource sh_mmcif_resources[] = { 171 + [0] = { 172 + .name = "MMCIF", 173 + .start = 0xe6bd0000, 174 + .end = 0xe6bd00ff, 175 + .flags = IORESOURCE_MEM, 176 + }, 177 + [1] = { 178 + .start = gic_spi(141), 179 + .flags = IORESOURCE_IRQ, 180 + }, 181 + [2] = { 182 + .start = gic_spi(140), 183 + .flags = IORESOURCE_IRQ, 184 + }, 185 + }; 186 + 187 + static struct sh_mmcif_plat_data sh_mmcif_platdata = { 188 + .ocr = MMC_VDD_165_195, 189 + .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, 190 + }; 191 + 192 + static struct platform_device mmc_device = { 193 + .name = "sh_mmcif", 194 + .dev = { 195 + .dma_mask = NULL, 196 + .coherent_dma_mask = 0xffffffff, 197 + .platform_data = &sh_mmcif_platdata, 198 + }, 199 + .num_resources = ARRAY_SIZE(sh_mmcif_resources), 200 + .resource = sh_mmcif_resources, 201 + }; 202 + 203 + /* SDHI */ 204 + static struct sh_mobile_sdhi_info sdhi0_info = { 205 + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, 206 + .tmio_caps = MMC_CAP_SD_HIGHSPEED, 207 + .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, 208 + }; 209 + 210 + static struct resource sdhi0_resources[] = { 211 + [0] = { 212 + .name = "SDHI0", 213 + .start = 0xee100000, 214 + .end = 0xee1000ff, 215 + .flags = IORESOURCE_MEM, 216 + }, 217 + [1] = { 218 + .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT, 219 + .start = gic_spi(83), 220 + .flags = IORESOURCE_IRQ, 221 + }, 222 + [2] = { 223 + .name = SH_MOBILE_SDHI_IRQ_SDCARD, 224 + .start = gic_spi(84), 225 + .flags = IORESOURCE_IRQ, 226 + }, 227 + [3] = { 228 + .name = SH_MOBILE_SDHI_IRQ_SDIO, 229 + .start = gic_spi(85), 230 + .flags = IORESOURCE_IRQ, 231 + }, 232 + }; 233 + 234 + static struct platform_device sdhi0_device = { 235 + .name = "sh_mobile_sdhi", 236 + .num_resources = ARRAY_SIZE(sdhi0_resources), 237 + .resource = sdhi0_resources, 238 + .dev = { 239 + .platform_data = &sdhi0_info, 240 + }, 241 + }; 242 + 243 + /* KEY */ 244 + #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 } 245 + 246 + static struct gpio_keys_button gpio_buttons[] = { 247 + GPIO_KEY(KEY_BACK, GPIO_PCF8575_PORT10, "SW3"), 248 + GPIO_KEY(KEY_RIGHT, GPIO_PCF8575_PORT11, "SW2-R"), 249 + GPIO_KEY(KEY_LEFT, GPIO_PCF8575_PORT12, "SW2-L"), 250 + GPIO_KEY(KEY_ENTER, GPIO_PCF8575_PORT13, "SW2-P"), 251 + GPIO_KEY(KEY_UP, GPIO_PCF8575_PORT14, "SW2-U"), 252 + GPIO_KEY(KEY_DOWN, GPIO_PCF8575_PORT15, "SW2-D"), 253 + GPIO_KEY(KEY_HOME, GPIO_PCF8575_PORT16, "SW1"), 254 + }; 255 + 256 + static struct gpio_keys_platform_data gpio_key_info = { 257 + .buttons = gpio_buttons, 258 + .nbuttons = ARRAY_SIZE(gpio_buttons), 259 + .poll_interval = 250, /* poling at this point */ 260 + }; 261 + 262 + static struct platform_device gpio_keys_device = { 263 + /* gpio-pcf857x.c driver doesn't support gpio_to_irq() */ 264 + .name = "gpio-keys-polled", 265 + .dev = { 266 + .platform_data = &gpio_key_info, 267 + }, 268 + }; 269 + 270 + /* I2C */ 271 + static struct pcf857x_platform_data pcf8575_pdata = { 272 + .gpio_base = GPIO_PCF8575_BASE, 273 + }; 274 + 275 + static struct i2c_board_info i2c1_devices[] = { 276 + { 277 + I2C_BOARD_INFO("st1232-ts", 0x55), 278 + .irq = intcs_evt2irq(0x300), /* IRQ8 */ 279 + }, 280 + }; 281 + 282 + static struct i2c_board_info i2c3_devices[] = { 283 + { 284 + I2C_BOARD_INFO("pcf8575", 0x20), 285 + .platform_data = &pcf8575_pdata, 286 + }, 287 + }; 288 + 289 + static struct platform_device *kzm_devices[] __initdata = { 290 + &smsc_device, 291 + &usb_host_device, 292 + &lcdc_device, 293 + &mmc_device, 294 + &sdhi0_device, 295 + &gpio_keys_device, 296 + }; 297 + 298 + /* 299 + * FIXME 300 + * 301 + * This is quick hack for enabling LCDC backlight 302 + */ 303 + static int __init as3711_enable_lcdc_backlight(void) 304 + { 305 + struct i2c_adapter *a = i2c_get_adapter(0); 306 + struct i2c_msg msg; 307 + int i, ret; 308 + __u8 magic[] = { 309 + 0x40, 0x2a, 310 + 0x43, 0x3c, 311 + 0x44, 0x3c, 312 + 0x45, 0x3c, 313 + 0x54, 0x03, 314 + 0x51, 0x00, 315 + 0x51, 0x01, 316 + 0xff, 0x00, /* wait */ 317 + 0x43, 0xf0, 318 + 0x44, 0xf0, 319 + 0x45, 0xf0, 320 + }; 321 + 322 + if (!machine_is_kzm9g()) 323 + return 0; 324 + 325 + if (!a) 326 + return 0; 327 + 328 + msg.addr = 0x40; 329 + msg.len = 2; 330 + msg.flags = 0; 331 + 332 + for (i = 0; i < ARRAY_SIZE(magic); i += 2) { 333 + msg.buf = magic + i; 334 + 335 + if (0xff == msg.buf[0]) { 336 + udelay(500); 337 + continue; 338 + } 339 + 340 + ret = i2c_transfer(a, &msg, 1); 341 + if (ret < 0) { 342 + pr_err("i2c transfer fail\n"); 343 + break; 344 + } 345 + } 346 + 347 + return 0; 348 + } 349 + device_initcall(as3711_enable_lcdc_backlight); 350 + 351 + static void __init kzm_init(void) 352 + { 353 + sh73a0_pinmux_init(); 354 + 355 + /* enable SCIFA4 */ 356 + gpio_request(GPIO_FN_SCIFA4_TXD, NULL); 357 + gpio_request(GPIO_FN_SCIFA4_RXD, NULL); 358 + gpio_request(GPIO_FN_SCIFA4_RTS_, NULL); 359 + gpio_request(GPIO_FN_SCIFA4_CTS_, NULL); 360 + 361 + /* CS4 for SMSC/USB */ 362 + gpio_request(GPIO_FN_CS4_, NULL); /* CS4 */ 363 + 364 + /* SMSC */ 365 + gpio_request(GPIO_PORT224, NULL); /* IRQ3 */ 366 + gpio_direction_input(GPIO_PORT224); 367 + 368 + /* LCDC */ 369 + gpio_request(GPIO_FN_LCDD23, NULL); 370 + gpio_request(GPIO_FN_LCDD22, NULL); 371 + gpio_request(GPIO_FN_LCDD21, NULL); 372 + gpio_request(GPIO_FN_LCDD20, NULL); 373 + gpio_request(GPIO_FN_LCDD19, NULL); 374 + gpio_request(GPIO_FN_LCDD18, NULL); 375 + gpio_request(GPIO_FN_LCDD17, NULL); 376 + gpio_request(GPIO_FN_LCDD16, NULL); 377 + gpio_request(GPIO_FN_LCDD15, NULL); 378 + gpio_request(GPIO_FN_LCDD14, NULL); 379 + gpio_request(GPIO_FN_LCDD13, NULL); 380 + gpio_request(GPIO_FN_LCDD12, NULL); 381 + gpio_request(GPIO_FN_LCDD11, NULL); 382 + gpio_request(GPIO_FN_LCDD10, NULL); 383 + gpio_request(GPIO_FN_LCDD9, NULL); 384 + gpio_request(GPIO_FN_LCDD8, NULL); 385 + gpio_request(GPIO_FN_LCDD7, NULL); 386 + gpio_request(GPIO_FN_LCDD6, NULL); 387 + gpio_request(GPIO_FN_LCDD5, NULL); 388 + gpio_request(GPIO_FN_LCDD4, NULL); 389 + gpio_request(GPIO_FN_LCDD3, NULL); 390 + gpio_request(GPIO_FN_LCDD2, NULL); 391 + gpio_request(GPIO_FN_LCDD1, NULL); 392 + gpio_request(GPIO_FN_LCDD0, NULL); 393 + gpio_request(GPIO_FN_LCDDISP, NULL); 394 + gpio_request(GPIO_FN_LCDDCK, NULL); 395 + 396 + gpio_request(GPIO_PORT222, NULL); /* LCDCDON */ 397 + gpio_request(GPIO_PORT226, NULL); /* SC */ 398 + gpio_direction_output(GPIO_PORT222, 1); 399 + gpio_direction_output(GPIO_PORT226, 1); 400 + 401 + /* Touchscreen */ 402 + gpio_request(GPIO_PORT223, NULL); /* IRQ8 */ 403 + gpio_direction_input(GPIO_PORT223); 404 + 405 + /* enable MMCIF */ 406 + gpio_request(GPIO_FN_MMCCLK0, NULL); 407 + gpio_request(GPIO_FN_MMCCMD0_PU, NULL); 408 + gpio_request(GPIO_FN_MMCD0_0_PU, NULL); 409 + gpio_request(GPIO_FN_MMCD0_1_PU, NULL); 410 + gpio_request(GPIO_FN_MMCD0_2_PU, NULL); 411 + gpio_request(GPIO_FN_MMCD0_3_PU, NULL); 412 + gpio_request(GPIO_FN_MMCD0_4_PU, NULL); 413 + gpio_request(GPIO_FN_MMCD0_5_PU, NULL); 414 + gpio_request(GPIO_FN_MMCD0_6_PU, NULL); 415 + gpio_request(GPIO_FN_MMCD0_7_PU, NULL); 416 + 417 + /* enable SD */ 418 + gpio_request(GPIO_FN_SDHIWP0, NULL); 419 + gpio_request(GPIO_FN_SDHICD0, NULL); 420 + gpio_request(GPIO_FN_SDHICMD0, NULL); 421 + gpio_request(GPIO_FN_SDHICLK0, NULL); 422 + gpio_request(GPIO_FN_SDHID0_3, NULL); 423 + gpio_request(GPIO_FN_SDHID0_2, NULL); 424 + gpio_request(GPIO_FN_SDHID0_1, NULL); 425 + gpio_request(GPIO_FN_SDHID0_0, NULL); 426 + gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL); 427 + gpio_request(GPIO_PORT15, NULL); 428 + gpio_direction_output(GPIO_PORT15, 1); /* power */ 429 + 430 + /* I2C 3 */ 431 + gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL); 432 + gpio_request(GPIO_FN_PORT28_I2C_SDA3, NULL); 433 + 434 + #ifdef CONFIG_CACHE_L2X0 435 + /* Early BRESP enable, Shared attribute override enable, 64K*8way */ 436 + l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff); 437 + #endif 438 + 439 + i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices)); 440 + i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices)); 441 + 442 + sh73a0_add_standard_devices(); 443 + platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices)); 444 + } 445 + 446 + static const char *kzm9g_boards_compat_dt[] __initdata = { 447 + "renesas,kzm9g", 448 + NULL, 449 + }; 450 + 451 + DT_MACHINE_START(KZM9G_DT, "kzm9g") 452 + .map_io = sh73a0_map_io, 453 + .init_early = sh73a0_add_early_devices, 454 + .nr_irqs = NR_IRQS_LEGACY, 455 + .init_irq = sh73a0_init_irq, 456 + .handle_irq = gic_handle_irq, 457 + .init_machine = kzm_init, 458 + .timer = &shmobile_timer, 459 + .dt_compat = kzm9g_boards_compat_dt, 460 + MACHINE_END
+8 -2
arch/arm/mach-shmobile/board-mackerel.c
··· 908 908 static struct sh_fsi_platform_info fsi_info = { 909 909 .port_a = { 910 910 .flags = SH_FSI_BRS_INV, 911 + .tx_id = SHDMA_SLAVE_FSIA_TX, 912 + .rx_id = SHDMA_SLAVE_FSIA_RX, 911 913 }, 912 914 .port_b = { 913 915 .flags = SH_FSI_BRS_INV | ··· 922 920 923 921 static struct resource fsi_resources[] = { 924 922 [0] = { 923 + /* we need 0xFE1F0000 to access DMA 924 + * instead of 0xFE3C0000 */ 925 925 .name = "FSI", 926 - .start = 0xFE3C0000, 927 - .end = 0xFE3C0400 - 1, 926 + .start = 0xFE1F0000, 927 + .end = 0xFE1F0400 - 1, 928 928 .flags = IORESOURCE_MEM, 929 929 }, 930 930 [1] = { ··· 1252 1248 1253 1249 static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 1254 1250 .flags = SH_CEU_FLAG_USE_8BIT_BUS, 1251 + .max_width = 8188, 1252 + .max_height = 8188, 1255 1253 }; 1256 1254 1257 1255 static struct resource ceu_resources[] = {
+3
arch/arm/mach-shmobile/clock-r8a7740.c
··· 352 352 353 353 MSTP329, MSTP328, MSTP323, MSTP320, 354 354 MSTP314, MSTP313, MSTP312, 355 + MSTP309, 355 356 356 357 MSTP416, MSTP415, MSTP407, MSTP406, 357 358 ··· 383 382 [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */ 384 383 [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */ 385 384 [MSTP312] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */ 385 + [MSTP309] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 9, 0), /* GEther */ 386 386 387 387 [MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 16, 0), /* USBHOST */ 388 388 [MSTP415] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */ ··· 449 447 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), 450 448 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), 451 449 CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]), 450 + CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP309]), 452 451 453 452 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), 454 453
+3
arch/arm/mach-shmobile/include/mach/sh73a0.h
··· 482 482 GPIO_FN_FSIAILR_PU, 483 483 GPIO_FN_FSIAIBT_PU, 484 484 GPIO_FN_FSIAISLD_PU, 485 + 486 + /* end of GPIO */ 487 + GPIO_NR, 485 488 }; 486 489 487 490 /* DMA slave IDs */
+2 -2
arch/arm/mach-shmobile/pfc-sh73a0.c
··· 829 829 PINMUX_DATA(PORT27_I2C_SCL2_MARK, PORT27_FN2, MSEL2CR_MSEL17_0, 830 830 MSEL2CR_MSEL16_1), \ 831 831 PINMUX_DATA(PORT27_I2C_SCL3_MARK, PORT27_FN3, MSEL2CR_MSEL19_0, 832 - MSEL2CR_MSEL18_0), \ 832 + MSEL2CR_MSEL18_1), \ 833 833 PINMUX_DATA(MFG0_OUT1_MARK, PORT27_FN4), \ 834 834 PINMUX_DATA(PORT27_IROUT_MARK, PORT27_FN7), 835 835 PINMUX_DATA(XDVFS2_MARK, PORT28_FN1), \ 836 836 PINMUX_DATA(PORT28_I2C_SDA2_MARK, PORT28_FN2, MSEL2CR_MSEL17_0, 837 837 MSEL2CR_MSEL16_1), \ 838 838 PINMUX_DATA(PORT28_I2C_SDA3_MARK, PORT28_FN3, MSEL2CR_MSEL19_0, 839 - MSEL2CR_MSEL18_0), \ 839 + MSEL2CR_MSEL18_1), \ 840 840 PINMUX_DATA(PORT28_TPU1TO1_MARK, PORT28_FN7), 841 841 PINMUX_DATA(SIM_RST_MARK, PORT29_FN1), \ 842 842 PINMUX_DATA(PORT29_TPU1TO1_MARK, PORT29_FN4),
+2 -1
arch/arm/mach-shmobile/platsmp.c
··· 22 22 #include <mach/common.h> 23 23 #include <mach/emev2.h> 24 24 25 - #define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2()) 25 + #define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2() || \ 26 + of_machine_is_compatible("renesas,sh73a0")) 26 27 #define is_r8a7779() machine_is_marzen() 27 28 #define is_emev2() of_machine_is_compatible("renesas,emev2") 28 29
+7
arch/arm/mach-shmobile/setup-r8a7740.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 19 */ 20 20 #include <linux/delay.h> 21 + #include <linux/dma-mapping.h> 21 22 #include <linux/kernel.h> 22 23 #include <linux/init.h> 23 24 #include <linux/io.h> ··· 61 60 void __init r8a7740_map_io(void) 62 61 { 63 62 iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc)); 63 + 64 + /* 65 + * DMA memory at 0xff200000 - 0xffdfffff. The default 2MB size isn't 66 + * enough to allocate the frame buffer memory. 67 + */ 68 + init_consistent_dma_size(12 << 20); 64 69 } 65 70 66 71 /* SCIFA0 */
+25 -2
arch/arm/plat-orion/gpio.c
··· 16 16 #include <linux/bitops.h> 17 17 #include <linux/io.h> 18 18 #include <linux/gpio.h> 19 + #include <linux/leds.h> 19 20 20 21 /* 21 22 * GPIO unit register offsets. ··· 290 289 return; 291 290 292 291 spin_lock_irqsave(&ochip->lock, flags); 293 - __set_level(ochip, pin, 0); 294 - __set_blinking(ochip, pin, blink); 292 + __set_level(ochip, pin & 31, 0); 293 + __set_blinking(ochip, pin & 31, blink); 295 294 spin_unlock_irqrestore(&ochip->lock, flags); 296 295 } 297 296 EXPORT_SYMBOL(orion_gpio_set_blink); 297 + 298 + #define ORION_BLINK_HALF_PERIOD 100 /* ms */ 299 + 300 + int orion_gpio_led_blink_set(unsigned gpio, int state, 301 + unsigned long *delay_on, unsigned long *delay_off) 302 + { 303 + 304 + if (delay_on && delay_off && !*delay_on && !*delay_off) 305 + *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD; 306 + 307 + switch (state) { 308 + case GPIO_LED_NO_BLINK_LOW: 309 + case GPIO_LED_NO_BLINK_HIGH: 310 + orion_gpio_set_blink(gpio, 0); 311 + gpio_set_value(gpio, state); 312 + break; 313 + case GPIO_LED_BLINK: 314 + orion_gpio_set_blink(gpio, 1); 315 + } 316 + return 0; 317 + } 318 + EXPORT_SYMBOL_GPL(orion_gpio_led_blink_set); 298 319 299 320 300 321 /*****************************************************************************
+2
arch/arm/plat-orion/include/plat/gpio.h
··· 19 19 */ 20 20 void orion_gpio_set_unused(unsigned pin); 21 21 void orion_gpio_set_blink(unsigned pin, int blink); 22 + int orion_gpio_led_blink_set(unsigned gpio, int state, 23 + unsigned long *delay_on, unsigned long *delay_off); 22 24 23 25 #define GPIO_INPUT_OK (1 << 0) 24 26 #define GPIO_OUTPUT_OK (1 << 1)
+44 -3
drivers/mtd/nand/orion_nand.c
··· 13 13 #include <linux/slab.h> 14 14 #include <linux/module.h> 15 15 #include <linux/platform_device.h> 16 + #include <linux/of.h> 16 17 #include <linux/mtd/mtd.h> 17 18 #include <linux/mtd/nand.h> 18 19 #include <linux/mtd/partitions.h> ··· 75 74 static int __init orion_nand_probe(struct platform_device *pdev) 76 75 { 77 76 struct mtd_info *mtd; 77 + struct mtd_part_parser_data ppdata = {}; 78 78 struct nand_chip *nc; 79 79 struct orion_nand_data *board; 80 80 struct resource *res; 81 81 void __iomem *io_base; 82 82 int ret = 0; 83 + u32 val = 0; 83 84 84 85 nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL); 85 86 if (!nc) { ··· 104 101 goto no_res; 105 102 } 106 103 107 - board = pdev->dev.platform_data; 104 + if (pdev->dev.of_node) { 105 + board = devm_kzalloc(&pdev->dev, sizeof(struct orion_nand_data), 106 + GFP_KERNEL); 107 + if (!board) { 108 + printk(KERN_ERR "orion_nand: failed to allocate board structure.\n"); 109 + ret = -ENOMEM; 110 + goto no_res; 111 + } 112 + if (!of_property_read_u32(pdev->dev.of_node, "cle", &val)) 113 + board->cle = (u8)val; 114 + else 115 + board->cle = 0; 116 + if (!of_property_read_u32(pdev->dev.of_node, "ale", &val)) 117 + board->ale = (u8)val; 118 + else 119 + board->ale = 1; 120 + if (!of_property_read_u32(pdev->dev.of_node, 121 + "bank-width", &val)) 122 + board->width = (u8)val * 8; 123 + else 124 + board->width = 8; 125 + if (!of_property_read_u32(pdev->dev.of_node, 126 + "chip-delay", &val)) 127 + board->chip_delay = (u8)val; 128 + } else 129 + board = pdev->dev.platform_data; 108 130 109 131 mtd->priv = nc; 110 132 mtd->owner = THIS_MODULE; ··· 142 114 143 115 if (board->chip_delay) 144 116 nc->chip_delay = board->chip_delay; 117 + 118 + WARN(board->width > 16, 119 + "%d bit bus width out of range", 120 + board->width); 145 121 146 122 if (board->width == 16) 147 123 nc->options |= NAND_BUSWIDTH_16; ··· 161 129 } 162 130 163 131 mtd->name = "orion_nand"; 164 - ret = mtd_device_parse_register(mtd, NULL, NULL, board->parts, 165 - board->nr_parts); 132 + ppdata.of_node = pdev->dev.of_node; 133 + ret = mtd_device_parse_register(mtd, NULL, &ppdata, 134 + board->parts, board->nr_parts); 166 135 if (ret) { 167 136 nand_release(mtd); 168 137 goto no_dev; ··· 194 161 return 0; 195 162 } 196 163 164 + #ifdef CONFIG_OF 165 + static struct of_device_id orion_nand_of_match_table[] = { 166 + { .compatible = "mrvl,orion-nand", }, 167 + {}, 168 + }; 169 + #endif 170 + 197 171 static struct platform_driver orion_nand_driver = { 198 172 .remove = __devexit_p(orion_nand_remove), 199 173 .driver = { 200 174 .name = "orion_nand", 201 175 .owner = THIS_MODULE, 176 + .of_match_table = of_match_ptr(orion_nand_of_match_table), 202 177 }, 203 178 }; 204 179
+1 -1
drivers/pcmcia/Kconfig
··· 217 217 || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ 218 218 || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ 219 219 || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI \ 220 - || MACH_COLIBRI320) 220 + || MACH_COLIBRI320 || MACH_H4700) 221 221 select PCMCIA_SA1111 if ARCH_LUBBOCK && SA1111 222 222 select PCMCIA_SOC_COMMON 223 223 help
+1
drivers/pcmcia/Makefile
··· 69 69 pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o 70 70 pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o 71 71 pxa2xx-obj-$(CONFIG_MACH_COLIBRI320) += pxa2xx_colibri.o 72 + pxa2xx-obj-$(CONFIG_MACH_H4700) += pxa2xx_hx4700.o 72 73 73 74 obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y) 74 75
+121
drivers/pcmcia/pxa2xx_hx4700.c
··· 1 + /* 2 + * Copyright (C) 2012 Paul Parsons <lost.distance@yahoo.com> 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #include <linux/module.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/err.h> 12 + #include <linux/gpio.h> 13 + #include <linux/irq.h> 14 + 15 + #include <asm/mach-types.h> 16 + #include <mach/hx4700.h> 17 + 18 + #include "soc_common.h" 19 + 20 + static struct gpio gpios[] = { 21 + { GPIO114_HX4700_CF_RESET, GPIOF_OUT_INIT_LOW, "CF reset" }, 22 + { EGPIO4_CF_3V3_ON, GPIOF_OUT_INIT_LOW, "CF 3.3V enable" }, 23 + }; 24 + 25 + static int hx4700_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 26 + { 27 + int ret; 28 + 29 + ret = gpio_request_array(gpios, ARRAY_SIZE(gpios)); 30 + if (ret) 31 + goto out; 32 + 33 + /* 34 + * IRQ type must be set before soc_pcmcia_hw_init() calls request_irq(). 35 + * The asic3 default IRQ type is level trigger low level detect, exactly 36 + * the the signal present on GPIOD4_CF_nCD when a CF card is inserted. 37 + * If the IRQ type is not changed, the asic3 interrupt handler will loop 38 + * repeatedly because it is unable to clear the level trigger interrupt. 39 + */ 40 + irq_set_irq_type(gpio_to_irq(GPIOD4_CF_nCD), IRQ_TYPE_EDGE_BOTH); 41 + 42 + skt->stat[SOC_STAT_CD].gpio = GPIOD4_CF_nCD; 43 + skt->stat[SOC_STAT_CD].name = "PCMCIA CD"; 44 + skt->stat[SOC_STAT_RDY].gpio = GPIO60_HX4700_CF_RNB; 45 + skt->stat[SOC_STAT_RDY].name = "PCMCIA Ready"; 46 + 47 + out: 48 + return ret; 49 + } 50 + 51 + static void hx4700_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 52 + { 53 + gpio_free_array(gpios, ARRAY_SIZE(gpios)); 54 + } 55 + 56 + static void hx4700_pcmcia_socket_state(struct soc_pcmcia_socket *skt, 57 + struct pcmcia_state *state) 58 + { 59 + state->vs_3v = 1; 60 + state->vs_Xv = 0; 61 + } 62 + 63 + static int hx4700_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, 64 + const socket_state_t *state) 65 + { 66 + switch (state->Vcc) { 67 + case 0: 68 + gpio_set_value(EGPIO4_CF_3V3_ON, 0); 69 + break; 70 + case 33: 71 + gpio_set_value(EGPIO4_CF_3V3_ON, 1); 72 + break; 73 + default: 74 + printk(KERN_ERR "pcmcia: Unsupported Vcc: %d\n", state->Vcc); 75 + return -EINVAL; 76 + } 77 + 78 + gpio_set_value(GPIO114_HX4700_CF_RESET, (state->flags & SS_RESET) != 0); 79 + 80 + return 0; 81 + } 82 + 83 + static struct pcmcia_low_level hx4700_pcmcia_ops = { 84 + .owner = THIS_MODULE, 85 + .nr = 1, 86 + .hw_init = hx4700_pcmcia_hw_init, 87 + .hw_shutdown = hx4700_pcmcia_hw_shutdown, 88 + .socket_state = hx4700_pcmcia_socket_state, 89 + .configure_socket = hx4700_pcmcia_configure_socket, 90 + }; 91 + 92 + static struct platform_device *hx4700_pcmcia_device; 93 + 94 + static int __init hx4700_pcmcia_init(void) 95 + { 96 + struct platform_device *pdev; 97 + 98 + if (!machine_is_h4700()) 99 + return -ENODEV; 100 + 101 + pdev = platform_device_register_data(NULL, "pxa2xx-pcmcia", -1, 102 + &hx4700_pcmcia_ops, sizeof(hx4700_pcmcia_ops)); 103 + if (IS_ERR(pdev)) 104 + return PTR_ERR(pdev); 105 + 106 + hx4700_pcmcia_device = pdev; 107 + 108 + return 0; 109 + } 110 + 111 + static void __exit hx4700_pcmcia_exit(void) 112 + { 113 + platform_device_unregister(hx4700_pcmcia_device); 114 + } 115 + 116 + module_init(hx4700_pcmcia_init); 117 + module_exit(hx4700_pcmcia_exit); 118 + 119 + MODULE_AUTHOR("Paul Parsons <lost.distance@yahoo.com>"); 120 + MODULE_DESCRIPTION("HP iPAQ hx4700 PCMCIA driver"); 121 + MODULE_LICENSE("GPL");
+1
include/linux/mfd/asic3.h
··· 138 138 #define ASIC3_GPIOC13_nPWAIT ASIC3_CONFIG_GPIO(45, 1, 1, 0) 139 139 #define ASIC3_GPIOC14_nPIOIS16 ASIC3_CONFIG_GPIO(46, 1, 1, 0) 140 140 #define ASIC3_GPIOC15_nPIOR ASIC3_CONFIG_GPIO(47, 1, 0, 0) 141 + #define ASIC3_GPIOD4_CF_nCD ASIC3_CONFIG_GPIO(52, 1, 0, 0) 141 142 #define ASIC3_GPIOD11_nCIOIS16 ASIC3_CONFIG_GPIO(59, 1, 0, 0) 142 143 #define ASIC3_GPIOD12_nCWAIT ASIC3_CONFIG_GPIO(60, 1, 0, 0) 143 144 #define ASIC3_GPIOD15_nPIOW ASIC3_CONFIG_GPIO(63, 1, 0, 0)