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

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

Pull ARM SoC multiplatform code changes from Olof Johansson:
"The changes here belong to two main platforms:

- Atmel At91 is flipping the bit and going multiplatform. This
includes some cleanups and removal of code, and the final flip of
config dependencies

- Shmobile has several platforms that are going multiplatform, but
this branch also contains a bunch of cleanups that they weren't
able to keep separate in a good way. THere's also a removal of one
of their SoCs and the corresponding boards (sh7372 and mackerel)"

* tag 'armsoc-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (67 commits)
ARM: at91/pm: move AT91_MEMCTRL_* to pm.h
ARM: at91/pm: move the standby functions to pm.c
ARM: at91: fix pm_suspend.S compilation when ARMv6 is selected
ARM: at91: add a Kconfig dependency on multi-platform
ARM: at91: drop AT91_TIMER_HZ
ARM: at91: remove hardware.h
ARM: at91: remove SoC headers
ARM: at91: remove useless mach/cpu.h
ARM: at91: remove unused headers
ARM: at91: switch at91_dt_defconfig to multiplatform
ARM: at91: switch to multiplatform
ARM: shmobile: r8a7778: enable multiplatform target
ARM: shmobile: bockw: add sound to DT
ARM: shmobile: r8a7778: add sound to DT
ARM: shmobile: bockw: add devices hooked up to i2c0 to DT
DT: i2c: add trivial binding for OKI ML86V7667 video decoder
ARM: shmobile: r8a7778: common clock framework CPG driver
ARM: shmobile: bockw dts: set extal clock frequency
ARM: shmobile: bockw dts: Move Ethernet node to BSC
ARM: shmobile: r8a73a4: Remove legacy code
...

+2064 -10015
+1 -1
Documentation/Makefile
··· 1 - subdir-y := accounting arm auxdisplay blackfin connector \ 1 + subdir-y := accounting auxdisplay blackfin connector \ 2 2 filesystems filesystems ia64 laptops mic misc-devices \ 3 3 networking pcmcia prctl ptp spi timers vDSO video4linux \ 4 4 watchdog
-1
Documentation/arm/Makefile
··· 1 - subdir-y := SH-Mobile
-7
Documentation/arm/SH-Mobile/Makefile
··· 1 - # List of programs to build 2 - hostprogs-y := vrl4 3 - 4 - # Tell kbuild to always build the programs 5 - always := $(hostprogs-y) 6 - 7 - HOSTCFLAGS_vrl4.o += -I$(objtree)/usr/include -I$(srctree)/tools/include
-170
Documentation/arm/SH-Mobile/vrl4.c
··· 1 - /* 2 - * vrl4 format generator 3 - * 4 - * Copyright (C) 2010 Simon Horman 5 - * 6 - * This file is subject to the terms and conditions of the GNU General Public 7 - * License. See the file "COPYING" in the main directory of this archive 8 - * for more details. 9 - */ 10 - 11 - /* 12 - * usage: vrl4 < zImage > out 13 - * dd if=out of=/dev/sdx bs=512 seek=1 # Write the image to sector 1 14 - * 15 - * Reads a zImage from stdin and writes a vrl4 image to stdout. 16 - * In practice this means writing a padded vrl4 header to stdout followed 17 - * by the zImage. 18 - * 19 - * The padding places the zImage at ALIGN bytes into the output. 20 - * The vrl4 uses ALIGN + START_BASE as the start_address. 21 - * This is where the mask ROM will jump to after verifying the header. 22 - * 23 - * The header sets copy_size to min(sizeof(zImage), MAX_BOOT_PROG_LEN) + ALIGN. 24 - * That is, the mask ROM will load the padded header (ALIGN bytes) 25 - * And then MAX_BOOT_PROG_LEN bytes of the image, or the entire image, 26 - * whichever is smaller. 27 - * 28 - * The zImage is not modified in any way. 29 - */ 30 - 31 - #define _BSD_SOURCE 32 - #include <endian.h> 33 - #include <unistd.h> 34 - #include <stdint.h> 35 - #include <stdio.h> 36 - #include <errno.h> 37 - #include <tools/endian.h> 38 - 39 - struct hdr { 40 - uint32_t magic1; 41 - uint32_t reserved1; 42 - uint32_t magic2; 43 - uint32_t reserved2; 44 - uint16_t copy_size; 45 - uint16_t boot_options; 46 - uint32_t reserved3; 47 - uint32_t start_address; 48 - uint32_t reserved4; 49 - uint32_t reserved5; 50 - char reserved6[308]; 51 - }; 52 - 53 - #define DECLARE_HDR(h) \ 54 - struct hdr (h) = { \ 55 - .magic1 = htole32(0xea000000), \ 56 - .reserved1 = htole32(0x56), \ 57 - .magic2 = htole32(0xe59ff008), \ 58 - .reserved3 = htole16(0x1) } 59 - 60 - /* Align to 512 bytes, the MMCIF sector size */ 61 - #define ALIGN_BITS 9 62 - #define ALIGN (1 << ALIGN_BITS) 63 - 64 - #define START_BASE 0xe55b0000 65 - 66 - /* 67 - * With an alignment of 512 the header uses the first sector. 68 - * There is a 128 sector (64kbyte) limit on the data loaded by the mask ROM. 69 - * So there are 127 sectors left for the boot programme. But in practice 70 - * Only a small portion of a zImage is needed, 16 sectors should be more 71 - * than enough. 72 - * 73 - * Note that this sets how much of the zImage is copied by the mask ROM. 74 - * The entire zImage is present after the header and is loaded 75 - * by the code in the boot program (which is the first portion of the zImage). 76 - */ 77 - #define MAX_BOOT_PROG_LEN (16 * 512) 78 - 79 - #define ROUND_UP(x) ((x + ALIGN - 1) & ~(ALIGN - 1)) 80 - 81 - static ssize_t do_read(int fd, void *buf, size_t count) 82 - { 83 - size_t offset = 0; 84 - ssize_t l; 85 - 86 - while (offset < count) { 87 - l = read(fd, buf + offset, count - offset); 88 - if (!l) 89 - break; 90 - if (l < 0) { 91 - if (errno == EAGAIN || errno == EWOULDBLOCK) 92 - continue; 93 - perror("read"); 94 - return -1; 95 - } 96 - offset += l; 97 - } 98 - 99 - return offset; 100 - } 101 - 102 - static ssize_t do_write(int fd, const void *buf, size_t count) 103 - { 104 - size_t offset = 0; 105 - ssize_t l; 106 - 107 - while (offset < count) { 108 - l = write(fd, buf + offset, count - offset); 109 - if (l < 0) { 110 - if (errno == EAGAIN || errno == EWOULDBLOCK) 111 - continue; 112 - perror("write"); 113 - return -1; 114 - } 115 - offset += l; 116 - } 117 - 118 - return offset; 119 - } 120 - 121 - static ssize_t write_zero(int fd, size_t len) 122 - { 123 - size_t i = len; 124 - 125 - while (i--) { 126 - const char x = 0; 127 - if (do_write(fd, &x, 1) < 0) 128 - return -1; 129 - } 130 - 131 - return len; 132 - } 133 - 134 - int main(void) 135 - { 136 - DECLARE_HDR(hdr); 137 - char boot_program[MAX_BOOT_PROG_LEN]; 138 - size_t aligned_hdr_len, alligned_prog_len; 139 - ssize_t prog_len; 140 - 141 - prog_len = do_read(0, boot_program, sizeof(boot_program)); 142 - if (prog_len <= 0) 143 - return -1; 144 - 145 - aligned_hdr_len = ROUND_UP(sizeof(hdr)); 146 - hdr.start_address = htole32(START_BASE + aligned_hdr_len); 147 - alligned_prog_len = ROUND_UP(prog_len); 148 - hdr.copy_size = htole16(aligned_hdr_len + alligned_prog_len); 149 - 150 - if (do_write(1, &hdr, sizeof(hdr)) < 0) 151 - return -1; 152 - if (write_zero(1, aligned_hdr_len - sizeof(hdr)) < 0) 153 - return -1; 154 - 155 - if (do_write(1, boot_program, prog_len) < 0) 156 - return 1; 157 - 158 - /* Write out the rest of the kernel */ 159 - while (1) { 160 - prog_len = do_read(0, boot_program, sizeof(boot_program)); 161 - if (prog_len < 0) 162 - return 1; 163 - if (prog_len == 0) 164 - break; 165 - if (do_write(1, boot_program, prog_len) < 0) 166 - return 1; 167 - } 168 - 169 - return 0; 170 - }
-29
Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt
··· 1 - ROM-able zImage boot from MMC 2 - ----------------------------- 3 - 4 - An ROM-able zImage compiled with ZBOOT_ROM_MMCIF may be written to MMC and 5 - SuperH Mobile ARM will to boot directly from the MMCIF hardware block. 6 - 7 - This is achieved by the mask ROM loading the first portion of the image into 8 - MERAM and then jumping to it. This portion contains loader code which 9 - copies the entire image to SDRAM and jumps to it. From there the zImage 10 - boot code proceeds as normal, uncompressing the image into its final 11 - location and then jumping to it. 12 - 13 - This code has been tested on an AP4EB board using the developer 1A eMMC 14 - boot mode which is configured using the following jumper settings. 15 - The board used for testing required a patched mask ROM in order for 16 - this mode to function. 17 - 18 - 8 7 6 5 4 3 2 1 19 - x|x|x|x|x| |x| 20 - S4 -+-+-+-+-+-+-+- 21 - | | | | |x| |x on 22 - 23 - The zImage must be written to the MMC card at sector 1 (512 bytes) in 24 - vrl4 format. A utility vrl4 is supplied to accomplish this. 25 - 26 - e.g. 27 - vrl4 < zImage | dd of=/dev/sdX bs=512 seek=1 28 - 29 - A dual-voltage MMC 4.0 card was used for testing.
-42
Documentation/arm/SH-Mobile/zboot-rom-sdhi.txt
··· 1 - ROM-able zImage boot from eSD 2 - ----------------------------- 3 - 4 - An ROM-able zImage compiled with ZBOOT_ROM_SDHI may be written to eSD and 5 - SuperH Mobile ARM will to boot directly from the SDHI hardware block. 6 - 7 - This is achieved by the mask ROM loading the first portion of the image into 8 - MERAM and then jumping to it. This portion contains loader code which 9 - copies the entire image to SDRAM and jumps to it. From there the zImage 10 - boot code proceeds as normal, uncompressing the image into its final 11 - location and then jumping to it. 12 - 13 - This code has been tested on an mackerel board using the developer 1A eSD 14 - boot mode which is configured using the following jumper settings. 15 - 16 - 8 7 6 5 4 3 2 1 17 - x|x|x|x| |x|x| 18 - S4 -+-+-+-+-+-+-+- 19 - | | | |x| | |x on 20 - 21 - The eSD card needs to be present in SDHI slot 1 (CN7). 22 - As such S1 and S33 also need to be configured as per 23 - the notes in arch/arm/mach-shmobile/board-mackerel.c. 24 - 25 - A partial zImage must be written to physical partition #1 (boot) 26 - of the eSD at sector 0 in vrl4 format. A utility vrl4 is supplied to 27 - accomplish this. 28 - 29 - e.g. 30 - vrl4 < zImage | dd of=/dev/sdX bs=512 count=17 31 - 32 - A full copy of _the same_ zImage should be written to physical partition #1 33 - (boot) of the eSD at sector 0. This should _not_ be in vrl4 format. 34 - 35 - vrl4 < zImage | dd of=/dev/sdX bs=512 36 - 37 - Note: The commands above assume that the physical partition has been 38 - switched. No such facility currently exists in the Linux Kernel. 39 - 40 - Physical partitions are described in the eSD specification. At the time of 41 - writing they are not the same as partitions that are typically configured 42 - using fdisk and visible through /proc/partitions
-8
Documentation/devicetree/bindings/arm/shmobile.txt
··· 7 7 compatible = "renesas,emev2" 8 8 - RZ/A1H (R7S72100) 9 9 compatible = "renesas,r7s72100" 10 - - SH-Mobile AP4 (R8A73720/SH7372) 11 - compatible = "renesas,sh7372" 12 10 - SH-Mobile AG5 (R8A73A00/SH73A0) 13 11 compatible = "renesas,sh73a0" 14 12 - R-Mobile APE6 (R8A73A40) ··· 35 37 compatible = "renesas,alt", "renesas,r8a7794" 36 38 - APE6-EVM 37 39 compatible = "renesas,ape6evm", "renesas,r8a73a4" 38 - - APE6-EVM - Reference Device Tree Implementation 39 - compatible = "renesas,ape6evm-reference", "renesas,r8a73a4" 40 40 - Atmark Techno Armadillo-800 EVA 41 41 compatible = "renesas,armadillo800eva" 42 42 - BOCK-W ··· 53 57 compatible = "renesas,kzm9d", "renesas,emev2" 54 58 - Kyoto Microcomputer Co. KZM-A9-GT 55 59 compatible = "renesas,kzm9g", "renesas,sh73a0" 56 - - Kyoto Microcomputer Co. KZM-A9-GT - Reference Device Tree Implementation 57 - compatible = "renesas,kzm9g-reference", "renesas,sh73a0" 58 60 - Lager (RTP0RC7790SEB00010S) 59 61 compatible = "renesas,lager", "renesas,r8a7790" 60 - - Mackerel (R0P7372LC0016RL, AP4 EVM 2nd) 61 - compatible = "renesas,mackerel" 62 62 - Marzen 63 63 compatible = "renesas,marzen", "renesas,r8a7779" 64 64
+25
Documentation/devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt
··· 1 + * Renesas R8A7778 Clock Pulse Generator (CPG) 2 + 3 + The CPG generates core clocks for the R8A7778. It includes two PLLs and 4 + several fixed ratio dividers 5 + 6 + Required Properties: 7 + 8 + - compatible: Must be "renesas,r8a7778-cpg-clocks" 9 + - reg: Base address and length of the memory resource used by the CPG 10 + - #clock-cells: Must be 1 11 + - clock-output-names: The names of the clocks. Supported clocks are 12 + "plla", "pllb", "b", "out", "p", "s", and "s1". 13 + 14 + 15 + Example 16 + ------- 17 + 18 + cpg_clocks: cpg_clocks@ffc80000 { 19 + compatible = "renesas,r8a7778-cpg-clocks"; 20 + reg = <0xffc80000 0x80>; 21 + #clock-cells = <1>; 22 + clocks = <&extal_clk>; 23 + clock-output-names = "plla", "pllb", "b", 24 + "out", "p", "s", "s1"; 25 + };
+1
Documentation/devicetree/bindings/i2c/trivial-devices.txt
··· 77 77 nxp,pca9557 8-bit I2C-bus and SMBus I/O port with reset 78 78 nxp,pcf8563 Real-time clock/calendar 79 79 nxp,pcf85063 Tiny Real-Time Clock 80 + oki,ml86v7667 OKI ML86V7667 video decoder 80 81 ovti,ov5642 OV5642: Color CMOS QSXGA (5-megapixel) Image Sensor with OmniBSI and Embedded TrueFocus 81 82 pericom,pt7c4338 Real-time Clock Module 82 83 plx,pex8648 48-Lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch
+1
Documentation/devicetree/bindings/power/renesas,sysc-rmobile.txt
··· 11 11 - compatible: Should be "renesas,sysc-<soctype>", "renesas,sysc-rmobile" as 12 12 fallback. 13 13 Examples with soctypes are: 14 + - "renesas,sysc-r8a73a4" (R-Mobile APE6) 14 15 - "renesas,sysc-r8a7740" (R-Mobile A1) 15 16 - "renesas,sysc-sh73a0" (SH-Mobile AG5) 16 17 - reg: Two address start and address range blocks for the device:
-2
MAINTAINERS
··· 1426 1426 F: arch/arm/boot/dts/r7s* 1427 1427 F: arch/arm/boot/dts/r8a* 1428 1428 F: arch/arm/boot/dts/sh* 1429 - F: arch/arm/configs/ape6evm_defconfig 1430 1429 F: arch/arm/configs/armadillo800eva_defconfig 1431 1430 F: arch/arm/configs/bockw_defconfig 1432 1431 F: arch/arm/configs/kzm9g_defconfig 1433 - F: arch/arm/configs/mackerel_defconfig 1434 1432 F: arch/arm/configs/marzen_defconfig 1435 1433 F: arch/arm/configs/shmobile_defconfig 1436 1434 F: arch/arm/include/debug/renesas-scif.S
+1 -44
arch/arm/Kconfig
··· 362 362 help 363 363 This enables support for ARM Ltd Versatile board. 364 364 365 - config ARCH_AT91 366 - bool "Atmel AT91" 367 - select ARCH_REQUIRE_GPIOLIB 368 - select CLKDEV_LOOKUP 369 - select IRQ_DOMAIN 370 - select PINCTRL 371 - select PINCTRL_AT91 372 - select SOC_BUS 373 - select USE_OF 374 - help 375 - This enables support for systems based on Atmel 376 - AT91RM9200, AT91SAM9 and SAMA5 processors. 377 - 378 365 config ARCH_CLPS711X 379 366 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" 380 367 select ARCH_REQUIRE_GPIOLIB ··· 628 641 select GENERIC_CLOCKEVENTS 629 642 select HAVE_ARM_SCU if SMP 630 643 select HAVE_ARM_TWD if SMP 631 - select HAVE_MACH_CLKDEV 632 644 select HAVE_SMP 633 645 select MIGHT_HAVE_CACHE_L2X0 634 646 select MULTI_IRQ_HANDLER ··· 1497 1511 int 1498 1512 default 200 if ARCH_EBSA110 || ARCH_S3C24XX || \ 1499 1513 ARCH_S5PV210 || ARCH_EXYNOS4 1500 - default AT91_TIMER_HZ if ARCH_AT91 1514 + default 128 if SOC_AT91RM9200 1501 1515 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE_LEGACY 1502 1516 default 0 1503 1517 ··· 1829 1843 help 1830 1844 Say Y here if you intend to execute your compressed kernel image 1831 1845 (zImage) directly from ROM or flash. If unsure, say N. 1832 - 1833 - choice 1834 - prompt "Include SD/MMC loader in zImage (EXPERIMENTAL)" 1835 - depends on ZBOOT_ROM && ARCH_SH7372 1836 - default ZBOOT_ROM_NONE 1837 - help 1838 - Include experimental SD/MMC loading code in the ROM-able zImage. 1839 - With this enabled it is possible to write the ROM-able zImage 1840 - kernel image to an MMC or SD card and boot the kernel straight 1841 - from the reset vector. At reset the processor Mask ROM will load 1842 - the first part of the ROM-able zImage which in turn loads the 1843 - rest the kernel image to RAM. 1844 - 1845 - config ZBOOT_ROM_NONE 1846 - bool "No SD/MMC loader in zImage (EXPERIMENTAL)" 1847 - help 1848 - Do not load image from SD or MMC 1849 - 1850 - config ZBOOT_ROM_MMCIF 1851 - bool "Include MMCIF loader in zImage (EXPERIMENTAL)" 1852 - help 1853 - Load image from MMCIF hardware block. 1854 - 1855 - config ZBOOT_ROM_SH_MOBILE_SDHI 1856 - bool "Include SuperH Mobile SDHI loader in zImage (EXPERIMENTAL)" 1857 - help 1858 - Load image from SDHI hardware block 1859 - 1860 - endchoice 1861 1846 1862 1847 config ARM_APPENDED_DTB 1863 1848 bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
+5 -5
arch/arm/Kconfig.debug
··· 810 810 via SCIF2 on Renesas R-Car E2 (R8A7794). 811 811 812 812 config DEBUG_RMOBILE_SCIFA0 813 - bool "Kernel low-level debugging messages via SCIFA0 on R8A73A4/SH7372" 814 - depends on ARCH_R8A73A4 || ARCH_SH7372 813 + bool "Kernel low-level debugging messages via SCIFA0 on R8A73A4" 814 + depends on ARCH_R8A73A4 815 815 help 816 816 Say Y here if you want kernel low-level debugging support 817 - via SCIFA0 on Renesas R-Mobile APE6 (R8A73A4) or SH-Mobile 818 - AP4 (SH7372). 817 + via SCIFA0 on Renesas R-Mobile APE6 (R8A73A4). 819 818 820 819 config DEBUG_RMOBILE_SCIFA1 821 820 bool "Kernel low-level debugging messages via SCIFA1 on R8A7740" ··· 1561 1562 config UNCOMPRESS_INCLUDE 1562 1563 string 1563 1564 default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \ 1564 - PLAT_SAMSUNG || ARCH_EFM32 1565 + PLAT_SAMSUNG || ARCH_EFM32 || \ 1566 + ARCH_SHMOBILE_LEGACY 1565 1567 default "mach/uncompress.h" 1566 1568 1567 1569 config EARLY_PRINTK
-15
arch/arm/boot/compressed/Makefile
··· 6 6 7 7 OBJS = 8 8 9 - # Ensure that MMCIF loader code appears early in the image 10 - # to minimise that number of bocks that have to be read in 11 - # order to load it. 12 - ifeq ($(CONFIG_ZBOOT_ROM_MMCIF),y) 13 - OBJS += mmcif-sh7372.o 14 - endif 15 - 16 - # Ensure that SDHI loader code appears early in the image 17 - # to minimise that number of bocks that have to be read in 18 - # order to load it. 19 - ifeq ($(CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI),y) 20 - OBJS += sdhi-shmobile.o 21 - OBJS += sdhi-sh7372.o 22 - endif 23 - 24 9 AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) 25 10 HEAD = head.o 26 11 OBJS += misc.o decompress.o
-30
arch/arm/boot/compressed/head-shmobile.S
··· 25 25 /* load board-specific initialization code */ 26 26 #include <mach/zboot.h> 27 27 28 - #if defined(CONFIG_ZBOOT_ROM_MMCIF) || defined(CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI) 29 - /* Load image from MMC/SD */ 30 - adr sp, __tmp_stack + 256 31 - ldr r0, __image_start 32 - ldr r1, __image_end 33 - subs r1, r1, r0 34 - ldr r0, __load_base 35 - bl mmc_loader 36 - 37 - /* Jump to loaded code */ 38 - ldr r0, __loaded 39 - ldr r1, __image_start 40 - sub r0, r0, r1 41 - ldr r1, __load_base 42 - add pc, r0, r1 43 - 44 - __image_start: 45 - .long _start 46 - __image_end: 47 - .long _got_end 48 - __load_base: 49 - .long MEMORY_START + 0x02000000 @ Load at 32Mb into SDRAM 50 - __loaded: 51 - .long __continue 52 - .align 53 - __tmp_stack: 54 - .space 256 55 - __continue: 56 - #endif /* CONFIG_ZBOOT_ROM_MMC || CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI */ 57 - 58 28 adr r0, dtb_info 59 29 ldmia r0, {r1, r3, r4, r5, r7} 60 30
-88
arch/arm/boot/compressed/mmcif-sh7372.c
··· 1 - /* 2 - * sh7372 MMCIF loader 3 - * 4 - * Copyright (C) 2010 Magnus Damm 5 - * Copyright (C) 2010 Simon Horman 6 - * 7 - * This file is subject to the terms and conditions of the GNU General Public 8 - * License. See the file "COPYING" in the main directory of this archive 9 - * for more details. 10 - */ 11 - 12 - #include <linux/mmc/sh_mmcif.h> 13 - #include <linux/mmc/boot.h> 14 - #include <mach/mmc.h> 15 - 16 - #define MMCIF_BASE (void __iomem *)0xe6bd0000 17 - 18 - #define PORT84CR (void __iomem *)0xe6050054 19 - #define PORT85CR (void __iomem *)0xe6050055 20 - #define PORT86CR (void __iomem *)0xe6050056 21 - #define PORT87CR (void __iomem *)0xe6050057 22 - #define PORT88CR (void __iomem *)0xe6050058 23 - #define PORT89CR (void __iomem *)0xe6050059 24 - #define PORT90CR (void __iomem *)0xe605005a 25 - #define PORT91CR (void __iomem *)0xe605005b 26 - #define PORT92CR (void __iomem *)0xe605005c 27 - #define PORT99CR (void __iomem *)0xe6050063 28 - 29 - #define SMSTPCR3 (void __iomem *)0xe615013c 30 - 31 - /* SH7372 specific MMCIF loader 32 - * 33 - * loads the zImage from an MMC card starting from block 1. 34 - * 35 - * The image must be start with a vrl4 header and 36 - * the zImage must start at offset 512 of the image. That is, 37 - * at block 2 (=byte 1024) on the media 38 - * 39 - * Use the following line to write the vrl4 formated zImage 40 - * to an MMC card 41 - * # dd if=vrl4.out of=/dev/sdx bs=512 seek=1 42 - */ 43 - asmlinkage void mmc_loader(unsigned char *buf, unsigned long len) 44 - { 45 - mmc_init_progress(); 46 - mmc_update_progress(MMC_PROGRESS_ENTER); 47 - 48 - /* Initialise MMC 49 - * registers: PORT84CR-PORT92CR 50 - * (MMCD0_0-MMCD0_7,MMCCMD0 Control) 51 - * value: 0x04 - select function 4 52 - */ 53 - __raw_writeb(0x04, PORT84CR); 54 - __raw_writeb(0x04, PORT85CR); 55 - __raw_writeb(0x04, PORT86CR); 56 - __raw_writeb(0x04, PORT87CR); 57 - __raw_writeb(0x04, PORT88CR); 58 - __raw_writeb(0x04, PORT89CR); 59 - __raw_writeb(0x04, PORT90CR); 60 - __raw_writeb(0x04, PORT91CR); 61 - __raw_writeb(0x04, PORT92CR); 62 - 63 - /* Initialise MMC 64 - * registers: PORT99CR (MMCCLK0 Control) 65 - * value: 0x10 | 0x04 - enable output | select function 4 66 - */ 67 - __raw_writeb(0x14, PORT99CR); 68 - 69 - /* Enable clock to MMC hardware block */ 70 - __raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 12), SMSTPCR3); 71 - 72 - mmc_update_progress(MMC_PROGRESS_INIT); 73 - 74 - /* setup MMCIF hardware */ 75 - sh_mmcif_boot_init(MMCIF_BASE); 76 - 77 - mmc_update_progress(MMC_PROGRESS_LOAD); 78 - 79 - /* load kernel via MMCIF interface */ 80 - sh_mmcif_boot_do_read(MMCIF_BASE, 2, /* Kernel is at block 2 */ 81 - (len + SH_MMCIF_BBS - 1) / SH_MMCIF_BBS, buf); 82 - 83 - 84 - /* Disable clock to MMC hardware block */ 85 - __raw_writel(__raw_readl(SMSTPCR3) | (1 << 12), SMSTPCR3); 86 - 87 - mmc_update_progress(MMC_PROGRESS_DONE); 88 - }
-95
arch/arm/boot/compressed/sdhi-sh7372.c
··· 1 - /* 2 - * SuperH Mobile SDHI 3 - * 4 - * Copyright (C) 2010 Magnus Damm 5 - * Copyright (C) 2010 Kuninori Morimoto 6 - * Copyright (C) 2010 Simon Horman 7 - * 8 - * This file is subject to the terms and conditions of the GNU General Public 9 - * License. See the file "COPYING" in the main directory of this archive 10 - * for more details. 11 - * 12 - * Parts inspired by u-boot 13 - */ 14 - 15 - #include <linux/io.h> 16 - #include <mach/mmc.h> 17 - #include <linux/mmc/boot.h> 18 - #include <linux/mmc/tmio.h> 19 - 20 - #include "sdhi-shmobile.h" 21 - 22 - #define PORT179CR 0xe60520b3 23 - #define PORT180CR 0xe60520b4 24 - #define PORT181CR 0xe60520b5 25 - #define PORT182CR 0xe60520b6 26 - #define PORT183CR 0xe60520b7 27 - #define PORT184CR 0xe60520b8 28 - 29 - #define SMSTPCR3 0xe615013c 30 - 31 - #define CR_INPUT_ENABLE 0x10 32 - #define CR_FUNCTION1 0x01 33 - 34 - #define SDHI1_BASE (void __iomem *)0xe6860000 35 - #define SDHI_BASE SDHI1_BASE 36 - 37 - /* SuperH Mobile SDHI loader 38 - * 39 - * loads the zImage from an SD card starting from block 0 40 - * on physical partition 1 41 - * 42 - * The image must be start with a vrl4 header and 43 - * the zImage must start at offset 512 of the image. That is, 44 - * at block 1 (=byte 512) of physical partition 1 45 - * 46 - * Use the following line to write the vrl4 formated zImage 47 - * to an SD card 48 - * # dd if=vrl4.out of=/dev/sdx bs=512 49 - */ 50 - asmlinkage void mmc_loader(unsigned short *buf, unsigned long len) 51 - { 52 - int high_capacity; 53 - 54 - mmc_init_progress(); 55 - 56 - mmc_update_progress(MMC_PROGRESS_ENTER); 57 - /* Initialise SDHI1 */ 58 - /* PORT184CR: GPIO_FN_SDHICMD1 Control */ 59 - __raw_writeb(CR_FUNCTION1, PORT184CR); 60 - /* PORT179CR: GPIO_FN_SDHICLK1 Control */ 61 - __raw_writeb(CR_INPUT_ENABLE|CR_FUNCTION1, PORT179CR); 62 - /* PORT181CR: GPIO_FN_SDHID1_3 Control */ 63 - __raw_writeb(CR_FUNCTION1, PORT183CR); 64 - /* PORT182CR: GPIO_FN_SDHID1_2 Control */ 65 - __raw_writeb(CR_FUNCTION1, PORT182CR); 66 - /* PORT183CR: GPIO_FN_SDHID1_1 Control */ 67 - __raw_writeb(CR_FUNCTION1, PORT181CR); 68 - /* PORT180CR: GPIO_FN_SDHID1_0 Control */ 69 - __raw_writeb(CR_FUNCTION1, PORT180CR); 70 - 71 - /* Enable clock to SDHI1 hardware block */ 72 - __raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 13), SMSTPCR3); 73 - 74 - /* setup SDHI hardware */ 75 - mmc_update_progress(MMC_PROGRESS_INIT); 76 - high_capacity = sdhi_boot_init(SDHI_BASE); 77 - if (high_capacity < 0) 78 - goto err; 79 - 80 - mmc_update_progress(MMC_PROGRESS_LOAD); 81 - /* load kernel */ 82 - if (sdhi_boot_do_read(SDHI_BASE, high_capacity, 83 - 0, /* Kernel is at block 1 */ 84 - (len + TMIO_BBS - 1) / TMIO_BBS, buf)) 85 - goto err; 86 - 87 - /* Disable clock to SDHI1 hardware block */ 88 - __raw_writel(__raw_readl(SMSTPCR3) | (1 << 13), SMSTPCR3); 89 - 90 - mmc_update_progress(MMC_PROGRESS_DONE); 91 - 92 - return; 93 - err: 94 - for(;;); 95 - }
-449
arch/arm/boot/compressed/sdhi-shmobile.c
··· 1 - /* 2 - * SuperH Mobile SDHI 3 - * 4 - * Copyright (C) 2010 Magnus Damm 5 - * Copyright (C) 2010 Kuninori Morimoto 6 - * Copyright (C) 2010 Simon Horman 7 - * 8 - * This file is subject to the terms and conditions of the GNU General Public 9 - * License. See the file "COPYING" in the main directory of this archive 10 - * for more details. 11 - * 12 - * Parts inspired by u-boot 13 - */ 14 - 15 - #include <linux/io.h> 16 - #include <linux/mmc/host.h> 17 - #include <linux/mmc/core.h> 18 - #include <linux/mmc/mmc.h> 19 - #include <linux/mmc/sd.h> 20 - #include <linux/mmc/tmio.h> 21 - #include <mach/sdhi.h> 22 - 23 - #define OCR_FASTBOOT (1<<29) 24 - #define OCR_HCS (1<<30) 25 - #define OCR_BUSY (1<<31) 26 - 27 - #define RESP_CMD12 0x00000030 28 - 29 - static inline u16 sd_ctrl_read16(void __iomem *base, int addr) 30 - { 31 - return __raw_readw(base + addr); 32 - } 33 - 34 - static inline u32 sd_ctrl_read32(void __iomem *base, int addr) 35 - { 36 - return __raw_readw(base + addr) | 37 - __raw_readw(base + addr + 2) << 16; 38 - } 39 - 40 - static inline void sd_ctrl_write16(void __iomem *base, int addr, u16 val) 41 - { 42 - __raw_writew(val, base + addr); 43 - } 44 - 45 - static inline void sd_ctrl_write32(void __iomem *base, int addr, u32 val) 46 - { 47 - __raw_writew(val, base + addr); 48 - __raw_writew(val >> 16, base + addr + 2); 49 - } 50 - 51 - #define ALL_ERROR (TMIO_STAT_CMD_IDX_ERR | TMIO_STAT_CRCFAIL | \ 52 - TMIO_STAT_STOPBIT_ERR | TMIO_STAT_DATATIMEOUT | \ 53 - TMIO_STAT_RXOVERFLOW | TMIO_STAT_TXUNDERRUN | \ 54 - TMIO_STAT_CMDTIMEOUT | TMIO_STAT_ILL_ACCESS | \ 55 - TMIO_STAT_ILL_FUNC) 56 - 57 - static int sdhi_intr(void __iomem *base) 58 - { 59 - unsigned long state = sd_ctrl_read32(base, CTL_STATUS); 60 - 61 - if (state & ALL_ERROR) { 62 - sd_ctrl_write32(base, CTL_STATUS, ~ALL_ERROR); 63 - sd_ctrl_write32(base, CTL_IRQ_MASK, 64 - ALL_ERROR | 65 - sd_ctrl_read32(base, CTL_IRQ_MASK)); 66 - return -EINVAL; 67 - } 68 - if (state & TMIO_STAT_CMDRESPEND) { 69 - sd_ctrl_write32(base, CTL_STATUS, ~TMIO_STAT_CMDRESPEND); 70 - sd_ctrl_write32(base, CTL_IRQ_MASK, 71 - TMIO_STAT_CMDRESPEND | 72 - sd_ctrl_read32(base, CTL_IRQ_MASK)); 73 - return 0; 74 - } 75 - if (state & TMIO_STAT_RXRDY) { 76 - sd_ctrl_write32(base, CTL_STATUS, ~TMIO_STAT_RXRDY); 77 - sd_ctrl_write32(base, CTL_IRQ_MASK, 78 - TMIO_STAT_RXRDY | TMIO_STAT_TXUNDERRUN | 79 - sd_ctrl_read32(base, CTL_IRQ_MASK)); 80 - return 0; 81 - } 82 - if (state & TMIO_STAT_DATAEND) { 83 - sd_ctrl_write32(base, CTL_STATUS, ~TMIO_STAT_DATAEND); 84 - sd_ctrl_write32(base, CTL_IRQ_MASK, 85 - TMIO_STAT_DATAEND | 86 - sd_ctrl_read32(base, CTL_IRQ_MASK)); 87 - return 0; 88 - } 89 - 90 - return -EAGAIN; 91 - } 92 - 93 - static int sdhi_boot_wait_resp_end(void __iomem *base) 94 - { 95 - int err = -EAGAIN, timeout = 10000000; 96 - 97 - while (timeout--) { 98 - err = sdhi_intr(base); 99 - if (err != -EAGAIN) 100 - break; 101 - udelay(1); 102 - } 103 - 104 - return err; 105 - } 106 - 107 - /* SDHI_CLK_CTRL */ 108 - #define CLK_MMC_ENABLE (1 << 8) 109 - #define CLK_MMC_INIT (1 << 6) /* clk / 256 */ 110 - 111 - static void sdhi_boot_mmc_clk_stop(void __iomem *base) 112 - { 113 - sd_ctrl_write16(base, CTL_CLK_AND_WAIT_CTL, 0x0000); 114 - msleep(10); 115 - sd_ctrl_write16(base, CTL_SD_CARD_CLK_CTL, ~CLK_MMC_ENABLE & 116 - sd_ctrl_read16(base, CTL_SD_CARD_CLK_CTL)); 117 - msleep(10); 118 - } 119 - 120 - static void sdhi_boot_mmc_clk_start(void __iomem *base) 121 - { 122 - sd_ctrl_write16(base, CTL_SD_CARD_CLK_CTL, CLK_MMC_ENABLE | 123 - sd_ctrl_read16(base, CTL_SD_CARD_CLK_CTL)); 124 - msleep(10); 125 - sd_ctrl_write16(base, CTL_CLK_AND_WAIT_CTL, CLK_MMC_ENABLE); 126 - msleep(10); 127 - } 128 - 129 - static void sdhi_boot_reset(void __iomem *base) 130 - { 131 - sd_ctrl_write16(base, CTL_RESET_SD, 0x0000); 132 - msleep(10); 133 - sd_ctrl_write16(base, CTL_RESET_SD, 0x0001); 134 - msleep(10); 135 - } 136 - 137 - /* Set MMC clock / power. 138 - * Note: This controller uses a simple divider scheme therefore it cannot 139 - * run a MMC card at full speed (20MHz). The max clock is 24MHz on SD, but as 140 - * MMC wont run that fast, it has to be clocked at 12MHz which is the next 141 - * slowest setting. 142 - */ 143 - static int sdhi_boot_mmc_set_ios(void __iomem *base, struct mmc_ios *ios) 144 - { 145 - if (sd_ctrl_read32(base, CTL_STATUS) & TMIO_STAT_CMD_BUSY) 146 - return -EBUSY; 147 - 148 - if (ios->clock) 149 - sd_ctrl_write16(base, CTL_SD_CARD_CLK_CTL, 150 - ios->clock | CLK_MMC_ENABLE); 151 - 152 - /* Power sequence - OFF -> ON -> UP */ 153 - switch (ios->power_mode) { 154 - case MMC_POWER_OFF: /* power down SD bus */ 155 - sdhi_boot_mmc_clk_stop(base); 156 - break; 157 - case MMC_POWER_ON: /* power up SD bus */ 158 - break; 159 - case MMC_POWER_UP: /* start bus clock */ 160 - sdhi_boot_mmc_clk_start(base); 161 - break; 162 - } 163 - 164 - switch (ios->bus_width) { 165 - case MMC_BUS_WIDTH_1: 166 - sd_ctrl_write16(base, CTL_SD_MEM_CARD_OPT, 0x80e0); 167 - break; 168 - case MMC_BUS_WIDTH_4: 169 - sd_ctrl_write16(base, CTL_SD_MEM_CARD_OPT, 0x00e0); 170 - break; 171 - } 172 - 173 - /* Let things settle. delay taken from winCE driver */ 174 - udelay(140); 175 - 176 - return 0; 177 - } 178 - 179 - /* These are the bitmasks the tmio chip requires to implement the MMC response 180 - * types. Note that R1 and R6 are the same in this scheme. */ 181 - #define RESP_NONE 0x0300 182 - #define RESP_R1 0x0400 183 - #define RESP_R1B 0x0500 184 - #define RESP_R2 0x0600 185 - #define RESP_R3 0x0700 186 - #define DATA_PRESENT 0x0800 187 - #define TRANSFER_READ 0x1000 188 - 189 - static int sdhi_boot_request(void __iomem *base, struct mmc_command *cmd) 190 - { 191 - int err, c = cmd->opcode; 192 - 193 - switch (mmc_resp_type(cmd)) { 194 - case MMC_RSP_NONE: c |= RESP_NONE; break; 195 - case MMC_RSP_R1: c |= RESP_R1; break; 196 - case MMC_RSP_R1B: c |= RESP_R1B; break; 197 - case MMC_RSP_R2: c |= RESP_R2; break; 198 - case MMC_RSP_R3: c |= RESP_R3; break; 199 - default: 200 - return -EINVAL; 201 - } 202 - 203 - /* No interrupts so this may not be cleared */ 204 - sd_ctrl_write32(base, CTL_STATUS, ~TMIO_STAT_CMDRESPEND); 205 - 206 - sd_ctrl_write32(base, CTL_IRQ_MASK, TMIO_STAT_CMDRESPEND | 207 - sd_ctrl_read32(base, CTL_IRQ_MASK)); 208 - sd_ctrl_write32(base, CTL_ARG_REG, cmd->arg); 209 - sd_ctrl_write16(base, CTL_SD_CMD, c); 210 - 211 - 212 - sd_ctrl_write32(base, CTL_IRQ_MASK, 213 - ~(TMIO_STAT_CMDRESPEND | ALL_ERROR) & 214 - sd_ctrl_read32(base, CTL_IRQ_MASK)); 215 - 216 - err = sdhi_boot_wait_resp_end(base); 217 - if (err) 218 - return err; 219 - 220 - cmd->resp[0] = sd_ctrl_read32(base, CTL_RESPONSE); 221 - 222 - return 0; 223 - } 224 - 225 - static int sdhi_boot_do_read_single(void __iomem *base, int high_capacity, 226 - unsigned long block, unsigned short *buf) 227 - { 228 - int err, i; 229 - 230 - /* CMD17 - Read */ 231 - { 232 - struct mmc_command cmd; 233 - 234 - cmd.opcode = MMC_READ_SINGLE_BLOCK | \ 235 - TRANSFER_READ | DATA_PRESENT; 236 - if (high_capacity) 237 - cmd.arg = block; 238 - else 239 - cmd.arg = block * TMIO_BBS; 240 - cmd.flags = MMC_RSP_R1; 241 - err = sdhi_boot_request(base, &cmd); 242 - if (err) 243 - return err; 244 - } 245 - 246 - sd_ctrl_write32(base, CTL_IRQ_MASK, 247 - ~(TMIO_STAT_DATAEND | TMIO_STAT_RXRDY | 248 - TMIO_STAT_TXUNDERRUN) & 249 - sd_ctrl_read32(base, CTL_IRQ_MASK)); 250 - err = sdhi_boot_wait_resp_end(base); 251 - if (err) 252 - return err; 253 - 254 - sd_ctrl_write16(base, CTL_SD_XFER_LEN, TMIO_BBS); 255 - for (i = 0; i < TMIO_BBS / sizeof(*buf); i++) 256 - *buf++ = sd_ctrl_read16(base, RESP_CMD12); 257 - 258 - err = sdhi_boot_wait_resp_end(base); 259 - if (err) 260 - return err; 261 - 262 - return 0; 263 - } 264 - 265 - int sdhi_boot_do_read(void __iomem *base, int high_capacity, 266 - unsigned long offset, unsigned short count, 267 - unsigned short *buf) 268 - { 269 - unsigned long i; 270 - int err = 0; 271 - 272 - for (i = 0; i < count; i++) { 273 - err = sdhi_boot_do_read_single(base, high_capacity, offset + i, 274 - buf + (i * TMIO_BBS / 275 - sizeof(*buf))); 276 - if (err) 277 - return err; 278 - } 279 - 280 - return 0; 281 - } 282 - 283 - #define VOLTAGES (MMC_VDD_32_33 | MMC_VDD_33_34) 284 - 285 - int sdhi_boot_init(void __iomem *base) 286 - { 287 - bool sd_v2 = false, sd_v1_0 = false; 288 - unsigned short cid; 289 - int err, high_capacity = 0; 290 - 291 - sdhi_boot_mmc_clk_stop(base); 292 - sdhi_boot_reset(base); 293 - 294 - /* mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0 */ 295 - { 296 - struct mmc_ios ios; 297 - ios.power_mode = MMC_POWER_ON; 298 - ios.bus_width = MMC_BUS_WIDTH_1; 299 - ios.clock = CLK_MMC_INIT; 300 - err = sdhi_boot_mmc_set_ios(base, &ios); 301 - if (err) 302 - return err; 303 - } 304 - 305 - /* CMD0 */ 306 - { 307 - struct mmc_command cmd; 308 - msleep(1); 309 - cmd.opcode = MMC_GO_IDLE_STATE; 310 - cmd.arg = 0; 311 - cmd.flags = MMC_RSP_NONE; 312 - err = sdhi_boot_request(base, &cmd); 313 - if (err) 314 - return err; 315 - msleep(2); 316 - } 317 - 318 - /* CMD8 - Test for SD version 2 */ 319 - { 320 - struct mmc_command cmd; 321 - cmd.opcode = SD_SEND_IF_COND; 322 - cmd.arg = (VOLTAGES != 0) << 8 | 0xaa; 323 - cmd.flags = MMC_RSP_R1; 324 - err = sdhi_boot_request(base, &cmd); /* Ignore error */ 325 - if ((cmd.resp[0] & 0xff) == 0xaa) 326 - sd_v2 = true; 327 - } 328 - 329 - /* CMD55 - Get OCR (SD) */ 330 - { 331 - int timeout = 1000; 332 - struct mmc_command cmd; 333 - 334 - cmd.arg = 0; 335 - 336 - do { 337 - cmd.opcode = MMC_APP_CMD; 338 - cmd.flags = MMC_RSP_R1; 339 - cmd.arg = 0; 340 - err = sdhi_boot_request(base, &cmd); 341 - if (err) 342 - break; 343 - 344 - cmd.opcode = SD_APP_OP_COND; 345 - cmd.flags = MMC_RSP_R3; 346 - cmd.arg = (VOLTAGES & 0xff8000); 347 - if (sd_v2) 348 - cmd.arg |= OCR_HCS; 349 - cmd.arg |= OCR_FASTBOOT; 350 - err = sdhi_boot_request(base, &cmd); 351 - if (err) 352 - break; 353 - 354 - msleep(1); 355 - } while((!(cmd.resp[0] & OCR_BUSY)) && --timeout); 356 - 357 - if (!err && timeout) { 358 - if (!sd_v2) 359 - sd_v1_0 = true; 360 - high_capacity = (cmd.resp[0] & OCR_HCS) == OCR_HCS; 361 - } 362 - } 363 - 364 - /* CMD1 - Get OCR (MMC) */ 365 - if (!sd_v2 && !sd_v1_0) { 366 - int timeout = 1000; 367 - struct mmc_command cmd; 368 - 369 - do { 370 - cmd.opcode = MMC_SEND_OP_COND; 371 - cmd.arg = VOLTAGES | OCR_HCS; 372 - cmd.flags = MMC_RSP_R3; 373 - err = sdhi_boot_request(base, &cmd); 374 - if (err) 375 - return err; 376 - 377 - msleep(1); 378 - } while((!(cmd.resp[0] & OCR_BUSY)) && --timeout); 379 - 380 - if (!timeout) 381 - return -EAGAIN; 382 - 383 - high_capacity = (cmd.resp[0] & OCR_HCS) == OCR_HCS; 384 - } 385 - 386 - /* CMD2 - Get CID */ 387 - { 388 - struct mmc_command cmd; 389 - cmd.opcode = MMC_ALL_SEND_CID; 390 - cmd.arg = 0; 391 - cmd.flags = MMC_RSP_R2; 392 - err = sdhi_boot_request(base, &cmd); 393 - if (err) 394 - return err; 395 - } 396 - 397 - /* CMD3 398 - * MMC: Set the relative address 399 - * SD: Get the relative address 400 - * Also puts the card into the standby state 401 - */ 402 - { 403 - struct mmc_command cmd; 404 - cmd.opcode = MMC_SET_RELATIVE_ADDR; 405 - cmd.arg = 0; 406 - cmd.flags = MMC_RSP_R1; 407 - err = sdhi_boot_request(base, &cmd); 408 - if (err) 409 - return err; 410 - cid = cmd.resp[0] >> 16; 411 - } 412 - 413 - /* CMD9 - Get CSD */ 414 - { 415 - struct mmc_command cmd; 416 - cmd.opcode = MMC_SEND_CSD; 417 - cmd.arg = cid << 16; 418 - cmd.flags = MMC_RSP_R2; 419 - err = sdhi_boot_request(base, &cmd); 420 - if (err) 421 - return err; 422 - } 423 - 424 - /* CMD7 - Select the card */ 425 - { 426 - struct mmc_command cmd; 427 - cmd.opcode = MMC_SELECT_CARD; 428 - //cmd.arg = rca << 16; 429 - cmd.arg = cid << 16; 430 - //cmd.flags = MMC_RSP_R1B; 431 - cmd.flags = MMC_RSP_R1; 432 - err = sdhi_boot_request(base, &cmd); 433 - if (err) 434 - return err; 435 - } 436 - 437 - /* CMD16 - Set the block size */ 438 - { 439 - struct mmc_command cmd; 440 - cmd.opcode = MMC_SET_BLOCKLEN; 441 - cmd.arg = TMIO_BBS; 442 - cmd.flags = MMC_RSP_R1; 443 - err = sdhi_boot_request(base, &cmd); 444 - if (err) 445 - return err; 446 - } 447 - 448 - return high_capacity; 449 - }
-11
arch/arm/boot/compressed/sdhi-shmobile.h
··· 1 - #ifndef SDHI_MOBILE_H 2 - #define SDHI_MOBILE_H 3 - 4 - #include <linux/compiler.h> 5 - 6 - int sdhi_boot_do_read(void __iomem *base, int high_capacity, 7 - unsigned long offset, unsigned short count, 8 - unsigned short *buf); 9 - int sdhi_boot_init(void __iomem *base); 10 - 11 - #endif
+4 -6
arch/arm/boot/dts/Makefile
··· 475 475 s5pv210-smdkv210.dtb \ 476 476 s5pv210-torbreck.dtb 477 477 dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += \ 478 - r8a73a4-ape6evm.dtb \ 479 - r8a73a4-ape6evm-reference.dtb \ 480 478 r8a7740-armadillo800eva.dtb \ 481 479 r8a7778-bockw.dtb \ 482 480 r8a7778-bockw-reference.dtb \ 483 481 r8a7779-marzen.dtb \ 484 - sh7372-mackerel.dtb \ 485 - sh73a0-kzm9g.dtb \ 486 - sh73a0-kzm9g-reference.dtb 482 + sh73a0-kzm9g.dtb 487 483 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += \ 488 484 emev2-kzm9d.dtb \ 489 485 r7s72100-genmai.dtb \ 490 486 r8a73a4-ape6evm.dtb \ 491 487 r8a7740-armadillo800eva.dtb \ 488 + r8a7778-bockw.dtb \ 492 489 r8a7779-marzen.dtb \ 493 490 r8a7790-lager.dtb \ 494 491 r8a7791-henninger.dtb \ 495 492 r8a7791-koelsch.dtb \ 496 - r8a7794-alt.dtb 493 + r8a7794-alt.dtb \ 494 + sh73a0-kzm9g.dtb 497 495 dtb-$(CONFIG_ARCH_SOCFPGA) += \ 498 496 socfpga_arria5_socdk.dtb \ 499 497 socfpga_arria10_socdk.dtb \
-156
arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts
··· 1 - /* 2 - * Device Tree Source for the APE6EVM board 3 - * 4 - * Copyright (C) 2013 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 "r8a73a4.dtsi" 13 - #include <dt-bindings/gpio/gpio.h> 14 - 15 - / { 16 - model = "APE6EVM"; 17 - compatible = "renesas,ape6evm-reference", "renesas,r8a73a4"; 18 - 19 - aliases { 20 - serial0 = &scifa0; 21 - }; 22 - 23 - chosen { 24 - bootargs = "ignore_loglevel rw"; 25 - stdout-path = &scifa0; 26 - }; 27 - 28 - memory@40000000 { 29 - device_type = "memory"; 30 - reg = <0 0x40000000 0 0x40000000>; 31 - }; 32 - 33 - memory@200000000 { 34 - device_type = "memory"; 35 - reg = <2 0x00000000 0 0x40000000>; 36 - }; 37 - 38 - vcc_mmc0: regulator@0 { 39 - compatible = "regulator-fixed"; 40 - regulator-name = "MMC0 Vcc"; 41 - regulator-min-microvolt = <2800000>; 42 - regulator-max-microvolt = <2800000>; 43 - regulator-always-on; 44 - }; 45 - 46 - vcc_sdhi0: regulator@1 { 47 - compatible = "regulator-fixed"; 48 - 49 - regulator-name = "SDHI0 Vcc"; 50 - regulator-min-microvolt = <3300000>; 51 - regulator-max-microvolt = <3300000>; 52 - 53 - gpio = <&pfc 76 GPIO_ACTIVE_HIGH>; 54 - enable-active-high; 55 - }; 56 - 57 - /* Common 3.3V rail, used by several devices on APE6EVM */ 58 - ape6evm_fixed_3v3: regulator@2 { 59 - compatible = "regulator-fixed"; 60 - regulator-name = "3V3"; 61 - regulator-min-microvolt = <3300000>; 62 - regulator-max-microvolt = <3300000>; 63 - regulator-always-on; 64 - }; 65 - 66 - lbsc { 67 - compatible = "simple-bus"; 68 - #address-cells = <1>; 69 - #size-cells = <1>; 70 - ranges = <0 0 0 0x20000000>; 71 - }; 72 - }; 73 - 74 - &i2c5 { 75 - status = "okay"; 76 - vdd_dvfs: max8973@1b { 77 - compatible = "maxim,max8973"; 78 - reg = <0x1b>; 79 - 80 - regulator-min-microvolt = <935000>; 81 - regulator-max-microvolt = <1200000>; 82 - regulator-boot-on; 83 - regulator-always-on; 84 - }; 85 - }; 86 - 87 - &cpu0 { 88 - cpu0-supply = <&vdd_dvfs>; 89 - operating-points = < 90 - /* kHz uV */ 91 - 1950000 1115000 92 - 1462500 995000 93 - >; 94 - voltage-tolerance = <1>; /* 1% */ 95 - }; 96 - 97 - &cmt1 { 98 - status = "okay"; 99 - }; 100 - 101 - &pfc { 102 - scifa0_pins: serial0 { 103 - renesas,groups = "scifa0_data"; 104 - renesas,function = "scifa0"; 105 - }; 106 - 107 - mmc0_pins: mmc { 108 - renesas,groups = "mmc0_data8", "mmc0_ctrl"; 109 - renesas,function = "mmc0"; 110 - }; 111 - 112 - sdhi0_pins: sd0 { 113 - renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd"; 114 - renesas,function = "sdhi0"; 115 - }; 116 - 117 - sdhi1_pins: sd1 { 118 - renesas,groups = "sdhi1_data4", "sdhi1_ctrl"; 119 - renesas,function = "sdhi1"; 120 - }; 121 - }; 122 - 123 - &mmcif0 { 124 - vmmc-supply = <&vcc_mmc0>; 125 - bus-width = <8>; 126 - non-removable; 127 - pinctrl-names = "default"; 128 - pinctrl-0 = <&mmc0_pins>; 129 - status = "okay"; 130 - }; 131 - 132 - &scifa0 { 133 - pinctrl-0 = <&scifa0_pins>; 134 - pinctrl-names = "default"; 135 - 136 - status = "okay"; 137 - }; 138 - 139 - &sdhi0 { 140 - vmmc-supply = <&vcc_sdhi0>; 141 - bus-width = <4>; 142 - toshiba,mmc-wrprotect-disable; 143 - pinctrl-names = "default"; 144 - pinctrl-0 = <&sdhi0_pins>; 145 - status = "okay"; 146 - }; 147 - 148 - &sdhi1 { 149 - vmmc-supply = <&ape6evm_fixed_3v3>; 150 - bus-width = <4>; 151 - broken-cd; 152 - toshiba,mmc-wrprotect-disable; 153 - pinctrl-names = "default"; 154 - pinctrl-0 = <&sdhi1_pins>; 155 - status = "okay"; 156 - };
+16 -21
arch/arm/boot/dts/r8a73a4-ape6evm.dts
··· 22 22 }; 23 23 24 24 chosen { 25 - bootargs = "console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp rw"; 25 + bootargs = "ignore_loglevel root=/dev/nfs ip=dhcp rw"; 26 26 stdout-path = &scifa0; 27 27 }; 28 28 ··· 70 70 regulator-min-microvolt = <3300000>; 71 71 regulator-max-microvolt = <3300000>; 72 72 regulator-always-on; 73 - }; 74 - 75 - lbsc { 76 - compatible = "simple-bus"; 77 - #address-cells = <1>; 78 - #size-cells = <1>; 79 - ranges = <0 0 0 0x20000000>; 80 - 81 - ethernet@8000000 { 82 - compatible = "smsc,lan9220", "smsc,lan9115"; 83 - reg = <0x08000000 0x1000>; 84 - interrupt-parent = <&irqc1>; 85 - interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; 86 - phy-mode = "mii"; 87 - reg-io-width = <4>; 88 - smsc,irq-active-high; 89 - smsc,irq-push-pull; 90 - vdd33a-supply = <&ape6evm_fixed_3v3>; 91 - vddvario-supply = <&ape6evm_fixed_1v8>; 92 - }; 93 73 }; 94 74 95 75 leds { ··· 166 186 1462500 995000 167 187 >; 168 188 voltage-tolerance = <1>; /* 1% */ 189 + }; 190 + 191 + &bsc { 192 + ethernet@8000000 { 193 + compatible = "smsc,lan9220", "smsc,lan9115"; 194 + reg = <0x08000000 0x1000>; 195 + interrupt-parent = <&irqc1>; 196 + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; 197 + phy-mode = "mii"; 198 + reg-io-width = <4>; 199 + smsc,irq-active-high; 200 + smsc,irq-push-pull; 201 + vdd33a-supply = <&ape6evm_fixed_3v3>; 202 + vddvario-supply = <&ape6evm_fixed_1v8>; 203 + }; 169 204 }; 170 205 171 206 &cmt1 {
+534 -23
arch/arm/boot/dts/r8a73a4.dtsi
··· 9 9 * kind, whether express or implied. 10 10 */ 11 11 12 + #include <dt-bindings/clock/r8a73a4-clock.h> 12 13 #include <dt-bindings/interrupt-controller/arm-gic.h> 13 14 #include <dt-bindings/interrupt-controller/irq.h> 14 15 ··· 28 27 compatible = "arm,cortex-a15"; 29 28 reg = <0>; 30 29 clock-frequency = <1500000000>; 30 + power-domains = <&pd_a2sl>; 31 31 }; 32 + }; 33 + 34 + ptm { 35 + compatible = "arm,coresight-etm3x"; 36 + power-domains = <&pd_d4>; 32 37 }; 33 38 34 39 timer { ··· 48 41 dbsc1: memory-controller@e6790000 { 49 42 compatible = "renesas,dbsc-r8a73a4"; 50 43 reg = <0 0xe6790000 0 0x10000>; 44 + power-domains = <&pd_a3bc>; 51 45 }; 52 46 53 47 dbsc2: memory-controller@e67a0000 { 54 48 compatible = "renesas,dbsc-r8a73a4"; 55 49 reg = <0 0xe67a0000 0 0x10000>; 50 + power-domains = <&pd_a3bc>; 56 51 }; 57 52 58 53 dmac: dma-multiplexer { ··· 96 87 "ch8", "ch9", "ch10", "ch11", 97 88 "ch12", "ch13", "ch14", "ch15", 98 89 "ch16", "ch17", "ch18", "ch19"; 90 + clocks = <&mstp2_clks R8A73A4_CLK_DMAC>; 91 + power-domains = <&pd_a3sp>; 99 92 }; 100 - }; 101 - 102 - pfc: pfc@e6050000 { 103 - compatible = "renesas,pfc-r8a73a4"; 104 - reg = <0 0xe6050000 0 0x9000>; 105 - gpio-controller; 106 - #gpio-cells = <2>; 107 - interrupts-extended = 108 - <&irqc0 0 0>, <&irqc0 1 0>, <&irqc0 2 0>, <&irqc0 3 0>, 109 - <&irqc0 4 0>, <&irqc0 5 0>, <&irqc0 6 0>, <&irqc0 7 0>, 110 - <&irqc0 8 0>, <&irqc0 9 0>, <&irqc0 10 0>, <&irqc0 11 0>, 111 - <&irqc0 12 0>, <&irqc0 13 0>, <&irqc0 14 0>, <&irqc0 15 0>, 112 - <&irqc0 16 0>, <&irqc0 17 0>, <&irqc0 18 0>, <&irqc0 19 0>, 113 - <&irqc0 20 0>, <&irqc0 21 0>, <&irqc0 22 0>, <&irqc0 23 0>, 114 - <&irqc0 24 0>, <&irqc0 25 0>, <&irqc0 26 0>, <&irqc0 27 0>, 115 - <&irqc0 28 0>, <&irqc0 29 0>, <&irqc0 30 0>, <&irqc0 31 0>, 116 - <&irqc1 0 0>, <&irqc1 1 0>, <&irqc1 2 0>, <&irqc1 3 0>, 117 - <&irqc1 4 0>, <&irqc1 5 0>, <&irqc1 6 0>, <&irqc1 7 0>, 118 - <&irqc1 8 0>, <&irqc1 9 0>, <&irqc1 10 0>, <&irqc1 11 0>, 119 - <&irqc1 12 0>, <&irqc1 13 0>, <&irqc1 14 0>, <&irqc1 15 0>, 120 - <&irqc1 16 0>, <&irqc1 17 0>, <&irqc1 18 0>, <&irqc1 19 0>, 121 - <&irqc1 20 0>, <&irqc1 21 0>, <&irqc1 22 0>, <&irqc1 23 0>, 122 - <&irqc1 24 0>, <&irqc1 25 0>; 123 93 }; 124 94 125 95 i2c5: i2c@e60b0000 { ··· 107 119 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 108 120 reg = <0 0xe60b0000 0 0x428>; 109 121 interrupts = <0 179 IRQ_TYPE_LEVEL_HIGH>; 122 + clocks = <&mstp4_clks R8A73A4_CLK_IIC5>; 123 + power-domains = <&pd_a3sp>; 110 124 111 125 status = "disabled"; 112 126 }; ··· 117 127 compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2"; 118 128 reg = <0 0xe6130000 0 0x1004>; 119 129 interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>; 130 + clocks = <&mstp3_clks R8A73A4_CLK_CMT1>; 131 + clock-names = "fck"; 132 + power-domains = <&pd_c5>; 120 133 121 134 renesas,channels-mask = <0xff>; 122 135 ··· 163 170 <0 29 IRQ_TYPE_LEVEL_HIGH>, 164 171 <0 30 IRQ_TYPE_LEVEL_HIGH>, 165 172 <0 31 IRQ_TYPE_LEVEL_HIGH>; 173 + power-domains = <&pd_c4>; 166 174 }; 167 175 168 176 irqc1: interrupt-controller@e61c0200 { ··· 197 203 <0 55 IRQ_TYPE_LEVEL_HIGH>, 198 204 <0 56 IRQ_TYPE_LEVEL_HIGH>, 199 205 <0 57 IRQ_TYPE_LEVEL_HIGH>; 206 + power-domains = <&pd_c4>; 207 + }; 208 + 209 + pfc: pfc@e6050000 { 210 + compatible = "renesas,pfc-r8a73a4"; 211 + reg = <0 0xe6050000 0 0x9000>; 212 + gpio-controller; 213 + #gpio-cells = <2>; 214 + interrupts-extended = 215 + <&irqc0 0 0>, <&irqc0 1 0>, <&irqc0 2 0>, <&irqc0 3 0>, 216 + <&irqc0 4 0>, <&irqc0 5 0>, <&irqc0 6 0>, <&irqc0 7 0>, 217 + <&irqc0 8 0>, <&irqc0 9 0>, <&irqc0 10 0>, <&irqc0 11 0>, 218 + <&irqc0 12 0>, <&irqc0 13 0>, <&irqc0 14 0>, <&irqc0 15 0>, 219 + <&irqc0 16 0>, <&irqc0 17 0>, <&irqc0 18 0>, <&irqc0 19 0>, 220 + <&irqc0 20 0>, <&irqc0 21 0>, <&irqc0 22 0>, <&irqc0 23 0>, 221 + <&irqc0 24 0>, <&irqc0 25 0>, <&irqc0 26 0>, <&irqc0 27 0>, 222 + <&irqc0 28 0>, <&irqc0 29 0>, <&irqc0 30 0>, <&irqc0 31 0>, 223 + <&irqc1 0 0>, <&irqc1 1 0>, <&irqc1 2 0>, <&irqc1 3 0>, 224 + <&irqc1 4 0>, <&irqc1 5 0>, <&irqc1 6 0>, <&irqc1 7 0>, 225 + <&irqc1 8 0>, <&irqc1 9 0>, <&irqc1 10 0>, <&irqc1 11 0>, 226 + <&irqc1 12 0>, <&irqc1 13 0>, <&irqc1 14 0>, <&irqc1 15 0>, 227 + <&irqc1 16 0>, <&irqc1 17 0>, <&irqc1 18 0>, <&irqc1 19 0>, 228 + <&irqc1 20 0>, <&irqc1 21 0>, <&irqc1 22 0>, <&irqc1 23 0>, 229 + <&irqc1 24 0>, <&irqc1 25 0>; 230 + power-domains = <&pd_c5>; 200 231 }; 201 232 202 233 thermal@e61f0000 { ··· 229 210 reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>, 230 211 <0 0xe61f0200 0 0x38>, <0 0xe61f0300 0 0x38>; 231 212 interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>; 213 + clocks = <&mstp5_clks R8A73A4_CLK_THERMAL>; 214 + power-domains = <&pd_c5>; 232 215 }; 233 216 234 217 i2c0: i2c@e6500000 { ··· 239 218 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 240 219 reg = <0 0xe6500000 0 0x428>; 241 220 interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>; 221 + clocks = <&mstp3_clks R8A73A4_CLK_IIC0>; 222 + power-domains = <&pd_a3sp>; 242 223 status = "disabled"; 243 224 }; 244 225 ··· 250 227 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 251 228 reg = <0 0xe6510000 0 0x428>; 252 229 interrupts = <0 175 IRQ_TYPE_LEVEL_HIGH>; 230 + clocks = <&mstp3_clks R8A73A4_CLK_IIC1>; 231 + power-domains = <&pd_a3sp>; 253 232 status = "disabled"; 254 233 }; 255 234 ··· 261 236 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 262 237 reg = <0 0xe6520000 0 0x428>; 263 238 interrupts = <0 176 IRQ_TYPE_LEVEL_HIGH>; 239 + clocks = <&mstp3_clks R8A73A4_CLK_IIC2>; 240 + power-domains = <&pd_a3sp>; 264 241 status = "disabled"; 265 242 }; 266 243 ··· 272 245 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 273 246 reg = <0 0xe6530000 0 0x428>; 274 247 interrupts = <0 177 IRQ_TYPE_LEVEL_HIGH>; 248 + clocks = <&mstp4_clks R8A73A4_CLK_IIC3>; 249 + power-domains = <&pd_a3sp>; 275 250 status = "disabled"; 276 251 }; 277 252 ··· 283 254 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 284 255 reg = <0 0xe6540000 0 0x428>; 285 256 interrupts = <0 178 IRQ_TYPE_LEVEL_HIGH>; 257 + clocks = <&mstp4_clks R8A73A4_CLK_IIC4>; 258 + power-domains = <&pd_a3sp>; 286 259 status = "disabled"; 287 260 }; 288 261 ··· 294 263 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 295 264 reg = <0 0xe6550000 0 0x428>; 296 265 interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>; 266 + clocks = <&mstp3_clks R8A73A4_CLK_IIC6>; 267 + power-domains = <&pd_a3sp>; 297 268 status = "disabled"; 298 269 }; 299 270 ··· 305 272 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 306 273 reg = <0 0xe6560000 0 0x428>; 307 274 interrupts = <0 185 IRQ_TYPE_LEVEL_HIGH>; 275 + clocks = <&mstp3_clks R8A73A4_CLK_IIC7>; 276 + power-domains = <&pd_a3sp>; 308 277 status = "disabled"; 309 278 }; 310 279 ··· 316 281 compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; 317 282 reg = <0 0xe6570000 0 0x428>; 318 283 interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>; 284 + clocks = <&mstp5_clks R8A73A4_CLK_IIC8>; 285 + power-domains = <&pd_a3sp>; 319 286 status = "disabled"; 320 287 }; 321 288 ··· 325 288 compatible = "renesas,scifb-r8a73a4", "renesas,scifb"; 326 289 reg = <0 0xe6c20000 0 0x100>; 327 290 interrupts = <0 148 IRQ_TYPE_LEVEL_HIGH>; 291 + clocks = <&mstp2_clks R8A73A4_CLK_SCIFB0>; 292 + clock-names = "sci_ick"; 293 + power-domains = <&pd_a3sp>; 328 294 status = "disabled"; 329 295 }; 330 296 ··· 335 295 compatible = "renesas,scifb-r8a73a4", "renesas,scifb"; 336 296 reg = <0 0xe6c30000 0 0x100>; 337 297 interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH>; 298 + clocks = <&mstp2_clks R8A73A4_CLK_SCIFB1>; 299 + clock-names = "sci_ick"; 300 + power-domains = <&pd_a3sp>; 338 301 status = "disabled"; 339 302 }; 340 303 ··· 345 302 compatible = "renesas,scifa-r8a73a4", "renesas,scifa"; 346 303 reg = <0 0xe6c40000 0 0x100>; 347 304 interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>; 305 + clocks = <&mstp2_clks R8A73A4_CLK_SCIFA0>; 306 + clock-names = "sci_ick"; 307 + power-domains = <&pd_a3sp>; 348 308 status = "disabled"; 349 309 }; 350 310 ··· 355 309 compatible = "renesas,scifa-r8a73a4", "renesas,scifa"; 356 310 reg = <0 0xe6c50000 0 0x100>; 357 311 interrupts = <0 145 IRQ_TYPE_LEVEL_HIGH>; 312 + clocks = <&mstp2_clks R8A73A4_CLK_SCIFA1>; 313 + clock-names = "sci_ick"; 314 + power-domains = <&pd_a3sp>; 358 315 status = "disabled"; 359 316 }; 360 317 ··· 365 316 compatible = "renesas,scifb-r8a73a4", "renesas,scifb"; 366 317 reg = <0 0xe6ce0000 0 0x100>; 367 318 interrupts = <0 150 IRQ_TYPE_LEVEL_HIGH>; 319 + clocks = <&mstp2_clks R8A73A4_CLK_SCIFB2>; 320 + clock-names = "sci_ick"; 321 + power-domains = <&pd_a3sp>; 368 322 status = "disabled"; 369 323 }; 370 324 ··· 375 323 compatible = "renesas,scifb-r8a73a4", "renesas,scifb"; 376 324 reg = <0 0xe6cf0000 0 0x100>; 377 325 interrupts = <0 151 IRQ_TYPE_LEVEL_HIGH>; 326 + clocks = <&mstp2_clks R8A73A4_CLK_SCIFB3>; 327 + clock-names = "sci_ick"; 328 + power-domains = <&pd_c4>; 378 329 status = "disabled"; 379 330 }; 380 331 ··· 385 330 compatible = "renesas,sdhi-r8a73a4"; 386 331 reg = <0 0xee100000 0 0x100>; 387 332 interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>; 333 + clocks = <&mstp3_clks R8A73A4_CLK_SDHI0>; 334 + power-domains = <&pd_a3sp>; 388 335 cap-sd-highspeed; 389 336 status = "disabled"; 390 337 }; ··· 395 338 compatible = "renesas,sdhi-r8a73a4"; 396 339 reg = <0 0xee120000 0 0x100>; 397 340 interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>; 341 + clocks = <&mstp3_clks R8A73A4_CLK_SDHI1>; 342 + power-domains = <&pd_a3sp>; 398 343 cap-sd-highspeed; 399 344 status = "disabled"; 400 345 }; ··· 405 346 compatible = "renesas,sdhi-r8a73a4"; 406 347 reg = <0 0xee140000 0 0x100>; 407 348 interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>; 349 + clocks = <&mstp3_clks R8A73A4_CLK_SDHI2>; 350 + power-domains = <&pd_a3sp>; 408 351 cap-sd-highspeed; 409 352 status = "disabled"; 410 353 }; ··· 415 354 compatible = "renesas,sh-mmcif"; 416 355 reg = <0 0xee200000 0 0x80>; 417 356 interrupts = <0 169 IRQ_TYPE_LEVEL_HIGH>; 357 + clocks = <&mstp3_clks R8A73A4_CLK_MMCIF0>; 358 + power-domains = <&pd_a3sp>; 418 359 reg-io-width = <4>; 419 360 status = "disabled"; 420 361 }; ··· 425 362 compatible = "renesas,sh-mmcif"; 426 363 reg = <0 0xee220000 0 0x80>; 427 364 interrupts = <0 170 IRQ_TYPE_LEVEL_HIGH>; 365 + clocks = <&mstp3_clks R8A73A4_CLK_MMCIF1>; 366 + power-domains = <&pd_a3sp>; 428 367 reg-io-width = <4>; 429 368 status = "disabled"; 430 369 }; ··· 441 376 <0 0xf1004000 0 0x2000>, 442 377 <0 0xf1006000 0 0x2000>; 443 378 interrupts = <1 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; 379 + }; 380 + 381 + bsc: bus@fec10000 { 382 + compatible = "renesas,bsc-r8a73a4", "renesas,bsc", 383 + "simple-pm-bus"; 384 + #address-cells = <1>; 385 + #size-cells = <1>; 386 + ranges = <0 0 0 0x20000000>; 387 + reg = <0 0xfec10000 0 0x400>; 388 + clocks = <&zb_clk>; 389 + power-domains = <&pd_c4>; 390 + }; 391 + 392 + clocks { 393 + #address-cells = <2>; 394 + #size-cells = <2>; 395 + ranges; 396 + 397 + /* External root clocks */ 398 + extalr_clk: extalr_clk { 399 + compatible = "fixed-clock"; 400 + #clock-cells = <0>; 401 + clock-frequency = <32768>; 402 + clock-output-names = "extalr"; 403 + }; 404 + extal1_clk: extal1_clk { 405 + compatible = "fixed-clock"; 406 + #clock-cells = <0>; 407 + clock-frequency = <25000000>; 408 + clock-output-names = "extal1"; 409 + }; 410 + extal2_clk: extal2_clk { 411 + compatible = "fixed-clock"; 412 + #clock-cells = <0>; 413 + clock-frequency = <48000000>; 414 + clock-output-names = "extal2"; 415 + }; 416 + fsiack_clk: fsiack_clk { 417 + compatible = "fixed-clock"; 418 + #clock-cells = <0>; 419 + /* This value must be overridden by the board. */ 420 + clock-frequency = <0>; 421 + clock-output-names = "fsiack"; 422 + }; 423 + fsibck_clk: fsibck_clk { 424 + compatible = "fixed-clock"; 425 + #clock-cells = <0>; 426 + /* This value must be overridden by the board. */ 427 + clock-frequency = <0>; 428 + clock-output-names = "fsibck"; 429 + }; 430 + 431 + /* Special CPG clocks */ 432 + cpg_clocks: cpg_clocks@e6150000 { 433 + compatible = "renesas,r8a73a4-cpg-clocks"; 434 + reg = <0 0xe6150000 0 0x10000>; 435 + clocks = <&extal1_clk>, <&extal2_clk>; 436 + #clock-cells = <1>; 437 + clock-output-names = "main", "pll0", "pll1", "pll2", 438 + "pll2s", "pll2h", "z", "z2", 439 + "i", "m3", "b", "m1", "m2", 440 + "zx", "zs", "hp"; 441 + }; 442 + 443 + /* Variable factor clocks (DIV6) */ 444 + zb_clk: zb_clk@e6150010 { 445 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 446 + reg = <0 0xe6150010 0 4>; 447 + clocks = <&pll1_div2_clk>, <0>, 448 + <&cpg_clocks R8A73A4_CLK_PLL2S>, <0>; 449 + #clock-cells = <0>; 450 + clock-output-names = "zb"; 451 + }; 452 + sdhi0_clk: sdhi0_clk@e6150074 { 453 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 454 + reg = <0 0xe6150074 0 4>; 455 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 456 + <0>, <&extal2_clk>; 457 + #clock-cells = <0>; 458 + clock-output-names = "sdhi0ck"; 459 + }; 460 + sdhi1_clk: sdhi1_clk@e6150078 { 461 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 462 + reg = <0 0xe6150078 0 4>; 463 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 464 + <0>, <&extal2_clk>; 465 + #clock-cells = <0>; 466 + clock-output-names = "sdhi1ck"; 467 + }; 468 + sdhi2_clk: sdhi2_clk@e615007c { 469 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 470 + reg = <0 0xe615007c 0 4>; 471 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 472 + <0>, <&extal2_clk>; 473 + #clock-cells = <0>; 474 + clock-output-names = "sdhi2ck"; 475 + }; 476 + mmc0_clk: mmc0_clk@e6150240 { 477 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 478 + reg = <0 0xe6150240 0 4>; 479 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 480 + <0>, <&extal2_clk>; 481 + #clock-cells = <0>; 482 + clock-output-names = "mmc0"; 483 + }; 484 + mmc1_clk: mmc1_clk@e6150244 { 485 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 486 + reg = <0 0xe6150244 0 4>; 487 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 488 + <0>, <&extal2_clk>; 489 + #clock-cells = <0>; 490 + clock-output-names = "mmc1"; 491 + }; 492 + vclk1_clk: vclk1_clk@e6150008 { 493 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 494 + reg = <0 0xe6150008 0 4>; 495 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 496 + <0>, <&extal2_clk>, <&main_div2_clk>, 497 + <&extalr_clk>, <0>, <0>; 498 + #clock-cells = <0>; 499 + clock-output-names = "vclk1"; 500 + }; 501 + vclk2_clk: vclk2_clk@e615000c { 502 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 503 + reg = <0 0xe615000c 0 4>; 504 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 505 + <0>, <&extal2_clk>, <&main_div2_clk>, 506 + <&extalr_clk>, <0>, <0>; 507 + #clock-cells = <0>; 508 + clock-output-names = "vclk2"; 509 + }; 510 + vclk3_clk: vclk3_clk@e615001c { 511 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 512 + reg = <0 0xe615001c 0 4>; 513 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 514 + <0>, <&extal2_clk>, <&main_div2_clk>, 515 + <&extalr_clk>, <0>, <0>; 516 + #clock-cells = <0>; 517 + clock-output-names = "vclk3"; 518 + }; 519 + vclk4_clk: vclk4_clk@e6150014 { 520 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 521 + reg = <0 0xe6150014 0 4>; 522 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 523 + <0>, <&extal2_clk>, <&main_div2_clk>, 524 + <&extalr_clk>, <0>, <0>; 525 + #clock-cells = <0>; 526 + clock-output-names = "vclk4"; 527 + }; 528 + vclk5_clk: vclk5_clk@e6150034 { 529 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 530 + reg = <0 0xe6150034 0 4>; 531 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 532 + <0>, <&extal2_clk>, <&main_div2_clk>, 533 + <&extalr_clk>, <0>, <0>; 534 + #clock-cells = <0>; 535 + clock-output-names = "vclk5"; 536 + }; 537 + fsia_clk: fsia_clk@e6150018 { 538 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 539 + reg = <0 0xe6150018 0 4>; 540 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 541 + <&fsiack_clk>, <0>; 542 + #clock-cells = <0>; 543 + clock-output-names = "fsia"; 544 + }; 545 + fsib_clk: fsib_clk@e6150090 { 546 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 547 + reg = <0 0xe6150090 0 4>; 548 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 549 + <&fsibck_clk>, <0>; 550 + #clock-cells = <0>; 551 + clock-output-names = "fsib"; 552 + }; 553 + mp_clk: mp_clk@e6150080 { 554 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 555 + reg = <0 0xe6150080 0 4>; 556 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 557 + <&extal2_clk>, <&extal2_clk>; 558 + #clock-cells = <0>; 559 + clock-output-names = "mp"; 560 + }; 561 + m4_clk: m4_clk@e6150098 { 562 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 563 + reg = <0 0xe6150098 0 4>; 564 + clocks = <&cpg_clocks R8A73A4_CLK_PLL2S>; 565 + #clock-cells = <0>; 566 + clock-output-names = "m4"; 567 + }; 568 + hsi_clk: hsi_clk@e615026c { 569 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 570 + reg = <0 0xe615026c 0 4>; 571 + clocks = <&cpg_clocks R8A73A4_CLK_PLL2H>, <&pll1_div2_clk>, 572 + <&cpg_clocks R8A73A4_CLK_PLL2S>, <0>; 573 + #clock-cells = <0>; 574 + clock-output-names = "hsi"; 575 + }; 576 + spuv_clk: spuv_clk@e6150094 { 577 + compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock"; 578 + reg = <0 0xe6150094 0 4>; 579 + clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, 580 + <&extal2_clk>, <&extal2_clk>; 581 + #clock-cells = <0>; 582 + clock-output-names = "spuv"; 583 + }; 584 + 585 + /* Fixed factor clocks */ 586 + main_div2_clk: main_div2_clk { 587 + compatible = "fixed-factor-clock"; 588 + clocks = <&cpg_clocks R8A73A4_CLK_MAIN>; 589 + #clock-cells = <0>; 590 + clock-div = <2>; 591 + clock-mult = <1>; 592 + clock-output-names = "main_div2"; 593 + }; 594 + pll0_div2_clk: pll0_div2_clk { 595 + compatible = "fixed-factor-clock"; 596 + clocks = <&cpg_clocks R8A73A4_CLK_PLL0>; 597 + #clock-cells = <0>; 598 + clock-div = <2>; 599 + clock-mult = <1>; 600 + clock-output-names = "pll0_div2"; 601 + }; 602 + pll1_div2_clk: pll1_div2_clk { 603 + compatible = "fixed-factor-clock"; 604 + clocks = <&cpg_clocks R8A73A4_CLK_PLL1>; 605 + #clock-cells = <0>; 606 + clock-div = <2>; 607 + clock-mult = <1>; 608 + clock-output-names = "pll1_div2"; 609 + }; 610 + extal1_div2_clk: extal1_div2_clk { 611 + compatible = "fixed-factor-clock"; 612 + clocks = <&extal1_clk>; 613 + #clock-cells = <0>; 614 + clock-div = <2>; 615 + clock-mult = <1>; 616 + clock-output-names = "extal1_div2"; 617 + }; 618 + 619 + /* Gate clocks */ 620 + mstp2_clks: mstp2_clks@e6150138 { 621 + compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks"; 622 + reg = <0 0xe6150138 0 4>, <0 0xe6150040 0 4>; 623 + clocks = <&mp_clk>, <&mp_clk>, <&mp_clk>, <&mp_clk>, 624 + <&mp_clk>, <&mp_clk>, <&cpg_clocks R8A73A4_CLK_HP>; 625 + #clock-cells = <1>; 626 + clock-indices = < 627 + R8A73A4_CLK_SCIFA0 R8A73A4_CLK_SCIFA1 628 + R8A73A4_CLK_SCIFB0 R8A73A4_CLK_SCIFB1 629 + R8A73A4_CLK_SCIFB2 R8A73A4_CLK_SCIFB3 630 + R8A73A4_CLK_DMAC 631 + >; 632 + clock-output-names = 633 + "scifa0", "scifa1", "scifb0", "scifb1", 634 + "scifb2", "scifb3", "dmac"; 635 + }; 636 + mstp3_clks: mstp3_clks@e615013c { 637 + compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks"; 638 + reg = <0 0xe615013c 0 4>, <0 0xe6150048 0 4>; 639 + clocks = <&cpg_clocks R8A73A4_CLK_HP>, <&mmc1_clk>, 640 + <&sdhi2_clk>, <&sdhi1_clk>, <&sdhi0_clk>, 641 + <&mmc0_clk>, <&cpg_clocks R8A73A4_CLK_HP>, 642 + <&cpg_clocks R8A73A4_CLK_HP>, <&cpg_clocks 643 + R8A73A4_CLK_HP>, <&cpg_clocks 644 + R8A73A4_CLK_HP>, <&extalr_clk>; 645 + #clock-cells = <1>; 646 + clock-indices = < 647 + R8A73A4_CLK_IIC2 R8A73A4_CLK_MMCIF1 648 + R8A73A4_CLK_SDHI2 R8A73A4_CLK_SDHI1 649 + R8A73A4_CLK_SDHI0 R8A73A4_CLK_MMCIF0 650 + R8A73A4_CLK_IIC6 R8A73A4_CLK_IIC7 651 + R8A73A4_CLK_IIC0 R8A73A4_CLK_IIC1 652 + R8A73A4_CLK_CMT1 653 + >; 654 + clock-output-names = 655 + "iic2", "mmcif1", "sdhi2", "sdhi1", "sdhi0", 656 + "mmcif0", "iic6", "iic7", "iic0", "iic1", 657 + "cmt1"; 658 + }; 659 + mstp4_clks: mstp4_clks@e6150140 { 660 + compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks"; 661 + reg = <0 0xe6150140 0 4>, <0 0xe615004c 0 4>; 662 + clocks = <&main_div2_clk>, <&cpg_clocks R8A73A4_CLK_HP>, 663 + <&cpg_clocks R8A73A4_CLK_HP>; 664 + #clock-cells = <1>; 665 + clock-indices = < 666 + R8A73A4_CLK_IIC5 R8A73A4_CLK_IIC4 667 + R8A73A4_CLK_IIC3 668 + >; 669 + clock-output-names = 670 + "iic5", "iic4", "iic3"; 671 + }; 672 + mstp5_clks: mstp5_clks@e6150144 { 673 + compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks"; 674 + reg = <0 0xe6150144 0 4>, <0 0xe615003c 0 4>; 675 + clocks = <&extal2_clk>, <&cpg_clocks R8A73A4_CLK_HP>; 676 + #clock-cells = <1>; 677 + clock-indices = < 678 + R8A73A4_CLK_THERMAL R8A73A4_CLK_IIC8 679 + >; 680 + clock-output-names = 681 + "thermal", "iic8"; 682 + }; 683 + }; 684 + 685 + sysc: system-controller@e6180000 { 686 + compatible = "renesas,sysc-r8a73a4", "renesas,sysc-rmobile"; 687 + reg = <0 0xe6180000 0 0x8000>, <0 0xe6188000 0 0x8000>; 688 + 689 + pm-domains { 690 + pd_c5: c5 { 691 + #address-cells = <1>; 692 + #size-cells = <0>; 693 + #power-domain-cells = <0>; 694 + 695 + pd_c4: c4@0 { 696 + reg = <0>; 697 + #address-cells = <1>; 698 + #size-cells = <0>; 699 + #power-domain-cells = <0>; 700 + 701 + pd_a3sg: a3sg@16 { 702 + reg = <16>; 703 + #power-domain-cells = <0>; 704 + }; 705 + 706 + pd_a3ex: a3ex@17 { 707 + reg = <17>; 708 + #power-domain-cells = <0>; 709 + }; 710 + 711 + pd_a3sp: a3sp@18 { 712 + reg = <18>; 713 + #address-cells = <1>; 714 + #size-cells = <0>; 715 + #power-domain-cells = <0>; 716 + 717 + pd_a2us: a2us@19 { 718 + reg = <19>; 719 + #power-domain-cells = <0>; 720 + }; 721 + }; 722 + 723 + pd_a3sm: a3sm@20 { 724 + reg = <20>; 725 + #address-cells = <1>; 726 + #size-cells = <0>; 727 + #power-domain-cells = <0>; 728 + 729 + pd_a2sl: a2sl@21 { 730 + reg = <21>; 731 + #power-domain-cells = <0>; 732 + }; 733 + }; 734 + 735 + pd_a3km: a3km@22 { 736 + reg = <22>; 737 + #address-cells = <1>; 738 + #size-cells = <0>; 739 + #power-domain-cells = <0>; 740 + 741 + pd_a2kl: a2kl@23 { 742 + reg = <23>; 743 + #power-domain-cells = <0>; 744 + }; 745 + }; 746 + }; 747 + 748 + pd_c4ma: c4ma@1 { 749 + reg = <1>; 750 + #power-domain-cells = <0>; 751 + }; 752 + 753 + pd_c4cl: c4cl@2 { 754 + reg = <2>; 755 + #power-domain-cells = <0>; 756 + }; 757 + 758 + pd_d4: d4@3 { 759 + reg = <3>; 760 + #power-domain-cells = <0>; 761 + }; 762 + 763 + pd_a4bc: a4bc@4 { 764 + reg = <4>; 765 + #address-cells = <1>; 766 + #size-cells = <0>; 767 + #power-domain-cells = <0>; 768 + 769 + pd_a3bc: a3bc@5 { 770 + reg = <5>; 771 + #power-domain-cells = <0>; 772 + }; 773 + }; 774 + 775 + pd_a4l: a4l@6 { 776 + reg = <6>; 777 + #power-domain-cells = <0>; 778 + }; 779 + 780 + pd_a4lc: a4lc@7 { 781 + reg = <7>; 782 + #power-domain-cells = <0>; 783 + }; 784 + 785 + pd_a4mp: a4mp@8 { 786 + reg = <8>; 787 + #address-cells = <1>; 788 + #size-cells = <0>; 789 + #power-domain-cells = <0>; 790 + 791 + pd_a3mp: a3mp@9 { 792 + reg = <9>; 793 + #power-domain-cells = <0>; 794 + }; 795 + 796 + pd_a3vc: a3vc@10 { 797 + reg = <10>; 798 + #power-domain-cells = <0>; 799 + }; 800 + }; 801 + 802 + pd_a4sf: a4sf@11 { 803 + reg = <11>; 804 + #power-domain-cells = <0>; 805 + }; 806 + 807 + pd_a3r: a3r@12 { 808 + reg = <12>; 809 + #address-cells = <1>; 810 + #size-cells = <0>; 811 + #power-domain-cells = <0>; 812 + 813 + pd_a2rv: a2rv@13 { 814 + reg = <13>; 815 + #power-domain-cells = <0>; 816 + }; 817 + 818 + pd_a2is: a2is@14 { 819 + reg = <14>; 820 + #power-domain-cells = <0>; 821 + }; 822 + }; 823 + }; 824 + }; 444 825 }; 445 826 };
+174
arch/arm/boot/dts/r8a7778-bockw.dts
··· 16 16 17 17 /dts-v1/; 18 18 #include "r8a7778.dtsi" 19 + #include <dt-bindings/interrupt-controller/irq.h> 20 + #include <dt-bindings/gpio/gpio.h> 19 21 20 22 / { 21 23 model = "bockw"; 22 24 compatible = "renesas,bockw", "renesas,r8a7778"; 23 25 26 + aliases { 27 + serial0 = &scif0; 28 + }; 29 + 24 30 chosen { 25 31 bootargs = "console=ttySC0,115200 ignore_loglevel ip=dhcp root=/dev/nfs rw"; 32 + stdout-path = &scif0; 26 33 }; 27 34 28 35 memory { 29 36 device_type = "memory"; 30 37 reg = <0x60000000 0x10000000>; 31 38 }; 39 + 40 + fixedregulator3v3: fixedregulator@0 { 41 + compatible = "regulator-fixed"; 42 + regulator-name = "fixed-3.3V"; 43 + regulator-min-microvolt = <3300000>; 44 + regulator-max-microvolt = <3300000>; 45 + regulator-boot-on; 46 + regulator-always-on; 47 + }; 48 + 49 + sound { 50 + compatible = "simple-audio-card"; 51 + 52 + simple-audio-card,format = "left_j"; 53 + simple-audio-card,bitclock-master = <&sndcodec>; 54 + simple-audio-card,frame-master = <&sndcodec>; 55 + 56 + sndcpu: simple-audio-card,cpu { 57 + sound-dai = <&rcar_sound>; 58 + }; 59 + 60 + sndcodec: simple-audio-card,codec { 61 + sound-dai = <&ak4643>; 62 + system-clock-frequency = <11289600>; 63 + }; 64 + }; 65 + }; 66 + 67 + &bsc { 68 + ethernet@18300000 { 69 + compatible = "smsc,lan9220", "smsc,lan9115"; 70 + reg = <0x18300000 0x1000>; 71 + 72 + phy-mode = "mii"; 73 + interrupt-parent = <&irqpin>; 74 + interrupts = <0 IRQ_TYPE_EDGE_FALLING>; 75 + reg-io-width = <4>; 76 + vddvario-supply = <&fixedregulator3v3>; 77 + vdd33a-supply = <&fixedregulator3v3>; 78 + }; 79 + }; 80 + 81 + &extal_clk { 82 + clock-frequency = <33333333>; 83 + }; 84 + 85 + &i2c0 { 86 + status = "okay"; 87 + 88 + ak4643: sound-codec@12 { 89 + compatible = "asahi-kasei,ak4643"; 90 + #sound-dai-cells = <0>; 91 + reg = <0x12>; 92 + }; 93 + 94 + camera@41 { 95 + compatible = "oki,ml86v7667"; 96 + reg = <0x41>; 97 + }; 98 + 99 + camera@43 { 100 + compatible = "oki,ml86v7667"; 101 + reg = <0x43>; 102 + }; 103 + 104 + rx8581: rtc@51 { 105 + compatible = "epson,rx8581"; 106 + reg = <0x51>; 107 + }; 108 + }; 109 + 110 + &mmcif { 111 + pinctrl-0 = <&mmc_pins>; 112 + pinctrl-names = "default"; 113 + 114 + vmmc-supply = <&fixedregulator3v3>; 115 + bus-width = <8>; 116 + broken-cd; 117 + status = "okay"; 118 + }; 119 + 120 + &irqpin { 121 + status = "okay"; 122 + }; 123 + 124 + &tmu0 { 125 + status = "okay"; 126 + }; 127 + 128 + &pfc { 129 + scif0_pins: serial0 { 130 + renesas,groups = "scif0_data_a", "scif0_ctrl"; 131 + renesas,function = "scif0"; 132 + }; 133 + 134 + mmc_pins: mmc { 135 + renesas,groups = "mmc_data8", "mmc_ctrl"; 136 + renesas,function = "mmc"; 137 + }; 138 + 139 + sdhi0_pins: sd0 { 140 + renesas,groups = "sdhi0_data4", "sdhi0_ctrl", 141 + "sdhi0_cd"; 142 + renesas,function = "sdhi0"; 143 + }; 144 + 145 + hspi0_pins: hspi0 { 146 + renesas,groups = "hspi0_a"; 147 + renesas,function = "hspi0"; 148 + }; 149 + 150 + usb0_pins: usb0 { 151 + renesas,groups = "usb0"; 152 + renesas,function = "usb0"; 153 + }; 154 + 155 + usb1_pins: usb1 { 156 + renesas,groups = "usb1"; 157 + renesas,function = "usb1"; 158 + }; 159 + 160 + vin0_pins: vin0 { 161 + renesas,groups = "vin0_data8", "vin0_clk"; 162 + renesas,function = "vin0"; 163 + }; 164 + 165 + vin1_pins: vin1 { 166 + renesas,groups = "vin1_data8", "vin1_clk"; 167 + renesas,function = "vin1"; 168 + }; 169 + }; 170 + 171 + &sdhi0 { 172 + pinctrl-0 = <&sdhi0_pins>; 173 + pinctrl-names = "default"; 174 + 175 + vmmc-supply = <&fixedregulator3v3>; 176 + bus-width = <4>; 177 + status = "okay"; 178 + wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>; 179 + }; 180 + 181 + &hspi0 { 182 + pinctrl-0 = <&hspi0_pins>; 183 + pinctrl-names = "default"; 184 + status = "okay"; 185 + 186 + flash: flash@0 { 187 + #address-cells = <1>; 188 + #size-cells = <1>; 189 + compatible = "spansion,s25fl008k"; 190 + reg = <0>; 191 + spi-max-frequency = <104000000>; 192 + m25p,fast-read; 193 + 194 + partition@0 { 195 + label = "data(spi)"; 196 + reg = <0x00000000 0x00100000>; 197 + }; 198 + }; 199 + }; 200 + 201 + &scif0 { 202 + pinctrl-0 = <&scif0_pins>; 203 + pinctrl-names = "default"; 204 + 205 + status = "okay"; 32 206 };
+293
arch/arm/boot/dts/r8a7778.dtsi
··· 16 16 17 17 /include/ "skeleton.dtsi" 18 18 19 + #include <dt-bindings/clock/r8a7778-clock.h> 19 20 #include <dt-bindings/interrupt-controller/irq.h> 20 21 21 22 / { ··· 39 38 spi0 = &hspi0; 40 39 spi1 = &hspi1; 41 40 spi2 = &hspi2; 41 + }; 42 + 43 + bsc: bus@1c000000 { 44 + compatible = "simple-bus"; 45 + #address-cells = <1>; 46 + #size-cells = <1>; 47 + ranges = <0 0 0x1c000000>; 48 + }; 49 + 50 + ether: ethernet@fde00000 { 51 + compatible = "renesas,ether-r8a7778"; 52 + reg = <0xfde00000 0x400>; 53 + interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>; 54 + clocks = <&mstp1_clks R8A7778_CLK_ETHER>; 55 + phy-mode = "rmii"; 56 + #address-cells = <1>; 57 + #size-cells = <0>; 58 + status = "disabled"; 42 59 }; 43 60 44 61 gic: interrupt-controller@fe438000 { ··· 151 132 compatible = "renesas,i2c-r8a7778"; 152 133 reg = <0xffc70000 0x1000>; 153 134 interrupts = <0 67 IRQ_TYPE_LEVEL_HIGH>; 135 + clocks = <&mstp0_clks R8A7778_CLK_I2C0>; 154 136 status = "disabled"; 155 137 }; 156 138 ··· 161 141 compatible = "renesas,i2c-r8a7778"; 162 142 reg = <0xffc71000 0x1000>; 163 143 interrupts = <0 78 IRQ_TYPE_LEVEL_HIGH>; 144 + clocks = <&mstp0_clks R8A7778_CLK_I2C1>; 164 145 status = "disabled"; 165 146 }; 166 147 ··· 171 150 compatible = "renesas,i2c-r8a7778"; 172 151 reg = <0xffc72000 0x1000>; 173 152 interrupts = <0 76 IRQ_TYPE_LEVEL_HIGH>; 153 + clocks = <&mstp0_clks R8A7778_CLK_I2C2>; 174 154 status = "disabled"; 175 155 }; 176 156 ··· 181 159 compatible = "renesas,i2c-r8a7778"; 182 160 reg = <0xffc73000 0x1000>; 183 161 interrupts = <0 77 IRQ_TYPE_LEVEL_HIGH>; 162 + clocks = <&mstp0_clks R8A7778_CLK_I2C3>; 184 163 status = "disabled"; 185 164 }; 186 165 ··· 191 168 interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>, 192 169 <0 33 IRQ_TYPE_LEVEL_HIGH>, 193 170 <0 34 IRQ_TYPE_LEVEL_HIGH>; 171 + clocks = <&mstp0_clks R8A7778_CLK_TMU0>; 172 + clock-names = "fck"; 194 173 195 174 #renesas,channels = <3>; 196 175 ··· 205 180 interrupts = <0 36 IRQ_TYPE_LEVEL_HIGH>, 206 181 <0 37 IRQ_TYPE_LEVEL_HIGH>, 207 182 <0 38 IRQ_TYPE_LEVEL_HIGH>; 183 + clocks = <&mstp0_clks R8A7778_CLK_TMU1>; 184 + clock-names = "fck"; 208 185 209 186 #renesas,channels = <3>; 210 187 ··· 219 192 interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, 220 193 <0 41 IRQ_TYPE_LEVEL_HIGH>, 221 194 <0 42 IRQ_TYPE_LEVEL_HIGH>; 195 + clocks = <&mstp0_clks R8A7778_CLK_TMU2>; 196 + clock-names = "fck"; 222 197 223 198 #renesas,channels = <3>; 224 199 225 200 status = "disabled"; 226 201 }; 227 202 203 + rcar_sound: sound@ffd90000 { 204 + #sound-dai-cells = <1>; 205 + compatible = "renesas,rcar_sound-r8a7778", "renesas,rcar_sound-gen1"; 206 + reg = <0xffd90000 0x1000>, /* SRU */ 207 + <0xffd91000 0x1240>, /* SSI */ 208 + <0xfffe0000 0x24>; /* ADG */ 209 + clocks = <&mstp3_clks R8A7778_CLK_SSI8>, 210 + <&mstp3_clks R8A7778_CLK_SSI7>, 211 + <&mstp3_clks R8A7778_CLK_SSI6>, 212 + <&mstp3_clks R8A7778_CLK_SSI5>, 213 + <&mstp3_clks R8A7778_CLK_SSI4>, 214 + <&mstp0_clks R8A7778_CLK_SSI3>, 215 + <&mstp0_clks R8A7778_CLK_SSI2>, 216 + <&mstp0_clks R8A7778_CLK_SSI1>, 217 + <&mstp0_clks R8A7778_CLK_SSI0>, 218 + <&mstp5_clks R8A7778_CLK_SRU_SRC8>, 219 + <&mstp5_clks R8A7778_CLK_SRU_SRC7>, 220 + <&mstp5_clks R8A7778_CLK_SRU_SRC6>, 221 + <&mstp5_clks R8A7778_CLK_SRU_SRC5>, 222 + <&mstp5_clks R8A7778_CLK_SRU_SRC4>, 223 + <&mstp5_clks R8A7778_CLK_SRU_SRC3>, 224 + <&mstp5_clks R8A7778_CLK_SRU_SRC2>, 225 + <&mstp5_clks R8A7778_CLK_SRU_SRC1>, 226 + <&mstp5_clks R8A7778_CLK_SRU_SRC0>, 227 + <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, 228 + <&cpg_clocks R8A7778_CLK_S1>; 229 + clock-names = "ssi.8", "ssi.7", "ssi.6", "ssi.5", "ssi.4", 230 + "ssi.3", "ssi.2", "ssi.1", "ssi.0", 231 + "src.8", "src.7", "src.6", "src.5", "src.4", 232 + "src.3", "src.2", "src.1", "src.0", 233 + "clk_a", "clk_b", "clk_c", "clk_i"; 234 + 235 + status = "disabled"; 236 + 237 + rcar_sound,src { 238 + src3: src@3 { }; 239 + src4: src@4 { }; 240 + src5: src@5 { }; 241 + src6: src@6 { }; 242 + src7: src@7 { }; 243 + src8: src@8 { }; 244 + src9: src@9 { }; 245 + }; 246 + 247 + rcar_sound,ssi { 248 + ssi3: ssi@3 { interrupts = <0 0x85 IRQ_TYPE_LEVEL_HIGH>; }; 249 + ssi4: ssi@4 { interrupts = <0 0x85 IRQ_TYPE_LEVEL_HIGH>; }; 250 + ssi5: ssi@5 { interrupts = <0 0x86 IRQ_TYPE_LEVEL_HIGH>; }; 251 + ssi6: ssi@6 { interrupts = <0 0x86 IRQ_TYPE_LEVEL_HIGH>; }; 252 + ssi7: ssi@7 { interrupts = <0 0x86 IRQ_TYPE_LEVEL_HIGH>; }; 253 + ssi8: ssi@8 { interrupts = <0 0x86 IRQ_TYPE_LEVEL_HIGH>; }; 254 + ssi9: ssi@9 { interrupts = <0 0x86 IRQ_TYPE_LEVEL_HIGH>; }; 255 + }; 256 + }; 257 + 228 258 scif0: serial@ffe40000 { 229 259 compatible = "renesas,scif-r8a7778", "renesas,scif"; 230 260 reg = <0xffe40000 0x100>; 231 261 interrupts = <0 70 IRQ_TYPE_LEVEL_HIGH>; 262 + clocks = <&mstp0_clks R8A7778_CLK_SCIF0>; 263 + clock-names = "sci_ick"; 232 264 status = "disabled"; 233 265 }; 234 266 ··· 295 209 compatible = "renesas,scif-r8a7778", "renesas,scif"; 296 210 reg = <0xffe41000 0x100>; 297 211 interrupts = <0 71 IRQ_TYPE_LEVEL_HIGH>; 212 + clocks = <&mstp0_clks R8A7778_CLK_SCIF1>; 213 + clock-names = "sci_ick"; 298 214 status = "disabled"; 299 215 }; 300 216 ··· 304 216 compatible = "renesas,scif-r8a7778", "renesas,scif"; 305 217 reg = <0xffe42000 0x100>; 306 218 interrupts = <0 72 IRQ_TYPE_LEVEL_HIGH>; 219 + clocks = <&mstp0_clks R8A7778_CLK_SCIF2>; 220 + clock-names = "sci_ick"; 307 221 status = "disabled"; 308 222 }; 309 223 ··· 313 223 compatible = "renesas,scif-r8a7778", "renesas,scif"; 314 224 reg = <0xffe43000 0x100>; 315 225 interrupts = <0 73 IRQ_TYPE_LEVEL_HIGH>; 226 + clocks = <&mstp0_clks R8A7778_CLK_SCIF3>; 227 + clock-names = "sci_ick"; 316 228 status = "disabled"; 317 229 }; 318 230 ··· 322 230 compatible = "renesas,scif-r8a7778", "renesas,scif"; 323 231 reg = <0xffe44000 0x100>; 324 232 interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>; 233 + clocks = <&mstp0_clks R8A7778_CLK_SCIF4>; 234 + clock-names = "sci_ick"; 325 235 status = "disabled"; 326 236 }; 327 237 ··· 331 237 compatible = "renesas,scif-r8a7778", "renesas,scif"; 332 238 reg = <0xffe45000 0x100>; 333 239 interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>; 240 + clocks = <&mstp0_clks R8A7778_CLK_SCIF5>; 241 + clock-names = "sci_ick"; 334 242 status = "disabled"; 335 243 }; 336 244 ··· 340 244 compatible = "renesas,sh-mmcif"; 341 245 reg = <0xffe4e000 0x100>; 342 246 interrupts = <0 61 IRQ_TYPE_LEVEL_HIGH>; 247 + clocks = <&mstp3_clks R8A7778_CLK_MMC>; 343 248 status = "disabled"; 344 249 }; 345 250 ··· 348 251 compatible = "renesas,sdhi-r8a7778"; 349 252 reg = <0xffe4c000 0x100>; 350 253 interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>; 254 + clocks = <&mstp3_clks R8A7778_CLK_SDHI0>; 351 255 status = "disabled"; 352 256 }; 353 257 ··· 356 258 compatible = "renesas,sdhi-r8a7778"; 357 259 reg = <0xffe4d000 0x100>; 358 260 interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>; 261 + clocks = <&mstp3_clks R8A7778_CLK_SDHI1>; 359 262 status = "disabled"; 360 263 }; 361 264 ··· 364 265 compatible = "renesas,sdhi-r8a7778"; 365 266 reg = <0xffe4f000 0x100>; 366 267 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>; 268 + clocks = <&mstp3_clks R8A7778_CLK_SDHI2>; 367 269 status = "disabled"; 368 270 }; 369 271 ··· 372 272 compatible = "renesas,hspi-r8a7778", "renesas,hspi"; 373 273 reg = <0xfffc7000 0x18>; 374 274 interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>; 275 + clocks = <&mstp0_clks R8A7778_CLK_HSPI>; 375 276 #address-cells = <1>; 376 277 #size-cells = <0>; 377 278 status = "disabled"; ··· 382 281 compatible = "renesas,hspi-r8a7778", "renesas,hspi"; 383 282 reg = <0xfffc8000 0x18>; 384 283 interrupts = <0 84 IRQ_TYPE_LEVEL_HIGH>; 284 + clocks = <&mstp0_clks R8A7778_CLK_HSPI>; 385 285 #address-cells = <1>; 386 286 #size-cells = <0>; 387 287 status = "disabled"; ··· 392 290 compatible = "renesas,hspi-r8a7778", "renesas,hspi"; 393 291 reg = <0xfffc6000 0x18>; 394 292 interrupts = <0 85 IRQ_TYPE_LEVEL_HIGH>; 293 + clocks = <&mstp0_clks R8A7778_CLK_HSPI>; 395 294 #address-cells = <1>; 396 295 #size-cells = <0>; 397 296 status = "disabled"; 297 + }; 298 + 299 + clocks { 300 + #address-cells = <1>; 301 + #size-cells = <1>; 302 + ranges; 303 + 304 + /* External input clock */ 305 + extal_clk: extal_clk { 306 + compatible = "fixed-clock"; 307 + #clock-cells = <0>; 308 + clock-frequency = <0>; 309 + clock-output-names = "extal"; 310 + }; 311 + 312 + /* Special CPG clocks */ 313 + cpg_clocks: cpg_clocks@ffc80000 { 314 + compatible = "renesas,r8a7778-cpg-clocks"; 315 + reg = <0xffc80000 0x80>; 316 + #clock-cells = <1>; 317 + clocks = <&extal_clk>; 318 + clock-output-names = "plla", "pllb", "b", 319 + "out", "p", "s", "s1"; 320 + }; 321 + 322 + /* Audio clocks; frequencies are set by boards if applicable. */ 323 + audio_clk_a: audio_clk_a { 324 + compatible = "fixed-clock"; 325 + #clock-cells = <0>; 326 + clock-output-names = "audio_clk_a"; 327 + }; 328 + audio_clk_b: audio_clk_b { 329 + compatible = "fixed-clock"; 330 + #clock-cells = <0>; 331 + clock-output-names = "audio_clk_b"; 332 + }; 333 + audio_clk_c: audio_clk_c { 334 + compatible = "fixed-clock"; 335 + #clock-cells = <0>; 336 + clock-output-names = "audio_clk_c"; 337 + }; 338 + 339 + /* Fixed ratio clocks */ 340 + g_clk: g_clk { 341 + compatible = "fixed-factor-clock"; 342 + clocks = <&cpg_clocks R8A7778_CLK_PLLA>; 343 + #clock-cells = <0>; 344 + clock-div = <12>; 345 + clock-mult = <1>; 346 + clock-output-names = "g"; 347 + }; 348 + i_clk: i_clk { 349 + compatible = "fixed-factor-clock"; 350 + clocks = <&cpg_clocks R8A7778_CLK_PLLA>; 351 + #clock-cells = <0>; 352 + clock-div = <1>; 353 + clock-mult = <1>; 354 + clock-output-names = "i"; 355 + }; 356 + s3_clk: s3_clk { 357 + compatible = "fixed-factor-clock"; 358 + clocks = <&cpg_clocks R8A7778_CLK_PLLA>; 359 + #clock-cells = <0>; 360 + clock-div = <4>; 361 + clock-mult = <1>; 362 + clock-output-names = "s3"; 363 + }; 364 + s4_clk: s4_clk { 365 + compatible = "fixed-factor-clock"; 366 + clocks = <&cpg_clocks R8A7778_CLK_PLLA>; 367 + #clock-cells = <0>; 368 + clock-div = <8>; 369 + clock-mult = <1>; 370 + clock-output-names = "s4"; 371 + }; 372 + z_clk: z_clk { 373 + compatible = "fixed-factor-clock"; 374 + clocks = <&cpg_clocks R8A7778_CLK_PLLB>; 375 + #clock-cells = <0>; 376 + clock-div = <1>; 377 + clock-mult = <1>; 378 + clock-output-names = "z"; 379 + }; 380 + 381 + /* Gate clocks */ 382 + mstp0_clks: mstp0_clks@ffc80030 { 383 + compatible = "renesas,r8a7778-mstp-clocks", "renesas,cpg-mstp-clocks"; 384 + reg = <0xffc80030 4>; 385 + clocks = <&cpg_clocks R8A7778_CLK_P>, 386 + <&cpg_clocks R8A7778_CLK_P>, 387 + <&cpg_clocks R8A7778_CLK_P>, 388 + <&cpg_clocks R8A7778_CLK_P>, 389 + <&cpg_clocks R8A7778_CLK_P>, 390 + <&cpg_clocks R8A7778_CLK_P>, 391 + <&cpg_clocks R8A7778_CLK_P>, 392 + <&cpg_clocks R8A7778_CLK_P>, 393 + <&cpg_clocks R8A7778_CLK_P>, 394 + <&cpg_clocks R8A7778_CLK_P>, 395 + <&cpg_clocks R8A7778_CLK_P>, 396 + <&cpg_clocks R8A7778_CLK_P>, 397 + <&cpg_clocks R8A7778_CLK_P>, 398 + <&cpg_clocks R8A7778_CLK_P>, 399 + <&cpg_clocks R8A7778_CLK_P>, 400 + <&cpg_clocks R8A7778_CLK_P>, 401 + <&cpg_clocks R8A7778_CLK_P>, 402 + <&cpg_clocks R8A7778_CLK_P>, 403 + <&cpg_clocks R8A7778_CLK_S>; 404 + #clock-cells = <1>; 405 + clock-indices = < 406 + R8A7778_CLK_I2C0 R8A7778_CLK_I2C1 407 + R8A7778_CLK_I2C2 R8A7778_CLK_I2C3 408 + R8A7778_CLK_SCIF0 R8A7778_CLK_SCIF1 409 + R8A7778_CLK_SCIF2 R8A7778_CLK_SCIF3 410 + R8A7778_CLK_SCIF4 R8A7778_CLK_SCIF5 411 + R8A7778_CLK_TMU0 R8A7778_CLK_TMU1 412 + R8A7778_CLK_TMU2 R8A7778_CLK_SSI0 413 + R8A7778_CLK_SSI1 R8A7778_CLK_SSI2 414 + R8A7778_CLK_SSI3 R8A7778_CLK_SRU 415 + R8A7778_CLK_HSPI 416 + >; 417 + clock-output-names = 418 + "i2c0", "i2c1", "i2c2", "i2c3", "scif0", 419 + "scif1", "scif2", "scif3", "scif4", "scif5", 420 + "tmu0", "tmu1", "tmu2", "ssi0", "ssi1", 421 + "ssi2", "ssi3", "sru", "hspi"; 422 + }; 423 + mstp1_clks: mstp1_clks@ffc80034 { 424 + compatible = "renesas,r8a7778-mstp-clocks", "renesas,cpg-mstp-clocks"; 425 + reg = <0xffc80034 4>, <0xffc80044 4>; 426 + clocks = <&cpg_clocks R8A7778_CLK_P>, 427 + <&cpg_clocks R8A7778_CLK_S>, 428 + <&cpg_clocks R8A7778_CLK_S>, 429 + <&cpg_clocks R8A7778_CLK_P>; 430 + #clock-cells = <1>; 431 + clock-indices = < 432 + R8A7778_CLK_ETHER R8A7778_CLK_VIN0 433 + R8A7778_CLK_VIN1 R8A7778_CLK_USB 434 + >; 435 + clock-output-names = 436 + "ether", "vin0", "vin1", "usb"; 437 + }; 438 + mstp3_clks: mstp3_clks@ffc8003c { 439 + compatible = "renesas,r8a7778-mstp-clocks", "renesas,cpg-mstp-clocks"; 440 + reg = <0xffc8003c 4>; 441 + clocks = <&s4_clk>, 442 + <&cpg_clocks R8A7778_CLK_P>, 443 + <&cpg_clocks R8A7778_CLK_P>, 444 + <&cpg_clocks R8A7778_CLK_P>, 445 + <&cpg_clocks R8A7778_CLK_P>, 446 + <&cpg_clocks R8A7778_CLK_P>, 447 + <&cpg_clocks R8A7778_CLK_P>, 448 + <&cpg_clocks R8A7778_CLK_P>, 449 + <&cpg_clocks R8A7778_CLK_P>; 450 + #clock-cells = <1>; 451 + clock-indices = < 452 + R8A7778_CLK_MMC R8A7778_CLK_SDHI0 453 + R8A7778_CLK_SDHI1 R8A7778_CLK_SDHI2 454 + R8A7778_CLK_SSI4 R8A7778_CLK_SSI5 455 + R8A7778_CLK_SSI6 R8A7778_CLK_SSI7 456 + R8A7778_CLK_SSI8 457 + >; 458 + clock-output-names = 459 + "mmc", "sdhi0", "sdhi1", "sdhi2", "ssi4", 460 + "ssi5", "ssi6", "ssi7", "ssi8"; 461 + }; 462 + mstp5_clks: mstp5_clks@ffc80054 { 463 + compatible = "renesas,r8a7778-mstp-clocks", "renesas,cpg-mstp-clocks"; 464 + reg = <0xffc80054 4>; 465 + clocks = <&cpg_clocks R8A7778_CLK_P>, 466 + <&cpg_clocks R8A7778_CLK_P>, 467 + <&cpg_clocks R8A7778_CLK_P>, 468 + <&cpg_clocks R8A7778_CLK_P>, 469 + <&cpg_clocks R8A7778_CLK_P>, 470 + <&cpg_clocks R8A7778_CLK_P>, 471 + <&cpg_clocks R8A7778_CLK_P>, 472 + <&cpg_clocks R8A7778_CLK_P>, 473 + <&cpg_clocks R8A7778_CLK_P>; 474 + #clock-cells = <1>; 475 + clock-indices = < 476 + R8A7778_CLK_SRU_SRC0 R8A7778_CLK_SRU_SRC1 477 + R8A7778_CLK_SRU_SRC2 R8A7778_CLK_SRU_SRC3 478 + R8A7778_CLK_SRU_SRC4 R8A7778_CLK_SRU_SRC5 479 + R8A7778_CLK_SRU_SRC6 R8A7778_CLK_SRU_SRC7 480 + R8A7778_CLK_SRU_SRC8 481 + >; 482 + clock-output-names = 483 + "sru-src0", "sru-src1", "sru-src2", 484 + "sru-src3", "sru-src4", "sru-src5", 485 + "sru-src6", "sru-src7", "sru-src8"; 486 + }; 398 487 }; 399 488 };
-26
arch/arm/boot/dts/sh7372-mackerel.dts
··· 1 - /* 2 - * Device Tree Source for the mackerel 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 "sh7372.dtsi" 13 - 14 - / { 15 - model = "Mackerel (AP4 EVM 2nd)"; 16 - compatible = "renesas,mackerel"; 17 - 18 - chosen { 19 - bootargs = "console=tty0, console=ttySC0,115200 earlyprintk=sh-sci.0,115200 root=/dev/nfs nfsroot=,tcp,v3 ip=dhcp mem=240m rw"; 20 - }; 21 - 22 - memory { 23 - device_type = "memory"; 24 - reg = <0x40000000 0x10000000>; 25 - }; 26 - };
-35
arch/arm/boot/dts/sh7372.dtsi
··· 1 - /* 2 - * Device Tree Source for the sh7372 SoC 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 - /include/ "skeleton.dtsi" 12 - 13 - / { 14 - compatible = "renesas,sh7372"; 15 - 16 - cpus { 17 - #address-cells = <1>; 18 - #size-cells = <0>; 19 - 20 - cpu@0 { 21 - compatible = "arm,cortex-a8"; 22 - device_type = "cpu"; 23 - reg = <0x0>; 24 - clock-frequency = <800000000>; 25 - }; 26 - }; 27 - 28 - pfc: pfc@e6050000 { 29 - compatible = "renesas,pfc-sh7372"; 30 - reg = <0xe6050000 0x8000>, 31 - <0xe605801c 0x1c>; 32 - gpio-controller; 33 - #gpio-cells = <2>; 34 - }; 35 - };
-398
arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
··· 1 - /* 2 - * Device Tree Source for the KZM-A9-GT board 3 - * 4 - * Copyright (C) 2012 Horms Solutions Ltd. 5 - * 6 - * Based on sh73a0-kzm9g.dts 7 - * Copyright (C) 2012 Renesas Solutions Corp. 8 - * 9 - * This file is licensed under the terms of the GNU General Public License 10 - * version 2. This program is licensed "as is" without any warranty of any 11 - * kind, whether express or implied. 12 - */ 13 - 14 - /dts-v1/; 15 - #include "sh73a0.dtsi" 16 - #include <dt-bindings/gpio/gpio.h> 17 - #include <dt-bindings/input/input.h> 18 - #include <dt-bindings/interrupt-controller/irq.h> 19 - 20 - / { 21 - model = "KZM-A9-GT"; 22 - compatible = "renesas,kzm9g-reference", "renesas,sh73a0"; 23 - 24 - aliases { 25 - serial4 = &scifa4; 26 - }; 27 - 28 - cpus { 29 - cpu@0 { 30 - cpu0-supply = <&vdd_dvfs>; 31 - operating-points = < 32 - /* kHz uV */ 33 - 1196000 1315000 34 - 598000 1175000 35 - 398667 1065000 36 - >; 37 - voltage-tolerance = <1>; /* 1% */ 38 - }; 39 - }; 40 - 41 - chosen { 42 - bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel rw"; 43 - stdout-path = &scifa4; 44 - }; 45 - 46 - memory { 47 - device_type = "memory"; 48 - reg = <0x40000000 0x20000000>; 49 - }; 50 - 51 - reg_1p8v: regulator@0 { 52 - compatible = "regulator-fixed"; 53 - regulator-name = "fixed-1.8V"; 54 - regulator-min-microvolt = <1800000>; 55 - regulator-max-microvolt = <1800000>; 56 - regulator-always-on; 57 - regulator-boot-on; 58 - }; 59 - 60 - reg_3p3v: regulator@1 { 61 - compatible = "regulator-fixed"; 62 - regulator-name = "fixed-3.3V"; 63 - regulator-min-microvolt = <3300000>; 64 - regulator-max-microvolt = <3300000>; 65 - regulator-always-on; 66 - regulator-boot-on; 67 - }; 68 - 69 - vmmc_sdhi0: regulator@2 { 70 - compatible = "regulator-fixed"; 71 - regulator-name = "SDHI0 Vcc"; 72 - regulator-min-microvolt = <3300000>; 73 - regulator-max-microvolt = <3300000>; 74 - gpio = <&pfc 15 GPIO_ACTIVE_HIGH>; 75 - enable-active-high; 76 - }; 77 - 78 - vmmc_sdhi2: regulator@3 { 79 - compatible = "regulator-fixed"; 80 - regulator-name = "SDHI2 Vcc"; 81 - regulator-min-microvolt = <3300000>; 82 - regulator-max-microvolt = <3300000>; 83 - gpio = <&pfc 14 GPIO_ACTIVE_HIGH>; 84 - enable-active-high; 85 - }; 86 - 87 - lan9220@10000000 { 88 - compatible = "smsc,lan9220", "smsc,lan9115"; 89 - reg = <0x10000000 0x100>; 90 - phy-mode = "mii"; 91 - interrupt-parent = <&irqpin0>; 92 - interrupts = <3 IRQ_TYPE_EDGE_FALLING>; 93 - reg-io-width = <4>; 94 - smsc,irq-push-pull; 95 - smsc,save-mac-address; 96 - vddvario-supply = <&reg_1p8v>; 97 - vdd33a-supply = <&reg_3p3v>; 98 - }; 99 - 100 - leds { 101 - compatible = "gpio-leds"; 102 - led1 { 103 - gpios = <&pfc 20 GPIO_ACTIVE_LOW>; 104 - label = "LED1"; 105 - }; 106 - led2 { 107 - gpios = <&pfc 21 GPIO_ACTIVE_LOW>; 108 - label = "LED2"; 109 - }; 110 - led3 { 111 - gpios = <&pfc 22 GPIO_ACTIVE_LOW>; 112 - label = "LED3"; 113 - }; 114 - led4 { 115 - gpios = <&pfc 23 GPIO_ACTIVE_LOW>; 116 - label = "LED4"; 117 - }; 118 - }; 119 - 120 - keyboard { 121 - compatible = "gpio-keys"; 122 - 123 - back-key { 124 - gpios = <&pcf8575 8 GPIO_ACTIVE_LOW>; 125 - linux,code = <KEY_BACK>; 126 - label = "SW3"; 127 - }; 128 - 129 - right-key { 130 - gpios = <&pcf8575 9 GPIO_ACTIVE_LOW>; 131 - linux,code = <KEY_RIGHT>; 132 - label = "SW2-R"; 133 - }; 134 - 135 - left-key { 136 - gpios = <&pcf8575 10 GPIO_ACTIVE_LOW>; 137 - linux,code = <KEY_LEFT>; 138 - label = "SW2-L"; 139 - }; 140 - 141 - enter-key { 142 - gpios = <&pcf8575 11 GPIO_ACTIVE_LOW>; 143 - linux,code = <KEY_ENTER>; 144 - label = "SW2-P"; 145 - }; 146 - 147 - up-key { 148 - gpios = <&pcf8575 12 GPIO_ACTIVE_LOW>; 149 - linux,code = <KEY_UP>; 150 - label = "SW2-U"; 151 - }; 152 - 153 - down-key { 154 - gpios = <&pcf8575 13 GPIO_ACTIVE_LOW>; 155 - linux,code = <KEY_DOWN>; 156 - label = "SW2-D"; 157 - }; 158 - 159 - home-key { 160 - gpios = <&pcf8575 14 GPIO_ACTIVE_LOW>; 161 - linux,code = <KEY_HOME>; 162 - label = "SW1"; 163 - }; 164 - }; 165 - 166 - sound { 167 - compatible = "simple-audio-card"; 168 - simple-audio-card,format = "left_j"; 169 - simple-audio-card,cpu { 170 - sound-dai = <&sh_fsi2 0>; 171 - }; 172 - simple-audio-card,codec { 173 - sound-dai = <&ak4648>; 174 - bitclock-master; 175 - frame-master; 176 - system-clock-frequency = <11289600>; 177 - }; 178 - }; 179 - }; 180 - 181 - &cmt1 { 182 - status = "okay"; 183 - }; 184 - 185 - &extal2_clk { 186 - clock-frequency = <48000000>; 187 - }; 188 - 189 - &i2c0 { 190 - status = "okay"; 191 - 192 - compass@c { 193 - compatible = "asahi-kasei,ak8975"; 194 - reg = <0x0c>; 195 - interrupt-parent = <&irqpin3>; 196 - interrupts = <4 IRQ_TYPE_EDGE_FALLING>; 197 - }; 198 - 199 - ak4648: codec@12 { 200 - compatible = "asahi-kasei,ak4648"; 201 - reg = <0x12>; 202 - #sound-dai-cells = <0>; 203 - }; 204 - 205 - accelerometer@1d { 206 - compatible = "adi,adxl34x"; 207 - reg = <0x1d>; 208 - interrupt-parent = <&irqpin3>; 209 - interrupts = <2 IRQ_TYPE_LEVEL_HIGH>, 210 - <3 IRQ_TYPE_LEVEL_HIGH>; 211 - }; 212 - 213 - rtc@32 { 214 - compatible = "ricoh,r2025sd"; 215 - reg = <0x32>; 216 - }; 217 - 218 - as3711@40 { 219 - compatible = "ams,as3711"; 220 - reg = <0x40>; 221 - 222 - regulators { 223 - vdd_dvfs: sd1 { 224 - regulator-name = "1.315V CPU"; 225 - regulator-min-microvolt = <1050000>; 226 - regulator-max-microvolt = <1350000>; 227 - regulator-always-on; 228 - regulator-boot-on; 229 - }; 230 - sd2 { 231 - regulator-name = "1.8V"; 232 - regulator-min-microvolt = <1800000>; 233 - regulator-max-microvolt = <1800000>; 234 - regulator-always-on; 235 - regulator-boot-on; 236 - }; 237 - sd4 { 238 - regulator-name = "1.215V"; 239 - regulator-min-microvolt = <1215000>; 240 - regulator-max-microvolt = <1235000>; 241 - regulator-always-on; 242 - regulator-boot-on; 243 - }; 244 - ldo2 { 245 - regulator-name = "2.8V CPU"; 246 - regulator-min-microvolt = <2800000>; 247 - regulator-max-microvolt = <2800000>; 248 - regulator-always-on; 249 - regulator-boot-on; 250 - }; 251 - ldo3 { 252 - regulator-name = "3.0V CPU"; 253 - regulator-min-microvolt = <3000000>; 254 - regulator-max-microvolt = <3000000>; 255 - regulator-always-on; 256 - regulator-boot-on; 257 - }; 258 - ldo4 { 259 - regulator-name = "2.8V"; 260 - regulator-min-microvolt = <2800000>; 261 - regulator-max-microvolt = <2800000>; 262 - regulator-always-on; 263 - regulator-boot-on; 264 - }; 265 - ldo5 { 266 - regulator-name = "2.8V #2"; 267 - regulator-min-microvolt = <2800000>; 268 - regulator-max-microvolt = <2800000>; 269 - regulator-always-on; 270 - regulator-boot-on; 271 - }; 272 - ldo7 { 273 - regulator-name = "1.15V CPU"; 274 - regulator-min-microvolt = <1150000>; 275 - regulator-max-microvolt = <1150000>; 276 - regulator-always-on; 277 - regulator-boot-on; 278 - }; 279 - ldo8 { 280 - regulator-name = "1.15V CPU #2"; 281 - regulator-min-microvolt = <1150000>; 282 - regulator-max-microvolt = <1150000>; 283 - regulator-always-on; 284 - regulator-boot-on; 285 - }; 286 - }; 287 - }; 288 - }; 289 - 290 - &i2c1 { 291 - status = "okay"; 292 - 293 - touchscreen@55 { 294 - compatible = "sitronix,st1232"; 295 - reg = <0x55>; 296 - interrupt-parent = <&irqpin1>; 297 - interrupts = <0 IRQ_TYPE_EDGE_FALLING>; 298 - }; 299 - }; 300 - 301 - &i2c3 { 302 - pinctrl-0 = <&i2c3_pins>; 303 - pinctrl-names = "default"; 304 - status = "okay"; 305 - 306 - pcf8575: gpio@20 { 307 - compatible = "nxp,pcf8575"; 308 - reg = <0x20>; 309 - interrupt-parent = <&irqpin2>; 310 - interrupts = <3 IRQ_TYPE_EDGE_FALLING>; 311 - gpio-controller; 312 - #gpio-cells = <2>; 313 - interrupt-controller; 314 - #interrupt-cells = <2>; 315 - }; 316 - }; 317 - 318 - &mmcif { 319 - pinctrl-0 = <&mmcif_pins>; 320 - pinctrl-names = "default"; 321 - 322 - bus-width = <8>; 323 - vmmc-supply = <&reg_1p8v>; 324 - status = "okay"; 325 - }; 326 - 327 - &pfc { 328 - i2c3_pins: i2c3 { 329 - renesas,groups = "i2c3_1"; 330 - renesas,function = "i2c3"; 331 - }; 332 - 333 - mmcif_pins: mmc { 334 - mux { 335 - renesas,groups = "mmc0_data8_0", "mmc0_ctrl_0"; 336 - renesas,function = "mmc0"; 337 - }; 338 - cfg { 339 - renesas,groups = "mmc0_data8_0"; 340 - renesas,pins = "PORT279"; 341 - bias-pull-up; 342 - }; 343 - }; 344 - 345 - scifa4_pins: serial4 { 346 - renesas,groups = "scifa4_data", "scifa4_ctrl"; 347 - renesas,function = "scifa4"; 348 - }; 349 - 350 - sdhi0_pins: sd0 { 351 - renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd", "sdhi0_wp"; 352 - renesas,function = "sdhi0"; 353 - }; 354 - 355 - sdhi2_pins: sd2 { 356 - renesas,groups = "sdhi2_data4", "sdhi2_ctrl"; 357 - renesas,function = "sdhi2"; 358 - }; 359 - 360 - fsia_pins: sounda { 361 - renesas,groups = "fsia_mclk_in", "fsia_sclk_in", 362 - "fsia_data_in", "fsia_data_out"; 363 - renesas,function = "fsia"; 364 - }; 365 - }; 366 - 367 - &scifa4 { 368 - pinctrl-0 = <&scifa4_pins>; 369 - pinctrl-names = "default"; 370 - 371 - status = "okay"; 372 - }; 373 - 374 - &sdhi0 { 375 - pinctrl-0 = <&sdhi0_pins>; 376 - pinctrl-names = "default"; 377 - 378 - vmmc-supply = <&vmmc_sdhi0>; 379 - bus-width = <4>; 380 - status = "okay"; 381 - }; 382 - 383 - &sdhi2 { 384 - pinctrl-0 = <&sdhi2_pins>; 385 - pinctrl-names = "default"; 386 - 387 - vmmc-supply = <&vmmc_sdhi2>; 388 - bus-width = <4>; 389 - broken-cd; 390 - status = "okay"; 391 - }; 392 - 393 - &sh_fsi2 { 394 - pinctrl-0 = <&fsia_pins>; 395 - pinctrl-names = "default"; 396 - 397 - status = "okay"; 398 - };
+375 -1
arch/arm/boot/dts/sh73a0-kzm9g.dts
··· 1 1 /* 2 2 * Device Tree Source for the KZM-A9-GT board 3 3 * 4 + * Copyright (C) 2012 Horms Solutions Ltd. 5 + * 6 + * Based on sh73a0-kzm9g.dts 4 7 * Copyright (C) 2012 Renesas Solutions Corp. 5 8 * 6 9 * This file is licensed under the terms of the GNU General Public License ··· 13 10 14 11 /dts-v1/; 15 12 #include "sh73a0.dtsi" 13 + #include <dt-bindings/gpio/gpio.h> 14 + #include <dt-bindings/input/input.h> 15 + #include <dt-bindings/interrupt-controller/irq.h> 16 16 17 17 / { 18 18 model = "KZM-A9-GT"; 19 19 compatible = "renesas,kzm9g", "renesas,sh73a0"; 20 20 21 + aliases { 22 + serial4 = &scifa4; 23 + }; 24 + 25 + cpus { 26 + cpu@0 { 27 + cpu0-supply = <&vdd_dvfs>; 28 + operating-points = < 29 + /* kHz uV */ 30 + 1196000 1315000 31 + 598000 1175000 32 + 398667 1065000 33 + >; 34 + voltage-tolerance = <1>; /* 1% */ 35 + }; 36 + }; 37 + 21 38 chosen { 22 - bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200 rw"; 39 + bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel rw"; 40 + stdout-path = &scifa4; 23 41 }; 24 42 25 43 memory { 26 44 device_type = "memory"; 27 45 reg = <0x40000000 0x20000000>; 28 46 }; 47 + 48 + reg_1p8v: regulator@0 { 49 + compatible = "regulator-fixed"; 50 + regulator-name = "fixed-1.8V"; 51 + regulator-min-microvolt = <1800000>; 52 + regulator-max-microvolt = <1800000>; 53 + regulator-always-on; 54 + regulator-boot-on; 55 + }; 56 + 57 + reg_3p3v: regulator@1 { 58 + compatible = "regulator-fixed"; 59 + regulator-name = "fixed-3.3V"; 60 + regulator-min-microvolt = <3300000>; 61 + regulator-max-microvolt = <3300000>; 62 + regulator-always-on; 63 + regulator-boot-on; 64 + }; 65 + 66 + vmmc_sdhi0: regulator@2 { 67 + compatible = "regulator-fixed"; 68 + regulator-name = "SDHI0 Vcc"; 69 + regulator-min-microvolt = <3300000>; 70 + regulator-max-microvolt = <3300000>; 71 + gpio = <&pfc 15 GPIO_ACTIVE_HIGH>; 72 + enable-active-high; 73 + }; 74 + 75 + vmmc_sdhi2: regulator@3 { 76 + compatible = "regulator-fixed"; 77 + regulator-name = "SDHI2 Vcc"; 78 + regulator-min-microvolt = <3300000>; 79 + regulator-max-microvolt = <3300000>; 80 + gpio = <&pfc 14 GPIO_ACTIVE_HIGH>; 81 + enable-active-high; 82 + }; 83 + 84 + leds { 85 + compatible = "gpio-leds"; 86 + led1 { 87 + gpios = <&pfc 20 GPIO_ACTIVE_LOW>; 88 + label = "LED1"; 89 + }; 90 + led2 { 91 + gpios = <&pfc 21 GPIO_ACTIVE_LOW>; 92 + label = "LED2"; 93 + }; 94 + led3 { 95 + gpios = <&pfc 22 GPIO_ACTIVE_LOW>; 96 + label = "LED3"; 97 + }; 98 + led4 { 99 + gpios = <&pfc 23 GPIO_ACTIVE_LOW>; 100 + label = "LED4"; 101 + }; 102 + }; 103 + 104 + keyboard { 105 + compatible = "gpio-keys"; 106 + 107 + back-key { 108 + gpios = <&pcf8575 8 GPIO_ACTIVE_LOW>; 109 + linux,code = <KEY_BACK>; 110 + label = "SW3"; 111 + }; 112 + 113 + right-key { 114 + gpios = <&pcf8575 9 GPIO_ACTIVE_LOW>; 115 + linux,code = <KEY_RIGHT>; 116 + label = "SW2-R"; 117 + }; 118 + 119 + left-key { 120 + gpios = <&pcf8575 10 GPIO_ACTIVE_LOW>; 121 + linux,code = <KEY_LEFT>; 122 + label = "SW2-L"; 123 + }; 124 + 125 + enter-key { 126 + gpios = <&pcf8575 11 GPIO_ACTIVE_LOW>; 127 + linux,code = <KEY_ENTER>; 128 + label = "SW2-P"; 129 + }; 130 + 131 + up-key { 132 + gpios = <&pcf8575 12 GPIO_ACTIVE_LOW>; 133 + linux,code = <KEY_UP>; 134 + label = "SW2-U"; 135 + }; 136 + 137 + down-key { 138 + gpios = <&pcf8575 13 GPIO_ACTIVE_LOW>; 139 + linux,code = <KEY_DOWN>; 140 + label = "SW2-D"; 141 + }; 142 + 143 + home-key { 144 + gpios = <&pcf8575 14 GPIO_ACTIVE_LOW>; 145 + linux,code = <KEY_HOME>; 146 + label = "SW1"; 147 + }; 148 + }; 149 + 150 + sound { 151 + compatible = "simple-audio-card"; 152 + simple-audio-card,format = "left_j"; 153 + simple-audio-card,cpu { 154 + sound-dai = <&sh_fsi2 0>; 155 + }; 156 + simple-audio-card,codec { 157 + sound-dai = <&ak4648>; 158 + bitclock-master; 159 + frame-master; 160 + system-clock-frequency = <11289600>; 161 + }; 162 + }; 163 + }; 164 + 165 + &bsc { 166 + ethernet@10000000 { 167 + compatible = "smsc,lan9220", "smsc,lan9115"; 168 + reg = <0x10000000 0x100>; 169 + phy-mode = "mii"; 170 + interrupt-parent = <&irqpin0>; 171 + interrupts = <3 IRQ_TYPE_EDGE_FALLING>; 172 + reg-io-width = <4>; 173 + smsc,irq-push-pull; 174 + smsc,save-mac-address; 175 + vddvario-supply = <&reg_1p8v>; 176 + vdd33a-supply = <&reg_3p3v>; 177 + }; 178 + }; 179 + 180 + &cmt1 { 181 + status = "okay"; 182 + }; 183 + 184 + &extal2_clk { 185 + clock-frequency = <48000000>; 186 + }; 187 + 188 + &i2c0 { 189 + status = "okay"; 190 + 191 + compass@c { 192 + compatible = "asahi-kasei,ak8975"; 193 + reg = <0x0c>; 194 + interrupt-parent = <&irqpin3>; 195 + interrupts = <4 IRQ_TYPE_EDGE_FALLING>; 196 + }; 197 + 198 + ak4648: codec@12 { 199 + compatible = "asahi-kasei,ak4648"; 200 + reg = <0x12>; 201 + #sound-dai-cells = <0>; 202 + }; 203 + 204 + accelerometer@1d { 205 + compatible = "adi,adxl34x"; 206 + reg = <0x1d>; 207 + interrupt-parent = <&irqpin3>; 208 + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>, 209 + <3 IRQ_TYPE_LEVEL_HIGH>; 210 + }; 211 + 212 + rtc@32 { 213 + compatible = "ricoh,r2025sd"; 214 + reg = <0x32>; 215 + }; 216 + 217 + as3711@40 { 218 + compatible = "ams,as3711"; 219 + reg = <0x40>; 220 + 221 + regulators { 222 + vdd_dvfs: sd1 { 223 + regulator-name = "1.315V CPU"; 224 + regulator-min-microvolt = <1050000>; 225 + regulator-max-microvolt = <1350000>; 226 + regulator-always-on; 227 + regulator-boot-on; 228 + }; 229 + sd2 { 230 + regulator-name = "1.8V"; 231 + regulator-min-microvolt = <1800000>; 232 + regulator-max-microvolt = <1800000>; 233 + regulator-always-on; 234 + regulator-boot-on; 235 + }; 236 + sd4 { 237 + regulator-name = "1.215V"; 238 + regulator-min-microvolt = <1215000>; 239 + regulator-max-microvolt = <1235000>; 240 + regulator-always-on; 241 + regulator-boot-on; 242 + }; 243 + ldo2 { 244 + regulator-name = "2.8V CPU"; 245 + regulator-min-microvolt = <2800000>; 246 + regulator-max-microvolt = <2800000>; 247 + regulator-always-on; 248 + regulator-boot-on; 249 + }; 250 + ldo3 { 251 + regulator-name = "3.0V CPU"; 252 + regulator-min-microvolt = <3000000>; 253 + regulator-max-microvolt = <3000000>; 254 + regulator-always-on; 255 + regulator-boot-on; 256 + }; 257 + ldo4 { 258 + regulator-name = "2.8V"; 259 + regulator-min-microvolt = <2800000>; 260 + regulator-max-microvolt = <2800000>; 261 + regulator-always-on; 262 + regulator-boot-on; 263 + }; 264 + ldo5 { 265 + regulator-name = "2.8V #2"; 266 + regulator-min-microvolt = <2800000>; 267 + regulator-max-microvolt = <2800000>; 268 + regulator-always-on; 269 + regulator-boot-on; 270 + }; 271 + ldo7 { 272 + regulator-name = "1.15V CPU"; 273 + regulator-min-microvolt = <1150000>; 274 + regulator-max-microvolt = <1150000>; 275 + regulator-always-on; 276 + regulator-boot-on; 277 + }; 278 + ldo8 { 279 + regulator-name = "1.15V CPU #2"; 280 + regulator-min-microvolt = <1150000>; 281 + regulator-max-microvolt = <1150000>; 282 + regulator-always-on; 283 + regulator-boot-on; 284 + }; 285 + }; 286 + }; 287 + }; 288 + 289 + &i2c1 { 290 + status = "okay"; 291 + 292 + touchscreen@55 { 293 + compatible = "sitronix,st1232"; 294 + reg = <0x55>; 295 + interrupt-parent = <&irqpin1>; 296 + interrupts = <0 IRQ_TYPE_EDGE_FALLING>; 297 + }; 298 + }; 299 + 300 + &i2c3 { 301 + pinctrl-0 = <&i2c3_pins>; 302 + pinctrl-names = "default"; 303 + status = "okay"; 304 + 305 + pcf8575: gpio@20 { 306 + compatible = "nxp,pcf8575"; 307 + reg = <0x20>; 308 + interrupt-parent = <&irqpin2>; 309 + interrupts = <3 IRQ_TYPE_EDGE_FALLING>; 310 + gpio-controller; 311 + #gpio-cells = <2>; 312 + interrupt-controller; 313 + #interrupt-cells = <2>; 314 + }; 315 + }; 316 + 317 + &mmcif { 318 + pinctrl-0 = <&mmcif_pins>; 319 + pinctrl-names = "default"; 320 + 321 + bus-width = <8>; 322 + vmmc-supply = <&reg_1p8v>; 323 + status = "okay"; 324 + }; 325 + 326 + &pfc { 327 + i2c3_pins: i2c3 { 328 + renesas,groups = "i2c3_1"; 329 + renesas,function = "i2c3"; 330 + }; 331 + 332 + mmcif_pins: mmc { 333 + mux { 334 + renesas,groups = "mmc0_data8_0", "mmc0_ctrl_0"; 335 + renesas,function = "mmc0"; 336 + }; 337 + cfg { 338 + renesas,groups = "mmc0_data8_0"; 339 + renesas,pins = "PORT279"; 340 + bias-pull-up; 341 + }; 342 + }; 343 + 344 + scifa4_pins: serial4 { 345 + renesas,groups = "scifa4_data", "scifa4_ctrl"; 346 + renesas,function = "scifa4"; 347 + }; 348 + 349 + sdhi0_pins: sd0 { 350 + renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd", "sdhi0_wp"; 351 + renesas,function = "sdhi0"; 352 + }; 353 + 354 + sdhi2_pins: sd2 { 355 + renesas,groups = "sdhi2_data4", "sdhi2_ctrl"; 356 + renesas,function = "sdhi2"; 357 + }; 358 + 359 + fsia_pins: sounda { 360 + renesas,groups = "fsia_mclk_in", "fsia_sclk_in", 361 + "fsia_data_in", "fsia_data_out"; 362 + renesas,function = "fsia"; 363 + }; 364 + }; 365 + 366 + &scifa4 { 367 + pinctrl-0 = <&scifa4_pins>; 368 + pinctrl-names = "default"; 369 + 370 + status = "okay"; 371 + }; 372 + 373 + &sdhi0 { 374 + pinctrl-0 = <&sdhi0_pins>; 375 + pinctrl-names = "default"; 376 + 377 + vmmc-supply = <&vmmc_sdhi0>; 378 + bus-width = <4>; 379 + status = "okay"; 380 + }; 381 + 382 + &sdhi2 { 383 + pinctrl-0 = <&sdhi2_pins>; 384 + pinctrl-names = "default"; 385 + 386 + vmmc-supply = <&vmmc_sdhi2>; 387 + bus-width = <4>; 388 + broken-cd; 389 + status = "okay"; 390 + }; 391 + 392 + &sh_fsi2 { 393 + pinctrl-0 = <&fsia_pins>; 394 + pinctrl-names = "default"; 395 + 396 + status = "okay"; 29 397 };
+161 -2
arch/arm/boot/dts/sh73a0.dtsi
··· 11 11 /include/ "skeleton.dtsi" 12 12 13 13 #include <dt-bindings/clock/sh73a0-clock.h> 14 + #include <dt-bindings/interrupt-controller/arm-gic.h> 14 15 #include <dt-bindings/interrupt-controller/irq.h> 15 16 16 17 / { ··· 27 26 compatible = "arm,cortex-a9"; 28 27 reg = <0>; 29 28 clock-frequency = <1196000000>; 29 + power-domains = <&pd_a2sl>; 30 30 }; 31 31 cpu@1 { 32 32 device_type = "cpu"; 33 33 compatible = "arm,cortex-a9"; 34 34 reg = <1>; 35 35 clock-frequency = <1196000000>; 36 + power-domains = <&pd_a2sl>; 36 37 }; 38 + }; 39 + 40 + timer@f0000600 { 41 + compatible = "arm,cortex-a9-twd-timer"; 42 + reg = <0xf0000600 0x20>; 43 + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>; 44 + clocks = <&twd_clk>; 37 45 }; 38 46 39 47 gic: interrupt-controller@f0001000 { ··· 59 49 interrupts = <0 37 IRQ_TYPE_LEVEL_HIGH>, 60 50 <0 38 IRQ_TYPE_LEVEL_HIGH>; 61 51 interrupt-names = "sec", "temp"; 52 + power-domains = <&pd_a4bc1>; 62 53 }; 63 54 64 55 sbsc1: memory-controller@fe400000 { ··· 68 57 interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>, 69 58 <0 36 IRQ_TYPE_LEVEL_HIGH>; 70 59 interrupt-names = "sec", "temp"; 60 + power-domains = <&pd_a4bc0>; 71 61 }; 72 62 73 63 pmu { ··· 81 69 compatible = "renesas,cmt-48-sh73a0", "renesas,cmt-48"; 82 70 reg = <0xe6138000 0x200>; 83 71 interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>; 72 + clocks = <&mstp3_clks SH73A0_CLK_CMT1>; 73 + clock-names = "fck"; 74 + power-domains = <&pd_c5>; 84 75 85 76 renesas,channels-mask = <0x3f>; 86 77 87 - clocks = <&mstp3_clks SH73A0_CLK_CMT1>; 88 - clock-names = "fck"; 89 78 status = "disabled"; 90 79 }; 91 80 ··· 108 95 0 7 IRQ_TYPE_LEVEL_HIGH 109 96 0 8 IRQ_TYPE_LEVEL_HIGH>; 110 97 clocks = <&mstp5_clks SH73A0_CLK_INTCA0>; 98 + power-domains = <&pd_a4s>; 111 99 control-parent; 112 100 }; 113 101 ··· 130 116 0 15 IRQ_TYPE_LEVEL_HIGH 131 117 0 16 IRQ_TYPE_LEVEL_HIGH>; 132 118 clocks = <&mstp5_clks SH73A0_CLK_INTCA0>; 119 + power-domains = <&pd_a4s>; 133 120 control-parent; 134 121 }; 135 122 ··· 152 137 0 23 IRQ_TYPE_LEVEL_HIGH 153 138 0 24 IRQ_TYPE_LEVEL_HIGH>; 154 139 clocks = <&mstp5_clks SH73A0_CLK_INTCA0>; 140 + power-domains = <&pd_a4s>; 155 141 control-parent; 156 142 }; 157 143 ··· 174 158 0 31 IRQ_TYPE_LEVEL_HIGH 175 159 0 32 IRQ_TYPE_LEVEL_HIGH>; 176 160 clocks = <&mstp5_clks SH73A0_CLK_INTCA0>; 161 + power-domains = <&pd_a4s>; 177 162 control-parent; 178 163 }; 179 164 ··· 188 171 0 169 IRQ_TYPE_LEVEL_HIGH 189 172 0 170 IRQ_TYPE_LEVEL_HIGH>; 190 173 clocks = <&mstp1_clks SH73A0_CLK_IIC0>; 174 + power-domains = <&pd_a3sp>; 191 175 status = "disabled"; 192 176 }; 193 177 ··· 202 184 0 53 IRQ_TYPE_LEVEL_HIGH 203 185 0 54 IRQ_TYPE_LEVEL_HIGH>; 204 186 clocks = <&mstp3_clks SH73A0_CLK_IIC1>; 187 + power-domains = <&pd_a3sp>; 205 188 status = "disabled"; 206 189 }; 207 190 ··· 216 197 0 173 IRQ_TYPE_LEVEL_HIGH 217 198 0 174 IRQ_TYPE_LEVEL_HIGH>; 218 199 clocks = <&mstp0_clks SH73A0_CLK_IIC2>; 200 + power-domains = <&pd_a3sp>; 219 201 status = "disabled"; 220 202 }; 221 203 ··· 230 210 0 185 IRQ_TYPE_LEVEL_HIGH 231 211 0 186 IRQ_TYPE_LEVEL_HIGH>; 232 212 clocks = <&mstp4_clks SH73A0_CLK_IIC3>; 213 + power-domains = <&pd_a3sp>; 233 214 status = "disabled"; 234 215 }; 235 216 ··· 244 223 0 189 IRQ_TYPE_LEVEL_HIGH 245 224 0 190 IRQ_TYPE_LEVEL_HIGH>; 246 225 clocks = <&mstp4_clks SH73A0_CLK_IIC4>; 226 + power-domains = <&pd_c5>; 247 227 status = "disabled"; 248 228 }; 249 229 ··· 254 232 interrupts = <0 140 IRQ_TYPE_LEVEL_HIGH 255 233 0 141 IRQ_TYPE_LEVEL_HIGH>; 256 234 clocks = <&mstp3_clks SH73A0_CLK_MMCIF0>; 235 + power-domains = <&pd_a3sp>; 257 236 reg-io-width = <4>; 258 237 status = "disabled"; 259 238 }; ··· 266 243 0 84 IRQ_TYPE_LEVEL_HIGH 267 244 0 85 IRQ_TYPE_LEVEL_HIGH>; 268 245 clocks = <&mstp3_clks SH73A0_CLK_SDHI0>; 246 + power-domains = <&pd_a3sp>; 269 247 cap-sd-highspeed; 270 248 status = "disabled"; 271 249 }; ··· 278 254 interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH 279 255 0 89 IRQ_TYPE_LEVEL_HIGH>; 280 256 clocks = <&mstp3_clks SH73A0_CLK_SDHI1>; 257 + power-domains = <&pd_a3sp>; 281 258 toshiba,mmc-wrprotect-disable; 282 259 cap-sd-highspeed; 283 260 status = "disabled"; ··· 290 265 interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH 291 266 0 105 IRQ_TYPE_LEVEL_HIGH>; 292 267 clocks = <&mstp3_clks SH73A0_CLK_SDHI2>; 268 + power-domains = <&pd_a3sp>; 293 269 toshiba,mmc-wrprotect-disable; 294 270 cap-sd-highspeed; 295 271 status = "disabled"; ··· 302 276 interrupts = <0 72 IRQ_TYPE_LEVEL_HIGH>; 303 277 clocks = <&mstp2_clks SH73A0_CLK_SCIFA0>; 304 278 clock-names = "sci_ick"; 279 + power-domains = <&pd_a3sp>; 305 280 status = "disabled"; 306 281 }; 307 282 ··· 312 285 interrupts = <0 73 IRQ_TYPE_LEVEL_HIGH>; 313 286 clocks = <&mstp2_clks SH73A0_CLK_SCIFA1>; 314 287 clock-names = "sci_ick"; 288 + power-domains = <&pd_a3sp>; 315 289 status = "disabled"; 316 290 }; 317 291 ··· 322 294 interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>; 323 295 clocks = <&mstp2_clks SH73A0_CLK_SCIFA2>; 324 296 clock-names = "sci_ick"; 297 + power-domains = <&pd_a3sp>; 325 298 status = "disabled"; 326 299 }; 327 300 ··· 332 303 interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>; 333 304 clocks = <&mstp2_clks SH73A0_CLK_SCIFA3>; 334 305 clock-names = "sci_ick"; 306 + power-domains = <&pd_a3sp>; 335 307 status = "disabled"; 336 308 }; 337 309 ··· 342 312 interrupts = <0 78 IRQ_TYPE_LEVEL_HIGH>; 343 313 clocks = <&mstp2_clks SH73A0_CLK_SCIFA4>; 344 314 clock-names = "sci_ick"; 315 + power-domains = <&pd_a3sp>; 345 316 status = "disabled"; 346 317 }; 347 318 ··· 352 321 interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>; 353 322 clocks = <&mstp2_clks SH73A0_CLK_SCIFA5>; 354 323 clock-names = "sci_ick"; 324 + power-domains = <&pd_a3sp>; 355 325 status = "disabled"; 356 326 }; 357 327 ··· 362 330 interrupts = <0 156 IRQ_TYPE_LEVEL_HIGH>; 363 331 clocks = <&mstp3_clks SH73A0_CLK_SCIFA6>; 364 332 clock-names = "sci_ick"; 333 + power-domains = <&pd_a3sp>; 365 334 status = "disabled"; 366 335 }; 367 336 ··· 372 339 interrupts = <0 143 IRQ_TYPE_LEVEL_HIGH>; 373 340 clocks = <&mstp2_clks SH73A0_CLK_SCIFA7>; 374 341 clock-names = "sci_ick"; 342 + power-domains = <&pd_a3sp>; 375 343 status = "disabled"; 376 344 }; 377 345 ··· 382 348 interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>; 383 349 clocks = <&mstp2_clks SH73A0_CLK_SCIFB>; 384 350 clock-names = "sci_ick"; 351 + power-domains = <&pd_a3sp>; 385 352 status = "disabled"; 386 353 }; 387 354 ··· 401 366 <&irqpin2 4 0>, <&irqpin2 5 0>, <&irqpin2 6 0>, <&irqpin2 7 0>, 402 367 <&irqpin3 0 0>, <&irqpin3 1 0>, <&irqpin3 2 0>, <&irqpin3 3 0>, 403 368 <&irqpin3 4 0>, <&irqpin3 5 0>, <&irqpin3 6 0>, <&irqpin3 7 0>; 369 + power-domains = <&pd_c5>; 370 + }; 371 + 372 + sysc: system-controller@e6180000 { 373 + compatible = "renesas,sysc-sh73a0", "renesas,sysc-rmobile"; 374 + reg = <0xe6180000 0x8000>, <0xe6188000 0x8000>; 375 + 376 + pm-domains { 377 + pd_c5: c5 { 378 + #address-cells = <1>; 379 + #size-cells = <0>; 380 + #power-domain-cells = <0>; 381 + 382 + pd_c4: c4@0 { 383 + reg = <0>; 384 + #power-domain-cells = <0>; 385 + }; 386 + 387 + pd_d4: d4@1 { 388 + reg = <1>; 389 + #power-domain-cells = <0>; 390 + }; 391 + 392 + pd_a4bc0: a4bc0@4 { 393 + reg = <4>; 394 + #power-domain-cells = <0>; 395 + }; 396 + 397 + pd_a4bc1: a4bc1@5 { 398 + reg = <5>; 399 + #power-domain-cells = <0>; 400 + }; 401 + 402 + pd_a4lc0: a4lc0@6 { 403 + reg = <6>; 404 + #power-domain-cells = <0>; 405 + }; 406 + 407 + pd_a4lc1: a4lc1@7 { 408 + reg = <7>; 409 + #power-domain-cells = <0>; 410 + }; 411 + 412 + pd_a4mp: a4mp@8 { 413 + reg = <8>; 414 + #address-cells = <1>; 415 + #size-cells = <0>; 416 + #power-domain-cells = <0>; 417 + 418 + pd_a3mp: a3mp@9 { 419 + reg = <9>; 420 + #power-domain-cells = <0>; 421 + }; 422 + 423 + pd_a3vc: a3vc@10 { 424 + reg = <10>; 425 + #power-domain-cells = <0>; 426 + }; 427 + }; 428 + 429 + pd_a4rm: a4rm@12 { 430 + reg = <12>; 431 + #address-cells = <1>; 432 + #size-cells = <0>; 433 + #power-domain-cells = <0>; 434 + 435 + pd_a3r: a3r@13 { 436 + reg = <13>; 437 + #address-cells = <1>; 438 + #size-cells = <0>; 439 + #power-domain-cells = <0>; 440 + 441 + pd_a2rv: a2rv@14 { 442 + reg = <14>; 443 + #address-cells = <1>; 444 + #size-cells = <0>; 445 + #power-domain-cells = <0>; 446 + }; 447 + }; 448 + }; 449 + 450 + pd_a4s: a4s@16 { 451 + reg = <16>; 452 + #address-cells = <1>; 453 + #size-cells = <0>; 454 + #power-domain-cells = <0>; 455 + 456 + pd_a3sp: a3sp@17 { 457 + reg = <17>; 458 + #power-domain-cells = <0>; 459 + }; 460 + 461 + pd_a3sg: a3sg@18 { 462 + reg = <18>; 463 + #power-domain-cells = <0>; 464 + }; 465 + 466 + pd_a3sm: a3sm@19 { 467 + reg = <19>; 468 + #address-cells = <1>; 469 + #size-cells = <0>; 470 + #power-domain-cells = <0>; 471 + 472 + pd_a2sl: a2sl@20 { 473 + reg = <20>; 474 + #power-domain-cells = <0>; 475 + }; 476 + }; 477 + }; 478 + }; 479 + }; 404 480 }; 405 481 406 482 sh_fsi2: sound@ec230000 { ··· 519 373 compatible = "renesas,fsi2-sh73a0", "renesas,sh_fsi2"; 520 374 reg = <0xec230000 0x400>; 521 375 interrupts = <0 146 0x4>; 376 + power-domains = <&pd_a4mp>; 522 377 status = "disabled"; 378 + }; 379 + 380 + bsc: bus@fec10000 { 381 + compatible = "renesas,bsc-sh73a0", "renesas,bsc", 382 + "simple-pm-bus"; 383 + #address-cells = <1>; 384 + #size-cells = <1>; 385 + ranges = <0 0 0x20000000>; 386 + reg = <0xfec10000 0x400>; 387 + interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>; 388 + clocks = <&zb_clk>; 389 + power-domains = <&pd_a4s>; 523 390 }; 524 391 525 392 clocks {
-109
arch/arm/configs/ape6evm_defconfig
··· 1 - CONFIG_SYSVIPC=y 2 - CONFIG_POSIX_MQUEUE=y 3 - CONFIG_NO_HZ=y 4 - CONFIG_HIGH_RES_TIMERS=y 5 - CONFIG_BSD_PROCESS_ACCT=y 6 - CONFIG_IKCONFIG=y 7 - CONFIG_IKCONFIG_PROC=y 8 - CONFIG_LOG_BUF_SHIFT=16 9 - CONFIG_CGROUPS=y 10 - CONFIG_CGROUP_SCHED=y 11 - CONFIG_KALLSYMS_ALL=y 12 - CONFIG_EMBEDDED=y 13 - CONFIG_PERF_EVENTS=y 14 - CONFIG_SLAB=y 15 - CONFIG_ARCH_SHMOBILE_LEGACY=y 16 - CONFIG_ARCH_R8A73A4=y 17 - CONFIG_MACH_APE6EVM=y 18 - # CONFIG_ARM_THUMB is not set 19 - CONFIG_CPU_BPREDICT_DISABLE=y 20 - CONFIG_PL310_ERRATA_588369=y 21 - CONFIG_ARM_ERRATA_754322=y 22 - CONFIG_SMP=y 23 - CONFIG_SCHED_MC=y 24 - CONFIG_HAVE_ARM_ARCH_TIMER=y 25 - CONFIG_NR_CPUS=8 26 - CONFIG_AEABI=y 27 - CONFIG_HIGHMEM=y 28 - CONFIG_HIGHPTE=y 29 - # CONFIG_HW_PERF_EVENTS is not set 30 - # CONFIG_COMPACTION is not set 31 - # CONFIG_CROSS_MEMORY_ATTACH is not set 32 - CONFIG_ARM_APPENDED_DTB=y 33 - CONFIG_VFP=y 34 - CONFIG_NEON=y 35 - CONFIG_BINFMT_MISC=y 36 - CONFIG_PM=y 37 - CONFIG_NET=y 38 - CONFIG_PACKET=y 39 - CONFIG_UNIX=y 40 - CONFIG_XFRM_USER=y 41 - CONFIG_NET_KEY=y 42 - CONFIG_NET_KEY_MIGRATE=y 43 - CONFIG_INET=y 44 - CONFIG_IP_MULTICAST=y 45 - CONFIG_IP_PNP=y 46 - CONFIG_IP_PNP_DHCP=y 47 - # CONFIG_INET_LRO is not set 48 - # CONFIG_IPV6_SIT is not set 49 - CONFIG_NETFILTER=y 50 - CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 51 - CONFIG_DEVTMPFS=y 52 - CONFIG_DEVTMPFS_MOUNT=y 53 - # CONFIG_FW_LOADER_USER_HELPER is not set 54 - CONFIG_NETDEVICES=y 55 - # CONFIG_NET_CADENCE is not set 56 - CONFIG_SMC91X=y 57 - CONFIG_SMSC911X=y 58 - # CONFIG_INPUT_MOUSEDEV is not set 59 - CONFIG_INPUT_EVDEV=y 60 - CONFIG_KEYBOARD_GPIO=y 61 - # CONFIG_INPUT_MOUSE is not set 62 - # CONFIG_SERIO is not set 63 - CONFIG_SERIAL_NONSTANDARD=y 64 - CONFIG_SERIAL_SH_SCI=y 65 - CONFIG_SERIAL_SH_SCI_NR_UARTS=12 66 - CONFIG_SERIAL_SH_SCI_CONSOLE=y 67 - CONFIG_I2C=y 68 - CONFIG_I2C_SH_MOBILE=y 69 - CONFIG_GPIO_SH_PFC=y 70 - CONFIG_GPIOLIB=y 71 - # CONFIG_HWMON is not set 72 - CONFIG_THERMAL=y 73 - CONFIG_RCAR_THERMAL=y 74 - CONFIG_REGULATOR=y 75 - CONFIG_REGULATOR_FIXED_VOLTAGE=y 76 - CONFIG_REGULATOR_GPIO=y 77 - CONFIG_REGULATOR_MAX8973=y 78 - # CONFIG_HID is not set 79 - # CONFIG_USB_SUPPORT is not set 80 - CONFIG_MMC=y 81 - CONFIG_MMC_SDHI=y 82 - CONFIG_MMC_SH_MMCIF=y 83 - CONFIG_NEW_LEDS=y 84 - CONFIG_LEDS_CLASS=y 85 - CONFIG_LEDS_GPIO=y 86 - CONFIG_DMADEVICES=y 87 - CONFIG_SH_DMAE=y 88 - # CONFIG_IOMMU_SUPPORT is not set 89 - # CONFIG_DNOTIFY is not set 90 - CONFIG_TMPFS=y 91 - # CONFIG_MISC_FILESYSTEMS is not set 92 - CONFIG_NFS_FS=y 93 - CONFIG_NFS_V3_ACL=y 94 - CONFIG_NFS_V4=y 95 - CONFIG_NFS_V4_1=y 96 - CONFIG_ROOT_NFS=y 97 - CONFIG_MAGIC_SYSRQ=y 98 - CONFIG_ENABLE_DEFAULT_TRACERS=y 99 - CONFIG_CRYPTO_CBC=y 100 - CONFIG_CRYPTO_ECB=y 101 - CONFIG_CRYPTO_MD5=y 102 - CONFIG_CRYPTO_MICHAEL_MIC=y 103 - CONFIG_CRYPTO_TWOFISH=y 104 - CONFIG_CRC_CCITT=y 105 - CONFIG_CRC16=y 106 - CONFIG_CRC_T10DIF=y 107 - CONFIG_CRC_ITU_T=y 108 - CONFIG_CRC7=y 109 - CONFIG_LIBCRC32C=y
+4 -1
arch/arm/configs/at91_dt_defconfig
··· 13 13 # CONFIG_BLK_DEV_BSG is not set 14 14 # CONFIG_IOSCHED_DEADLINE is not set 15 15 # CONFIG_IOSCHED_CFQ is not set 16 + CONFIG_ARCH_MULTI_V4T=y 17 + CONFIG_ARCH_MULTI_V5=y 18 + # CONFIG_ARCH_MULTI_V7 is not set 16 19 CONFIG_ARCH_AT91=y 20 + CONFIG_SOC_SAM_V4_V5=y 17 21 CONFIG_SOC_AT91RM9200=y 18 22 CONFIG_SOC_AT91SAM9=y 19 - CONFIG_AT91_TIMER_HZ=128 20 23 CONFIG_AEABI=y 21 24 CONFIG_UACCESS_WITH_MEMCPY=y 22 25 CONFIG_ZBOOT_ROM_TEXT=0x0
-157
arch/arm/configs/mackerel_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_NET_NS is not set 11 - CONFIG_SLAB=y 12 - CONFIG_MODULES=y 13 - CONFIG_MODULE_UNLOAD=y 14 - # CONFIG_BLK_DEV_BSG is not set 15 - # CONFIG_IOSCHED_DEADLINE is not set 16 - # CONFIG_IOSCHED_CFQ is not set 17 - CONFIG_ARCH_SHMOBILE_LEGACY=y 18 - CONFIG_ARCH_SH7372=y 19 - CONFIG_MACH_MACKEREL=y 20 - CONFIG_MEMORY_SIZE=0x10000000 21 - CONFIG_AEABI=y 22 - # CONFIG_OABI_COMPAT is not set 23 - CONFIG_FORCE_MAX_ZONEORDER=15 24 - CONFIG_ZBOOT_ROM_TEXT=0x0 25 - CONFIG_ZBOOT_ROM_BSS=0x0 26 - CONFIG_ARM_APPENDED_DTB=y 27 - CONFIG_KEXEC=y 28 - CONFIG_VFP=y 29 - # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 30 - CONFIG_PM=y 31 - CONFIG_NET=y 32 - CONFIG_PACKET=y 33 - CONFIG_UNIX=y 34 - CONFIG_INET=y 35 - CONFIG_IP_MULTICAST=y 36 - CONFIG_IP_PNP=y 37 - CONFIG_IP_PNP_DHCP=y 38 - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 39 - # CONFIG_INET_XFRM_MODE_TUNNEL is not set 40 - # CONFIG_INET_XFRM_MODE_BEET is not set 41 - # CONFIG_IPV6 is not set 42 - # CONFIG_WIRELESS is not set 43 - CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 44 - CONFIG_DEVTMPFS=y 45 - CONFIG_DEVTMPFS_MOUNT=y 46 - # CONFIG_FIRMWARE_IN_KERNEL is not set 47 - CONFIG_MTD=y 48 - CONFIG_MTD_CONCAT=y 49 - CONFIG_MTD_PARTITIONS=y 50 - CONFIG_MTD_CHAR=y 51 - CONFIG_MTD_BLOCK=y 52 - CONFIG_MTD_CFI=y 53 - CONFIG_MTD_CFI_ADV_OPTIONS=y 54 - CONFIG_MTD_CFI_INTELEXT=y 55 - CONFIG_MTD_PHYSMAP=y 56 - CONFIG_MTD_ARM_INTEGRATOR=y 57 - CONFIG_MTD_BLOCK2MTD=y 58 - CONFIG_SCSI=y 59 - CONFIG_BLK_DEV_SD=y 60 - # CONFIG_SCSI_LOWLEVEL is not set 61 - CONFIG_NETDEVICES=y 62 - CONFIG_NET_ETHERNET=y 63 - CONFIG_SMSC911X=y 64 - # CONFIG_NETDEV_1000 is not set 65 - # CONFIG_NETDEV_10000 is not set 66 - # CONFIG_WLAN is not set 67 - # CONFIG_INPUT_MOUSEDEV_PSAUX is not set 68 - # CONFIG_INPUT_KEYBOARD is not set 69 - # CONFIG_INPUT_MOUSE is not set 70 - CONFIG_SERIAL_SH_SCI=y 71 - CONFIG_SERIAL_SH_SCI_NR_UARTS=8 72 - CONFIG_SERIAL_SH_SCI_CONSOLE=y 73 - # CONFIG_LEGACY_PTYS is not set 74 - # CONFIG_HW_RANDOM is not set 75 - CONFIG_I2C=y 76 - CONFIG_I2C_SH_MOBILE=y 77 - # CONFIG_HWMON is not set 78 - # CONFIG_MFD_SUPPORT is not set 79 - CONFIG_REGULATOR=y 80 - CONFIG_FB=y 81 - CONFIG_FB_MODE_HELPERS=y 82 - CONFIG_FB_SH_MOBILE_LCDC=y 83 - CONFIG_FB_SH_MOBILE_HDMI=y 84 - CONFIG_FRAMEBUFFER_CONSOLE=y 85 - CONFIG_LOGO=y 86 - # CONFIG_LOGO_LINUX_MONO is not set 87 - # CONFIG_LOGO_LINUX_CLUT224 is not set 88 - # CONFIG_SND_SUPPORT_OLD_API is not set 89 - # CONFIG_SND_VERBOSE_PROCFS is not set 90 - # CONFIG_SND_DRIVERS is not set 91 - # CONFIG_SND_ARM is not set 92 - CONFIG_SND_SOC_SH4_FSI=y 93 - CONFIG_USB=y 94 - CONFIG_USB_RENESAS_USBHS_HCD=y 95 - CONFIG_USB_RENESAS_USBHS=y 96 - CONFIG_USB_STORAGE=y 97 - CONFIG_USB_GADGET=y 98 - CONFIG_USB_RENESAS_USBHS_UDC=y 99 - CONFIG_MMC=y 100 - CONFIG_MMC_SDHI=y 101 - CONFIG_MMC_SH_MMCIF=y 102 - CONFIG_DMADEVICES=y 103 - CONFIG_SH_DMAE=y 104 - CONFIG_EXT2_FS=y 105 - CONFIG_EXT2_FS_XATTR=y 106 - CONFIG_EXT2_FS_POSIX_ACL=y 107 - CONFIG_EXT2_FS_SECURITY=y 108 - CONFIG_EXT2_FS_XIP=y 109 - CONFIG_EXT3_FS=y 110 - # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 111 - CONFIG_EXT3_FS_POSIX_ACL=y 112 - CONFIG_EXT3_FS_SECURITY=y 113 - # CONFIG_DNOTIFY is not set 114 - CONFIG_MSDOS_FS=y 115 - CONFIG_VFAT_FS=y 116 - CONFIG_TMPFS=y 117 - # CONFIG_MISC_FILESYSTEMS is not set 118 - CONFIG_NFS_FS=y 119 - CONFIG_NFS_V3=y 120 - CONFIG_NFS_V3_ACL=y 121 - CONFIG_NFS_V4=y 122 - CONFIG_NFS_V4_1=y 123 - CONFIG_ROOT_NFS=y 124 - CONFIG_NLS_CODEPAGE_437=y 125 - CONFIG_NLS_CODEPAGE_737=y 126 - CONFIG_NLS_CODEPAGE_775=y 127 - CONFIG_NLS_CODEPAGE_850=y 128 - CONFIG_NLS_CODEPAGE_852=y 129 - CONFIG_NLS_CODEPAGE_855=y 130 - CONFIG_NLS_CODEPAGE_857=y 131 - CONFIG_NLS_CODEPAGE_860=y 132 - CONFIG_NLS_CODEPAGE_861=y 133 - CONFIG_NLS_CODEPAGE_862=y 134 - CONFIG_NLS_CODEPAGE_863=y 135 - CONFIG_NLS_CODEPAGE_864=y 136 - CONFIG_NLS_CODEPAGE_865=y 137 - CONFIG_NLS_CODEPAGE_866=y 138 - CONFIG_NLS_CODEPAGE_869=y 139 - CONFIG_NLS_ISO8859_1=y 140 - CONFIG_NLS_ISO8859_2=y 141 - CONFIG_NLS_ISO8859_3=y 142 - CONFIG_NLS_ISO8859_4=y 143 - CONFIG_NLS_ISO8859_5=y 144 - CONFIG_NLS_ISO8859_6=y 145 - CONFIG_NLS_ISO8859_7=y 146 - CONFIG_NLS_ISO8859_9=y 147 - CONFIG_NLS_ISO8859_13=y 148 - CONFIG_NLS_ISO8859_14=y 149 - CONFIG_NLS_ISO8859_15=y 150 - CONFIG_NLS_KOI8_R=y 151 - CONFIG_NLS_KOI8_U=y 152 - CONFIG_NLS_UTF8=y 153 - # CONFIG_ENABLE_WARN_DEPRECATED is not set 154 - # CONFIG_ENABLE_MUST_CHECK is not set 155 - # CONFIG_ARM_UNWIND is not set 156 - CONFIG_CRYPTO=y 157 - CONFIG_CRYPTO_ANSI_CPRNG=y
+42 -76
arch/arm/mach-at91/Kconfig
··· 1 - if ARCH_AT91 2 - 3 - config HAVE_AT91_UTMI 4 - bool 5 - 6 - config HAVE_AT91_USB_CLK 7 - bool 8 - 9 - config COMMON_CLK_AT91 10 - bool 11 - select COMMON_CLK 12 - 13 - config HAVE_AT91_SMD 14 - bool 15 - 16 - config HAVE_AT91_H32MX 17 - bool 18 - 19 - config SOC_SAMA5 20 - bool 21 - select ATMEL_AIC5_IRQ 1 + menuconfig ARCH_AT91 2 + bool "Atmel SoCs" 3 + depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V7 4 + select ARCH_REQUIRE_GPIOLIB 22 5 select COMMON_CLK_AT91 23 - select CPU_V7 24 - select GENERIC_CLOCKEVENTS 25 - select MEMORY 26 - select ATMEL_SDRAMC 27 - select SRAM if PM 6 + select PINCTRL 7 + select PINCTRL_AT91 8 + select SOC_BUS 28 9 29 - menu "Atmel AT91 System-on-Chip" 30 - 31 - choice 32 - 33 - prompt "Core type" 34 - 35 - config SOC_SAM_V4_V5 36 - bool "ARM9 AT91SAM9/AT91RM9200" 37 - help 38 - Select this if you are using one of Atmel's AT91SAM9 or 39 - AT91RM9200 SoC. 40 - 41 - config SOC_SAM_V7 42 - bool "Cortex A5" 43 - help 44 - Select this if you are using one of Atmel's SAMA5D3 SoC. 45 - 46 - endchoice 47 - 48 - comment "Atmel AT91 Processor" 49 - 50 - if SOC_SAM_V7 10 + if ARCH_AT91 51 11 config SOC_SAMA5D3 52 - bool "SAMA5D3 family" 12 + bool "SAMA5D3 family" if ARCH_MULTI_V7 53 13 select SOC_SAMA5 54 14 select HAVE_FB_ATMEL 55 15 select HAVE_AT91_UTMI ··· 20 60 This support covers SAMA5D31, SAMA5D33, SAMA5D34, SAMA5D35, SAMA5D36. 21 61 22 62 config SOC_SAMA5D4 23 - bool "SAMA5D4 family" 63 + bool "SAMA5D4 family" if ARCH_MULTI_V7 24 64 select SOC_SAMA5 25 - select CLKSRC_MMIO 26 65 select CACHE_L2X0 27 66 select HAVE_FB_ATMEL 28 67 select HAVE_AT91_UTMI ··· 30 71 select HAVE_AT91_H32MX 31 72 help 32 73 Select this if you are using one of Atmel's SAMA5D4 family SoC. 33 - endif 34 74 35 - if SOC_SAM_V4_V5 36 75 config SOC_AT91RM9200 37 - bool "AT91RM9200" 76 + bool "AT91RM9200" if ARCH_MULTI_V4T 38 77 select ATMEL_AIC_IRQ 39 78 select ATMEL_ST 40 - select COMMON_CLK_AT91 41 79 select CPU_ARM920T 42 - select GENERIC_CLOCKEVENTS 43 80 select HAVE_AT91_USB_CLK 44 81 select MIGHT_HAVE_PCI 82 + select SOC_SAM_V4_V5 45 83 select SRAM if PM 84 + help 85 + Select this if you are using Atmel's AT91RM9200 SoC. 46 86 47 87 config SOC_AT91SAM9 48 - bool "AT91SAM9" 88 + bool "AT91SAM9" if ARCH_MULTI_V5 49 89 select ATMEL_AIC_IRQ 50 90 select ATMEL_SDRAMC 51 - select COMMON_CLK_AT91 52 91 select CPU_ARM926T 53 - select GENERIC_CLOCKEVENTS 54 92 select HAVE_AT91_SMD 55 93 select HAVE_AT91_USB_CLK 56 94 select HAVE_AT91_UTMI 57 95 select HAVE_FB_ATMEL 58 96 select MEMORY 97 + select SOC_SAM_V4_V5 59 98 select SRAM if PM 60 99 help 61 100 Select this if you are using one of those Atmel SoC: ··· 73 116 AT91SAM9X25 74 117 AT91SAM9X35 75 118 AT91SAM9XE 76 - endif # SOC_SAM_V4_V5 77 119 78 - comment "AT91 Feature Selections" 120 + config HAVE_AT91_UTMI 121 + bool 79 122 80 - config AT91_TIMER_HZ 81 - int "Kernel HZ (jiffies per second)" 82 - range 32 1024 83 - depends on ARCH_AT91 84 - default "128" if SOC_AT91RM9200 85 - default "100" 86 - help 87 - On AT91rm9200 chips where you're using a system clock derived 88 - from the 32768 Hz hardware clock, this tick rate should divide 89 - it exactly: use a power-of-two value, such as 128 or 256, to 90 - reduce timing errors caused by rounding. 123 + config HAVE_AT91_USB_CLK 124 + bool 91 125 92 - On AT91sam926x chips, or otherwise when using a higher precision 93 - system clock (of at least several MHz), rounding is less of a 94 - problem so it can be safer to use a decimal values like 100. 126 + config COMMON_CLK_AT91 127 + bool 128 + select COMMON_CLK 95 129 96 - endmenu 130 + config HAVE_AT91_SMD 131 + bool 132 + 133 + config HAVE_AT91_H32MX 134 + bool 135 + 136 + config SOC_SAM_V4_V5 137 + bool 138 + 139 + config SOC_SAM_V7 140 + bool 141 + 142 + config SOC_SAMA5 143 + bool 144 + select ATMEL_AIC5_IRQ 145 + select ATMEL_SDRAMC 146 + select MEMORY 147 + select SOC_SAM_V7 148 + select SRAM if PM 97 149 98 150 endif
+5
arch/arm/mach-at91/Makefile
··· 1 1 # 2 2 # Makefile for the linux kernel. 3 3 # 4 + ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include 5 + asflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include 4 6 5 7 obj-y := soc.o 6 8 ··· 17 15 obj-$(CONFIG_PM) += pm.o 18 16 obj-$(CONFIG_PM) += pm_suspend.o 19 17 18 + ifeq ($(CONFIG_CPU_V7),y) 19 + AFLAGS_pm_suspend.o := -march=armv7-a 20 + endif 20 21 ifeq ($(CONFIG_PM_DEBUG),y) 21 22 CFLAGS_pm.o += -DDEBUG 22 23 endif
-63
arch/arm/mach-at91/include/mach/at91_dbgu.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91_dbgu.h 3 - * 4 - * Copyright (C) 2005 Ivan Kokshaysky 5 - * Copyright (C) SAN People 6 - * 7 - * Debug Unit (DBGU) - System peripherals registers. 8 - * Based on AT91RM9200 datasheet revision E. 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of the GNU General Public License as published by 12 - * the Free Software Foundation; either version 2 of the License, or 13 - * (at your option) any later version. 14 - */ 15 - 16 - #ifndef AT91_DBGU_H 17 - #define AT91_DBGU_H 18 - 19 - #define AT91_DBGU_CR (0x00) /* Control Register */ 20 - #define AT91_DBGU_MR (0x04) /* Mode Register */ 21 - #define AT91_DBGU_IER (0x08) /* Interrupt Enable Register */ 22 - #define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */ 23 - #define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */ 24 - #define AT91_DBGU_IDR (0x0c) /* Interrupt Disable Register */ 25 - #define AT91_DBGU_IMR (0x10) /* Interrupt Mask Register */ 26 - #define AT91_DBGU_SR (0x14) /* Status Register */ 27 - #define AT91_DBGU_RHR (0x18) /* Receiver Holding Register */ 28 - #define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */ 29 - #define AT91_DBGU_BRGR (0x20) /* Baud Rate Generator Register */ 30 - 31 - #define AT91_DBGU_CIDR (0x40) /* Chip ID Register */ 32 - #define AT91_DBGU_EXID (0x44) /* Chip ID Extension Register */ 33 - #define AT91_DBGU_FNR (0x48) /* Force NTRST Register [SAM9 only] */ 34 - #define AT91_DBGU_FNTRST (1 << 0) /* Force NTRST */ 35 - 36 - /* 37 - * Some AT91 parts that don't have full DEBUG units still support the ID 38 - * and extensions register. 39 - */ 40 - #define AT91_CIDR_VERSION (0x1f << 0) /* Version of the Device */ 41 - #define AT91_CIDR_EPROC (7 << 5) /* Embedded Processor */ 42 - #define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */ 43 - #define AT91_CIDR_NVPSIZ2 (0xf << 12) /* Second Nonvolatile Program Memory Size */ 44 - #define AT91_CIDR_SRAMSIZ (0xf << 16) /* Internal SRAM Size */ 45 - #define AT91_CIDR_SRAMSIZ_1K (1 << 16) 46 - #define AT91_CIDR_SRAMSIZ_2K (2 << 16) 47 - #define AT91_CIDR_SRAMSIZ_112K (4 << 16) 48 - #define AT91_CIDR_SRAMSIZ_4K (5 << 16) 49 - #define AT91_CIDR_SRAMSIZ_80K (6 << 16) 50 - #define AT91_CIDR_SRAMSIZ_160K (7 << 16) 51 - #define AT91_CIDR_SRAMSIZ_8K (8 << 16) 52 - #define AT91_CIDR_SRAMSIZ_16K (9 << 16) 53 - #define AT91_CIDR_SRAMSIZ_32K (10 << 16) 54 - #define AT91_CIDR_SRAMSIZ_64K (11 << 16) 55 - #define AT91_CIDR_SRAMSIZ_128K (12 << 16) 56 - #define AT91_CIDR_SRAMSIZ_256K (13 << 16) 57 - #define AT91_CIDR_SRAMSIZ_96K (14 << 16) 58 - #define AT91_CIDR_SRAMSIZ_512K (15 << 16) 59 - #define AT91_CIDR_ARCH (0xff << 20) /* Architecture Identifier */ 60 - #define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ 61 - #define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ 62 - 63 - #endif
-4
arch/arm/mach-at91/include/mach/at91_ramc.h
··· 21 21 .extern at91_ramc_base 22 22 #endif 23 23 24 - #define AT91_MEMCTRL_MC 0 25 - #define AT91_MEMCTRL_SDRAMC 1 26 - #define AT91_MEMCTRL_DDRSDR 2 27 - 28 24 #include <soc/at91/at91rm9200_sdramc.h> 29 25 #include <soc/at91/at91sam9_ddrsdr.h> 30 26 #include <soc/at91/at91sam9_sdramc.h>
-103
arch/arm/mach-at91/include/mach/at91rm9200.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91rm9200.h 3 - * 4 - * Copyright (C) 2005 Ivan Kokshaysky 5 - * Copyright (C) SAN People 6 - * 7 - * Common definitions. 8 - * Based on AT91RM9200 datasheet revision E. 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of the GNU General Public License as published by 12 - * the Free Software Foundation; either version 2 of the License, or 13 - * (at your option) any later version. 14 - */ 15 - 16 - #ifndef AT91RM9200_H 17 - #define AT91RM9200_H 18 - 19 - /* 20 - * Peripheral identifiers/interrupts. 21 - */ 22 - #define AT91RM9200_ID_PIOA 2 /* Parallel IO Controller A */ 23 - #define AT91RM9200_ID_PIOB 3 /* Parallel IO Controller B */ 24 - #define AT91RM9200_ID_PIOC 4 /* Parallel IO Controller C */ 25 - #define AT91RM9200_ID_PIOD 5 /* Parallel IO Controller D */ 26 - #define AT91RM9200_ID_US0 6 /* USART 0 */ 27 - #define AT91RM9200_ID_US1 7 /* USART 1 */ 28 - #define AT91RM9200_ID_US2 8 /* USART 2 */ 29 - #define AT91RM9200_ID_US3 9 /* USART 3 */ 30 - #define AT91RM9200_ID_MCI 10 /* Multimedia Card Interface */ 31 - #define AT91RM9200_ID_UDP 11 /* USB Device Port */ 32 - #define AT91RM9200_ID_TWI 12 /* Two-Wire Interface */ 33 - #define AT91RM9200_ID_SPI 13 /* Serial Peripheral Interface */ 34 - #define AT91RM9200_ID_SSC0 14 /* Serial Synchronous Controller 0 */ 35 - #define AT91RM9200_ID_SSC1 15 /* Serial Synchronous Controller 1 */ 36 - #define AT91RM9200_ID_SSC2 16 /* Serial Synchronous Controller 2 */ 37 - #define AT91RM9200_ID_TC0 17 /* Timer Counter 0 */ 38 - #define AT91RM9200_ID_TC1 18 /* Timer Counter 1 */ 39 - #define AT91RM9200_ID_TC2 19 /* Timer Counter 2 */ 40 - #define AT91RM9200_ID_TC3 20 /* Timer Counter 3 */ 41 - #define AT91RM9200_ID_TC4 21 /* Timer Counter 4 */ 42 - #define AT91RM9200_ID_TC5 22 /* Timer Counter 5 */ 43 - #define AT91RM9200_ID_UHP 23 /* USB Host port */ 44 - #define AT91RM9200_ID_EMAC 24 /* Ethernet MAC */ 45 - #define AT91RM9200_ID_IRQ0 25 /* Advanced Interrupt Controller (IRQ0) */ 46 - #define AT91RM9200_ID_IRQ1 26 /* Advanced Interrupt Controller (IRQ1) */ 47 - #define AT91RM9200_ID_IRQ2 27 /* Advanced Interrupt Controller (IRQ2) */ 48 - #define AT91RM9200_ID_IRQ3 28 /* Advanced Interrupt Controller (IRQ3) */ 49 - #define AT91RM9200_ID_IRQ4 29 /* Advanced Interrupt Controller (IRQ4) */ 50 - #define AT91RM9200_ID_IRQ5 30 /* Advanced Interrupt Controller (IRQ5) */ 51 - #define AT91RM9200_ID_IRQ6 31 /* Advanced Interrupt Controller (IRQ6) */ 52 - 53 - 54 - /* 55 - * Peripheral physical base addresses. 56 - */ 57 - #define AT91RM9200_BASE_TCB0 0xfffa0000 58 - #define AT91RM9200_BASE_TC0 0xfffa0000 59 - #define AT91RM9200_BASE_TC1 0xfffa0040 60 - #define AT91RM9200_BASE_TC2 0xfffa0080 61 - #define AT91RM9200_BASE_TCB1 0xfffa4000 62 - #define AT91RM9200_BASE_TC3 0xfffa4000 63 - #define AT91RM9200_BASE_TC4 0xfffa4040 64 - #define AT91RM9200_BASE_TC5 0xfffa4080 65 - #define AT91RM9200_BASE_UDP 0xfffb0000 66 - #define AT91RM9200_BASE_MCI 0xfffb4000 67 - #define AT91RM9200_BASE_TWI 0xfffb8000 68 - #define AT91RM9200_BASE_EMAC 0xfffbc000 69 - #define AT91RM9200_BASE_US0 0xfffc0000 70 - #define AT91RM9200_BASE_US1 0xfffc4000 71 - #define AT91RM9200_BASE_US2 0xfffc8000 72 - #define AT91RM9200_BASE_US3 0xfffcc000 73 - #define AT91RM9200_BASE_SSC0 0xfffd0000 74 - #define AT91RM9200_BASE_SSC1 0xfffd4000 75 - #define AT91RM9200_BASE_SSC2 0xfffd8000 76 - #define AT91RM9200_BASE_SPI 0xfffe0000 77 - 78 - 79 - /* 80 - * System Peripherals 81 - */ 82 - #define AT91RM9200_BASE_DBGU AT91_BASE_DBGU0 /* Debug Unit */ 83 - #define AT91RM9200_BASE_PIOA 0xfffff400 /* PIO Controller A */ 84 - #define AT91RM9200_BASE_PIOB 0xfffff600 /* PIO Controller B */ 85 - #define AT91RM9200_BASE_PIOC 0xfffff800 /* PIO Controller C */ 86 - #define AT91RM9200_BASE_PIOD 0xfffffa00 /* PIO Controller D */ 87 - #define AT91RM9200_BASE_ST 0xfffffd00 /* System Timer */ 88 - #define AT91RM9200_BASE_RTC 0xfffffe00 /* Real-Time Clock */ 89 - #define AT91RM9200_BASE_MC 0xffffff00 /* Memory Controllers */ 90 - 91 - /* 92 - * Internal Memory. 93 - */ 94 - #define AT91RM9200_ROM_BASE 0x00100000 /* Internal ROM base address */ 95 - #define AT91RM9200_ROM_SIZE SZ_128K /* Internal ROM size (128Kb) */ 96 - 97 - #define AT91RM9200_SRAM_BASE 0x00200000 /* Internal SRAM base address */ 98 - #define AT91RM9200_SRAM_SIZE SZ_16K /* Internal SRAM size (16Kb) */ 99 - 100 - #define AT91RM9200_UHP_BASE 0x00300000 /* USB Host controller */ 101 - 102 - 103 - #endif
-129
arch/arm/mach-at91/include/mach/at91sam9260.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91sam9260.h 3 - * 4 - * (C) 2006 Andrew Victor 5 - * 6 - * Common definitions. 7 - * Based on AT91SAM9260 datasheet revision A (Preliminary). 8 - * 9 - * Includes also definitions for AT91SAM9XE and AT91SAM9G families 10 - * 11 - * This program is free software; you can redistribute it and/or modify 12 - * it under the terms of the GNU General Public License as published by 13 - * the Free Software Foundation; either version 2 of the License, or 14 - * (at your option) any later version. 15 - */ 16 - 17 - #ifndef AT91SAM9260_H 18 - #define AT91SAM9260_H 19 - 20 - /* 21 - * Peripheral identifiers/interrupts. 22 - */ 23 - #define AT91SAM9260_ID_PIOA 2 /* Parallel IO Controller A */ 24 - #define AT91SAM9260_ID_PIOB 3 /* Parallel IO Controller B */ 25 - #define AT91SAM9260_ID_PIOC 4 /* Parallel IO Controller C */ 26 - #define AT91SAM9260_ID_ADC 5 /* Analog-to-Digital Converter */ 27 - #define AT91SAM9260_ID_US0 6 /* USART 0 */ 28 - #define AT91SAM9260_ID_US1 7 /* USART 1 */ 29 - #define AT91SAM9260_ID_US2 8 /* USART 2 */ 30 - #define AT91SAM9260_ID_MCI 9 /* Multimedia Card Interface */ 31 - #define AT91SAM9260_ID_UDP 10 /* USB Device Port */ 32 - #define AT91SAM9260_ID_TWI 11 /* Two-Wire Interface */ 33 - #define AT91SAM9260_ID_SPI0 12 /* Serial Peripheral Interface 0 */ 34 - #define AT91SAM9260_ID_SPI1 13 /* Serial Peripheral Interface 1 */ 35 - #define AT91SAM9260_ID_SSC 14 /* Serial Synchronous Controller */ 36 - #define AT91SAM9260_ID_TC0 17 /* Timer Counter 0 */ 37 - #define AT91SAM9260_ID_TC1 18 /* Timer Counter 1 */ 38 - #define AT91SAM9260_ID_TC2 19 /* Timer Counter 2 */ 39 - #define AT91SAM9260_ID_UHP 20 /* USB Host port */ 40 - #define AT91SAM9260_ID_EMAC 21 /* Ethernet */ 41 - #define AT91SAM9260_ID_ISI 22 /* Image Sensor Interface */ 42 - #define AT91SAM9260_ID_US3 23 /* USART 3 */ 43 - #define AT91SAM9260_ID_US4 24 /* USART 4 */ 44 - #define AT91SAM9260_ID_US5 25 /* USART 5 */ 45 - #define AT91SAM9260_ID_TC3 26 /* Timer Counter 3 */ 46 - #define AT91SAM9260_ID_TC4 27 /* Timer Counter 4 */ 47 - #define AT91SAM9260_ID_TC5 28 /* Timer Counter 5 */ 48 - #define AT91SAM9260_ID_IRQ0 29 /* Advanced Interrupt Controller (IRQ0) */ 49 - #define AT91SAM9260_ID_IRQ1 30 /* Advanced Interrupt Controller (IRQ1) */ 50 - #define AT91SAM9260_ID_IRQ2 31 /* Advanced Interrupt Controller (IRQ2) */ 51 - 52 - 53 - /* 54 - * User Peripheral physical base addresses. 55 - */ 56 - #define AT91SAM9260_BASE_TCB0 0xfffa0000 57 - #define AT91SAM9260_BASE_TC0 0xfffa0000 58 - #define AT91SAM9260_BASE_TC1 0xfffa0040 59 - #define AT91SAM9260_BASE_TC2 0xfffa0080 60 - #define AT91SAM9260_BASE_UDP 0xfffa4000 61 - #define AT91SAM9260_BASE_MCI 0xfffa8000 62 - #define AT91SAM9260_BASE_TWI 0xfffac000 63 - #define AT91SAM9260_BASE_US0 0xfffb0000 64 - #define AT91SAM9260_BASE_US1 0xfffb4000 65 - #define AT91SAM9260_BASE_US2 0xfffb8000 66 - #define AT91SAM9260_BASE_SSC 0xfffbc000 67 - #define AT91SAM9260_BASE_ISI 0xfffc0000 68 - #define AT91SAM9260_BASE_EMAC 0xfffc4000 69 - #define AT91SAM9260_BASE_SPI0 0xfffc8000 70 - #define AT91SAM9260_BASE_SPI1 0xfffcc000 71 - #define AT91SAM9260_BASE_US3 0xfffd0000 72 - #define AT91SAM9260_BASE_US4 0xfffd4000 73 - #define AT91SAM9260_BASE_US5 0xfffd8000 74 - #define AT91SAM9260_BASE_TCB1 0xfffdc000 75 - #define AT91SAM9260_BASE_TC3 0xfffdc000 76 - #define AT91SAM9260_BASE_TC4 0xfffdc040 77 - #define AT91SAM9260_BASE_TC5 0xfffdc080 78 - #define AT91SAM9260_BASE_ADC 0xfffe0000 79 - 80 - /* 81 - * System Peripherals 82 - */ 83 - #define AT91SAM9260_BASE_ECC 0xffffe800 84 - #define AT91SAM9260_BASE_SDRAMC 0xffffea00 85 - #define AT91SAM9260_BASE_SMC 0xffffec00 86 - #define AT91SAM9260_BASE_MATRIX 0xffffee00 87 - #define AT91SAM9260_BASE_DBGU AT91_BASE_DBGU0 88 - #define AT91SAM9260_BASE_PIOA 0xfffff400 89 - #define AT91SAM9260_BASE_PIOB 0xfffff600 90 - #define AT91SAM9260_BASE_PIOC 0xfffff800 91 - #define AT91SAM9260_BASE_RSTC 0xfffffd00 92 - #define AT91SAM9260_BASE_SHDWC 0xfffffd10 93 - #define AT91SAM9260_BASE_RTT 0xfffffd20 94 - #define AT91SAM9260_BASE_PIT 0xfffffd30 95 - #define AT91SAM9260_BASE_WDT 0xfffffd40 96 - #define AT91SAM9260_BASE_GPBR 0xfffffd50 97 - 98 - 99 - /* 100 - * Internal Memory. 101 - */ 102 - #define AT91SAM9260_ROM_BASE 0x00100000 /* Internal ROM base address */ 103 - #define AT91SAM9260_ROM_SIZE SZ_32K /* Internal ROM size (32Kb) */ 104 - 105 - #define AT91SAM9260_SRAM0_BASE 0x00200000 /* Internal SRAM 0 base address */ 106 - #define AT91SAM9260_SRAM0_SIZE SZ_4K /* Internal SRAM 0 size (4Kb) */ 107 - #define AT91SAM9260_SRAM1_BASE 0x00300000 /* Internal SRAM 1 base address */ 108 - #define AT91SAM9260_SRAM1_SIZE SZ_4K /* Internal SRAM 1 size (4Kb) */ 109 - #define AT91SAM9260_SRAM_BASE 0x002FF000 /* Internal SRAM base address */ 110 - #define AT91SAM9260_SRAM_SIZE SZ_8K /* Internal SRAM size (8Kb) */ 111 - 112 - #define AT91SAM9260_UHP_BASE 0x00500000 /* USB Host controller */ 113 - 114 - #define AT91SAM9XE_FLASH_BASE 0x00200000 /* Internal FLASH base address */ 115 - #define AT91SAM9XE_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 116 - 117 - #define AT91SAM9G20_ROM_BASE 0x00100000 /* Internal ROM base address */ 118 - #define AT91SAM9G20_ROM_SIZE SZ_32K /* Internal ROM size (32Kb) */ 119 - 120 - #define AT91SAM9G20_SRAM0_BASE 0x00200000 /* Internal SRAM 0 base address */ 121 - #define AT91SAM9G20_SRAM0_SIZE SZ_16K /* Internal SRAM 0 size (16Kb) */ 122 - #define AT91SAM9G20_SRAM1_BASE 0x00300000 /* Internal SRAM 1 base address */ 123 - #define AT91SAM9G20_SRAM1_SIZE SZ_16K /* Internal SRAM 1 size (16Kb) */ 124 - #define AT91SAM9G20_SRAM_BASE 0x002FC000 /* Internal SRAM base address */ 125 - #define AT91SAM9G20_SRAM_SIZE SZ_32K /* Internal SRAM size (32Kb) */ 126 - 127 - #define AT91SAM9G20_UHP_BASE 0x00500000 /* USB Host controller */ 128 - 129 - #endif
-99
arch/arm/mach-at91/include/mach/at91sam9261.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91sam9261.h 3 - * 4 - * Copyright (C) SAN People 5 - * 6 - * Common definitions. 7 - * Based on AT91SAM9261 datasheet revision E. (Preliminary) 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License as published by 11 - * the Free Software Foundation; either version 2 of the License, or 12 - * (at your option) any later version. 13 - */ 14 - 15 - #ifndef AT91SAM9261_H 16 - #define AT91SAM9261_H 17 - 18 - /* 19 - * Peripheral identifiers/interrupts. 20 - */ 21 - #define AT91SAM9261_ID_PIOA 2 /* Parallel IO Controller A */ 22 - #define AT91SAM9261_ID_PIOB 3 /* Parallel IO Controller B */ 23 - #define AT91SAM9261_ID_PIOC 4 /* Parallel IO Controller C */ 24 - #define AT91SAM9261_ID_US0 6 /* USART 0 */ 25 - #define AT91SAM9261_ID_US1 7 /* USART 1 */ 26 - #define AT91SAM9261_ID_US2 8 /* USART 2 */ 27 - #define AT91SAM9261_ID_MCI 9 /* Multimedia Card Interface */ 28 - #define AT91SAM9261_ID_UDP 10 /* USB Device Port */ 29 - #define AT91SAM9261_ID_TWI 11 /* Two-Wire Interface */ 30 - #define AT91SAM9261_ID_SPI0 12 /* Serial Peripheral Interface 0 */ 31 - #define AT91SAM9261_ID_SPI1 13 /* Serial Peripheral Interface 1 */ 32 - #define AT91SAM9261_ID_SSC0 14 /* Serial Synchronous Controller 0 */ 33 - #define AT91SAM9261_ID_SSC1 15 /* Serial Synchronous Controller 1 */ 34 - #define AT91SAM9261_ID_SSC2 16 /* Serial Synchronous Controller 2 */ 35 - #define AT91SAM9261_ID_TC0 17 /* Timer Counter 0 */ 36 - #define AT91SAM9261_ID_TC1 18 /* Timer Counter 1 */ 37 - #define AT91SAM9261_ID_TC2 19 /* Timer Counter 2 */ 38 - #define AT91SAM9261_ID_UHP 20 /* USB Host port */ 39 - #define AT91SAM9261_ID_LCDC 21 /* LDC Controller */ 40 - #define AT91SAM9261_ID_IRQ0 29 /* Advanced Interrupt Controller (IRQ0) */ 41 - #define AT91SAM9261_ID_IRQ1 30 /* Advanced Interrupt Controller (IRQ1) */ 42 - #define AT91SAM9261_ID_IRQ2 31 /* Advanced Interrupt Controller (IRQ2) */ 43 - 44 - 45 - /* 46 - * User Peripheral physical base addresses. 47 - */ 48 - #define AT91SAM9261_BASE_TCB0 0xfffa0000 49 - #define AT91SAM9261_BASE_TC0 0xfffa0000 50 - #define AT91SAM9261_BASE_TC1 0xfffa0040 51 - #define AT91SAM9261_BASE_TC2 0xfffa0080 52 - #define AT91SAM9261_BASE_UDP 0xfffa4000 53 - #define AT91SAM9261_BASE_MCI 0xfffa8000 54 - #define AT91SAM9261_BASE_TWI 0xfffac000 55 - #define AT91SAM9261_BASE_US0 0xfffb0000 56 - #define AT91SAM9261_BASE_US1 0xfffb4000 57 - #define AT91SAM9261_BASE_US2 0xfffb8000 58 - #define AT91SAM9261_BASE_SSC0 0xfffbc000 59 - #define AT91SAM9261_BASE_SSC1 0xfffc0000 60 - #define AT91SAM9261_BASE_SSC2 0xfffc4000 61 - #define AT91SAM9261_BASE_SPI0 0xfffc8000 62 - #define AT91SAM9261_BASE_SPI1 0xfffcc000 63 - 64 - 65 - /* 66 - * System Peripherals 67 - */ 68 - #define AT91SAM9261_BASE_SMC 0xffffec00 69 - #define AT91SAM9261_BASE_MATRIX 0xffffee00 70 - #define AT91SAM9261_BASE_SDRAMC 0xffffea00 71 - #define AT91SAM9261_BASE_DBGU AT91_BASE_DBGU0 72 - #define AT91SAM9261_BASE_PIOA 0xfffff400 73 - #define AT91SAM9261_BASE_PIOB 0xfffff600 74 - #define AT91SAM9261_BASE_PIOC 0xfffff800 75 - #define AT91SAM9261_BASE_RSTC 0xfffffd00 76 - #define AT91SAM9261_BASE_SHDWC 0xfffffd10 77 - #define AT91SAM9261_BASE_RTT 0xfffffd20 78 - #define AT91SAM9261_BASE_PIT 0xfffffd30 79 - #define AT91SAM9261_BASE_WDT 0xfffffd40 80 - #define AT91SAM9261_BASE_GPBR 0xfffffd50 81 - 82 - 83 - /* 84 - * Internal Memory. 85 - */ 86 - #define AT91SAM9261_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 87 - #define AT91SAM9261_SRAM_SIZE 0x00028000 /* Internal SRAM size (160Kb) */ 88 - 89 - #define AT91SAM9G10_SRAM_BASE AT91SAM9261_SRAM_BASE /* Internal SRAM base address */ 90 - #define AT91SAM9G10_SRAM_SIZE 0x00004000 /* Internal SRAM size (16Kb) */ 91 - 92 - #define AT91SAM9261_ROM_BASE 0x00400000 /* Internal ROM base address */ 93 - #define AT91SAM9261_ROM_SIZE SZ_32K /* Internal ROM size (32Kb) */ 94 - 95 - #define AT91SAM9261_UHP_BASE 0x00500000 /* USB Host controller */ 96 - #define AT91SAM9261_LCDC_BASE 0x00600000 /* LDC controller */ 97 - 98 - 99 - #endif
-117
arch/arm/mach-at91/include/mach/at91sam9263.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91sam9263.h 3 - * 4 - * (C) 2007 Atmel Corporation. 5 - * 6 - * Common definitions. 7 - * Based on AT91SAM9263 datasheet revision B (Preliminary). 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License as published by 11 - * the Free Software Foundation; either version 2 of the License, or 12 - * (at your option) any later version. 13 - */ 14 - 15 - #ifndef AT91SAM9263_H 16 - #define AT91SAM9263_H 17 - 18 - /* 19 - * Peripheral identifiers/interrupts. 20 - */ 21 - #define AT91SAM9263_ID_PIOA 2 /* Parallel IO Controller A */ 22 - #define AT91SAM9263_ID_PIOB 3 /* Parallel IO Controller B */ 23 - #define AT91SAM9263_ID_PIOCDE 4 /* Parallel IO Controller C, D and E */ 24 - #define AT91SAM9263_ID_US0 7 /* USART 0 */ 25 - #define AT91SAM9263_ID_US1 8 /* USART 1 */ 26 - #define AT91SAM9263_ID_US2 9 /* USART 2 */ 27 - #define AT91SAM9263_ID_MCI0 10 /* Multimedia Card Interface 0 */ 28 - #define AT91SAM9263_ID_MCI1 11 /* Multimedia Card Interface 1 */ 29 - #define AT91SAM9263_ID_CAN 12 /* CAN */ 30 - #define AT91SAM9263_ID_TWI 13 /* Two-Wire Interface */ 31 - #define AT91SAM9263_ID_SPI0 14 /* Serial Peripheral Interface 0 */ 32 - #define AT91SAM9263_ID_SPI1 15 /* Serial Peripheral Interface 1 */ 33 - #define AT91SAM9263_ID_SSC0 16 /* Serial Synchronous Controller 0 */ 34 - #define AT91SAM9263_ID_SSC1 17 /* Serial Synchronous Controller 1 */ 35 - #define AT91SAM9263_ID_AC97C 18 /* AC97 Controller */ 36 - #define AT91SAM9263_ID_TCB 19 /* Timer Counter 0, 1 and 2 */ 37 - #define AT91SAM9263_ID_PWMC 20 /* Pulse Width Modulation Controller */ 38 - #define AT91SAM9263_ID_EMAC 21 /* Ethernet */ 39 - #define AT91SAM9263_ID_2DGE 23 /* 2D Graphic Engine */ 40 - #define AT91SAM9263_ID_UDP 24 /* USB Device Port */ 41 - #define AT91SAM9263_ID_ISI 25 /* Image Sensor Interface */ 42 - #define AT91SAM9263_ID_LCDC 26 /* LCD Controller */ 43 - #define AT91SAM9263_ID_DMA 27 /* DMA Controller */ 44 - #define AT91SAM9263_ID_UHP 29 /* USB Host port */ 45 - #define AT91SAM9263_ID_IRQ0 30 /* Advanced Interrupt Controller (IRQ0) */ 46 - #define AT91SAM9263_ID_IRQ1 31 /* Advanced Interrupt Controller (IRQ1) */ 47 - 48 - 49 - /* 50 - * User Peripheral physical base addresses. 51 - */ 52 - #define AT91SAM9263_BASE_UDP 0xfff78000 53 - #define AT91SAM9263_BASE_TCB0 0xfff7c000 54 - #define AT91SAM9263_BASE_TC0 0xfff7c000 55 - #define AT91SAM9263_BASE_TC1 0xfff7c040 56 - #define AT91SAM9263_BASE_TC2 0xfff7c080 57 - #define AT91SAM9263_BASE_MCI0 0xfff80000 58 - #define AT91SAM9263_BASE_MCI1 0xfff84000 59 - #define AT91SAM9263_BASE_TWI 0xfff88000 60 - #define AT91SAM9263_BASE_US0 0xfff8c000 61 - #define AT91SAM9263_BASE_US1 0xfff90000 62 - #define AT91SAM9263_BASE_US2 0xfff94000 63 - #define AT91SAM9263_BASE_SSC0 0xfff98000 64 - #define AT91SAM9263_BASE_SSC1 0xfff9c000 65 - #define AT91SAM9263_BASE_AC97C 0xfffa0000 66 - #define AT91SAM9263_BASE_SPI0 0xfffa4000 67 - #define AT91SAM9263_BASE_SPI1 0xfffa8000 68 - #define AT91SAM9263_BASE_CAN 0xfffac000 69 - #define AT91SAM9263_BASE_PWMC 0xfffb8000 70 - #define AT91SAM9263_BASE_EMAC 0xfffbc000 71 - #define AT91SAM9263_BASE_ISI 0xfffc4000 72 - #define AT91SAM9263_BASE_2DGE 0xfffc8000 73 - 74 - /* 75 - * System Peripherals 76 - */ 77 - #define AT91SAM9263_BASE_ECC0 0xffffe000 78 - #define AT91SAM9263_BASE_SDRAMC0 0xffffe200 79 - #define AT91SAM9263_BASE_SMC0 0xffffe400 80 - #define AT91SAM9263_BASE_ECC1 0xffffe600 81 - #define AT91SAM9263_BASE_SDRAMC1 0xffffe800 82 - #define AT91SAM9263_BASE_SMC1 0xffffea00 83 - #define AT91SAM9263_BASE_MATRIX 0xffffec00 84 - #define AT91SAM9263_BASE_DBGU AT91_BASE_DBGU1 85 - #define AT91SAM9263_BASE_PIOA 0xfffff200 86 - #define AT91SAM9263_BASE_PIOB 0xfffff400 87 - #define AT91SAM9263_BASE_PIOC 0xfffff600 88 - #define AT91SAM9263_BASE_PIOD 0xfffff800 89 - #define AT91SAM9263_BASE_PIOE 0xfffffa00 90 - #define AT91SAM9263_BASE_RSTC 0xfffffd00 91 - #define AT91SAM9263_BASE_SHDWC 0xfffffd10 92 - #define AT91SAM9263_BASE_RTT0 0xfffffd20 93 - #define AT91SAM9263_BASE_PIT 0xfffffd30 94 - #define AT91SAM9263_BASE_WDT 0xfffffd40 95 - #define AT91SAM9263_BASE_RTT1 0xfffffd50 96 - #define AT91SAM9263_BASE_GPBR 0xfffffd60 97 - 98 - #define AT91_SMC AT91_SMC0 99 - 100 - /* 101 - * Internal Memory. 102 - */ 103 - #define AT91SAM9263_SRAM0_BASE 0x00300000 /* Internal SRAM 0 base address */ 104 - #define AT91SAM9263_SRAM0_SIZE (80 * SZ_1K) /* Internal SRAM 0 size (80Kb) */ 105 - 106 - #define AT91SAM9263_ROM_BASE 0x00400000 /* Internal ROM base address */ 107 - #define AT91SAM9263_ROM_SIZE SZ_128K /* Internal ROM size (128Kb) */ 108 - 109 - #define AT91SAM9263_SRAM1_BASE 0x00500000 /* Internal SRAM 1 base address */ 110 - #define AT91SAM9263_SRAM1_SIZE SZ_16K /* Internal SRAM 1 size (16Kb) */ 111 - 112 - #define AT91SAM9263_LCDC_BASE 0x00700000 /* LCD Controller */ 113 - #define AT91SAM9263_DMAC_BASE 0x00800000 /* DMA Controller */ 114 - #define AT91SAM9263_UHP_BASE 0x00a00000 /* USB Host controller */ 115 - 116 - 117 - #endif
-2
arch/arm/mach-at91/include/mach/at91sam9_smc.h
··· 16 16 #ifndef AT91SAM9_SMC_H 17 17 #define AT91SAM9_SMC_H 18 18 19 - #include <mach/cpu.h> 20 - 21 19 #ifndef __ASSEMBLY__ 22 20 struct sam9_smc_config { 23 21 /* Setup register */
-143
arch/arm/mach-at91/include/mach/at91sam9g45.h
··· 1 - /* 2 - * Chip-specific header file for the AT91SAM9G45 family 3 - * 4 - * Copyright (C) 2008-2009 Atmel Corporation. 5 - * 6 - * Common definitions. 7 - * Based on AT91SAM9G45 preliminary datasheet. 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License as published by 11 - * the Free Software Foundation; either version 2 of the License, or 12 - * (at your option) any later version. 13 - */ 14 - 15 - #ifndef AT91SAM9G45_H 16 - #define AT91SAM9G45_H 17 - 18 - /* 19 - * Peripheral identifiers/interrupts. 20 - */ 21 - #define AT91SAM9G45_ID_PIOA 2 /* Parallel I/O Controller A */ 22 - #define AT91SAM9G45_ID_PIOB 3 /* Parallel I/O Controller B */ 23 - #define AT91SAM9G45_ID_PIOC 4 /* Parallel I/O Controller C */ 24 - #define AT91SAM9G45_ID_PIODE 5 /* Parallel I/O Controller D and E */ 25 - #define AT91SAM9G45_ID_TRNG 6 /* True Random Number Generator */ 26 - #define AT91SAM9G45_ID_US0 7 /* USART 0 */ 27 - #define AT91SAM9G45_ID_US1 8 /* USART 1 */ 28 - #define AT91SAM9G45_ID_US2 9 /* USART 2 */ 29 - #define AT91SAM9G45_ID_US3 10 /* USART 3 */ 30 - #define AT91SAM9G45_ID_MCI0 11 /* High Speed Multimedia Card Interface 0 */ 31 - #define AT91SAM9G45_ID_TWI0 12 /* Two-Wire Interface 0 */ 32 - #define AT91SAM9G45_ID_TWI1 13 /* Two-Wire Interface 1 */ 33 - #define AT91SAM9G45_ID_SPI0 14 /* Serial Peripheral Interface 0 */ 34 - #define AT91SAM9G45_ID_SPI1 15 /* Serial Peripheral Interface 1 */ 35 - #define AT91SAM9G45_ID_SSC0 16 /* Synchronous Serial Controller 0 */ 36 - #define AT91SAM9G45_ID_SSC1 17 /* Synchronous Serial Controller 1 */ 37 - #define AT91SAM9G45_ID_TCB 18 /* Timer Counter 0, 1, 2, 3, 4 and 5 */ 38 - #define AT91SAM9G45_ID_PWMC 19 /* Pulse Width Modulation Controller */ 39 - #define AT91SAM9G45_ID_TSC 20 /* Touch Screen ADC Controller */ 40 - #define AT91SAM9G45_ID_DMA 21 /* DMA Controller */ 41 - #define AT91SAM9G45_ID_UHPHS 22 /* USB Host High Speed */ 42 - #define AT91SAM9G45_ID_LCDC 23 /* LCD Controller */ 43 - #define AT91SAM9G45_ID_AC97C 24 /* AC97 Controller */ 44 - #define AT91SAM9G45_ID_EMAC 25 /* Ethernet MAC */ 45 - #define AT91SAM9G45_ID_ISI 26 /* Image Sensor Interface */ 46 - #define AT91SAM9G45_ID_UDPHS 27 /* USB Device High Speed */ 47 - #define AT91SAM9G45_ID_AESTDESSHA 28 /* AES + T-DES + SHA */ 48 - #define AT91SAM9G45_ID_MCI1 29 /* High Speed Multimedia Card Interface 1 */ 49 - #define AT91SAM9G45_ID_VDEC 30 /* Video Decoder */ 50 - #define AT91SAM9G45_ID_IRQ0 31 /* Advanced Interrupt Controller */ 51 - 52 - /* 53 - * User Peripheral physical base addresses. 54 - */ 55 - #define AT91SAM9G45_BASE_UDPHS 0xfff78000 56 - #define AT91SAM9G45_BASE_TCB0 0xfff7c000 57 - #define AT91SAM9G45_BASE_TC0 0xfff7c000 58 - #define AT91SAM9G45_BASE_TC1 0xfff7c040 59 - #define AT91SAM9G45_BASE_TC2 0xfff7c080 60 - #define AT91SAM9G45_BASE_MCI0 0xfff80000 61 - #define AT91SAM9G45_BASE_TWI0 0xfff84000 62 - #define AT91SAM9G45_BASE_TWI1 0xfff88000 63 - #define AT91SAM9G45_BASE_US0 0xfff8c000 64 - #define AT91SAM9G45_BASE_US1 0xfff90000 65 - #define AT91SAM9G45_BASE_US2 0xfff94000 66 - #define AT91SAM9G45_BASE_US3 0xfff98000 67 - #define AT91SAM9G45_BASE_SSC0 0xfff9c000 68 - #define AT91SAM9G45_BASE_SSC1 0xfffa0000 69 - #define AT91SAM9G45_BASE_SPI0 0xfffa4000 70 - #define AT91SAM9G45_BASE_SPI1 0xfffa8000 71 - #define AT91SAM9G45_BASE_AC97C 0xfffac000 72 - #define AT91SAM9G45_BASE_TSC 0xfffb0000 73 - #define AT91SAM9G45_BASE_ISI 0xfffb4000 74 - #define AT91SAM9G45_BASE_PWMC 0xfffb8000 75 - #define AT91SAM9G45_BASE_EMAC 0xfffbc000 76 - #define AT91SAM9G45_BASE_AES 0xfffc0000 77 - #define AT91SAM9G45_BASE_TDES 0xfffc4000 78 - #define AT91SAM9G45_BASE_SHA 0xfffc8000 79 - #define AT91SAM9G45_BASE_TRNG 0xfffcc000 80 - #define AT91SAM9G45_BASE_MCI1 0xfffd0000 81 - #define AT91SAM9G45_BASE_TCB1 0xfffd4000 82 - #define AT91SAM9G45_BASE_TC3 0xfffd4000 83 - #define AT91SAM9G45_BASE_TC4 0xfffd4040 84 - #define AT91SAM9G45_BASE_TC5 0xfffd4080 85 - 86 - /* 87 - * System Peripherals 88 - */ 89 - #define AT91SAM9G45_BASE_ECC 0xffffe200 90 - #define AT91SAM9G45_BASE_DDRSDRC1 0xffffe400 91 - #define AT91SAM9G45_BASE_DDRSDRC0 0xffffe600 92 - #define AT91SAM9G45_BASE_DMA 0xffffec00 93 - #define AT91SAM9G45_BASE_SMC 0xffffe800 94 - #define AT91SAM9G45_BASE_MATRIX 0xffffea00 95 - #define AT91SAM9G45_BASE_DBGU AT91_BASE_DBGU1 96 - #define AT91SAM9G45_BASE_PIOA 0xfffff200 97 - #define AT91SAM9G45_BASE_PIOB 0xfffff400 98 - #define AT91SAM9G45_BASE_PIOC 0xfffff600 99 - #define AT91SAM9G45_BASE_PIOD 0xfffff800 100 - #define AT91SAM9G45_BASE_PIOE 0xfffffa00 101 - #define AT91SAM9G45_BASE_RSTC 0xfffffd00 102 - #define AT91SAM9G45_BASE_SHDWC 0xfffffd10 103 - #define AT91SAM9G45_BASE_RTT 0xfffffd20 104 - #define AT91SAM9G45_BASE_PIT 0xfffffd30 105 - #define AT91SAM9G45_BASE_WDT 0xfffffd40 106 - #define AT91SAM9G45_BASE_RTC 0xfffffdb0 107 - #define AT91SAM9G45_BASE_GPBR 0xfffffd60 108 - 109 - /* 110 - * Internal Memory. 111 - */ 112 - #define AT91SAM9G45_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 113 - #define AT91SAM9G45_SRAM_SIZE SZ_64K /* Internal SRAM size (64Kb) */ 114 - 115 - #define AT91SAM9G45_ROM_BASE 0x00400000 /* Internal ROM base address */ 116 - #define AT91SAM9G45_ROM_SIZE SZ_64K /* Internal ROM size (64Kb) */ 117 - 118 - #define AT91SAM9G45_LCDC_BASE 0x00500000 /* LCD Controller */ 119 - #define AT91SAM9G45_UDPHS_FIFO 0x00600000 /* USB Device HS controller */ 120 - #define AT91SAM9G45_OHCI_BASE 0x00700000 /* USB Host controller (OHCI) */ 121 - #define AT91SAM9G45_EHCI_BASE 0x00800000 /* USB Host controller (EHCI) */ 122 - #define AT91SAM9G45_VDEC_BASE 0x00900000 /* Video Decoder Controller */ 123 - 124 - /* 125 - * DMA peripheral identifiers 126 - * for hardware handshaking interface 127 - */ 128 - #define AT_DMA_ID_MCI0 0 129 - #define AT_DMA_ID_SPI0_TX 1 130 - #define AT_DMA_ID_SPI0_RX 2 131 - #define AT_DMA_ID_SPI1_TX 3 132 - #define AT_DMA_ID_SPI1_RX 4 133 - #define AT_DMA_ID_SSC0_TX 5 134 - #define AT_DMA_ID_SSC0_RX 6 135 - #define AT_DMA_ID_SSC1_TX 7 136 - #define AT_DMA_ID_SSC1_RX 8 137 - #define AT_DMA_ID_AC97_TX 9 138 - #define AT_DMA_ID_AC97_RX 10 139 - #define AT_DMA_ID_AES_TX 11 140 - #define AT_DMA_ID_AES_RX 12 141 - #define AT_DMA_ID_MCI1 13 142 - 143 - #endif
-65
arch/arm/mach-at91/include/mach/at91sam9n12.h
··· 1 - /* 2 - * SoC specific header file for the AT91SAM9N12 3 - * 4 - * Copyright (C) 2012 Atmel Corporation 5 - * 6 - * Common definitions, based on AT91SAM9N12 SoC datasheet 7 - * 8 - * Licensed under GPLv2 or later 9 - */ 10 - 11 - #ifndef _AT91SAM9N12_H_ 12 - #define _AT91SAM9N12_H_ 13 - 14 - /* 15 - * Peripheral identifiers/interrupts. 16 - */ 17 - #define AT91SAM9N12_ID_PIOAB 2 /* Parallel I/O Controller A and B */ 18 - #define AT91SAM9N12_ID_PIOCD 3 /* Parallel I/O Controller C and D */ 19 - #define AT91SAM9N12_ID_FUSE 4 /* FUSE Controller */ 20 - #define AT91SAM9N12_ID_USART0 5 /* USART 0 */ 21 - #define AT91SAM9N12_ID_USART1 6 /* USART 1 */ 22 - #define AT91SAM9N12_ID_USART2 7 /* USART 2 */ 23 - #define AT91SAM9N12_ID_USART3 8 /* USART 3 */ 24 - #define AT91SAM9N12_ID_TWI0 9 /* Two-Wire Interface 0 */ 25 - #define AT91SAM9N12_ID_TWI1 10 /* Two-Wire Interface 1 */ 26 - #define AT91SAM9N12_ID_MCI 12 /* High Speed Multimedia Card Interface */ 27 - #define AT91SAM9N12_ID_SPI0 13 /* Serial Peripheral Interface 0 */ 28 - #define AT91SAM9N12_ID_SPI1 14 /* Serial Peripheral Interface 1 */ 29 - #define AT91SAM9N12_ID_UART0 15 /* UART 0 */ 30 - #define AT91SAM9N12_ID_UART1 16 /* UART 1 */ 31 - #define AT91SAM9N12_ID_TCB 17 /* Timer Counter 0, 1, 2, 3, 4 and 5 */ 32 - #define AT91SAM9N12_ID_PWM 18 /* Pulse Width Modulation Controller */ 33 - #define AT91SAM9N12_ID_ADC 19 /* ADC Controller */ 34 - #define AT91SAM9N12_ID_DMA 20 /* DMA Controller */ 35 - #define AT91SAM9N12_ID_UHP 22 /* USB Host High Speed */ 36 - #define AT91SAM9N12_ID_UDP 23 /* USB Device High Speed */ 37 - #define AT91SAM9N12_ID_LCDC 25 /* LCD Controller */ 38 - #define AT91SAM9N12_ID_ISI 25 /* Image Sensor Interface */ 39 - #define AT91SAM9N12_ID_SSC 28 /* Synchronous Serial Controller */ 40 - #define AT91SAM9N12_ID_TRNG 30 /* TRNG */ 41 - #define AT91SAM9N12_ID_IRQ0 31 /* Advanced Interrupt Controller */ 42 - 43 - /* 44 - * User Peripheral physical base addresses. 45 - */ 46 - #define AT91SAM9N12_BASE_USART0 0xf801c000 47 - #define AT91SAM9N12_BASE_USART1 0xf8020000 48 - #define AT91SAM9N12_BASE_USART2 0xf8024000 49 - #define AT91SAM9N12_BASE_USART3 0xf8028000 50 - 51 - /* 52 - * System Peripherals 53 - */ 54 - #define AT91SAM9N12_BASE_RTC 0xfffffeb0 55 - 56 - /* 57 - * Internal Memory. 58 - */ 59 - #define AT91SAM9N12_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 60 - #define AT91SAM9N12_SRAM_SIZE SZ_32K /* Internal SRAM size (32Kb) */ 61 - 62 - #define AT91SAM9N12_ROM_BASE 0x00100000 /* Internal ROM base address */ 63 - #define AT91SAM9N12_ROM_SIZE SZ_128K /* Internal ROM size (128Kb) */ 64 - 65 - #endif
-105
arch/arm/mach-at91/include/mach/at91sam9rl.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91sam9260.h 3 - * 4 - * Copyright (C) 2007 Atmel Corporation 5 - * 6 - * Common definitions. 7 - * Based on AT91SAM9RL datasheet revision A. (Preliminary) 8 - * 9 - * This file is subject to the terms and conditions of the GNU General Public 10 - * License. See the file COPYING in the main directory of this archive for 11 - * more details. 12 - */ 13 - 14 - #ifndef AT91SAM9RL_H 15 - #define AT91SAM9RL_H 16 - 17 - /* 18 - * Peripheral identifiers/interrupts. 19 - */ 20 - #define AT91SAM9RL_ID_PIOA 2 /* Parallel IO Controller A */ 21 - #define AT91SAM9RL_ID_PIOB 3 /* Parallel IO Controller B */ 22 - #define AT91SAM9RL_ID_PIOC 4 /* Parallel IO Controller C */ 23 - #define AT91SAM9RL_ID_PIOD 5 /* Parallel IO Controller D */ 24 - #define AT91SAM9RL_ID_US0 6 /* USART 0 */ 25 - #define AT91SAM9RL_ID_US1 7 /* USART 1 */ 26 - #define AT91SAM9RL_ID_US2 8 /* USART 2 */ 27 - #define AT91SAM9RL_ID_US3 9 /* USART 3 */ 28 - #define AT91SAM9RL_ID_MCI 10 /* Multimedia Card Interface */ 29 - #define AT91SAM9RL_ID_TWI0 11 /* TWI 0 */ 30 - #define AT91SAM9RL_ID_TWI1 12 /* TWI 1 */ 31 - #define AT91SAM9RL_ID_SPI 13 /* Serial Peripheral Interface */ 32 - #define AT91SAM9RL_ID_SSC0 14 /* Serial Synchronous Controller 0 */ 33 - #define AT91SAM9RL_ID_SSC1 15 /* Serial Synchronous Controller 1 */ 34 - #define AT91SAM9RL_ID_TC0 16 /* Timer Counter 0 */ 35 - #define AT91SAM9RL_ID_TC1 17 /* Timer Counter 1 */ 36 - #define AT91SAM9RL_ID_TC2 18 /* Timer Counter 2 */ 37 - #define AT91SAM9RL_ID_PWMC 19 /* Pulse Width Modulation Controller */ 38 - #define AT91SAM9RL_ID_TSC 20 /* Touch Screen Controller */ 39 - #define AT91SAM9RL_ID_DMA 21 /* DMA Controller */ 40 - #define AT91SAM9RL_ID_UDPHS 22 /* USB Device HS */ 41 - #define AT91SAM9RL_ID_LCDC 23 /* LCD Controller */ 42 - #define AT91SAM9RL_ID_AC97C 24 /* AC97 Controller */ 43 - #define AT91SAM9RL_ID_IRQ0 31 /* Advanced Interrupt Controller (IRQ0) */ 44 - 45 - 46 - /* 47 - * User Peripheral physical base addresses. 48 - */ 49 - #define AT91SAM9RL_BASE_TCB0 0xfffa0000 50 - #define AT91SAM9RL_BASE_TC0 0xfffa0000 51 - #define AT91SAM9RL_BASE_TC1 0xfffa0040 52 - #define AT91SAM9RL_BASE_TC2 0xfffa0080 53 - #define AT91SAM9RL_BASE_MCI 0xfffa4000 54 - #define AT91SAM9RL_BASE_TWI0 0xfffa8000 55 - #define AT91SAM9RL_BASE_TWI1 0xfffac000 56 - #define AT91SAM9RL_BASE_US0 0xfffb0000 57 - #define AT91SAM9RL_BASE_US1 0xfffb4000 58 - #define AT91SAM9RL_BASE_US2 0xfffb8000 59 - #define AT91SAM9RL_BASE_US3 0xfffbc000 60 - #define AT91SAM9RL_BASE_SSC0 0xfffc0000 61 - #define AT91SAM9RL_BASE_SSC1 0xfffc4000 62 - #define AT91SAM9RL_BASE_PWMC 0xfffc8000 63 - #define AT91SAM9RL_BASE_SPI 0xfffcc000 64 - #define AT91SAM9RL_BASE_TSC 0xfffd0000 65 - #define AT91SAM9RL_BASE_UDPHS 0xfffd4000 66 - #define AT91SAM9RL_BASE_AC97C 0xfffd8000 67 - 68 - 69 - /* 70 - * System Peripherals (offset from AT91_BASE_SYS) 71 - */ 72 - #define AT91_SCKCR (0xfffffd50 - AT91_BASE_SYS) 73 - 74 - #define AT91SAM9RL_BASE_DMA 0xffffe600 75 - #define AT91SAM9RL_BASE_ECC 0xffffe800 76 - #define AT91SAM9RL_BASE_SDRAMC 0xffffea00 77 - #define AT91SAM9RL_BASE_SMC 0xffffec00 78 - #define AT91SAM9RL_BASE_MATRIX 0xffffee00 79 - #define AT91SAM9RL_BASE_DBGU AT91_BASE_DBGU0 80 - #define AT91SAM9RL_BASE_PIOA 0xfffff400 81 - #define AT91SAM9RL_BASE_PIOB 0xfffff600 82 - #define AT91SAM9RL_BASE_PIOC 0xfffff800 83 - #define AT91SAM9RL_BASE_PIOD 0xfffffa00 84 - #define AT91SAM9RL_BASE_RSTC 0xfffffd00 85 - #define AT91SAM9RL_BASE_SHDWC 0xfffffd10 86 - #define AT91SAM9RL_BASE_RTT 0xfffffd20 87 - #define AT91SAM9RL_BASE_PIT 0xfffffd30 88 - #define AT91SAM9RL_BASE_WDT 0xfffffd40 89 - #define AT91SAM9RL_BASE_GPBR 0xfffffd60 90 - #define AT91SAM9RL_BASE_RTC 0xfffffe00 91 - 92 - 93 - /* 94 - * Internal Memory. 95 - */ 96 - #define AT91SAM9RL_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 97 - #define AT91SAM9RL_SRAM_SIZE SZ_16K /* Internal SRAM size (16Kb) */ 98 - 99 - #define AT91SAM9RL_ROM_BASE 0x00400000 /* Internal ROM base address */ 100 - #define AT91SAM9RL_ROM_SIZE (2 * SZ_16K) /* Internal ROM size (32Kb) */ 101 - 102 - #define AT91SAM9RL_LCDC_BASE 0x00500000 /* LCD Controller */ 103 - #define AT91SAM9RL_UDPHS_FIFO 0x00600000 /* USB Device HS controller */ 104 - 105 - #endif
-71
arch/arm/mach-at91/include/mach/at91sam9x5.h
··· 1 - /* 2 - * Chip-specific header file for the AT91SAM9x5 family 3 - * 4 - * Copyright (C) 2009-2012 Atmel Corporation. 5 - * 6 - * Common definitions. 7 - * Based on AT91SAM9x5 datasheet. 8 - * 9 - * Licensed under GPLv2 or later. 10 - */ 11 - 12 - #ifndef AT91SAM9X5_H 13 - #define AT91SAM9X5_H 14 - 15 - /* 16 - * Peripheral identifiers/interrupts. 17 - */ 18 - #define AT91SAM9X5_ID_PIOAB 2 /* Parallel I/O Controller A and B */ 19 - #define AT91SAM9X5_ID_PIOCD 3 /* Parallel I/O Controller C and D */ 20 - #define AT91SAM9X5_ID_SMD 4 /* SMD Soft Modem (SMD) */ 21 - #define AT91SAM9X5_ID_USART0 5 /* USART 0 */ 22 - #define AT91SAM9X5_ID_USART1 6 /* USART 1 */ 23 - #define AT91SAM9X5_ID_USART2 7 /* USART 2 */ 24 - #define AT91SAM9X5_ID_USART3 8 /* USART 3 */ 25 - #define AT91SAM9X5_ID_TWI0 9 /* Two-Wire Interface 0 */ 26 - #define AT91SAM9X5_ID_TWI1 10 /* Two-Wire Interface 1 */ 27 - #define AT91SAM9X5_ID_TWI2 11 /* Two-Wire Interface 2 */ 28 - #define AT91SAM9X5_ID_MCI0 12 /* High Speed Multimedia Card Interface 0 */ 29 - #define AT91SAM9X5_ID_SPI0 13 /* Serial Peripheral Interface 0 */ 30 - #define AT91SAM9X5_ID_SPI1 14 /* Serial Peripheral Interface 1 */ 31 - #define AT91SAM9X5_ID_UART0 15 /* UART 0 */ 32 - #define AT91SAM9X5_ID_UART1 16 /* UART 1 */ 33 - #define AT91SAM9X5_ID_TCB 17 /* Timer Counter 0, 1, 2, 3, 4 and 5 */ 34 - #define AT91SAM9X5_ID_PWM 18 /* Pulse Width Modulation Controller */ 35 - #define AT91SAM9X5_ID_ADC 19 /* ADC Controller */ 36 - #define AT91SAM9X5_ID_DMA0 20 /* DMA Controller 0 */ 37 - #define AT91SAM9X5_ID_DMA1 21 /* DMA Controller 1 */ 38 - #define AT91SAM9X5_ID_UHPHS 22 /* USB Host High Speed */ 39 - #define AT91SAM9X5_ID_UDPHS 23 /* USB Device High Speed */ 40 - #define AT91SAM9X5_ID_EMAC0 24 /* Ethernet MAC0 */ 41 - #define AT91SAM9X5_ID_LCDC 25 /* LCD Controller */ 42 - #define AT91SAM9X5_ID_ISI 25 /* Image Sensor Interface */ 43 - #define AT91SAM9X5_ID_MCI1 26 /* High Speed Multimedia Card Interface 1 */ 44 - #define AT91SAM9X5_ID_EMAC1 27 /* Ethernet MAC1 */ 45 - #define AT91SAM9X5_ID_SSC 28 /* Synchronous Serial Controller */ 46 - #define AT91SAM9X5_ID_CAN0 29 /* CAN Controller 0 */ 47 - #define AT91SAM9X5_ID_CAN1 30 /* CAN Controller 1 */ 48 - #define AT91SAM9X5_ID_IRQ0 31 /* Advanced Interrupt Controller */ 49 - 50 - /* 51 - * User Peripheral physical base addresses. 52 - */ 53 - #define AT91SAM9X5_BASE_USART0 0xf801c000 54 - #define AT91SAM9X5_BASE_USART1 0xf8020000 55 - #define AT91SAM9X5_BASE_USART2 0xf8024000 56 - 57 - /* 58 - * System Peripherals 59 - */ 60 - #define AT91SAM9X5_BASE_RTC 0xfffffeb0 61 - 62 - /* 63 - * Internal Memory. 64 - */ 65 - #define AT91SAM9X5_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 66 - #define AT91SAM9X5_SRAM_SIZE SZ_32K /* Internal SRAM size (32Kb) */ 67 - 68 - #define AT91SAM9X5_ROM_BASE 0x00400000 /* Internal ROM base address */ 69 - #define AT91SAM9X5_ROM_SIZE SZ_64K /* Internal ROM size (64Kb) */ 70 - 71 - #endif
-216
arch/arm/mach-at91/include/mach/cpu.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/cpu.h 3 - * 4 - * Copyright (C) 2006 SAN People 5 - * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.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; either version 2 of the License, or 10 - * (at your option) any later version. 11 - * 12 - */ 13 - 14 - #ifndef __MACH_CPU_H__ 15 - #define __MACH_CPU_H__ 16 - 17 - #define ARCH_ID_AT91RM9200 0x09290780 18 - #define ARCH_ID_AT91SAM9260 0x019803a0 19 - #define ARCH_ID_AT91SAM9261 0x019703a0 20 - #define ARCH_ID_AT91SAM9263 0x019607a0 21 - #define ARCH_ID_AT91SAM9G10 0x019903a0 22 - #define ARCH_ID_AT91SAM9G20 0x019905a0 23 - #define ARCH_ID_AT91SAM9RL64 0x019b03a0 24 - #define ARCH_ID_AT91SAM9G45 0x819b05a0 25 - #define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */ 26 - #define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */ 27 - #define ARCH_ID_AT91SAM9X5 0x819a05a0 28 - #define ARCH_ID_AT91SAM9N12 0x819a07a0 29 - 30 - #define ARCH_ID_AT91SAM9XE128 0x329973a0 31 - #define ARCH_ID_AT91SAM9XE256 0x329a93a0 32 - #define ARCH_ID_AT91SAM9XE512 0x329aa3a0 33 - 34 - #define ARCH_ID_AT91M40800 0x14080044 35 - #define ARCH_ID_AT91R40807 0x44080746 36 - #define ARCH_ID_AT91M40807 0x14080745 37 - #define ARCH_ID_AT91R40008 0x44000840 38 - 39 - #define ARCH_ID_SAMA5 0x8A5C07C0 40 - 41 - #define ARCH_EXID_AT91SAM9M11 0x00000001 42 - #define ARCH_EXID_AT91SAM9M10 0x00000002 43 - #define ARCH_EXID_AT91SAM9G46 0x00000003 44 - #define ARCH_EXID_AT91SAM9G45 0x00000004 45 - 46 - #define ARCH_EXID_AT91SAM9G15 0x00000000 47 - #define ARCH_EXID_AT91SAM9G35 0x00000001 48 - #define ARCH_EXID_AT91SAM9X35 0x00000002 49 - #define ARCH_EXID_AT91SAM9G25 0x00000003 50 - #define ARCH_EXID_AT91SAM9X25 0x00000004 51 - 52 - #define ARCH_EXID_SAMA5D3 0x00004300 53 - #define ARCH_EXID_SAMA5D31 0x00444300 54 - #define ARCH_EXID_SAMA5D33 0x00414300 55 - #define ARCH_EXID_SAMA5D34 0x00414301 56 - #define ARCH_EXID_SAMA5D35 0x00584300 57 - #define ARCH_EXID_SAMA5D36 0x00004301 58 - 59 - #define ARCH_EXID_SAMA5D4 0x00000007 60 - #define ARCH_EXID_SAMA5D41 0x00000001 61 - #define ARCH_EXID_SAMA5D42 0x00000002 62 - #define ARCH_EXID_SAMA5D43 0x00000003 63 - #define ARCH_EXID_SAMA5D44 0x00000004 64 - 65 - #define ARCH_FAMILY_AT91SAM9 0x01900000 66 - #define ARCH_FAMILY_AT91SAM9XE 0x02900000 67 - 68 - /* RM9200 type */ 69 - #define ARCH_REVISON_9200_BGA (0 << 0) 70 - #define ARCH_REVISON_9200_PQFP (1 << 0) 71 - 72 - #ifndef __ASSEMBLY__ 73 - enum at91_soc_type { 74 - /* 920T */ 75 - AT91_SOC_RM9200, 76 - 77 - /* SAM92xx */ 78 - AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263, 79 - 80 - /* SAM9Gxx */ 81 - AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45, 82 - 83 - /* SAM9RL */ 84 - AT91_SOC_SAM9RL, 85 - 86 - /* SAM9X5 */ 87 - AT91_SOC_SAM9X5, 88 - 89 - /* SAM9N12 */ 90 - AT91_SOC_SAM9N12, 91 - 92 - /* SAMA5D3 */ 93 - AT91_SOC_SAMA5D3, 94 - 95 - /* SAMA5D4 */ 96 - AT91_SOC_SAMA5D4, 97 - 98 - /* Unknown type */ 99 - AT91_SOC_UNKNOWN, 100 - }; 101 - 102 - enum at91_soc_subtype { 103 - /* RM9200 */ 104 - AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP, 105 - 106 - /* SAM9260 */ 107 - AT91_SOC_SAM9XE, 108 - 109 - /* SAM9G45 */ 110 - AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11, 111 - 112 - /* SAM9X5 */ 113 - AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35, 114 - AT91_SOC_SAM9G25, AT91_SOC_SAM9X25, 115 - 116 - /* SAMA5D3 */ 117 - AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34, 118 - AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D36, 119 - 120 - /* SAMA5D4 */ 121 - AT91_SOC_SAMA5D41, AT91_SOC_SAMA5D42, AT91_SOC_SAMA5D43, 122 - AT91_SOC_SAMA5D44, 123 - 124 - /* No subtype for this SoC */ 125 - AT91_SOC_SUBTYPE_NONE, 126 - 127 - /* Unknown subtype */ 128 - AT91_SOC_SUBTYPE_UNKNOWN, 129 - }; 130 - 131 - struct at91_socinfo { 132 - unsigned int type, subtype; 133 - unsigned int cidr, exid; 134 - }; 135 - 136 - extern struct at91_socinfo at91_soc_initdata; 137 - const char *at91_get_soc_type(struct at91_socinfo *c); 138 - const char *at91_get_soc_subtype(struct at91_socinfo *c); 139 - 140 - static inline int at91_soc_is_detected(void) 141 - { 142 - return at91_soc_initdata.type != AT91_SOC_UNKNOWN; 143 - } 144 - 145 - #ifdef CONFIG_SOC_AT91RM9200 146 - #define cpu_is_at91rm9200() (at91_soc_initdata.type == AT91_SOC_RM9200) 147 - #define cpu_is_at91rm9200_bga() (at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA) 148 - #define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP) 149 - #else 150 - #define cpu_is_at91rm9200() (0) 151 - #define cpu_is_at91rm9200_bga() (0) 152 - #define cpu_is_at91rm9200_pqfp() (0) 153 - #endif 154 - 155 - #ifdef CONFIG_SOC_AT91SAM9 156 - #define cpu_is_at91sam9xe() (at91_soc_initdata.subtype == AT91_SOC_SAM9XE) 157 - #define cpu_is_at91sam9260() (at91_soc_initdata.type == AT91_SOC_SAM9260) 158 - #define cpu_is_at91sam9g20() (at91_soc_initdata.type == AT91_SOC_SAM9G20) 159 - #define cpu_is_at91sam9261() (at91_soc_initdata.type == AT91_SOC_SAM9261) 160 - #define cpu_is_at91sam9g10() (at91_soc_initdata.type == AT91_SOC_SAM9G10) 161 - #define cpu_is_at91sam9263() (at91_soc_initdata.type == AT91_SOC_SAM9263) 162 - #define cpu_is_at91sam9rl() (at91_soc_initdata.type == AT91_SOC_SAM9RL) 163 - #define cpu_is_at91sam9g45() (at91_soc_initdata.type == AT91_SOC_SAM9G45) 164 - #define cpu_is_at91sam9g45es() (at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES) 165 - #define cpu_is_at91sam9m10() (at91_soc_initdata.subtype == AT91_SOC_SAM9M10) 166 - #define cpu_is_at91sam9g46() (at91_soc_initdata.subtype == AT91_SOC_SAM9G46) 167 - #define cpu_is_at91sam9m11() (at91_soc_initdata.subtype == AT91_SOC_SAM9M11) 168 - #define cpu_is_at91sam9x5() (at91_soc_initdata.type == AT91_SOC_SAM9X5) 169 - #define cpu_is_at91sam9g15() (at91_soc_initdata.subtype == AT91_SOC_SAM9G15) 170 - #define cpu_is_at91sam9g35() (at91_soc_initdata.subtype == AT91_SOC_SAM9G35) 171 - #define cpu_is_at91sam9x35() (at91_soc_initdata.subtype == AT91_SOC_SAM9X35) 172 - #define cpu_is_at91sam9g25() (at91_soc_initdata.subtype == AT91_SOC_SAM9G25) 173 - #define cpu_is_at91sam9x25() (at91_soc_initdata.subtype == AT91_SOC_SAM9X25) 174 - #define cpu_is_at91sam9n12() (at91_soc_initdata.type == AT91_SOC_SAM9N12) 175 - #else 176 - #define cpu_is_at91sam9xe() (0) 177 - #define cpu_is_at91sam9260() (0) 178 - #define cpu_is_at91sam9g20() (0) 179 - #define cpu_is_at91sam9261() (0) 180 - #define cpu_is_at91sam9g10() (0) 181 - #define cpu_is_at91sam9263() (0) 182 - #define cpu_is_at91sam9rl() (0) 183 - #define cpu_is_at91sam9g45() (0) 184 - #define cpu_is_at91sam9g45es() (0) 185 - #define cpu_is_at91sam9m10() (0) 186 - #define cpu_is_at91sam9g46() (0) 187 - #define cpu_is_at91sam9m11() (0) 188 - #define cpu_is_at91sam9x5() (0) 189 - #define cpu_is_at91sam9g15() (0) 190 - #define cpu_is_at91sam9g35() (0) 191 - #define cpu_is_at91sam9x35() (0) 192 - #define cpu_is_at91sam9g25() (0) 193 - #define cpu_is_at91sam9x25() (0) 194 - #define cpu_is_at91sam9n12() (0) 195 - #endif 196 - 197 - #ifdef CONFIG_SOC_SAMA5D3 198 - #define cpu_is_sama5d3() (at91_soc_initdata.type == AT91_SOC_SAMA5D3) 199 - #else 200 - #define cpu_is_sama5d3() (0) 201 - #endif 202 - 203 - #ifdef CONFIG_SOC_SAMA5D4 204 - #define cpu_is_sama5d4() (at91_soc_initdata.type == AT91_SOC_SAMA5D4) 205 - #else 206 - #define cpu_is_sama5d4() (0) 207 - #endif 208 - 209 - /* 210 - * Since this is ARM, we will never run on any AVR32 CPU. But these 211 - * definitions may reduce clutter in common drivers. 212 - */ 213 - #define cpu_is_at32ap7000() (0) 214 - #endif /* __ASSEMBLY__ */ 215 - 216 - #endif /* __MACH_CPU_H__ */
-134
arch/arm/mach-at91/include/mach/hardware.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/hardware.h 3 - * 4 - * Copyright (C) 2003 SAN People 5 - * Copyright (C) 2003 ATMEL 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; either version 2 of the License, or 10 - * (at your option) any later version. 11 - * 12 - */ 13 - 14 - #ifndef __ASM_ARCH_HARDWARE_H 15 - #define __ASM_ARCH_HARDWARE_H 16 - 17 - #include <asm/sizes.h> 18 - 19 - /* DBGU base */ 20 - /* rm9200, 9260/9g20, 9261/9g10, 9rl */ 21 - #define AT91_BASE_DBGU0 0xfffff200 22 - /* 9263, 9g45, sama5d3 */ 23 - #define AT91_BASE_DBGU1 0xffffee00 24 - /* sama5d4 */ 25 - #define AT91_BASE_DBGU2 0xfc069000 26 - 27 - #include <mach/at91rm9200.h> 28 - #include <mach/at91sam9260.h> 29 - #include <mach/at91sam9261.h> 30 - #include <mach/at91sam9263.h> 31 - #include <mach/at91sam9rl.h> 32 - #include <mach/at91sam9g45.h> 33 - #include <mach/at91sam9x5.h> 34 - #include <mach/at91sam9n12.h> 35 - #include <mach/sama5d3.h> 36 - #include <mach/sama5d4.h> 37 - 38 - /* 39 - * On all at91 except rm9200 and x40 have the System Controller starts 40 - * at address 0xffffc000 and has a size of 16KiB. 41 - * 42 - * On rm9200 it's start at 0xfffe4000 of 111KiB with non reserved data starting 43 - * at 0xfffff000 44 - * 45 - * Removes the individual definitions of AT91_BASE_SYS and 46 - * replaces them with a common version at base 0xfffffc000 and size 16KiB 47 - * and map the same memory space 48 - */ 49 - #define AT91_BASE_SYS 0xffffc000 50 - 51 - /* 52 - * On sama5d4 there is no system controller, we map some needed peripherals 53 - */ 54 - #define AT91_ALT_BASE_SYS 0xfc069000 55 - 56 - /* 57 - * On all at91 have the Advanced Interrupt Controller starts at address 58 - * 0xfffff000 and the Power Management Controller starts at 0xfffffc00 59 - */ 60 - #define AT91_AIC 0xfffff000 61 - #define AT91_PMC 0xfffffc00 62 - 63 - /* 64 - * Peripheral identifiers/interrupts. 65 - */ 66 - #define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */ 67 - #define AT91_ID_SYS 1 /* System Peripherals */ 68 - 69 - #ifdef CONFIG_MMU 70 - /* 71 - * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF 72 - * to 0xFEF78000 .. 0xFF000000. (544Kb) 73 - */ 74 - #define AT91_IO_PHYS_BASE 0xFFF78000 75 - #define AT91_IO_VIRT_BASE IOMEM(0xFF000000 - AT91_IO_SIZE) 76 - 77 - /* 78 - * On sama5d4, remap the peripherals from address 0xFC069000 .. 0xFC06F000 79 - * to 0xFB069000 .. 0xFB06F000. (24Kb) 80 - */ 81 - #define AT91_ALT_IO_PHYS_BASE AT91_ALT_BASE_SYS 82 - #define AT91_ALT_IO_VIRT_BASE IOMEM(0xFB069000) 83 - #else 84 - /* 85 - * Identity mapping for the non MMU case. 86 - */ 87 - #define AT91_IO_PHYS_BASE AT91_BASE_SYS 88 - #define AT91_IO_VIRT_BASE IOMEM(AT91_IO_PHYS_BASE) 89 - 90 - #define AT91_ALT_IO_PHYS_BASE AT91_ALT_BASE_SYS 91 - #define AT91_ALT_IO_VIRT_BASE IOMEM(AT91_ALT_BASE_SYS) 92 - #endif 93 - 94 - #define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) 95 - 96 - /* Convert a physical IO address to virtual IO address */ 97 - #define AT91_IO_P2V(x) ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE) 98 - #define AT91_ALT_IO_P2V(x) ((x) - AT91_ALT_IO_PHYS_BASE + AT91_ALT_IO_VIRT_BASE) 99 - 100 - /* 101 - * Virtual to Physical Address mapping for IO devices. 102 - */ 103 - #define AT91_VA_BASE_SYS AT91_IO_P2V(AT91_BASE_SYS) 104 - #define AT91_ALT_VA_BASE_SYS AT91_ALT_IO_P2V(AT91_ALT_BASE_SYS) 105 - 106 - /* Internal SRAM is mapped below the IO devices */ 107 - #define AT91_SRAM_MAX SZ_1M 108 - #define AT91_VIRT_BASE (AT91_IO_VIRT_BASE - AT91_SRAM_MAX) 109 - 110 - /* External Memory Map */ 111 - #define AT91_CHIPSELECT_0 0x10000000 112 - #define AT91_CHIPSELECT_1 0x20000000 113 - #define AT91_CHIPSELECT_2 0x30000000 114 - #define AT91_CHIPSELECT_3 0x40000000 115 - #define AT91_CHIPSELECT_4 0x50000000 116 - #define AT91_CHIPSELECT_5 0x60000000 117 - #define AT91_CHIPSELECT_6 0x70000000 118 - #define AT91_CHIPSELECT_7 0x80000000 119 - 120 - /* Clocks */ 121 - #define AT91_SLOW_CLOCK 32768 /* slow clock */ 122 - 123 - /* 124 - * FIXME: this is needed to communicate between the pinctrl driver and 125 - * the PM implementation in the machine. Possibly part of the PM 126 - * implementation should be moved down into the pinctrl driver and get 127 - * called as part of the generic suspend/resume path. 128 - */ 129 - #ifndef __ASSEMBLY__ 130 - extern void at91_pinctrl_gpio_suspend(void); 131 - extern void at91_pinctrl_gpio_resume(void); 132 - #endif 133 - 134 - #endif
-86
arch/arm/mach-at91/include/mach/sama5d3.h
··· 1 - /* 2 - * Chip-specific header file for the SAMA5D3 family 3 - * 4 - * Copyright (C) 2013 Atmel, 5 - * 2013 Ludovic Desroches <ludovic.desroches@atmel.com> 6 - * 7 - * Common definitions. 8 - * Based on SAMA5D3 datasheet. 9 - * 10 - * Licensed under GPLv2 or later. 11 - */ 12 - 13 - #ifndef SAMA5D3_H 14 - #define SAMA5D3_H 15 - 16 - /* 17 - * Peripheral identifiers/interrupts. 18 - */ 19 - #define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */ 20 - #define AT91_ID_SYS 1 /* System Peripherals */ 21 - #define SAMA5D3_ID_DBGU 2 /* debug Unit (usually no special interrupt line) */ 22 - #define AT91_ID_PIT 3 /* PIT */ 23 - #define SAMA5D3_ID_WDT 4 /* Watchdog Timer Interrupt */ 24 - #define SAMA5D3_ID_HSMC 5 /* Static Memory Controller */ 25 - #define SAMA5D3_ID_PIOA 6 /* PIOA */ 26 - #define SAMA5D3_ID_PIOB 7 /* PIOB */ 27 - #define SAMA5D3_ID_PIOC 8 /* PIOC */ 28 - #define SAMA5D3_ID_PIOD 9 /* PIOD */ 29 - #define SAMA5D3_ID_PIOE 10 /* PIOE */ 30 - #define SAMA5D3_ID_SMD 11 /* SMD Soft Modem */ 31 - #define SAMA5D3_ID_USART0 12 /* USART0 */ 32 - #define SAMA5D3_ID_USART1 13 /* USART1 */ 33 - #define SAMA5D3_ID_USART2 14 /* USART2 */ 34 - #define SAMA5D3_ID_USART3 15 /* USART3 */ 35 - #define SAMA5D3_ID_UART0 16 /* UART 0 */ 36 - #define SAMA5D3_ID_UART1 17 /* UART 1 */ 37 - #define SAMA5D3_ID_TWI0 18 /* Two-Wire Interface 0 */ 38 - #define SAMA5D3_ID_TWI1 19 /* Two-Wire Interface 1 */ 39 - #define SAMA5D3_ID_TWI2 20 /* Two-Wire Interface 2 */ 40 - #define SAMA5D3_ID_HSMCI0 21 /* MCI */ 41 - #define SAMA5D3_ID_HSMCI1 22 /* MCI */ 42 - #define SAMA5D3_ID_HSMCI2 23 /* MCI */ 43 - #define SAMA5D3_ID_SPI0 24 /* Serial Peripheral Interface 0 */ 44 - #define SAMA5D3_ID_SPI1 25 /* Serial Peripheral Interface 1 */ 45 - #define SAMA5D3_ID_TC0 26 /* Timer Counter 0 */ 46 - #define SAMA5D3_ID_TC1 27 /* Timer Counter 2 */ 47 - #define SAMA5D3_ID_PWM 28 /* Pulse Width Modulation Controller */ 48 - #define SAMA5D3_ID_ADC 29 /* Touch Screen ADC Controller */ 49 - #define SAMA5D3_ID_DMA0 30 /* DMA Controller 0 */ 50 - #define SAMA5D3_ID_DMA1 31 /* DMA Controller 1 */ 51 - #define SAMA5D3_ID_UHPHS 32 /* USB Host High Speed */ 52 - #define SAMA5D3_ID_UDPHS 33 /* USB Device High Speed */ 53 - #define SAMA5D3_ID_GMAC 34 /* Gigabit Ethernet MAC */ 54 - #define SAMA5D3_ID_EMAC 35 /* Ethernet MAC */ 55 - #define SAMA5D3_ID_LCDC 36 /* LCD Controller */ 56 - #define SAMA5D3_ID_ISI 37 /* Image Sensor Interface */ 57 - #define SAMA5D3_ID_SSC0 38 /* Synchronous Serial Controller 0 */ 58 - #define SAMA5D3_ID_SSC1 39 /* Synchronous Serial Controller 1 */ 59 - #define SAMA5D3_ID_CAN0 40 /* CAN Controller 0 */ 60 - #define SAMA5D3_ID_CAN1 41 /* CAN Controller 1 */ 61 - #define SAMA5D3_ID_SHA 42 /* Secure Hash Algorithm */ 62 - #define SAMA5D3_ID_AES 43 /* Advanced Encryption Standard */ 63 - #define SAMA5D3_ID_TDES 44 /* Triple Data Encryption Standard */ 64 - #define SAMA5D3_ID_TRNG 45 /* True Random Generator Number */ 65 - #define SAMA5D3_ID_IRQ0 47 /* Advanced Interrupt Controller (IRQ0) */ 66 - 67 - /* 68 - * User Peripheral physical base addresses. 69 - */ 70 - #define SAMA5D3_BASE_USART0 0xf001c000 71 - #define SAMA5D3_BASE_USART1 0xf0020000 72 - #define SAMA5D3_BASE_USART2 0xf8020000 73 - #define SAMA5D3_BASE_USART3 0xf8024000 74 - 75 - /* 76 - * System Peripherals 77 - */ 78 - #define SAMA5D3_BASE_RTC 0xfffffeb0 79 - 80 - /* 81 - * Internal Memory 82 - */ 83 - #define SAMA5D3_SRAM_BASE 0x00300000 /* Internal SRAM base address */ 84 - #define SAMA5D3_SRAM_SIZE (128 * SZ_1K) /* Internal SRAM size (128Kb) */ 85 - 86 - #endif
-33
arch/arm/mach-at91/include/mach/sama5d4.h
··· 1 - /* 2 - * Chip-specific header file for the SAMA5D4 family 3 - * 4 - * Copyright (C) 2013 Atmel Corporation, 5 - * Nicolas Ferre <nicolas.ferre@atmel.com> 6 - * 7 - * Common definitions. 8 - * Based on SAMA5D4 datasheet. 9 - * 10 - * Licensed under GPLv2 or later. 11 - */ 12 - 13 - #ifndef SAMA5D4_H 14 - #define SAMA5D4_H 15 - 16 - /* 17 - * User Peripheral physical base addresses. 18 - */ 19 - #define SAMA5D4_BASE_USART3 0xfc00c000 /* (USART3 non-secure) Base Address */ 20 - #define SAMA5D4_BASE_PMC 0xf0018000 /* (PMC) Base Address */ 21 - #define SAMA5D4_BASE_MPDDRC 0xf0010000 /* (MPDDRC) Base Address */ 22 - #define SAMA5D4_BASE_PIOD 0xfc068000 /* (PIOD) Base Address */ 23 - 24 - /* Some other peripherals */ 25 - #define SAMA5D4_BASE_SYS2 SAMA5D4_BASE_PIOD 26 - 27 - /* 28 - * Internal Memory. 29 - */ 30 - #define SAMA5D4_NS_SRAM_BASE 0x00210000 /* Internal SRAM base address Non-Secure */ 31 - #define SAMA5D4_NS_SRAM_SIZE (64 * SZ_1K) /* Internal SRAM size Non-Secure part (64Kb) */ 32 - 33 - #endif
-218
arch/arm/mach-at91/include/mach/uncompress.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/uncompress.h 3 - * 4 - * Copyright (C) 2003 SAN People 5 - * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.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; either version 2 of the License, or 10 - * (at your option) any later version. 11 - * 12 - * This program is distributed in the hope that it will be useful, 13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 - * GNU General Public License for more details. 16 - * 17 - * You should have received a copy of the GNU General Public License 18 - * along with this program; if not, write to the Free Software 19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 - */ 21 - 22 - #ifndef __ASM_ARCH_UNCOMPRESS_H 23 - #define __ASM_ARCH_UNCOMPRESS_H 24 - 25 - #include <linux/io.h> 26 - #include <linux/atmel_serial.h> 27 - #include <mach/hardware.h> 28 - 29 - #include <mach/at91_dbgu.h> 30 - #include <mach/cpu.h> 31 - 32 - void __iomem *at91_uart; 33 - 34 - static const u32 uarts_rm9200[] = { 35 - AT91_BASE_DBGU0, 36 - AT91RM9200_BASE_US0, 37 - AT91RM9200_BASE_US1, 38 - AT91RM9200_BASE_US2, 39 - AT91RM9200_BASE_US3, 40 - 0, 41 - }; 42 - 43 - static const u32 uarts_sam9260[] = { 44 - AT91_BASE_DBGU0, 45 - AT91SAM9260_BASE_US0, 46 - AT91SAM9260_BASE_US1, 47 - AT91SAM9260_BASE_US2, 48 - AT91SAM9260_BASE_US3, 49 - AT91SAM9260_BASE_US4, 50 - AT91SAM9260_BASE_US5, 51 - 0, 52 - }; 53 - 54 - static const u32 uarts_sam9261[] = { 55 - AT91_BASE_DBGU0, 56 - AT91SAM9261_BASE_US0, 57 - AT91SAM9261_BASE_US1, 58 - AT91SAM9261_BASE_US2, 59 - 0, 60 - }; 61 - 62 - static const u32 uarts_sam9263[] = { 63 - AT91_BASE_DBGU1, 64 - AT91SAM9263_BASE_US0, 65 - AT91SAM9263_BASE_US1, 66 - AT91SAM9263_BASE_US2, 67 - 0, 68 - }; 69 - 70 - static const u32 uarts_sam9g45[] = { 71 - AT91_BASE_DBGU1, 72 - AT91SAM9G45_BASE_US0, 73 - AT91SAM9G45_BASE_US1, 74 - AT91SAM9G45_BASE_US2, 75 - AT91SAM9G45_BASE_US3, 76 - 0, 77 - }; 78 - 79 - static const u32 uarts_sam9rl[] = { 80 - AT91_BASE_DBGU0, 81 - AT91SAM9RL_BASE_US0, 82 - AT91SAM9RL_BASE_US1, 83 - AT91SAM9RL_BASE_US2, 84 - AT91SAM9RL_BASE_US3, 85 - 0, 86 - }; 87 - 88 - static const u32 uarts_sam9x5[] = { 89 - AT91_BASE_DBGU0, 90 - AT91SAM9X5_BASE_USART0, 91 - AT91SAM9X5_BASE_USART1, 92 - AT91SAM9X5_BASE_USART2, 93 - 0, 94 - }; 95 - 96 - static const u32 uarts_sama5d3[] = { 97 - AT91_BASE_DBGU1, 98 - SAMA5D3_BASE_USART0, 99 - SAMA5D3_BASE_USART1, 100 - SAMA5D3_BASE_USART2, 101 - SAMA5D3_BASE_USART3, 102 - 0, 103 - }; 104 - 105 - static const u32 uarts_sama5d4[] = { 106 - AT91_BASE_DBGU2, 107 - SAMA5D4_BASE_USART3, 108 - 0, 109 - }; 110 - 111 - static inline const u32* decomp_soc_detect(void __iomem *dbgu_base) 112 - { 113 - u32 cidr, socid; 114 - 115 - cidr = __raw_readl(dbgu_base + AT91_DBGU_CIDR); 116 - socid = cidr & ~AT91_CIDR_VERSION; 117 - 118 - switch (socid) { 119 - case ARCH_ID_AT91RM9200: 120 - return uarts_rm9200; 121 - 122 - case ARCH_ID_AT91SAM9G20: 123 - case ARCH_ID_AT91SAM9260: 124 - return uarts_sam9260; 125 - 126 - case ARCH_ID_AT91SAM9261: 127 - return uarts_sam9261; 128 - 129 - case ARCH_ID_AT91SAM9263: 130 - return uarts_sam9263; 131 - 132 - case ARCH_ID_AT91SAM9G45: 133 - return uarts_sam9g45; 134 - 135 - case ARCH_ID_AT91SAM9RL64: 136 - return uarts_sam9rl; 137 - 138 - case ARCH_ID_AT91SAM9N12: 139 - case ARCH_ID_AT91SAM9X5: 140 - return uarts_sam9x5; 141 - 142 - case ARCH_ID_SAMA5: 143 - cidr = __raw_readl(dbgu_base + AT91_DBGU_EXID); 144 - if (cidr & ARCH_EXID_SAMA5D3) 145 - return uarts_sama5d3; 146 - else if (cidr & ARCH_EXID_SAMA5D4) 147 - return uarts_sama5d4; 148 - 149 - break; 150 - } 151 - 152 - /* at91sam9g10 */ 153 - if ((cidr & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { 154 - return uarts_sam9261; 155 - } 156 - /* at91sam9xe */ 157 - else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) { 158 - return uarts_sam9260; 159 - } 160 - 161 - return NULL; 162 - } 163 - 164 - static inline void arch_decomp_setup(void) 165 - { 166 - int i = 0; 167 - const u32* usarts; 168 - 169 - usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU0); 170 - if (!usarts) 171 - usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU1); 172 - if (!usarts) 173 - usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU2); 174 - if (!usarts) { 175 - at91_uart = NULL; 176 - return; 177 - } 178 - 179 - do { 180 - /* physical address */ 181 - at91_uart = (void __iomem *)usarts[i]; 182 - 183 - if (__raw_readl(at91_uart + ATMEL_US_BRGR)) 184 - return; 185 - i++; 186 - } while (usarts[i]); 187 - 188 - at91_uart = NULL; 189 - } 190 - 191 - /* 192 - * The following code assumes the serial port has already been 193 - * initialized by the bootloader. If you didn't setup a port in 194 - * your bootloader then nothing will appear (which might be desired). 195 - * 196 - * This does not append a newline 197 - */ 198 - static void putc(int c) 199 - { 200 - if (!at91_uart) 201 - return; 202 - 203 - while (!(__raw_readl(at91_uart + ATMEL_US_CSR) & ATMEL_US_TXRDY)) 204 - barrier(); 205 - __raw_writel(c, at91_uart + ATMEL_US_THR); 206 - } 207 - 208 - static inline void flush(void) 209 - { 210 - if (!at91_uart) 211 - return; 212 - 213 - /* wait for transmission to complete */ 214 - while (!(__raw_readl(at91_uart + ATMEL_US_CSR) & ATMEL_US_TXEMPTY)) 215 - barrier(); 216 - } 217 - 218 - #endif
+98 -3
arch/arm/mach-at91/pm.c
··· 32 32 #include <asm/fncpy.h> 33 33 #include <asm/cacheflush.h> 34 34 35 - #include <mach/cpu.h> 36 - #include <mach/hardware.h> 37 - 38 35 #include "generic.h" 39 36 #include "pm.h" 37 + 38 + /* 39 + * FIXME: this is needed to communicate between the pinctrl driver and 40 + * the PM implementation in the machine. Possibly part of the PM 41 + * implementation should be moved down into the pinctrl driver and get 42 + * called as part of the generic suspend/resume path. 43 + */ 44 + extern void at91_pinctrl_gpio_suspend(void); 45 + extern void at91_pinctrl_gpio_resume(void); 40 46 41 47 static struct { 42 48 unsigned long uhp_udp_mask; ··· 220 214 { 221 215 if (at91_standby) 222 216 at91_cpuidle_device.dev.platform_data = at91_standby; 217 + } 218 + 219 + /* 220 + * The AT91RM9200 goes into self-refresh mode with this command, and will 221 + * terminate self-refresh automatically on the next SDRAM access. 222 + * 223 + * Self-refresh mode is exited as soon as a memory access is made, but we don't 224 + * know for sure when that happens. However, we need to restore the low-power 225 + * mode if it was enabled before going idle. Restoring low-power mode while 226 + * still in self-refresh is "not recommended", but seems to work. 227 + */ 228 + static void at91rm9200_standby(void) 229 + { 230 + u32 lpr = at91_ramc_read(0, AT91RM9200_SDRAMC_LPR); 231 + 232 + asm volatile( 233 + "b 1f\n\t" 234 + ".align 5\n\t" 235 + "1: mcr p15, 0, %0, c7, c10, 4\n\t" 236 + " str %0, [%1, %2]\n\t" 237 + " str %3, [%1, %4]\n\t" 238 + " mcr p15, 0, %0, c7, c0, 4\n\t" 239 + " str %5, [%1, %2]" 240 + : 241 + : "r" (0), "r" (at91_ramc_base[0]), "r" (AT91RM9200_SDRAMC_LPR), 242 + "r" (1), "r" (AT91RM9200_SDRAMC_SRR), 243 + "r" (lpr)); 244 + } 245 + 246 + /* We manage both DDRAM/SDRAM controllers, we need more than one value to 247 + * remember. 248 + */ 249 + static void at91_ddr_standby(void) 250 + { 251 + /* Those two values allow us to delay self-refresh activation 252 + * to the maximum. */ 253 + u32 lpr0, lpr1 = 0; 254 + u32 saved_lpr0, saved_lpr1 = 0; 255 + 256 + if (at91_ramc_base[1]) { 257 + saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR); 258 + lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB; 259 + lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH; 260 + } 261 + 262 + saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR); 263 + lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB; 264 + lpr0 |= AT91_DDRSDRC_LPCB_SELF_REFRESH; 265 + 266 + /* self-refresh mode now */ 267 + at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0); 268 + if (at91_ramc_base[1]) 269 + at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1); 270 + 271 + cpu_do_idle(); 272 + 273 + at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); 274 + if (at91_ramc_base[1]) 275 + at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); 276 + } 277 + 278 + /* We manage both DDRAM/SDRAM controllers, we need more than one value to 279 + * remember. 280 + */ 281 + static void at91sam9_sdram_standby(void) 282 + { 283 + u32 lpr0, lpr1 = 0; 284 + u32 saved_lpr0, saved_lpr1 = 0; 285 + 286 + if (at91_ramc_base[1]) { 287 + saved_lpr1 = at91_ramc_read(1, AT91_SDRAMC_LPR); 288 + lpr1 = saved_lpr1 & ~AT91_SDRAMC_LPCB; 289 + lpr1 |= AT91_SDRAMC_LPCB_SELF_REFRESH; 290 + } 291 + 292 + saved_lpr0 = at91_ramc_read(0, AT91_SDRAMC_LPR); 293 + lpr0 = saved_lpr0 & ~AT91_SDRAMC_LPCB; 294 + lpr0 |= AT91_SDRAMC_LPCB_SELF_REFRESH; 295 + 296 + /* self-refresh mode now */ 297 + at91_ramc_write(0, AT91_SDRAMC_LPR, lpr0); 298 + if (at91_ramc_base[1]) 299 + at91_ramc_write(1, AT91_SDRAMC_LPR, lpr1); 300 + 301 + cpu_do_idle(); 302 + 303 + at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr0); 304 + if (at91_ramc_base[1]) 305 + at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1); 223 306 } 224 307 225 308 static const struct of_device_id ramc_ids[] __initconst = {
+4 -92
arch/arm/mach-at91/pm.h
··· 15 15 16 16 #include <mach/at91_ramc.h> 17 17 18 + #define AT91_MEMCTRL_MC 0 19 + #define AT91_MEMCTRL_SDRAMC 1 20 + #define AT91_MEMCTRL_DDRSDR 2 21 + 18 22 #define AT91_PM_MEMTYPE_MASK 0x0f 19 23 20 24 #define AT91_PM_MODE_OFFSET 4 ··· 27 23 28 24 #define AT91_PM_SLOW_CLOCK 0x01 29 25 30 - /* 31 - * The AT91RM9200 goes into self-refresh mode with this command, and will 32 - * terminate self-refresh automatically on the next SDRAM access. 33 - * 34 - * Self-refresh mode is exited as soon as a memory access is made, but we don't 35 - * know for sure when that happens. However, we need to restore the low-power 36 - * mode if it was enabled before going idle. Restoring low-power mode while 37 - * still in self-refresh is "not recommended", but seems to work. 38 - */ 39 - 40 - #ifndef __ASSEMBLY__ 41 - static inline void at91rm9200_standby(void) 42 - { 43 - u32 lpr = at91_ramc_read(0, AT91RM9200_SDRAMC_LPR); 44 - 45 - asm volatile( 46 - "b 1f\n\t" 47 - ".align 5\n\t" 48 - "1: mcr p15, 0, %0, c7, c10, 4\n\t" 49 - " str %0, [%1, %2]\n\t" 50 - " str %3, [%1, %4]\n\t" 51 - " mcr p15, 0, %0, c7, c0, 4\n\t" 52 - " str %5, [%1, %2]" 53 - : 54 - : "r" (0), "r" (at91_ramc_base[0]), "r" (AT91RM9200_SDRAMC_LPR), 55 - "r" (1), "r" (AT91RM9200_SDRAMC_SRR), 56 - "r" (lpr)); 57 - } 58 - 59 - /* We manage both DDRAM/SDRAM controllers, we need more than one value to 60 - * remember. 61 - */ 62 - static inline void at91_ddr_standby(void) 63 - { 64 - /* Those two values allow us to delay self-refresh activation 65 - * to the maximum. */ 66 - u32 lpr0, lpr1 = 0; 67 - u32 saved_lpr0, saved_lpr1 = 0; 68 - 69 - if (at91_ramc_base[1]) { 70 - saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR); 71 - lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB; 72 - lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH; 73 - } 74 - 75 - saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR); 76 - lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB; 77 - lpr0 |= AT91_DDRSDRC_LPCB_SELF_REFRESH; 78 - 79 - /* self-refresh mode now */ 80 - at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0); 81 - if (at91_ramc_base[1]) 82 - at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1); 83 - 84 - cpu_do_idle(); 85 - 86 - at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); 87 - if (at91_ramc_base[1]) 88 - at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); 89 - } 90 - 91 - /* We manage both DDRAM/SDRAM controllers, we need more than one value to 92 - * remember. 93 - */ 94 - static inline void at91sam9_sdram_standby(void) 95 - { 96 - u32 lpr0, lpr1 = 0; 97 - u32 saved_lpr0, saved_lpr1 = 0; 98 - 99 - if (at91_ramc_base[1]) { 100 - saved_lpr1 = at91_ramc_read(1, AT91_SDRAMC_LPR); 101 - lpr1 = saved_lpr1 & ~AT91_SDRAMC_LPCB; 102 - lpr1 |= AT91_SDRAMC_LPCB_SELF_REFRESH; 103 - } 104 - 105 - saved_lpr0 = at91_ramc_read(0, AT91_SDRAMC_LPR); 106 - lpr0 = saved_lpr0 & ~AT91_SDRAMC_LPCB; 107 - lpr0 |= AT91_SDRAMC_LPCB_SELF_REFRESH; 108 - 109 - /* self-refresh mode now */ 110 - at91_ramc_write(0, AT91_SDRAMC_LPR, lpr0); 111 - if (at91_ramc_base[1]) 112 - at91_ramc_write(1, AT91_SDRAMC_LPR, lpr1); 113 - 114 - cpu_do_idle(); 115 - 116 - at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr0); 117 - if (at91_ramc_base[1]) 118 - at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1); 119 - } 120 - 121 - #endif 122 26 #endif
-1
arch/arm/mach-at91/pm_suspend.S
··· 13 13 */ 14 14 #include <linux/linkage.h> 15 15 #include <linux/clk/at91_pmc.h> 16 - #include <mach/hardware.h> 17 16 #include <mach/at91_ramc.h> 18 17 #include "pm.h" 19 18
-2
arch/arm/mach-at91/sama5.c
··· 14 14 #include <asm/mach/map.h> 15 15 #include <asm/system_misc.h> 16 16 17 - #include <mach/hardware.h> 18 - 19 17 #include "generic.h" 20 18 #include "soc.h" 21 19
+9 -55
arch/arm/mach-shmobile/Kconfig
··· 62 62 select ARCH_RMOBILE 63 63 select RENESAS_INTC_IRQPIN 64 64 65 + config ARCH_R8A7778 66 + bool "R-Car M1A (R8A77781)" 67 + select ARCH_RCAR_GEN1 68 + 65 69 config ARCH_R8A7779 66 70 bool "R-Car H1 (R8A77790)" 67 71 select ARCH_RCAR_GEN1 ··· 84 80 bool "R-Car E2 (R8A77940)" 85 81 select ARCH_RCAR_GEN2 86 82 83 + config ARCH_SH73A0 84 + bool "SH-Mobile AG5 (R8A73A00)" 85 + select ARCH_RMOBILE 86 + select RENESAS_INTC_IRQPIN 87 + 87 88 comment "Renesas ARM SoCs Board Type" 88 89 89 90 config MACH_MARZEN ··· 103 94 104 95 comment "Renesas ARM SoCs System Type" 105 96 106 - config ARCH_SH7372 107 - bool "SH-Mobile AP4 (SH7372)" 108 - select ARCH_RMOBILE 109 - select ARCH_WANT_OPTIONAL_GPIOLIB 110 - select ARM_CPU_SUSPEND if PM || CPU_IDLE 111 - select SH_INTC 112 - 113 97 config ARCH_SH73A0 114 98 bool "SH-Mobile AG5 (R8A73A00)" 115 99 select ARCH_RMOBILE ··· 111 109 select I2C 112 110 select SH_INTC 113 111 select RENESAS_INTC_IRQPIN 114 - 115 - config ARCH_R8A73A4 116 - bool "R-Mobile APE6 (R8A73A40)" 117 - select ARCH_RMOBILE 118 - select ARCH_WANT_OPTIONAL_GPIOLIB 119 - select ARM_GIC 120 - select RENESAS_IRQC 121 112 122 113 config ARCH_R8A7740 123 114 bool "R-Mobile A1 (R8A77400)" ··· 132 137 select ARM_GIC 133 138 134 139 comment "Renesas ARM SoCs Board Type" 135 - 136 - config MACH_APE6EVM 137 - bool "APE6EVM board" 138 - depends on ARCH_R8A73A4 139 - select SMSC_PHY if SMSC911X 140 - select USE_OF 141 - 142 - config MACH_APE6EVM_REFERENCE 143 - bool "APE6EVM board - Reference Device Tree Implementation" 144 - depends on ARCH_R8A73A4 145 - select SMSC_PHY if SMSC911X 146 - select USE_OF 147 - ---help--- 148 - Use reference implementation of APE6EVM board support 149 - which makes a greater use of device tree at the expense 150 - of not supporting a number of devices. 151 - 152 - This is intended to aid developers 153 - 154 - config MACH_MACKEREL 155 - bool "mackerel board" 156 - depends on ARCH_SH7372 157 - select ARCH_REQUIRE_GPIOLIB 158 - select REGULATOR_FIXED_VOLTAGE if REGULATOR 159 - select SMSC_PHY if SMSC911X 160 - select SND_SOC_AK4642 if SND_SIMPLE_CARD 161 - select USE_OF 162 140 163 141 config MACH_ARMADILLO800EVA 164 142 bool "Armadillo-800 EVA board" ··· 178 210 select REGULATOR_FIXED_VOLTAGE if REGULATOR 179 211 select SND_SOC_AK4642 if SND_SIMPLE_CARD 180 212 select USE_OF 181 - 182 - config MACH_KZM9G_REFERENCE 183 - bool "KZM-A9-GT board - Reference Device Tree Implementation" 184 - depends on ARCH_SH73A0 185 - select ARCH_REQUIRE_GPIOLIB 186 - select REGULATOR_FIXED_VOLTAGE if REGULATOR 187 - select SND_SOC_AK4642 if SND_SIMPLE_CARD 188 - select USE_OF 189 - ---help--- 190 - Use reference implementation of KZM-A9-GT board support 191 - which makes as greater use of device tree at the expense 192 - of not supporting a number of devices. 193 - 194 - This is intended to aid developers 195 213 196 214 comment "Renesas ARM SoCs System Configuration" 197 215
+2 -12
arch/arm/mach-shmobile/Makefile
··· 6 6 obj-y := timer.o console.o 7 7 8 8 # CPU objects 9 - obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o pm-sh7372.o 10 - obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o intc-sh73a0.o pm-sh73a0.o 9 + obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o pm-sh73a0.o 11 10 obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o 12 11 obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o pm-r8a7740.o 13 12 obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o ··· 20 21 # Clock objects 21 22 ifndef CONFIG_COMMON_CLK 22 23 obj-y += clock.o 23 - obj-$(CONFIG_ARCH_SH7372) += clock-sh7372.o 24 24 obj-$(CONFIG_ARCH_SH73A0) += clock-sh73a0.o 25 - obj-$(CONFIG_ARCH_R8A73A4) += clock-r8a73a4.o 26 25 obj-$(CONFIG_ARCH_R8A7740) += clock-r8a7740.o 27 26 obj-$(CONFIG_ARCH_R8A7778) += clock-r8a7778.o 28 27 obj-$(CONFIG_ARCH_R8A7779) += clock-r8a7779.o ··· 50 53 obj-$(CONFIG_PM_RMOBILE) += pm-rmobile.o 51 54 obj-$(CONFIG_ARCH_RCAR_GEN2) += pm-rcar-gen2.o 52 55 53 - # special sh7372 handling for IRQ objects and low level sleep code 54 - obj-$(CONFIG_ARCH_SH7372) += entry-intc.o sleep-sh7372.o 55 - 56 56 # Board objects 57 57 ifdef CONFIG_ARCH_SHMOBILE_MULTI 58 58 obj-$(CONFIG_MACH_MARZEN) += board-marzen-reference.o 59 59 else 60 - obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o 61 - obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o 62 - obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o 63 60 obj-$(CONFIG_MACH_BOCKW) += board-bockw.o 64 61 obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o 65 62 obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 66 63 obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o 67 - obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o 68 - obj-$(CONFIG_MACH_KZM9G_REFERENCE) += board-kzm9g-reference.o 64 + obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o intc-sh73a0.o 69 65 endif 70 66 71 67 # Framework support
-4
arch/arm/mach-shmobile/Makefile.boot
··· 1 1 # per-board load address for uImage 2 2 loadaddr-y := 3 - loadaddr-$(CONFIG_MACH_APE6EVM) += 0x40008000 4 - loadaddr-$(CONFIG_MACH_APE6EVM_REFERENCE) += 0x40008000 5 3 loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000 6 4 loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 7 5 loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000 8 6 loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000 9 - loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 10 - loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000 11 7 loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000 12 8 13 9 __ZRELADDR := $(sort $(loadaddr-y))
-60
arch/arm/mach-shmobile/board-ape6evm-reference.c
··· 1 - /* 2 - * APE6EVM board support 3 - * 4 - * Copyright (C) 2013 Renesas Solutions Corp. 5 - * Copyright (C) 2013 Magnus Damm 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 - 17 - #include <linux/gpio.h> 18 - #include <linux/kernel.h> 19 - #include <linux/of_platform.h> 20 - #include <linux/pinctrl/machine.h> 21 - #include <linux/platform_device.h> 22 - #include <linux/sh_clk.h> 23 - 24 - #include <asm/mach-types.h> 25 - #include <asm/mach/arch.h> 26 - 27 - #include "common.h" 28 - #include "r8a73a4.h" 29 - 30 - static void __init ape6evm_add_standard_devices(void) 31 - { 32 - 33 - struct clk *parent; 34 - struct clk *mp; 35 - 36 - r8a73a4_clock_init(); 37 - 38 - /* MP clock parent = extal2 */ 39 - parent = clk_get(NULL, "extal2"); 40 - mp = clk_get(NULL, "mp"); 41 - BUG_ON(IS_ERR(parent) || IS_ERR(mp)); 42 - 43 - clk_set_parent(mp, parent); 44 - clk_put(parent); 45 - clk_put(mp); 46 - 47 - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 48 - } 49 - 50 - static const char *ape6evm_boards_compat_dt[] __initdata = { 51 - "renesas,ape6evm-reference", 52 - NULL, 53 - }; 54 - 55 - DT_MACHINE_START(APE6EVM_DT, "ape6evm") 56 - .init_early = shmobile_init_delay, 57 - .init_machine = ape6evm_add_standard_devices, 58 - .init_late = shmobile_init_late, 59 - .dt_compat = ape6evm_boards_compat_dt, 60 - MACHINE_END
-306
arch/arm/mach-shmobile/board-ape6evm.c
··· 1 - /* 2 - * APE6EVM board support 3 - * 4 - * Copyright (C) 2013 Renesas Solutions Corp. 5 - * Copyright (C) 2013 Magnus Damm 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 - 17 - #include <linux/gpio.h> 18 - #include <linux/gpio_keys.h> 19 - #include <linux/input.h> 20 - #include <linux/interrupt.h> 21 - #include <linux/irqchip.h> 22 - #include <linux/irqchip/arm-gic.h> 23 - #include <linux/kernel.h> 24 - #include <linux/mfd/tmio.h> 25 - #include <linux/mmc/host.h> 26 - #include <linux/mmc/sh_mmcif.h> 27 - #include <linux/mmc/sh_mobile_sdhi.h> 28 - #include <linux/pinctrl/machine.h> 29 - #include <linux/platform_device.h> 30 - #include <linux/regulator/fixed.h> 31 - #include <linux/regulator/machine.h> 32 - #include <linux/sh_clk.h> 33 - #include <linux/smsc911x.h> 34 - 35 - #include <asm/mach-types.h> 36 - #include <asm/mach/arch.h> 37 - 38 - #include "common.h" 39 - #include "irqs.h" 40 - #include "r8a73a4.h" 41 - 42 - /* LEDS */ 43 - static struct gpio_led ape6evm_leds[] = { 44 - { 45 - .name = "gnss-en", 46 - .gpio = 28, 47 - .default_state = LEDS_GPIO_DEFSTATE_OFF, 48 - }, { 49 - .name = "nfc-nrst", 50 - .gpio = 126, 51 - .default_state = LEDS_GPIO_DEFSTATE_OFF, 52 - }, { 53 - .name = "gnss-nrst", 54 - .gpio = 132, 55 - .default_state = LEDS_GPIO_DEFSTATE_OFF, 56 - }, { 57 - .name = "bt-wakeup", 58 - .gpio = 232, 59 - .default_state = LEDS_GPIO_DEFSTATE_OFF, 60 - }, { 61 - .name = "strobe", 62 - .gpio = 250, 63 - .default_state = LEDS_GPIO_DEFSTATE_OFF, 64 - }, { 65 - .name = "bbresetout", 66 - .gpio = 288, 67 - .default_state = LEDS_GPIO_DEFSTATE_OFF, 68 - }, 69 - }; 70 - 71 - static __initdata struct gpio_led_platform_data ape6evm_leds_pdata = { 72 - .leds = ape6evm_leds, 73 - .num_leds = ARRAY_SIZE(ape6evm_leds), 74 - }; 75 - 76 - /* GPIO KEY */ 77 - #define GPIO_KEY(c, g, d, ...) \ 78 - { .code = c, .gpio = g, .desc = d, .active_low = 1 } 79 - 80 - static struct gpio_keys_button gpio_buttons[] = { 81 - GPIO_KEY(KEY_0, 324, "S16"), 82 - GPIO_KEY(KEY_MENU, 325, "S17"), 83 - GPIO_KEY(KEY_HOME, 326, "S18"), 84 - GPIO_KEY(KEY_BACK, 327, "S19"), 85 - GPIO_KEY(KEY_VOLUMEUP, 328, "S20"), 86 - GPIO_KEY(KEY_VOLUMEDOWN, 329, "S21"), 87 - }; 88 - 89 - static struct gpio_keys_platform_data ape6evm_keys_pdata __initdata = { 90 - .buttons = gpio_buttons, 91 - .nbuttons = ARRAY_SIZE(gpio_buttons), 92 - }; 93 - 94 - /* Dummy supplies, where voltage doesn't matter */ 95 - static struct regulator_consumer_supply dummy_supplies[] = { 96 - REGULATOR_SUPPLY("vddvario", "smsc911x"), 97 - REGULATOR_SUPPLY("vdd33a", "smsc911x"), 98 - }; 99 - 100 - /* SMSC LAN9220 */ 101 - static const struct resource lan9220_res[] __initconst = { 102 - DEFINE_RES_MEM(0x08000000, 0x1000), 103 - { 104 - .start = irq_pin(40), /* IRQ40 */ 105 - .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH, 106 - }, 107 - }; 108 - 109 - static const struct smsc911x_platform_config lan9220_data __initconst = { 110 - .flags = SMSC911X_USE_32BIT, 111 - .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 112 - .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, 113 - }; 114 - 115 - /* 116 - * MMC0 power supplies: 117 - * Both Vcc and VccQ to eMMC on APE6EVM are supplied by a tps80032 voltage 118 - * regulator. Until support for it is added to this file we simulate the 119 - * Vcc supply by a fixed always-on regulator 120 - */ 121 - static struct regulator_consumer_supply vcc_mmc0_consumers[] = 122 - { 123 - REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), 124 - }; 125 - 126 - /* 127 - * SDHI0 power supplies: 128 - * Vcc to SDHI0 on APE6EVM is supplied by a GPIO-switchable regulator. VccQ is 129 - * provided by the same tps80032 regulator as both MMC0 voltages - see comment 130 - * above 131 - */ 132 - static struct regulator_consumer_supply vcc_sdhi0_consumers[] = 133 - { 134 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 135 - }; 136 - 137 - static struct regulator_init_data vcc_sdhi0_init_data = { 138 - .constraints = { 139 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 140 - }, 141 - .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi0_consumers), 142 - .consumer_supplies = vcc_sdhi0_consumers, 143 - }; 144 - 145 - static const struct fixed_voltage_config vcc_sdhi0_info __initconst = { 146 - .supply_name = "SDHI0 Vcc", 147 - .microvolts = 3300000, 148 - .gpio = 76, 149 - .enable_high = 1, 150 - .init_data = &vcc_sdhi0_init_data, 151 - }; 152 - 153 - /* 154 - * SDHI1 power supplies: 155 - * Vcc and VccQ to SDHI1 on APE6EVM are both fixed at 3.3V 156 - */ 157 - static struct regulator_consumer_supply vcc_sdhi1_consumers[] = 158 - { 159 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), 160 - }; 161 - 162 - /* MMCIF */ 163 - static const struct sh_mmcif_plat_data mmcif0_pdata __initconst = { 164 - .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, 165 - .slave_id_tx = SHDMA_SLAVE_MMCIF0_TX, 166 - .slave_id_rx = SHDMA_SLAVE_MMCIF0_RX, 167 - .ccs_unsupported = true, 168 - }; 169 - 170 - static const struct resource mmcif0_resources[] __initconst = { 171 - DEFINE_RES_MEM(0xee200000, 0x100), 172 - DEFINE_RES_IRQ(gic_spi(169)), 173 - }; 174 - 175 - /* SDHI0 */ 176 - static const struct sh_mobile_sdhi_info sdhi0_pdata __initconst = { 177 - .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, 178 - .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, 179 - }; 180 - 181 - static const struct resource sdhi0_resources[] __initconst = { 182 - DEFINE_RES_MEM(0xee100000, 0x100), 183 - DEFINE_RES_IRQ(gic_spi(165)), 184 - }; 185 - 186 - /* SDHI1 */ 187 - static const struct sh_mobile_sdhi_info sdhi1_pdata __initconst = { 188 - .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, 189 - .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | 190 - MMC_CAP_NEEDS_POLL, 191 - }; 192 - 193 - static const struct resource sdhi1_resources[] __initconst = { 194 - DEFINE_RES_MEM(0xee120000, 0x100), 195 - DEFINE_RES_IRQ(gic_spi(166)), 196 - }; 197 - 198 - static const struct pinctrl_map ape6evm_pinctrl_map[] __initconst = { 199 - /* SCIFA0 console */ 200 - PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", 201 - "scifa0_data", "scifa0"), 202 - /* SMSC */ 203 - PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a73a4", 204 - "irqc_irq40", "irqc"), 205 - /* MMCIF0 */ 206 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4", 207 - "mmc0_data8", "mmc0"), 208 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4", 209 - "mmc0_ctrl", "mmc0"), 210 - /* SDHI0: uSD: no WP */ 211 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", 212 - "sdhi0_data4", "sdhi0"), 213 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", 214 - "sdhi0_ctrl", "sdhi0"), 215 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", 216 - "sdhi0_cd", "sdhi0"), 217 - /* SDHI1 */ 218 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4", 219 - "sdhi1_data4", "sdhi1"), 220 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4", 221 - "sdhi1_ctrl", "sdhi1"), 222 - }; 223 - 224 - static void __init ape6evm_add_standard_devices(void) 225 - { 226 - 227 - struct clk *parent; 228 - struct clk *mp; 229 - 230 - r8a73a4_clock_init(); 231 - 232 - /* MP clock parent = extal2 */ 233 - parent = clk_get(NULL, "extal2"); 234 - mp = clk_get(NULL, "mp"); 235 - BUG_ON(IS_ERR(parent) || IS_ERR(mp)); 236 - 237 - clk_set_parent(mp, parent); 238 - clk_put(parent); 239 - clk_put(mp); 240 - 241 - pinctrl_register_mappings(ape6evm_pinctrl_map, 242 - ARRAY_SIZE(ape6evm_pinctrl_map)); 243 - r8a73a4_pinmux_init(); 244 - r8a73a4_add_standard_devices(); 245 - 246 - /* LAN9220 ethernet */ 247 - gpio_request_one(270, GPIOF_OUT_INIT_HIGH, NULL); /* smsc9220 RESET */ 248 - 249 - regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 250 - 251 - platform_device_register_resndata(NULL, "smsc911x", -1, 252 - lan9220_res, ARRAY_SIZE(lan9220_res), 253 - &lan9220_data, sizeof(lan9220_data)); 254 - 255 - regulator_register_always_on(1, "MMC0 Vcc", vcc_mmc0_consumers, 256 - ARRAY_SIZE(vcc_mmc0_consumers), 2800000); 257 - platform_device_register_resndata(NULL, "sh_mmcif", 0, 258 - mmcif0_resources, ARRAY_SIZE(mmcif0_resources), 259 - &mmcif0_pdata, sizeof(mmcif0_pdata)); 260 - platform_device_register_data(NULL, "reg-fixed-voltage", 2, 261 - &vcc_sdhi0_info, sizeof(vcc_sdhi0_info)); 262 - platform_device_register_resndata(NULL, "sh_mobile_sdhi", 0, 263 - sdhi0_resources, ARRAY_SIZE(sdhi0_resources), 264 - &sdhi0_pdata, sizeof(sdhi0_pdata)); 265 - regulator_register_always_on(3, "SDHI1 Vcc", vcc_sdhi1_consumers, 266 - ARRAY_SIZE(vcc_sdhi1_consumers), 3300000); 267 - platform_device_register_resndata(NULL, "sh_mobile_sdhi", 1, 268 - sdhi1_resources, ARRAY_SIZE(sdhi1_resources), 269 - &sdhi1_pdata, sizeof(sdhi1_pdata)); 270 - platform_device_register_data(NULL, "gpio-keys", -1, 271 - &ape6evm_keys_pdata, 272 - sizeof(ape6evm_keys_pdata)); 273 - platform_device_register_data(NULL, "leds-gpio", -1, 274 - &ape6evm_leds_pdata, 275 - sizeof(ape6evm_leds_pdata)); 276 - } 277 - 278 - static void __init ape6evm_legacy_init_time(void) 279 - { 280 - /* Do not invoke DT-based timers via clocksource_of_init() */ 281 - } 282 - 283 - static void __init ape6evm_legacy_init_irq(void) 284 - { 285 - void __iomem *gic_dist_base = ioremap_nocache(0xf1001000, 0x1000); 286 - void __iomem *gic_cpu_base = ioremap_nocache(0xf1002000, 0x1000); 287 - 288 - gic_init(0, 29, gic_dist_base, gic_cpu_base); 289 - 290 - /* Do not invoke DT-based interrupt code via irqchip_init() */ 291 - } 292 - 293 - 294 - static const char *ape6evm_boards_compat_dt[] __initdata = { 295 - "renesas,ape6evm", 296 - NULL, 297 - }; 298 - 299 - DT_MACHINE_START(APE6EVM_DT, "ape6evm") 300 - .init_early = shmobile_init_delay, 301 - .init_irq = ape6evm_legacy_init_irq, 302 - .init_machine = ape6evm_add_standard_devices, 303 - .init_late = shmobile_init_late, 304 - .dt_compat = ape6evm_boards_compat_dt, 305 - .init_time = ape6evm_legacy_init_time, 306 - MACHINE_END
+2
arch/arm/mach-shmobile/board-bockw-reference.c
··· 36 36 void __iomem *fpga; 37 37 void __iomem *pfc; 38 38 39 + #ifndef CONFIG_COMMON_CLK 39 40 r8a7778_clock_init(); 41 + #endif 40 42 r8a7778_init_irq_extpin_dt(1); 41 43 r8a7778_add_dt_devices(); 42 44
-62
arch/arm/mach-shmobile/board-kzm9g-reference.c
··· 1 - /* 2 - * KZM-A9-GT board support - Reference Device Tree Implementation 3 - * 4 - * Copyright (C) 2012 Horms Solutions Ltd. 5 - * 6 - * Based on board-kzm9g.c 7 - * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License as published by 11 - * the Free Software Foundation; version 2 of the License. 12 - * 13 - * This program is distributed in the hope that it will be useful, 14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 - * GNU General Public License for more details. 17 - */ 18 - 19 - #include <linux/delay.h> 20 - #include <linux/io.h> 21 - #include <linux/irq.h> 22 - #include <linux/input.h> 23 - #include <linux/of_platform.h> 24 - 25 - #include <asm/hardware/cache-l2x0.h> 26 - #include <asm/mach-types.h> 27 - #include <asm/mach/arch.h> 28 - 29 - #include "common.h" 30 - #include "sh73a0.h" 31 - 32 - static void __init kzm_init(void) 33 - { 34 - sh73a0_add_standard_devices_dt(); 35 - 36 - #ifdef CONFIG_CACHE_L2X0 37 - /* Shared attribute override enable, 64K*8way */ 38 - l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff); 39 - #endif 40 - } 41 - 42 - #define RESCNT2 IOMEM(0xe6188020) 43 - static void kzm9g_restart(enum reboot_mode mode, const char *cmd) 44 - { 45 - /* Do soft power on reset */ 46 - writel((1 << 31), RESCNT2); 47 - } 48 - 49 - static const char *kzm9g_boards_compat_dt[] __initdata = { 50 - "renesas,kzm9g-reference", 51 - NULL, 52 - }; 53 - 54 - DT_MACHINE_START(KZM9G_DT, "kzm9g-reference") 55 - .smp = smp_ops(sh73a0_smp_ops), 56 - .map_io = sh73a0_map_io, 57 - .init_early = shmobile_init_delay, 58 - .init_machine = kzm_init, 59 - .init_late = shmobile_init_late, 60 - .restart = kzm9g_restart, 61 - .dt_compat = kzm9g_boards_compat_dt, 62 - MACHINE_END
-1522
arch/arm/mach-shmobile/board-mackerel.c
··· 1 - /* 2 - * mackerel board support 3 - * 4 - * Copyright (C) 2010 Renesas Solutions Corp. 5 - * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 6 - * 7 - * based on ap4evb 8 - * Copyright (C) 2010 Magnus Damm 9 - * Copyright (C) 2008 Yoshihiro Shimoda 10 - * 11 - * This program is free software; you can redistribute it and/or modify 12 - * it under the terms of the GNU General Public License as published by 13 - * the Free Software Foundation; version 2 of the License. 14 - * 15 - * This program is distributed in the hope that it will be useful, 16 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 - * GNU General Public License for more details. 19 - */ 20 - #include <linux/delay.h> 21 - #include <linux/kernel.h> 22 - #include <linux/init.h> 23 - #include <linux/interrupt.h> 24 - #include <linux/irq.h> 25 - #include <linux/platform_device.h> 26 - #include <linux/gpio.h> 27 - #include <linux/input.h> 28 - #include <linux/io.h> 29 - #include <linux/i2c.h> 30 - #include <linux/leds.h> 31 - #include <linux/mfd/tmio.h> 32 - #include <linux/mmc/host.h> 33 - #include <linux/mmc/sh_mmcif.h> 34 - #include <linux/mmc/sh_mobile_sdhi.h> 35 - #include <linux/mtd/mtd.h> 36 - #include <linux/mtd/partitions.h> 37 - #include <linux/mtd/physmap.h> 38 - #include <linux/mtd/sh_flctl.h> 39 - #include <linux/pinctrl/machine.h> 40 - #include <linux/pinctrl/pinconf-generic.h> 41 - #include <linux/platform_data/gpio_backlight.h> 42 - #include <linux/pm_clock.h> 43 - #include <linux/regulator/fixed.h> 44 - #include <linux/regulator/machine.h> 45 - #include <linux/smsc911x.h> 46 - #include <linux/sh_clk.h> 47 - #include <linux/tca6416_keypad.h> 48 - #include <linux/usb/renesas_usbhs.h> 49 - #include <linux/dma-mapping.h> 50 - 51 - #include <video/sh_mobile_hdmi.h> 52 - #include <video/sh_mobile_lcdc.h> 53 - #include <media/sh_mobile_ceu.h> 54 - #include <media/soc_camera.h> 55 - #include <media/soc_camera_platform.h> 56 - #include <sound/sh_fsi.h> 57 - #include <sound/simple_card.h> 58 - #include <asm/mach/arch.h> 59 - #include <asm/mach-types.h> 60 - 61 - #include "common.h" 62 - #include "intc.h" 63 - #include "irqs.h" 64 - #include "pm-rmobile.h" 65 - #include "sh-gpio.h" 66 - #include "sh7372.h" 67 - 68 - /* 69 - * Address Interface BusWidth note 70 - * ------------------------------------------------------------------ 71 - * 0x0000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = ON 72 - * 0x0800_0000 user area - 73 - * 0x1000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = OFF 74 - * 0x1400_0000 Ether (LAN9220) 16bit 75 - * 0x1600_0000 user area - cannot use with NAND 76 - * 0x1800_0000 user area - 77 - * 0x1A00_0000 - 78 - * 0x4000_0000 LPDDR2-SDRAM (POP) 32bit 79 - */ 80 - 81 - /* 82 - * CPU mode 83 - * 84 - * SW4 | Boot Area| Master | Remarks 85 - * 1 | 2 | 3 | 4 | 5 | 6 | 8 | | Processor| 86 - * ----+-----+-----+-----+-----+-----+-----+----------+----------+-------------- 87 - * ON | ON | OFF | ON | ON | OFF | OFF | External | System | External ROM 88 - * ON | ON | ON | ON | ON | OFF | OFF | External | System | ROM Debug 89 - * ON | ON | X | ON | OFF | OFF | OFF | Built-in | System | ROM Debug 90 - * X | OFF | X | X | X | X | OFF | Built-in | System | MaskROM 91 - * OFF | X | X | X | X | X | OFF | Built-in | System | MaskROM 92 - * X | X | X | OFF | X | X | OFF | Built-in | System | MaskROM 93 - * OFF | ON | OFF | X | X | OFF | ON | External | System | Standalone 94 - * ON | OFF | OFF | X | X | OFF | ON | External | Realtime | Standalone 95 - */ 96 - 97 - /* 98 - * NOR Flash ROM 99 - * 100 - * SW1 | SW2 | SW7 | NOR Flash ROM 101 - * bit1 | bit1 bit2 | bit1 | Memory allocation 102 - * ------+------------+------+------------------ 103 - * OFF | ON OFF | ON | Area 0 104 - * OFF | ON OFF | OFF | Area 4 105 - */ 106 - 107 - /* 108 - * SMSC 9220 109 - * 110 - * SW1 SMSC 9220 111 - * ----------------------- 112 - * ON access disable 113 - * OFF access enable 114 - */ 115 - 116 - /* 117 - * NAND Flash ROM 118 - * 119 - * SW1 | SW2 | SW7 | NAND Flash ROM 120 - * bit1 | bit1 bit2 | bit2 | Memory allocation 121 - * ------+------------+------+------------------ 122 - * OFF | ON OFF | ON | FCE 0 123 - * OFF | ON OFF | OFF | FCE 1 124 - */ 125 - 126 - /* 127 - * External interrupt pin settings 128 - * 129 - * IRQX | pin setting | device | level 130 - * ------+--------------------+--------------------+------- 131 - * IRQ0 | ICR1A.IRQ0SA=0010 | SDHI2 card detect | Low 132 - * IRQ6 | ICR1A.IRQ6SA=0011 | Ether(LAN9220) | High 133 - * IRQ7 | ICR1A.IRQ7SA=0010 | LCD Touch Panel | Low 134 - * IRQ8 | ICR2A.IRQ8SA=0010 | MMC/SD card detect | Low 135 - * IRQ9 | ICR2A.IRQ9SA=0010 | KEY(TCA6408) | Low 136 - * IRQ21 | ICR4A.IRQ21SA=0011 | Sensor(ADXL345) | High 137 - * IRQ22 | ICR4A.IRQ22SA=0011 | Sensor(AK8975) | High 138 - */ 139 - 140 - /* 141 - * USB 142 - * 143 - * USB0 : CN22 : Function 144 - * USB1 : CN31 : Function/Host *1 145 - * 146 - * J30 (for CN31) *1 147 - * ----------+---------------+------------- 148 - * 1-2 short | VBUS 5V | Host 149 - * open | external VBUS | Function 150 - * 151 - * CAUTION 152 - * 153 - * renesas_usbhs driver can use external interrupt mode 154 - * (which come from USB-PHY) or autonomy mode (it use own interrupt) 155 - * for detecting connection/disconnection when Function. 156 - * USB will be power OFF while it has been disconnecting 157 - * if external interrupt mode, and it is always power ON if autonomy mode, 158 - * 159 - * mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0", 160 - * because Touchscreen is using IRQ7-PORT40. 161 - * It is impossible to use IRQ7 demux on this board. 162 - */ 163 - 164 - /* 165 - * SDHI0 (CN12) 166 - * 167 - * SW56 : OFF 168 - * 169 - */ 170 - 171 - /* MMC /SDHI1 (CN7) 172 - * 173 - * I/O voltage : 1.8v 174 - * 175 - * Power voltage : 1.8v or 3.3v 176 - * J22 : select power voltage *1 177 - * 1-2 pin : 1.8v 178 - * 2-3 pin : 3.3v 179 - * 180 - * *1 181 - * Please change J22 depends the card to be used. 182 - * MMC's OCR field set to support either voltage for the card inserted. 183 - * 184 - * SW1 | SW33 185 - * | bit1 | bit2 | bit3 | bit4 186 - * -------------+------+------+------+------- 187 - * MMC0 OFF | OFF | X | ON | X (Use MMCIF) 188 - * SDHI1 OFF | ON | X | OFF | X (Use MFD_SH_MOBILE_SDHI) 189 - * 190 - */ 191 - 192 - /* 193 - * SDHI2 (CN23) 194 - * 195 - * microSD card sloct 196 - * 197 - */ 198 - 199 - /* 200 - * FSI - AK4642 201 - * 202 - * it needs amixer settings for playing 203 - * 204 - * amixer set "Headphone Enable" on 205 - */ 206 - 207 - /* Fixed 3.3V and 1.8V regulators to be used by multiple devices */ 208 - static struct regulator_consumer_supply fixed1v8_power_consumers[] = 209 - { 210 - /* 211 - * J22 on mackerel switches mmcif.0 and sdhi.1 between 1.8V and 3.3V 212 - * Since we cannot support both voltages, we support the default 1.8V 213 - */ 214 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), 215 - REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"), 216 - REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), 217 - REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"), 218 - }; 219 - 220 - static struct regulator_consumer_supply fixed3v3_power_consumers[] = 221 - { 222 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 223 - REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 224 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"), 225 - REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.2"), 226 - }; 227 - 228 - /* Dummy supplies, where voltage doesn't matter */ 229 - static struct regulator_consumer_supply dummy_supplies[] = { 230 - REGULATOR_SUPPLY("vddvario", "smsc911x"), 231 - REGULATOR_SUPPLY("vdd33a", "smsc911x"), 232 - }; 233 - 234 - /* MTD */ 235 - static struct mtd_partition nor_flash_partitions[] = { 236 - { 237 - .name = "loader", 238 - .offset = 0x00000000, 239 - .size = 512 * 1024, 240 - .mask_flags = MTD_WRITEABLE, 241 - }, 242 - { 243 - .name = "bootenv", 244 - .offset = MTDPART_OFS_APPEND, 245 - .size = 512 * 1024, 246 - .mask_flags = MTD_WRITEABLE, 247 - }, 248 - { 249 - .name = "kernel_ro", 250 - .offset = MTDPART_OFS_APPEND, 251 - .size = 8 * 1024 * 1024, 252 - .mask_flags = MTD_WRITEABLE, 253 - }, 254 - { 255 - .name = "kernel", 256 - .offset = MTDPART_OFS_APPEND, 257 - .size = 8 * 1024 * 1024, 258 - }, 259 - { 260 - .name = "data", 261 - .offset = MTDPART_OFS_APPEND, 262 - .size = MTDPART_SIZ_FULL, 263 - }, 264 - }; 265 - 266 - static struct physmap_flash_data nor_flash_data = { 267 - .width = 2, 268 - .parts = nor_flash_partitions, 269 - .nr_parts = ARRAY_SIZE(nor_flash_partitions), 270 - }; 271 - 272 - static struct resource nor_flash_resources[] = { 273 - [0] = { 274 - .start = 0x20000000, /* CS0 shadow instead of regular CS0 */ 275 - .end = 0x28000000 - 1, /* needed by USB MASK ROM boot */ 276 - .flags = IORESOURCE_MEM, 277 - } 278 - }; 279 - 280 - static struct platform_device nor_flash_device = { 281 - .name = "physmap-flash", 282 - .dev = { 283 - .platform_data = &nor_flash_data, 284 - }, 285 - .num_resources = ARRAY_SIZE(nor_flash_resources), 286 - .resource = nor_flash_resources, 287 - }; 288 - 289 - /* SMSC */ 290 - static struct resource smc911x_resources[] = { 291 - { 292 - .start = 0x14000000, 293 - .end = 0x16000000 - 1, 294 - .flags = IORESOURCE_MEM, 295 - }, { 296 - .start = evt2irq(0x02c0) /* IRQ6A */, 297 - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 298 - }, 299 - }; 300 - 301 - static struct smsc911x_platform_config smsc911x_info = { 302 - .flags = SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS, 303 - .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 304 - .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 305 - }; 306 - 307 - static struct platform_device smc911x_device = { 308 - .name = "smsc911x", 309 - .id = -1, 310 - .num_resources = ARRAY_SIZE(smc911x_resources), 311 - .resource = smc911x_resources, 312 - .dev = { 313 - .platform_data = &smsc911x_info, 314 - }, 315 - }; 316 - 317 - /* MERAM */ 318 - static struct sh_mobile_meram_info mackerel_meram_info = { 319 - .addr_mode = SH_MOBILE_MERAM_MODE1, 320 - }; 321 - 322 - static struct resource meram_resources[] = { 323 - [0] = { 324 - .name = "regs", 325 - .start = 0xe8000000, 326 - .end = 0xe807ffff, 327 - .flags = IORESOURCE_MEM, 328 - }, 329 - [1] = { 330 - .name = "meram", 331 - .start = 0xe8080000, 332 - .end = 0xe81fffff, 333 - .flags = IORESOURCE_MEM, 334 - }, 335 - }; 336 - 337 - static struct platform_device meram_device = { 338 - .name = "sh_mobile_meram", 339 - .id = 0, 340 - .num_resources = ARRAY_SIZE(meram_resources), 341 - .resource = meram_resources, 342 - .dev = { 343 - .platform_data = &mackerel_meram_info, 344 - }, 345 - }; 346 - 347 - /* LCDC and backlight */ 348 - static struct fb_videomode mackerel_lcdc_modes[] = { 349 - { 350 - .name = "WVGA Panel", 351 - .xres = 800, 352 - .yres = 480, 353 - .left_margin = 220, 354 - .right_margin = 110, 355 - .hsync_len = 70, 356 - .upper_margin = 20, 357 - .lower_margin = 5, 358 - .vsync_len = 5, 359 - .sync = 0, 360 - }, 361 - }; 362 - 363 - static const struct sh_mobile_meram_cfg lcd_meram_cfg = { 364 - .icb[0] = { 365 - .meram_size = 0x40, 366 - }, 367 - .icb[1] = { 368 - .meram_size = 0x40, 369 - }, 370 - }; 371 - 372 - static struct sh_mobile_lcdc_info lcdc_info = { 373 - .meram_dev = &mackerel_meram_info, 374 - .clock_source = LCDC_CLK_BUS, 375 - .ch[0] = { 376 - .chan = LCDC_CHAN_MAINLCD, 377 - .fourcc = V4L2_PIX_FMT_RGB565, 378 - .lcd_modes = mackerel_lcdc_modes, 379 - .num_modes = ARRAY_SIZE(mackerel_lcdc_modes), 380 - .interface_type = RGB24, 381 - .clock_divider = 3, 382 - .flags = 0, 383 - .panel_cfg = { 384 - .width = 152, 385 - .height = 91, 386 - }, 387 - .meram_cfg = &lcd_meram_cfg, 388 - } 389 - }; 390 - 391 - static struct resource lcdc_resources[] = { 392 - [0] = { 393 - .name = "LCDC", 394 - .start = 0xfe940000, 395 - .end = 0xfe943fff, 396 - .flags = IORESOURCE_MEM, 397 - }, 398 - [1] = { 399 - .start = intcs_evt2irq(0x580), 400 - .flags = IORESOURCE_IRQ, 401 - }, 402 - }; 403 - 404 - static struct platform_device lcdc_device = { 405 - .name = "sh_mobile_lcdc_fb", 406 - .num_resources = ARRAY_SIZE(lcdc_resources), 407 - .resource = lcdc_resources, 408 - .dev = { 409 - .platform_data = &lcdc_info, 410 - .coherent_dma_mask = DMA_BIT_MASK(32), 411 - }, 412 - }; 413 - 414 - static struct gpio_backlight_platform_data gpio_backlight_data = { 415 - .fbdev = &lcdc_device.dev, 416 - .gpio = 31, 417 - .def_value = 1, 418 - .name = "backlight", 419 - }; 420 - 421 - static struct platform_device gpio_backlight_device = { 422 - .name = "gpio-backlight", 423 - .dev = { 424 - .platform_data = &gpio_backlight_data, 425 - }, 426 - }; 427 - 428 - /* HDMI */ 429 - static struct sh_mobile_hdmi_info hdmi_info = { 430 - .flags = HDMI_SND_SRC_SPDIF, 431 - }; 432 - 433 - static struct resource hdmi_resources[] = { 434 - [0] = { 435 - .name = "HDMI", 436 - .start = 0xe6be0000, 437 - .end = 0xe6be00ff, 438 - .flags = IORESOURCE_MEM, 439 - }, 440 - [1] = { 441 - /* There's also an HDMI interrupt on INTCS @ 0x18e0 */ 442 - .start = evt2irq(0x17e0), 443 - .flags = IORESOURCE_IRQ, 444 - }, 445 - }; 446 - 447 - static struct platform_device hdmi_device = { 448 - .name = "sh-mobile-hdmi", 449 - .num_resources = ARRAY_SIZE(hdmi_resources), 450 - .resource = hdmi_resources, 451 - .id = -1, 452 - .dev = { 453 - .platform_data = &hdmi_info, 454 - }, 455 - }; 456 - 457 - static const struct sh_mobile_meram_cfg hdmi_meram_cfg = { 458 - .icb[0] = { 459 - .meram_size = 0x100, 460 - }, 461 - .icb[1] = { 462 - .meram_size = 0x100, 463 - }, 464 - }; 465 - 466 - static struct sh_mobile_lcdc_info hdmi_lcdc_info = { 467 - .meram_dev = &mackerel_meram_info, 468 - .clock_source = LCDC_CLK_EXTERNAL, 469 - .ch[0] = { 470 - .chan = LCDC_CHAN_MAINLCD, 471 - .fourcc = V4L2_PIX_FMT_RGB565, 472 - .interface_type = RGB24, 473 - .clock_divider = 1, 474 - .flags = LCDC_FLAGS_DWPOL, 475 - .meram_cfg = &hdmi_meram_cfg, 476 - .tx_dev = &hdmi_device, 477 - } 478 - }; 479 - 480 - static struct resource hdmi_lcdc_resources[] = { 481 - [0] = { 482 - .name = "LCDC1", 483 - .start = 0xfe944000, 484 - .end = 0xfe947fff, 485 - .flags = IORESOURCE_MEM, 486 - }, 487 - [1] = { 488 - .start = intcs_evt2irq(0x1780), 489 - .flags = IORESOURCE_IRQ, 490 - }, 491 - }; 492 - 493 - static struct platform_device hdmi_lcdc_device = { 494 - .name = "sh_mobile_lcdc_fb", 495 - .num_resources = ARRAY_SIZE(hdmi_lcdc_resources), 496 - .resource = hdmi_lcdc_resources, 497 - .id = 1, 498 - .dev = { 499 - .platform_data = &hdmi_lcdc_info, 500 - .coherent_dma_mask = DMA_BIT_MASK(32), 501 - }, 502 - }; 503 - 504 - static struct asoc_simple_card_info fsi2_hdmi_info = { 505 - .name = "HDMI", 506 - .card = "FSI2B-HDMI", 507 - .codec = "sh-mobile-hdmi", 508 - .platform = "sh_fsi2", 509 - .daifmt = SND_SOC_DAIFMT_CBS_CFS, 510 - .cpu_dai = { 511 - .name = "fsib-dai", 512 - }, 513 - .codec_dai = { 514 - .name = "sh_mobile_hdmi-hifi", 515 - }, 516 - }; 517 - 518 - static struct platform_device fsi_hdmi_device = { 519 - .name = "asoc-simple-card", 520 - .id = 1, 521 - .dev = { 522 - .platform_data = &fsi2_hdmi_info, 523 - .coherent_dma_mask = DMA_BIT_MASK(32), 524 - .dma_mask = &fsi_hdmi_device.dev.coherent_dma_mask, 525 - }, 526 - }; 527 - 528 - static void __init hdmi_init_pm_clock(void) 529 - { 530 - struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick"); 531 - int ret; 532 - long rate; 533 - 534 - if (IS_ERR(hdmi_ick)) { 535 - ret = PTR_ERR(hdmi_ick); 536 - pr_err("Cannot get HDMI ICK: %d\n", ret); 537 - goto out; 538 - } 539 - 540 - ret = clk_set_parent(&sh7372_pllc2_clk, &sh7372_dv_clki_div2_clk); 541 - if (ret < 0) { 542 - pr_err("Cannot set PLLC2 parent: %d, %d users\n", 543 - ret, sh7372_pllc2_clk.usecount); 544 - goto out; 545 - } 546 - 547 - pr_debug("PLLC2 initial frequency %lu\n", 548 - clk_get_rate(&sh7372_pllc2_clk)); 549 - 550 - rate = clk_round_rate(&sh7372_pllc2_clk, 594000000); 551 - if (rate <= 0) { 552 - pr_err("Cannot get suitable rate: %ld\n", rate); 553 - ret = -EINVAL; 554 - goto out; 555 - } 556 - 557 - ret = clk_set_rate(&sh7372_pllc2_clk, rate); 558 - if (ret < 0) { 559 - pr_err("Cannot set rate %ld: %d\n", rate, ret); 560 - goto out; 561 - } 562 - 563 - pr_debug("PLLC2 set frequency %lu\n", rate); 564 - 565 - ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk); 566 - if (ret < 0) 567 - pr_err("Cannot set HDMI parent: %d\n", ret); 568 - 569 - out: 570 - if (!IS_ERR(hdmi_ick)) 571 - clk_put(hdmi_ick); 572 - } 573 - 574 - /* USBHS0 is connected to CN22 which takes a USB Mini-B plug 575 - * 576 - * The sh7372 SoC has IRQ7 set aside for USBHS0 hotplug, 577 - * but on this particular board IRQ7 is already used by 578 - * the touch screen. This leaves us with software polling. 579 - */ 580 - #define USBHS0_POLL_INTERVAL (HZ * 5) 581 - 582 - struct usbhs_private { 583 - void __iomem *usbphyaddr; 584 - void __iomem *usbcrcaddr; 585 - struct renesas_usbhs_platform_info info; 586 - struct delayed_work work; 587 - struct platform_device *pdev; 588 - }; 589 - 590 - #define usbhs_get_priv(pdev) \ 591 - container_of(renesas_usbhs_get_info(pdev), \ 592 - struct usbhs_private, info) 593 - 594 - #define usbhs_is_connected(priv) \ 595 - (!((1 << 7) & __raw_readw(priv->usbcrcaddr))) 596 - 597 - static int usbhs_get_vbus(struct platform_device *pdev) 598 - { 599 - return usbhs_is_connected(usbhs_get_priv(pdev)); 600 - } 601 - 602 - static int usbhs_phy_reset(struct platform_device *pdev) 603 - { 604 - struct usbhs_private *priv = usbhs_get_priv(pdev); 605 - 606 - /* init phy */ 607 - __raw_writew(0x8a0a, priv->usbcrcaddr); 608 - 609 - return 0; 610 - } 611 - 612 - static int usbhs0_get_id(struct platform_device *pdev) 613 - { 614 - return USBHS_GADGET; 615 - } 616 - 617 - static void usbhs0_work_function(struct work_struct *work) 618 - { 619 - struct usbhs_private *priv = container_of(work, struct usbhs_private, 620 - work.work); 621 - 622 - renesas_usbhs_call_notify_hotplug(priv->pdev); 623 - schedule_delayed_work(&priv->work, USBHS0_POLL_INTERVAL); 624 - } 625 - 626 - static int usbhs0_hardware_init(struct platform_device *pdev) 627 - { 628 - struct usbhs_private *priv = usbhs_get_priv(pdev); 629 - 630 - priv->pdev = pdev; 631 - INIT_DELAYED_WORK(&priv->work, usbhs0_work_function); 632 - schedule_delayed_work(&priv->work, USBHS0_POLL_INTERVAL); 633 - return 0; 634 - } 635 - 636 - static int usbhs0_hardware_exit(struct platform_device *pdev) 637 - { 638 - struct usbhs_private *priv = usbhs_get_priv(pdev); 639 - 640 - cancel_delayed_work_sync(&priv->work); 641 - 642 - return 0; 643 - } 644 - 645 - static struct usbhs_private usbhs0_private = { 646 - .usbcrcaddr = IOMEM(0xe605810c), /* USBCR2 */ 647 - .info = { 648 - .platform_callback = { 649 - .hardware_init = usbhs0_hardware_init, 650 - .hardware_exit = usbhs0_hardware_exit, 651 - .phy_reset = usbhs_phy_reset, 652 - .get_id = usbhs0_get_id, 653 - .get_vbus = usbhs_get_vbus, 654 - }, 655 - .driver_param = { 656 - .buswait_bwait = 4, 657 - .d0_tx_id = SHDMA_SLAVE_USB0_TX, 658 - .d1_rx_id = SHDMA_SLAVE_USB0_RX, 659 - }, 660 - }, 661 - }; 662 - 663 - static struct resource usbhs0_resources[] = { 664 - [0] = { 665 - .name = "USBHS0", 666 - .start = 0xe6890000, 667 - .end = 0xe68900e6 - 1, 668 - .flags = IORESOURCE_MEM, 669 - }, 670 - [1] = { 671 - .start = evt2irq(0x1ca0) /* USB0_USB0I0 */, 672 - .flags = IORESOURCE_IRQ, 673 - }, 674 - }; 675 - 676 - static struct platform_device usbhs0_device = { 677 - .name = "renesas_usbhs", 678 - .id = 0, 679 - .dev = { 680 - .platform_data = &usbhs0_private.info, 681 - }, 682 - .num_resources = ARRAY_SIZE(usbhs0_resources), 683 - .resource = usbhs0_resources, 684 - }; 685 - 686 - /* USBHS1 is connected to CN31 which takes a USB Mini-AB plug 687 - * 688 - * Use J30 to select between Host and Function. This setting 689 - * can however not be detected by software. Hotplug of USBHS1 690 - * is provided via IRQ8. 691 - * 692 - * Current USB1 works as "USB Host". 693 - * - set J30 "short" 694 - * 695 - * If you want to use it as "USB gadget", 696 - * - J30 "open" 697 - * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET 698 - * - add .get_vbus = usbhs_get_vbus in usbhs1_private 699 - * - check usbhs0_device(pio)/usbhs1_device(irq) order in mackerel_devices. 700 - */ 701 - #define IRQ8 evt2irq(0x0300) 702 - #define USB_PHY_MODE (1 << 4) 703 - #define USB_PHY_INT_EN ((1 << 3) | (1 << 2)) 704 - #define USB_PHY_ON (1 << 1) 705 - #define USB_PHY_OFF (1 << 0) 706 - #define USB_PHY_INT_CLR (USB_PHY_ON | USB_PHY_OFF) 707 - 708 - static irqreturn_t usbhs1_interrupt(int irq, void *data) 709 - { 710 - struct platform_device *pdev = data; 711 - struct usbhs_private *priv = usbhs_get_priv(pdev); 712 - 713 - dev_dbg(&pdev->dev, "%s\n", __func__); 714 - 715 - renesas_usbhs_call_notify_hotplug(pdev); 716 - 717 - /* clear status */ 718 - __raw_writew(__raw_readw(priv->usbphyaddr) | USB_PHY_INT_CLR, 719 - priv->usbphyaddr); 720 - 721 - return IRQ_HANDLED; 722 - } 723 - 724 - static int usbhs1_hardware_init(struct platform_device *pdev) 725 - { 726 - struct usbhs_private *priv = usbhs_get_priv(pdev); 727 - int ret; 728 - 729 - /* clear interrupt status */ 730 - __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr); 731 - 732 - ret = request_irq(IRQ8, usbhs1_interrupt, IRQF_TRIGGER_HIGH, 733 - dev_name(&pdev->dev), pdev); 734 - if (ret) { 735 - dev_err(&pdev->dev, "request_irq err\n"); 736 - return ret; 737 - } 738 - 739 - /* enable USB phy interrupt */ 740 - __raw_writew(USB_PHY_MODE | USB_PHY_INT_EN, priv->usbphyaddr); 741 - 742 - return 0; 743 - } 744 - 745 - static int usbhs1_hardware_exit(struct platform_device *pdev) 746 - { 747 - struct usbhs_private *priv = usbhs_get_priv(pdev); 748 - 749 - /* clear interrupt status */ 750 - __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr); 751 - 752 - free_irq(IRQ8, pdev); 753 - 754 - return 0; 755 - } 756 - 757 - static int usbhs1_get_id(struct platform_device *pdev) 758 - { 759 - return USBHS_HOST; 760 - } 761 - 762 - static u32 usbhs1_pipe_cfg[] = { 763 - USB_ENDPOINT_XFER_CONTROL, 764 - USB_ENDPOINT_XFER_ISOC, 765 - USB_ENDPOINT_XFER_ISOC, 766 - USB_ENDPOINT_XFER_BULK, 767 - USB_ENDPOINT_XFER_BULK, 768 - USB_ENDPOINT_XFER_BULK, 769 - USB_ENDPOINT_XFER_INT, 770 - USB_ENDPOINT_XFER_INT, 771 - USB_ENDPOINT_XFER_INT, 772 - USB_ENDPOINT_XFER_BULK, 773 - USB_ENDPOINT_XFER_BULK, 774 - USB_ENDPOINT_XFER_BULK, 775 - USB_ENDPOINT_XFER_BULK, 776 - USB_ENDPOINT_XFER_BULK, 777 - USB_ENDPOINT_XFER_BULK, 778 - USB_ENDPOINT_XFER_BULK, 779 - }; 780 - 781 - static struct usbhs_private usbhs1_private = { 782 - .usbphyaddr = IOMEM(0xe60581e2), /* USBPHY1INTAP */ 783 - .usbcrcaddr = IOMEM(0xe6058130), /* USBCR4 */ 784 - .info = { 785 - .platform_callback = { 786 - .hardware_init = usbhs1_hardware_init, 787 - .hardware_exit = usbhs1_hardware_exit, 788 - .get_id = usbhs1_get_id, 789 - .phy_reset = usbhs_phy_reset, 790 - }, 791 - .driver_param = { 792 - .buswait_bwait = 4, 793 - .has_otg = 1, 794 - .pipe_type = usbhs1_pipe_cfg, 795 - .pipe_size = ARRAY_SIZE(usbhs1_pipe_cfg), 796 - .d0_tx_id = SHDMA_SLAVE_USB1_TX, 797 - .d1_rx_id = SHDMA_SLAVE_USB1_RX, 798 - }, 799 - }, 800 - }; 801 - 802 - static struct resource usbhs1_resources[] = { 803 - [0] = { 804 - .name = "USBHS1", 805 - .start = 0xe68b0000, 806 - .end = 0xe68b00e6 - 1, 807 - .flags = IORESOURCE_MEM, 808 - }, 809 - [1] = { 810 - .start = evt2irq(0x1ce0) /* USB1_USB1I0 */, 811 - .flags = IORESOURCE_IRQ, 812 - }, 813 - }; 814 - 815 - static struct platform_device usbhs1_device = { 816 - .name = "renesas_usbhs", 817 - .id = 1, 818 - .dev = { 819 - .platform_data = &usbhs1_private.info, 820 - .dma_mask = &usbhs1_device.dev.coherent_dma_mask, 821 - .coherent_dma_mask = DMA_BIT_MASK(32), 822 - }, 823 - .num_resources = ARRAY_SIZE(usbhs1_resources), 824 - .resource = usbhs1_resources, 825 - }; 826 - 827 - /* LED */ 828 - static struct gpio_led mackerel_leds[] = { 829 - { 830 - .name = "led0", 831 - .gpio = 0, 832 - .default_state = LEDS_GPIO_DEFSTATE_ON, 833 - }, 834 - { 835 - .name = "led1", 836 - .gpio = 1, 837 - .default_state = LEDS_GPIO_DEFSTATE_ON, 838 - }, 839 - { 840 - .name = "led2", 841 - .gpio = 2, 842 - .default_state = LEDS_GPIO_DEFSTATE_ON, 843 - }, 844 - { 845 - .name = "led3", 846 - .gpio = 159, 847 - .default_state = LEDS_GPIO_DEFSTATE_ON, 848 - } 849 - }; 850 - 851 - static struct gpio_led_platform_data mackerel_leds_pdata = { 852 - .leds = mackerel_leds, 853 - .num_leds = ARRAY_SIZE(mackerel_leds), 854 - }; 855 - 856 - static struct platform_device leds_device = { 857 - .name = "leds-gpio", 858 - .id = 0, 859 - .dev = { 860 - .platform_data = &mackerel_leds_pdata, 861 - }, 862 - }; 863 - 864 - /* FSI */ 865 - #define IRQ_FSI evt2irq(0x1840) 866 - static struct sh_fsi_platform_info fsi_info = { 867 - .port_a = { 868 - .tx_id = SHDMA_SLAVE_FSIA_TX, 869 - .rx_id = SHDMA_SLAVE_FSIA_RX, 870 - }, 871 - .port_b = { 872 - .flags = SH_FSI_CLK_CPG | 873 - SH_FSI_FMT_SPDIF, 874 - } 875 - }; 876 - 877 - static struct resource fsi_resources[] = { 878 - [0] = { 879 - /* we need 0xFE1F0000 to access DMA 880 - * instead of 0xFE3C0000 */ 881 - .name = "FSI", 882 - .start = 0xFE1F0000, 883 - .end = 0xFE1F0400 - 1, 884 - .flags = IORESOURCE_MEM, 885 - }, 886 - [1] = { 887 - .start = IRQ_FSI, 888 - .flags = IORESOURCE_IRQ, 889 - }, 890 - }; 891 - 892 - static struct platform_device fsi_device = { 893 - .name = "sh_fsi2", 894 - .id = -1, 895 - .num_resources = ARRAY_SIZE(fsi_resources), 896 - .resource = fsi_resources, 897 - .dev = { 898 - .platform_data = &fsi_info, 899 - }, 900 - }; 901 - 902 - static struct asoc_simple_card_info fsi2_ak4643_info = { 903 - .name = "AK4643", 904 - .card = "FSI2A-AK4643", 905 - .codec = "ak4642-codec.0-0013", 906 - .platform = "sh_fsi2", 907 - .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM, 908 - .cpu_dai = { 909 - .name = "fsia-dai", 910 - }, 911 - .codec_dai = { 912 - .name = "ak4642-hifi", 913 - .sysclk = 11289600, 914 - }, 915 - }; 916 - 917 - static struct platform_device fsi_ak4643_device = { 918 - .name = "asoc-simple-card", 919 - .dev = { 920 - .platform_data = &fsi2_ak4643_info, 921 - .coherent_dma_mask = DMA_BIT_MASK(32), 922 - .dma_mask = &fsi_ak4643_device.dev.coherent_dma_mask, 923 - }, 924 - }; 925 - 926 - /* FLCTL */ 927 - static struct mtd_partition nand_partition_info[] = { 928 - { 929 - .name = "system", 930 - .offset = 0, 931 - .size = 128 * 1024 * 1024, 932 - }, 933 - { 934 - .name = "userdata", 935 - .offset = MTDPART_OFS_APPEND, 936 - .size = 256 * 1024 * 1024, 937 - }, 938 - { 939 - .name = "cache", 940 - .offset = MTDPART_OFS_APPEND, 941 - .size = 128 * 1024 * 1024, 942 - }, 943 - }; 944 - 945 - static struct resource nand_flash_resources[] = { 946 - [0] = { 947 - .start = 0xe6a30000, 948 - .end = 0xe6a3009b, 949 - .flags = IORESOURCE_MEM, 950 - }, 951 - [1] = { 952 - .start = evt2irq(0x0d80), /* flstei: status error irq */ 953 - .flags = IORESOURCE_IRQ, 954 - }, 955 - }; 956 - 957 - static struct sh_flctl_platform_data nand_flash_data = { 958 - .parts = nand_partition_info, 959 - .nr_parts = ARRAY_SIZE(nand_partition_info), 960 - .flcmncr_val = CLK_16B_12L_4H | TYPESEL_SET 961 - | SHBUSSEL | SEL_16BIT | SNAND_E, 962 - .use_holden = 1, 963 - }; 964 - 965 - static struct platform_device nand_flash_device = { 966 - .name = "sh_flctl", 967 - .resource = nand_flash_resources, 968 - .num_resources = ARRAY_SIZE(nand_flash_resources), 969 - .dev = { 970 - .platform_data = &nand_flash_data, 971 - }, 972 - }; 973 - 974 - /* SDHI0 */ 975 - static struct sh_mobile_sdhi_info sdhi0_info = { 976 - .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 977 - .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 978 - .tmio_flags = TMIO_MMC_USE_GPIO_CD, 979 - .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, 980 - .cd_gpio = 172, 981 - }; 982 - 983 - static struct resource sdhi0_resources[] = { 984 - { 985 - .name = "SDHI0", 986 - .start = 0xe6850000, 987 - .end = 0xe68500ff, 988 - .flags = IORESOURCE_MEM, 989 - }, { 990 - .name = SH_MOBILE_SDHI_IRQ_SDCARD, 991 - .start = evt2irq(0x0e20) /* SDHI0_SDHI0I1 */, 992 - .flags = IORESOURCE_IRQ, 993 - }, { 994 - .name = SH_MOBILE_SDHI_IRQ_SDIO, 995 - .start = evt2irq(0x0e40) /* SDHI0_SDHI0I2 */, 996 - .flags = IORESOURCE_IRQ, 997 - }, 998 - }; 999 - 1000 - static struct platform_device sdhi0_device = { 1001 - .name = "sh_mobile_sdhi", 1002 - .num_resources = ARRAY_SIZE(sdhi0_resources), 1003 - .resource = sdhi0_resources, 1004 - .id = 0, 1005 - .dev = { 1006 - .platform_data = &sdhi0_info, 1007 - }, 1008 - }; 1009 - 1010 - #if !IS_ENABLED(CONFIG_MMC_SH_MMCIF) 1011 - /* SDHI1 */ 1012 - 1013 - /* GPIO 41 can trigger IRQ8, but it is used by USBHS1, we have to poll */ 1014 - static struct sh_mobile_sdhi_info sdhi1_info = { 1015 - .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, 1016 - .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, 1017 - .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_USE_GPIO_CD, 1018 - .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | 1019 - MMC_CAP_NEEDS_POLL, 1020 - .cd_gpio = 41, 1021 - }; 1022 - 1023 - static struct resource sdhi1_resources[] = { 1024 - { 1025 - .name = "SDHI1", 1026 - .start = 0xe6860000, 1027 - .end = 0xe68600ff, 1028 - .flags = IORESOURCE_MEM, 1029 - }, { 1030 - .name = SH_MOBILE_SDHI_IRQ_SDCARD, 1031 - .start = evt2irq(0x0ea0), /* SDHI1_SDHI1I1 */ 1032 - .flags = IORESOURCE_IRQ, 1033 - }, { 1034 - .name = SH_MOBILE_SDHI_IRQ_SDIO, 1035 - .start = evt2irq(0x0ec0), /* SDHI1_SDHI1I2 */ 1036 - .flags = IORESOURCE_IRQ, 1037 - }, 1038 - }; 1039 - 1040 - static struct platform_device sdhi1_device = { 1041 - .name = "sh_mobile_sdhi", 1042 - .num_resources = ARRAY_SIZE(sdhi1_resources), 1043 - .resource = sdhi1_resources, 1044 - .id = 1, 1045 - .dev = { 1046 - .platform_data = &sdhi1_info, 1047 - }, 1048 - }; 1049 - #endif 1050 - 1051 - /* SDHI2 */ 1052 - 1053 - /* 1054 - * The card detect pin of the top SD/MMC slot (CN23) is active low and is 1055 - * connected to GPIO SCIFB_SCK of SH7372 (GPIO 162). 1056 - */ 1057 - static struct sh_mobile_sdhi_info sdhi2_info = { 1058 - .dma_slave_tx = SHDMA_SLAVE_SDHI2_TX, 1059 - .dma_slave_rx = SHDMA_SLAVE_SDHI2_RX, 1060 - .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_USE_GPIO_CD, 1061 - .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | 1062 - MMC_CAP_NEEDS_POLL, 1063 - .cd_gpio = 162, 1064 - }; 1065 - 1066 - static struct resource sdhi2_resources[] = { 1067 - { 1068 - .name = "SDHI2", 1069 - .start = 0xe6870000, 1070 - .end = 0xe68700ff, 1071 - .flags = IORESOURCE_MEM, 1072 - }, { 1073 - .name = SH_MOBILE_SDHI_IRQ_SDCARD, 1074 - .start = evt2irq(0x1220), /* SDHI2_SDHI2I1 */ 1075 - .flags = IORESOURCE_IRQ, 1076 - }, { 1077 - .name = SH_MOBILE_SDHI_IRQ_SDIO, 1078 - .start = evt2irq(0x1240), /* SDHI2_SDHI2I2 */ 1079 - .flags = IORESOURCE_IRQ, 1080 - }, 1081 - }; 1082 - 1083 - static struct platform_device sdhi2_device = { 1084 - .name = "sh_mobile_sdhi", 1085 - .num_resources = ARRAY_SIZE(sdhi2_resources), 1086 - .resource = sdhi2_resources, 1087 - .id = 2, 1088 - .dev = { 1089 - .platform_data = &sdhi2_info, 1090 - }, 1091 - }; 1092 - 1093 - /* SH_MMCIF */ 1094 - #if IS_ENABLED(CONFIG_MMC_SH_MMCIF) 1095 - static struct resource sh_mmcif_resources[] = { 1096 - [0] = { 1097 - .name = "MMCIF", 1098 - .start = 0xE6BD0000, 1099 - .end = 0xE6BD00FF, 1100 - .flags = IORESOURCE_MEM, 1101 - }, 1102 - [1] = { 1103 - /* MMC ERR */ 1104 - .start = evt2irq(0x1ac0), 1105 - .flags = IORESOURCE_IRQ, 1106 - }, 1107 - [2] = { 1108 - /* MMC NOR */ 1109 - .start = evt2irq(0x1ae0), 1110 - .flags = IORESOURCE_IRQ, 1111 - }, 1112 - }; 1113 - 1114 - static struct sh_mmcif_plat_data sh_mmcif_plat = { 1115 - .sup_pclk = 0, 1116 - .caps = MMC_CAP_4_BIT_DATA | 1117 - MMC_CAP_8_BIT_DATA | 1118 - MMC_CAP_NEEDS_POLL, 1119 - .use_cd_gpio = true, 1120 - /* card detect pin for SD/MMC slot (CN7) */ 1121 - .cd_gpio = 41, 1122 - .slave_id_tx = SHDMA_SLAVE_MMCIF_TX, 1123 - .slave_id_rx = SHDMA_SLAVE_MMCIF_RX, 1124 - }; 1125 - 1126 - static struct platform_device sh_mmcif_device = { 1127 - .name = "sh_mmcif", 1128 - .id = 0, 1129 - .dev = { 1130 - .dma_mask = NULL, 1131 - .coherent_dma_mask = 0xffffffff, 1132 - .platform_data = &sh_mmcif_plat, 1133 - }, 1134 - .num_resources = ARRAY_SIZE(sh_mmcif_resources), 1135 - .resource = sh_mmcif_resources, 1136 - }; 1137 - #endif 1138 - 1139 - static int mackerel_camera_add(struct soc_camera_device *icd); 1140 - static void mackerel_camera_del(struct soc_camera_device *icd); 1141 - 1142 - static int camera_set_capture(struct soc_camera_platform_info *info, 1143 - int enable) 1144 - { 1145 - return 0; /* camera sensor always enabled */ 1146 - } 1147 - 1148 - static struct soc_camera_platform_info camera_info = { 1149 - .format_name = "UYVY", 1150 - .format_depth = 16, 1151 - .format = { 1152 - .code = MEDIA_BUS_FMT_UYVY8_2X8, 1153 - .colorspace = V4L2_COLORSPACE_SMPTE170M, 1154 - .field = V4L2_FIELD_NONE, 1155 - .width = 640, 1156 - .height = 480, 1157 - }, 1158 - .mbus_param = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER | 1159 - V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH | 1160 - V4L2_MBUS_DATA_ACTIVE_HIGH, 1161 - .mbus_type = V4L2_MBUS_PARALLEL, 1162 - .set_capture = camera_set_capture, 1163 - }; 1164 - 1165 - static struct soc_camera_link camera_link = { 1166 - .bus_id = 0, 1167 - .add_device = mackerel_camera_add, 1168 - .del_device = mackerel_camera_del, 1169 - .module_name = "soc_camera_platform", 1170 - .priv = &camera_info, 1171 - }; 1172 - 1173 - static struct platform_device *camera_device; 1174 - 1175 - static void mackerel_camera_release(struct device *dev) 1176 - { 1177 - soc_camera_platform_release(&camera_device); 1178 - } 1179 - 1180 - static int mackerel_camera_add(struct soc_camera_device *icd) 1181 - { 1182 - return soc_camera_platform_add(icd, &camera_device, &camera_link, 1183 - mackerel_camera_release, 0); 1184 - } 1185 - 1186 - static void mackerel_camera_del(struct soc_camera_device *icd) 1187 - { 1188 - soc_camera_platform_del(icd, camera_device, &camera_link); 1189 - } 1190 - 1191 - static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 1192 - .flags = SH_CEU_FLAG_USE_8BIT_BUS, 1193 - .max_width = 8188, 1194 - .max_height = 8188, 1195 - }; 1196 - 1197 - static struct resource ceu_resources[] = { 1198 - [0] = { 1199 - .name = "CEU", 1200 - .start = 0xfe910000, 1201 - .end = 0xfe91009f, 1202 - .flags = IORESOURCE_MEM, 1203 - }, 1204 - [1] = { 1205 - .start = intcs_evt2irq(0x880), 1206 - .flags = IORESOURCE_IRQ, 1207 - }, 1208 - [2] = { 1209 - /* place holder for contiguous memory */ 1210 - }, 1211 - }; 1212 - 1213 - static struct platform_device ceu_device = { 1214 - .name = "sh_mobile_ceu", 1215 - .id = 0, /* "ceu0" clock */ 1216 - .num_resources = ARRAY_SIZE(ceu_resources), 1217 - .resource = ceu_resources, 1218 - .dev = { 1219 - .platform_data = &sh_mobile_ceu_info, 1220 - .coherent_dma_mask = 0xffffffff, 1221 - }, 1222 - }; 1223 - 1224 - static struct platform_device mackerel_camera = { 1225 - .name = "soc-camera-pdrv", 1226 - .id = 0, 1227 - .dev = { 1228 - .platform_data = &camera_link, 1229 - }, 1230 - }; 1231 - 1232 - static struct platform_device *mackerel_devices[] __initdata = { 1233 - &nor_flash_device, 1234 - &smc911x_device, 1235 - &lcdc_device, 1236 - &gpio_backlight_device, 1237 - &usbhs0_device, 1238 - &usbhs1_device, 1239 - &leds_device, 1240 - &fsi_device, 1241 - &fsi_ak4643_device, 1242 - &fsi_hdmi_device, 1243 - &nand_flash_device, 1244 - &sdhi0_device, 1245 - #if !IS_ENABLED(CONFIG_MMC_SH_MMCIF) 1246 - &sdhi1_device, 1247 - #else 1248 - &sh_mmcif_device, 1249 - #endif 1250 - &sdhi2_device, 1251 - &ceu_device, 1252 - &mackerel_camera, 1253 - &hdmi_device, 1254 - &hdmi_lcdc_device, 1255 - &meram_device, 1256 - }; 1257 - 1258 - /* Keypad Initialization */ 1259 - #define KEYPAD_BUTTON(ev_type, ev_code, act_low) \ 1260 - { \ 1261 - .type = ev_type, \ 1262 - .code = ev_code, \ 1263 - .active_low = act_low, \ 1264 - } 1265 - 1266 - #define KEYPAD_BUTTON_LOW(event_code) KEYPAD_BUTTON(EV_KEY, event_code, 1) 1267 - 1268 - static struct tca6416_button mackerel_gpio_keys[] = { 1269 - KEYPAD_BUTTON_LOW(KEY_HOME), 1270 - KEYPAD_BUTTON_LOW(KEY_MENU), 1271 - KEYPAD_BUTTON_LOW(KEY_BACK), 1272 - KEYPAD_BUTTON_LOW(KEY_POWER), 1273 - }; 1274 - 1275 - static struct tca6416_keys_platform_data mackerel_tca6416_keys_info = { 1276 - .buttons = mackerel_gpio_keys, 1277 - .nbuttons = ARRAY_SIZE(mackerel_gpio_keys), 1278 - .rep = 1, 1279 - .use_polling = 0, 1280 - .pinmask = 0x000F, 1281 - }; 1282 - 1283 - /* I2C */ 1284 - #define IRQ7 evt2irq(0x02e0) 1285 - #define IRQ9 evt2irq(0x0320) 1286 - 1287 - static struct i2c_board_info i2c0_devices[] = { 1288 - { 1289 - I2C_BOARD_INFO("ak4643", 0x13), 1290 - }, 1291 - /* Keypad */ 1292 - { 1293 - I2C_BOARD_INFO("tca6408-keys", 0x20), 1294 - .platform_data = &mackerel_tca6416_keys_info, 1295 - .irq = IRQ9, 1296 - }, 1297 - /* Touchscreen */ 1298 - { 1299 - I2C_BOARD_INFO("st1232-ts", 0x55), 1300 - .irq = IRQ7, 1301 - }, 1302 - }; 1303 - 1304 - #define IRQ21 evt2irq(0x32a0) 1305 - 1306 - static struct i2c_board_info i2c1_devices[] = { 1307 - /* Accelerometer */ 1308 - { 1309 - I2C_BOARD_INFO("adxl34x", 0x53), 1310 - .irq = IRQ21, 1311 - }, 1312 - }; 1313 - 1314 - static unsigned long pin_pulldown_conf[] = { 1315 - PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_DOWN, 0), 1316 - }; 1317 - 1318 - static const struct pinctrl_map mackerel_pinctrl_map[] = { 1319 - /* ADXL34X */ 1320 - PIN_MAP_MUX_GROUP_DEFAULT("1-0053", "pfc-sh7372", 1321 - "intc_irq21", "intc"), 1322 - /* CEU */ 1323 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_ceu.0", "pfc-sh7372", 1324 - "ceu_data_0_7", "ceu"), 1325 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_ceu.0", "pfc-sh7372", 1326 - "ceu_clk_0", "ceu"), 1327 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_ceu.0", "pfc-sh7372", 1328 - "ceu_sync", "ceu"), 1329 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_ceu.0", "pfc-sh7372", 1330 - "ceu_field", "ceu"), 1331 - /* FLCTL */ 1332 - PIN_MAP_MUX_GROUP_DEFAULT("sh_flctl.0", "pfc-sh7372", 1333 - "flctl_data", "flctl"), 1334 - PIN_MAP_MUX_GROUP_DEFAULT("sh_flctl.0", "pfc-sh7372", 1335 - "flctl_ce0", "flctl"), 1336 - PIN_MAP_MUX_GROUP_DEFAULT("sh_flctl.0", "pfc-sh7372", 1337 - "flctl_ctrl", "flctl"), 1338 - /* FSIA (AK4643) */ 1339 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.0", "pfc-sh7372", 1340 - "fsia_sclk_in", "fsia"), 1341 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.0", "pfc-sh7372", 1342 - "fsia_data_in", "fsia"), 1343 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.0", "pfc-sh7372", 1344 - "fsia_data_out", "fsia"), 1345 - /* FSIB (HDMI) */ 1346 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.1", "pfc-sh7372", 1347 - "fsib_mclk_in", "fsib"), 1348 - /* HDMI */ 1349 - PIN_MAP_MUX_GROUP_DEFAULT("sh-mobile-hdmi", "pfc-sh7372", 1350 - "hdmi", "hdmi"), 1351 - /* LCDC */ 1352 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-sh7372", 1353 - "lcd_data24", "lcd"), 1354 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-sh7372", 1355 - "lcd_sync", "lcd"), 1356 - /* SCIFA0 */ 1357 - PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-sh7372", 1358 - "scifa0_data", "scifa0"), 1359 - /* SCIFA2 (GT-720F GPS module) */ 1360 - PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh7372", 1361 - "scifa2_data", "scifa2"), 1362 - /* SDHI0 */ 1363 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", 1364 - "sdhi0_data4", "sdhi0"), 1365 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", 1366 - "sdhi0_ctrl", "sdhi0"), 1367 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", 1368 - "sdhi0_wp", "sdhi0"), 1369 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh7372", 1370 - "intc_irq26_1", "intc"), 1371 - /* SDHI1 */ 1372 - #if !IS_ENABLED(CONFIG_MMC_SH_MMCIF) 1373 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh7372", 1374 - "sdhi1_data4", "sdhi1"), 1375 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh7372", 1376 - "sdhi1_ctrl", "sdhi1"), 1377 - #else 1378 - /* MMCIF */ 1379 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh7372", 1380 - "mmc0_data8_0", "mmc0"), 1381 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh7372", 1382 - "mmc0_ctrl_0", "mmc0"), 1383 - #endif 1384 - /* SDHI2 */ 1385 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh7372", 1386 - "sdhi2_data4", "sdhi2"), 1387 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh7372", 1388 - "sdhi2_ctrl", "sdhi2"), 1389 - /* SMSC911X */ 1390 - PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-sh7372", 1391 - "bsc_cs5a", "bsc"), 1392 - PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-sh7372", 1393 - "intc_irq6_0", "intc"), 1394 - /* ST1232 */ 1395 - PIN_MAP_MUX_GROUP_DEFAULT("0-0055", "pfc-sh7372", 1396 - "intc_irq7_0", "intc"), 1397 - /* TCA6416 */ 1398 - PIN_MAP_MUX_GROUP_DEFAULT("0-0020", "pfc-sh7372", 1399 - "intc_irq9_0", "intc"), 1400 - /* USBHS0 */ 1401 - PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.0", "pfc-sh7372", 1402 - "usb0_vbus", "usb0"), 1403 - PIN_MAP_CONFIGS_GROUP_DEFAULT("renesas_usbhs.0", "pfc-sh7372", 1404 - "usb0_vbus", pin_pulldown_conf), 1405 - /* USBHS1 */ 1406 - PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372", 1407 - "usb1_vbus", "usb1"), 1408 - PIN_MAP_CONFIGS_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372", 1409 - "usb1_vbus", pin_pulldown_conf), 1410 - PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372", 1411 - "usb1_otg_id_0", "usb1"), 1412 - }; 1413 - 1414 - #define GPIO_PORT9CR IOMEM(0xE6051009) 1415 - #define GPIO_PORT10CR IOMEM(0xE605100A) 1416 - #define SRCR4 IOMEM(0xe61580bc) 1417 - #define USCCR1 IOMEM(0xE6058144) 1418 - static void __init mackerel_init(void) 1419 - { 1420 - static struct pm_domain_device domain_devices[] __initdata = { 1421 - { "A4LC", &lcdc_device, }, 1422 - { "A4LC", &hdmi_lcdc_device, }, 1423 - { "A4LC", &meram_device, }, 1424 - { "A4MP", &fsi_device, }, 1425 - { "A3SP", &usbhs0_device, }, 1426 - { "A3SP", &usbhs1_device, }, 1427 - { "A3SP", &nand_flash_device, }, 1428 - { "A3SP", &sdhi0_device, }, 1429 - #if !IS_ENABLED(CONFIG_MMC_SH_MMCIF) 1430 - { "A3SP", &sdhi1_device, }, 1431 - #else 1432 - { "A3SP", &sh_mmcif_device, }, 1433 - #endif 1434 - { "A3SP", &sdhi2_device, }, 1435 - { "A4R", &ceu_device, }, 1436 - }; 1437 - u32 srcr4; 1438 - struct clk *clk; 1439 - 1440 - regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers, 1441 - ARRAY_SIZE(fixed1v8_power_consumers), 1800000); 1442 - regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers, 1443 - ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 1444 - regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 1445 - 1446 - /* External clock source */ 1447 - clk_set_rate(&sh7372_dv_clki_clk, 27000000); 1448 - 1449 - pinctrl_register_mappings(mackerel_pinctrl_map, 1450 - ARRAY_SIZE(mackerel_pinctrl_map)); 1451 - sh7372_pinmux_init(); 1452 - 1453 - gpio_request_one(151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ 1454 - 1455 - /* FSI2 port A (ak4643) */ 1456 - gpio_request_one(161, GPIOF_OUT_INIT_LOW, NULL); /* slave */ 1457 - 1458 - gpio_request(9, NULL); 1459 - gpio_request(10, NULL); 1460 - gpio_direction_none(GPIO_PORT9CR); /* FSIAOBT needs no direction */ 1461 - gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */ 1462 - 1463 - intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */ 1464 - 1465 - /* FSI2 port B (HDMI) */ 1466 - __raw_writew(__raw_readw(USCCR1) & ~(1 << 6), USCCR1); /* use SPDIF */ 1467 - 1468 - /* set SPU2 clock to 119.6 MHz */ 1469 - clk = clk_get(NULL, "spu_clk"); 1470 - if (!IS_ERR(clk)) { 1471 - clk_set_rate(clk, clk_round_rate(clk, 119600000)); 1472 - clk_put(clk); 1473 - } 1474 - 1475 - /* Keypad */ 1476 - irq_set_irq_type(IRQ9, IRQ_TYPE_LEVEL_HIGH); 1477 - 1478 - /* Touchscreen */ 1479 - irq_set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW); 1480 - 1481 - /* Accelerometer */ 1482 - irq_set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH); 1483 - 1484 - /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */ 1485 - srcr4 = __raw_readl(SRCR4); 1486 - __raw_writel(srcr4 | (1 << 13), SRCR4); 1487 - udelay(50); 1488 - __raw_writel(srcr4 & ~(1 << 13), SRCR4); 1489 - 1490 - i2c_register_board_info(0, i2c0_devices, 1491 - ARRAY_SIZE(i2c0_devices)); 1492 - i2c_register_board_info(1, i2c1_devices, 1493 - ARRAY_SIZE(i2c1_devices)); 1494 - 1495 - sh7372_add_standard_devices(); 1496 - 1497 - platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices)); 1498 - 1499 - rmobile_add_devices_to_domains(domain_devices, 1500 - ARRAY_SIZE(domain_devices)); 1501 - 1502 - hdmi_init_pm_clock(); 1503 - sh7372_pm_init(); 1504 - pm_clk_add(&fsi_device.dev, "spu2"); 1505 - pm_clk_add(&hdmi_lcdc_device.dev, "hdmi"); 1506 - } 1507 - 1508 - static const char *mackerel_boards_compat_dt[] __initdata = { 1509 - "renesas,mackerel", 1510 - NULL, 1511 - }; 1512 - 1513 - DT_MACHINE_START(MACKEREL_DT, "mackerel") 1514 - .map_io = sh7372_map_io, 1515 - .init_early = sh7372_add_early_devices, 1516 - .init_irq = sh7372_init_irq, 1517 - .handle_irq = shmobile_handle_irq_intc, 1518 - .init_machine = mackerel_init, 1519 - .init_late = sh7372_pm_init_late, 1520 - .init_time = sh7372_earlytimer_init, 1521 - .dt_compat = mackerel_boards_compat_dt, 1522 - MACHINE_END
-659
arch/arm/mach-shmobile/clock-r8a73a4.c
··· 1 - /* 2 - * r8a73a4 clock framework support 3 - * 4 - * Copyright (C) 2013 Renesas Solutions Corp. 5 - * Copyright (C) 2013 Magnus Damm 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 - #include <linux/init.h> 17 - #include <linux/io.h> 18 - #include <linux/kernel.h> 19 - #include <linux/sh_clk.h> 20 - #include <linux/clkdev.h> 21 - #include "common.h" 22 - #include "clock.h" 23 - 24 - #define CPG_BASE 0xe6150000 25 - #define CPG_LEN 0x270 26 - 27 - #define SMSTPCR2 0xe6150138 28 - #define SMSTPCR3 0xe615013c 29 - #define SMSTPCR4 0xe6150140 30 - #define SMSTPCR5 0xe6150144 31 - 32 - #define FRQCRA 0xE6150000 33 - #define FRQCRB 0xE6150004 34 - #define FRQCRC 0xE61500E0 35 - #define VCLKCR1 0xE6150008 36 - #define VCLKCR2 0xE615000C 37 - #define VCLKCR3 0xE615001C 38 - #define VCLKCR4 0xE6150014 39 - #define VCLKCR5 0xE6150034 40 - #define ZBCKCR 0xE6150010 41 - #define SD0CKCR 0xE6150074 42 - #define SD1CKCR 0xE6150078 43 - #define SD2CKCR 0xE615007C 44 - #define MMC0CKCR 0xE6150240 45 - #define MMC1CKCR 0xE6150244 46 - #define FSIACKCR 0xE6150018 47 - #define FSIBCKCR 0xE6150090 48 - #define MPCKCR 0xe6150080 49 - #define SPUVCKCR 0xE6150094 50 - #define HSICKCR 0xE615026C 51 - #define M4CKCR 0xE6150098 52 - #define PLLECR 0xE61500D0 53 - #define PLL0CR 0xE61500D8 54 - #define PLL1CR 0xE6150028 55 - #define PLL2CR 0xE615002C 56 - #define PLL2SCR 0xE61501F4 57 - #define PLL2HCR 0xE61501E4 58 - #define CKSCR 0xE61500C0 59 - 60 - #define CPG_MAP(o) ((o - CPG_BASE) + cpg_mapping.base) 61 - 62 - static struct clk_mapping cpg_mapping = { 63 - .phys = CPG_BASE, 64 - .len = CPG_LEN, 65 - }; 66 - 67 - static struct clk extalr_clk = { 68 - .rate = 32768, 69 - .mapping = &cpg_mapping, 70 - }; 71 - 72 - static struct clk extal1_clk = { 73 - .rate = 26000000, 74 - .mapping = &cpg_mapping, 75 - }; 76 - 77 - static struct clk extal2_clk = { 78 - .rate = 48000000, 79 - .mapping = &cpg_mapping, 80 - }; 81 - 82 - static struct sh_clk_ops followparent_clk_ops = { 83 - .recalc = followparent_recalc, 84 - }; 85 - 86 - static struct clk main_clk = { 87 - /* .parent will be set r8a73a4_clock_init */ 88 - .ops = &followparent_clk_ops, 89 - }; 90 - 91 - SH_CLK_RATIO(div2, 1, 2); 92 - SH_CLK_RATIO(div4, 1, 4); 93 - 94 - SH_FIXED_RATIO_CLK(main_div2_clk, main_clk, div2); 95 - SH_FIXED_RATIO_CLK(extal1_div2_clk, extal1_clk, div2); 96 - SH_FIXED_RATIO_CLK(extal2_div2_clk, extal2_clk, div2); 97 - SH_FIXED_RATIO_CLK(extal2_div4_clk, extal2_clk, div4); 98 - 99 - /* External FSIACK/FSIBCK clock */ 100 - static struct clk fsiack_clk = { 101 - }; 102 - 103 - static struct clk fsibck_clk = { 104 - }; 105 - 106 - /* 107 - * PLL clocks 108 - */ 109 - static struct clk *pll_parent_main[] = { 110 - [0] = &main_clk, 111 - [1] = &main_div2_clk 112 - }; 113 - 114 - static struct clk *pll_parent_main_extal[8] = { 115 - [0] = &main_div2_clk, 116 - [1] = &extal2_div2_clk, 117 - [3] = &extal2_div4_clk, 118 - [4] = &main_clk, 119 - [5] = &extal2_clk, 120 - }; 121 - 122 - static unsigned long pll_recalc(struct clk *clk) 123 - { 124 - unsigned long mult = 1; 125 - 126 - if (ioread32(CPG_MAP(PLLECR)) & (1 << clk->enable_bit)) 127 - mult = (((ioread32(clk->mapped_reg) >> 24) & 0x7f) + 1); 128 - 129 - return clk->parent->rate * mult; 130 - } 131 - 132 - static int pll_set_parent(struct clk *clk, struct clk *parent) 133 - { 134 - u32 val; 135 - int i, ret; 136 - 137 - if (!clk->parent_table || !clk->parent_num) 138 - return -EINVAL; 139 - 140 - /* Search the parent */ 141 - for (i = 0; i < clk->parent_num; i++) 142 - if (clk->parent_table[i] == parent) 143 - break; 144 - 145 - if (i == clk->parent_num) 146 - return -ENODEV; 147 - 148 - ret = clk_reparent(clk, parent); 149 - if (ret < 0) 150 - return ret; 151 - 152 - val = ioread32(clk->mapped_reg) & 153 - ~(((1 << clk->src_width) - 1) << clk->src_shift); 154 - 155 - iowrite32(val | i << clk->src_shift, clk->mapped_reg); 156 - 157 - return 0; 158 - } 159 - 160 - static struct sh_clk_ops pll_clk_ops = { 161 - .recalc = pll_recalc, 162 - .set_parent = pll_set_parent, 163 - }; 164 - 165 - #define PLL_CLOCK(name, p, pt, w, s, reg, e) \ 166 - static struct clk name = { \ 167 - .ops = &pll_clk_ops, \ 168 - .flags = CLK_ENABLE_ON_INIT, \ 169 - .parent = p, \ 170 - .parent_table = pt, \ 171 - .parent_num = ARRAY_SIZE(pt), \ 172 - .src_width = w, \ 173 - .src_shift = s, \ 174 - .enable_reg = (void __iomem *)reg, \ 175 - .enable_bit = e, \ 176 - .mapping = &cpg_mapping, \ 177 - } 178 - 179 - PLL_CLOCK(pll0_clk, &main_clk, pll_parent_main, 1, 20, PLL0CR, 0); 180 - PLL_CLOCK(pll1_clk, &main_clk, pll_parent_main, 1, 7, PLL1CR, 1); 181 - PLL_CLOCK(pll2_clk, &main_div2_clk, pll_parent_main_extal, 3, 5, PLL2CR, 2); 182 - PLL_CLOCK(pll2s_clk, &main_div2_clk, pll_parent_main_extal, 3, 5, PLL2SCR, 4); 183 - PLL_CLOCK(pll2h_clk, &main_div2_clk, pll_parent_main_extal, 3, 5, PLL2HCR, 5); 184 - 185 - SH_FIXED_RATIO_CLK(pll1_div2_clk, pll1_clk, div2); 186 - 187 - static atomic_t frqcr_lock; 188 - 189 - /* Several clocks need to access FRQCRB, have to lock */ 190 - static bool frqcr_kick_check(struct clk *clk) 191 - { 192 - return !(ioread32(CPG_MAP(FRQCRB)) & BIT(31)); 193 - } 194 - 195 - static int frqcr_kick_do(struct clk *clk) 196 - { 197 - int i; 198 - 199 - /* set KICK bit in FRQCRB to update hardware setting, check success */ 200 - iowrite32(ioread32(CPG_MAP(FRQCRB)) | BIT(31), CPG_MAP(FRQCRB)); 201 - for (i = 1000; i; i--) 202 - if (ioread32(CPG_MAP(FRQCRB)) & BIT(31)) 203 - cpu_relax(); 204 - else 205 - return 0; 206 - 207 - return -ETIMEDOUT; 208 - } 209 - 210 - static int zclk_set_rate(struct clk *clk, unsigned long rate) 211 - { 212 - void __iomem *frqcrc; 213 - int ret; 214 - unsigned long step, p_rate; 215 - u32 val; 216 - 217 - if (!clk->parent || !__clk_get(clk->parent)) 218 - return -ENODEV; 219 - 220 - if (!atomic_inc_and_test(&frqcr_lock) || !frqcr_kick_check(clk)) { 221 - ret = -EBUSY; 222 - goto done; 223 - } 224 - 225 - /* 226 - * Users are supposed to first call clk_set_rate() only with 227 - * clk_round_rate() results. So, we don't fix wrong rates here, but 228 - * guard against them anyway 229 - */ 230 - 231 - p_rate = clk_get_rate(clk->parent); 232 - if (rate == p_rate) { 233 - val = 0; 234 - } else { 235 - step = DIV_ROUND_CLOSEST(p_rate, 32); 236 - 237 - if (rate > p_rate || rate < step) { 238 - ret = -EINVAL; 239 - goto done; 240 - } 241 - 242 - val = 32 - rate / step; 243 - } 244 - 245 - frqcrc = clk->mapped_reg + (FRQCRC - (u32)clk->enable_reg); 246 - 247 - iowrite32((ioread32(frqcrc) & ~(clk->div_mask << clk->enable_bit)) | 248 - (val << clk->enable_bit), frqcrc); 249 - 250 - ret = frqcr_kick_do(clk); 251 - 252 - done: 253 - atomic_dec(&frqcr_lock); 254 - __clk_put(clk->parent); 255 - return ret; 256 - } 257 - 258 - static long zclk_round_rate(struct clk *clk, unsigned long rate) 259 - { 260 - /* 261 - * theoretical rate = parent rate * multiplier / 32, 262 - * where 1 <= multiplier <= 32. Therefore we should do 263 - * multiplier = rate * 32 / parent rate 264 - * rounded rate = parent rate * multiplier / 32. 265 - * However, multiplication before division won't fit in 32 bits, so 266 - * we sacrifice some precision by first dividing and then multiplying. 267 - * To find the nearest divisor we calculate both and pick up the best 268 - * one. This avoids 64-bit arithmetics. 269 - */ 270 - unsigned long step, mul_min, mul_max, rate_min, rate_max; 271 - 272 - rate_max = clk_get_rate(clk->parent); 273 - 274 - /* output freq <= parent */ 275 - if (rate >= rate_max) 276 - return rate_max; 277 - 278 - step = DIV_ROUND_CLOSEST(rate_max, 32); 279 - /* output freq >= parent / 32 */ 280 - if (step >= rate) 281 - return step; 282 - 283 - mul_min = rate / step; 284 - mul_max = DIV_ROUND_UP(rate, step); 285 - rate_min = step * mul_min; 286 - if (mul_max == mul_min) 287 - return rate_min; 288 - 289 - rate_max = step * mul_max; 290 - 291 - if (rate_max - rate < rate - rate_min) 292 - return rate_max; 293 - 294 - return rate_min; 295 - } 296 - 297 - static unsigned long zclk_recalc(struct clk *clk) 298 - { 299 - void __iomem *frqcrc = FRQCRC - (u32)clk->enable_reg + clk->mapped_reg; 300 - unsigned int max = clk->div_mask + 1; 301 - unsigned long val = ((ioread32(frqcrc) >> clk->enable_bit) & 302 - clk->div_mask); 303 - 304 - return DIV_ROUND_CLOSEST(clk_get_rate(clk->parent), max) * 305 - (max - val); 306 - } 307 - 308 - static struct sh_clk_ops zclk_ops = { 309 - .recalc = zclk_recalc, 310 - .set_rate = zclk_set_rate, 311 - .round_rate = zclk_round_rate, 312 - }; 313 - 314 - static struct clk z_clk = { 315 - .parent = &pll0_clk, 316 - .div_mask = 0x1f, 317 - .enable_bit = 8, 318 - /* We'll need to access FRQCRB and FRQCRC */ 319 - .enable_reg = (void __iomem *)FRQCRB, 320 - .ops = &zclk_ops, 321 - }; 322 - 323 - /* 324 - * It seems only 1/2 divider is usable in manual mode. 1/2 / 2/3 325 - * switching is only available in auto-DVFS mode 326 - */ 327 - SH_FIXED_RATIO_CLK(pll0_div2_clk, pll0_clk, div2); 328 - 329 - static struct clk z2_clk = { 330 - .parent = &pll0_div2_clk, 331 - .div_mask = 0x1f, 332 - .enable_bit = 0, 333 - /* We'll need to access FRQCRB and FRQCRC */ 334 - .enable_reg = (void __iomem *)FRQCRB, 335 - .ops = &zclk_ops, 336 - }; 337 - 338 - static struct clk *main_clks[] = { 339 - &extalr_clk, 340 - &extal1_clk, 341 - &extal1_div2_clk, 342 - &extal2_clk, 343 - &extal2_div2_clk, 344 - &extal2_div4_clk, 345 - &main_clk, 346 - &main_div2_clk, 347 - &fsiack_clk, 348 - &fsibck_clk, 349 - &pll0_clk, 350 - &pll1_clk, 351 - &pll1_div2_clk, 352 - &pll2_clk, 353 - &pll2s_clk, 354 - &pll2h_clk, 355 - &z_clk, 356 - &pll0_div2_clk, 357 - &z2_clk, 358 - }; 359 - 360 - /* DIV4 */ 361 - static void div4_kick(struct clk *clk) 362 - { 363 - if (!WARN(!atomic_inc_and_test(&frqcr_lock), "FRQCR* lock broken!\n")) 364 - frqcr_kick_do(clk); 365 - atomic_dec(&frqcr_lock); 366 - } 367 - 368 - static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 24, 0, 36, 48, 10}; 369 - 370 - static struct clk_div_mult_table div4_div_mult_table = { 371 - .divisors = divisors, 372 - .nr_divisors = ARRAY_SIZE(divisors), 373 - }; 374 - 375 - static struct clk_div4_table div4_table = { 376 - .div_mult_table = &div4_div_mult_table, 377 - .kick = div4_kick, 378 - }; 379 - 380 - enum { 381 - DIV4_I, DIV4_M3, DIV4_B, DIV4_M1, DIV4_M2, 382 - DIV4_ZX, DIV4_ZS, DIV4_HP, 383 - DIV4_NR }; 384 - 385 - static struct clk div4_clks[DIV4_NR] = { 386 - [DIV4_I] = SH_CLK_DIV4(&pll1_clk, FRQCRA, 20, 0x0dff, CLK_ENABLE_ON_INIT), 387 - [DIV4_M3] = SH_CLK_DIV4(&pll1_clk, FRQCRA, 12, 0x1dff, CLK_ENABLE_ON_INIT), 388 - [DIV4_B] = SH_CLK_DIV4(&pll1_clk, FRQCRA, 8, 0x0dff, CLK_ENABLE_ON_INIT), 389 - [DIV4_M1] = SH_CLK_DIV4(&pll1_clk, FRQCRA, 4, 0x1dff, 0), 390 - [DIV4_M2] = SH_CLK_DIV4(&pll1_clk, FRQCRA, 0, 0x1dff, 0), 391 - [DIV4_ZX] = SH_CLK_DIV4(&pll1_clk, FRQCRB, 12, 0x0dff, 0), 392 - [DIV4_ZS] = SH_CLK_DIV4(&pll1_clk, FRQCRB, 8, 0x0dff, 0), 393 - [DIV4_HP] = SH_CLK_DIV4(&pll1_clk, FRQCRB, 4, 0x0dff, 0), 394 - }; 395 - 396 - enum { 397 - DIV6_ZB, 398 - DIV6_SDHI0, DIV6_SDHI1, DIV6_SDHI2, 399 - DIV6_MMC0, DIV6_MMC1, 400 - DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_VCK4, DIV6_VCK5, 401 - DIV6_FSIA, DIV6_FSIB, 402 - DIV6_MP, DIV6_M4, DIV6_HSI, DIV6_SPUV, 403 - DIV6_NR }; 404 - 405 - static struct clk *div6_parents[8] = { 406 - [0] = &pll1_div2_clk, 407 - [1] = &pll2s_clk, 408 - [3] = &extal2_clk, 409 - [4] = &main_div2_clk, 410 - [6] = &extalr_clk, 411 - }; 412 - 413 - static struct clk *fsia_parents[4] = { 414 - [0] = &pll1_div2_clk, 415 - [1] = &pll2s_clk, 416 - [2] = &fsiack_clk, 417 - }; 418 - 419 - static struct clk *fsib_parents[4] = { 420 - [0] = &pll1_div2_clk, 421 - [1] = &pll2s_clk, 422 - [2] = &fsibck_clk, 423 - }; 424 - 425 - static struct clk *mp_parents[4] = { 426 - [0] = &pll1_div2_clk, 427 - [1] = &pll2s_clk, 428 - [2] = &extal2_clk, 429 - [3] = &extal2_clk, 430 - }; 431 - 432 - static struct clk *m4_parents[2] = { 433 - [0] = &pll2s_clk, 434 - }; 435 - 436 - static struct clk *hsi_parents[4] = { 437 - [0] = &pll2h_clk, 438 - [1] = &pll1_div2_clk, 439 - [3] = &pll2s_clk, 440 - }; 441 - 442 - /*** FIXME *** 443 - * SH_CLK_DIV6_EXT() macro doesn't care .mapping 444 - * but, it is necessary on R-Car (= ioremap() base CPG) 445 - * The difference between 446 - * SH_CLK_DIV6_EXT() <--> SH_CLK_MAP_DIV6_EXT() 447 - * is only .mapping 448 - */ 449 - #define SH_CLK_MAP_DIV6_EXT(_reg, _flags, _parents, \ 450 - _num_parents, _src_shift, _src_width) \ 451 - { \ 452 - .enable_reg = (void __iomem *)_reg, \ 453 - .enable_bit = 0, /* unused */ \ 454 - .flags = _flags | CLK_MASK_DIV_ON_DISABLE, \ 455 - .div_mask = SH_CLK_DIV6_MSK, \ 456 - .parent_table = _parents, \ 457 - .parent_num = _num_parents, \ 458 - .src_shift = _src_shift, \ 459 - .src_width = _src_width, \ 460 - .mapping = &cpg_mapping, \ 461 - } 462 - 463 - static struct clk div6_clks[DIV6_NR] = { 464 - [DIV6_ZB] = SH_CLK_MAP_DIV6_EXT(ZBCKCR, CLK_ENABLE_ON_INIT, 465 - div6_parents, 2, 7, 1), 466 - [DIV6_SDHI0] = SH_CLK_MAP_DIV6_EXT(SD0CKCR, 0, 467 - div6_parents, 2, 6, 2), 468 - [DIV6_SDHI1] = SH_CLK_MAP_DIV6_EXT(SD1CKCR, 0, 469 - div6_parents, 2, 6, 2), 470 - [DIV6_SDHI2] = SH_CLK_MAP_DIV6_EXT(SD2CKCR, 0, 471 - div6_parents, 2, 6, 2), 472 - [DIV6_MMC0] = SH_CLK_MAP_DIV6_EXT(MMC0CKCR, 0, 473 - div6_parents, 2, 6, 2), 474 - [DIV6_MMC1] = SH_CLK_MAP_DIV6_EXT(MMC1CKCR, 0, 475 - div6_parents, 2, 6, 2), 476 - [DIV6_VCK1] = SH_CLK_MAP_DIV6_EXT(VCLKCR1, 0, /* didn't care bit[6-7] */ 477 - div6_parents, ARRAY_SIZE(div6_parents), 12, 3), 478 - [DIV6_VCK2] = SH_CLK_MAP_DIV6_EXT(VCLKCR2, 0, /* didn't care bit[6-7] */ 479 - div6_parents, ARRAY_SIZE(div6_parents), 12, 3), 480 - [DIV6_VCK3] = SH_CLK_MAP_DIV6_EXT(VCLKCR3, 0, /* didn't care bit[6-7] */ 481 - div6_parents, ARRAY_SIZE(div6_parents), 12, 3), 482 - [DIV6_VCK4] = SH_CLK_MAP_DIV6_EXT(VCLKCR4, 0, /* didn't care bit[6-7] */ 483 - div6_parents, ARRAY_SIZE(div6_parents), 12, 3), 484 - [DIV6_VCK5] = SH_CLK_MAP_DIV6_EXT(VCLKCR5, 0, /* didn't care bit[6-7] */ 485 - div6_parents, ARRAY_SIZE(div6_parents), 12, 3), 486 - [DIV6_FSIA] = SH_CLK_MAP_DIV6_EXT(FSIACKCR, 0, 487 - fsia_parents, ARRAY_SIZE(fsia_parents), 6, 2), 488 - [DIV6_FSIB] = SH_CLK_MAP_DIV6_EXT(FSIBCKCR, 0, 489 - fsib_parents, ARRAY_SIZE(fsib_parents), 6, 2), 490 - [DIV6_MP] = SH_CLK_MAP_DIV6_EXT(MPCKCR, 0, /* it needs bit[9-11] control */ 491 - mp_parents, ARRAY_SIZE(mp_parents), 6, 2), 492 - /* pll2s will be selected always for M4 */ 493 - [DIV6_M4] = SH_CLK_MAP_DIV6_EXT(M4CKCR, 0, /* it needs bit[9] control */ 494 - m4_parents, ARRAY_SIZE(m4_parents), 6, 1), 495 - [DIV6_HSI] = SH_CLK_MAP_DIV6_EXT(HSICKCR, 0, /* it needs bit[9] control */ 496 - hsi_parents, ARRAY_SIZE(hsi_parents), 6, 2), 497 - [DIV6_SPUV] = SH_CLK_MAP_DIV6_EXT(SPUVCKCR, 0, 498 - mp_parents, ARRAY_SIZE(mp_parents), 6, 2), 499 - }; 500 - 501 - /* MSTP */ 502 - enum { 503 - MSTP218, MSTP217, MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, 504 - MSTP329, MSTP323, MSTP318, MSTP317, MSTP316, 505 - MSTP315, MSTP314, MSTP313, MSTP312, MSTP305, MSTP300, 506 - MSTP411, MSTP410, MSTP409, 507 - MSTP522, MSTP515, 508 - MSTP_NR 509 - }; 510 - 511 - static struct clk mstp_clks[MSTP_NR] = { 512 - [MSTP204] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 4, 0), /* SCIFA0 */ 513 - [MSTP203] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 3, 0), /* SCIFA1 */ 514 - [MSTP206] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 6, 0), /* SCIFB0 */ 515 - [MSTP207] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 7, 0), /* SCIFB1 */ 516 - [MSTP216] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 16, 0), /* SCIFB2 */ 517 - [MSTP217] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 17, 0), /* SCIFB3 */ 518 - [MSTP218] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC */ 519 - [MSTP300] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 0, 0), /* IIC2 */ 520 - [MSTP305] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC1],SMSTPCR3, 5, 0), /* MMCIF1 */ 521 - [MSTP312] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI2],SMSTPCR3, 12, 0), /* SDHI2 */ 522 - [MSTP313] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI1],SMSTPCR3, 13, 0), /* SDHI1 */ 523 - [MSTP314] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI0],SMSTPCR3, 14, 0), /* SDHI0 */ 524 - [MSTP315] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC0],SMSTPCR3, 15, 0), /* MMCIF0 */ 525 - [MSTP316] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 16, 0), /* IIC6 */ 526 - [MSTP317] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 17, 0), /* IIC7 */ 527 - [MSTP318] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 18, 0), /* IIC0 */ 528 - [MSTP323] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ 529 - [MSTP329] = SH_CLK_MSTP32(&extalr_clk, SMSTPCR3, 29, 0), /* CMT10 */ 530 - [MSTP409] = SH_CLK_MSTP32(&main_div2_clk, SMSTPCR4, 9, 0), /* IIC5 */ 531 - [MSTP410] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */ 532 - [MSTP411] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ 533 - [MSTP522] = SH_CLK_MSTP32(&extal2_clk, SMSTPCR5, 22, 0), /* Thermal */ 534 - [MSTP515] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR5, 15, 0), /* IIC8 */ 535 - }; 536 - 537 - static struct clk_lookup lookups[] = { 538 - /* main clock */ 539 - CLKDEV_CON_ID("extal1", &extal1_clk), 540 - CLKDEV_CON_ID("extal1_div2", &extal1_div2_clk), 541 - CLKDEV_CON_ID("extal2", &extal2_clk), 542 - CLKDEV_CON_ID("extal2_div2", &extal2_div2_clk), 543 - CLKDEV_CON_ID("extal2_div4", &extal2_div4_clk), 544 - CLKDEV_CON_ID("fsiack", &fsiack_clk), 545 - CLKDEV_CON_ID("fsibck", &fsibck_clk), 546 - 547 - /* pll clock */ 548 - CLKDEV_CON_ID("pll1", &pll1_clk), 549 - CLKDEV_CON_ID("pll1_div2", &pll1_div2_clk), 550 - CLKDEV_CON_ID("pll2", &pll2_clk), 551 - CLKDEV_CON_ID("pll2s", &pll2s_clk), 552 - CLKDEV_CON_ID("pll2h", &pll2h_clk), 553 - 554 - /* CPU clock */ 555 - CLKDEV_DEV_ID("cpu0", &z_clk), 556 - 557 - /* DIV6 */ 558 - CLKDEV_CON_ID("zb", &div6_clks[DIV6_ZB]), 559 - CLKDEV_CON_ID("vck1", &div6_clks[DIV6_VCK1]), 560 - CLKDEV_CON_ID("vck2", &div6_clks[DIV6_VCK2]), 561 - CLKDEV_CON_ID("vck3", &div6_clks[DIV6_VCK3]), 562 - CLKDEV_CON_ID("vck4", &div6_clks[DIV6_VCK4]), 563 - CLKDEV_CON_ID("vck5", &div6_clks[DIV6_VCK5]), 564 - CLKDEV_CON_ID("fsia", &div6_clks[DIV6_FSIA]), 565 - CLKDEV_CON_ID("fsib", &div6_clks[DIV6_FSIB]), 566 - CLKDEV_CON_ID("mp", &div6_clks[DIV6_MP]), 567 - CLKDEV_CON_ID("m4", &div6_clks[DIV6_M4]), 568 - CLKDEV_CON_ID("hsi", &div6_clks[DIV6_HSI]), 569 - CLKDEV_CON_ID("spuv", &div6_clks[DIV6_SPUV]), 570 - 571 - /* MSTP */ 572 - CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), 573 - CLKDEV_DEV_ID("e6c40000.serial", &mstp_clks[MSTP204]), 574 - CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), 575 - CLKDEV_DEV_ID("e6c50000.serial", &mstp_clks[MSTP203]), 576 - CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP206]), 577 - CLKDEV_DEV_ID("e6c20000.serial", &mstp_clks[MSTP206]), 578 - CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP207]), 579 - CLKDEV_DEV_ID("e6c30000.serial", &mstp_clks[MSTP207]), 580 - CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP216]), 581 - CLKDEV_DEV_ID("e6ce0000.serial", &mstp_clks[MSTP216]), 582 - CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP217]), 583 - CLKDEV_DEV_ID("e6cf0000.serial", &mstp_clks[MSTP217]), 584 - CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), 585 - CLKDEV_DEV_ID("e6700020.dma-controller", &mstp_clks[MSTP218]), 586 - CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), 587 - CLKDEV_DEV_ID("e6520000.i2c", &mstp_clks[MSTP300]), 588 - CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]), 589 - CLKDEV_DEV_ID("ee220000.mmc", &mstp_clks[MSTP305]), 590 - CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]), 591 - CLKDEV_DEV_ID("ee140000.sd", &mstp_clks[MSTP312]), 592 - CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), 593 - CLKDEV_DEV_ID("ee120000.sd", &mstp_clks[MSTP313]), 594 - CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), 595 - CLKDEV_DEV_ID("ee100000.sd", &mstp_clks[MSTP314]), 596 - CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]), 597 - CLKDEV_DEV_ID("ee200000.mmc", &mstp_clks[MSTP315]), 598 - CLKDEV_DEV_ID("e6550000.i2c", &mstp_clks[MSTP316]), 599 - CLKDEV_DEV_ID("e6560000.i2c", &mstp_clks[MSTP317]), 600 - CLKDEV_DEV_ID("e6500000.i2c", &mstp_clks[MSTP318]), 601 - CLKDEV_DEV_ID("e6510000.i2c", &mstp_clks[MSTP323]), 602 - CLKDEV_ICK_ID("fck", "sh-cmt-48-gen2.1", &mstp_clks[MSTP329]), 603 - CLKDEV_ICK_ID("fck", "e6130000.timer", &mstp_clks[MSTP329]), 604 - CLKDEV_DEV_ID("e60b0000.i2c", &mstp_clks[MSTP409]), 605 - CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP410]), 606 - CLKDEV_DEV_ID("e6530000.i2c", &mstp_clks[MSTP411]), 607 - CLKDEV_DEV_ID("e6570000.i2c", &mstp_clks[MSTP515]), 608 - 609 - /* for DT */ 610 - CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]), 611 - }; 612 - 613 - void __init r8a73a4_clock_init(void) 614 - { 615 - void __iomem *reg; 616 - int k, ret = 0; 617 - u32 ckscr; 618 - 619 - atomic_set(&frqcr_lock, -1); 620 - 621 - reg = ioremap_nocache(CKSCR, PAGE_SIZE); 622 - BUG_ON(!reg); 623 - ckscr = ioread32(reg); 624 - iounmap(reg); 625 - 626 - switch ((ckscr >> 28) & 0x3) { 627 - case 0: 628 - main_clk.parent = &extal1_clk; 629 - break; 630 - case 1: 631 - main_clk.parent = &extal1_div2_clk; 632 - break; 633 - case 2: 634 - main_clk.parent = &extal2_clk; 635 - break; 636 - case 3: 637 - main_clk.parent = &extal2_div2_clk; 638 - break; 639 - } 640 - 641 - for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 642 - ret = clk_register(main_clks[k]); 643 - 644 - if (!ret) 645 - ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 646 - 647 - if (!ret) 648 - ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR); 649 - 650 - if (!ret) 651 - ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 652 - 653 - clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 654 - 655 - if (!ret) 656 - shmobile_clk_init(); 657 - else 658 - panic("failed to setup r8a73a4 clocks\n"); 659 - }
-620
arch/arm/mach-shmobile/clock-sh7372.c
··· 1 - /* 2 - * SH7372 clock framework support 3 - * 4 - * Copyright (C) 2010 Magnus Damm 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; either 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 - #include <linux/init.h> 16 - #include <linux/kernel.h> 17 - #include <linux/io.h> 18 - #include <linux/sh_clk.h> 19 - #include <linux/clkdev.h> 20 - #include "clock.h" 21 - #include "common.h" 22 - 23 - /* SH7372 registers */ 24 - #define FRQCRA IOMEM(0xe6150000) 25 - #define FRQCRB IOMEM(0xe6150004) 26 - #define FRQCRC IOMEM(0xe61500e0) 27 - #define FRQCRD IOMEM(0xe61500e4) 28 - #define VCLKCR1 IOMEM(0xe6150008) 29 - #define VCLKCR2 IOMEM(0xe615000c) 30 - #define VCLKCR3 IOMEM(0xe615001c) 31 - #define FMSICKCR IOMEM(0xe6150010) 32 - #define FMSOCKCR IOMEM(0xe6150014) 33 - #define FSIACKCR IOMEM(0xe6150018) 34 - #define FSIBCKCR IOMEM(0xe6150090) 35 - #define SUBCKCR IOMEM(0xe6150080) 36 - #define SPUCKCR IOMEM(0xe6150084) 37 - #define VOUCKCR IOMEM(0xe6150088) 38 - #define HDMICKCR IOMEM(0xe6150094) 39 - #define DSITCKCR IOMEM(0xe6150060) 40 - #define DSI0PCKCR IOMEM(0xe6150064) 41 - #define DSI1PCKCR IOMEM(0xe6150098) 42 - #define PLLC01CR IOMEM(0xe6150028) 43 - #define PLLC2CR IOMEM(0xe615002c) 44 - #define RMSTPCR0 IOMEM(0xe6150110) 45 - #define RMSTPCR1 IOMEM(0xe6150114) 46 - #define RMSTPCR2 IOMEM(0xe6150118) 47 - #define RMSTPCR3 IOMEM(0xe615011c) 48 - #define RMSTPCR4 IOMEM(0xe6150120) 49 - #define SMSTPCR0 IOMEM(0xe6150130) 50 - #define SMSTPCR1 IOMEM(0xe6150134) 51 - #define SMSTPCR2 IOMEM(0xe6150138) 52 - #define SMSTPCR3 IOMEM(0xe615013c) 53 - #define SMSTPCR4 IOMEM(0xe6150140) 54 - 55 - #define FSIDIVA 0xFE1F8000 56 - #define FSIDIVB 0xFE1F8008 57 - 58 - /* Platforms must set frequency on their DV_CLKI pin */ 59 - struct clk sh7372_dv_clki_clk = { 60 - }; 61 - 62 - /* Fixed 32 KHz root clock from EXTALR pin */ 63 - static struct clk r_clk = { 64 - .rate = 32768, 65 - }; 66 - 67 - /* 68 - * 26MHz default rate for the EXTAL1 root input clock. 69 - * If needed, reset this with clk_set_rate() from the platform code. 70 - */ 71 - struct clk sh7372_extal1_clk = { 72 - .rate = 26000000, 73 - }; 74 - 75 - /* 76 - * 48MHz default rate for the EXTAL2 root input clock. 77 - * If needed, reset this with clk_set_rate() from the platform code. 78 - */ 79 - struct clk sh7372_extal2_clk = { 80 - .rate = 48000000, 81 - }; 82 - 83 - SH_CLK_RATIO(div2, 1, 2); 84 - 85 - SH_FIXED_RATIO_CLKg(sh7372_dv_clki_div2_clk, sh7372_dv_clki_clk, div2); 86 - SH_FIXED_RATIO_CLK(extal1_div2_clk, sh7372_extal1_clk, div2); 87 - SH_FIXED_RATIO_CLK(extal2_div2_clk, sh7372_extal2_clk, div2); 88 - SH_FIXED_RATIO_CLK(extal2_div4_clk, extal2_div2_clk, div2); 89 - 90 - /* PLLC0 and PLLC1 */ 91 - static unsigned long pllc01_recalc(struct clk *clk) 92 - { 93 - unsigned long mult = 1; 94 - 95 - if (__raw_readl(PLLC01CR) & (1 << 14)) 96 - mult = (((__raw_readl(clk->enable_reg) >> 24) & 0x3f) + 1) * 2; 97 - 98 - return clk->parent->rate * mult; 99 - } 100 - 101 - static struct sh_clk_ops pllc01_clk_ops = { 102 - .recalc = pllc01_recalc, 103 - }; 104 - 105 - static struct clk pllc0_clk = { 106 - .ops = &pllc01_clk_ops, 107 - .flags = CLK_ENABLE_ON_INIT, 108 - .parent = &extal1_div2_clk, 109 - .enable_reg = (void __iomem *)FRQCRC, 110 - }; 111 - 112 - static struct clk pllc1_clk = { 113 - .ops = &pllc01_clk_ops, 114 - .flags = CLK_ENABLE_ON_INIT, 115 - .parent = &extal1_div2_clk, 116 - .enable_reg = (void __iomem *)FRQCRA, 117 - }; 118 - 119 - /* Divide PLLC1 by two */ 120 - SH_FIXED_RATIO_CLK(pllc1_div2_clk, pllc1_clk, div2); 121 - 122 - /* PLLC2 */ 123 - 124 - /* Indices are important - they are the actual src selecting values */ 125 - static struct clk *pllc2_parent[] = { 126 - [0] = &extal1_div2_clk, 127 - [1] = &extal2_div2_clk, 128 - [2] = &sh7372_dv_clki_div2_clk, 129 - }; 130 - 131 - /* Only multipliers 20 * 2 to 46 * 2 are valid, last entry for CPUFREQ_TABLE_END */ 132 - static struct cpufreq_frequency_table pllc2_freq_table[29]; 133 - 134 - static void pllc2_table_rebuild(struct clk *clk) 135 - { 136 - int i; 137 - 138 - /* Initialise PLLC2 frequency table */ 139 - for (i = 0; i < ARRAY_SIZE(pllc2_freq_table) - 2; i++) { 140 - pllc2_freq_table[i].frequency = clk->parent->rate * (i + 20) * 2; 141 - pllc2_freq_table[i].driver_data = i; 142 - } 143 - 144 - /* This is a special entry - switching PLL off makes it a repeater */ 145 - pllc2_freq_table[i].frequency = clk->parent->rate; 146 - pllc2_freq_table[i].driver_data = i; 147 - 148 - pllc2_freq_table[++i].frequency = CPUFREQ_TABLE_END; 149 - pllc2_freq_table[i].driver_data = i; 150 - } 151 - 152 - static unsigned long pllc2_recalc(struct clk *clk) 153 - { 154 - unsigned long mult = 1; 155 - 156 - pllc2_table_rebuild(clk); 157 - 158 - /* 159 - * If the PLL is off, mult == 1, clk->rate will be updated in 160 - * pllc2_enable(). 161 - */ 162 - if (__raw_readl(PLLC2CR) & (1 << 31)) 163 - mult = (((__raw_readl(PLLC2CR) >> 24) & 0x3f) + 1) * 2; 164 - 165 - return clk->parent->rate * mult; 166 - } 167 - 168 - static long pllc2_round_rate(struct clk *clk, unsigned long rate) 169 - { 170 - return clk_rate_table_round(clk, clk->freq_table, rate); 171 - } 172 - 173 - static int pllc2_enable(struct clk *clk) 174 - { 175 - int i; 176 - 177 - __raw_writel(__raw_readl(PLLC2CR) | 0x80000000, PLLC2CR); 178 - 179 - for (i = 0; i < 100; i++) 180 - if (__raw_readl(PLLC2CR) & 0x80000000) { 181 - clk->rate = pllc2_recalc(clk); 182 - return 0; 183 - } 184 - 185 - pr_err("%s(): timeout!\n", __func__); 186 - 187 - return -ETIMEDOUT; 188 - } 189 - 190 - static void pllc2_disable(struct clk *clk) 191 - { 192 - __raw_writel(__raw_readl(PLLC2CR) & ~0x80000000, PLLC2CR); 193 - } 194 - 195 - static int pllc2_set_rate(struct clk *clk, unsigned long rate) 196 - { 197 - unsigned long value; 198 - int idx; 199 - 200 - idx = clk_rate_table_find(clk, clk->freq_table, rate); 201 - if (idx < 0) 202 - return idx; 203 - 204 - if (rate == clk->parent->rate) 205 - return -EINVAL; 206 - 207 - value = __raw_readl(PLLC2CR) & ~(0x3f << 24); 208 - 209 - __raw_writel(value | ((idx + 19) << 24), PLLC2CR); 210 - 211 - clk->rate = clk->freq_table[idx].frequency; 212 - 213 - return 0; 214 - } 215 - 216 - static int pllc2_set_parent(struct clk *clk, struct clk *parent) 217 - { 218 - u32 value; 219 - int ret, i; 220 - 221 - if (!clk->parent_table || !clk->parent_num) 222 - return -EINVAL; 223 - 224 - /* Search the parent */ 225 - for (i = 0; i < clk->parent_num; i++) 226 - if (clk->parent_table[i] == parent) 227 - break; 228 - 229 - if (i == clk->parent_num) 230 - return -ENODEV; 231 - 232 - ret = clk_reparent(clk, parent); 233 - if (ret < 0) 234 - return ret; 235 - 236 - value = __raw_readl(PLLC2CR) & ~(3 << 6); 237 - 238 - __raw_writel(value | (i << 6), PLLC2CR); 239 - 240 - /* Rebiuld the frequency table */ 241 - pllc2_table_rebuild(clk); 242 - 243 - return 0; 244 - } 245 - 246 - static struct sh_clk_ops pllc2_clk_ops = { 247 - .recalc = pllc2_recalc, 248 - .round_rate = pllc2_round_rate, 249 - .set_rate = pllc2_set_rate, 250 - .enable = pllc2_enable, 251 - .disable = pllc2_disable, 252 - .set_parent = pllc2_set_parent, 253 - }; 254 - 255 - struct clk sh7372_pllc2_clk = { 256 - .ops = &pllc2_clk_ops, 257 - .parent = &extal1_div2_clk, 258 - .freq_table = pllc2_freq_table, 259 - .nr_freqs = ARRAY_SIZE(pllc2_freq_table) - 1, 260 - .parent_table = pllc2_parent, 261 - .parent_num = ARRAY_SIZE(pllc2_parent), 262 - }; 263 - 264 - /* External input clock (pin name: FSIACK/FSIBCK ) */ 265 - static struct clk fsiack_clk = { 266 - }; 267 - 268 - static struct clk fsibck_clk = { 269 - }; 270 - 271 - static struct clk *main_clks[] = { 272 - &sh7372_dv_clki_clk, 273 - &r_clk, 274 - &sh7372_extal1_clk, 275 - &sh7372_extal2_clk, 276 - &sh7372_dv_clki_div2_clk, 277 - &extal1_div2_clk, 278 - &extal2_div2_clk, 279 - &extal2_div4_clk, 280 - &pllc0_clk, 281 - &pllc1_clk, 282 - &pllc1_div2_clk, 283 - &sh7372_pllc2_clk, 284 - &fsiack_clk, 285 - &fsibck_clk, 286 - }; 287 - 288 - static void div4_kick(struct clk *clk) 289 - { 290 - unsigned long value; 291 - 292 - /* set KICK bit in FRQCRB to update hardware setting */ 293 - value = __raw_readl(FRQCRB); 294 - value |= (1 << 31); 295 - __raw_writel(value, FRQCRB); 296 - } 297 - 298 - static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 299 - 24, 32, 36, 48, 0, 72, 96, 0 }; 300 - 301 - static struct clk_div_mult_table div4_div_mult_table = { 302 - .divisors = divisors, 303 - .nr_divisors = ARRAY_SIZE(divisors), 304 - }; 305 - 306 - static struct clk_div4_table div4_table = { 307 - .div_mult_table = &div4_div_mult_table, 308 - .kick = div4_kick, 309 - }; 310 - 311 - enum { DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_CSIR, 312 - DIV4_ZX, DIV4_HP, 313 - DIV4_ISPB, DIV4_S, DIV4_ZB, DIV4_ZB3, DIV4_CP, 314 - DIV4_DDRP, DIV4_NR }; 315 - 316 - #define DIV4(_reg, _bit, _mask, _flags) \ 317 - SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags) 318 - 319 - static struct clk div4_clks[DIV4_NR] = { 320 - [DIV4_I] = DIV4(FRQCRA, 20, 0x6fff, CLK_ENABLE_ON_INIT), 321 - [DIV4_ZG] = DIV4(FRQCRA, 16, 0x6fff, CLK_ENABLE_ON_INIT), 322 - [DIV4_B] = DIV4(FRQCRA, 8, 0x6fff, CLK_ENABLE_ON_INIT), 323 - [DIV4_M1] = DIV4(FRQCRA, 4, 0x6fff, CLK_ENABLE_ON_INIT), 324 - [DIV4_CSIR] = DIV4(FRQCRA, 0, 0x6fff, 0), 325 - [DIV4_ZX] = DIV4(FRQCRB, 12, 0x6fff, 0), 326 - [DIV4_HP] = DIV4(FRQCRB, 4, 0x6fff, 0), 327 - [DIV4_ISPB] = DIV4(FRQCRC, 20, 0x6fff, 0), 328 - [DIV4_S] = DIV4(FRQCRC, 12, 0x6fff, 0), 329 - [DIV4_ZB] = DIV4(FRQCRC, 8, 0x6fff, 0), 330 - [DIV4_ZB3] = DIV4(FRQCRC, 4, 0x6fff, 0), 331 - [DIV4_CP] = DIV4(FRQCRC, 0, 0x6fff, 0), 332 - [DIV4_DDRP] = DIV4(FRQCRD, 0, 0x677c, 0), 333 - }; 334 - 335 - enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_FMSI, DIV6_FMSO, 336 - DIV6_SUB, DIV6_SPU, 337 - DIV6_VOU, DIV6_DSIT, DIV6_DSI0P, DIV6_DSI1P, 338 - DIV6_NR }; 339 - 340 - static struct clk div6_clks[DIV6_NR] = { 341 - [DIV6_VCK1] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR1, 0), 342 - [DIV6_VCK2] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR2, 0), 343 - [DIV6_VCK3] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR3, 0), 344 - [DIV6_FMSI] = SH_CLK_DIV6(&pllc1_div2_clk, FMSICKCR, 0), 345 - [DIV6_FMSO] = SH_CLK_DIV6(&pllc1_div2_clk, FMSOCKCR, 0), 346 - [DIV6_SUB] = SH_CLK_DIV6(&sh7372_extal2_clk, SUBCKCR, 0), 347 - [DIV6_SPU] = SH_CLK_DIV6(&pllc1_div2_clk, SPUCKCR, 0), 348 - [DIV6_VOU] = SH_CLK_DIV6(&pllc1_div2_clk, VOUCKCR, 0), 349 - [DIV6_DSIT] = SH_CLK_DIV6(&pllc1_div2_clk, DSITCKCR, 0), 350 - [DIV6_DSI0P] = SH_CLK_DIV6(&pllc1_div2_clk, DSI0PCKCR, 0), 351 - [DIV6_DSI1P] = SH_CLK_DIV6(&pllc1_div2_clk, DSI1PCKCR, 0), 352 - }; 353 - 354 - enum { DIV6_HDMI, DIV6_FSIA, DIV6_FSIB, DIV6_REPARENT_NR }; 355 - 356 - /* Indices are important - they are the actual src selecting values */ 357 - static struct clk *hdmi_parent[] = { 358 - [0] = &pllc1_div2_clk, 359 - [1] = &sh7372_pllc2_clk, 360 - [2] = &sh7372_dv_clki_clk, 361 - [3] = NULL, /* pllc2_div4 not implemented yet */ 362 - }; 363 - 364 - static struct clk *fsiackcr_parent[] = { 365 - [0] = &pllc1_div2_clk, 366 - [1] = &sh7372_pllc2_clk, 367 - [2] = &fsiack_clk, /* external input for FSI A */ 368 - [3] = NULL, /* setting prohibited */ 369 - }; 370 - 371 - static struct clk *fsibckcr_parent[] = { 372 - [0] = &pllc1_div2_clk, 373 - [1] = &sh7372_pllc2_clk, 374 - [2] = &fsibck_clk, /* external input for FSI B */ 375 - [3] = NULL, /* setting prohibited */ 376 - }; 377 - 378 - static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { 379 - [DIV6_HDMI] = SH_CLK_DIV6_EXT(HDMICKCR, 0, 380 - hdmi_parent, ARRAY_SIZE(hdmi_parent), 6, 2), 381 - [DIV6_FSIA] = SH_CLK_DIV6_EXT(FSIACKCR, 0, 382 - fsiackcr_parent, ARRAY_SIZE(fsiackcr_parent), 6, 2), 383 - [DIV6_FSIB] = SH_CLK_DIV6_EXT(FSIBCKCR, 0, 384 - fsibckcr_parent, ARRAY_SIZE(fsibckcr_parent), 6, 2), 385 - }; 386 - 387 - /* FSI DIV */ 388 - enum { FSIDIV_A, FSIDIV_B, FSIDIV_REPARENT_NR }; 389 - 390 - static struct clk fsidivs[] = { 391 - [FSIDIV_A] = SH_CLK_FSIDIV(FSIDIVA, &div6_reparent_clks[DIV6_FSIA]), 392 - [FSIDIV_B] = SH_CLK_FSIDIV(FSIDIVB, &div6_reparent_clks[DIV6_FSIB]), 393 - }; 394 - 395 - enum { MSTP001, MSTP000, 396 - MSTP131, MSTP130, 397 - MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, 398 - MSTP118, MSTP117, MSTP116, MSTP113, 399 - MSTP106, MSTP101, MSTP100, 400 - MSTP223, 401 - MSTP218, MSTP217, MSTP216, MSTP214, MSTP208, MSTP207, 402 - MSTP206, MSTP205, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 403 - MSTP328, MSTP323, MSTP322, MSTP315, MSTP314, MSTP313, MSTP312, 404 - MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406, 405 - MSTP405, MSTP404, MSTP403, MSTP400, 406 - MSTP_NR }; 407 - 408 - #define MSTP(_parent, _reg, _bit, _flags) \ 409 - SH_CLK_MSTP32(_parent, _reg, _bit, _flags) 410 - 411 - static struct clk mstp_clks[MSTP_NR] = { 412 - [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */ 413 - [MSTP000] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 0, 0), /* MSIOF0 */ 414 - [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */ 415 - [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */ 416 - [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */ 417 - [MSTP128] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 28, 0), /* VEU0 */ 418 - [MSTP127] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 27, 0), /* CEU */ 419 - [MSTP126] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 26, 0), /* CSI2 */ 420 - [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ 421 - [MSTP118] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 18, 0), /* DSITX */ 422 - [MSTP117] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 17, 0), /* LCDC1 */ 423 - [MSTP116] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 16, 0), /* IIC0 */ 424 - [MSTP113] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 13, 0), /* MERAM */ 425 - [MSTP106] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 6, 0), /* JPU */ 426 - [MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */ 427 - [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ 428 - [MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */ 429 - [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ 430 - [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ 431 - [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ 432 - [MSTP214] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */ 433 - [MSTP208] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 8, 0), /* MSIOF1 */ 434 - [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ 435 - [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ 436 - [MSTP205] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 5, 0), /* MSIOF2 */ 437 - [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ 438 - [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ 439 - [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ 440 - [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */ 441 - [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ 442 - [MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */ 443 - [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */ 444 - [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */ 445 - [MSTP315] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 15, 0), /* FLCTL*/ 446 - [MSTP314] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */ 447 - [MSTP313] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */ 448 - [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */ 449 - [MSTP423] = MSTP(&div4_clks[DIV4_B], SMSTPCR4, 23, 0), /* DSITX1 */ 450 - [MSTP415] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */ 451 - [MSTP413] = MSTP(&pllc1_div2_clk, SMSTPCR4, 13, 0), /* HDMI */ 452 - [MSTP411] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 11, 0), /* IIC3 */ 453 - [MSTP410] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 10, 0), /* IIC4 */ 454 - [MSTP407] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 7, 0), /* USB-DMAC1 */ 455 - [MSTP406] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 6, 0), /* USB1 */ 456 - [MSTP405] = MSTP(&r_clk, SMSTPCR4, 5, 0), /* CMT4 */ 457 - [MSTP404] = MSTP(&r_clk, SMSTPCR4, 4, 0), /* CMT3 */ 458 - [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ 459 - [MSTP400] = MSTP(&r_clk, SMSTPCR4, 0, 0), /* CMT2 */ 460 - }; 461 - 462 - static struct clk_lookup lookups[] = { 463 - /* main clocks */ 464 - CLKDEV_CON_ID("dv_clki_div2_clk", &sh7372_dv_clki_div2_clk), 465 - CLKDEV_CON_ID("r_clk", &r_clk), 466 - CLKDEV_CON_ID("extal1", &sh7372_extal1_clk), 467 - CLKDEV_CON_ID("extal2", &sh7372_extal2_clk), 468 - CLKDEV_CON_ID("extal1_div2_clk", &extal1_div2_clk), 469 - CLKDEV_CON_ID("extal2_div2_clk", &extal2_div2_clk), 470 - CLKDEV_CON_ID("extal2_div4_clk", &extal2_div4_clk), 471 - CLKDEV_CON_ID("pllc0_clk", &pllc0_clk), 472 - CLKDEV_CON_ID("pllc1_clk", &pllc1_clk), 473 - CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk), 474 - CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk), 475 - CLKDEV_CON_ID("fsiack", &fsiack_clk), 476 - CLKDEV_CON_ID("fsibck", &fsibck_clk), 477 - 478 - /* DIV4 clocks */ 479 - CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]), 480 - CLKDEV_CON_ID("zg_clk", &div4_clks[DIV4_ZG]), 481 - CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]), 482 - CLKDEV_CON_ID("m1_clk", &div4_clks[DIV4_M1]), 483 - CLKDEV_CON_ID("csir_clk", &div4_clks[DIV4_CSIR]), 484 - CLKDEV_CON_ID("zx_clk", &div4_clks[DIV4_ZX]), 485 - CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]), 486 - CLKDEV_CON_ID("ispb_clk", &div4_clks[DIV4_ISPB]), 487 - CLKDEV_CON_ID("s_clk", &div4_clks[DIV4_S]), 488 - CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]), 489 - CLKDEV_CON_ID("zb3_clk", &div4_clks[DIV4_ZB3]), 490 - CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]), 491 - CLKDEV_CON_ID("ddrp_clk", &div4_clks[DIV4_DDRP]), 492 - 493 - /* DIV6 clocks */ 494 - CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]), 495 - CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]), 496 - CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]), 497 - CLKDEV_CON_ID("fmsi_clk", &div6_clks[DIV6_FMSI]), 498 - CLKDEV_CON_ID("fmso_clk", &div6_clks[DIV6_FMSO]), 499 - CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]), 500 - CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]), 501 - CLKDEV_CON_ID("vou_clk", &div6_clks[DIV6_VOU]), 502 - CLKDEV_CON_ID("hdmi_clk", &div6_reparent_clks[DIV6_HDMI]), 503 - 504 - /* MSTP32 clocks */ 505 - CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ 506 - CLKDEV_DEV_ID("fff30000.i2c", &mstp_clks[MSTP001]), /* IIC2 */ 507 - CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */ 508 - CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ 509 - CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ 510 - CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */ 511 - CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[MSTP128]), /* VEU0 */ 512 - CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU */ 513 - CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2 */ 514 - CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX0 */ 515 - CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), /* LCDC1 */ 516 - CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */ 517 - CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]), /* IIC0 */ 518 - CLKDEV_DEV_ID("sh_mobile_meram.0", &mstp_clks[MSTP113]), /* MERAM */ 519 - CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */ 520 - CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */ 521 - CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ 522 - CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */ 523 - CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */ 524 - CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */ 525 - CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */ 526 - CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */ 527 - CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), /* USB-DMAC0 */ 528 - CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[MSTP208]), /* MSIOF1 */ 529 - CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 530 - CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ 531 - CLKDEV_DEV_ID("spi_sh_msiof.2", &mstp_clks[MSTP205]), /* MSIOF2 */ 532 - CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ 533 - CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ 534 - CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ 535 - CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */ 536 - CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ 537 - CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */ 538 - CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */ 539 - CLKDEV_DEV_ID("e6c20000.i2c", &mstp_clks[MSTP323]), /* IIC1 */ 540 - CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */ 541 - CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */ 542 - CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP322]), /* USB0 */ 543 - CLKDEV_DEV_ID("sh_flctl.0", &mstp_clks[MSTP315]), /* FLCTL */ 544 - CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ 545 - CLKDEV_DEV_ID("e6850000.sdhi", &mstp_clks[MSTP314]), /* SDHI0 */ 546 - CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ 547 - CLKDEV_DEV_ID("e6860000.sdhi", &mstp_clks[MSTP313]), /* SDHI1 */ 548 - CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */ 549 - CLKDEV_DEV_ID("e6bd0000.mmcif", &mstp_clks[MSTP312]), /* MMC */ 550 - CLKDEV_DEV_ID("sh-mipi-dsi.1", &mstp_clks[MSTP423]), /* DSITX1 */ 551 - CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), /* SDHI2 */ 552 - CLKDEV_DEV_ID("e6870000.sdhi", &mstp_clks[MSTP415]), /* SDHI2 */ 553 - CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */ 554 - CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */ 555 - CLKDEV_DEV_ID("e6d20000.i2c", &mstp_clks[MSTP411]), /* IIC3 */ 556 - CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */ 557 - CLKDEV_DEV_ID("e6d30000.i2c", &mstp_clks[MSTP410]), /* IIC4 */ 558 - CLKDEV_DEV_ID("sh-dma-engine.4", &mstp_clks[MSTP407]), /* USB-DMAC1 */ 559 - CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */ 560 - CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */ 561 - CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */ 562 - CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ 563 - 564 - /* ICK */ 565 - CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), 566 - CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), 567 - CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), 568 - CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), 569 - CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1", 570 - &div6_reparent_clks[DIV6_HDMI]), 571 - CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]), 572 - CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]), 573 - CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]), 574 - CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), /* TMU0 */ 575 - CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]), 576 - CLKDEV_ICK_ID("fck", "sh-cmt-32-fast.4", &mstp_clks[MSTP405]), /* CMT4 */ 577 - CLKDEV_ICK_ID("fck", "sh-cmt-32-fast.3", &mstp_clks[MSTP404]), /* CMT3 */ 578 - CLKDEV_ICK_ID("fck", "sh-cmt-32-fast.2", &mstp_clks[MSTP400]), /* CMT2 */ 579 - CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]), 580 - CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]), 581 - CLKDEV_ICK_ID("xcka", "sh_fsi2", &fsiack_clk), 582 - CLKDEV_ICK_ID("xckb", "sh_fsi2", &fsibck_clk), 583 - }; 584 - 585 - void __init sh7372_clock_init(void) 586 - { 587 - int k, ret = 0; 588 - 589 - /* make sure MSTP bits on the RT/SH4AL-DSP side are off */ 590 - __raw_writel(0xe4ef8087, RMSTPCR0); 591 - __raw_writel(0xffffffff, RMSTPCR1); 592 - __raw_writel(0x37c7f7ff, RMSTPCR2); 593 - __raw_writel(0xffffffff, RMSTPCR3); 594 - __raw_writel(0xffe0fffd, RMSTPCR4); 595 - 596 - for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 597 - ret = clk_register(main_clks[k]); 598 - 599 - if (!ret) 600 - ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 601 - 602 - if (!ret) 603 - ret = sh_clk_div6_register(div6_clks, DIV6_NR); 604 - 605 - if (!ret) 606 - ret = sh_clk_div6_reparent_register(div6_reparent_clks, DIV6_REPARENT_NR); 607 - 608 - if (!ret) 609 - ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 610 - 611 - if (!ret) 612 - ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR); 613 - 614 - clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 615 - 616 - if (!ret) 617 - shmobile_clk_init(); 618 - else 619 - panic("failed to setup sh7372 clocks\n"); 620 - }
-11
arch/arm/mach-shmobile/clock.c
··· 45 45 46 46 return 0; 47 47 } 48 - 49 - int __clk_get(struct clk *clk) 50 - { 51 - return 1; 52 - } 53 - EXPORT_SYMBOL(__clk_get); 54 - 55 - void __clk_put(struct clk *clk) 56 - { 57 - } 58 - EXPORT_SYMBOL(__clk_put);
-1
arch/arm/mach-shmobile/common.h
··· 21 21 extern int shmobile_smp_scu_cpu_kill(unsigned int cpu); 22 22 struct clk; 23 23 extern int shmobile_clk_init(void); 24 - extern void shmobile_handle_irq_intc(struct pt_regs *); 25 24 extern struct platform_suspend_ops shmobile_suspend_ops; 26 25 27 26 #ifdef CONFIG_SUSPEND
-54
arch/arm/mach-shmobile/entry-intc.S
··· 1 - /* 2 - * ARM Interrupt demux handler using INTC 3 - * 4 - * Copyright (C) 2010 Magnus Damm 5 - * Copyright (C) 2008 Renesas Solutions Corp. 6 - * 7 - * This file is licensed under the terms of the GNU General Public 8 - * License version 2. This program is licensed "as is" without any 9 - * warranty of any kind, whether express or implied. 10 - */ 11 - 12 - #include <asm/entry-macro-multi.S> 13 - 14 - #define INTCA_BASE 0xe6980000 15 - #define INTFLGA_OFFS 0x00000018 /* accept pending interrupt */ 16 - #define INTEVTA_OFFS 0x00000020 /* vector number of accepted interrupt */ 17 - #define INTLVLA_OFFS 0x00000030 /* priority level of accepted interrupt */ 18 - #define INTLVLB_OFFS 0x00000034 /* previous priority level */ 19 - 20 - .macro get_irqnr_preamble, base, tmp 21 - ldr \base, =INTCA_BASE 22 - .endm 23 - 24 - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 25 - /* The single INTFLGA read access below results in the following: 26 - * 27 - * 1. INTLVLB is updated with old priority value from INTLVLA 28 - * 2. Highest priority interrupt is accepted 29 - * 3. INTLVLA is updated to contain priority of accepted interrupt 30 - * 4. Accepted interrupt vector is stored in INTFLGA and INTEVTA 31 - */ 32 - ldr \irqnr, [\base, #INTFLGA_OFFS] 33 - 34 - /* Restore INTLVLA with the value saved in INTLVLB. 35 - * This is required to support interrupt priorities properly. 36 - */ 37 - ldrb \tmp, [\base, #INTLVLB_OFFS] 38 - strb \tmp, [\base, #INTLVLA_OFFS] 39 - 40 - /* Handle invalid vector number case */ 41 - cmp \irqnr, #0 42 - beq 1000f 43 - 44 - /* Convert vector to irq number, same as the evt2irq() macro */ 45 - lsr \irqnr, \irqnr, #0x5 46 - subs \irqnr, \irqnr, #16 47 - 48 - 1000: 49 - .endm 50 - 51 - .macro test_for_ipi, irqnr, irqstat, base, tmp 52 - .endm 53 - 54 - arch_irq_handler shmobile_handle_irq_intc
-7
arch/arm/mach-shmobile/include/mach/clkdev.h
··· 1 - #ifndef __ASM_MACH_CLKDEV_H 2 - #define __ASM_MACH_CLKDEV_H 3 - 4 - int __clk_get(struct clk *clk); 5 - void __clk_put(struct clk *clk); 6 - 7 - #endif /* __ASM_MACH_CLKDEV_H */
-93
arch/arm/mach-shmobile/include/mach/head-mackerel.txt
··· 1 - LIST "partner-jet-setup.txt" 2 - LIST "(C) Copyright 2010 Renesas Solutions Corp" 3 - LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>" 4 - 5 - LIST "RWT Setting" 6 - EW 0xE6020004, 0xA500 7 - EW 0xE6030004, 0xA500 8 - 9 - LIST "GPIO Setting" 10 - EB 0xE6051013, 0xA2 11 - 12 - LIST "CPG" 13 - ED 0xE61500C0, 0x00000002 14 - 15 - WAIT 1, 0xFE40009C 16 - 17 - LIST "FRQCR" 18 - ED 0xE6150000, 0x2D1305C3 19 - ED 0xE61500E0, 0x9E40358E 20 - ED 0xE6150004, 0x80331050 21 - 22 - WAIT 1, 0xFE40009C 23 - 24 - ED 0xE61500E4, 0x00002000 25 - 26 - WAIT 1, 0xFE40009C 27 - 28 - LIST "PLL" 29 - ED 0xE6150028, 0x00004000 30 - 31 - WAIT 1, 0xFE40009C 32 - 33 - ED 0xE615002C, 0x93000040 34 - 35 - WAIT 1, 0xFE40009C 36 - 37 - LIST "SUB/USBClk" 38 - ED 0xE6150080, 0x00000180 39 - 40 - LIST "BSC" 41 - ED 0xFEC10000, 0x00E0001B 42 - 43 - LIST "SBSC1" 44 - ED 0xFE400354, 0x01AD8000 45 - ED 0xFE400354, 0x01AD8001 46 - 47 - WAIT 5, 0xFE40009C 48 - 49 - ED 0xFE400008, 0xBCC90151 50 - ED 0xFE400040, 0x41774113 51 - ED 0xFE400044, 0x2712E229 52 - ED 0xFE400048, 0x20C18505 53 - ED 0xFE40004C, 0x00110209 54 - ED 0xFE400010, 0x00000087 55 - 56 - WAIT 30, 0xFE40009C 57 - 58 - ED 0xFE400084, 0x0000003F 59 - EB 0xFE500000, 0x00 60 - 61 - WAIT 5, 0xFE40009C 62 - 63 - ED 0xFE400084, 0x0000FF0A 64 - EB 0xFE500000, 0x00 65 - 66 - WAIT 1, 0xFE40009C 67 - 68 - ED 0xFE400084, 0x00002201 69 - EB 0xFE500000, 0x00 70 - ED 0xFE400084, 0x00000302 71 - EB 0xFE500000, 0x00 72 - EB 0xFE5C0000, 0x00 73 - ED 0xFE400008, 0xBCC90159 74 - ED 0xFE40008C, 0x88800004 75 - ED 0xFE400094, 0x00000004 76 - ED 0xFE400028, 0xA55A0032 77 - ED 0xFE40002C, 0xA55A000C 78 - ED 0xFE400020, 0xA55A2048 79 - ED 0xFE400008, 0xBCC90959 80 - 81 - LIST "Change CPGA setting" 82 - ED 0xE61500E0, 0x9E40352E 83 - ED 0xE6150004, 0x80331050 84 - 85 - WAIT 1, 0xFE40009C 86 - 87 - ED 0xFE400354, 0x01AD8002 88 - 89 - LIST "SCIF0 - Serial port for earlyprintk" 90 - EB 0xE6053098, 0xe1 91 - EW 0xE6C40000, 0x0000 92 - EB 0xE6C40004, 0x19 93 - EW 0xE6C40008, 0x0030
-38
arch/arm/mach-shmobile/include/mach/mmc-mackerel.h
··· 1 - #ifndef MMC_MACKEREL_H 2 - #define MMC_MACKEREL_H 3 - 4 - #define PORT0CR (void __iomem *)0xe6051000 5 - #define PORT1CR (void __iomem *)0xe6051001 6 - #define PORT2CR (void __iomem *)0xe6051002 7 - #define PORT159CR (void __iomem *)0xe605009f 8 - 9 - #define PORTR031_000DR (void __iomem *)0xe6055000 10 - #define PORTL159_128DR (void __iomem *)0xe6054010 11 - 12 - static inline void mmc_init_progress(void) 13 - { 14 - /* Initialise LEDS0-3 15 - * registers: PORT0CR-PORT2CR,PORT159CR (LED0-LED3 Control) 16 - * value: 0x10 - enable output 17 - */ 18 - __raw_writeb(0x10, PORT0CR); 19 - __raw_writeb(0x10, PORT1CR); 20 - __raw_writeb(0x10, PORT2CR); 21 - __raw_writeb(0x10, PORT159CR); 22 - } 23 - 24 - static inline void mmc_update_progress(int n) 25 - { 26 - unsigned a = 0, b = 0; 27 - 28 - if (n < 3) 29 - a = 1 << n; 30 - else 31 - b = 1 << 31; 32 - 33 - __raw_writel((__raw_readl(PORTR031_000DR) & ~0x7) | a, 34 - PORTR031_000DR); 35 - __raw_writel((__raw_readl(PORTL159_128DR) & ~(1 << 31)) | b, 36 - PORTL159_128DR); 37 - } 38 - #endif /* MMC_MACKEREL_H */
-16
arch/arm/mach-shmobile/include/mach/mmc.h
··· 1 - #ifndef MMC_H 2 - #define MMC_H 3 - 4 - /************************************************** 5 - * 6 - * board specific settings 7 - * 8 - **************************************************/ 9 - 10 - #ifdef CONFIG_MACH_MACKEREL 11 - #include "mach/mmc-mackerel.h" 12 - #else 13 - #error "unsupported board." 14 - #endif 15 - 16 - #endif /* MMC_H */
-21
arch/arm/mach-shmobile/include/mach/sdhi-sh7372.h
··· 1 - #ifndef SDHI_SH7372_H 2 - #define SDHI_SH7372_H 3 - 4 - #define SDGENCNTA 0xfe40009c 5 - 6 - /* The countdown of SDGENCNTA is controlled by 7 - * ZB3D2CLK which runs at 149.5MHz. 8 - * That is 149.5ticks/us. Approximate this as 150ticks/us. 9 - */ 10 - static void udelay(int us) 11 - { 12 - __raw_writel(us * 150, SDGENCNTA); 13 - while(__raw_readl(SDGENCNTA)) ; 14 - } 15 - 16 - static void msleep(int ms) 17 - { 18 - udelay(ms * 1000); 19 - } 20 - 21 - #endif
-16
arch/arm/mach-shmobile/include/mach/sdhi.h
··· 1 - #ifndef SDHI_H 2 - #define SDHI_H 3 - 4 - /************************************************** 5 - * 6 - * CPU specific settings 7 - * 8 - **************************************************/ 9 - 10 - #ifdef CONFIG_ARCH_SH7372 11 - #include "mach/sdhi-sh7372.h" 12 - #else 13 - #error "unsupported CPU." 14 - #endif 15 - 16 - #endif /* SDHI_H */
-11
arch/arm/mach-shmobile/include/mach/system.h
··· 1 - #ifndef __ASM_ARCH_SYSTEM_H 2 - #define __ASM_ARCH_SYSTEM_H 3 - 4 - #include <asm/system_misc.h> 5 - 6 - static inline void arch_reset(char mode, const char *cmd) 7 - { 8 - soft_restart(0); 9 - } 10 - 11 - #endif
-19
arch/arm/mach-shmobile/include/mach/uncompress.h
··· 1 - #ifndef __ASM_MACH_UNCOMPRESS_H 2 - #define __ASM_MACH_UNCOMPRESS_H 3 - 4 - /* 5 - * This does not append a newline 6 - */ 7 - static void putc(int c) 8 - { 9 - } 10 - 11 - static inline void flush(void) 12 - { 13 - } 14 - 15 - static void arch_decomp_setup(void) 16 - { 17 - } 18 - 19 - #endif /* __ASM_MACH_UNCOMPRESS_H */
+1 -4
arch/arm/mach-shmobile/include/mach/zboot.h
··· 9 9 * 10 10 **************************************************/ 11 11 12 - #ifdef CONFIG_MACH_MACKEREL 13 - #define MEMORY_START 0x40000000 14 - #include "mach/head-mackerel.txt" 15 - #elif defined(CONFIG_MACH_KZM9G) || defined(CONFIG_MACH_KZM9G_REFERENCE) 12 + #ifdef CONFIG_MACH_KZM9G 16 13 #define MEMORY_START 0x43000000 17 14 #include "mach/head-kzm9g.txt" 18 15 #else
-672
arch/arm/mach-shmobile/intc-sh7372.c
··· 1 - /* 2 - * sh7372 processor support - INTC hardware block 3 - * 4 - * Copyright (C) 2010 Magnus Damm 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 - #include <linux/kernel.h> 16 - #include <linux/init.h> 17 - #include <linux/interrupt.h> 18 - #include <linux/module.h> 19 - #include <linux/irq.h> 20 - #include <linux/io.h> 21 - #include <asm/mach-types.h> 22 - #include <asm/mach/arch.h> 23 - #include "intc.h" 24 - #include "irqs.h" 25 - 26 - enum { 27 - UNUSED_INTCA = 0, 28 - 29 - /* interrupt sources INTCA */ 30 - DIRC, 31 - CRYPT_STD, 32 - IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1, 33 - AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX, 34 - MFI_MFIM, MFI_MFIS, 35 - BBIF1, BBIF2, 36 - USBHSDMAC0_USHDMI, 37 - _3DG_SGX540, 38 - CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3, 39 - KEYSC_KEY, 40 - SCIFA0, SCIFA1, SCIFA2, SCIFA3, 41 - MSIOF2, MSIOF1, 42 - SCIFA4, SCIFA5, SCIFB, 43 - FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I, 44 - SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3, 45 - SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2, 46 - IRREM, 47 - IRDA, 48 - TPU0, 49 - TTI20, 50 - DDM, 51 - SDHI2_SDHI2I0, SDHI2_SDHI2I1, SDHI2_SDHI2I2, SDHI2_SDHI2I3, 52 - RWDT0, 53 - DMAC1_1_DEI0, DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3, 54 - DMAC1_2_DEI4, DMAC1_2_DEI5, DMAC1_2_DADERR, 55 - DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3, 56 - DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR, 57 - DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3, 58 - DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR, 59 - SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 60 - HDMI, 61 - SPU2_SPU0, SPU2_SPU1, 62 - FSI, FMSI, 63 - MIPI_HSI, 64 - IPMMU_IPMMUD, 65 - CEC_1, CEC_2, 66 - AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, AP_ARM_DMAIRQ, AP_ARM_DMASIRQ, 67 - MFIS2, 68 - CPORTR2S, 69 - CMT14, CMT15, 70 - MMC_MMC_ERR, MMC_MMC_NOR, 71 - IIC4_ALI4, IIC4_TACKI4, IIC4_WAITI4, IIC4_DTEI4, 72 - IIC3_ALI3, IIC3_TACKI3, IIC3_WAITI3, IIC3_DTEI3, 73 - USB0_USB0I1, USB0_USB0I0, 74 - USB1_USB1I1, USB1_USB1I0, 75 - USBHSDMAC1_USHDMI, 76 - 77 - /* interrupt groups INTCA */ 78 - DMAC1_1, DMAC1_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT, 79 - AP_ARM1, AP_ARM2, SPU2, FLCTL, IIC1, SDHI0, SDHI1, SDHI2 80 - }; 81 - 82 - static struct intc_vect intca_vectors[] __initdata = { 83 - INTC_VECT(DIRC, 0x0560), 84 - INTC_VECT(CRYPT_STD, 0x0700), 85 - INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0), 86 - INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0), 87 - INTC_VECT(AP_ARM_IRQPMU, 0x0800), INTC_VECT(AP_ARM_COMMTX, 0x0840), 88 - INTC_VECT(AP_ARM_COMMRX, 0x0860), 89 - INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920), 90 - INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960), 91 - INTC_VECT(USBHSDMAC0_USHDMI, 0x0a00), 92 - INTC_VECT(_3DG_SGX540, 0x0a60), 93 - INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20), 94 - INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60), 95 - INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0), 96 - INTC_VECT(KEYSC_KEY, 0x0be0), 97 - INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20), 98 - INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60), 99 - INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00), 100 - INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40), 101 - INTC_VECT(SCIFB, 0x0d60), 102 - INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0), 103 - INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0), 104 - INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20), 105 - INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60), 106 - INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0), 107 - INTC_VECT(SDHI1_SDHI1I2, 0x0ec0), 108 - INTC_VECT(IRREM, 0x0f60), 109 - INTC_VECT(IRDA, 0x0480), 110 - INTC_VECT(TPU0, 0x04a0), 111 - INTC_VECT(TTI20, 0x1100), 112 - INTC_VECT(DDM, 0x1140), 113 - INTC_VECT(SDHI2_SDHI2I0, 0x1200), INTC_VECT(SDHI2_SDHI2I1, 0x1220), 114 - INTC_VECT(SDHI2_SDHI2I2, 0x1240), INTC_VECT(SDHI2_SDHI2I3, 0x1260), 115 - INTC_VECT(RWDT0, 0x1280), 116 - INTC_VECT(DMAC1_1_DEI0, 0x2000), INTC_VECT(DMAC1_1_DEI1, 0x2020), 117 - INTC_VECT(DMAC1_1_DEI2, 0x2040), INTC_VECT(DMAC1_1_DEI3, 0x2060), 118 - INTC_VECT(DMAC1_2_DEI4, 0x2080), INTC_VECT(DMAC1_2_DEI5, 0x20a0), 119 - INTC_VECT(DMAC1_2_DADERR, 0x20c0), 120 - INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120), 121 - INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160), 122 - INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0), 123 - INTC_VECT(DMAC2_2_DADERR, 0x21c0), 124 - INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220), 125 - INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260), 126 - INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0), 127 - INTC_VECT(DMAC3_2_DADERR, 0x22c0), 128 - INTC_VECT(SHWYSTAT_RT, 0x1300), INTC_VECT(SHWYSTAT_HS, 0x1320), 129 - INTC_VECT(SHWYSTAT_COM, 0x1340), 130 - INTC_VECT(HDMI, 0x17e0), 131 - INTC_VECT(SPU2_SPU0, 0x1800), INTC_VECT(SPU2_SPU1, 0x1820), 132 - INTC_VECT(FSI, 0x1840), 133 - INTC_VECT(FMSI, 0x1860), 134 - INTC_VECT(MIPI_HSI, 0x18e0), 135 - INTC_VECT(IPMMU_IPMMUD, 0x1920), 136 - INTC_VECT(CEC_1, 0x1940), INTC_VECT(CEC_2, 0x1960), 137 - INTC_VECT(AP_ARM_CTIIRQ, 0x1980), 138 - INTC_VECT(AP_ARM_DMAEXTERRIRQ, 0x19a0), 139 - INTC_VECT(AP_ARM_DMAIRQ, 0x19c0), 140 - INTC_VECT(AP_ARM_DMASIRQ, 0x19e0), 141 - INTC_VECT(MFIS2, 0x1a00), 142 - INTC_VECT(CPORTR2S, 0x1a20), 143 - INTC_VECT(CMT14, 0x1a40), INTC_VECT(CMT15, 0x1a60), 144 - INTC_VECT(MMC_MMC_ERR, 0x1ac0), INTC_VECT(MMC_MMC_NOR, 0x1ae0), 145 - INTC_VECT(IIC4_ALI4, 0x1b00), INTC_VECT(IIC4_TACKI4, 0x1b20), 146 - INTC_VECT(IIC4_WAITI4, 0x1b40), INTC_VECT(IIC4_DTEI4, 0x1b60), 147 - INTC_VECT(IIC3_ALI3, 0x1b80), INTC_VECT(IIC3_TACKI3, 0x1ba0), 148 - INTC_VECT(IIC3_WAITI3, 0x1bc0), INTC_VECT(IIC3_DTEI3, 0x1be0), 149 - INTC_VECT(USB0_USB0I1, 0x1c80), INTC_VECT(USB0_USB0I0, 0x1ca0), 150 - INTC_VECT(USB1_USB1I1, 0x1cc0), INTC_VECT(USB1_USB1I0, 0x1ce0), 151 - INTC_VECT(USBHSDMAC1_USHDMI, 0x1d00), 152 - }; 153 - 154 - static struct intc_group intca_groups[] __initdata = { 155 - INTC_GROUP(DMAC1_1, DMAC1_1_DEI0, 156 - DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3), 157 - INTC_GROUP(DMAC1_2, DMAC1_2_DEI4, 158 - DMAC1_2_DEI5, DMAC1_2_DADERR), 159 - INTC_GROUP(DMAC2_1, DMAC2_1_DEI0, 160 - DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3), 161 - INTC_GROUP(DMAC2_2, DMAC2_2_DEI4, 162 - DMAC2_2_DEI5, DMAC2_2_DADERR), 163 - INTC_GROUP(DMAC3_1, DMAC3_1_DEI0, 164 - DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3), 165 - INTC_GROUP(DMAC3_2, DMAC3_2_DEI4, 166 - DMAC3_2_DEI5, DMAC3_2_DADERR), 167 - INTC_GROUP(AP_ARM1, AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX), 168 - INTC_GROUP(AP_ARM2, AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, 169 - AP_ARM_DMAIRQ, AP_ARM_DMASIRQ), 170 - INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1), 171 - INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI, 172 - FLCTL_FLTREQ0I, FLCTL_FLTREQ1I), 173 - INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1), 174 - INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1, 175 - SDHI0_SDHI0I2, SDHI0_SDHI0I3), 176 - INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1, 177 - SDHI1_SDHI1I2), 178 - INTC_GROUP(SDHI2, SDHI2_SDHI2I0, SDHI2_SDHI2I1, 179 - SDHI2_SDHI2I2, SDHI2_SDHI2I3), 180 - INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM), 181 - }; 182 - 183 - static struct intc_mask_reg intca_mask_registers[] __initdata = { 184 - { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */ 185 - { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0, 186 - AP_ARM_IRQPMU, 0, AP_ARM_COMMTX, AP_ARM_COMMRX } }, 187 - { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */ 188 - { 0, CRYPT_STD, DIRC, 0, 189 - DMAC1_1_DEI3, DMAC1_1_DEI2, DMAC1_1_DEI1, DMAC1_1_DEI0 } }, 190 - { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */ 191 - { 0, 0, 0, 0, 192 - BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } }, 193 - { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */ 194 - { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0, 195 - DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } }, 196 - { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */ 197 - { DDM, 0, 0, 0, 198 - 0, 0, 0, 0 } }, 199 - { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */ 200 - { KEYSC_KEY, DMAC1_2_DADERR, DMAC1_2_DEI5, DMAC1_2_DEI4, 201 - SCIFA3, SCIFA2, SCIFA1, SCIFA0 } }, 202 - { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */ 203 - { SCIFB, SCIFA5, SCIFA4, MSIOF1, 204 - 0, 0, MSIOF2, 0 } }, 205 - { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */ 206 - { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0, 207 - FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } }, 208 - { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */ 209 - { 0, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0, 210 - TTI20, USBHSDMAC0_USHDMI, 0, 0 } }, 211 - { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */ 212 - { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10, 213 - CMT2, 0, 0, _3DG_SGX540 } }, 214 - { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */ 215 - { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4, 216 - 0, 0, 0, 0 } }, 217 - { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */ 218 - { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1, 219 - 0, 0, IRREM, 0 } }, 220 - { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */ 221 - { 0, 0, TPU0, 0, 222 - 0, 0, 0, 0 } }, 223 - { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */ 224 - { SDHI2_SDHI2I3, SDHI2_SDHI2I2, SDHI2_SDHI2I1, SDHI2_SDHI2I0, 225 - 0, CMT3, 0, RWDT0 } }, 226 - { 0xe6950080, 0xe69500c0, 8, /* IMR0A3 / IMCR0A3 */ 227 - { SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0, 228 - 0, 0, 0, 0 } }, 229 - { 0xe6950090, 0xe69500d0, 8, /* IMR4A3 / IMCR4A3 */ 230 - { 0, 0, 0, 0, 231 - 0, 0, 0, HDMI } }, 232 - { 0xe6950094, 0xe69500d4, 8, /* IMR5A3 / IMCR5A3 */ 233 - { SPU2_SPU0, SPU2_SPU1, FSI, FMSI, 234 - 0, 0, 0, MIPI_HSI } }, 235 - { 0xe6950098, 0xe69500d8, 8, /* IMR6A3 / IMCR6A3 */ 236 - { 0, IPMMU_IPMMUD, CEC_1, CEC_2, 237 - AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, 238 - AP_ARM_DMAIRQ, AP_ARM_DMASIRQ } }, 239 - { 0xe695009c, 0xe69500dc, 8, /* IMR7A3 / IMCR7A3 */ 240 - { MFIS2, CPORTR2S, CMT14, CMT15, 241 - 0, 0, MMC_MMC_ERR, MMC_MMC_NOR } }, 242 - { 0xe69500a0, 0xe69500e0, 8, /* IMR8A3 / IMCR8A3 */ 243 - { IIC4_ALI4, IIC4_TACKI4, IIC4_WAITI4, IIC4_DTEI4, 244 - IIC3_ALI3, IIC3_TACKI3, IIC3_WAITI3, IIC3_DTEI3 } }, 245 - { 0xe69500a4, 0xe69500e4, 8, /* IMR9A3 / IMCR9A3 */ 246 - { 0, 0, 0, 0, 247 - USB0_USB0I1, USB0_USB0I0, USB1_USB1I1, USB1_USB1I0 } }, 248 - { 0xe69500a8, 0xe69500e8, 8, /* IMR10A3 / IMCR10A3 */ 249 - { USBHSDMAC1_USHDMI, 0, 0, 0, 250 - 0, 0, 0, 0 } }, 251 - }; 252 - 253 - static struct intc_prio_reg intca_prio_registers[] __initdata = { 254 - { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, 0 } }, 255 - { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } }, 256 - { 0xe6940008, 0, 16, 4, /* IPRCA */ { 0, CRYPT_STD, 257 - CMT1_CMT11, AP_ARM1 } }, 258 - { 0xe694000c, 0, 16, 4, /* IPRDA */ { 0, 0, 259 - CMT1_CMT12, 0 } }, 260 - { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC1_1, MFI_MFIS, 261 - MFI_MFIM, 0 } }, 262 - { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC1_2, 263 - _3DG_SGX540, CMT1_CMT10 } }, 264 - { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1, 265 - SCIFA2, SCIFA3 } }, 266 - { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBHSDMAC0_USHDMI, 267 - FLCTL, SDHI0 } }, 268 - { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, 269 - 0/* MSU */, IIC1 } }, 270 - { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, 271 - 0/* MSUG */, TTI20 } }, 272 - { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IRREM, SDHI1 } }, 273 - { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, 0, 0, 0 } }, 274 - { 0xe6940030, 0, 16, 4, /* IPRMA */ { 0, CMT3, 0, RWDT0 } }, 275 - { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } }, 276 - { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } }, 277 - { 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } }, 278 - { 0xe6950024, 0, 16, 4, /* IPRJA3 */ { 0, 0, 0, HDMI } }, 279 - { 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } }, 280 - { 0xe695002c, 0, 16, 4, /* IPRLA3 */ { 0, 0, 0, MIPI_HSI } }, 281 - { 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU_IPMMUD, 0, 282 - CEC_1, CEC_2 } }, 283 - { 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } }, 284 - { 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S, 285 - CMT14, CMT15 } }, 286 - { 0xe695003c, 0, 16, 4, /* IPRPA3 */ { 0, 0, 287 - MMC_MMC_ERR, MMC_MMC_NOR } }, 288 - { 0xe6950040, 0, 16, 4, /* IPRQA3 */ { IIC4_ALI4, IIC4_TACKI4, 289 - IIC4_WAITI4, IIC4_DTEI4 } }, 290 - { 0xe6950044, 0, 16, 4, /* IPRRA3 */ { IIC3_ALI3, IIC3_TACKI3, 291 - IIC3_WAITI3, IIC3_DTEI3 } }, 292 - { 0xe6950048, 0, 16, 4, /* IPRSA3 */ { 0/*ERI*/, 0/*RXI*/, 293 - 0/*TXI*/, 0/*TEI*/} }, 294 - { 0xe695004c, 0, 16, 4, /* IPRTA3 */ { USB0_USB0I1, USB0_USB0I0, 295 - USB1_USB1I1, USB1_USB1I0 } }, 296 - { 0xe6950050, 0, 16, 4, /* IPRUA3 */ { USBHSDMAC1_USHDMI, 0, 0, 0 } }, 297 - }; 298 - 299 - static DECLARE_INTC_DESC(intca_desc, "sh7372-intca", 300 - intca_vectors, intca_groups, 301 - intca_mask_registers, intca_prio_registers, 302 - NULL); 303 - 304 - INTC_IRQ_PINS_16(intca_irq_pins_lo, 0xe6900000, 305 - INTC_VECT, "sh7372-intca-irq-lo"); 306 - 307 - INTC_IRQ_PINS_16H(intca_irq_pins_hi, 0xe6900000, 308 - INTC_VECT, "sh7372-intca-irq-hi"); 309 - 310 - enum { 311 - UNUSED_INTCS = 0, 312 - ENABLED_INTCS, 313 - 314 - /* interrupt sources INTCS */ 315 - 316 - /* IRQ0S - IRQ31S */ 317 - VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3, 318 - RTDMAC_1_DEI0, RTDMAC_1_DEI1, RTDMAC_1_DEI2, RTDMAC_1_DEI3, 319 - CEU, BEU_BEU0, BEU_BEU1, BEU_BEU2, 320 - /* MFI */ 321 - /* BBIF2 */ 322 - VPU, 323 - TSIF1, 324 - /* 3DG */ 325 - _2DDMAC, 326 - IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2, 327 - IPMMU_IPMMUR, IPMMU_IPMMUR2, 328 - RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR, 329 - /* KEYSC */ 330 - /* TTI20 */ 331 - MSIOF, 332 - IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0, 333 - TMU_TUNI0, TMU_TUNI1, TMU_TUNI2, 334 - CMT0, 335 - TSIF0, 336 - /* CMT2 */ 337 - LMB, 338 - CTI, 339 - /* RWDT0 */ 340 - ICB, 341 - JPU_JPEG, 342 - LCDC, 343 - LCRC, 344 - RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3, 345 - RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR, 346 - ISP, 347 - LCDC1, 348 - CSIRX, 349 - DSITX_DSITX0, 350 - DSITX_DSITX1, 351 - /* SPU2 */ 352 - /* FSI */ 353 - /* FMSI */ 354 - /* HDMI */ 355 - TMU1_TUNI0, TMU1_TUNI1, TMU1_TUNI2, 356 - CMT4, 357 - DSITX1_DSITX1_0, 358 - DSITX1_DSITX1_1, 359 - MFIS2_INTCS, /* Priority always enabled using ENABLED_INTCS */ 360 - CPORTS2R, 361 - /* CEC */ 362 - JPU6E, 363 - 364 - /* interrupt groups INTCS */ 365 - RTDMAC_1, RTDMAC_2, VEU, BEU, IIC0, IPMMU, IIC2, 366 - RTDMAC2_1, RTDMAC2_2, TMU1, DSITX, 367 - }; 368 - 369 - static struct intc_vect intcs_vectors[] = { 370 - /* IRQ0S - IRQ31S */ 371 - INTCS_VECT(VEU_VEU0, 0x700), INTCS_VECT(VEU_VEU1, 0x720), 372 - INTCS_VECT(VEU_VEU2, 0x740), INTCS_VECT(VEU_VEU3, 0x760), 373 - INTCS_VECT(RTDMAC_1_DEI0, 0x800), INTCS_VECT(RTDMAC_1_DEI1, 0x820), 374 - INTCS_VECT(RTDMAC_1_DEI2, 0x840), INTCS_VECT(RTDMAC_1_DEI3, 0x860), 375 - INTCS_VECT(CEU, 0x880), INTCS_VECT(BEU_BEU0, 0x8a0), 376 - INTCS_VECT(BEU_BEU1, 0x8c0), INTCS_VECT(BEU_BEU2, 0x8e0), 377 - /* MFI */ 378 - /* BBIF2 */ 379 - INTCS_VECT(VPU, 0x980), 380 - INTCS_VECT(TSIF1, 0x9a0), 381 - /* 3DG */ 382 - INTCS_VECT(_2DDMAC, 0xa00), 383 - INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0), 384 - INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0), 385 - INTCS_VECT(IPMMU_IPMMUR, 0xb00), INTCS_VECT(IPMMU_IPMMUR2, 0xb20), 386 - INTCS_VECT(RTDMAC_2_DEI4, 0xb80), INTCS_VECT(RTDMAC_2_DEI5, 0xba0), 387 - INTCS_VECT(RTDMAC_2_DADERR, 0xbc0), 388 - /* KEYSC */ 389 - /* TTI20 */ 390 - INTCS_VECT(MSIOF, 0x0d20), 391 - INTCS_VECT(IIC0_ALI0, 0xe00), INTCS_VECT(IIC0_TACKI0, 0xe20), 392 - INTCS_VECT(IIC0_WAITI0, 0xe40), INTCS_VECT(IIC0_DTEI0, 0xe60), 393 - INTCS_VECT(TMU_TUNI0, 0xe80), INTCS_VECT(TMU_TUNI1, 0xea0), 394 - INTCS_VECT(TMU_TUNI2, 0xec0), 395 - INTCS_VECT(CMT0, 0xf00), 396 - INTCS_VECT(TSIF0, 0xf20), 397 - /* CMT2 */ 398 - INTCS_VECT(LMB, 0xf60), 399 - INTCS_VECT(CTI, 0x400), 400 - /* RWDT0 */ 401 - INTCS_VECT(ICB, 0x480), 402 - INTCS_VECT(JPU_JPEG, 0x560), 403 - INTCS_VECT(LCDC, 0x580), 404 - INTCS_VECT(LCRC, 0x5a0), 405 - INTCS_VECT(RTDMAC2_1_DEI0, 0x1300), INTCS_VECT(RTDMAC2_1_DEI1, 0x1320), 406 - INTCS_VECT(RTDMAC2_1_DEI2, 0x1340), INTCS_VECT(RTDMAC2_1_DEI3, 0x1360), 407 - INTCS_VECT(RTDMAC2_2_DEI4, 0x1380), INTCS_VECT(RTDMAC2_2_DEI5, 0x13a0), 408 - INTCS_VECT(RTDMAC2_2_DADERR, 0x13c0), 409 - INTCS_VECT(ISP, 0x1720), 410 - INTCS_VECT(LCDC1, 0x1780), 411 - INTCS_VECT(CSIRX, 0x17a0), 412 - INTCS_VECT(DSITX_DSITX0, 0x17c0), 413 - INTCS_VECT(DSITX_DSITX1, 0x17e0), 414 - /* SPU2 */ 415 - /* FSI */ 416 - /* FMSI */ 417 - /* HDMI */ 418 - INTCS_VECT(TMU1_TUNI0, 0x1900), INTCS_VECT(TMU1_TUNI1, 0x1920), 419 - INTCS_VECT(TMU1_TUNI2, 0x1940), 420 - INTCS_VECT(CMT4, 0x1980), 421 - INTCS_VECT(DSITX1_DSITX1_0, 0x19a0), 422 - INTCS_VECT(DSITX1_DSITX1_1, 0x19c0), 423 - INTCS_VECT(MFIS2_INTCS, 0x1a00), 424 - INTCS_VECT(CPORTS2R, 0x1a20), 425 - /* CEC */ 426 - INTCS_VECT(JPU6E, 0x1a80), 427 - }; 428 - 429 - static struct intc_group intcs_groups[] __initdata = { 430 - INTC_GROUP(RTDMAC_1, RTDMAC_1_DEI0, RTDMAC_1_DEI1, 431 - RTDMAC_1_DEI2, RTDMAC_1_DEI3), 432 - INTC_GROUP(RTDMAC_2, RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR), 433 - INTC_GROUP(VEU, VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3), 434 - INTC_GROUP(BEU, BEU_BEU0, BEU_BEU1, BEU_BEU2), 435 - INTC_GROUP(IIC0, IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0), 436 - INTC_GROUP(IPMMU, IPMMU_IPMMUR, IPMMU_IPMMUR2), 437 - INTC_GROUP(IIC2, IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2), 438 - INTC_GROUP(RTDMAC2_1, RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, 439 - RTDMAC2_1_DEI2, RTDMAC2_1_DEI3), 440 - INTC_GROUP(RTDMAC2_2, RTDMAC2_2_DEI4, 441 - RTDMAC2_2_DEI5, RTDMAC2_2_DADERR), 442 - INTC_GROUP(TMU1, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0), 443 - INTC_GROUP(DSITX, DSITX_DSITX0, DSITX_DSITX1), 444 - }; 445 - 446 - static struct intc_mask_reg intcs_mask_registers[] = { 447 - { 0xffd20184, 0xffd201c4, 8, /* IMR1SA / IMCR1SA */ 448 - { BEU_BEU2, BEU_BEU1, BEU_BEU0, CEU, 449 - VEU_VEU3, VEU_VEU2, VEU_VEU1, VEU_VEU0 } }, 450 - { 0xffd20188, 0xffd201c8, 8, /* IMR2SA / IMCR2SA */ 451 - { 0, 0, 0, VPU, 452 - 0, 0, 0, 0 } }, 453 - { 0xffd2018c, 0xffd201cc, 8, /* IMR3SA / IMCR3SA */ 454 - { 0, 0, 0, _2DDMAC, 455 - 0, 0, 0, ICB } }, 456 - { 0xffd20190, 0xffd201d0, 8, /* IMR4SA / IMCR4SA */ 457 - { 0, 0, 0, CTI, 458 - JPU_JPEG, 0, LCRC, LCDC } }, 459 - { 0xffd20194, 0xffd201d4, 8, /* IMR5SA / IMCR5SA */ 460 - { 0, RTDMAC_2_DADERR, RTDMAC_2_DEI5, RTDMAC_2_DEI4, 461 - RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } }, 462 - { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */ 463 - { 0, 0, MSIOF, 0, 464 - 0, 0, 0, 0 } }, 465 - { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */ 466 - { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0, 467 - 0, 0, 0, 0 } }, 468 - { 0xffd201a4, 0xffd201e4, 8, /* IMR9SA / IMCR9SA */ 469 - { 0, 0, 0, CMT0, 470 - IIC2_DTEI2, IIC2_WAITI2, IIC2_TACKI2, IIC2_ALI2 } }, 471 - { 0xffd201a8, 0xffd201e8, 8, /* IMR10SA / IMCR10SA */ 472 - { 0, 0, IPMMU_IPMMUR2, IPMMU_IPMMUR, 473 - 0, 0, 0, 0 } }, 474 - { 0xffd201ac, 0xffd201ec, 8, /* IMR11SA / IMCR11SA */ 475 - { IIC0_DTEI0, IIC0_WAITI0, IIC0_TACKI0, IIC0_ALI0, 476 - 0, TSIF1, LMB, TSIF0 } }, 477 - { 0xffd50180, 0xffd501c0, 8, /* IMR0SA3 / IMCR0SA3 */ 478 - { 0, RTDMAC2_2_DADERR, RTDMAC2_2_DEI5, RTDMAC2_2_DEI4, 479 - RTDMAC2_1_DEI3, RTDMAC2_1_DEI2, RTDMAC2_1_DEI1, RTDMAC2_1_DEI0 } }, 480 - { 0xffd50190, 0xffd501d0, 8, /* IMR4SA3 / IMCR4SA3 */ 481 - { 0, ISP, 0, 0, 482 - LCDC1, CSIRX, DSITX_DSITX0, DSITX_DSITX1 } }, 483 - { 0xffd50198, 0xffd501d8, 8, /* IMR6SA3 / IMCR6SA3 */ 484 - { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0, 485 - CMT4, DSITX1_DSITX1_0, DSITX1_DSITX1_1, 0 } }, 486 - { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */ 487 - { MFIS2_INTCS, CPORTS2R, 0, 0, 488 - JPU6E, 0, 0, 0 } }, 489 - }; 490 - 491 - /* Priority is needed for INTCA to receive the INTCS interrupt */ 492 - static struct intc_prio_reg intcs_prio_registers[] = { 493 - { 0xffd20000, 0, 16, 4, /* IPRAS */ { CTI, 0, _2DDMAC, ICB } }, 494 - { 0xffd20004, 0, 16, 4, /* IPRBS */ { JPU_JPEG, LCDC, 0, LCRC } }, 495 - { 0xffd20010, 0, 16, 4, /* IPRES */ { RTDMAC_1, CEU, 0, VPU } }, 496 - { 0xffd20014, 0, 16, 4, /* IPRFS */ { 0, RTDMAC_2, 0, CMT0 } }, 497 - { 0xffd20018, 0, 16, 4, /* IPRGS */ { TMU_TUNI0, TMU_TUNI1, 498 - TMU_TUNI2, TSIF1 } }, 499 - { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } }, 500 - { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } }, 501 - { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } }, 502 - { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } }, 503 - { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } }, 504 - { 0xffd50000, 0, 16, 4, /* IPRAS3 */ { RTDMAC2_1, 0, 0, 0 } }, 505 - { 0xffd50004, 0, 16, 4, /* IPRBS3 */ { RTDMAC2_2, 0, 0, 0 } }, 506 - { 0xffd50020, 0, 16, 4, /* IPRIS3 */ { 0, ISP, 0, 0 } }, 507 - { 0xffd50024, 0, 16, 4, /* IPRJS3 */ { LCDC1, CSIRX, DSITX, 0 } }, 508 - { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, 0 } }, 509 - { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, DSITX1_DSITX1_0, 510 - DSITX1_DSITX1_1, 0 } }, 511 - { 0xffd50038, 0, 16, 4, /* IPROS3 */ { ENABLED_INTCS, CPORTS2R, 512 - 0, 0 } }, 513 - { 0xffd5003c, 0, 16, 4, /* IPRPS3 */ { JPU6E, 0, 0, 0 } }, 514 - }; 515 - 516 - static struct resource intcs_resources[] __initdata = { 517 - [0] = { 518 - .start = 0xffd20000, 519 - .end = 0xffd201ff, 520 - .flags = IORESOURCE_MEM, 521 - }, 522 - [1] = { 523 - .start = 0xffd50000, 524 - .end = 0xffd501ff, 525 - .flags = IORESOURCE_MEM, 526 - } 527 - }; 528 - 529 - static struct intc_desc intcs_desc __initdata = { 530 - .name = "sh7372-intcs", 531 - .force_enable = ENABLED_INTCS, 532 - .skip_syscore_suspend = true, 533 - .resource = intcs_resources, 534 - .num_resources = ARRAY_SIZE(intcs_resources), 535 - .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers, 536 - intcs_prio_registers, NULL, NULL), 537 - }; 538 - 539 - static void intcs_demux(unsigned int irq, struct irq_desc *desc) 540 - { 541 - void __iomem *reg = (void *)irq_get_handler_data(irq); 542 - unsigned int evtcodeas = ioread32(reg); 543 - 544 - generic_handle_irq(intcs_evt2irq(evtcodeas)); 545 - } 546 - 547 - static void __iomem *intcs_ffd2; 548 - static void __iomem *intcs_ffd5; 549 - 550 - void __init sh7372_init_irq(void) 551 - { 552 - void __iomem *intevtsa; 553 - int n; 554 - 555 - intcs_ffd2 = ioremap_nocache(0xffd20000, PAGE_SIZE); 556 - intevtsa = intcs_ffd2 + 0x100; 557 - intcs_ffd5 = ioremap_nocache(0xffd50000, PAGE_SIZE); 558 - 559 - register_intc_controller(&intca_desc); 560 - register_intc_controller(&intca_irq_pins_lo_desc); 561 - register_intc_controller(&intca_irq_pins_hi_desc); 562 - register_intc_controller(&intcs_desc); 563 - 564 - /* setup dummy cascade chip for INTCS */ 565 - n = evt2irq(0xf80); 566 - irq_alloc_desc_at(n, numa_node_id()); 567 - irq_set_chip_and_handler_name(n, &dummy_irq_chip, 568 - handle_level_irq, "level"); 569 - set_irq_flags(n, IRQF_VALID); /* yuck */ 570 - 571 - /* demux using INTEVTSA */ 572 - irq_set_handler_data(n, (void *)intevtsa); 573 - irq_set_chained_handler(n, intcs_demux); 574 - 575 - /* unmask INTCS in INTAMASK */ 576 - iowrite16(0, intcs_ffd2 + 0x104); 577 - } 578 - 579 - static unsigned short ffd2[0x200]; 580 - static unsigned short ffd5[0x100]; 581 - 582 - void sh7372_intcs_suspend(void) 583 - { 584 - int k; 585 - 586 - for (k = 0x00; k <= 0x30; k += 4) 587 - ffd2[k] = __raw_readw(intcs_ffd2 + k); 588 - 589 - for (k = 0x80; k <= 0xb0; k += 4) 590 - ffd2[k] = __raw_readb(intcs_ffd2 + k); 591 - 592 - for (k = 0x180; k <= 0x188; k += 4) 593 - ffd2[k] = __raw_readb(intcs_ffd2 + k); 594 - 595 - for (k = 0x00; k <= 0x3c; k += 4) 596 - ffd5[k] = __raw_readw(intcs_ffd5 + k); 597 - 598 - for (k = 0x80; k <= 0x9c; k += 4) 599 - ffd5[k] = __raw_readb(intcs_ffd5 + k); 600 - } 601 - 602 - void sh7372_intcs_resume(void) 603 - { 604 - int k; 605 - 606 - for (k = 0x00; k <= 0x30; k += 4) 607 - __raw_writew(ffd2[k], intcs_ffd2 + k); 608 - 609 - for (k = 0x80; k <= 0xb0; k += 4) 610 - __raw_writeb(ffd2[k], intcs_ffd2 + k); 611 - 612 - for (k = 0x180; k <= 0x188; k += 4) 613 - __raw_writeb(ffd2[k], intcs_ffd2 + k); 614 - 615 - for (k = 0x00; k <= 0x3c; k += 4) 616 - __raw_writew(ffd5[k], intcs_ffd5 + k); 617 - 618 - for (k = 0x80; k <= 0x9c; k += 4) 619 - __raw_writeb(ffd5[k], intcs_ffd5 + k); 620 - } 621 - 622 - #define E694_BASE IOMEM(0xe6940000) 623 - #define E695_BASE IOMEM(0xe6950000) 624 - 625 - static unsigned short e694[0x200]; 626 - static unsigned short e695[0x200]; 627 - 628 - void sh7372_intca_suspend(void) 629 - { 630 - int k; 631 - 632 - for (k = 0x00; k <= 0x38; k += 4) 633 - e694[k] = __raw_readw(E694_BASE + k); 634 - 635 - for (k = 0x80; k <= 0xb4; k += 4) 636 - e694[k] = __raw_readb(E694_BASE + k); 637 - 638 - for (k = 0x180; k <= 0x1b4; k += 4) 639 - e694[k] = __raw_readb(E694_BASE + k); 640 - 641 - for (k = 0x00; k <= 0x50; k += 4) 642 - e695[k] = __raw_readw(E695_BASE + k); 643 - 644 - for (k = 0x80; k <= 0xa8; k += 4) 645 - e695[k] = __raw_readb(E695_BASE + k); 646 - 647 - for (k = 0x180; k <= 0x1a8; k += 4) 648 - e695[k] = __raw_readb(E695_BASE + k); 649 - } 650 - 651 - void sh7372_intca_resume(void) 652 - { 653 - int k; 654 - 655 - for (k = 0x00; k <= 0x38; k += 4) 656 - __raw_writew(e694[k], E694_BASE + k); 657 - 658 - for (k = 0x80; k <= 0xb4; k += 4) 659 - __raw_writeb(e694[k], E694_BASE + k); 660 - 661 - for (k = 0x180; k <= 0x1b4; k += 4) 662 - __raw_writeb(e694[k], E694_BASE + k); 663 - 664 - for (k = 0x00; k <= 0x50; k += 4) 665 - __raw_writew(e695[k], E695_BASE + k); 666 - 667 - for (k = 0x80; k <= 0xa8; k += 4) 668 - __raw_writeb(e695[k], E695_BASE + k); 669 - 670 - for (k = 0x180; k <= 0x1a8; k += 4) 671 - __raw_writeb(e695[k], E695_BASE + k); 672 - }
-549
arch/arm/mach-shmobile/pm-sh7372.c
··· 1 - /* 2 - * sh7372 Power management support 3 - * 4 - * Copyright (C) 2011 Magnus Damm 5 - * 6 - * This file is subject to the terms and conditions of the GNU General Public 7 - * License. See the file "COPYING" in the main directory of this archive 8 - * for more details. 9 - */ 10 - 11 - #include <linux/pm.h> 12 - #include <linux/suspend.h> 13 - #include <linux/cpuidle.h> 14 - #include <linux/module.h> 15 - #include <linux/list.h> 16 - #include <linux/err.h> 17 - #include <linux/slab.h> 18 - #include <linux/pm_clock.h> 19 - #include <linux/platform_device.h> 20 - #include <linux/delay.h> 21 - #include <linux/irq.h> 22 - #include <linux/bitrev.h> 23 - #include <linux/console.h> 24 - 25 - #include <asm/cpuidle.h> 26 - #include <asm/io.h> 27 - #include <asm/tlbflush.h> 28 - #include <asm/suspend.h> 29 - 30 - #include "common.h" 31 - #include "pm-rmobile.h" 32 - #include "sh7372.h" 33 - 34 - /* DBG */ 35 - #define DBGREG1 IOMEM(0xe6100020) 36 - #define DBGREG9 IOMEM(0xe6100040) 37 - 38 - /* CPGA */ 39 - #define SYSTBCR IOMEM(0xe6150024) 40 - #define MSTPSR0 IOMEM(0xe6150030) 41 - #define MSTPSR1 IOMEM(0xe6150038) 42 - #define MSTPSR2 IOMEM(0xe6150040) 43 - #define MSTPSR3 IOMEM(0xe6150048) 44 - #define MSTPSR4 IOMEM(0xe615004c) 45 - #define PLLC01STPCR IOMEM(0xe61500c8) 46 - 47 - /* SYSC */ 48 - #define SYSC_BASE IOMEM(0xe6180000) 49 - 50 - #define SBAR IOMEM(0xe6180020) 51 - #define WUPRMSK IOMEM(0xe6180028) 52 - #define WUPSMSK IOMEM(0xe618002c) 53 - #define WUPSMSK2 IOMEM(0xe6180048) 54 - #define WUPSFAC IOMEM(0xe6180098) 55 - #define IRQCR IOMEM(0xe618022c) 56 - #define IRQCR2 IOMEM(0xe6180238) 57 - #define IRQCR3 IOMEM(0xe6180244) 58 - #define IRQCR4 IOMEM(0xe6180248) 59 - #define PDNSEL IOMEM(0xe6180254) 60 - 61 - /* INTC */ 62 - #define ICR1A IOMEM(0xe6900000) 63 - #define ICR2A IOMEM(0xe6900004) 64 - #define ICR3A IOMEM(0xe6900008) 65 - #define ICR4A IOMEM(0xe690000c) 66 - #define INTMSK00A IOMEM(0xe6900040) 67 - #define INTMSK10A IOMEM(0xe6900044) 68 - #define INTMSK20A IOMEM(0xe6900048) 69 - #define INTMSK30A IOMEM(0xe690004c) 70 - 71 - /* MFIS */ 72 - /* FIXME: pointing where? */ 73 - #define SMFRAM 0xe6a70000 74 - 75 - /* AP-System Core */ 76 - #define APARMBAREA IOMEM(0xe6f10020) 77 - 78 - #ifdef CONFIG_PM 79 - 80 - #define PM_DOMAIN_ON_OFF_LATENCY_NS 250000 81 - 82 - static int sh7372_a4r_pd_suspend(void) 83 - { 84 - sh7372_intcs_suspend(); 85 - __raw_writel(0x300fffff, WUPRMSK); /* avoid wakeup */ 86 - return 0; 87 - } 88 - 89 - static bool a4s_suspend_ready; 90 - 91 - static int sh7372_a4s_pd_suspend(void) 92 - { 93 - /* 94 - * The A4S domain contains the CPU core and therefore it should 95 - * only be turned off if the CPU is not in use. This may happen 96 - * during system suspend, when SYSC is going to be used for generating 97 - * resume signals and a4s_suspend_ready is set to let 98 - * sh7372_enter_suspend() know that it can turn A4S off. 99 - */ 100 - a4s_suspend_ready = true; 101 - return -EBUSY; 102 - } 103 - 104 - static void sh7372_a4s_pd_resume(void) 105 - { 106 - a4s_suspend_ready = false; 107 - } 108 - 109 - static int sh7372_a3sp_pd_suspend(void) 110 - { 111 - /* 112 - * Serial consoles make use of SCIF hardware located in A3SP, 113 - * keep such power domain on if "no_console_suspend" is set. 114 - */ 115 - return console_suspend_enabled ? 0 : -EBUSY; 116 - } 117 - 118 - static struct rmobile_pm_domain sh7372_pm_domains[] = { 119 - { 120 - .genpd.name = "A4LC", 121 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 122 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 123 - .base = SYSC_BASE, 124 - .bit_shift = 1, 125 - }, 126 - { 127 - .genpd.name = "A4MP", 128 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 129 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 130 - .base = SYSC_BASE, 131 - .bit_shift = 2, 132 - }, 133 - { 134 - .genpd.name = "D4", 135 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 136 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 137 - .base = SYSC_BASE, 138 - .bit_shift = 3, 139 - }, 140 - { 141 - .genpd.name = "A4R", 142 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 143 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 144 - .base = SYSC_BASE, 145 - .bit_shift = 5, 146 - .suspend = sh7372_a4r_pd_suspend, 147 - .resume = sh7372_intcs_resume, 148 - }, 149 - { 150 - .genpd.name = "A3RV", 151 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 152 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 153 - .base = SYSC_BASE, 154 - .bit_shift = 6, 155 - }, 156 - { 157 - .genpd.name = "A3RI", 158 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 159 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 160 - .base = SYSC_BASE, 161 - .bit_shift = 8, 162 - }, 163 - { 164 - .genpd.name = "A4S", 165 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 166 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 167 - .base = SYSC_BASE, 168 - .bit_shift = 10, 169 - .gov = &pm_domain_always_on_gov, 170 - .no_debug = true, 171 - .suspend = sh7372_a4s_pd_suspend, 172 - .resume = sh7372_a4s_pd_resume, 173 - }, 174 - { 175 - .genpd.name = "A3SP", 176 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 177 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 178 - .base = SYSC_BASE, 179 - .bit_shift = 11, 180 - .gov = &pm_domain_always_on_gov, 181 - .no_debug = true, 182 - .suspend = sh7372_a3sp_pd_suspend, 183 - }, 184 - { 185 - .genpd.name = "A3SG", 186 - .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 187 - .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 188 - .base = SYSC_BASE, 189 - .bit_shift = 13, 190 - }, 191 - }; 192 - 193 - void __init sh7372_init_pm_domains(void) 194 - { 195 - rmobile_init_domains(sh7372_pm_domains, ARRAY_SIZE(sh7372_pm_domains)); 196 - pm_genpd_add_subdomain_names("A4LC", "A3RV"); 197 - pm_genpd_add_subdomain_names("A4R", "A4LC"); 198 - pm_genpd_add_subdomain_names("A4S", "A3SG"); 199 - pm_genpd_add_subdomain_names("A4S", "A3SP"); 200 - } 201 - 202 - #endif /* CONFIG_PM */ 203 - 204 - #if defined(CONFIG_SUSPEND) || defined(CONFIG_CPU_IDLE) 205 - static void sh7372_set_reset_vector(unsigned long address) 206 - { 207 - /* set reset vector, translate 4k */ 208 - __raw_writel(address, SBAR); 209 - __raw_writel(0, APARMBAREA); 210 - } 211 - 212 - static void sh7372_enter_sysc(int pllc0_on, unsigned long sleep_mode) 213 - { 214 - if (pllc0_on) 215 - __raw_writel(0, PLLC01STPCR); 216 - else 217 - __raw_writel(1 << 28, PLLC01STPCR); 218 - 219 - __raw_readl(WUPSFAC); /* read wakeup int. factor before sleep */ 220 - cpu_suspend(sleep_mode, sh7372_do_idle_sysc); 221 - __raw_readl(WUPSFAC); /* read wakeup int. factor after wakeup */ 222 - 223 - /* disable reset vector translation */ 224 - __raw_writel(0, SBAR); 225 - } 226 - 227 - static int sh7372_sysc_valid(unsigned long *mskp, unsigned long *msk2p) 228 - { 229 - unsigned long mstpsr0, mstpsr1, mstpsr2, mstpsr3, mstpsr4; 230 - unsigned long msk, msk2; 231 - 232 - /* check active clocks to determine potential wakeup sources */ 233 - 234 - mstpsr0 = __raw_readl(MSTPSR0); 235 - if ((mstpsr0 & 0x00000003) != 0x00000003) { 236 - pr_debug("sh7372 mstpsr0 0x%08lx\n", mstpsr0); 237 - return 0; 238 - } 239 - 240 - mstpsr1 = __raw_readl(MSTPSR1); 241 - if ((mstpsr1 & 0xff079b7f) != 0xff079b7f) { 242 - pr_debug("sh7372 mstpsr1 0x%08lx\n", mstpsr1); 243 - return 0; 244 - } 245 - 246 - mstpsr2 = __raw_readl(MSTPSR2); 247 - if ((mstpsr2 & 0x000741ff) != 0x000741ff) { 248 - pr_debug("sh7372 mstpsr2 0x%08lx\n", mstpsr2); 249 - return 0; 250 - } 251 - 252 - mstpsr3 = __raw_readl(MSTPSR3); 253 - if ((mstpsr3 & 0x1a60f010) != 0x1a60f010) { 254 - pr_debug("sh7372 mstpsr3 0x%08lx\n", mstpsr3); 255 - return 0; 256 - } 257 - 258 - mstpsr4 = __raw_readl(MSTPSR4); 259 - if ((mstpsr4 & 0x00008cf0) != 0x00008cf0) { 260 - pr_debug("sh7372 mstpsr4 0x%08lx\n", mstpsr4); 261 - return 0; 262 - } 263 - 264 - msk = 0; 265 - msk2 = 0; 266 - 267 - /* make bitmaps of limited number of wakeup sources */ 268 - 269 - if ((mstpsr2 & (1 << 23)) == 0) /* SPU2 */ 270 - msk |= 1 << 31; 271 - 272 - if ((mstpsr2 & (1 << 12)) == 0) /* MFI_MFIM */ 273 - msk |= 1 << 21; 274 - 275 - if ((mstpsr4 & (1 << 3)) == 0) /* KEYSC */ 276 - msk |= 1 << 2; 277 - 278 - if ((mstpsr1 & (1 << 24)) == 0) /* CMT0 */ 279 - msk |= 1 << 1; 280 - 281 - if ((mstpsr3 & (1 << 29)) == 0) /* CMT1 */ 282 - msk |= 1 << 1; 283 - 284 - if ((mstpsr4 & (1 << 0)) == 0) /* CMT2 */ 285 - msk |= 1 << 1; 286 - 287 - if ((mstpsr2 & (1 << 13)) == 0) /* MFI_MFIS */ 288 - msk2 |= 1 << 17; 289 - 290 - *mskp = msk; 291 - *msk2p = msk2; 292 - 293 - return 1; 294 - } 295 - 296 - static void sh7372_icr_to_irqcr(unsigned long icr, u16 *irqcr1p, u16 *irqcr2p) 297 - { 298 - u16 tmp, irqcr1, irqcr2; 299 - int k; 300 - 301 - irqcr1 = 0; 302 - irqcr2 = 0; 303 - 304 - /* convert INTCA ICR register layout to SYSC IRQCR+IRQCR2 */ 305 - for (k = 0; k <= 7; k++) { 306 - tmp = (icr >> ((7 - k) * 4)) & 0xf; 307 - irqcr1 |= (tmp & 0x03) << (k * 2); 308 - irqcr2 |= (tmp >> 2) << (k * 2); 309 - } 310 - 311 - *irqcr1p = irqcr1; 312 - *irqcr2p = irqcr2; 313 - } 314 - 315 - static void sh7372_setup_sysc(unsigned long msk, unsigned long msk2) 316 - { 317 - u16 irqcrx_low, irqcrx_high, irqcry_low, irqcry_high; 318 - unsigned long tmp; 319 - 320 - /* read IRQ0A -> IRQ15A mask */ 321 - tmp = bitrev8(__raw_readb(INTMSK00A)); 322 - tmp |= bitrev8(__raw_readb(INTMSK10A)) << 8; 323 - 324 - /* setup WUPSMSK from clocks and external IRQ mask */ 325 - msk = (~msk & 0xc030000f) | (tmp << 4); 326 - __raw_writel(msk, WUPSMSK); 327 - 328 - /* propage level/edge trigger for external IRQ 0->15 */ 329 - sh7372_icr_to_irqcr(__raw_readl(ICR1A), &irqcrx_low, &irqcry_low); 330 - sh7372_icr_to_irqcr(__raw_readl(ICR2A), &irqcrx_high, &irqcry_high); 331 - __raw_writel((irqcrx_high << 16) | irqcrx_low, IRQCR); 332 - __raw_writel((irqcry_high << 16) | irqcry_low, IRQCR2); 333 - 334 - /* read IRQ16A -> IRQ31A mask */ 335 - tmp = bitrev8(__raw_readb(INTMSK20A)); 336 - tmp |= bitrev8(__raw_readb(INTMSK30A)) << 8; 337 - 338 - /* setup WUPSMSK2 from clocks and external IRQ mask */ 339 - msk2 = (~msk2 & 0x00030000) | tmp; 340 - __raw_writel(msk2, WUPSMSK2); 341 - 342 - /* propage level/edge trigger for external IRQ 16->31 */ 343 - sh7372_icr_to_irqcr(__raw_readl(ICR3A), &irqcrx_low, &irqcry_low); 344 - sh7372_icr_to_irqcr(__raw_readl(ICR4A), &irqcrx_high, &irqcry_high); 345 - __raw_writel((irqcrx_high << 16) | irqcrx_low, IRQCR3); 346 - __raw_writel((irqcry_high << 16) | irqcry_low, IRQCR4); 347 - } 348 - 349 - static void sh7372_enter_a3sm_common(int pllc0_on) 350 - { 351 - /* use INTCA together with SYSC for wakeup */ 352 - sh7372_setup_sysc(1 << 0, 0); 353 - sh7372_set_reset_vector(__pa(sh7372_resume_core_standby_sysc)); 354 - sh7372_enter_sysc(pllc0_on, 1 << 12); 355 - } 356 - 357 - static void sh7372_enter_a4s_common(int pllc0_on) 358 - { 359 - sh7372_intca_suspend(); 360 - sh7372_set_reset_vector(SMFRAM); 361 - sh7372_enter_sysc(pllc0_on, 1 << 10); 362 - sh7372_intca_resume(); 363 - } 364 - 365 - static void sh7372_pm_setup_smfram(void) 366 - { 367 - /* pass physical address of cpu_resume() to assembly resume code */ 368 - sh7372_cpu_resume = virt_to_phys(cpu_resume); 369 - 370 - memcpy((void *)SMFRAM, sh7372_resume_core_standby_sysc, 0x100); 371 - } 372 - #else 373 - static inline void sh7372_pm_setup_smfram(void) {} 374 - #endif /* CONFIG_SUSPEND || CONFIG_CPU_IDLE */ 375 - 376 - #ifdef CONFIG_CPU_IDLE 377 - static int sh7372_do_idle_core_standby(unsigned long unused) 378 - { 379 - cpu_do_idle(); /* WFI when SYSTBCR == 0x10 -> Core Standby */ 380 - return 0; 381 - } 382 - 383 - static int sh7372_enter_core_standby(struct cpuidle_device *dev, 384 - struct cpuidle_driver *drv, int index) 385 - { 386 - sh7372_set_reset_vector(__pa(sh7372_resume_core_standby_sysc)); 387 - 388 - /* enter sleep mode with SYSTBCR to 0x10 */ 389 - __raw_writel(0x10, SYSTBCR); 390 - cpu_suspend(0, sh7372_do_idle_core_standby); 391 - __raw_writel(0, SYSTBCR); 392 - 393 - /* disable reset vector translation */ 394 - __raw_writel(0, SBAR); 395 - 396 - return 1; 397 - } 398 - 399 - static int sh7372_enter_a3sm_pll_on(struct cpuidle_device *dev, 400 - struct cpuidle_driver *drv, int index) 401 - { 402 - sh7372_enter_a3sm_common(1); 403 - return 2; 404 - } 405 - 406 - static int sh7372_enter_a3sm_pll_off(struct cpuidle_device *dev, 407 - struct cpuidle_driver *drv, int index) 408 - { 409 - sh7372_enter_a3sm_common(0); 410 - return 3; 411 - } 412 - 413 - static int sh7372_enter_a4s(struct cpuidle_device *dev, 414 - struct cpuidle_driver *drv, int index) 415 - { 416 - unsigned long msk, msk2; 417 - 418 - if (!sh7372_sysc_valid(&msk, &msk2)) 419 - return sh7372_enter_a3sm_pll_off(dev, drv, index); 420 - 421 - sh7372_setup_sysc(msk, msk2); 422 - sh7372_enter_a4s_common(0); 423 - return 4; 424 - } 425 - 426 - static struct cpuidle_driver sh7372_cpuidle_driver = { 427 - .name = "sh7372_cpuidle", 428 - .owner = THIS_MODULE, 429 - .state_count = 5, 430 - .safe_state_index = 0, /* C1 */ 431 - .states[0] = ARM_CPUIDLE_WFI_STATE, 432 - .states[1] = { 433 - .name = "C2", 434 - .desc = "Core Standby Mode", 435 - .exit_latency = 10, 436 - .target_residency = 20 + 10, 437 - .enter = sh7372_enter_core_standby, 438 - }, 439 - .states[2] = { 440 - .name = "C3", 441 - .desc = "A3SM PLL ON", 442 - .exit_latency = 20, 443 - .target_residency = 30 + 20, 444 - .enter = sh7372_enter_a3sm_pll_on, 445 - }, 446 - .states[3] = { 447 - .name = "C4", 448 - .desc = "A3SM PLL OFF", 449 - .exit_latency = 120, 450 - .target_residency = 30 + 120, 451 - .enter = sh7372_enter_a3sm_pll_off, 452 - }, 453 - .states[4] = { 454 - .name = "C5", 455 - .desc = "A4S PLL OFF", 456 - .exit_latency = 240, 457 - .target_residency = 30 + 240, 458 - .enter = sh7372_enter_a4s, 459 - .disabled = true, 460 - }, 461 - }; 462 - 463 - static void __init sh7372_cpuidle_init(void) 464 - { 465 - return cpuidle_register(cpuidle_drv, NULL); 466 - } 467 - #else 468 - static void __init sh7372_cpuidle_init(void) {} 469 - #endif 470 - 471 - #ifdef CONFIG_SUSPEND 472 - static int sh7372_enter_suspend(suspend_state_t suspend_state) 473 - { 474 - unsigned long msk, msk2; 475 - 476 - /* check active clocks to determine potential wakeup sources */ 477 - if (sh7372_sysc_valid(&msk, &msk2) && a4s_suspend_ready) { 478 - /* convert INTC mask/sense to SYSC mask/sense */ 479 - sh7372_setup_sysc(msk, msk2); 480 - 481 - /* enter A4S sleep with PLLC0 off */ 482 - pr_debug("entering A4S\n"); 483 - sh7372_enter_a4s_common(0); 484 - return 0; 485 - } 486 - 487 - /* default to enter A3SM sleep with PLLC0 off */ 488 - pr_debug("entering A3SM\n"); 489 - sh7372_enter_a3sm_common(0); 490 - return 0; 491 - } 492 - 493 - /** 494 - * sh7372_pm_notifier_fn - SH7372 PM notifier routine. 495 - * @notifier: Unused. 496 - * @pm_event: Event being handled. 497 - * @unused: Unused. 498 - */ 499 - static int sh7372_pm_notifier_fn(struct notifier_block *notifier, 500 - unsigned long pm_event, void *unused) 501 - { 502 - switch (pm_event) { 503 - case PM_SUSPEND_PREPARE: 504 - /* 505 - * This is necessary, because the A4R domain has to be "on" 506 - * when suspend_device_irqs() and resume_device_irqs() are 507 - * executed during system suspend and resume, respectively, so 508 - * that those functions don't crash while accessing the INTCS. 509 - */ 510 - pm_genpd_name_poweron("A4R"); 511 - break; 512 - case PM_POST_SUSPEND: 513 - pm_genpd_poweroff_unused(); 514 - break; 515 - } 516 - 517 - return NOTIFY_DONE; 518 - } 519 - 520 - static void sh7372_suspend_init(void) 521 - { 522 - shmobile_suspend_ops.enter = sh7372_enter_suspend; 523 - pm_notifier(sh7372_pm_notifier_fn, 0); 524 - } 525 - #else 526 - static void sh7372_suspend_init(void) {} 527 - #endif 528 - 529 - void __init sh7372_pm_init(void) 530 - { 531 - /* enable DBG hardware block to kick SYSC */ 532 - __raw_writel(0x0000a500, DBGREG9); 533 - __raw_writel(0x0000a501, DBGREG9); 534 - __raw_writel(0x00000000, DBGREG1); 535 - 536 - /* do not convert A3SM, A3SP, A3SG, A4R power down into A4S */ 537 - __raw_writel(0, PDNSEL); 538 - 539 - sh7372_pm_setup_smfram(); 540 - 541 - sh7372_suspend_init(); 542 - sh7372_cpuidle_init(); 543 - } 544 - 545 - void __init sh7372_pm_init_late(void) 546 - { 547 - shmobile_init_late(); 548 - pm_genpd_name_attach_cpuidle("A4S", 4); 549 - }
-17
arch/arm/mach-shmobile/r8a73a4.h
··· 1 - #ifndef __ASM_R8A73A4_H__ 2 - #define __ASM_R8A73A4_H__ 3 - 4 - /* DMA slave IDs */ 5 - enum { 6 - SHDMA_SLAVE_INVALID, 7 - SHDMA_SLAVE_MMCIF0_TX, 8 - SHDMA_SLAVE_MMCIF0_RX, 9 - SHDMA_SLAVE_MMCIF1_TX, 10 - SHDMA_SLAVE_MMCIF1_RX, 11 - }; 12 - 13 - void r8a73a4_add_standard_devices(void); 14 - void r8a73a4_clock_init(void); 15 - void r8a73a4_pinmux_init(void); 16 - 17 - #endif /* __ASM_R8A73A4_H__ */
+2 -271
arch/arm/mach-shmobile/setup-r8a73a4.c
··· 13 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * GNU General Public License for more details. 15 15 */ 16 - #include <linux/irq.h> 17 - #include <linux/kernel.h> 18 - #include <linux/of_platform.h> 19 - #include <linux/platform_data/irq-renesas-irqc.h> 20 - #include <linux/serial_sci.h> 21 - #include <linux/sh_dma.h> 22 - #include <linux/sh_timer.h> 16 + 17 + #include <linux/init.h> 23 18 24 19 #include <asm/mach/arch.h> 25 20 26 21 #include "common.h" 27 - #include "dma-register.h" 28 - #include "irqs.h" 29 - #include "r8a73a4.h" 30 - 31 - static const struct resource pfc_resources[] = { 32 - DEFINE_RES_MEM(0xe6050000, 0x9000), 33 - }; 34 - 35 - void __init r8a73a4_pinmux_init(void) 36 - { 37 - platform_device_register_simple("pfc-r8a73a4", -1, pfc_resources, 38 - ARRAY_SIZE(pfc_resources)); 39 - } 40 - 41 - #define R8A73A4_SCIF(scif_type, _scscr, index, baseaddr, irq) \ 42 - static struct plat_sci_port scif##index##_platform_data = { \ 43 - .type = scif_type, \ 44 - .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \ 45 - .scscr = _scscr, \ 46 - }; \ 47 - \ 48 - static struct resource scif##index##_resources[] = { \ 49 - DEFINE_RES_MEM(baseaddr, 0x100), \ 50 - DEFINE_RES_IRQ(irq), \ 51 - } 52 - 53 - #define R8A73A4_SCIFA(index, baseaddr, irq) \ 54 - R8A73A4_SCIF(PORT_SCIFA, SCSCR_RE | SCSCR_TE | SCSCR_CKE0, \ 55 - index, baseaddr, irq) 56 - 57 - #define R8A73A4_SCIFB(index, baseaddr, irq) \ 58 - R8A73A4_SCIF(PORT_SCIFB, SCSCR_RE | SCSCR_TE, \ 59 - index, baseaddr, irq) 60 - 61 - R8A73A4_SCIFA(0, 0xe6c40000, gic_spi(144)); /* SCIFA0 */ 62 - R8A73A4_SCIFA(1, 0xe6c50000, gic_spi(145)); /* SCIFA1 */ 63 - R8A73A4_SCIFB(2, 0xe6c20000, gic_spi(148)); /* SCIFB0 */ 64 - R8A73A4_SCIFB(3, 0xe6c30000, gic_spi(149)); /* SCIFB1 */ 65 - R8A73A4_SCIFB(4, 0xe6ce0000, gic_spi(150)); /* SCIFB2 */ 66 - R8A73A4_SCIFB(5, 0xe6cf0000, gic_spi(151)); /* SCIFB3 */ 67 - 68 - #define r8a73a4_register_scif(index) \ 69 - platform_device_register_resndata(NULL, "sh-sci", index, \ 70 - scif##index##_resources, \ 71 - ARRAY_SIZE(scif##index##_resources), \ 72 - &scif##index##_platform_data, \ 73 - sizeof(scif##index##_platform_data)) 74 - 75 - static const struct renesas_irqc_config irqc0_data = { 76 - .irq_base = irq_pin(0), /* IRQ0 -> IRQ31 */ 77 - }; 78 - 79 - static const struct resource irqc0_resources[] = { 80 - DEFINE_RES_MEM(0xe61c0000, 0x200), /* IRQC Event Detector Block_0 */ 81 - DEFINE_RES_IRQ(gic_spi(0)), /* IRQ0 */ 82 - DEFINE_RES_IRQ(gic_spi(1)), /* IRQ1 */ 83 - DEFINE_RES_IRQ(gic_spi(2)), /* IRQ2 */ 84 - DEFINE_RES_IRQ(gic_spi(3)), /* IRQ3 */ 85 - DEFINE_RES_IRQ(gic_spi(4)), /* IRQ4 */ 86 - DEFINE_RES_IRQ(gic_spi(5)), /* IRQ5 */ 87 - DEFINE_RES_IRQ(gic_spi(6)), /* IRQ6 */ 88 - DEFINE_RES_IRQ(gic_spi(7)), /* IRQ7 */ 89 - DEFINE_RES_IRQ(gic_spi(8)), /* IRQ8 */ 90 - DEFINE_RES_IRQ(gic_spi(9)), /* IRQ9 */ 91 - DEFINE_RES_IRQ(gic_spi(10)), /* IRQ10 */ 92 - DEFINE_RES_IRQ(gic_spi(11)), /* IRQ11 */ 93 - DEFINE_RES_IRQ(gic_spi(12)), /* IRQ12 */ 94 - DEFINE_RES_IRQ(gic_spi(13)), /* IRQ13 */ 95 - DEFINE_RES_IRQ(gic_spi(14)), /* IRQ14 */ 96 - DEFINE_RES_IRQ(gic_spi(15)), /* IRQ15 */ 97 - DEFINE_RES_IRQ(gic_spi(16)), /* IRQ16 */ 98 - DEFINE_RES_IRQ(gic_spi(17)), /* IRQ17 */ 99 - DEFINE_RES_IRQ(gic_spi(18)), /* IRQ18 */ 100 - DEFINE_RES_IRQ(gic_spi(19)), /* IRQ19 */ 101 - DEFINE_RES_IRQ(gic_spi(20)), /* IRQ20 */ 102 - DEFINE_RES_IRQ(gic_spi(21)), /* IRQ21 */ 103 - DEFINE_RES_IRQ(gic_spi(22)), /* IRQ22 */ 104 - DEFINE_RES_IRQ(gic_spi(23)), /* IRQ23 */ 105 - DEFINE_RES_IRQ(gic_spi(24)), /* IRQ24 */ 106 - DEFINE_RES_IRQ(gic_spi(25)), /* IRQ25 */ 107 - DEFINE_RES_IRQ(gic_spi(26)), /* IRQ26 */ 108 - DEFINE_RES_IRQ(gic_spi(27)), /* IRQ27 */ 109 - DEFINE_RES_IRQ(gic_spi(28)), /* IRQ28 */ 110 - DEFINE_RES_IRQ(gic_spi(29)), /* IRQ29 */ 111 - DEFINE_RES_IRQ(gic_spi(30)), /* IRQ30 */ 112 - DEFINE_RES_IRQ(gic_spi(31)), /* IRQ31 */ 113 - }; 114 - 115 - static const struct renesas_irqc_config irqc1_data = { 116 - .irq_base = irq_pin(32), /* IRQ32 -> IRQ57 */ 117 - }; 118 - 119 - static const struct resource irqc1_resources[] = { 120 - DEFINE_RES_MEM(0xe61c0200, 0x200), /* IRQC Event Detector Block_1 */ 121 - DEFINE_RES_IRQ(gic_spi(32)), /* IRQ32 */ 122 - DEFINE_RES_IRQ(gic_spi(33)), /* IRQ33 */ 123 - DEFINE_RES_IRQ(gic_spi(34)), /* IRQ34 */ 124 - DEFINE_RES_IRQ(gic_spi(35)), /* IRQ35 */ 125 - DEFINE_RES_IRQ(gic_spi(36)), /* IRQ36 */ 126 - DEFINE_RES_IRQ(gic_spi(37)), /* IRQ37 */ 127 - DEFINE_RES_IRQ(gic_spi(38)), /* IRQ38 */ 128 - DEFINE_RES_IRQ(gic_spi(39)), /* IRQ39 */ 129 - DEFINE_RES_IRQ(gic_spi(40)), /* IRQ40 */ 130 - DEFINE_RES_IRQ(gic_spi(41)), /* IRQ41 */ 131 - DEFINE_RES_IRQ(gic_spi(42)), /* IRQ42 */ 132 - DEFINE_RES_IRQ(gic_spi(43)), /* IRQ43 */ 133 - DEFINE_RES_IRQ(gic_spi(44)), /* IRQ44 */ 134 - DEFINE_RES_IRQ(gic_spi(45)), /* IRQ45 */ 135 - DEFINE_RES_IRQ(gic_spi(46)), /* IRQ46 */ 136 - DEFINE_RES_IRQ(gic_spi(47)), /* IRQ47 */ 137 - DEFINE_RES_IRQ(gic_spi(48)), /* IRQ48 */ 138 - DEFINE_RES_IRQ(gic_spi(49)), /* IRQ49 */ 139 - DEFINE_RES_IRQ(gic_spi(50)), /* IRQ50 */ 140 - DEFINE_RES_IRQ(gic_spi(51)), /* IRQ51 */ 141 - DEFINE_RES_IRQ(gic_spi(52)), /* IRQ52 */ 142 - DEFINE_RES_IRQ(gic_spi(53)), /* IRQ53 */ 143 - DEFINE_RES_IRQ(gic_spi(54)), /* IRQ54 */ 144 - DEFINE_RES_IRQ(gic_spi(55)), /* IRQ55 */ 145 - DEFINE_RES_IRQ(gic_spi(56)), /* IRQ56 */ 146 - DEFINE_RES_IRQ(gic_spi(57)), /* IRQ57 */ 147 - }; 148 - 149 - #define r8a73a4_register_irqc(idx) \ 150 - platform_device_register_resndata(NULL, "renesas_irqc", \ 151 - idx, irqc##idx##_resources, \ 152 - ARRAY_SIZE(irqc##idx##_resources), \ 153 - &irqc##idx##_data, \ 154 - sizeof(struct renesas_irqc_config)) 155 - 156 - /* Thermal0 -> Thermal2 */ 157 - static const struct resource thermal0_resources[] = { 158 - DEFINE_RES_MEM(0xe61f0000, 0x14), 159 - DEFINE_RES_MEM(0xe61f0100, 0x38), 160 - DEFINE_RES_MEM(0xe61f0200, 0x38), 161 - DEFINE_RES_MEM(0xe61f0300, 0x38), 162 - DEFINE_RES_IRQ(gic_spi(69)), 163 - }; 164 - 165 - #define r8a73a4_register_thermal() \ 166 - platform_device_register_simple("rcar_thermal", -1, \ 167 - thermal0_resources, \ 168 - ARRAY_SIZE(thermal0_resources)) 169 - 170 - static struct sh_timer_config cmt1_platform_data = { 171 - .channels_mask = 0xff, 172 - }; 173 - 174 - static struct resource cmt1_resources[] = { 175 - DEFINE_RES_MEM(0xe6130000, 0x1004), 176 - DEFINE_RES_IRQ(gic_spi(120)), 177 - }; 178 - 179 - #define r8a73a4_register_cmt(idx) \ 180 - platform_device_register_resndata(NULL, "sh-cmt-48-gen2", \ 181 - idx, cmt##idx##_resources, \ 182 - ARRAY_SIZE(cmt##idx##_resources), \ 183 - &cmt##idx##_platform_data, \ 184 - sizeof(struct sh_timer_config)) 185 - 186 - /* DMA */ 187 - static const struct sh_dmae_slave_config dma_slaves[] = { 188 - { 189 - .slave_id = SHDMA_SLAVE_MMCIF0_TX, 190 - .addr = 0xee200034, 191 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 192 - .mid_rid = 0xd1, 193 - }, { 194 - .slave_id = SHDMA_SLAVE_MMCIF0_RX, 195 - .addr = 0xee200034, 196 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 197 - .mid_rid = 0xd2, 198 - }, { 199 - .slave_id = SHDMA_SLAVE_MMCIF1_TX, 200 - .addr = 0xee220034, 201 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 202 - .mid_rid = 0xe1, 203 - }, { 204 - .slave_id = SHDMA_SLAVE_MMCIF1_RX, 205 - .addr = 0xee220034, 206 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 207 - .mid_rid = 0xe2, 208 - }, 209 - }; 210 - 211 - #define DMAE_CHANNEL(a, b) \ 212 - { \ 213 - .offset = (a) - 0x20, \ 214 - .dmars = (a) - 0x20 + 0x40, \ 215 - .chclr_bit = (b), \ 216 - .chclr_offset = 0x80 - 0x20, \ 217 - } 218 - 219 - static const struct sh_dmae_channel dma_channels[] = { 220 - DMAE_CHANNEL(0x8000, 0), 221 - DMAE_CHANNEL(0x8080, 1), 222 - DMAE_CHANNEL(0x8100, 2), 223 - DMAE_CHANNEL(0x8180, 3), 224 - DMAE_CHANNEL(0x8200, 4), 225 - DMAE_CHANNEL(0x8280, 5), 226 - DMAE_CHANNEL(0x8300, 6), 227 - DMAE_CHANNEL(0x8380, 7), 228 - DMAE_CHANNEL(0x8400, 8), 229 - DMAE_CHANNEL(0x8480, 9), 230 - DMAE_CHANNEL(0x8500, 10), 231 - DMAE_CHANNEL(0x8580, 11), 232 - DMAE_CHANNEL(0x8600, 12), 233 - DMAE_CHANNEL(0x8680, 13), 234 - DMAE_CHANNEL(0x8700, 14), 235 - DMAE_CHANNEL(0x8780, 15), 236 - DMAE_CHANNEL(0x8800, 16), 237 - DMAE_CHANNEL(0x8880, 17), 238 - DMAE_CHANNEL(0x8900, 18), 239 - DMAE_CHANNEL(0x8980, 19), 240 - }; 241 - 242 - static const struct sh_dmae_pdata dma_pdata = { 243 - .slave = dma_slaves, 244 - .slave_num = ARRAY_SIZE(dma_slaves), 245 - .channel = dma_channels, 246 - .channel_num = ARRAY_SIZE(dma_channels), 247 - .ts_low_shift = TS_LOW_SHIFT, 248 - .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT, 249 - .ts_high_shift = TS_HI_SHIFT, 250 - .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT, 251 - .ts_shift = dma_ts_shift, 252 - .ts_shift_num = ARRAY_SIZE(dma_ts_shift), 253 - .dmaor_init = DMAOR_DME, 254 - .chclr_present = 1, 255 - .chclr_bitwise = 1, 256 - }; 257 - 258 - static struct resource dma_resources[] = { 259 - DEFINE_RES_MEM(0xe6700020, 0x89e0), 260 - DEFINE_RES_IRQ(gic_spi(220)), 261 - { 262 - /* IRQ for channels 0-19 */ 263 - .start = gic_spi(200), 264 - .end = gic_spi(219), 265 - .flags = IORESOURCE_IRQ, 266 - }, 267 - }; 268 - 269 - #define r8a73a4_register_dmac() \ 270 - platform_device_register_resndata(NULL, "sh-dma-engine", 0, \ 271 - dma_resources, ARRAY_SIZE(dma_resources), \ 272 - &dma_pdata, sizeof(dma_pdata)) 273 - 274 - void __init r8a73a4_add_standard_devices(void) 275 - { 276 - r8a73a4_register_cmt(1); 277 - r8a73a4_register_scif(0); 278 - r8a73a4_register_scif(1); 279 - r8a73a4_register_scif(2); 280 - r8a73a4_register_scif(3); 281 - r8a73a4_register_scif(4); 282 - r8a73a4_register_scif(5); 283 - r8a73a4_register_irqc(0); 284 - r8a73a4_register_irqc(1); 285 - r8a73a4_register_thermal(); 286 - r8a73a4_register_dmac(); 287 - } 288 - 289 - #ifdef CONFIG_USE_OF 290 22 291 23 static const char *r8a73a4_boards_compat_dt[] __initdata = { 292 24 "renesas,r8a73a4", ··· 30 298 .init_late = shmobile_init_late, 31 299 .dt_compat = r8a73a4_boards_compat_dt, 32 300 MACHINE_END 33 - #endif /* CONFIG_USE_OF */
+19
arch/arm/mach-shmobile/setup-r8a7778.c
··· 15 15 * GNU General Public License for more details. 16 16 */ 17 17 18 + #include <linux/clk/shmobile.h> 18 19 #include <linux/kernel.h> 19 20 #include <linux/io.h> 20 21 #include <linux/irqchip/arm-gic.h> ··· 41 40 #include "common.h" 42 41 #include "irqs.h" 43 42 #include "r8a7778.h" 43 + 44 + #define MODEMR 0xffcc0020 45 + 46 + #ifdef CONFIG_COMMON_CLK 47 + static void __init r8a7778_timer_init(void) 48 + { 49 + u32 mode; 50 + void __iomem *modemr = ioremap_nocache(MODEMR, 4); 51 + 52 + BUG_ON(!modemr); 53 + mode = ioread32(modemr); 54 + iounmap(modemr); 55 + r8a7778_clocks_init(mode); 56 + } 57 + #endif 44 58 45 59 /* SCIF */ 46 60 #define R8A7778_SCIF(index, baseaddr, irq) \ ··· 624 608 .init_early = shmobile_init_delay, 625 609 .init_irq = r8a7778_init_irq_dt, 626 610 .init_late = shmobile_init_late, 611 + #ifdef CONFIG_COMMON_CLK 612 + .init_time = r8a7778_timer_init, 613 + #endif 627 614 .dt_compat = r8a7778_compat_dt, 628 615 MACHINE_END 629 616
-1016
arch/arm/mach-shmobile/setup-sh7372.c
··· 1 - /* 2 - * sh7372 processor support 3 - * 4 - * Copyright (C) 2010 Magnus Damm 5 - * Copyright (C) 2008 Yoshihiro Shimoda 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 - #include <linux/kernel.h> 17 - #include <linux/init.h> 18 - #include <linux/interrupt.h> 19 - #include <linux/irq.h> 20 - #include <linux/platform_device.h> 21 - #include <linux/of_platform.h> 22 - #include <linux/uio_driver.h> 23 - #include <linux/delay.h> 24 - #include <linux/input.h> 25 - #include <linux/io.h> 26 - #include <linux/serial_sci.h> 27 - #include <linux/sh_dma.h> 28 - #include <linux/sh_timer.h> 29 - #include <linux/pm_domain.h> 30 - #include <linux/dma-mapping.h> 31 - #include <linux/platform_data/sh_ipmmu.h> 32 - 33 - #include <asm/mach/map.h> 34 - #include <asm/mach-types.h> 35 - #include <asm/mach/arch.h> 36 - #include <asm/mach/time.h> 37 - 38 - #include "common.h" 39 - #include "dma-register.h" 40 - #include "intc.h" 41 - #include "irqs.h" 42 - #include "pm-rmobile.h" 43 - #include "sh7372.h" 44 - 45 - static struct map_desc sh7372_io_desc[] __initdata = { 46 - /* create a 1:1 identity mapping for 0xe6xxxxxx 47 - * used by CPGA, INTC and PFC. 48 - */ 49 - { 50 - .virtual = 0xe6000000, 51 - .pfn = __phys_to_pfn(0xe6000000), 52 - .length = 256 << 20, 53 - .type = MT_DEVICE_NONSHARED 54 - }, 55 - }; 56 - 57 - void __init sh7372_map_io(void) 58 - { 59 - debug_ll_io_init(); 60 - iotable_init(sh7372_io_desc, ARRAY_SIZE(sh7372_io_desc)); 61 - } 62 - 63 - /* PFC */ 64 - static struct resource sh7372_pfc_resources[] = { 65 - [0] = { 66 - .start = 0xe6050000, 67 - .end = 0xe6057fff, 68 - .flags = IORESOURCE_MEM, 69 - }, 70 - [1] = { 71 - .start = 0xe605800c, 72 - .end = 0xe6058027, 73 - .flags = IORESOURCE_MEM, 74 - } 75 - }; 76 - 77 - static struct platform_device sh7372_pfc_device = { 78 - .name = "pfc-sh7372", 79 - .id = -1, 80 - .resource = sh7372_pfc_resources, 81 - .num_resources = ARRAY_SIZE(sh7372_pfc_resources), 82 - }; 83 - 84 - void __init sh7372_pinmux_init(void) 85 - { 86 - platform_device_register(&sh7372_pfc_device); 87 - } 88 - 89 - /* SCIF */ 90 - #define SH7372_SCIF(scif_type, index, baseaddr, irq) \ 91 - static struct plat_sci_port scif##index##_platform_data = { \ 92 - .type = scif_type, \ 93 - .flags = UPF_BOOT_AUTOCONF, \ 94 - .scscr = SCSCR_RE | SCSCR_TE, \ 95 - }; \ 96 - \ 97 - static struct resource scif##index##_resources[] = { \ 98 - DEFINE_RES_MEM(baseaddr, 0x100), \ 99 - DEFINE_RES_IRQ(irq), \ 100 - }; \ 101 - \ 102 - static struct platform_device scif##index##_device = { \ 103 - .name = "sh-sci", \ 104 - .id = index, \ 105 - .resource = scif##index##_resources, \ 106 - .num_resources = ARRAY_SIZE(scif##index##_resources), \ 107 - .dev = { \ 108 - .platform_data = &scif##index##_platform_data, \ 109 - }, \ 110 - } 111 - 112 - SH7372_SCIF(PORT_SCIFA, 0, 0xe6c40000, evt2irq(0x0c00)); 113 - SH7372_SCIF(PORT_SCIFA, 1, 0xe6c50000, evt2irq(0x0c20)); 114 - SH7372_SCIF(PORT_SCIFA, 2, 0xe6c60000, evt2irq(0x0c40)); 115 - SH7372_SCIF(PORT_SCIFA, 3, 0xe6c70000, evt2irq(0x0c60)); 116 - SH7372_SCIF(PORT_SCIFA, 4, 0xe6c80000, evt2irq(0x0d20)); 117 - SH7372_SCIF(PORT_SCIFA, 5, 0xe6cb0000, evt2irq(0x0d40)); 118 - SH7372_SCIF(PORT_SCIFB, 6, 0xe6c30000, evt2irq(0x0d60)); 119 - 120 - /* CMT */ 121 - static struct sh_timer_config cmt2_platform_data = { 122 - .channels_mask = 0x20, 123 - }; 124 - 125 - static struct resource cmt2_resources[] = { 126 - DEFINE_RES_MEM(0xe6130000, 0x50), 127 - DEFINE_RES_IRQ(evt2irq(0x0b80)), 128 - }; 129 - 130 - static struct platform_device cmt2_device = { 131 - .name = "sh-cmt-32-fast", 132 - .id = 2, 133 - .dev = { 134 - .platform_data = &cmt2_platform_data, 135 - }, 136 - .resource = cmt2_resources, 137 - .num_resources = ARRAY_SIZE(cmt2_resources), 138 - }; 139 - 140 - /* TMU */ 141 - static struct sh_timer_config tmu0_platform_data = { 142 - .channels_mask = 7, 143 - }; 144 - 145 - static struct resource tmu0_resources[] = { 146 - DEFINE_RES_MEM(0xfff60000, 0x2c), 147 - DEFINE_RES_IRQ(intcs_evt2irq(0xe80)), 148 - DEFINE_RES_IRQ(intcs_evt2irq(0xea0)), 149 - DEFINE_RES_IRQ(intcs_evt2irq(0xec0)), 150 - }; 151 - 152 - static struct platform_device tmu0_device = { 153 - .name = "sh-tmu", 154 - .id = 0, 155 - .dev = { 156 - .platform_data = &tmu0_platform_data, 157 - }, 158 - .resource = tmu0_resources, 159 - .num_resources = ARRAY_SIZE(tmu0_resources), 160 - }; 161 - 162 - /* I2C */ 163 - static struct resource iic0_resources[] = { 164 - [0] = { 165 - .name = "IIC0", 166 - .start = 0xFFF20000, 167 - .end = 0xFFF20425 - 1, 168 - .flags = IORESOURCE_MEM, 169 - }, 170 - [1] = { 171 - .start = intcs_evt2irq(0xe00), /* IIC0_ALI0 */ 172 - .end = intcs_evt2irq(0xe60), /* IIC0_DTEI0 */ 173 - .flags = IORESOURCE_IRQ, 174 - }, 175 - }; 176 - 177 - static struct platform_device iic0_device = { 178 - .name = "i2c-sh_mobile", 179 - .id = 0, /* "i2c0" clock */ 180 - .num_resources = ARRAY_SIZE(iic0_resources), 181 - .resource = iic0_resources, 182 - }; 183 - 184 - static struct resource iic1_resources[] = { 185 - [0] = { 186 - .name = "IIC1", 187 - .start = 0xE6C20000, 188 - .end = 0xE6C20425 - 1, 189 - .flags = IORESOURCE_MEM, 190 - }, 191 - [1] = { 192 - .start = evt2irq(0x780), /* IIC1_ALI1 */ 193 - .end = evt2irq(0x7e0), /* IIC1_DTEI1 */ 194 - .flags = IORESOURCE_IRQ, 195 - }, 196 - }; 197 - 198 - static struct platform_device iic1_device = { 199 - .name = "i2c-sh_mobile", 200 - .id = 1, /* "i2c1" clock */ 201 - .num_resources = ARRAY_SIZE(iic1_resources), 202 - .resource = iic1_resources, 203 - }; 204 - 205 - /* DMA */ 206 - static const struct sh_dmae_slave_config sh7372_dmae_slaves[] = { 207 - { 208 - .slave_id = SHDMA_SLAVE_SCIF0_TX, 209 - .addr = 0xe6c40020, 210 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 211 - .mid_rid = 0x21, 212 - }, { 213 - .slave_id = SHDMA_SLAVE_SCIF0_RX, 214 - .addr = 0xe6c40024, 215 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 216 - .mid_rid = 0x22, 217 - }, { 218 - .slave_id = SHDMA_SLAVE_SCIF1_TX, 219 - .addr = 0xe6c50020, 220 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 221 - .mid_rid = 0x25, 222 - }, { 223 - .slave_id = SHDMA_SLAVE_SCIF1_RX, 224 - .addr = 0xe6c50024, 225 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 226 - .mid_rid = 0x26, 227 - }, { 228 - .slave_id = SHDMA_SLAVE_SCIF2_TX, 229 - .addr = 0xe6c60020, 230 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 231 - .mid_rid = 0x29, 232 - }, { 233 - .slave_id = SHDMA_SLAVE_SCIF2_RX, 234 - .addr = 0xe6c60024, 235 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 236 - .mid_rid = 0x2a, 237 - }, { 238 - .slave_id = SHDMA_SLAVE_SCIF3_TX, 239 - .addr = 0xe6c70020, 240 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 241 - .mid_rid = 0x2d, 242 - }, { 243 - .slave_id = SHDMA_SLAVE_SCIF3_RX, 244 - .addr = 0xe6c70024, 245 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 246 - .mid_rid = 0x2e, 247 - }, { 248 - .slave_id = SHDMA_SLAVE_SCIF4_TX, 249 - .addr = 0xe6c80020, 250 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 251 - .mid_rid = 0x39, 252 - }, { 253 - .slave_id = SHDMA_SLAVE_SCIF4_RX, 254 - .addr = 0xe6c80024, 255 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 256 - .mid_rid = 0x3a, 257 - }, { 258 - .slave_id = SHDMA_SLAVE_SCIF5_TX, 259 - .addr = 0xe6cb0020, 260 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 261 - .mid_rid = 0x35, 262 - }, { 263 - .slave_id = SHDMA_SLAVE_SCIF5_RX, 264 - .addr = 0xe6cb0024, 265 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 266 - .mid_rid = 0x36, 267 - }, { 268 - .slave_id = SHDMA_SLAVE_SCIF6_TX, 269 - .addr = 0xe6c30040, 270 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 271 - .mid_rid = 0x3d, 272 - }, { 273 - .slave_id = SHDMA_SLAVE_SCIF6_RX, 274 - .addr = 0xe6c30060, 275 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 276 - .mid_rid = 0x3e, 277 - }, { 278 - .slave_id = SHDMA_SLAVE_FLCTL0_TX, 279 - .addr = 0xe6a30050, 280 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 281 - .mid_rid = 0x83, 282 - }, { 283 - .slave_id = SHDMA_SLAVE_FLCTL0_RX, 284 - .addr = 0xe6a30050, 285 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 286 - .mid_rid = 0x83, 287 - }, { 288 - .slave_id = SHDMA_SLAVE_FLCTL1_TX, 289 - .addr = 0xe6a30060, 290 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 291 - .mid_rid = 0x87, 292 - }, { 293 - .slave_id = SHDMA_SLAVE_FLCTL1_RX, 294 - .addr = 0xe6a30060, 295 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 296 - .mid_rid = 0x87, 297 - }, { 298 - .slave_id = SHDMA_SLAVE_SDHI0_TX, 299 - .addr = 0xe6850030, 300 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 301 - .mid_rid = 0xc1, 302 - }, { 303 - .slave_id = SHDMA_SLAVE_SDHI0_RX, 304 - .addr = 0xe6850030, 305 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 306 - .mid_rid = 0xc2, 307 - }, { 308 - .slave_id = SHDMA_SLAVE_SDHI1_TX, 309 - .addr = 0xe6860030, 310 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 311 - .mid_rid = 0xc9, 312 - }, { 313 - .slave_id = SHDMA_SLAVE_SDHI1_RX, 314 - .addr = 0xe6860030, 315 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 316 - .mid_rid = 0xca, 317 - }, { 318 - .slave_id = SHDMA_SLAVE_SDHI2_TX, 319 - .addr = 0xe6870030, 320 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 321 - .mid_rid = 0xcd, 322 - }, { 323 - .slave_id = SHDMA_SLAVE_SDHI2_RX, 324 - .addr = 0xe6870030, 325 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 326 - .mid_rid = 0xce, 327 - }, { 328 - .slave_id = SHDMA_SLAVE_FSIA_TX, 329 - .addr = 0xfe1f0024, 330 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 331 - .mid_rid = 0xb1, 332 - }, { 333 - .slave_id = SHDMA_SLAVE_FSIA_RX, 334 - .addr = 0xfe1f0020, 335 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 336 - .mid_rid = 0xb2, 337 - }, { 338 - .slave_id = SHDMA_SLAVE_MMCIF_TX, 339 - .addr = 0xe6bd0034, 340 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 341 - .mid_rid = 0xd1, 342 - }, { 343 - .slave_id = SHDMA_SLAVE_MMCIF_RX, 344 - .addr = 0xe6bd0034, 345 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 346 - .mid_rid = 0xd2, 347 - }, 348 - }; 349 - 350 - #define SH7372_CHCLR (0x220 - 0x20) 351 - 352 - static const struct sh_dmae_channel sh7372_dmae_channels[] = { 353 - { 354 - .offset = 0, 355 - .dmars = 0, 356 - .dmars_bit = 0, 357 - .chclr_offset = SH7372_CHCLR + 0, 358 - }, { 359 - .offset = 0x10, 360 - .dmars = 0, 361 - .dmars_bit = 8, 362 - .chclr_offset = SH7372_CHCLR + 0x10, 363 - }, { 364 - .offset = 0x20, 365 - .dmars = 4, 366 - .dmars_bit = 0, 367 - .chclr_offset = SH7372_CHCLR + 0x20, 368 - }, { 369 - .offset = 0x30, 370 - .dmars = 4, 371 - .dmars_bit = 8, 372 - .chclr_offset = SH7372_CHCLR + 0x30, 373 - }, { 374 - .offset = 0x50, 375 - .dmars = 8, 376 - .dmars_bit = 0, 377 - .chclr_offset = SH7372_CHCLR + 0x50, 378 - }, { 379 - .offset = 0x60, 380 - .dmars = 8, 381 - .dmars_bit = 8, 382 - .chclr_offset = SH7372_CHCLR + 0x60, 383 - } 384 - }; 385 - 386 - static struct sh_dmae_pdata dma_platform_data = { 387 - .slave = sh7372_dmae_slaves, 388 - .slave_num = ARRAY_SIZE(sh7372_dmae_slaves), 389 - .channel = sh7372_dmae_channels, 390 - .channel_num = ARRAY_SIZE(sh7372_dmae_channels), 391 - .ts_low_shift = TS_LOW_SHIFT, 392 - .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT, 393 - .ts_high_shift = TS_HI_SHIFT, 394 - .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT, 395 - .ts_shift = dma_ts_shift, 396 - .ts_shift_num = ARRAY_SIZE(dma_ts_shift), 397 - .dmaor_init = DMAOR_DME, 398 - .chclr_present = 1, 399 - }; 400 - 401 - /* Resource order important! */ 402 - static struct resource sh7372_dmae0_resources[] = { 403 - { 404 - /* Channel registers and DMAOR */ 405 - .start = 0xfe008020, 406 - .end = 0xfe00828f, 407 - .flags = IORESOURCE_MEM, 408 - }, 409 - { 410 - /* DMARSx */ 411 - .start = 0xfe009000, 412 - .end = 0xfe00900b, 413 - .flags = IORESOURCE_MEM, 414 - }, 415 - { 416 - .name = "error_irq", 417 - .start = evt2irq(0x20c0), 418 - .end = evt2irq(0x20c0), 419 - .flags = IORESOURCE_IRQ, 420 - }, 421 - { 422 - /* IRQ for channels 0-5 */ 423 - .start = evt2irq(0x2000), 424 - .end = evt2irq(0x20a0), 425 - .flags = IORESOURCE_IRQ, 426 - }, 427 - }; 428 - 429 - /* Resource order important! */ 430 - static struct resource sh7372_dmae1_resources[] = { 431 - { 432 - /* Channel registers and DMAOR */ 433 - .start = 0xfe018020, 434 - .end = 0xfe01828f, 435 - .flags = IORESOURCE_MEM, 436 - }, 437 - { 438 - /* DMARSx */ 439 - .start = 0xfe019000, 440 - .end = 0xfe01900b, 441 - .flags = IORESOURCE_MEM, 442 - }, 443 - { 444 - .name = "error_irq", 445 - .start = evt2irq(0x21c0), 446 - .end = evt2irq(0x21c0), 447 - .flags = IORESOURCE_IRQ, 448 - }, 449 - { 450 - /* IRQ for channels 0-5 */ 451 - .start = evt2irq(0x2100), 452 - .end = evt2irq(0x21a0), 453 - .flags = IORESOURCE_IRQ, 454 - }, 455 - }; 456 - 457 - /* Resource order important! */ 458 - static struct resource sh7372_dmae2_resources[] = { 459 - { 460 - /* Channel registers and DMAOR */ 461 - .start = 0xfe028020, 462 - .end = 0xfe02828f, 463 - .flags = IORESOURCE_MEM, 464 - }, 465 - { 466 - /* DMARSx */ 467 - .start = 0xfe029000, 468 - .end = 0xfe02900b, 469 - .flags = IORESOURCE_MEM, 470 - }, 471 - { 472 - .name = "error_irq", 473 - .start = evt2irq(0x22c0), 474 - .end = evt2irq(0x22c0), 475 - .flags = IORESOURCE_IRQ, 476 - }, 477 - { 478 - /* IRQ for channels 0-5 */ 479 - .start = evt2irq(0x2200), 480 - .end = evt2irq(0x22a0), 481 - .flags = IORESOURCE_IRQ, 482 - }, 483 - }; 484 - 485 - static struct platform_device dma0_device = { 486 - .name = "sh-dma-engine", 487 - .id = 0, 488 - .resource = sh7372_dmae0_resources, 489 - .num_resources = ARRAY_SIZE(sh7372_dmae0_resources), 490 - .dev = { 491 - .platform_data = &dma_platform_data, 492 - }, 493 - }; 494 - 495 - static struct platform_device dma1_device = { 496 - .name = "sh-dma-engine", 497 - .id = 1, 498 - .resource = sh7372_dmae1_resources, 499 - .num_resources = ARRAY_SIZE(sh7372_dmae1_resources), 500 - .dev = { 501 - .platform_data = &dma_platform_data, 502 - }, 503 - }; 504 - 505 - static struct platform_device dma2_device = { 506 - .name = "sh-dma-engine", 507 - .id = 2, 508 - .resource = sh7372_dmae2_resources, 509 - .num_resources = ARRAY_SIZE(sh7372_dmae2_resources), 510 - .dev = { 511 - .platform_data = &dma_platform_data, 512 - }, 513 - }; 514 - 515 - /* 516 - * USB-DMAC 517 - */ 518 - static const struct sh_dmae_channel sh7372_usb_dmae_channels[] = { 519 - { 520 - .offset = 0, 521 - }, { 522 - .offset = 0x20, 523 - }, 524 - }; 525 - 526 - /* USB DMAC0 */ 527 - static const struct sh_dmae_slave_config sh7372_usb_dmae0_slaves[] = { 528 - { 529 - .slave_id = SHDMA_SLAVE_USB0_TX, 530 - .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE), 531 - }, { 532 - .slave_id = SHDMA_SLAVE_USB0_RX, 533 - .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE), 534 - }, 535 - }; 536 - 537 - static struct sh_dmae_pdata usb_dma0_platform_data = { 538 - .slave = sh7372_usb_dmae0_slaves, 539 - .slave_num = ARRAY_SIZE(sh7372_usb_dmae0_slaves), 540 - .channel = sh7372_usb_dmae_channels, 541 - .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels), 542 - .ts_low_shift = USBTS_LOW_SHIFT, 543 - .ts_low_mask = USBTS_LOW_BIT << USBTS_LOW_SHIFT, 544 - .ts_high_shift = USBTS_HI_SHIFT, 545 - .ts_high_mask = USBTS_HI_BIT << USBTS_HI_SHIFT, 546 - .ts_shift = dma_usbts_shift, 547 - .ts_shift_num = ARRAY_SIZE(dma_usbts_shift), 548 - .dmaor_init = DMAOR_DME, 549 - .chcr_offset = 0x14, 550 - .chcr_ie_bit = 1 << 5, 551 - .dmaor_is_32bit = 1, 552 - .needs_tend_set = 1, 553 - .no_dmars = 1, 554 - .slave_only = 1, 555 - }; 556 - 557 - static struct resource sh7372_usb_dmae0_resources[] = { 558 - { 559 - /* Channel registers and DMAOR */ 560 - .start = 0xe68a0020, 561 - .end = 0xe68a0064 - 1, 562 - .flags = IORESOURCE_MEM, 563 - }, 564 - { 565 - /* VCR/SWR/DMICR */ 566 - .start = 0xe68a0000, 567 - .end = 0xe68a0014 - 1, 568 - .flags = IORESOURCE_MEM, 569 - }, 570 - { 571 - /* IRQ for channels */ 572 - .start = evt2irq(0x0a00), 573 - .end = evt2irq(0x0a00), 574 - .flags = IORESOURCE_IRQ, 575 - }, 576 - }; 577 - 578 - static struct platform_device usb_dma0_device = { 579 - .name = "sh-dma-engine", 580 - .id = 3, 581 - .resource = sh7372_usb_dmae0_resources, 582 - .num_resources = ARRAY_SIZE(sh7372_usb_dmae0_resources), 583 - .dev = { 584 - .platform_data = &usb_dma0_platform_data, 585 - }, 586 - }; 587 - 588 - /* USB DMAC1 */ 589 - static const struct sh_dmae_slave_config sh7372_usb_dmae1_slaves[] = { 590 - { 591 - .slave_id = SHDMA_SLAVE_USB1_TX, 592 - .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE), 593 - }, { 594 - .slave_id = SHDMA_SLAVE_USB1_RX, 595 - .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE), 596 - }, 597 - }; 598 - 599 - static struct sh_dmae_pdata usb_dma1_platform_data = { 600 - .slave = sh7372_usb_dmae1_slaves, 601 - .slave_num = ARRAY_SIZE(sh7372_usb_dmae1_slaves), 602 - .channel = sh7372_usb_dmae_channels, 603 - .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels), 604 - .ts_low_shift = USBTS_LOW_SHIFT, 605 - .ts_low_mask = USBTS_LOW_BIT << USBTS_LOW_SHIFT, 606 - .ts_high_shift = USBTS_HI_SHIFT, 607 - .ts_high_mask = USBTS_HI_BIT << USBTS_HI_SHIFT, 608 - .ts_shift = dma_usbts_shift, 609 - .ts_shift_num = ARRAY_SIZE(dma_usbts_shift), 610 - .dmaor_init = DMAOR_DME, 611 - .chcr_offset = 0x14, 612 - .chcr_ie_bit = 1 << 5, 613 - .dmaor_is_32bit = 1, 614 - .needs_tend_set = 1, 615 - .no_dmars = 1, 616 - .slave_only = 1, 617 - }; 618 - 619 - static struct resource sh7372_usb_dmae1_resources[] = { 620 - { 621 - /* Channel registers and DMAOR */ 622 - .start = 0xe68c0020, 623 - .end = 0xe68c0064 - 1, 624 - .flags = IORESOURCE_MEM, 625 - }, 626 - { 627 - /* VCR/SWR/DMICR */ 628 - .start = 0xe68c0000, 629 - .end = 0xe68c0014 - 1, 630 - .flags = IORESOURCE_MEM, 631 - }, 632 - { 633 - /* IRQ for channels */ 634 - .start = evt2irq(0x1d00), 635 - .end = evt2irq(0x1d00), 636 - .flags = IORESOURCE_IRQ, 637 - }, 638 - }; 639 - 640 - static struct platform_device usb_dma1_device = { 641 - .name = "sh-dma-engine", 642 - .id = 4, 643 - .resource = sh7372_usb_dmae1_resources, 644 - .num_resources = ARRAY_SIZE(sh7372_usb_dmae1_resources), 645 - .dev = { 646 - .platform_data = &usb_dma1_platform_data, 647 - }, 648 - }; 649 - 650 - /* VPU */ 651 - static struct uio_info vpu_platform_data = { 652 - .name = "VPU5HG", 653 - .version = "0", 654 - .irq = intcs_evt2irq(0x980), 655 - }; 656 - 657 - static struct resource vpu_resources[] = { 658 - [0] = { 659 - .name = "VPU", 660 - .start = 0xfe900000, 661 - .end = 0xfe900157, 662 - .flags = IORESOURCE_MEM, 663 - }, 664 - }; 665 - 666 - static struct platform_device vpu_device = { 667 - .name = "uio_pdrv_genirq", 668 - .id = 0, 669 - .dev = { 670 - .platform_data = &vpu_platform_data, 671 - }, 672 - .resource = vpu_resources, 673 - .num_resources = ARRAY_SIZE(vpu_resources), 674 - }; 675 - 676 - /* VEU0 */ 677 - static struct uio_info veu0_platform_data = { 678 - .name = "VEU0", 679 - .version = "0", 680 - .irq = intcs_evt2irq(0x700), 681 - }; 682 - 683 - static struct resource veu0_resources[] = { 684 - [0] = { 685 - .name = "VEU0", 686 - .start = 0xfe920000, 687 - .end = 0xfe9200cb, 688 - .flags = IORESOURCE_MEM, 689 - }, 690 - }; 691 - 692 - static struct platform_device veu0_device = { 693 - .name = "uio_pdrv_genirq", 694 - .id = 1, 695 - .dev = { 696 - .platform_data = &veu0_platform_data, 697 - }, 698 - .resource = veu0_resources, 699 - .num_resources = ARRAY_SIZE(veu0_resources), 700 - }; 701 - 702 - /* VEU1 */ 703 - static struct uio_info veu1_platform_data = { 704 - .name = "VEU1", 705 - .version = "0", 706 - .irq = intcs_evt2irq(0x720), 707 - }; 708 - 709 - static struct resource veu1_resources[] = { 710 - [0] = { 711 - .name = "VEU1", 712 - .start = 0xfe924000, 713 - .end = 0xfe9240cb, 714 - .flags = IORESOURCE_MEM, 715 - }, 716 - }; 717 - 718 - static struct platform_device veu1_device = { 719 - .name = "uio_pdrv_genirq", 720 - .id = 2, 721 - .dev = { 722 - .platform_data = &veu1_platform_data, 723 - }, 724 - .resource = veu1_resources, 725 - .num_resources = ARRAY_SIZE(veu1_resources), 726 - }; 727 - 728 - /* VEU2 */ 729 - static struct uio_info veu2_platform_data = { 730 - .name = "VEU2", 731 - .version = "0", 732 - .irq = intcs_evt2irq(0x740), 733 - }; 734 - 735 - static struct resource veu2_resources[] = { 736 - [0] = { 737 - .name = "VEU2", 738 - .start = 0xfe928000, 739 - .end = 0xfe928307, 740 - .flags = IORESOURCE_MEM, 741 - }, 742 - }; 743 - 744 - static struct platform_device veu2_device = { 745 - .name = "uio_pdrv_genirq", 746 - .id = 3, 747 - .dev = { 748 - .platform_data = &veu2_platform_data, 749 - }, 750 - .resource = veu2_resources, 751 - .num_resources = ARRAY_SIZE(veu2_resources), 752 - }; 753 - 754 - /* VEU3 */ 755 - static struct uio_info veu3_platform_data = { 756 - .name = "VEU3", 757 - .version = "0", 758 - .irq = intcs_evt2irq(0x760), 759 - }; 760 - 761 - static struct resource veu3_resources[] = { 762 - [0] = { 763 - .name = "VEU3", 764 - .start = 0xfe92c000, 765 - .end = 0xfe92c307, 766 - .flags = IORESOURCE_MEM, 767 - }, 768 - }; 769 - 770 - static struct platform_device veu3_device = { 771 - .name = "uio_pdrv_genirq", 772 - .id = 4, 773 - .dev = { 774 - .platform_data = &veu3_platform_data, 775 - }, 776 - .resource = veu3_resources, 777 - .num_resources = ARRAY_SIZE(veu3_resources), 778 - }; 779 - 780 - /* JPU */ 781 - static struct uio_info jpu_platform_data = { 782 - .name = "JPU", 783 - .version = "0", 784 - .irq = intcs_evt2irq(0x560), 785 - }; 786 - 787 - static struct resource jpu_resources[] = { 788 - [0] = { 789 - .name = "JPU", 790 - .start = 0xfe980000, 791 - .end = 0xfe9902d3, 792 - .flags = IORESOURCE_MEM, 793 - }, 794 - }; 795 - 796 - static struct platform_device jpu_device = { 797 - .name = "uio_pdrv_genirq", 798 - .id = 5, 799 - .dev = { 800 - .platform_data = &jpu_platform_data, 801 - }, 802 - .resource = jpu_resources, 803 - .num_resources = ARRAY_SIZE(jpu_resources), 804 - }; 805 - 806 - /* SPU2DSP0 */ 807 - static struct uio_info spu0_platform_data = { 808 - .name = "SPU2DSP0", 809 - .version = "0", 810 - .irq = evt2irq(0x1800), 811 - }; 812 - 813 - static struct resource spu0_resources[] = { 814 - [0] = { 815 - .name = "SPU2DSP0", 816 - .start = 0xfe200000, 817 - .end = 0xfe2fffff, 818 - .flags = IORESOURCE_MEM, 819 - }, 820 - }; 821 - 822 - static struct platform_device spu0_device = { 823 - .name = "uio_pdrv_genirq", 824 - .id = 6, 825 - .dev = { 826 - .platform_data = &spu0_platform_data, 827 - }, 828 - .resource = spu0_resources, 829 - .num_resources = ARRAY_SIZE(spu0_resources), 830 - }; 831 - 832 - /* SPU2DSP1 */ 833 - static struct uio_info spu1_platform_data = { 834 - .name = "SPU2DSP1", 835 - .version = "0", 836 - .irq = evt2irq(0x1820), 837 - }; 838 - 839 - static struct resource spu1_resources[] = { 840 - [0] = { 841 - .name = "SPU2DSP1", 842 - .start = 0xfe300000, 843 - .end = 0xfe3fffff, 844 - .flags = IORESOURCE_MEM, 845 - }, 846 - }; 847 - 848 - static struct platform_device spu1_device = { 849 - .name = "uio_pdrv_genirq", 850 - .id = 7, 851 - .dev = { 852 - .platform_data = &spu1_platform_data, 853 - }, 854 - .resource = spu1_resources, 855 - .num_resources = ARRAY_SIZE(spu1_resources), 856 - }; 857 - 858 - /* IPMMUI (an IPMMU module for ICB/LMB) */ 859 - static struct resource ipmmu_resources[] = { 860 - [0] = { 861 - .name = "IPMMUI", 862 - .start = 0xfe951000, 863 - .end = 0xfe9510ff, 864 - .flags = IORESOURCE_MEM, 865 - }, 866 - }; 867 - 868 - static const char * const ipmmu_dev_names[] = { 869 - "sh_mobile_lcdc_fb.0", 870 - "sh_mobile_lcdc_fb.1", 871 - "sh_mobile_ceu.0", 872 - "uio_pdrv_genirq.0", 873 - "uio_pdrv_genirq.1", 874 - "uio_pdrv_genirq.2", 875 - "uio_pdrv_genirq.3", 876 - "uio_pdrv_genirq.4", 877 - "uio_pdrv_genirq.5", 878 - }; 879 - 880 - static struct shmobile_ipmmu_platform_data ipmmu_platform_data = { 881 - .dev_names = ipmmu_dev_names, 882 - .num_dev_names = ARRAY_SIZE(ipmmu_dev_names), 883 - }; 884 - 885 - static struct platform_device ipmmu_device = { 886 - .name = "ipmmu", 887 - .id = -1, 888 - .dev = { 889 - .platform_data = &ipmmu_platform_data, 890 - }, 891 - .resource = ipmmu_resources, 892 - .num_resources = ARRAY_SIZE(ipmmu_resources), 893 - }; 894 - 895 - static struct platform_device *sh7372_early_devices[] __initdata = { 896 - &scif0_device, 897 - &scif1_device, 898 - &scif2_device, 899 - &scif3_device, 900 - &scif4_device, 901 - &scif5_device, 902 - &scif6_device, 903 - &cmt2_device, 904 - &tmu0_device, 905 - &ipmmu_device, 906 - }; 907 - 908 - static struct platform_device *sh7372_late_devices[] __initdata = { 909 - &iic0_device, 910 - &iic1_device, 911 - &dma0_device, 912 - &dma1_device, 913 - &dma2_device, 914 - &usb_dma0_device, 915 - &usb_dma1_device, 916 - &vpu_device, 917 - &veu0_device, 918 - &veu1_device, 919 - &veu2_device, 920 - &veu3_device, 921 - &jpu_device, 922 - &spu0_device, 923 - &spu1_device, 924 - }; 925 - 926 - void __init sh7372_add_standard_devices(void) 927 - { 928 - static struct pm_domain_device domain_devices[] __initdata = { 929 - { "A3RV", &vpu_device, }, 930 - { "A4MP", &spu0_device, }, 931 - { "A4MP", &spu1_device, }, 932 - { "A3SP", &scif0_device, }, 933 - { "A3SP", &scif1_device, }, 934 - { "A3SP", &scif2_device, }, 935 - { "A3SP", &scif3_device, }, 936 - { "A3SP", &scif4_device, }, 937 - { "A3SP", &scif5_device, }, 938 - { "A3SP", &scif6_device, }, 939 - { "A3SP", &iic1_device, }, 940 - { "A3SP", &dma0_device, }, 941 - { "A3SP", &dma1_device, }, 942 - { "A3SP", &dma2_device, }, 943 - { "A3SP", &usb_dma0_device, }, 944 - { "A3SP", &usb_dma1_device, }, 945 - { "A4R", &iic0_device, }, 946 - { "A4R", &veu0_device, }, 947 - { "A4R", &veu1_device, }, 948 - { "A4R", &veu2_device, }, 949 - { "A4R", &veu3_device, }, 950 - { "A4R", &jpu_device, }, 951 - { "A4R", &tmu0_device, }, 952 - }; 953 - 954 - sh7372_init_pm_domains(); 955 - 956 - platform_add_devices(sh7372_early_devices, 957 - ARRAY_SIZE(sh7372_early_devices)); 958 - 959 - platform_add_devices(sh7372_late_devices, 960 - ARRAY_SIZE(sh7372_late_devices)); 961 - 962 - rmobile_add_devices_to_domains(domain_devices, 963 - ARRAY_SIZE(domain_devices)); 964 - } 965 - 966 - void __init sh7372_earlytimer_init(void) 967 - { 968 - sh7372_clock_init(); 969 - shmobile_earlytimer_init(); 970 - } 971 - 972 - void __init sh7372_add_early_devices(void) 973 - { 974 - early_platform_add_devices(sh7372_early_devices, 975 - ARRAY_SIZE(sh7372_early_devices)); 976 - 977 - /* setup early console here as well */ 978 - shmobile_setup_console(); 979 - } 980 - 981 - #ifdef CONFIG_USE_OF 982 - 983 - void __init sh7372_add_early_devices_dt(void) 984 - { 985 - shmobile_init_delay(); 986 - 987 - sh7372_add_early_devices(); 988 - } 989 - 990 - void __init sh7372_add_standard_devices_dt(void) 991 - { 992 - /* clocks are setup late during boot in the case of DT */ 993 - sh7372_clock_init(); 994 - 995 - platform_add_devices(sh7372_early_devices, 996 - ARRAY_SIZE(sh7372_early_devices)); 997 - 998 - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 999 - } 1000 - 1001 - static const char *sh7372_boards_compat_dt[] __initdata = { 1002 - "renesas,sh7372", 1003 - NULL, 1004 - }; 1005 - 1006 - DT_MACHINE_START(SH7372_DT, "Generic SH7372 (Flattened Device Tree)") 1007 - .map_io = sh7372_map_io, 1008 - .init_early = sh7372_add_early_devices_dt, 1009 - .init_irq = sh7372_init_irq, 1010 - .handle_irq = shmobile_handle_irq_intc, 1011 - .init_machine = sh7372_add_standard_devices_dt, 1012 - .init_late = shmobile_init_late, 1013 - .dt_compat = sh7372_boards_compat_dt, 1014 - MACHINE_END 1015 - 1016 - #endif /* CONFIG_USE_OF */
+6 -13
arch/arm/mach-shmobile/setup-sh73a0.c
··· 30 30 #include <linux/platform_data/sh_ipmmu.h> 31 31 #include <linux/platform_data/irq-renesas-intc-irqpin.h> 32 32 33 + #include <asm/hardware/cache-l2x0.h> 33 34 #include <asm/mach-types.h> 34 35 #include <asm/mach/map.h> 35 36 #include <asm/mach/arch.h> ··· 785 784 786 785 #ifdef CONFIG_USE_OF 787 786 788 - void __init sh73a0_add_standard_devices_dt(void) 787 + static void __init sh73a0_generic_init(void) 789 788 { 790 - /* clocks are setup late during boot in the case of DT */ 791 - #ifndef CONFIG_COMMON_CLK 792 - sh73a0_clock_init(); 789 + #ifdef CONFIG_CACHE_L2X0 790 + /* Shared attribute override enable, 64K*8way */ 791 + l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff); 793 792 #endif 794 793 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 795 - } 796 - 797 - #define RESCNT2 IOMEM(0xe6188020) 798 - static void sh73a0_restart(enum reboot_mode mode, const char *cmd) 799 - { 800 - /* Do soft power on reset */ 801 - writel((1 << 31), RESCNT2); 802 794 } 803 795 804 796 static const char *sh73a0_boards_compat_dt[] __initdata = { ··· 803 809 .smp = smp_ops(sh73a0_smp_ops), 804 810 .map_io = sh73a0_map_io, 805 811 .init_early = shmobile_init_delay, 806 - .init_machine = sh73a0_add_standard_devices_dt, 812 + .init_machine = sh73a0_generic_init, 807 813 .init_late = shmobile_init_late, 808 - .restart = sh73a0_restart, 809 814 .dt_compat = sh73a0_boards_compat_dt, 810 815 MACHINE_END 811 816 #endif /* CONFIG_USE_OF */
-84
arch/arm/mach-shmobile/sh7372.h
··· 1 - /* 2 - * Copyright (C) 2010 Renesas Solutions Corp. 3 - * 4 - * Kuninori Morimoto <morimoto.kuninori@renesas.com> 5 - * 6 - * This file is subject to the terms and conditions of the GNU General Public 7 - * License. See the file "COPYING" in the main directory of this archive 8 - * for more details. 9 - */ 10 - 11 - #ifndef __ASM_SH7372_H__ 12 - #define __ASM_SH7372_H__ 13 - 14 - /* DMA slave IDs */ 15 - enum { 16 - SHDMA_SLAVE_INVALID, 17 - SHDMA_SLAVE_SCIF0_TX, 18 - SHDMA_SLAVE_SCIF0_RX, 19 - SHDMA_SLAVE_SCIF1_TX, 20 - SHDMA_SLAVE_SCIF1_RX, 21 - SHDMA_SLAVE_SCIF2_TX, 22 - SHDMA_SLAVE_SCIF2_RX, 23 - SHDMA_SLAVE_SCIF3_TX, 24 - SHDMA_SLAVE_SCIF3_RX, 25 - SHDMA_SLAVE_SCIF4_TX, 26 - SHDMA_SLAVE_SCIF4_RX, 27 - SHDMA_SLAVE_SCIF5_TX, 28 - SHDMA_SLAVE_SCIF5_RX, 29 - SHDMA_SLAVE_SCIF6_TX, 30 - SHDMA_SLAVE_SCIF6_RX, 31 - SHDMA_SLAVE_FLCTL0_TX, 32 - SHDMA_SLAVE_FLCTL0_RX, 33 - SHDMA_SLAVE_FLCTL1_TX, 34 - SHDMA_SLAVE_FLCTL1_RX, 35 - SHDMA_SLAVE_SDHI0_RX, 36 - SHDMA_SLAVE_SDHI0_TX, 37 - SHDMA_SLAVE_SDHI1_RX, 38 - SHDMA_SLAVE_SDHI1_TX, 39 - SHDMA_SLAVE_SDHI2_RX, 40 - SHDMA_SLAVE_SDHI2_TX, 41 - SHDMA_SLAVE_FSIA_RX, 42 - SHDMA_SLAVE_FSIA_TX, 43 - SHDMA_SLAVE_MMCIF_RX, 44 - SHDMA_SLAVE_MMCIF_TX, 45 - SHDMA_SLAVE_USB0_TX, 46 - SHDMA_SLAVE_USB0_RX, 47 - SHDMA_SLAVE_USB1_TX, 48 - SHDMA_SLAVE_USB1_RX, 49 - }; 50 - 51 - extern struct clk sh7372_extal1_clk; 52 - extern struct clk sh7372_extal2_clk; 53 - extern struct clk sh7372_dv_clki_clk; 54 - extern struct clk sh7372_dv_clki_div2_clk; 55 - extern struct clk sh7372_pllc2_clk; 56 - 57 - extern void sh7372_init_irq(void); 58 - extern void sh7372_map_io(void); 59 - extern void sh7372_earlytimer_init(void); 60 - extern void sh7372_add_early_devices(void); 61 - extern void sh7372_add_standard_devices(void); 62 - extern void sh7372_add_early_devices_dt(void); 63 - extern void sh7372_add_standard_devices_dt(void); 64 - extern void sh7372_clock_init(void); 65 - extern void sh7372_pinmux_init(void); 66 - extern void sh7372_pm_init(void); 67 - extern void sh7372_resume_core_standby_sysc(void); 68 - extern int sh7372_do_idle_sysc(unsigned long sleep_mode); 69 - extern void sh7372_intcs_suspend(void); 70 - extern void sh7372_intcs_resume(void); 71 - extern void sh7372_intca_suspend(void); 72 - extern void sh7372_intca_resume(void); 73 - 74 - extern unsigned long sh7372_cpu_resume; 75 - 76 - #ifdef CONFIG_PM 77 - extern void __init sh7372_init_pm_domains(void); 78 - #else 79 - static inline void sh7372_init_pm_domains(void) {} 80 - #endif 81 - 82 - extern void __init sh7372_pm_init_late(void); 83 - 84 - #endif /* __ASM_SH7372_H__ */
-1
arch/arm/mach-shmobile/sh73a0.h
··· 77 77 extern void sh73a0_earlytimer_init(void); 78 78 extern void sh73a0_add_early_devices(void); 79 79 extern void sh73a0_add_standard_devices(void); 80 - extern void sh73a0_add_standard_devices_dt(void); 81 80 extern void sh73a0_clock_init(void); 82 81 extern void sh73a0_pinmux_init(void); 83 82 extern void sh73a0_pm_init(void);
-98
arch/arm/mach-shmobile/sleep-sh7372.S
··· 1 - /* 2 - * sh7372 lowlevel sleep code for "Core Standby Mode" 3 - * 4 - * Copyright (C) 2011 Magnus Damm 5 - * 6 - * In "Core Standby Mode" the ARM core is off, but L2 cache is still on 7 - * 8 - * Based on mach-omap2/sleep34xx.S 9 - * 10 - * (C) Copyright 2007 Texas Instruments 11 - * Karthik Dasu <karthik-dp@ti.com> 12 - * 13 - * (C) Copyright 2004 Texas Instruments, <www.ti.com> 14 - * Richard Woodruff <r-woodruff2@ti.com> 15 - * 16 - * This program is free software; you can redistribute it and/or 17 - * modify it under the terms of the GNU General Public License as 18 - * published by the Free Software Foundation; either version 2 of 19 - * the License, or (at your option) any later version. 20 - * 21 - * This program is distributed in the hope that it will be useful, 22 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the 24 - * GNU General Public License for more details. 25 - */ 26 - 27 - #include <linux/linkage.h> 28 - #include <linux/init.h> 29 - #include <asm/memory.h> 30 - #include <asm/assembler.h> 31 - 32 - #if defined(CONFIG_SUSPEND) || defined(CONFIG_CPU_IDLE) 33 - .align 12 34 - .text 35 - .global sh7372_resume_core_standby_sysc 36 - sh7372_resume_core_standby_sysc: 37 - ldr pc, 1f 38 - 39 - .align 2 40 - .globl sh7372_cpu_resume 41 - sh7372_cpu_resume: 42 - 1: .space 4 43 - 44 - #define SPDCR 0xe6180008 45 - 46 - /* A3SM & A4S power down */ 47 - .global sh7372_do_idle_sysc 48 - sh7372_do_idle_sysc: 49 - mov r8, r0 /* sleep mode passed in r0 */ 50 - 51 - /* 52 - * Clear the SCTLR.C bit to prevent further data cache 53 - * allocation. Clearing SCTLR.C would make all the data accesses 54 - * strongly ordered and would not hit the cache. 55 - */ 56 - mrc p15, 0, r0, c1, c0, 0 57 - bic r0, r0, #(1 << 2) @ Disable the C bit 58 - mcr p15, 0, r0, c1, c0, 0 59 - isb 60 - 61 - /* 62 - * Clean and invalidate data cache again. 63 - */ 64 - ldr r1, kernel_flush 65 - blx r1 66 - 67 - /* disable L2 cache in the aux control register */ 68 - mrc p15, 0, r10, c1, c0, 1 69 - bic r10, r10, #2 70 - mcr p15, 0, r10, c1, c0, 1 71 - isb 72 - 73 - /* 74 - * The kernel doesn't interwork: v7_flush_dcache_all in particluar will 75 - * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled. 76 - * This sequence switches back to ARM. Note that .align may insert a 77 - * nop: bx pc needs to be word-aligned in order to work. 78 - */ 79 - THUMB( .thumb ) 80 - THUMB( .align ) 81 - THUMB( bx pc ) 82 - THUMB( nop ) 83 - .arm 84 - 85 - /* Data memory barrier and Data sync barrier */ 86 - dsb 87 - dmb 88 - 89 - /* SYSC power down */ 90 - ldr r0, =SPDCR 91 - str r8, [r0] 92 - 1: 93 - b 1b 94 - 95 - .align 2 96 - kernel_flush: 97 - .word v7_flush_dcache_all 98 - #endif
-7
arch/arm/mach-shmobile/smp-r8a7779.c
··· 124 124 125 125 return 0; 126 126 } 127 - 128 - static int r8a7779_cpu_disable(unsigned int cpu) 129 - { 130 - /* only CPU1->3 have power domains, do not allow hotplug of CPU0 */ 131 - return cpu == 0 ? -EPERM : 0; 132 - } 133 127 #endif /* CONFIG_HOTPLUG_CPU */ 134 128 135 129 struct smp_operations r8a7779_smp_ops __initdata = { 136 130 .smp_prepare_cpus = r8a7779_smp_prepare_cpus, 137 131 .smp_boot_secondary = r8a7779_boot_secondary, 138 132 #ifdef CONFIG_HOTPLUG_CPU 139 - .cpu_disable = r8a7779_cpu_disable, 140 133 .cpu_die = shmobile_smp_scu_cpu_die, 141 134 .cpu_kill = r8a7779_cpu_kill, 142 135 #endif
+1 -1
arch/arm/mach-shmobile/smp-sh73a0.c
··· 33 33 34 34 #define SH73A0_SCU_BASE 0xf0000000 35 35 36 - #ifdef CONFIG_HAVE_ARM_TWD 36 + #if defined(CONFIG_HAVE_ARM_TWD) && !defined(CONFIG_ARCH_MULTIPLATFORM) 37 37 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, SH73A0_SCU_BASE + 0x600, 29); 38 38 void __init sh73a0_register_twd(void) 39 39 {
-1
arch/arm/tools/mach-types
··· 526 526 ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206 527 527 wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207 528 528 trimslice MACH_TRIMSLICE TRIMSLICE 3209 529 - mackerel MACH_MACKEREL MACKEREL 3211 530 529 kaen MACH_KAEN KAEN 3217 531 530 nokia_rm680 MACH_NOKIA_RM680 NOKIA_RM680 3220 532 531 msm8960_sim MACH_MSM8960_SIM MSM8960_SIM 3230
+1
drivers/clk/shmobile/Makefile
··· 2 2 obj-$(CONFIG_ARCH_R7S72100) += clk-rz.o 3 3 obj-$(CONFIG_ARCH_R8A73A4) += clk-r8a73a4.o 4 4 obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o 5 + obj-$(CONFIG_ARCH_R8A7778) += clk-r8a7778.o 5 6 obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o 6 7 obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o 7 8 obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o
+143
drivers/clk/shmobile/clk-r8a7778.c
··· 1 + /* 2 + * r8a7778 Core CPG Clocks 3 + * 4 + * Copyright (C) 2014 Ulrich Hecht 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 + 11 + #include <linux/clk-provider.h> 12 + #include <linux/clkdev.h> 13 + #include <linux/clk/shmobile.h> 14 + #include <linux/of_address.h> 15 + 16 + struct r8a7778_cpg { 17 + struct clk_onecell_data data; 18 + spinlock_t lock; 19 + void __iomem *reg; 20 + }; 21 + 22 + /* PLL multipliers per bits 11, 12, and 18 of MODEMR */ 23 + struct { 24 + unsigned long plla_mult; 25 + unsigned long pllb_mult; 26 + } r8a7778_rates[] __initdata = { 27 + [0] = { 21, 21 }, 28 + [1] = { 24, 24 }, 29 + [2] = { 28, 28 }, 30 + [3] = { 32, 32 }, 31 + [5] = { 24, 21 }, 32 + [6] = { 28, 21 }, 33 + [7] = { 32, 24 }, 34 + }; 35 + 36 + /* Clock dividers per bits 1 and 2 of MODEMR */ 37 + struct { 38 + const char *name; 39 + unsigned int div[4]; 40 + } r8a7778_divs[6] __initdata = { 41 + { "b", { 12, 12, 16, 18 } }, 42 + { "out", { 12, 12, 16, 18 } }, 43 + { "p", { 16, 12, 16, 12 } }, 44 + { "s", { 4, 3, 4, 3 } }, 45 + { "s1", { 8, 6, 8, 6 } }, 46 + }; 47 + 48 + static u32 cpg_mode_rates __initdata; 49 + static u32 cpg_mode_divs __initdata; 50 + 51 + static struct clk * __init 52 + r8a7778_cpg_register_clock(struct device_node *np, struct r8a7778_cpg *cpg, 53 + const char *name) 54 + { 55 + if (!strcmp(name, "plla")) { 56 + return clk_register_fixed_factor(NULL, "plla", 57 + of_clk_get_parent_name(np, 0), 0, 58 + r8a7778_rates[cpg_mode_rates].plla_mult, 1); 59 + } else if (!strcmp(name, "pllb")) { 60 + return clk_register_fixed_factor(NULL, "pllb", 61 + of_clk_get_parent_name(np, 0), 0, 62 + r8a7778_rates[cpg_mode_rates].pllb_mult, 1); 63 + } else { 64 + unsigned int i; 65 + 66 + for (i = 0; i < ARRAY_SIZE(r8a7778_divs); i++) { 67 + if (!strcmp(name, r8a7778_divs[i].name)) { 68 + return clk_register_fixed_factor(NULL, 69 + r8a7778_divs[i].name, 70 + "plla", 0, 1, 71 + r8a7778_divs[i].div[cpg_mode_divs]); 72 + } 73 + } 74 + } 75 + 76 + return ERR_PTR(-EINVAL); 77 + } 78 + 79 + 80 + static void __init r8a7778_cpg_clocks_init(struct device_node *np) 81 + { 82 + struct r8a7778_cpg *cpg; 83 + struct clk **clks; 84 + unsigned int i; 85 + int num_clks; 86 + 87 + num_clks = of_property_count_strings(np, "clock-output-names"); 88 + if (num_clks < 0) { 89 + pr_err("%s: failed to count clocks\n", __func__); 90 + return; 91 + } 92 + 93 + cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); 94 + clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL); 95 + if (cpg == NULL || clks == NULL) { 96 + /* We're leaking memory on purpose, there's no point in cleaning 97 + * up as the system won't boot anyway. 98 + */ 99 + return; 100 + } 101 + 102 + spin_lock_init(&cpg->lock); 103 + 104 + cpg->data.clks = clks; 105 + cpg->data.clk_num = num_clks; 106 + 107 + cpg->reg = of_iomap(np, 0); 108 + if (WARN_ON(cpg->reg == NULL)) 109 + return; 110 + 111 + for (i = 0; i < num_clks; ++i) { 112 + const char *name; 113 + struct clk *clk; 114 + 115 + of_property_read_string_index(np, "clock-output-names", i, 116 + &name); 117 + 118 + clk = r8a7778_cpg_register_clock(np, cpg, name); 119 + if (IS_ERR(clk)) 120 + pr_err("%s: failed to register %s %s clock (%ld)\n", 121 + __func__, np->name, name, PTR_ERR(clk)); 122 + else 123 + cpg->data.clks[i] = clk; 124 + } 125 + 126 + of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); 127 + } 128 + 129 + CLK_OF_DECLARE(r8a7778_cpg_clks, "renesas,r8a7778-cpg-clocks", 130 + r8a7778_cpg_clocks_init); 131 + 132 + void __init r8a7778_clocks_init(u32 mode) 133 + { 134 + BUG_ON(!(mode & BIT(19))); 135 + 136 + cpg_mode_rates = (!!(mode & BIT(18)) << 2) | 137 + (!!(mode & BIT(12)) << 1) | 138 + (!!(mode & BIT(11))); 139 + cpg_mode_divs = (!!(mode & BIT(2)) << 1) | 140 + (!!(mode & BIT(1))); 141 + 142 + of_clk_init(NULL); 143 + }
+62
include/dt-bindings/clock/r8a73a4-clock.h
··· 1 + /* 2 + * Copyright 2014 Ulrich Hecht 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 as published by 6 + * the Free Software Foundation; either version 2 of the License, or 7 + * (at your option) any later version. 8 + */ 9 + 10 + #ifndef __DT_BINDINGS_CLOCK_R8A73A4_H__ 11 + #define __DT_BINDINGS_CLOCK_R8A73A4_H__ 12 + 13 + /* CPG */ 14 + #define R8A73A4_CLK_MAIN 0 15 + #define R8A73A4_CLK_PLL0 1 16 + #define R8A73A4_CLK_PLL1 2 17 + #define R8A73A4_CLK_PLL2 3 18 + #define R8A73A4_CLK_PLL2S 4 19 + #define R8A73A4_CLK_PLL2H 5 20 + #define R8A73A4_CLK_Z 6 21 + #define R8A73A4_CLK_Z2 7 22 + #define R8A73A4_CLK_I 8 23 + #define R8A73A4_CLK_M3 9 24 + #define R8A73A4_CLK_B 10 25 + #define R8A73A4_CLK_M1 11 26 + #define R8A73A4_CLK_M2 12 27 + #define R8A73A4_CLK_ZX 13 28 + #define R8A73A4_CLK_ZS 14 29 + #define R8A73A4_CLK_HP 15 30 + 31 + /* MSTP2 */ 32 + #define R8A73A4_CLK_DMAC 18 33 + #define R8A73A4_CLK_SCIFB3 17 34 + #define R8A73A4_CLK_SCIFB2 16 35 + #define R8A73A4_CLK_SCIFB1 7 36 + #define R8A73A4_CLK_SCIFB0 6 37 + #define R8A73A4_CLK_SCIFA0 4 38 + #define R8A73A4_CLK_SCIFA1 3 39 + 40 + /* MSTP3 */ 41 + #define R8A73A4_CLK_CMT1 29 42 + #define R8A73A4_CLK_IIC1 23 43 + #define R8A73A4_CLK_IIC0 18 44 + #define R8A73A4_CLK_IIC7 17 45 + #define R8A73A4_CLK_IIC6 16 46 + #define R8A73A4_CLK_MMCIF0 15 47 + #define R8A73A4_CLK_SDHI0 14 48 + #define R8A73A4_CLK_SDHI1 13 49 + #define R8A73A4_CLK_SDHI2 12 50 + #define R8A73A4_CLK_MMCIF1 5 51 + #define R8A73A4_CLK_IIC2 0 52 + 53 + /* MSTP4 */ 54 + #define R8A73A4_CLK_IIC3 11 55 + #define R8A73A4_CLK_IIC4 10 56 + #define R8A73A4_CLK_IIC5 9 57 + 58 + /* MSTP5 */ 59 + #define R8A73A4_CLK_THERMAL 22 60 + #define R8A73A4_CLK_IIC8 15 61 + 62 + #endif /* __DT_BINDINGS_CLOCK_R8A73A4_H__ */
+71
include/dt-bindings/clock/r8a7778-clock.h
··· 1 + /* 2 + * Copyright (C) 2014 Ulrich Hecht 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 as published by 6 + * the Free Software Foundation; either version 2 of the License, or 7 + * (at your option) any later version. 8 + */ 9 + 10 + #ifndef __DT_BINDINGS_CLOCK_R8A7778_H__ 11 + #define __DT_BINDINGS_CLOCK_R8A7778_H__ 12 + 13 + /* CPG */ 14 + #define R8A7778_CLK_PLLA 0 15 + #define R8A7778_CLK_PLLB 1 16 + #define R8A7778_CLK_B 2 17 + #define R8A7778_CLK_OUT 3 18 + #define R8A7778_CLK_P 4 19 + #define R8A7778_CLK_S 5 20 + #define R8A7778_CLK_S1 6 21 + 22 + /* MSTP0 */ 23 + #define R8A7778_CLK_I2C0 30 24 + #define R8A7778_CLK_I2C1 29 25 + #define R8A7778_CLK_I2C2 28 26 + #define R8A7778_CLK_I2C3 27 27 + #define R8A7778_CLK_SCIF0 26 28 + #define R8A7778_CLK_SCIF1 25 29 + #define R8A7778_CLK_SCIF2 24 30 + #define R8A7778_CLK_SCIF3 23 31 + #define R8A7778_CLK_SCIF4 22 32 + #define R8A7778_CLK_SCIF5 21 33 + #define R8A7778_CLK_TMU0 16 34 + #define R8A7778_CLK_TMU1 15 35 + #define R8A7778_CLK_TMU2 14 36 + #define R8A7778_CLK_SSI0 12 37 + #define R8A7778_CLK_SSI1 11 38 + #define R8A7778_CLK_SSI2 10 39 + #define R8A7778_CLK_SSI3 9 40 + #define R8A7778_CLK_SRU 8 41 + #define R8A7778_CLK_HSPI 7 42 + 43 + /* MSTP1 */ 44 + #define R8A7778_CLK_ETHER 14 45 + #define R8A7778_CLK_VIN0 10 46 + #define R8A7778_CLK_VIN1 9 47 + #define R8A7778_CLK_USB 0 48 + 49 + /* MSTP3 */ 50 + #define R8A7778_CLK_MMC 31 51 + #define R8A7778_CLK_SDHI0 23 52 + #define R8A7778_CLK_SDHI1 22 53 + #define R8A7778_CLK_SDHI2 21 54 + #define R8A7778_CLK_SSI4 11 55 + #define R8A7778_CLK_SSI5 10 56 + #define R8A7778_CLK_SSI6 9 57 + #define R8A7778_CLK_SSI7 8 58 + #define R8A7778_CLK_SSI8 7 59 + 60 + /* MSTP5 */ 61 + #define R8A7778_CLK_SRU_SRC0 31 62 + #define R8A7778_CLK_SRU_SRC1 30 63 + #define R8A7778_CLK_SRU_SRC2 29 64 + #define R8A7778_CLK_SRU_SRC3 28 65 + #define R8A7778_CLK_SRU_SRC4 27 66 + #define R8A7778_CLK_SRU_SRC5 26 67 + #define R8A7778_CLK_SRU_SRC6 25 68 + #define R8A7778_CLK_SRU_SRC7 24 69 + #define R8A7778_CLK_SRU_SRC8 23 70 + 71 + #endif /* __DT_BINDINGS_CLOCK_R8A7778_H__ */
+1
include/linux/clk/shmobile.h
··· 16 16 17 17 #include <linux/types.h> 18 18 19 + void r8a7778_clocks_init(u32 mode); 19 20 void r8a7779_clocks_init(u32 mode); 20 21 void rcar_gen2_clocks_init(u32 mode); 21 22