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

Merge tag 'at91-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91 into next/multiplatform

Merge "at91: multiplatform for 4.1 #1" from Nicolas Ferre:

This is the multi-platform support for AT91:
- reworked arch/arm/mach-at91/Kconfig and arch/arm/Kconfig to switch to
multi-platform
- updated at91_dt_defconfig
- continue the cleanup of unneeded files and code chunks

* tag 'at91-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91: (61 commits)
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: at91: remove useless include
clocksource: atmel-st: remove mach/hardware dependency
clocksource: atmel-st: use syscon/regmap
ARM: at91: time: move the system timer driver to drivers/clocksource
ARM: at91: properly initialize timer
ARM: at91: at91rm9200: remove deprecated arm_pm_restart
watchdog: at91rm9200: implement restart handler
watchdog: at91rm9200: use the system timer syscon
mfd: syscon: Add atmel system timer registers definition
ARM: at91/dt: declare atmel,at91rm9200-st as a syscon
ARM: at91: remove old setup
ARM: at91: sama5d4: remove useless map_io
ARM: at91: sama5 use SoC detection infrastructure
...

Signed-off-by: Olof Johansson <olof@lixom.net>

+974 -3430
+3 -1
Documentation/devicetree/bindings/arm/atmel-at91.txt
··· 46 46 shared across all System Controller members. 47 47 48 48 System Timer (ST) required properties: 49 - - compatible: Should be "atmel,at91rm9200-st" 49 + - compatible: Should be "atmel,at91rm9200-st", "syscon", "simple-mfd" 50 50 - reg: Should contain registers location and length 51 51 - interrupts: Should contain interrupt for the ST which is the IRQ line 52 52 shared across all System Controller members. 53 + Its subnodes can be: 54 + - watchdog: compatible should be "atmel,at91rm9200-wdt" 53 55 54 56 TC/TCLIB Timer required properties: 55 57 - compatible: Should be "atmel,<chip>-tcb".
+2 -1
Documentation/devicetree/bindings/serial/atmel-usart.txt
··· 1 1 * Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART) 2 2 3 3 Required properties: 4 - - compatible: Should be "atmel,<chip>-usart" 4 + - compatible: Should be "atmel,<chip>-usart" or "atmel,<chip>-dbgu" 5 5 The compatible <chip> indicated will be the first SoC to support an 6 6 additional mode or an USART new feature. 7 + For the dbgu UART, use "atmel,<chip>-dbgu", "atmel,<chip>-usart" 7 8 - reg: Should contain registers location and length 8 9 - interrupts: Should contain interrupt 9 10 - clock-names: tuple listing input clock names.
+5
Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
··· 26 26 - atmel,disable : Should be present if you want to disable the watchdog. 27 27 - atmel,idle-halt : Should be present if you want to stop the watchdog when 28 28 entering idle state. 29 + CAUTION: This property should be used with care, it actually makes the 30 + watchdog not counting when the CPU is in idle state, therefore the 31 + watchdog reset time depends on mean CPU usage and will not reset at all 32 + if the CPU stop working while it is in idle state, which is probably 33 + not what you want. 29 34 - atmel,dbg-halt : Should be present if you want to stop the watchdog when 30 35 entering debug state. 31 36
+1 -14
arch/arm/Kconfig
··· 356 356 help 357 357 This enables support for ARM Ltd Versatile board. 358 358 359 - config ARCH_AT91 360 - bool "Atmel AT91" 361 - select ARCH_REQUIRE_GPIOLIB 362 - select CLKDEV_LOOKUP 363 - select IRQ_DOMAIN 364 - select NEED_MACH_IO_H if PCCARD 365 - select PINCTRL 366 - select PINCTRL_AT91 367 - select USE_OF 368 - help 369 - This enables support for systems based on Atmel 370 - AT91RM9200, AT91SAM9 and SAMA5 processors. 371 - 372 359 config ARCH_CLPS711X 373 360 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" 374 361 select ARCH_REQUIRE_GPIOLIB ··· 1501 1514 int 1502 1515 default 200 if ARCH_EBSA110 || ARCH_S3C24XX || \ 1503 1516 ARCH_S5PV210 || ARCH_EXYNOS4 1504 - default AT91_TIMER_HZ if ARCH_AT91 1517 + default 128 if SOC_AT91RM9200 1505 1518 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE_LEGACY 1506 1519 default 0 1507 1520
+6 -2
arch/arm/boot/dts/at91rm9200.dtsi
··· 356 356 }; 357 357 358 358 st: timer@fffffd00 { 359 - compatible = "atmel,at91rm9200-st"; 359 + compatible = "atmel,at91rm9200-st", "syscon", "simple-mfd"; 360 360 reg = <0xfffffd00 0x100>; 361 361 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 362 + 363 + watchdog { 364 + compatible = "atmel,at91rm9200-wdt"; 365 + }; 362 366 }; 363 367 364 368 rtc: rtc@fffffe00 { ··· 834 830 }; 835 831 836 832 dbgu: serial@fffff200 { 837 - compatible = "atmel,at91rm9200-usart"; 833 + compatible = "atmel,at91rm9200-dbgu", "atmel,at91rm9200-usart"; 838 834 reg = <0xfffff200 0x200>; 839 835 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 840 836 pinctrl-names = "default";
+4 -5
arch/arm/boot/dts/at91sam9260.dtsi
··· 494 494 495 495 pinctrl_usart3_rts: usart3_rts-0 { 496 496 atmel,pins = 497 - <AT91_PIOB 8 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PC8 periph B */ 497 + <AT91_PIOC 8 AT91_PERIPH_B AT91_PINCTRL_NONE>; 498 498 }; 499 499 500 500 pinctrl_usart3_cts: usart3_cts-0 { 501 501 atmel,pins = 502 - <AT91_PIOB 10 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PC10 periph B */ 502 + <AT91_PIOC 10 AT91_PERIPH_B AT91_PINCTRL_NONE>; 503 503 }; 504 504 }; 505 505 ··· 753 753 }; 754 754 755 755 dbgu: serial@fffff200 { 756 - compatible = "atmel,at91sam9260-usart"; 756 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 757 757 reg = <0xfffff200 0x200>; 758 758 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 759 759 pinctrl-names = "default"; ··· 853 853 }; 854 854 855 855 usb1: gadget@fffa4000 { 856 - compatible = "atmel,at91rm9200-udc"; 856 + compatible = "atmel,at91sam9260-udc"; 857 857 reg = <0xfffa4000 0x4000>; 858 858 interrupts = <10 IRQ_TYPE_LEVEL_HIGH 2>; 859 859 clocks = <&udc_clk>, <&udpck>; ··· 976 976 atmel,watchdog-type = "hardware"; 977 977 atmel,reset-type = "all"; 978 978 atmel,dbg-halt; 979 - atmel,idle-halt; 980 979 status = "disabled"; 981 980 }; 982 981
+6 -5
arch/arm/boot/dts/at91sam9261.dtsi
··· 124 124 }; 125 125 126 126 usb1: gadget@fffa4000 { 127 - compatible = "atmel,at91rm9200-udc"; 127 + compatible = "atmel,at91sam9261-udc"; 128 128 reg = <0xfffa4000 0x4000>; 129 129 interrupts = <10 IRQ_TYPE_LEVEL_HIGH 2>; 130 - clocks = <&usb>, <&udc_clk>, <&udpck>; 131 - clock-names = "usb_clk", "udc_clk", "udpck"; 130 + clocks = <&udc_clk>, <&udpck>; 131 + clock-names = "pclk", "hclk"; 132 + atmel,matrix = <&matrix>; 132 133 status = "disabled"; 133 134 }; 134 135 ··· 263 262 }; 264 263 265 264 matrix: matrix@ffffee00 { 266 - compatible = "atmel,at91sam9260-bus-matrix"; 265 + compatible = "atmel,at91sam9260-bus-matrix", "syscon"; 267 266 reg = <0xffffee00 0x200>; 268 267 }; 269 268 ··· 276 275 }; 277 276 278 277 dbgu: serial@fffff200 { 279 - compatible = "atmel,at91sam9260-usart"; 278 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 280 279 reg = <0xfffff200 0x200>; 281 280 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 282 281 pinctrl-names = "default";
+3 -4
arch/arm/boot/dts/at91sam9263.dtsi
··· 69 69 70 70 sram1: sram@00500000 { 71 71 compatible = "mmio-sram"; 72 - reg = <0x00300000 0x4000>; 72 + reg = <0x00500000 0x4000>; 73 73 }; 74 74 75 75 ahb { ··· 762 762 }; 763 763 764 764 dbgu: serial@ffffee00 { 765 - compatible = "atmel,at91sam9260-usart"; 765 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 766 766 reg = <0xffffee00 0x200>; 767 767 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 768 768 pinctrl-names = "default"; ··· 856 856 }; 857 857 858 858 usb1: gadget@fff78000 { 859 - compatible = "atmel,at91rm9200-udc"; 859 + compatible = "atmel,at91sam9263-udc"; 860 860 reg = <0xfff78000 0x4000>; 861 861 interrupts = <24 IRQ_TYPE_LEVEL_HIGH 2>; 862 862 clocks = <&udc_clk>, <&udpck>; ··· 905 905 atmel,watchdog-type = "hardware"; 906 906 atmel,reset-type = "all"; 907 907 atmel,dbg-halt; 908 - atmel,idle-halt; 909 908 status = "disabled"; 910 909 }; 911 910
+2 -3
arch/arm/boot/dts/at91sam9g45.dtsi
··· 893 893 }; 894 894 895 895 dbgu: serial@ffffee00 { 896 - compatible = "atmel,at91sam9260-usart"; 896 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 897 897 reg = <0xffffee00 0x200>; 898 898 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 899 899 pinctrl-names = "default"; ··· 1116 1116 atmel,watchdog-type = "hardware"; 1117 1117 atmel,reset-type = "all"; 1118 1118 atmel,dbg-halt; 1119 - atmel,idle-halt; 1120 1119 status = "disabled"; 1121 1120 }; 1122 1121 ··· 1300 1301 compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; 1301 1302 reg = <0x00800000 0x100000>; 1302 1303 interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; 1303 - clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; 1304 + clocks = <&utmi>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; 1304 1305 clock-names = "usb_clk", "ehci_clk", "hclk", "uhpck"; 1305 1306 status = "disabled"; 1306 1307 };
+1 -2
arch/arm/boot/dts/at91sam9n12.dtsi
··· 757 757 }; 758 758 759 759 dbgu: serial@fffff200 { 760 - compatible = "atmel,at91sam9260-usart"; 760 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 761 761 reg = <0xfffff200 0x200>; 762 762 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 763 763 pinctrl-names = "default"; ··· 894 894 atmel,watchdog-type = "hardware"; 895 895 atmel,reset-type = "all"; 896 896 atmel,dbg-halt; 897 - atmel,idle-halt; 898 897 status = "disabled"; 899 898 }; 900 899
+1 -1
arch/arm/boot/dts/at91sam9rl.dtsi
··· 377 377 }; 378 378 379 379 dbgu: serial@fffff200 { 380 - compatible = "atmel,at91sam9260-usart"; 380 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 381 381 reg = <0xfffff200 0x200>; 382 382 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 383 383 pinctrl-names = "default";
+3 -4
arch/arm/boot/dts/at91sam9x5.dtsi
··· 860 860 }; 861 861 862 862 dbgu: serial@fffff200 { 863 - compatible = "atmel,at91sam9260-usart"; 863 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 864 864 reg = <0xfffff200 0x200>; 865 865 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 866 866 pinctrl-names = "default"; ··· 1066 1066 reg = <0x00500000 0x80000 1067 1067 0xf803c000 0x400>; 1068 1068 interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>; 1069 - clocks = <&usb>, <&udphs_clk>; 1069 + clocks = <&utmi>, <&udphs_clk>; 1070 1070 clock-names = "hclk", "pclk"; 1071 1071 status = "disabled"; 1072 1072 ··· 1130 1130 atmel,watchdog-type = "hardware"; 1131 1131 atmel,reset-type = "all"; 1132 1132 atmel,dbg-halt; 1133 - atmel,idle-halt; 1134 1133 status = "disabled"; 1135 1134 }; 1136 1135 ··· 1185 1186 compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; 1186 1187 reg = <0x00700000 0x100000>; 1187 1188 interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; 1188 - clocks = <&usb>, <&uhphs_clk>, <&uhpck>; 1189 + clocks = <&utmi>, <&uhphs_clk>, <&uhpck>; 1189 1190 clock-names = "usb_clk", "ehci_clk", "uhpck"; 1190 1191 status = "disabled"; 1191 1192 };
+2 -3
arch/arm/boot/dts/sama5d3.dtsi
··· 439 439 }; 440 440 441 441 dbgu: serial@ffffee00 { 442 - compatible = "atmel,at91sam9260-usart"; 442 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 443 443 reg = <0xffffee00 0x200>; 444 444 interrupts = <2 IRQ_TYPE_LEVEL_HIGH 7>; 445 445 dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(13)>, ··· 1248 1248 atmel,watchdog-type = "hardware"; 1249 1249 atmel,reset-type = "all"; 1250 1250 atmel,dbg-halt; 1251 - atmel,idle-halt; 1252 1251 status = "disabled"; 1253 1252 }; 1254 1253 ··· 1415 1416 compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; 1416 1417 reg = <0x00700000 0x100000>; 1417 1418 interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>; 1418 - clocks = <&usb>, <&uhphs_clk>, <&uhpck>; 1419 + clocks = <&utmi>, <&uhphs_clk>, <&uhpck>; 1419 1420 clock-names = "usb_clk", "ehci_clk", "uhpck"; 1420 1421 status = "disabled"; 1421 1422 };
+6 -5
arch/arm/boot/dts/sama5d4.dtsi
··· 66 66 gpio4 = &pioE; 67 67 tcb0 = &tcb0; 68 68 tcb1 = &tcb1; 69 + i2c0 = &i2c0; 69 70 i2c2 = &i2c2; 70 71 }; 71 72 cpus { ··· 260 259 compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; 261 260 reg = <0x00600000 0x100000>; 262 261 interrupts = <46 IRQ_TYPE_LEVEL_HIGH 2>; 263 - clocks = <&usb>, <&uhphs_clk>, <&uhpck>; 262 + clocks = <&utmi>, <&uhphs_clk>, <&uhpck>; 264 263 clock-names = "usb_clk", "ehci_clk", "uhpck"; 265 264 status = "disabled"; 266 265 }; ··· 462 461 463 462 lcdck: lcdck { 464 463 #clock-cells = <0>; 465 - reg = <4>; 466 - clocks = <&smd>; 464 + reg = <3>; 465 + clocks = <&mck>; 467 466 }; 468 467 469 468 smdck: smdck { ··· 771 770 reg = <50>; 772 771 }; 773 772 774 - lcd_clk: lcd_clk { 773 + lcdc_clk: lcdc_clk { 775 774 #clock-cells = <0>; 776 775 reg = <51>; 777 776 }; ··· 1064 1063 }; 1065 1064 1066 1065 dbgu: serial@fc069000 { 1067 - compatible = "atmel,at91sam9260-usart"; 1066 + compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; 1068 1067 reg = <0xfc069000 0x200>; 1069 1068 interrupts = <2 IRQ_TYPE_LEVEL_HIGH 7>; 1070 1069 pinctrl-names = "default";
+5 -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 ··· 73 70 CONFIG_BLK_DEV_SD=y 74 71 # CONFIG_SCSI_LOWLEVEL is not set 75 72 CONFIG_NETDEVICES=y 73 + CONFIG_ARM_AT91_ETHER=y 76 74 CONFIG_MACB=y 77 75 # CONFIG_NET_VENDOR_BROADCOM is not set 78 76 CONFIG_DM9000=y
-2
arch/arm/configs/sama5_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_IRQ_DOMAIN_DEBUG=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED=y 7 - CONFIG_SYSFS_DEPRECATED_V2=y 8 6 CONFIG_BLK_DEV_INITRD=y 9 7 CONFIG_EMBEDDED=y 10 8 CONFIG_SLAB=y
+4 -1
arch/arm/include/debug/at91.S
··· 18 18 #define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */ 19 19 #endif 20 20 21 - /* Keep in sync with mach-at91/include/mach/hardware.h */ 21 + #ifdef CONFIG_MMU 22 22 #define AT91_IO_P2V(x) ((x) - 0x01000000) 23 + #else 24 + #define AT91_IO_P2V(x) (x) 25 + #endif 23 26 24 27 #define AT91_DBGU_SR (0x14) /* Status Register */ 25 28 #define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */
+43 -88
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 + select ARCH_REQUIRE_GPIOLIB 22 4 select COMMON_CLK_AT91 23 - select CPU_V7 24 - select GENERIC_CLOCKEVENTS 25 - select MEMORY 26 - select ATMEL_SDRAMC 27 - select PHYLIB if NETDEVICES 5 + select PINCTRL 6 + select PINCTRL_AT91 7 + select SOC_BUS 28 8 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 9 + if ARCH_AT91 51 10 config SOC_SAMA5D3 52 - bool "SAMA5D3 family" 11 + bool "SAMA5D3 family" if ARCH_MULTI_V7 53 12 select SOC_SAMA5 54 13 select HAVE_FB_ATMEL 55 14 select HAVE_AT91_UTMI ··· 19 60 This support covers SAMA5D31, SAMA5D33, SAMA5D34, SAMA5D35, SAMA5D36. 20 61 21 62 config SOC_SAMA5D4 22 - bool "SAMA5D4 family" 63 + bool "SAMA5D4 family" if ARCH_MULTI_V7 23 64 select SOC_SAMA5 24 - select CLKSRC_MMIO 25 65 select CACHE_L2X0 26 66 select HAVE_FB_ATMEL 27 67 select HAVE_AT91_UTMI ··· 29 71 select HAVE_AT91_H32MX 30 72 help 31 73 Select this if you are using one of Atmel's SAMA5D4 family SoC. 32 - endif 33 74 34 - if SOC_SAM_V4_V5 35 75 config SOC_AT91RM9200 36 - bool "AT91RM9200" 76 + bool "AT91RM9200" if ARCH_MULTI_V4T 37 77 select ATMEL_AIC_IRQ 38 - select COMMON_CLK_AT91 78 + select ATMEL_ST 39 79 select CPU_ARM920T 40 - select GENERIC_CLOCKEVENTS 41 80 select HAVE_AT91_USB_CLK 81 + select MIGHT_HAVE_PCI 82 + select SOC_SAM_V4_V5 83 + select SRAM if PM 84 + help 85 + Select this if you are using Atmel's AT91RM9200 SoC. 42 86 43 87 config SOC_AT91SAM9 44 - bool "AT91SAM9" 88 + bool "AT91SAM9" if ARCH_MULTI_V5 45 89 select ATMEL_AIC_IRQ 46 90 select ATMEL_SDRAMC 47 - select COMMON_CLK_AT91 48 91 select CPU_ARM926T 49 - select GENERIC_CLOCKEVENTS 50 92 select HAVE_AT91_SMD 51 93 select HAVE_AT91_USB_CLK 52 94 select HAVE_AT91_UTMI 53 95 select HAVE_FB_ATMEL 54 96 select MEMORY 97 + select SOC_SAM_V4_V5 98 + select SRAM if PM 55 99 help 56 100 Select this if you are using one of those Atmel SoC: 57 101 AT91SAM9260 ··· 72 112 AT91SAM9X25 73 113 AT91SAM9X35 74 114 AT91SAM9XE 75 - endif # SOC_SAM_V4_V5 76 115 77 - comment "AT91 Feature Selections" 116 + config HAVE_AT91_UTMI 117 + bool 78 118 79 - config AT91_SLOW_CLOCK 80 - bool "Suspend-to-RAM disables main oscillator" 81 - select SRAM 82 - depends on SUSPEND 83 - help 84 - Select this if you want Suspend-to-RAM to save the most power 85 - possible (without powering off the CPU) by disabling the PLLs 86 - and main oscillator so that only the 32 KiHz clock is available. 119 + config HAVE_AT91_USB_CLK 120 + bool 87 121 88 - When only that slow-clock is available, some peripherals lose 89 - functionality. Many can't issue wakeup events unless faster 90 - clocks are available. Some lose their operating state and 91 - need to be completely re-initialized. 122 + config COMMON_CLK_AT91 123 + bool 124 + select COMMON_CLK 92 125 93 - config AT91_TIMER_HZ 94 - int "Kernel HZ (jiffies per second)" 95 - range 32 1024 96 - depends on ARCH_AT91 97 - default "128" if SOC_AT91RM9200 98 - default "100" 99 - help 100 - On AT91rm9200 chips where you're using a system clock derived 101 - from the 32768 Hz hardware clock, this tick rate should divide 102 - it exactly: use a power-of-two value, such as 128 or 256, to 103 - reduce timing errors caused by rounding. 126 + config HAVE_AT91_SMD 127 + bool 104 128 105 - On AT91sam926x chips, or otherwise when using a higher precision 106 - system clock (of at least several MHz), rounding is less of a 107 - problem so it can be safer to use a decimal values like 100. 129 + config HAVE_AT91_H32MX 130 + bool 108 131 109 - endmenu 132 + config SOC_SAM_V4_V5 133 + bool 134 + 135 + config SOC_SAM_V7 136 + bool 137 + 138 + config SOC_SAMA5 139 + bool 140 + select ATMEL_AIC5_IRQ 141 + select ATMEL_SDRAMC 142 + select MEMORY 143 + select SOC_SAM_V7 144 + select SRAM if PM 110 145 111 146 endif
+5 -3
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 - obj-y := setup.o 7 + obj-y := soc.o 6 8 7 9 obj-$(CONFIG_SOC_AT91SAM9) += sam9_smc.o 8 10 9 11 # CPU-specific support 10 - obj-$(CONFIG_SOC_AT91RM9200) += at91rm9200.o at91rm9200_time.o 12 + obj-$(CONFIG_SOC_AT91RM9200) += at91rm9200.o 11 13 obj-$(CONFIG_SOC_AT91SAM9) += at91sam9.o 12 14 obj-$(CONFIG_SOC_SAMA5) += sama5.o 13 15 14 16 # Power Management 15 17 obj-$(CONFIG_PM) += pm.o 16 - obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o 18 + obj-$(CONFIG_PM) += pm_suspend.o 17 19 18 20 ifeq ($(CONFIG_PM_DEBUG),y) 19 21 CFLAGS_pm.o += -DDEBUG
+15 -33
arch/arm/mach-at91/at91rm9200.c
··· 8 8 * Licensed under GPLv2 or later. 9 9 */ 10 10 11 - #include <linux/types.h> 12 - #include <linux/init.h> 13 - #include <linux/module.h> 14 - #include <linux/gpio.h> 15 - #include <linux/of.h> 16 - #include <linux/of_irq.h> 17 - #include <linux/of_platform.h> 18 11 #include <linux/clk-provider.h> 12 + #include <linux/of.h> 13 + #include <linux/of_platform.h> 19 14 20 - #include <asm/setup.h> 21 - #include <asm/irq.h> 22 15 #include <asm/mach/arch.h> 23 - #include <asm/mach/map.h> 24 - #include <asm/mach/irq.h> 25 16 #include <asm/system_misc.h> 26 17 27 - #include <mach/at91_st.h> 28 - 29 18 #include "generic.h" 19 + #include "soc.h" 30 20 31 - static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) 32 - { 33 - /* 34 - * Perform a hardware reset with the use of the Watchdog timer. 35 - */ 36 - at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1); 37 - at91_st_write(AT91_ST_CR, AT91_ST_WDRST); 38 - } 39 - 40 - static void __init at91rm9200_dt_timer_init(void) 41 - { 42 - of_clk_init(NULL); 43 - at91rm9200_timer_init(); 44 - } 21 + static const struct at91_soc rm9200_socs[] = { 22 + AT91_SOC(AT91RM9200_CIDR_MATCH, 0, "at91rm9200 BGA", "at91rm9200"), 23 + { /* sentinel */ }, 24 + }; 45 25 46 26 static void __init at91rm9200_dt_device_init(void) 47 27 { 48 - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 28 + struct soc_device *soc; 29 + struct device *soc_dev = NULL; 30 + 31 + soc = at91_soc_init(rm9200_socs); 32 + if (soc != NULL) 33 + soc_dev = soc_device_to_device(soc); 34 + 35 + of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); 49 36 50 37 arm_pm_idle = at91rm9200_idle; 51 - arm_pm_restart = at91rm9200_restart; 52 38 at91rm9200_pm_init(); 53 39 } 54 - 55 - 56 40 57 41 static const char *at91rm9200_dt_board_compat[] __initconst = { 58 42 "atmel,at91rm9200", ··· 44 60 }; 45 61 46 62 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200") 47 - .init_time = at91rm9200_dt_timer_init, 48 - .map_io = at91_map_io, 49 63 .init_machine = at91rm9200_dt_device_init, 50 64 .dt_compat = at91rm9200_dt_board_compat, 51 65 MACHINE_END
+45 -72
arch/arm/mach-at91/at91rm9200_time.c drivers/clocksource/timer-atmel-st.c
··· 24 24 #include <linux/irq.h> 25 25 #include <linux/clockchips.h> 26 26 #include <linux/export.h> 27 - #include <linux/of.h> 28 - #include <linux/of_address.h> 27 + #include <linux/mfd/syscon.h> 28 + #include <linux/mfd/syscon/atmel-st.h> 29 29 #include <linux/of_irq.h> 30 - 31 - #include <asm/mach/time.h> 32 - 33 - #include <mach/at91_st.h> 34 - #include <mach/hardware.h> 30 + #include <linux/regmap.h> 35 31 36 32 static unsigned long last_crtr; 37 33 static u32 irqmask; 38 34 static struct clock_event_device clkevt; 35 + static struct regmap *regmap_st; 39 36 37 + #define AT91_SLOW_CLOCK 32768 40 38 #define RM9200_TIMER_LATCH ((AT91_SLOW_CLOCK + HZ/2) / HZ) 41 39 42 40 /* ··· 44 46 */ 45 47 static inline unsigned long read_CRTR(void) 46 48 { 47 - unsigned long x1, x2; 49 + unsigned int x1, x2; 48 50 49 - x1 = at91_st_read(AT91_ST_CRTR); 51 + regmap_read(regmap_st, AT91_ST_CRTR, &x1); 50 52 do { 51 - x2 = at91_st_read(AT91_ST_CRTR); 53 + regmap_read(regmap_st, AT91_ST_CRTR, &x2); 52 54 if (x1 == x2) 53 55 break; 54 56 x1 = x2; ··· 61 63 */ 62 64 static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id) 63 65 { 64 - u32 sr = at91_st_read(AT91_ST_SR) & irqmask; 66 + u32 sr; 67 + 68 + regmap_read(regmap_st, AT91_ST_SR, &sr); 69 + sr &= irqmask; 65 70 66 71 /* 67 72 * irqs should be disabled here, but as the irq is shared they are only ··· 93 92 return IRQ_NONE; 94 93 } 95 94 96 - static struct irqaction at91rm9200_timer_irq = { 97 - .name = "at91_tick", 98 - .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL, 99 - .handler = at91rm9200_timer_interrupt, 100 - .irq = NR_IRQS_LEGACY + AT91_ID_SYS, 101 - }; 102 - 103 95 static cycle_t read_clk32k(struct clocksource *cs) 104 96 { 105 97 return read_CRTR(); ··· 109 115 static void 110 116 clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev) 111 117 { 118 + unsigned int val; 119 + 112 120 /* Disable and flush pending timer interrupts */ 113 - at91_st_write(AT91_ST_IDR, AT91_ST_PITS | AT91_ST_ALMS); 114 - at91_st_read(AT91_ST_SR); 121 + regmap_write(regmap_st, AT91_ST_IDR, AT91_ST_PITS | AT91_ST_ALMS); 122 + regmap_read(regmap_st, AT91_ST_SR, &val); 115 123 116 124 last_crtr = read_CRTR(); 117 125 switch (mode) { 118 126 case CLOCK_EVT_MODE_PERIODIC: 119 127 /* PIT for periodic irqs; fixed rate of 1/HZ */ 120 128 irqmask = AT91_ST_PITS; 121 - at91_st_write(AT91_ST_PIMR, RM9200_TIMER_LATCH); 129 + regmap_write(regmap_st, AT91_ST_PIMR, RM9200_TIMER_LATCH); 122 130 break; 123 131 case CLOCK_EVT_MODE_ONESHOT: 124 132 /* ALM for oneshot irqs, set by next_event() 125 133 * before 32 seconds have passed 126 134 */ 127 135 irqmask = AT91_ST_ALMS; 128 - at91_st_write(AT91_ST_RTAR, last_crtr); 136 + regmap_write(regmap_st, AT91_ST_RTAR, last_crtr); 129 137 break; 130 138 case CLOCK_EVT_MODE_SHUTDOWN: 131 139 case CLOCK_EVT_MODE_UNUSED: ··· 135 139 irqmask = 0; 136 140 break; 137 141 } 138 - at91_st_write(AT91_ST_IER, irqmask); 142 + regmap_write(regmap_st, AT91_ST_IER, irqmask); 139 143 } 140 144 141 145 static int ··· 143 147 { 144 148 u32 alm; 145 149 int status = 0; 150 + unsigned int val; 146 151 147 152 BUG_ON(delta < 2); 148 153 ··· 159 162 alm = read_CRTR(); 160 163 161 164 /* Cancel any pending alarm; flush any pending IRQ */ 162 - at91_st_write(AT91_ST_RTAR, alm); 163 - at91_st_read(AT91_ST_SR); 165 + regmap_write(regmap_st, AT91_ST_RTAR, alm); 166 + regmap_read(regmap_st, AT91_ST_SR, &val); 164 167 165 168 /* Schedule alarm by writing RTAR. */ 166 169 alm += delta; 167 - at91_st_write(AT91_ST_RTAR, alm); 170 + regmap_write(regmap_st, AT91_ST_RTAR, alm); 168 171 169 172 return status; 170 173 } ··· 177 180 .set_mode = clkevt32k_mode, 178 181 }; 179 182 180 - void __iomem *at91_st_base; 181 - EXPORT_SYMBOL_GPL(at91_st_base); 182 - 183 - static const struct of_device_id at91rm9200_st_timer_ids[] = { 184 - { .compatible = "atmel,at91rm9200-st" }, 185 - { /* sentinel */ } 186 - }; 187 - 188 - static int __init of_at91rm9200_st_init(void) 189 - { 190 - struct device_node *np; 191 - int ret; 192 - 193 - np = of_find_matching_node(NULL, at91rm9200_st_timer_ids); 194 - if (!np) 195 - goto err; 196 - 197 - at91_st_base = of_iomap(np, 0); 198 - if (!at91_st_base) 199 - goto node_err; 200 - 201 - /* Get the interrupts property */ 202 - ret = irq_of_parse_and_map(np, 0); 203 - if (!ret) 204 - goto ioremap_err; 205 - at91rm9200_timer_irq.irq = ret; 206 - 207 - of_node_put(np); 208 - 209 - return 0; 210 - 211 - ioremap_err: 212 - iounmap(at91_st_base); 213 - node_err: 214 - of_node_put(np); 215 - err: 216 - return -EINVAL; 217 - } 218 - 219 183 /* 220 184 * ST (system timer) module supports both clockevents and clocksource. 221 185 */ 222 - void __init at91rm9200_timer_init(void) 186 + static void __init atmel_st_timer_init(struct device_node *node) 223 187 { 224 - /* For device tree enabled device: initialize here */ 225 - of_at91rm9200_st_init(); 188 + unsigned int val; 189 + int irq, ret; 190 + 191 + regmap_st = syscon_node_to_regmap(node); 192 + if (IS_ERR(regmap_st)) 193 + panic(pr_fmt("Unable to get regmap\n")); 226 194 227 195 /* Disable all timer interrupts, and clear any pending ones */ 228 - at91_st_write(AT91_ST_IDR, 196 + regmap_write(regmap_st, AT91_ST_IDR, 229 197 AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS); 230 - at91_st_read(AT91_ST_SR); 198 + regmap_read(regmap_st, AT91_ST_SR, &val); 199 + 200 + /* Get the interrupts property */ 201 + irq = irq_of_parse_and_map(node, 0); 202 + if (!irq) 203 + panic(pr_fmt("Unable to get IRQ from DT\n")); 231 204 232 205 /* Make IRQs happen for the system timer */ 233 - setup_irq(at91rm9200_timer_irq.irq, &at91rm9200_timer_irq); 206 + ret = request_irq(irq, at91rm9200_timer_interrupt, 207 + IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL, 208 + "at91_tick", regmap_st); 209 + if (ret) 210 + panic(pr_fmt("Unable to setup IRQ\n")); 234 211 235 212 /* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used 236 213 * directly for the clocksource and all clockevents, after adjusting 237 214 * its prescaler from the 1 Hz default. 238 215 */ 239 - at91_st_write(AT91_ST_RTMR, 1); 216 + regmap_write(regmap_st, AT91_ST_RTMR, 1); 240 217 241 218 /* Setup timer clockevent, with minimum of two ticks (important!!) */ 242 219 clkevt.cpumask = cpumask_of(0); ··· 220 249 /* register clocksource */ 221 250 clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); 222 251 } 252 + CLOCKSOURCE_OF_DECLARE(atmel_st_timer, "atmel,at91rm9200-st", 253 + atmel_st_timer_init);
+55 -23
arch/arm/mach-at91/at91sam9.c
··· 7 7 * Licensed under GPLv2 or later. 8 8 */ 9 9 10 - #include <linux/types.h> 11 - #include <linux/init.h> 12 - #include <linux/module.h> 13 - #include <linux/gpio.h> 14 10 #include <linux/of.h> 15 - #include <linux/of_irq.h> 16 11 #include <linux/of_platform.h> 17 - #include <linux/clk-provider.h> 18 12 19 - #include <asm/system_misc.h> 20 - #include <asm/setup.h> 21 - #include <asm/irq.h> 22 13 #include <asm/mach/arch.h> 23 - #include <asm/mach/map.h> 24 - #include <asm/mach/irq.h> 14 + #include <asm/system_misc.h> 25 15 26 16 #include "generic.h" 17 + #include "soc.h" 18 + 19 + static const struct at91_soc at91sam9_socs[] = { 20 + AT91_SOC(AT91SAM9260_CIDR_MATCH, 0, "at91sam9260", NULL), 21 + AT91_SOC(AT91SAM9261_CIDR_MATCH, 0, "at91sam9261", NULL), 22 + AT91_SOC(AT91SAM9263_CIDR_MATCH, 0, "at91sam9263", NULL), 23 + AT91_SOC(AT91SAM9G20_CIDR_MATCH, 0, "at91sam9g20", NULL), 24 + AT91_SOC(AT91SAM9RL64_CIDR_MATCH, 0, "at91sam9rl64", NULL), 25 + AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9M11_EXID_MATCH, 26 + "at91sam9m11", "at91sam9g45"), 27 + AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9M10_EXID_MATCH, 28 + "at91sam9m10", "at91sam9g45"), 29 + AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9G46_EXID_MATCH, 30 + "at91sam9g46", "at91sam9g45"), 31 + AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9G45_EXID_MATCH, 32 + "at91sam9g45", "at91sam9g45"), 33 + AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G15_EXID_MATCH, 34 + "at91sam9g15", "at91sam9x5"), 35 + AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G35_EXID_MATCH, 36 + "at91sam9g35", "at91sam9x5"), 37 + AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9X35_EXID_MATCH, 38 + "at91sam9x35", "at91sam9x5"), 39 + AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G25_EXID_MATCH, 40 + "at91sam9g25", "at91sam9x5"), 41 + AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9X25_EXID_MATCH, 42 + "at91sam9x25", "at91sam9x5"), 43 + AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9CN12_EXID_MATCH, 44 + "at91sam9cn12", "at91sam9n12"), 45 + AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9N12_EXID_MATCH, 46 + "at91sam9n12", "at91sam9n12"), 47 + AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9CN11_EXID_MATCH, 48 + "at91sam9cn11", "at91sam9n12"), 49 + AT91_SOC(AT91SAM9XE128_CIDR_MATCH, 0, "at91sam9xe128", "at91sam9xe128"), 50 + AT91_SOC(AT91SAM9XE256_CIDR_MATCH, 0, "at91sam9xe256", "at91sam9xe256"), 51 + AT91_SOC(AT91SAM9XE512_CIDR_MATCH, 0, "at91sam9xe512", "at91sam9xe512"), 52 + { /* sentinel */ }, 53 + }; 54 + 55 + static void __init at91sam9_common_init(void) 56 + { 57 + struct soc_device *soc; 58 + struct device *soc_dev = NULL; 59 + 60 + soc = at91_soc_init(at91sam9_socs); 61 + if (soc != NULL) 62 + soc_dev = soc_device_to_device(soc); 63 + 64 + of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); 65 + 66 + arm_pm_idle = at91sam9_idle; 67 + } 27 68 28 69 static void __init at91sam9_dt_device_init(void) 29 70 { 30 - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 31 - 32 - arm_pm_idle = at91sam9_idle; 71 + at91sam9_common_init(); 33 72 at91sam9260_pm_init(); 34 73 } 35 74 ··· 79 40 80 41 DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9") 81 42 /* Maintainer: Atmel */ 82 - .map_io = at91_map_io, 83 43 .init_machine = at91sam9_dt_device_init, 84 44 .dt_compat = at91_dt_board_compat, 85 45 MACHINE_END 86 46 87 47 static void __init at91sam9g45_dt_device_init(void) 88 48 { 89 - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 90 - 91 - arm_pm_idle = at91sam9_idle; 49 + at91sam9_common_init(); 92 50 at91sam9g45_pm_init(); 93 51 } 94 52 ··· 96 60 97 61 DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") 98 62 /* Maintainer: Atmel */ 99 - .map_io = at91_map_io, 100 63 .init_machine = at91sam9g45_dt_device_init, 101 64 .dt_compat = at91sam9g45_board_compat, 102 65 MACHINE_END 103 66 104 67 static void __init at91sam9x5_dt_device_init(void) 105 68 { 106 - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 107 - 108 - arm_pm_idle = at91sam9_idle; 69 + at91sam9_common_init(); 109 70 at91sam9x5_pm_init(); 110 71 } 111 72 ··· 114 81 115 82 DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9") 116 83 /* Maintainer: Atmel */ 117 - .map_io = at91_map_io, 118 84 .init_machine = at91sam9x5_dt_device_init, 119 85 .dt_compat = at91sam9x5_board_compat, 120 86 MACHINE_END
-7
arch/arm/mach-at91/generic.h
··· 18 18 extern void __init at91_map_io(void); 19 19 extern void __init at91_alt_map_io(void); 20 20 21 - /* Timer */ 22 - extern void at91rm9200_timer_init(void); 23 - 24 21 /* idle */ 25 22 extern void at91rm9200_idle(void); 26 23 extern void at91sam9_idle(void); 27 - 28 - /* Matrix */ 29 - extern void at91_ioremap_matrix(u32 base_addr); 30 - 31 24 32 25 #ifdef CONFIG_PM 33 26 extern void __init at91rm9200_pm_init(void);
-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
-23
arch/arm/mach-at91/include/mach/at91_matrix.h
··· 1 - /* 2 - * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 3 - * 4 - * Under GPLv2 5 - */ 6 - 7 - #ifndef __MACH_AT91_MATRIX_H__ 8 - #define __MACH_AT91_MATRIX_H__ 9 - 10 - #ifndef __ASSEMBLY__ 11 - extern void __iomem *at91_matrix_base; 12 - 13 - #define at91_matrix_read(field) \ 14 - __raw_readl(at91_matrix_base + field) 15 - 16 - #define at91_matrix_write(field, value) \ 17 - __raw_writel(value, at91_matrix_base + field) 18 - 19 - #else 20 - .extern at91_matrix_base 21 - #endif 22 - 23 - #endif /* __MACH_AT91_MATRIX_H__ */
-61
arch/arm/mach-at91/include/mach/at91_st.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91_st.h 3 - * 4 - * Copyright (C) 2005 Ivan Kokshaysky 5 - * Copyright (C) SAN People 6 - * 7 - * System Timer (ST) - 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_ST_H 17 - #define AT91_ST_H 18 - 19 - #ifndef __ASSEMBLY__ 20 - extern void __iomem *at91_st_base; 21 - 22 - #define at91_st_read(field) \ 23 - __raw_readl(at91_st_base + field) 24 - 25 - #define at91_st_write(field, value) \ 26 - __raw_writel(value, at91_st_base + field) 27 - #else 28 - .extern at91_st_base 29 - #endif 30 - 31 - #define AT91_ST_CR 0x00 /* Control Register */ 32 - #define AT91_ST_WDRST (1 << 0) /* Watchdog Timer Restart */ 33 - 34 - #define AT91_ST_PIMR 0x04 /* Period Interval Mode Register */ 35 - #define AT91_ST_PIV (0xffff << 0) /* Period Interval Value */ 36 - 37 - #define AT91_ST_WDMR 0x08 /* Watchdog Mode Register */ 38 - #define AT91_ST_WDV (0xffff << 0) /* Watchdog Counter Value */ 39 - #define AT91_ST_RSTEN (1 << 16) /* Reset Enable */ 40 - #define AT91_ST_EXTEN (1 << 17) /* External Signal Assertion Enable */ 41 - 42 - #define AT91_ST_RTMR 0x0c /* Real-time Mode Register */ 43 - #define AT91_ST_RTPRES (0xffff << 0) /* Real-time Prescalar Value */ 44 - 45 - #define AT91_ST_SR 0x10 /* Status Register */ 46 - #define AT91_ST_PITS (1 << 0) /* Period Interval Timer Status */ 47 - #define AT91_ST_WDOVF (1 << 1) /* Watchdog Overflow */ 48 - #define AT91_ST_RTTINC (1 << 2) /* Real-time Timer Increment */ 49 - #define AT91_ST_ALMS (1 << 3) /* Alarm Status */ 50 - 51 - #define AT91_ST_IER 0x14 /* Interrupt Enable Register */ 52 - #define AT91_ST_IDR 0x18 /* Interrupt Disable Register */ 53 - #define AT91_ST_IMR 0x1c /* Interrupt Mask Register */ 54 - 55 - #define AT91_ST_RTAR 0x20 /* Real-time Alarm Register */ 56 - #define AT91_ST_ALMV (0xfffff << 0) /* Alarm Value */ 57 - 58 - #define AT91_ST_CRTR 0x24 /* Current Real-time Register */ 59 - #define AT91_ST_CRTV (0xfffff << 0) /* Current Real-Time Value */ 60 - 61 - #endif
-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
-80
arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91sam9260_matrix.h 3 - * 4 - * Copyright (C) 2007 Atmel Corporation. 5 - * 6 - * Memory Controllers (MATRIX, EBI) - System peripherals registers. 7 - * Based on AT91SAM9260 datasheet revision B. 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 AT91SAM9260_MATRIX_H 16 - #define AT91SAM9260_MATRIX_H 17 - 18 - #define AT91_MATRIX_MCFG0 0x00 /* Master Configuration Register 0 */ 19 - #define AT91_MATRIX_MCFG1 0x04 /* Master Configuration Register 1 */ 20 - #define AT91_MATRIX_MCFG2 0x08 /* Master Configuration Register 2 */ 21 - #define AT91_MATRIX_MCFG3 0x0C /* Master Configuration Register 3 */ 22 - #define AT91_MATRIX_MCFG4 0x10 /* Master Configuration Register 4 */ 23 - #define AT91_MATRIX_MCFG5 0x14 /* Master Configuration Register 5 */ 24 - #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ 25 - #define AT91_MATRIX_ULBT_INFINITE (0 << 0) 26 - #define AT91_MATRIX_ULBT_SINGLE (1 << 0) 27 - #define AT91_MATRIX_ULBT_FOUR (2 << 0) 28 - #define AT91_MATRIX_ULBT_EIGHT (3 << 0) 29 - #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) 30 - 31 - #define AT91_MATRIX_SCFG0 0x40 /* Slave Configuration Register 0 */ 32 - #define AT91_MATRIX_SCFG1 0x44 /* Slave Configuration Register 1 */ 33 - #define AT91_MATRIX_SCFG2 0x48 /* Slave Configuration Register 2 */ 34 - #define AT91_MATRIX_SCFG3 0x4C /* Slave Configuration Register 3 */ 35 - #define AT91_MATRIX_SCFG4 0x50 /* Slave Configuration Register 4 */ 36 - #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 37 - #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 38 - #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) 39 - #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) 40 - #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) 41 - #define AT91_MATRIX_FIXED_DEFMSTR (7 << 18) /* Fixed Index of Default Master */ 42 - #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ 43 - #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) 44 - #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) 45 - 46 - #define AT91_MATRIX_PRAS0 0x80 /* Priority Register A for Slave 0 */ 47 - #define AT91_MATRIX_PRAS1 0x88 /* Priority Register A for Slave 1 */ 48 - #define AT91_MATRIX_PRAS2 0x90 /* Priority Register A for Slave 2 */ 49 - #define AT91_MATRIX_PRAS3 0x98 /* Priority Register A for Slave 3 */ 50 - #define AT91_MATRIX_PRAS4 0xA0 /* Priority Register A for Slave 4 */ 51 - #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ 52 - #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ 53 - #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ 54 - #define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */ 55 - #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ 56 - #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ 57 - 58 - #define AT91_MATRIX_MRCR 0x100 /* Master Remap Control Register */ 59 - #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 60 - #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 61 - 62 - #define AT91_MATRIX_EBICSA 0x11C /* EBI Chip Select Assignment Register */ 63 - #define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ 64 - #define AT91_MATRIX_CS1A_SMC (0 << 1) 65 - #define AT91_MATRIX_CS1A_SDRAMC (1 << 1) 66 - #define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */ 67 - #define AT91_MATRIX_CS3A_SMC (0 << 3) 68 - #define AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3) 69 - #define AT91_MATRIX_CS4A (1 << 4) /* Chip Select 4 Assignment */ 70 - #define AT91_MATRIX_CS4A_SMC (0 << 4) 71 - #define AT91_MATRIX_CS4A_SMC_CF1 (1 << 4) 72 - #define AT91_MATRIX_CS5A (1 << 5) /* Chip Select 5 Assignment */ 73 - #define AT91_MATRIX_CS5A_SMC (0 << 5) 74 - #define AT91_MATRIX_CS5A_SMC_CF2 (1 << 5) 75 - #define AT91_MATRIX_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 76 - #define AT91_MATRIX_VDDIOMSEL (1 << 16) /* Memory voltage selection */ 77 - #define AT91_MATRIX_VDDIOMSEL_1_8V (0 << 16) 78 - #define AT91_MATRIX_VDDIOMSEL_3_3V (1 << 16) 79 - 80 - #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
-64
arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91sam9261_matrix.h 3 - * 4 - * Copyright (C) 2007 Atmel Corporation. 5 - * 6 - * Memory Controllers (MATRIX, EBI) - System peripherals registers. 7 - * Based on AT91SAM9261 datasheet revision D. 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_MATRIX_H 16 - #define AT91SAM9261_MATRIX_H 17 - 18 - #define AT91_MATRIX_MCFG 0x00 /* Master Configuration Register */ 19 - #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 20 - #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 21 - 22 - #define AT91_MATRIX_SCFG0 0x04 /* Slave Configuration Register 0 */ 23 - #define AT91_MATRIX_SCFG1 0x08 /* Slave Configuration Register 1 */ 24 - #define AT91_MATRIX_SCFG2 0x0C /* Slave Configuration Register 2 */ 25 - #define AT91_MATRIX_SCFG3 0x10 /* Slave Configuration Register 3 */ 26 - #define AT91_MATRIX_SCFG4 0x14 /* Slave Configuration Register 4 */ 27 - #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 28 - #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 29 - #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) 30 - #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) 31 - #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) 32 - #define AT91_MATRIX_FIXED_DEFMSTR (7 << 18) /* Fixed Index of Default Master */ 33 - 34 - #define AT91_MATRIX_TCR 0x24 /* TCM Configuration Register */ 35 - #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ 36 - #define AT91_MATRIX_ITCM_0 (0 << 0) 37 - #define AT91_MATRIX_ITCM_16 (5 << 0) 38 - #define AT91_MATRIX_ITCM_32 (6 << 0) 39 - #define AT91_MATRIX_ITCM_64 (7 << 0) 40 - #define AT91_MATRIX_DTCM_SIZE (0xf << 4) /* Size of DTCM enabled memory block */ 41 - #define AT91_MATRIX_DTCM_0 (0 << 4) 42 - #define AT91_MATRIX_DTCM_16 (5 << 4) 43 - #define AT91_MATRIX_DTCM_32 (6 << 4) 44 - #define AT91_MATRIX_DTCM_64 (7 << 4) 45 - 46 - #define AT91_MATRIX_EBICSA 0x30 /* EBI Chip Select Assignment Register */ 47 - #define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ 48 - #define AT91_MATRIX_CS1A_SMC (0 << 1) 49 - #define AT91_MATRIX_CS1A_SDRAMC (1 << 1) 50 - #define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */ 51 - #define AT91_MATRIX_CS3A_SMC (0 << 3) 52 - #define AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3) 53 - #define AT91_MATRIX_CS4A (1 << 4) /* Chip Select 4 Assignment */ 54 - #define AT91_MATRIX_CS4A_SMC (0 << 4) 55 - #define AT91_MATRIX_CS4A_SMC_CF1 (1 << 4) 56 - #define AT91_MATRIX_CS5A (1 << 5) /* Chip Select 5 Assignment */ 57 - #define AT91_MATRIX_CS5A_SMC (0 << 5) 58 - #define AT91_MATRIX_CS5A_SMC_CF2 (1 << 5) 59 - #define AT91_MATRIX_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 60 - 61 - #define AT91_MATRIX_USBPUCR 0x34 /* USB Pad Pull-Up Control Register */ 62 - #define AT91_MATRIX_USBPUCR_PUON (1 << 30) /* USB Device PAD Pull-up Enable */ 63 - 64 - #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
-129
arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91sam9263_matrix.h 3 - * 4 - * Copyright (C) 2006 Atmel Corporation. 5 - * 6 - * Memory Controllers (MATRIX, EBI) - System peripherals registers. 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_MATRIX_H 16 - #define AT91SAM9263_MATRIX_H 17 - 18 - #define AT91_MATRIX_MCFG0 0x00 /* Master Configuration Register 0 */ 19 - #define AT91_MATRIX_MCFG1 0x04 /* Master Configuration Register 1 */ 20 - #define AT91_MATRIX_MCFG2 0x08 /* Master Configuration Register 2 */ 21 - #define AT91_MATRIX_MCFG3 0x0C /* Master Configuration Register 3 */ 22 - #define AT91_MATRIX_MCFG4 0x10 /* Master Configuration Register 4 */ 23 - #define AT91_MATRIX_MCFG5 0x14 /* Master Configuration Register 5 */ 24 - #define AT91_MATRIX_MCFG6 0x18 /* Master Configuration Register 6 */ 25 - #define AT91_MATRIX_MCFG7 0x1C /* Master Configuration Register 7 */ 26 - #define AT91_MATRIX_MCFG8 0x20 /* Master Configuration Register 8 */ 27 - #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ 28 - #define AT91_MATRIX_ULBT_INFINITE (0 << 0) 29 - #define AT91_MATRIX_ULBT_SINGLE (1 << 0) 30 - #define AT91_MATRIX_ULBT_FOUR (2 << 0) 31 - #define AT91_MATRIX_ULBT_EIGHT (3 << 0) 32 - #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) 33 - 34 - #define AT91_MATRIX_SCFG0 0x40 /* Slave Configuration Register 0 */ 35 - #define AT91_MATRIX_SCFG1 0x44 /* Slave Configuration Register 1 */ 36 - #define AT91_MATRIX_SCFG2 0x48 /* Slave Configuration Register 2 */ 37 - #define AT91_MATRIX_SCFG3 0x4C /* Slave Configuration Register 3 */ 38 - #define AT91_MATRIX_SCFG4 0x50 /* Slave Configuration Register 4 */ 39 - #define AT91_MATRIX_SCFG5 0x54 /* Slave Configuration Register 5 */ 40 - #define AT91_MATRIX_SCFG6 0x58 /* Slave Configuration Register 6 */ 41 - #define AT91_MATRIX_SCFG7 0x5C /* Slave Configuration Register 7 */ 42 - #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 43 - #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 44 - #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) 45 - #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) 46 - #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) 47 - #define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */ 48 - #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ 49 - #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) 50 - #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) 51 - 52 - #define AT91_MATRIX_PRAS0 0x80 /* Priority Register A for Slave 0 */ 53 - #define AT91_MATRIX_PRBS0 0x84 /* Priority Register B for Slave 0 */ 54 - #define AT91_MATRIX_PRAS1 0x88 /* Priority Register A for Slave 1 */ 55 - #define AT91_MATRIX_PRBS1 0x8C /* Priority Register B for Slave 1 */ 56 - #define AT91_MATRIX_PRAS2 0x90 /* Priority Register A for Slave 2 */ 57 - #define AT91_MATRIX_PRBS2 0x94 /* Priority Register B for Slave 2 */ 58 - #define AT91_MATRIX_PRAS3 0x98 /* Priority Register A for Slave 3 */ 59 - #define AT91_MATRIX_PRBS3 0x9C /* Priority Register B for Slave 3 */ 60 - #define AT91_MATRIX_PRAS4 0xA0 /* Priority Register A for Slave 4 */ 61 - #define AT91_MATRIX_PRBS4 0xA4 /* Priority Register B for Slave 4 */ 62 - #define AT91_MATRIX_PRAS5 0xA8 /* Priority Register A for Slave 5 */ 63 - #define AT91_MATRIX_PRBS5 0xAC /* Priority Register B for Slave 5 */ 64 - #define AT91_MATRIX_PRAS6 0xB0 /* Priority Register A for Slave 6 */ 65 - #define AT91_MATRIX_PRBS6 0xB4 /* Priority Register B for Slave 6 */ 66 - #define AT91_MATRIX_PRAS7 0xB8 /* Priority Register A for Slave 7 */ 67 - #define AT91_MATRIX_PRBS7 0xBC /* Priority Register B for Slave 7 */ 68 - #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ 69 - #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ 70 - #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ 71 - #define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */ 72 - #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ 73 - #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ 74 - #define AT91_MATRIX_M6PR (3 << 24) /* Master 6 Priority */ 75 - #define AT91_MATRIX_M7PR (3 << 28) /* Master 7 Priority */ 76 - #define AT91_MATRIX_M8PR (3 << 0) /* Master 8 Priority (in Register B) */ 77 - 78 - #define AT91_MATRIX_MRCR 0x100 /* Master Remap Control Register */ 79 - #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 80 - #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 81 - #define AT91_MATRIX_RCB2 (1 << 2) 82 - #define AT91_MATRIX_RCB3 (1 << 3) 83 - #define AT91_MATRIX_RCB4 (1 << 4) 84 - #define AT91_MATRIX_RCB5 (1 << 5) 85 - #define AT91_MATRIX_RCB6 (1 << 6) 86 - #define AT91_MATRIX_RCB7 (1 << 7) 87 - #define AT91_MATRIX_RCB8 (1 << 8) 88 - 89 - #define AT91_MATRIX_TCMR 0x114 /* TCM Configuration Register */ 90 - #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ 91 - #define AT91_MATRIX_ITCM_0 (0 << 0) 92 - #define AT91_MATRIX_ITCM_16 (5 << 0) 93 - #define AT91_MATRIX_ITCM_32 (6 << 0) 94 - #define AT91_MATRIX_DTCM_SIZE (0xf << 4) /* Size of DTCM enabled memory block */ 95 - #define AT91_MATRIX_DTCM_0 (0 << 4) 96 - #define AT91_MATRIX_DTCM_16 (5 << 4) 97 - #define AT91_MATRIX_DTCM_32 (6 << 4) 98 - 99 - #define AT91_MATRIX_EBI0CSA 0x120 /* EBI0 Chip Select Assignment Register */ 100 - #define AT91_MATRIX_EBI0_CS1A (1 << 1) /* Chip Select 1 Assignment */ 101 - #define AT91_MATRIX_EBI0_CS1A_SMC (0 << 1) 102 - #define AT91_MATRIX_EBI0_CS1A_SDRAMC (1 << 1) 103 - #define AT91_MATRIX_EBI0_CS3A (1 << 3) /* Chip Select 3 Assignment */ 104 - #define AT91_MATRIX_EBI0_CS3A_SMC (0 << 3) 105 - #define AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA (1 << 3) 106 - #define AT91_MATRIX_EBI0_CS4A (1 << 4) /* Chip Select 4 Assignment */ 107 - #define AT91_MATRIX_EBI0_CS4A_SMC (0 << 4) 108 - #define AT91_MATRIX_EBI0_CS4A_SMC_CF1 (1 << 4) 109 - #define AT91_MATRIX_EBI0_CS5A (1 << 5) /* Chip Select 5 Assignment */ 110 - #define AT91_MATRIX_EBI0_CS5A_SMC (0 << 5) 111 - #define AT91_MATRIX_EBI0_CS5A_SMC_CF2 (1 << 5) 112 - #define AT91_MATRIX_EBI0_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 113 - #define AT91_MATRIX_EBI0_VDDIOMSEL (1 << 16) /* Memory voltage selection */ 114 - #define AT91_MATRIX_EBI0_VDDIOMSEL_1_8V (0 << 16) 115 - #define AT91_MATRIX_EBI0_VDDIOMSEL_3_3V (1 << 16) 116 - 117 - #define AT91_MATRIX_EBI1CSA 0x124 /* EBI1 Chip Select Assignment Register */ 118 - #define AT91_MATRIX_EBI1_CS1A (1 << 1) /* Chip Select 1 Assignment */ 119 - #define AT91_MATRIX_EBI1_CS1A_SMC (0 << 1) 120 - #define AT91_MATRIX_EBI1_CS1A_SDRAMC (1 << 1) 121 - #define AT91_MATRIX_EBI1_CS2A (1 << 3) /* Chip Select 3 Assignment */ 122 - #define AT91_MATRIX_EBI1_CS2A_SMC (0 << 3) 123 - #define AT91_MATRIX_EBI1_CS2A_SMC_SMARTMEDIA (1 << 3) 124 - #define AT91_MATRIX_EBI1_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 125 - #define AT91_MATRIX_EBI1_VDDIOMSEL (1 << 16) /* Memory voltage selection */ 126 - #define AT91_MATRIX_EBI1_VDDIOMSEL_1_8V (0 << 16) 127 - #define AT91_MATRIX_EBI1_VDDIOMSEL_3_3V (1 << 16) 128 - 129 - #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
-153
arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
··· 1 - /* 2 - * Matrix-centric header file for the AT91SAM9G45 family 3 - * 4 - * Copyright (C) 2008-2009 Atmel Corporation. 5 - * 6 - * Memory Controllers (MATRIX, EBI) - System peripherals registers. 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_MATRIX_H 16 - #define AT91SAM9G45_MATRIX_H 17 - 18 - #define AT91_MATRIX_MCFG0 0x00 /* Master Configuration Register 0 */ 19 - #define AT91_MATRIX_MCFG1 0x04 /* Master Configuration Register 1 */ 20 - #define AT91_MATRIX_MCFG2 0x08 /* Master Configuration Register 2 */ 21 - #define AT91_MATRIX_MCFG3 0x0C /* Master Configuration Register 3 */ 22 - #define AT91_MATRIX_MCFG4 0x10 /* Master Configuration Register 4 */ 23 - #define AT91_MATRIX_MCFG5 0x14 /* Master Configuration Register 5 */ 24 - #define AT91_MATRIX_MCFG6 0x18 /* Master Configuration Register 6 */ 25 - #define AT91_MATRIX_MCFG7 0x1C /* Master Configuration Register 7 */ 26 - #define AT91_MATRIX_MCFG8 0x20 /* Master Configuration Register 8 */ 27 - #define AT91_MATRIX_MCFG9 0x24 /* Master Configuration Register 9 */ 28 - #define AT91_MATRIX_MCFG10 0x28 /* Master Configuration Register 10 */ 29 - #define AT91_MATRIX_MCFG11 0x2C /* Master Configuration Register 11 */ 30 - #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ 31 - #define AT91_MATRIX_ULBT_INFINITE (0 << 0) 32 - #define AT91_MATRIX_ULBT_SINGLE (1 << 0) 33 - #define AT91_MATRIX_ULBT_FOUR (2 << 0) 34 - #define AT91_MATRIX_ULBT_EIGHT (3 << 0) 35 - #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) 36 - #define AT91_MATRIX_ULBT_THIRTYTWO (5 << 0) 37 - #define AT91_MATRIX_ULBT_SIXTYFOUR (6 << 0) 38 - #define AT91_MATRIX_ULBT_128 (7 << 0) 39 - 40 - #define AT91_MATRIX_SCFG0 0x40 /* Slave Configuration Register 0 */ 41 - #define AT91_MATRIX_SCFG1 0x44 /* Slave Configuration Register 1 */ 42 - #define AT91_MATRIX_SCFG2 0x48 /* Slave Configuration Register 2 */ 43 - #define AT91_MATRIX_SCFG3 0x4C /* Slave Configuration Register 3 */ 44 - #define AT91_MATRIX_SCFG4 0x50 /* Slave Configuration Register 4 */ 45 - #define AT91_MATRIX_SCFG5 0x54 /* Slave Configuration Register 5 */ 46 - #define AT91_MATRIX_SCFG6 0x58 /* Slave Configuration Register 6 */ 47 - #define AT91_MATRIX_SCFG7 0x5C /* Slave Configuration Register 7 */ 48 - #define AT91_MATRIX_SLOT_CYCLE (0x1ff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 49 - #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 50 - #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) 51 - #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) 52 - #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) 53 - #define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */ 54 - 55 - #define AT91_MATRIX_PRAS0 0x80 /* Priority Register A for Slave 0 */ 56 - #define AT91_MATRIX_PRBS0 0x84 /* Priority Register B for Slave 0 */ 57 - #define AT91_MATRIX_PRAS1 0x88 /* Priority Register A for Slave 1 */ 58 - #define AT91_MATRIX_PRBS1 0x8C /* Priority Register B for Slave 1 */ 59 - #define AT91_MATRIX_PRAS2 0x90 /* Priority Register A for Slave 2 */ 60 - #define AT91_MATRIX_PRBS2 0x94 /* Priority Register B for Slave 2 */ 61 - #define AT91_MATRIX_PRAS3 0x98 /* Priority Register A for Slave 3 */ 62 - #define AT91_MATRIX_PRBS3 0x9C /* Priority Register B for Slave 3 */ 63 - #define AT91_MATRIX_PRAS4 0xA0 /* Priority Register A for Slave 4 */ 64 - #define AT91_MATRIX_PRBS4 0xA4 /* Priority Register B for Slave 4 */ 65 - #define AT91_MATRIX_PRAS5 0xA8 /* Priority Register A for Slave 5 */ 66 - #define AT91_MATRIX_PRBS5 0xAC /* Priority Register B for Slave 5 */ 67 - #define AT91_MATRIX_PRAS6 0xB0 /* Priority Register A for Slave 6 */ 68 - #define AT91_MATRIX_PRBS6 0xB4 /* Priority Register B for Slave 6 */ 69 - #define AT91_MATRIX_PRAS7 0xB8 /* Priority Register A for Slave 7 */ 70 - #define AT91_MATRIX_PRBS7 0xBC /* Priority Register B for Slave 7 */ 71 - #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ 72 - #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ 73 - #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ 74 - #define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */ 75 - #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ 76 - #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ 77 - #define AT91_MATRIX_M6PR (3 << 24) /* Master 6 Priority */ 78 - #define AT91_MATRIX_M7PR (3 << 28) /* Master 7 Priority */ 79 - #define AT91_MATRIX_M8PR (3 << 0) /* Master 8 Priority (in Register B) */ 80 - #define AT91_MATRIX_M9PR (3 << 4) /* Master 9 Priority (in Register B) */ 81 - #define AT91_MATRIX_M10PR (3 << 8) /* Master 10 Priority (in Register B) */ 82 - #define AT91_MATRIX_M11PR (3 << 12) /* Master 11 Priority (in Register B) */ 83 - 84 - #define AT91_MATRIX_MRCR 0x100 /* Master Remap Control Register */ 85 - #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 86 - #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 87 - #define AT91_MATRIX_RCB2 (1 << 2) 88 - #define AT91_MATRIX_RCB3 (1 << 3) 89 - #define AT91_MATRIX_RCB4 (1 << 4) 90 - #define AT91_MATRIX_RCB5 (1 << 5) 91 - #define AT91_MATRIX_RCB6 (1 << 6) 92 - #define AT91_MATRIX_RCB7 (1 << 7) 93 - #define AT91_MATRIX_RCB8 (1 << 8) 94 - #define AT91_MATRIX_RCB9 (1 << 9) 95 - #define AT91_MATRIX_RCB10 (1 << 10) 96 - #define AT91_MATRIX_RCB11 (1 << 11) 97 - 98 - #define AT91_MATRIX_TCMR 0x110 /* TCM Configuration Register */ 99 - #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ 100 - #define AT91_MATRIX_ITCM_0 (0 << 0) 101 - #define AT91_MATRIX_ITCM_32 (6 << 0) 102 - #define AT91_MATRIX_DTCM_SIZE (0xf << 4) /* Size of DTCM enabled memory block */ 103 - #define AT91_MATRIX_DTCM_0 (0 << 4) 104 - #define AT91_MATRIX_DTCM_32 (6 << 4) 105 - #define AT91_MATRIX_DTCM_64 (7 << 4) 106 - #define AT91_MATRIX_TCM_NWS (0x1 << 11) /* Wait state TCM register */ 107 - #define AT91_MATRIX_TCM_NO_WS (0x0 << 11) 108 - #define AT91_MATRIX_TCM_ONE_WS (0x1 << 11) 109 - 110 - #define AT91_MATRIX_VIDEO 0x118 /* Video Mode Configuration Register */ 111 - #define AT91C_VDEC_SEL (0x1 << 0) /* Video Mode Selection */ 112 - #define AT91C_VDEC_SEL_OFF (0 << 0) 113 - #define AT91C_VDEC_SEL_ON (1 << 0) 114 - 115 - #define AT91_MATRIX_EBICSA 0x128 /* EBI Chip Select Assignment Register */ 116 - #define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */ 117 - #define AT91_MATRIX_EBI_CS1A_SMC (0 << 1) 118 - #define AT91_MATRIX_EBI_CS1A_SDRAMC (1 << 1) 119 - #define AT91_MATRIX_EBI_CS3A (1 << 3) /* Chip Select 3 Assignment */ 120 - #define AT91_MATRIX_EBI_CS3A_SMC (0 << 3) 121 - #define AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA (1 << 3) 122 - #define AT91_MATRIX_EBI_CS4A (1 << 4) /* Chip Select 4 Assignment */ 123 - #define AT91_MATRIX_EBI_CS4A_SMC (0 << 4) 124 - #define AT91_MATRIX_EBI_CS4A_SMC_CF0 (1 << 4) 125 - #define AT91_MATRIX_EBI_CS5A (1 << 5) /* Chip Select 5 Assignment */ 126 - #define AT91_MATRIX_EBI_CS5A_SMC (0 << 5) 127 - #define AT91_MATRIX_EBI_CS5A_SMC_CF1 (1 << 5) 128 - #define AT91_MATRIX_EBI_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 129 - #define AT91_MATRIX_EBI_DBPU_ON (0 << 8) 130 - #define AT91_MATRIX_EBI_DBPU_OFF (1 << 8) 131 - #define AT91_MATRIX_EBI_VDDIOMSEL (1 << 16) /* Memory voltage selection */ 132 - #define AT91_MATRIX_EBI_VDDIOMSEL_1_8V (0 << 16) 133 - #define AT91_MATRIX_EBI_VDDIOMSEL_3_3V (1 << 16) 134 - #define AT91_MATRIX_EBI_EBI_IOSR (1 << 17) /* EBI I/O slew rate selection */ 135 - #define AT91_MATRIX_EBI_EBI_IOSR_REDUCED (0 << 17) 136 - #define AT91_MATRIX_EBI_EBI_IOSR_NORMAL (1 << 17) 137 - #define AT91_MATRIX_EBI_DDR_IOSR (1 << 18) /* DDR2 dedicated port I/O slew rate selection */ 138 - #define AT91_MATRIX_EBI_DDR_IOSR_REDUCED (0 << 18) 139 - #define AT91_MATRIX_EBI_DDR_IOSR_NORMAL (1 << 18) 140 - 141 - #define AT91_MATRIX_WPMR 0x1E4 /* Write Protect Mode Register */ 142 - #define AT91_MATRIX_WPMR_WPEN (1 << 0) /* Write Protect ENable */ 143 - #define AT91_MATRIX_WPMR_WP_WPDIS (0 << 0) 144 - #define AT91_MATRIX_WPMR_WP_WPEN (1 << 0) 145 - #define AT91_MATRIX_WPMR_WPKEY (0xFFFFFF << 8) /* Write Protect KEY */ 146 - 147 - #define AT91_MATRIX_WPSR 0x1E8 /* Write Protect Status Register */ 148 - #define AT91_MATRIX_WPSR_WPVS (1 << 0) /* Write Protect Violation Status */ 149 - #define AT91_MATRIX_WPSR_NO_WPV (0 << 0) 150 - #define AT91_MATRIX_WPSR_WPV (1 << 0) 151 - #define AT91_MATRIX_WPSR_WPVSRC (0xFFFF << 8) /* Write Protect Violation Source */ 152 - 153 - #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
-53
arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
··· 1 - /* 2 - * Matrix-centric header file for the AT91SAM9N12 3 - * 4 - * Copyright (C) 2012 Atmel Corporation. 5 - * 6 - * Only EBI related registers. 7 - * Write Protect register definitions may be useful. 8 - * 9 - * Licensed under GPLv2 or later. 10 - */ 11 - 12 - #ifndef _AT91SAM9N12_MATRIX_H_ 13 - #define _AT91SAM9N12_MATRIX_H_ 14 - 15 - #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x118) /* EBI Chip Select Assignment Register */ 16 - #define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */ 17 - #define AT91_MATRIX_EBI_CS1A_SMC (0 << 1) 18 - #define AT91_MATRIX_EBI_CS1A_SDRAMC (1 << 1) 19 - #define AT91_MATRIX_EBI_CS3A (1 << 3) /* Chip Select 3 Assignment */ 20 - #define AT91_MATRIX_EBI_CS3A_SMC (0 << 3) 21 - #define AT91_MATRIX_EBI_CS3A_SMC_NANDFLASH (1 << 3) 22 - #define AT91_MATRIX_EBI_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 23 - #define AT91_MATRIX_EBI_DBPU_ON (0 << 8) 24 - #define AT91_MATRIX_EBI_DBPU_OFF (1 << 8) 25 - #define AT91_MATRIX_EBI_VDDIOMSEL (1 << 16) /* Memory voltage selection */ 26 - #define AT91_MATRIX_EBI_VDDIOMSEL_1_8V (0 << 16) 27 - #define AT91_MATRIX_EBI_VDDIOMSEL_3_3V (1 << 16) 28 - #define AT91_MATRIX_EBI_EBI_IOSR (1 << 17) /* EBI I/O slew rate selection */ 29 - #define AT91_MATRIX_EBI_EBI_IOSR_REDUCED (0 << 17) 30 - #define AT91_MATRIX_EBI_EBI_IOSR_NORMAL (1 << 17) 31 - #define AT91_MATRIX_EBI_DDR_IOSR (1 << 18) /* DDR2 dedicated port I/O slew rate selection */ 32 - #define AT91_MATRIX_EBI_DDR_IOSR_REDUCED (0 << 18) 33 - #define AT91_MATRIX_EBI_DDR_IOSR_NORMAL (1 << 18) 34 - #define AT91_MATRIX_NFD0_SELECT (1 << 24) /* NAND Flash Data Bus Selection */ 35 - #define AT91_MATRIX_NFD0_ON_D0 (0 << 24) 36 - #define AT91_MATRIX_NFD0_ON_D16 (1 << 24) 37 - #define AT91_MATRIX_DDR_MP_EN (1 << 25) /* DDR Multi-port Enable */ 38 - #define AT91_MATRIX_MP_OFF (0 << 25) 39 - #define AT91_MATRIX_MP_ON (1 << 25) 40 - 41 - #define AT91_MATRIX_WPMR (AT91_MATRIX + 0x1E4) /* Write Protect Mode Register */ 42 - #define AT91_MATRIX_WPMR_WPEN (1 << 0) /* Write Protect ENable */ 43 - #define AT91_MATRIX_WPMR_WP_WPDIS (0 << 0) 44 - #define AT91_MATRIX_WPMR_WP_WPEN (1 << 0) 45 - #define AT91_MATRIX_WPMR_WPKEY (0xFFFFFF << 8) /* Write Protect KEY */ 46 - 47 - #define AT91_MATRIX_WPSR (AT91_MATRIX + 0x1E8) /* Write Protect Status Register */ 48 - #define AT91_MATRIX_WPSR_WPVS (1 << 0) /* Write Protect Violation Status */ 49 - #define AT91_MATRIX_WPSR_NO_WPV (0 << 0) 50 - #define AT91_MATRIX_WPSR_WPV (1 << 0) 51 - #define AT91_MATRIX_WPSR_WPVSRC (0xFFFF << 8) /* Write Protect Violation Source */ 52 - 53 - #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
-96
arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h 3 - * 4 - * Copyright (C) 2007 Atmel Corporation 5 - * 6 - * Memory Controllers (MATRIX, EBI) - System peripherals registers. 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_MATRIX_H 15 - #define AT91SAM9RL_MATRIX_H 16 - 17 - #define AT91_MATRIX_MCFG0 0x00 /* Master Configuration Register 0 */ 18 - #define AT91_MATRIX_MCFG1 0x04 /* Master Configuration Register 1 */ 19 - #define AT91_MATRIX_MCFG2 0x08 /* Master Configuration Register 2 */ 20 - #define AT91_MATRIX_MCFG3 0x0C /* Master Configuration Register 3 */ 21 - #define AT91_MATRIX_MCFG4 0x10 /* Master Configuration Register 4 */ 22 - #define AT91_MATRIX_MCFG5 0x14 /* Master Configuration Register 5 */ 23 - #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ 24 - #define AT91_MATRIX_ULBT_INFINITE (0 << 0) 25 - #define AT91_MATRIX_ULBT_SINGLE (1 << 0) 26 - #define AT91_MATRIX_ULBT_FOUR (2 << 0) 27 - #define AT91_MATRIX_ULBT_EIGHT (3 << 0) 28 - #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) 29 - 30 - #define AT91_MATRIX_SCFG0 0x40 /* Slave Configuration Register 0 */ 31 - #define AT91_MATRIX_SCFG1 0x44 /* Slave Configuration Register 1 */ 32 - #define AT91_MATRIX_SCFG2 0x48 /* Slave Configuration Register 2 */ 33 - #define AT91_MATRIX_SCFG3 0x4C /* Slave Configuration Register 3 */ 34 - #define AT91_MATRIX_SCFG4 0x50 /* Slave Configuration Register 4 */ 35 - #define AT91_MATRIX_SCFG5 0x54 /* Slave Configuration Register 5 */ 36 - #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ 37 - #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ 38 - #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) 39 - #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) 40 - #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) 41 - #define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */ 42 - #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ 43 - #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) 44 - #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) 45 - 46 - #define AT91_MATRIX_PRAS0 0x80 /* Priority Register A for Slave 0 */ 47 - #define AT91_MATRIX_PRAS1 0x88 /* Priority Register A for Slave 1 */ 48 - #define AT91_MATRIX_PRAS2 0x90 /* Priority Register A for Slave 2 */ 49 - #define AT91_MATRIX_PRAS3 0x98 /* Priority Register A for Slave 3 */ 50 - #define AT91_MATRIX_PRAS4 0xA0 /* Priority Register A for Slave 4 */ 51 - #define AT91_MATRIX_PRAS5 0xA8 /* Priority Register A for Slave 5 */ 52 - #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ 53 - #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ 54 - #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ 55 - #define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */ 56 - #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ 57 - #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ 58 - 59 - #define AT91_MATRIX_MRCR 0x100 /* Master Remap Control Register */ 60 - #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 61 - #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 62 - #define AT91_MATRIX_RCB2 (1 << 2) 63 - #define AT91_MATRIX_RCB3 (1 << 3) 64 - #define AT91_MATRIX_RCB4 (1 << 4) 65 - #define AT91_MATRIX_RCB5 (1 << 5) 66 - 67 - #define AT91_MATRIX_TCMR 0x114 /* TCM Configuration Register */ 68 - #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ 69 - #define AT91_MATRIX_ITCM_0 (0 << 0) 70 - #define AT91_MATRIX_ITCM_16 (5 << 0) 71 - #define AT91_MATRIX_ITCM_32 (6 << 0) 72 - #define AT91_MATRIX_DTCM_SIZE (0xf << 4) /* Size of DTCM enabled memory block */ 73 - #define AT91_MATRIX_DTCM_0 (0 << 4) 74 - #define AT91_MATRIX_DTCM_16 (5 << 4) 75 - #define AT91_MATRIX_DTCM_32 (6 << 4) 76 - 77 - #define AT91_MATRIX_EBICSA 0x120 /* EBI0 Chip Select Assignment Register */ 78 - #define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ 79 - #define AT91_MATRIX_CS1A_SMC (0 << 1) 80 - #define AT91_MATRIX_CS1A_SDRAMC (1 << 1) 81 - #define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */ 82 - #define AT91_MATRIX_CS3A_SMC (0 << 3) 83 - #define AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3) 84 - #define AT91_MATRIX_CS4A (1 << 4) /* Chip Select 4 Assignment */ 85 - #define AT91_MATRIX_CS4A_SMC (0 << 4) 86 - #define AT91_MATRIX_CS4A_SMC_CF1 (1 << 4) 87 - #define AT91_MATRIX_CS5A (1 << 5) /* Chip Select 5 Assignment */ 88 - #define AT91_MATRIX_CS5A_SMC (0 << 5) 89 - #define AT91_MATRIX_CS5A_SMC_CF2 (1 << 5) 90 - #define AT91_MATRIX_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 91 - #define AT91_MATRIX_VDDIOMSEL (1 << 16) /* Memory voltage selection */ 92 - #define AT91_MATRIX_VDDIOMSEL_1_8V (0 << 16) 93 - #define AT91_MATRIX_VDDIOMSEL_3_3V (1 << 16) 94 - 95 - 96 - #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
-53
arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
··· 1 - /* 2 - * Matrix-centric header file for the AT91SAM9x5 family 3 - * 4 - * Copyright (C) 2009-2012 Atmel Corporation. 5 - * 6 - * Only EBI related registers. 7 - * Write Protect register definitions may be useful. 8 - * 9 - * Licensed under GPLv2 or later. 10 - */ 11 - 12 - #ifndef AT91SAM9X5_MATRIX_H 13 - #define AT91SAM9X5_MATRIX_H 14 - 15 - #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x120) /* EBI Chip Select Assignment Register */ 16 - #define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */ 17 - #define AT91_MATRIX_EBI_CS1A_SMC (0 << 1) 18 - #define AT91_MATRIX_EBI_CS1A_SDRAMC (1 << 1) 19 - #define AT91_MATRIX_EBI_CS3A (1 << 3) /* Chip Select 3 Assignment */ 20 - #define AT91_MATRIX_EBI_CS3A_SMC (0 << 3) 21 - #define AT91_MATRIX_EBI_CS3A_SMC_NANDFLASH (1 << 3) 22 - #define AT91_MATRIX_EBI_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ 23 - #define AT91_MATRIX_EBI_DBPU_ON (0 << 8) 24 - #define AT91_MATRIX_EBI_DBPU_OFF (1 << 8) 25 - #define AT91_MATRIX_EBI_VDDIOMSEL (1 << 16) /* Memory voltage selection */ 26 - #define AT91_MATRIX_EBI_VDDIOMSEL_1_8V (0 << 16) 27 - #define AT91_MATRIX_EBI_VDDIOMSEL_3_3V (1 << 16) 28 - #define AT91_MATRIX_EBI_EBI_IOSR (1 << 17) /* EBI I/O slew rate selection */ 29 - #define AT91_MATRIX_EBI_EBI_IOSR_REDUCED (0 << 17) 30 - #define AT91_MATRIX_EBI_EBI_IOSR_NORMAL (1 << 17) 31 - #define AT91_MATRIX_EBI_DDR_IOSR (1 << 18) /* DDR2 dedicated port I/O slew rate selection */ 32 - #define AT91_MATRIX_EBI_DDR_IOSR_REDUCED (0 << 18) 33 - #define AT91_MATRIX_EBI_DDR_IOSR_NORMAL (1 << 18) 34 - #define AT91_MATRIX_NFD0_SELECT (1 << 24) /* NAND Flash Data Bus Selection */ 35 - #define AT91_MATRIX_NFD0_ON_D0 (0 << 24) 36 - #define AT91_MATRIX_NFD0_ON_D16 (1 << 24) 37 - #define AT91_MATRIX_DDR_MP_EN (1 << 25) /* DDR Multi-port Enable */ 38 - #define AT91_MATRIX_MP_OFF (0 << 25) 39 - #define AT91_MATRIX_MP_ON (1 << 25) 40 - 41 - #define AT91_MATRIX_WPMR (AT91_MATRIX + 0x1E4) /* Write Protect Mode Register */ 42 - #define AT91_MATRIX_WPMR_WPEN (1 << 0) /* Write Protect ENable */ 43 - #define AT91_MATRIX_WPMR_WP_WPDIS (0 << 0) 44 - #define AT91_MATRIX_WPMR_WP_WPEN (1 << 0) 45 - #define AT91_MATRIX_WPMR_WPKEY (0xFFFFFF << 8) /* Write Protect KEY */ 46 - 47 - #define AT91_MATRIX_WPSR (AT91_MATRIX + 0x1E8) /* Write Protect Status Register */ 48 - #define AT91_MATRIX_WPSR_WPVS (1 << 0) /* Write Protect Violation Status */ 49 - #define AT91_MATRIX_WPSR_NO_WPV (0 << 0) 50 - #define AT91_MATRIX_WPSR_WPV (1 << 0) 51 - #define AT91_MATRIX_WPSR_WPVSRC (0xFFFF << 8) /* Write Protect Violation Source */ 52 - 53 - #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
-27
arch/arm/mach-at91/include/mach/io.h
··· 1 - /* 2 - * arch/arm/mach-at91/include/mach/io.h 3 - * 4 - * Copyright (C) 2003 SAN People 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, or 9 - * (at your option) any later version. 10 - * 11 - * This program is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - * GNU General Public License for more details. 15 - * 16 - * You should have received a copy of the GNU General Public License 17 - * along with this program; if not, write to the Free Software 18 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 - */ 20 - 21 - #ifndef __ASM_ARCH_IO_H 22 - #define __ASM_ARCH_IO_H 23 - 24 - #define IO_SPACE_LIMIT 0xFFFFFFFF 25 - #define __io(a) __typesafe_io(a) 26 - 27 - #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
+87 -88
arch/arm/mach-at91/pm.c
··· 29 29 #include <linux/atomic.h> 30 30 #include <asm/mach/time.h> 31 31 #include <asm/mach/irq.h> 32 - 33 - #include <mach/cpu.h> 34 - #include <mach/hardware.h> 32 + #include <asm/fncpy.h> 33 + #include <asm/cacheflush.h> 35 34 36 35 #include "generic.h" 37 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); 38 46 39 47 static struct { 40 48 unsigned long uhp_udp_mask; 41 49 int memctrl; 42 50 } at91_pm_data; 43 51 44 - static void (*at91_pm_standby)(void); 45 52 void __iomem *at91_ramc_base[2]; 46 53 47 54 static int at91_pm_valid_state(suspend_state_t state) ··· 126 119 } 127 120 EXPORT_SYMBOL(at91_suspend_entering_slow_clock); 128 121 129 - 130 - static void (*slow_clock)(void __iomem *pmc, void __iomem *ramc0, 122 + static void (*at91_suspend_sram_fn)(void __iomem *pmc, void __iomem *ramc0, 131 123 void __iomem *ramc1, int memctrl); 132 124 133 - #ifdef CONFIG_AT91_SLOW_CLOCK 134 - extern void at91_slow_clock(void __iomem *pmc, void __iomem *ramc0, 125 + extern void at91_pm_suspend_in_sram(void __iomem *pmc, void __iomem *ramc0, 135 126 void __iomem *ramc1, int memctrl); 136 - extern u32 at91_slow_clock_sz; 137 - #endif 127 + extern u32 at91_pm_suspend_in_sram_sz; 128 + 129 + static void at91_pm_suspend(suspend_state_t state) 130 + { 131 + unsigned int pm_data = at91_pm_data.memctrl; 132 + 133 + pm_data |= (state == PM_SUSPEND_MEM) ? 134 + AT91_PM_MODE(AT91_PM_SLOW_CLOCK) : 0; 135 + 136 + flush_cache_all(); 137 + outer_disable(); 138 + 139 + at91_suspend_sram_fn(at91_pmc_base, at91_ramc_base[0], 140 + at91_ramc_base[1], pm_data); 141 + 142 + outer_resume(); 143 + } 138 144 139 145 static int at91_pm_enter(suspend_state_t state) 140 146 { 141 147 at91_pinctrl_gpio_suspend(); 142 148 143 149 switch (state) { 150 + /* 151 + * Suspend-to-RAM is like STANDBY plus slow clock mode, so 152 + * drivers must suspend more deeply, the master clock switches 153 + * to the clk32k and turns off the main oscillator 154 + */ 155 + case PM_SUSPEND_MEM: 144 156 /* 145 - * Suspend-to-RAM is like STANDBY plus slow clock mode, so 146 - * drivers must suspend more deeply: only the master clock 147 - * controller may be using the main oscillator. 157 + * Ensure that clocks are in a valid state. 148 158 */ 149 - case PM_SUSPEND_MEM: 150 - /* 151 - * Ensure that clocks are in a valid state. 152 - */ 153 - if (!at91_pm_verify_clocks()) 154 - goto error; 155 - 156 - /* 157 - * Enter slow clock mode by switching over to clk32k and 158 - * turning off the main oscillator; reverse on wakeup. 159 - */ 160 - if (slow_clock) { 161 - #ifdef CONFIG_AT91_SLOW_CLOCK 162 - /* copy slow_clock handler to SRAM, and call it */ 163 - memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz); 164 - #endif 165 - slow_clock(at91_pmc_base, at91_ramc_base[0], 166 - at91_ramc_base[1], 167 - at91_pm_data.memctrl); 168 - break; 169 - } else { 170 - pr_info("AT91: PM - no slow clock mode enabled ...\n"); 171 - /* FALLTHROUGH leaving master clock alone */ 172 - } 173 - 174 - /* 175 - * STANDBY mode has *all* drivers suspended; ignores irqs not 176 - * marked as 'wakeup' event sources; and reduces DRAM power. 177 - * But otherwise it's identical to PM_SUSPEND_ON: cpu idle, and 178 - * nothing fancy done with main or cpu clocks. 179 - */ 180 - case PM_SUSPEND_STANDBY: 181 - /* 182 - * NOTE: the Wait-for-Interrupt instruction needs to be 183 - * in icache so no SDRAM accesses are needed until the 184 - * wakeup IRQ occurs and self-refresh is terminated. 185 - * For ARM 926 based chips, this requirement is weaker 186 - * as at91sam9 can access a RAM in self-refresh mode. 187 - */ 188 - if (at91_pm_standby) 189 - at91_pm_standby(); 190 - break; 191 - 192 - case PM_SUSPEND_ON: 193 - cpu_do_idle(); 194 - break; 195 - 196 - default: 197 - pr_debug("AT91: PM - bogus suspend state %d\n", state); 159 + if (!at91_pm_verify_clocks()) 198 160 goto error; 161 + 162 + at91_pm_suspend(state); 163 + 164 + break; 165 + 166 + /* 167 + * STANDBY mode has *all* drivers suspended; ignores irqs not 168 + * marked as 'wakeup' event sources; and reduces DRAM power. 169 + * But otherwise it's identical to PM_SUSPEND_ON: cpu idle, and 170 + * nothing fancy done with main or cpu clocks. 171 + */ 172 + case PM_SUSPEND_STANDBY: 173 + at91_pm_suspend(state); 174 + break; 175 + 176 + case PM_SUSPEND_ON: 177 + cpu_do_idle(); 178 + break; 179 + 180 + default: 181 + pr_debug("AT91: PM - bogus suspend state %d\n", state); 182 + goto error; 199 183 } 200 184 201 185 error: ··· 216 218 .name = "cpuidle-at91", 217 219 }; 218 220 219 - void at91_pm_set_standby(void (*at91_standby)(void)) 221 + static void at91_pm_set_standby(void (*at91_standby)(void)) 220 222 { 221 - if (at91_standby) { 223 + if (at91_standby) 222 224 at91_cpuidle_device.dev.platform_data = at91_standby; 223 - at91_pm_standby = at91_standby; 224 - } 225 225 } 226 226 227 227 static const struct of_device_id ramc_ids[] __initconst = { ··· 259 263 at91_pm_set_standby(standby); 260 264 } 261 265 262 - #ifdef CONFIG_AT91_SLOW_CLOCK 263 266 static void __init at91_pm_sram_init(void) 264 267 { 265 268 struct gen_pool *sram_pool; 266 269 phys_addr_t sram_pbase; 267 270 unsigned long sram_base; 268 271 struct device_node *node; 269 - struct platform_device *pdev; 272 + struct platform_device *pdev = NULL; 270 273 271 - node = of_find_compatible_node(NULL, NULL, "mmio-sram"); 272 - if (!node) { 273 - pr_warn("%s: failed to find sram node!\n", __func__); 274 - return; 274 + for_each_compatible_node(node, NULL, "mmio-sram") { 275 + pdev = of_find_device_by_node(node); 276 + if (pdev) { 277 + of_node_put(node); 278 + break; 279 + } 275 280 } 276 281 277 - pdev = of_find_device_by_node(node); 278 282 if (!pdev) { 279 283 pr_warn("%s: failed to find sram device!\n", __func__); 280 - goto put_node; 284 + return; 281 285 } 282 286 283 287 sram_pool = dev_get_gen_pool(&pdev->dev); 284 288 if (!sram_pool) { 285 289 pr_warn("%s: sram pool unavailable!\n", __func__); 286 - goto put_node; 290 + return; 287 291 } 288 292 289 - sram_base = gen_pool_alloc(sram_pool, at91_slow_clock_sz); 293 + sram_base = gen_pool_alloc(sram_pool, at91_pm_suspend_in_sram_sz); 290 294 if (!sram_base) { 291 - pr_warn("%s: unable to alloc ocram!\n", __func__); 292 - goto put_node; 295 + pr_warn("%s: unable to alloc sram!\n", __func__); 296 + return; 293 297 } 294 298 295 299 sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base); 296 - slow_clock = __arm_ioremap_exec(sram_pbase, at91_slow_clock_sz, false); 300 + at91_suspend_sram_fn = __arm_ioremap_exec(sram_pbase, 301 + at91_pm_suspend_in_sram_sz, false); 302 + if (!at91_suspend_sram_fn) { 303 + pr_warn("SRAM: Could not map\n"); 304 + return; 305 + } 297 306 298 - put_node: 299 - of_node_put(node); 307 + /* Copy the pm suspend handler to SRAM */ 308 + at91_suspend_sram_fn = fncpy(at91_suspend_sram_fn, 309 + &at91_pm_suspend_in_sram, at91_pm_suspend_in_sram_sz); 300 310 } 301 - #endif 302 - 303 311 304 312 static void __init at91_pm_init(void) 305 313 { 306 - #ifdef CONFIG_AT91_SLOW_CLOCK 307 314 at91_pm_sram_init(); 308 - #endif 309 - 310 - pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : "")); 311 315 312 316 if (at91_cpuidle_device.dev.platform_data) 313 317 platform_device_register(&at91_cpuidle_device); 314 318 315 - suspend_set_ops(&at91_pm_ops); 319 + if (at91_suspend_sram_fn) 320 + suspend_set_ops(&at91_pm_ops); 321 + else 322 + pr_info("AT91: PM not supported, due to no SRAM allocated\n"); 316 323 } 317 324 318 325 void __init at91rm9200_pm_init(void)
+10 -6
arch/arm/mach-at91/pm.h
··· 15 15 16 16 #include <mach/at91_ramc.h> 17 17 18 - #ifdef CONFIG_PM 19 - extern void at91_pm_set_standby(void (*at91_standby)(void)); 20 - #else 21 - static inline void at91_pm_set_standby(void (*at91_standby)(void)) { } 22 - #endif 18 + #define AT91_PM_MEMTYPE_MASK 0x0f 19 + 20 + #define AT91_PM_MODE_OFFSET 4 21 + #define AT91_PM_MODE_MASK 0x01 22 + #define AT91_PM_MODE(x) (((x) & AT91_PM_MODE_MASK) << AT91_PM_MODE_OFFSET) 23 + 24 + #define AT91_PM_SLOW_CLOCK 0x01 23 25 24 26 /* 25 27 * The AT91RM9200 goes into self-refresh mode with this command, and will ··· 33 31 * still in self-refresh is "not recommended", but seems to work. 34 32 */ 35 33 34 + #ifndef __ASSEMBLY__ 36 35 static inline void at91rm9200_standby(void) 37 36 { 38 37 u32 lpr = at91_ramc_read(0, AT91RM9200_SDRAMC_LPR); ··· 47 44 " mcr p15, 0, %0, c7, c0, 4\n\t" 48 45 " str %5, [%1, %2]" 49 46 : 50 - : "r" (0), "r" (AT91_BASE_SYS), "r" (AT91RM9200_SDRAMC_LPR), 47 + : "r" (0), "r" (at91_ramc_base[0]), "r" (AT91RM9200_SDRAMC_LPR), 51 48 "r" (1), "r" (AT91RM9200_SDRAMC_SRR), 52 49 "r" (lpr)); 53 50 } ··· 114 111 at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1); 115 112 } 116 113 114 + #endif 117 115 #endif
-323
arch/arm/mach-at91/pm_slowclock.S
··· 1 - /* 2 - * arch/arm/mach-at91/pm_slow_clock.S 3 - * 4 - * Copyright (C) 2006 Savin Zlobec 5 - * 6 - * AT91SAM9 support: 7 - * Copyright (C) 2007 Anti Sullin <anti.sullin@artecdesign.ee 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 version 2 as 11 - * published by the Free Software Foundation. 12 - * 13 - */ 14 - 15 - #include <linux/linkage.h> 16 - #include <linux/clk/at91_pmc.h> 17 - #include <mach/hardware.h> 18 - #include <mach/at91_ramc.h> 19 - 20 - /* 21 - * When SLOWDOWN_MASTER_CLOCK is defined we will also slow down the Master 22 - * clock during suspend by adjusting its prescalar and divisor. 23 - * NOTE: This hasn't been shown to be stable on SAM9s; and on the RM9200 there 24 - * are errata regarding adjusting the prescalar and divisor. 25 - */ 26 - #undef SLOWDOWN_MASTER_CLOCK 27 - 28 - #define MCKRDY_TIMEOUT 1000 29 - #define MOSCRDY_TIMEOUT 1000 30 - #define PLLALOCK_TIMEOUT 1000 31 - #define PLLBLOCK_TIMEOUT 1000 32 - 33 - pmc .req r0 34 - sdramc .req r1 35 - ramc1 .req r2 36 - memctrl .req r3 37 - tmp1 .req r4 38 - tmp2 .req r5 39 - 40 - /* 41 - * Wait until master clock is ready (after switching master clock source) 42 - */ 43 - .macro wait_mckrdy 44 - mov tmp2, #MCKRDY_TIMEOUT 45 - 1: sub tmp2, tmp2, #1 46 - cmp tmp2, #0 47 - beq 2f 48 - ldr tmp1, [pmc, #AT91_PMC_SR] 49 - tst tmp1, #AT91_PMC_MCKRDY 50 - beq 1b 51 - 2: 52 - .endm 53 - 54 - /* 55 - * Wait until master oscillator has stabilized. 56 - */ 57 - .macro wait_moscrdy 58 - mov tmp2, #MOSCRDY_TIMEOUT 59 - 1: sub tmp2, tmp2, #1 60 - cmp tmp2, #0 61 - beq 2f 62 - ldr tmp1, [pmc, #AT91_PMC_SR] 63 - tst tmp1, #AT91_PMC_MOSCS 64 - beq 1b 65 - 2: 66 - .endm 67 - 68 - /* 69 - * Wait until PLLA has locked. 70 - */ 71 - .macro wait_pllalock 72 - mov tmp2, #PLLALOCK_TIMEOUT 73 - 1: sub tmp2, tmp2, #1 74 - cmp tmp2, #0 75 - beq 2f 76 - ldr tmp1, [pmc, #AT91_PMC_SR] 77 - tst tmp1, #AT91_PMC_LOCKA 78 - beq 1b 79 - 2: 80 - .endm 81 - 82 - /* 83 - * Wait until PLLB has locked. 84 - */ 85 - .macro wait_pllblock 86 - mov tmp2, #PLLBLOCK_TIMEOUT 87 - 1: sub tmp2, tmp2, #1 88 - cmp tmp2, #0 89 - beq 2f 90 - ldr tmp1, [pmc, #AT91_PMC_SR] 91 - tst tmp1, #AT91_PMC_LOCKB 92 - beq 1b 93 - 2: 94 - .endm 95 - 96 - .text 97 - 98 - /* void at91_slow_clock(void __iomem *pmc, void __iomem *sdramc, 99 - * void __iomem *ramc1, int memctrl) 100 - */ 101 - ENTRY(at91_slow_clock) 102 - /* Save registers on stack */ 103 - stmfd sp!, {r4 - r12, lr} 104 - 105 - /* 106 - * Register usage: 107 - * R0 = Base address of AT91_PMC 108 - * R1 = Base address of RAM Controller (SDRAM, DDRSDR, or AT91_SYS) 109 - * R2 = Base address of second RAM Controller or 0 if not present 110 - * R3 = Memory controller 111 - * R4 = temporary register 112 - * R5 = temporary register 113 - */ 114 - 115 - /* Drain write buffer */ 116 - mov tmp1, #0 117 - mcr p15, 0, tmp1, c7, c10, 4 118 - 119 - cmp memctrl, #AT91_MEMCTRL_MC 120 - bne ddr_sr_enable 121 - 122 - /* 123 - * at91rm9200 Memory controller 124 - */ 125 - /* Put SDRAM in self-refresh mode */ 126 - mov tmp1, #1 127 - str tmp1, [sdramc, #AT91RM9200_SDRAMC_SRR] 128 - b sdr_sr_done 129 - 130 - /* 131 - * DDRSDR Memory controller 132 - */ 133 - ddr_sr_enable: 134 - cmp memctrl, #AT91_MEMCTRL_DDRSDR 135 - bne sdr_sr_enable 136 - 137 - /* prepare for DDRAM self-refresh mode */ 138 - ldr tmp1, [sdramc, #AT91_DDRSDRC_LPR] 139 - str tmp1, .saved_sam9_lpr 140 - bic tmp1, #AT91_DDRSDRC_LPCB 141 - orr tmp1, #AT91_DDRSDRC_LPCB_SELF_REFRESH 142 - 143 - /* figure out if we use the second ram controller */ 144 - cmp ramc1, #0 145 - ldrne tmp2, [ramc1, #AT91_DDRSDRC_LPR] 146 - strne tmp2, .saved_sam9_lpr1 147 - bicne tmp2, #AT91_DDRSDRC_LPCB 148 - orrne tmp2, #AT91_DDRSDRC_LPCB_SELF_REFRESH 149 - 150 - /* Enable DDRAM self-refresh mode */ 151 - str tmp1, [sdramc, #AT91_DDRSDRC_LPR] 152 - strne tmp2, [ramc1, #AT91_DDRSDRC_LPR] 153 - 154 - b sdr_sr_done 155 - 156 - /* 157 - * SDRAMC Memory controller 158 - */ 159 - sdr_sr_enable: 160 - /* Enable SDRAM self-refresh mode */ 161 - ldr tmp1, [sdramc, #AT91_SDRAMC_LPR] 162 - str tmp1, .saved_sam9_lpr 163 - 164 - bic tmp1, #AT91_SDRAMC_LPCB 165 - orr tmp1, #AT91_SDRAMC_LPCB_SELF_REFRESH 166 - str tmp1, [sdramc, #AT91_SDRAMC_LPR] 167 - 168 - sdr_sr_done: 169 - /* Save Master clock setting */ 170 - ldr tmp1, [pmc, #AT91_PMC_MCKR] 171 - str tmp1, .saved_mckr 172 - 173 - /* 174 - * Set the Master clock source to slow clock 175 - */ 176 - bic tmp1, tmp1, #AT91_PMC_CSS 177 - str tmp1, [pmc, #AT91_PMC_MCKR] 178 - 179 - wait_mckrdy 180 - 181 - #ifdef SLOWDOWN_MASTER_CLOCK 182 - /* 183 - * Set the Master Clock PRES and MDIV fields. 184 - * 185 - * See AT91RM9200 errata #27 and #28 for details. 186 - */ 187 - mov tmp1, #0 188 - str tmp1, [pmc, #AT91_PMC_MCKR] 189 - 190 - wait_mckrdy 191 - #endif 192 - 193 - /* Save PLLA setting and disable it */ 194 - ldr tmp1, [pmc, #AT91_CKGR_PLLAR] 195 - str tmp1, .saved_pllar 196 - 197 - mov tmp1, #AT91_PMC_PLLCOUNT 198 - orr tmp1, tmp1, #(1 << 29) /* bit 29 always set */ 199 - str tmp1, [pmc, #AT91_CKGR_PLLAR] 200 - 201 - /* Save PLLB setting and disable it */ 202 - ldr tmp1, [pmc, #AT91_CKGR_PLLBR] 203 - str tmp1, .saved_pllbr 204 - 205 - mov tmp1, #AT91_PMC_PLLCOUNT 206 - str tmp1, [pmc, #AT91_CKGR_PLLBR] 207 - 208 - /* Turn off the main oscillator */ 209 - ldr tmp1, [pmc, #AT91_CKGR_MOR] 210 - bic tmp1, tmp1, #AT91_PMC_MOSCEN 211 - str tmp1, [pmc, #AT91_CKGR_MOR] 212 - 213 - /* Wait for interrupt */ 214 - mcr p15, 0, tmp1, c7, c0, 4 215 - 216 - /* Turn on the main oscillator */ 217 - ldr tmp1, [pmc, #AT91_CKGR_MOR] 218 - orr tmp1, tmp1, #AT91_PMC_MOSCEN 219 - str tmp1, [pmc, #AT91_CKGR_MOR] 220 - 221 - wait_moscrdy 222 - 223 - /* Restore PLLB setting */ 224 - ldr tmp1, .saved_pllbr 225 - str tmp1, [pmc, #AT91_CKGR_PLLBR] 226 - 227 - tst tmp1, #(AT91_PMC_MUL & 0xff0000) 228 - bne 1f 229 - tst tmp1, #(AT91_PMC_MUL & ~0xff0000) 230 - beq 2f 231 - 1: 232 - wait_pllblock 233 - 2: 234 - 235 - /* Restore PLLA setting */ 236 - ldr tmp1, .saved_pllar 237 - str tmp1, [pmc, #AT91_CKGR_PLLAR] 238 - 239 - tst tmp1, #(AT91_PMC_MUL & 0xff0000) 240 - bne 3f 241 - tst tmp1, #(AT91_PMC_MUL & ~0xff0000) 242 - beq 4f 243 - 3: 244 - wait_pllalock 245 - 4: 246 - 247 - #ifdef SLOWDOWN_MASTER_CLOCK 248 - /* 249 - * First set PRES if it was not 0, 250 - * than set CSS and MDIV fields. 251 - * 252 - * See AT91RM9200 errata #27 and #28 for details. 253 - */ 254 - ldr tmp1, .saved_mckr 255 - tst tmp1, #AT91_PMC_PRES 256 - beq 2f 257 - and tmp1, tmp1, #AT91_PMC_PRES 258 - str tmp1, [pmc, #AT91_PMC_MCKR] 259 - 260 - wait_mckrdy 261 - #endif 262 - 263 - /* 264 - * Restore master clock setting 265 - */ 266 - 2: ldr tmp1, .saved_mckr 267 - str tmp1, [pmc, #AT91_PMC_MCKR] 268 - 269 - wait_mckrdy 270 - 271 - /* 272 - * at91rm9200 Memory controller 273 - * Do nothing - self-refresh is automatically disabled. 274 - */ 275 - cmp memctrl, #AT91_MEMCTRL_MC 276 - beq ram_restored 277 - 278 - /* 279 - * DDRSDR Memory controller 280 - */ 281 - cmp memctrl, #AT91_MEMCTRL_DDRSDR 282 - bne sdr_en_restore 283 - /* Restore LPR on AT91 with DDRAM */ 284 - ldr tmp1, .saved_sam9_lpr 285 - str tmp1, [sdramc, #AT91_DDRSDRC_LPR] 286 - 287 - /* if we use the second ram controller */ 288 - cmp ramc1, #0 289 - ldrne tmp2, .saved_sam9_lpr1 290 - strne tmp2, [ramc1, #AT91_DDRSDRC_LPR] 291 - 292 - b ram_restored 293 - 294 - /* 295 - * SDRAMC Memory controller 296 - */ 297 - sdr_en_restore: 298 - /* Restore LPR on AT91 with SDRAM */ 299 - ldr tmp1, .saved_sam9_lpr 300 - str tmp1, [sdramc, #AT91_SDRAMC_LPR] 301 - 302 - ram_restored: 303 - /* Restore registers, and return */ 304 - ldmfd sp!, {r4 - r12, pc} 305 - 306 - 307 - .saved_mckr: 308 - .word 0 309 - 310 - .saved_pllar: 311 - .word 0 312 - 313 - .saved_pllbr: 314 - .word 0 315 - 316 - .saved_sam9_lpr: 317 - .word 0 318 - 319 - .saved_sam9_lpr1: 320 - .word 0 321 - 322 - ENTRY(at91_slow_clock_sz) 323 - .word .-at91_slow_clock
+337
arch/arm/mach-at91/pm_suspend.S
··· 1 + /* 2 + * arch/arm/mach-at91/pm_slow_clock.S 3 + * 4 + * Copyright (C) 2006 Savin Zlobec 5 + * 6 + * AT91SAM9 support: 7 + * Copyright (C) 2007 Anti Sullin <anti.sullin@artecdesign.ee 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 version 2 as 11 + * published by the Free Software Foundation. 12 + * 13 + */ 14 + #include <linux/linkage.h> 15 + #include <linux/clk/at91_pmc.h> 16 + #include <mach/at91_ramc.h> 17 + #include "pm.h" 18 + 19 + #define SRAMC_SELF_FRESH_ACTIVE 0x01 20 + #define SRAMC_SELF_FRESH_EXIT 0x00 21 + 22 + pmc .req r0 23 + tmp1 .req r4 24 + tmp2 .req r5 25 + 26 + /* 27 + * Wait until master clock is ready (after switching master clock source) 28 + */ 29 + .macro wait_mckrdy 30 + 1: ldr tmp1, [pmc, #AT91_PMC_SR] 31 + tst tmp1, #AT91_PMC_MCKRDY 32 + beq 1b 33 + .endm 34 + 35 + /* 36 + * Wait until master oscillator has stabilized. 37 + */ 38 + .macro wait_moscrdy 39 + 1: ldr tmp1, [pmc, #AT91_PMC_SR] 40 + tst tmp1, #AT91_PMC_MOSCS 41 + beq 1b 42 + .endm 43 + 44 + /* 45 + * Wait until PLLA has locked. 46 + */ 47 + .macro wait_pllalock 48 + 1: ldr tmp1, [pmc, #AT91_PMC_SR] 49 + tst tmp1, #AT91_PMC_LOCKA 50 + beq 1b 51 + .endm 52 + 53 + /* 54 + * Put the processor to enter the idle state 55 + */ 56 + .macro at91_cpu_idle 57 + 58 + #if defined(CONFIG_CPU_V7) 59 + mov tmp1, #AT91_PMC_PCK 60 + str tmp1, [pmc, #AT91_PMC_SCDR] 61 + 62 + dsb 63 + 64 + wfi @ Wait For Interrupt 65 + #else 66 + mcr p15, 0, tmp1, c7, c0, 4 67 + #endif 68 + 69 + .endm 70 + 71 + .text 72 + 73 + .arm 74 + 75 + /* 76 + * void at91_pm_suspend_in_sram(void __iomem *pmc, void __iomem *sdramc, 77 + * void __iomem *ramc1, int memctrl) 78 + * @input param: 79 + * @r0: base address of AT91_PMC 80 + * @r1: base address of SDRAM Controller (SDRAM, DDRSDR, or AT91_SYS) 81 + * @r2: base address of second SDRAM Controller or 0 if not present 82 + * @r3: pm information 83 + */ 84 + ENTRY(at91_pm_suspend_in_sram) 85 + /* Save registers on stack */ 86 + stmfd sp!, {r4 - r12, lr} 87 + 88 + /* Drain write buffer */ 89 + mov tmp1, #0 90 + mcr p15, 0, tmp1, c7, c10, 4 91 + 92 + str r0, .pmc_base 93 + str r1, .sramc_base 94 + str r2, .sramc1_base 95 + 96 + and r0, r3, #AT91_PM_MEMTYPE_MASK 97 + str r0, .memtype 98 + 99 + lsr r0, r3, #AT91_PM_MODE_OFFSET 100 + and r0, r0, #AT91_PM_MODE_MASK 101 + str r0, .pm_mode 102 + 103 + /* Active the self-refresh mode */ 104 + mov r0, #SRAMC_SELF_FRESH_ACTIVE 105 + bl at91_sramc_self_refresh 106 + 107 + ldr r0, .pm_mode 108 + tst r0, #AT91_PM_SLOW_CLOCK 109 + beq skip_disable_main_clock 110 + 111 + ldr pmc, .pmc_base 112 + 113 + /* Save Master clock setting */ 114 + ldr tmp1, [pmc, #AT91_PMC_MCKR] 115 + str tmp1, .saved_mckr 116 + 117 + /* 118 + * Set the Master clock source to slow clock 119 + */ 120 + bic tmp1, tmp1, #AT91_PMC_CSS 121 + str tmp1, [pmc, #AT91_PMC_MCKR] 122 + 123 + wait_mckrdy 124 + 125 + /* Save PLLA setting and disable it */ 126 + ldr tmp1, [pmc, #AT91_CKGR_PLLAR] 127 + str tmp1, .saved_pllar 128 + 129 + mov tmp1, #AT91_PMC_PLLCOUNT 130 + orr tmp1, tmp1, #(1 << 29) /* bit 29 always set */ 131 + str tmp1, [pmc, #AT91_CKGR_PLLAR] 132 + 133 + /* Turn off the main oscillator */ 134 + ldr tmp1, [pmc, #AT91_CKGR_MOR] 135 + bic tmp1, tmp1, #AT91_PMC_MOSCEN 136 + orr tmp1, tmp1, #AT91_PMC_KEY 137 + str tmp1, [pmc, #AT91_CKGR_MOR] 138 + 139 + skip_disable_main_clock: 140 + ldr pmc, .pmc_base 141 + 142 + /* Wait for interrupt */ 143 + at91_cpu_idle 144 + 145 + ldr r0, .pm_mode 146 + tst r0, #AT91_PM_SLOW_CLOCK 147 + beq skip_enable_main_clock 148 + 149 + ldr pmc, .pmc_base 150 + 151 + /* Turn on the main oscillator */ 152 + ldr tmp1, [pmc, #AT91_CKGR_MOR] 153 + orr tmp1, tmp1, #AT91_PMC_MOSCEN 154 + orr tmp1, tmp1, #AT91_PMC_KEY 155 + str tmp1, [pmc, #AT91_CKGR_MOR] 156 + 157 + wait_moscrdy 158 + 159 + /* Restore PLLA setting */ 160 + ldr tmp1, .saved_pllar 161 + str tmp1, [pmc, #AT91_CKGR_PLLAR] 162 + 163 + tst tmp1, #(AT91_PMC_MUL & 0xff0000) 164 + bne 3f 165 + tst tmp1, #(AT91_PMC_MUL & ~0xff0000) 166 + beq 4f 167 + 3: 168 + wait_pllalock 169 + 4: 170 + 171 + /* 172 + * Restore master clock setting 173 + */ 174 + ldr tmp1, .saved_mckr 175 + str tmp1, [pmc, #AT91_PMC_MCKR] 176 + 177 + wait_mckrdy 178 + 179 + skip_enable_main_clock: 180 + /* Exit the self-refresh mode */ 181 + mov r0, #SRAMC_SELF_FRESH_EXIT 182 + bl at91_sramc_self_refresh 183 + 184 + /* Restore registers, and return */ 185 + ldmfd sp!, {r4 - r12, pc} 186 + ENDPROC(at91_pm_suspend_in_sram) 187 + 188 + /* 189 + * void at91_sramc_self_refresh(unsigned int is_active) 190 + * 191 + * @input param: 192 + * @r0: 1 - active self-refresh mode 193 + * 0 - exit self-refresh mode 194 + * register usage: 195 + * @r1: memory type 196 + * @r2: base address of the sram controller 197 + */ 198 + 199 + ENTRY(at91_sramc_self_refresh) 200 + ldr r1, .memtype 201 + ldr r2, .sramc_base 202 + 203 + cmp r1, #AT91_MEMCTRL_MC 204 + bne ddrc_sf 205 + 206 + /* 207 + * at91rm9200 Memory controller 208 + */ 209 + 210 + /* 211 + * For exiting the self-refresh mode, do nothing, 212 + * automatically exit the self-refresh mode. 213 + */ 214 + tst r0, #SRAMC_SELF_FRESH_ACTIVE 215 + beq exit_sramc_sf 216 + 217 + /* Active SDRAM self-refresh mode */ 218 + mov r3, #1 219 + str r3, [r2, #AT91RM9200_SDRAMC_SRR] 220 + b exit_sramc_sf 221 + 222 + ddrc_sf: 223 + cmp r1, #AT91_MEMCTRL_DDRSDR 224 + bne sdramc_sf 225 + 226 + /* 227 + * DDR Memory controller 228 + */ 229 + tst r0, #SRAMC_SELF_FRESH_ACTIVE 230 + beq ddrc_exit_sf 231 + 232 + /* LPDDR1 --> force DDR2 mode during self-refresh */ 233 + ldr r3, [r2, #AT91_DDRSDRC_MDR] 234 + str r3, .saved_sam9_mdr 235 + bic r3, r3, #~AT91_DDRSDRC_MD 236 + cmp r3, #AT91_DDRSDRC_MD_LOW_POWER_DDR 237 + ldreq r3, [r2, #AT91_DDRSDRC_MDR] 238 + biceq r3, r3, #AT91_DDRSDRC_MD 239 + orreq r3, r3, #AT91_DDRSDRC_MD_DDR2 240 + streq r3, [r2, #AT91_DDRSDRC_MDR] 241 + 242 + /* Active DDRC self-refresh mode */ 243 + ldr r3, [r2, #AT91_DDRSDRC_LPR] 244 + str r3, .saved_sam9_lpr 245 + bic r3, r3, #AT91_DDRSDRC_LPCB 246 + orr r3, r3, #AT91_DDRSDRC_LPCB_SELF_REFRESH 247 + str r3, [r2, #AT91_DDRSDRC_LPR] 248 + 249 + /* If using the 2nd ddr controller */ 250 + ldr r2, .sramc1_base 251 + cmp r2, #0 252 + beq no_2nd_ddrc 253 + 254 + ldr r3, [r2, #AT91_DDRSDRC_MDR] 255 + str r3, .saved_sam9_mdr1 256 + bic r3, r3, #~AT91_DDRSDRC_MD 257 + cmp r3, #AT91_DDRSDRC_MD_LOW_POWER_DDR 258 + ldreq r3, [r2, #AT91_DDRSDRC_MDR] 259 + biceq r3, r3, #AT91_DDRSDRC_MD 260 + orreq r3, r3, #AT91_DDRSDRC_MD_DDR2 261 + streq r3, [r2, #AT91_DDRSDRC_MDR] 262 + 263 + /* Active DDRC self-refresh mode */ 264 + ldr r3, [r2, #AT91_DDRSDRC_LPR] 265 + str r3, .saved_sam9_lpr1 266 + bic r3, r3, #AT91_DDRSDRC_LPCB 267 + orr r3, r3, #AT91_DDRSDRC_LPCB_SELF_REFRESH 268 + str r3, [r2, #AT91_DDRSDRC_LPR] 269 + 270 + no_2nd_ddrc: 271 + b exit_sramc_sf 272 + 273 + ddrc_exit_sf: 274 + /* Restore MDR in case of LPDDR1 */ 275 + ldr r3, .saved_sam9_mdr 276 + str r3, [r2, #AT91_DDRSDRC_MDR] 277 + /* Restore LPR on AT91 with DDRAM */ 278 + ldr r3, .saved_sam9_lpr 279 + str r3, [r2, #AT91_DDRSDRC_LPR] 280 + 281 + /* If using the 2nd ddr controller */ 282 + ldr r2, .sramc1_base 283 + cmp r2, #0 284 + ldrne r3, .saved_sam9_mdr1 285 + strne r3, [r2, #AT91_DDRSDRC_MDR] 286 + ldrne r3, .saved_sam9_lpr1 287 + strne r3, [r2, #AT91_DDRSDRC_LPR] 288 + 289 + b exit_sramc_sf 290 + 291 + /* 292 + * SDRAMC Memory controller 293 + */ 294 + sdramc_sf: 295 + tst r0, #SRAMC_SELF_FRESH_ACTIVE 296 + beq sdramc_exit_sf 297 + 298 + /* Active SDRAMC self-refresh mode */ 299 + ldr r3, [r2, #AT91_SDRAMC_LPR] 300 + str r3, .saved_sam9_lpr 301 + bic r3, r3, #AT91_SDRAMC_LPCB 302 + orr r3, r3, #AT91_SDRAMC_LPCB_SELF_REFRESH 303 + str r3, [r2, #AT91_SDRAMC_LPR] 304 + 305 + sdramc_exit_sf: 306 + ldr r3, .saved_sam9_lpr 307 + str r3, [r2, #AT91_SDRAMC_LPR] 308 + 309 + exit_sramc_sf: 310 + mov pc, lr 311 + ENDPROC(at91_sramc_self_refresh) 312 + 313 + .pmc_base: 314 + .word 0 315 + .sramc_base: 316 + .word 0 317 + .sramc1_base: 318 + .word 0 319 + .memtype: 320 + .word 0 321 + .pm_mode: 322 + .word 0 323 + .saved_mckr: 324 + .word 0 325 + .saved_pllar: 326 + .word 0 327 + .saved_sam9_lpr: 328 + .word 0 329 + .saved_sam9_lpr1: 330 + .word 0 331 + .saved_sam9_mdr: 332 + .word 0 333 + .saved_sam9_mdr1: 334 + .word 0 335 + 336 + ENTRY(at91_pm_suspend_in_sram_sz) 337 + .word .-at91_pm_suspend_in_sram
+30 -65
arch/arm/mach-at91/sama5.c
··· 7 7 * Licensed under GPLv2 or later. 8 8 */ 9 9 10 - #include <linux/types.h> 11 - #include <linux/init.h> 12 - #include <linux/module.h> 13 - #include <linux/gpio.h> 14 - #include <linux/micrel_phy.h> 15 10 #include <linux/of.h> 16 - #include <linux/of_irq.h> 17 11 #include <linux/of_platform.h> 18 - #include <linux/phy.h> 19 - #include <linux/clk-provider.h> 20 - #include <linux/phy.h> 21 12 22 - #include <mach/hardware.h> 23 - 24 - #include <asm/setup.h> 25 - #include <asm/irq.h> 26 13 #include <asm/mach/arch.h> 27 14 #include <asm/mach/map.h> 28 - #include <asm/mach/irq.h> 15 + #include <asm/system_misc.h> 29 16 30 17 #include "generic.h" 18 + #include "soc.h" 31 19 32 - static int ksz8081_phy_fixup(struct phy_device *phy) 33 - { 34 - int value; 35 - 36 - value = phy_read(phy, 0x16); 37 - value &= ~0x20; 38 - phy_write(phy, 0x16, value); 39 - 40 - return 0; 41 - } 20 + static const struct at91_soc sama5_socs[] = { 21 + AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D31_EXID_MATCH, 22 + "sama5d31", "sama5d3"), 23 + AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D33_EXID_MATCH, 24 + "sama5d33", "sama5d3"), 25 + AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D34_EXID_MATCH, 26 + "sama5d34", "sama5d3"), 27 + AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D35_EXID_MATCH, 28 + "sama5d35", "sama5d3"), 29 + AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D36_EXID_MATCH, 30 + "sama5d36", "sama5d3"), 31 + AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D41_EXID_MATCH, 32 + "sama5d41", "sama5d4"), 33 + AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D42_EXID_MATCH, 34 + "sama5d42", "sama5d4"), 35 + AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D43_EXID_MATCH, 36 + "sama5d43", "sama5d4"), 37 + AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D44_EXID_MATCH, 38 + "sama5d44", "sama5d4"), 39 + { /* sentinel */ }, 40 + }; 42 41 43 42 static void __init sama5_dt_device_init(void) 44 43 { 45 - if (of_machine_is_compatible("atmel,sama5d4ek") && 46 - IS_ENABLED(CONFIG_PHYLIB)) { 47 - phy_register_fixup_for_id("fc028000.etherne:00", 48 - ksz8081_phy_fixup); 49 - } 44 + struct soc_device *soc; 45 + struct device *soc_dev = NULL; 50 46 51 - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 47 + soc = at91_soc_init(sama5_socs); 48 + if (soc != NULL) 49 + soc_dev = soc_device_to_device(soc); 50 + 51 + of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); 52 52 at91sam9x5_pm_init(); 53 53 } 54 54 ··· 59 59 60 60 DT_MACHINE_START(sama5_dt, "Atmel SAMA5") 61 61 /* Maintainer: Atmel */ 62 - .map_io = at91_map_io, 63 62 .init_machine = sama5_dt_device_init, 64 63 .dt_compat = sama5_dt_board_compat, 65 64 MACHINE_END 66 - 67 - static struct map_desc at91_io_desc[] __initdata = { 68 - { 69 - .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC), 70 - .pfn = __phys_to_pfn(SAMA5D4_BASE_MPDDRC), 71 - .length = SZ_512, 72 - .type = MT_DEVICE, 73 - }, 74 - { 75 - .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_PMC), 76 - .pfn = __phys_to_pfn(SAMA5D4_BASE_PMC), 77 - .length = SZ_512, 78 - .type = MT_DEVICE, 79 - }, 80 - { /* On sama5d4, we use USART3 as serial console */ 81 - .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_USART3), 82 - .pfn = __phys_to_pfn(SAMA5D4_BASE_USART3), 83 - .length = SZ_256, 84 - .type = MT_DEVICE, 85 - }, 86 - { /* A bunch of peripheral with fine grained IO space */ 87 - .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_SYS2), 88 - .pfn = __phys_to_pfn(SAMA5D4_BASE_SYS2), 89 - .length = SZ_2K, 90 - .type = MT_DEVICE, 91 - }, 92 - }; 93 - 94 - static void __init sama5_alt_map_io(void) 95 - { 96 - at91_alt_map_io(); 97 - iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc)); 98 - } 99 65 100 66 static const char *sama5_alt_dt_board_compat[] __initconst = { 101 67 "atmel,sama5d4", ··· 70 104 71 105 DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5") 72 106 /* Maintainer: Atmel */ 73 - .map_io = sama5_alt_map_io, 74 107 .init_machine = sama5_dt_device_init, 75 108 .dt_compat = sama5_alt_dt_board_compat, 76 109 .l2c_aux_mask = ~0UL,
-330
arch/arm/mach-at91/setup.c
··· 1 - /* 2 - * Copyright (C) 2007 Atmel Corporation. 3 - * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 4 - * 5 - * Under GPLv2 6 - */ 7 - 8 - #define pr_fmt(fmt) "AT91: " fmt 9 - 10 - #include <linux/module.h> 11 - #include <linux/io.h> 12 - #include <linux/mm.h> 13 - #include <linux/pm.h> 14 - #include <linux/of_address.h> 15 - #include <linux/pinctrl/machine.h> 16 - #include <linux/clk/at91_pmc.h> 17 - 18 - #include <asm/system_misc.h> 19 - #include <asm/mach/map.h> 20 - 21 - #include <mach/hardware.h> 22 - #include <mach/cpu.h> 23 - #include <mach/at91_dbgu.h> 24 - 25 - #include "generic.h" 26 - #include "pm.h" 27 - 28 - struct at91_socinfo at91_soc_initdata; 29 - EXPORT_SYMBOL(at91_soc_initdata); 30 - 31 - static struct map_desc at91_io_desc __initdata __maybe_unused = { 32 - .virtual = (unsigned long)AT91_VA_BASE_SYS, 33 - .pfn = __phys_to_pfn(AT91_BASE_SYS), 34 - .length = SZ_16K, 35 - .type = MT_DEVICE, 36 - }; 37 - 38 - static struct map_desc at91_alt_io_desc __initdata __maybe_unused = { 39 - .virtual = (unsigned long)AT91_ALT_VA_BASE_SYS, 40 - .pfn = __phys_to_pfn(AT91_ALT_BASE_SYS), 41 - .length = 24 * SZ_1K, 42 - .type = MT_DEVICE, 43 - }; 44 - 45 - static void __init soc_detect(u32 dbgu_base) 46 - { 47 - u32 cidr, socid; 48 - 49 - cidr = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_CIDR); 50 - socid = cidr & ~AT91_CIDR_VERSION; 51 - 52 - switch (socid) { 53 - case ARCH_ID_AT91RM9200: 54 - at91_soc_initdata.type = AT91_SOC_RM9200; 55 - if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN) 56 - at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; 57 - break; 58 - 59 - case ARCH_ID_AT91SAM9260: 60 - at91_soc_initdata.type = AT91_SOC_SAM9260; 61 - at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 62 - break; 63 - 64 - case ARCH_ID_AT91SAM9261: 65 - at91_soc_initdata.type = AT91_SOC_SAM9261; 66 - at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 67 - break; 68 - 69 - case ARCH_ID_AT91SAM9263: 70 - at91_soc_initdata.type = AT91_SOC_SAM9263; 71 - at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 72 - break; 73 - 74 - case ARCH_ID_AT91SAM9G20: 75 - at91_soc_initdata.type = AT91_SOC_SAM9G20; 76 - at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 77 - break; 78 - 79 - case ARCH_ID_AT91SAM9G45: 80 - at91_soc_initdata.type = AT91_SOC_SAM9G45; 81 - if (cidr == ARCH_ID_AT91SAM9G45ES) 82 - at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES; 83 - break; 84 - 85 - case ARCH_ID_AT91SAM9RL64: 86 - at91_soc_initdata.type = AT91_SOC_SAM9RL; 87 - at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 88 - break; 89 - 90 - case ARCH_ID_AT91SAM9X5: 91 - at91_soc_initdata.type = AT91_SOC_SAM9X5; 92 - break; 93 - 94 - case ARCH_ID_AT91SAM9N12: 95 - at91_soc_initdata.type = AT91_SOC_SAM9N12; 96 - break; 97 - 98 - case ARCH_ID_SAMA5: 99 - at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID); 100 - if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) { 101 - at91_soc_initdata.type = AT91_SOC_SAMA5D3; 102 - } 103 - break; 104 - } 105 - 106 - /* at91sam9g10 */ 107 - if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { 108 - at91_soc_initdata.type = AT91_SOC_SAM9G10; 109 - at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 110 - } 111 - /* at91sam9xe */ 112 - else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) { 113 - at91_soc_initdata.type = AT91_SOC_SAM9260; 114 - at91_soc_initdata.subtype = AT91_SOC_SAM9XE; 115 - } 116 - 117 - if (!at91_soc_is_detected()) 118 - return; 119 - 120 - at91_soc_initdata.cidr = cidr; 121 - 122 - /* sub version of soc */ 123 - if (!at91_soc_initdata.exid) 124 - at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID); 125 - 126 - if (at91_soc_initdata.type == AT91_SOC_SAM9G45) { 127 - switch (at91_soc_initdata.exid) { 128 - case ARCH_EXID_AT91SAM9M10: 129 - at91_soc_initdata.subtype = AT91_SOC_SAM9M10; 130 - break; 131 - case ARCH_EXID_AT91SAM9G46: 132 - at91_soc_initdata.subtype = AT91_SOC_SAM9G46; 133 - break; 134 - case ARCH_EXID_AT91SAM9M11: 135 - at91_soc_initdata.subtype = AT91_SOC_SAM9M11; 136 - break; 137 - } 138 - } 139 - 140 - if (at91_soc_initdata.type == AT91_SOC_SAM9X5) { 141 - switch (at91_soc_initdata.exid) { 142 - case ARCH_EXID_AT91SAM9G15: 143 - at91_soc_initdata.subtype = AT91_SOC_SAM9G15; 144 - break; 145 - case ARCH_EXID_AT91SAM9G35: 146 - at91_soc_initdata.subtype = AT91_SOC_SAM9G35; 147 - break; 148 - case ARCH_EXID_AT91SAM9X35: 149 - at91_soc_initdata.subtype = AT91_SOC_SAM9X35; 150 - break; 151 - case ARCH_EXID_AT91SAM9G25: 152 - at91_soc_initdata.subtype = AT91_SOC_SAM9G25; 153 - break; 154 - case ARCH_EXID_AT91SAM9X25: 155 - at91_soc_initdata.subtype = AT91_SOC_SAM9X25; 156 - break; 157 - } 158 - } 159 - 160 - if (at91_soc_initdata.type == AT91_SOC_SAMA5D3) { 161 - switch (at91_soc_initdata.exid) { 162 - case ARCH_EXID_SAMA5D31: 163 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D31; 164 - break; 165 - case ARCH_EXID_SAMA5D33: 166 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D33; 167 - break; 168 - case ARCH_EXID_SAMA5D34: 169 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D34; 170 - break; 171 - case ARCH_EXID_SAMA5D35: 172 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D35; 173 - break; 174 - case ARCH_EXID_SAMA5D36: 175 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D36; 176 - break; 177 - } 178 - } 179 - } 180 - 181 - static void __init alt_soc_detect(u32 dbgu_base) 182 - { 183 - u32 cidr, socid; 184 - 185 - /* SoC ID */ 186 - cidr = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_CIDR); 187 - socid = cidr & ~AT91_CIDR_VERSION; 188 - 189 - switch (socid) { 190 - case ARCH_ID_SAMA5: 191 - at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID); 192 - if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) { 193 - at91_soc_initdata.type = AT91_SOC_SAMA5D3; 194 - } else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) { 195 - at91_soc_initdata.type = AT91_SOC_SAMA5D4; 196 - } 197 - break; 198 - } 199 - 200 - if (!at91_soc_is_detected()) 201 - return; 202 - 203 - at91_soc_initdata.cidr = cidr; 204 - 205 - /* sub version of soc */ 206 - if (!at91_soc_initdata.exid) 207 - at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID); 208 - 209 - if (at91_soc_initdata.type == AT91_SOC_SAMA5D4) { 210 - switch (at91_soc_initdata.exid) { 211 - case ARCH_EXID_SAMA5D41: 212 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D41; 213 - break; 214 - case ARCH_EXID_SAMA5D42: 215 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D42; 216 - break; 217 - case ARCH_EXID_SAMA5D43: 218 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D43; 219 - break; 220 - case ARCH_EXID_SAMA5D44: 221 - at91_soc_initdata.subtype = AT91_SOC_SAMA5D44; 222 - break; 223 - } 224 - } 225 - } 226 - 227 - static const char *soc_name[] = { 228 - [AT91_SOC_RM9200] = "at91rm9200", 229 - [AT91_SOC_SAM9260] = "at91sam9260", 230 - [AT91_SOC_SAM9261] = "at91sam9261", 231 - [AT91_SOC_SAM9263] = "at91sam9263", 232 - [AT91_SOC_SAM9G10] = "at91sam9g10", 233 - [AT91_SOC_SAM9G20] = "at91sam9g20", 234 - [AT91_SOC_SAM9G45] = "at91sam9g45", 235 - [AT91_SOC_SAM9RL] = "at91sam9rl", 236 - [AT91_SOC_SAM9X5] = "at91sam9x5", 237 - [AT91_SOC_SAM9N12] = "at91sam9n12", 238 - [AT91_SOC_SAMA5D3] = "sama5d3", 239 - [AT91_SOC_SAMA5D4] = "sama5d4", 240 - [AT91_SOC_UNKNOWN] = "Unknown", 241 - }; 242 - 243 - const char *at91_get_soc_type(struct at91_socinfo *c) 244 - { 245 - return soc_name[c->type]; 246 - } 247 - EXPORT_SYMBOL(at91_get_soc_type); 248 - 249 - static const char *soc_subtype_name[] = { 250 - [AT91_SOC_RM9200_BGA] = "at91rm9200 BGA", 251 - [AT91_SOC_RM9200_PQFP] = "at91rm9200 PQFP", 252 - [AT91_SOC_SAM9XE] = "at91sam9xe", 253 - [AT91_SOC_SAM9G45ES] = "at91sam9g45es", 254 - [AT91_SOC_SAM9M10] = "at91sam9m10", 255 - [AT91_SOC_SAM9G46] = "at91sam9g46", 256 - [AT91_SOC_SAM9M11] = "at91sam9m11", 257 - [AT91_SOC_SAM9G15] = "at91sam9g15", 258 - [AT91_SOC_SAM9G35] = "at91sam9g35", 259 - [AT91_SOC_SAM9X35] = "at91sam9x35", 260 - [AT91_SOC_SAM9G25] = "at91sam9g25", 261 - [AT91_SOC_SAM9X25] = "at91sam9x25", 262 - [AT91_SOC_SAMA5D31] = "sama5d31", 263 - [AT91_SOC_SAMA5D33] = "sama5d33", 264 - [AT91_SOC_SAMA5D34] = "sama5d34", 265 - [AT91_SOC_SAMA5D35] = "sama5d35", 266 - [AT91_SOC_SAMA5D36] = "sama5d36", 267 - [AT91_SOC_SAMA5D41] = "sama5d41", 268 - [AT91_SOC_SAMA5D42] = "sama5d42", 269 - [AT91_SOC_SAMA5D43] = "sama5d43", 270 - [AT91_SOC_SAMA5D44] = "sama5d44", 271 - [AT91_SOC_SUBTYPE_NONE] = "None", 272 - [AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown", 273 - }; 274 - 275 - const char *at91_get_soc_subtype(struct at91_socinfo *c) 276 - { 277 - return soc_subtype_name[c->subtype]; 278 - } 279 - EXPORT_SYMBOL(at91_get_soc_subtype); 280 - 281 - void __init at91_map_io(void) 282 - { 283 - /* Map peripherals */ 284 - iotable_init(&at91_io_desc, 1); 285 - 286 - at91_soc_initdata.type = AT91_SOC_UNKNOWN; 287 - at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN; 288 - 289 - soc_detect(AT91_BASE_DBGU0); 290 - if (!at91_soc_is_detected()) 291 - soc_detect(AT91_BASE_DBGU1); 292 - 293 - if (!at91_soc_is_detected()) 294 - panic(pr_fmt("Impossible to detect the SOC type")); 295 - 296 - pr_info("Detected soc type: %s\n", 297 - at91_get_soc_type(&at91_soc_initdata)); 298 - if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE) 299 - pr_info("Detected soc subtype: %s\n", 300 - at91_get_soc_subtype(&at91_soc_initdata)); 301 - } 302 - 303 - void __init at91_alt_map_io(void) 304 - { 305 - /* Map peripherals */ 306 - iotable_init(&at91_alt_io_desc, 1); 307 - 308 - at91_soc_initdata.type = AT91_SOC_UNKNOWN; 309 - at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN; 310 - 311 - alt_soc_detect(AT91_BASE_DBGU2); 312 - if (!at91_soc_is_detected()) 313 - panic("AT91: Impossible to detect the SOC type"); 314 - 315 - pr_info("AT91: Detected soc type: %s\n", 316 - at91_get_soc_type(&at91_soc_initdata)); 317 - if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE) 318 - pr_info("AT91: Detected soc subtype: %s\n", 319 - at91_get_soc_subtype(&at91_soc_initdata)); 320 - } 321 - 322 - void __iomem *at91_matrix_base; 323 - EXPORT_SYMBOL_GPL(at91_matrix_base); 324 - 325 - void __init at91_ioremap_matrix(u32 base_addr) 326 - { 327 - at91_matrix_base = ioremap(base_addr, 512); 328 - if (!at91_matrix_base) 329 - panic(pr_fmt("Impossible to ioremap at91_matrix_base\n")); 330 - }
+97
arch/arm/mach-at91/soc.c
··· 1 + /* 2 + * Copyright (C) 2015 Atmel 3 + * 4 + * Alexandre Belloni <alexandre.belloni@free-electrons.com 5 + * Boris Brezillon <boris.brezillon@free-electrons.com 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 + 13 + #define pr_fmt(fmt) "AT91: " fmt 14 + 15 + #include <linux/io.h> 16 + #include <linux/of.h> 17 + #include <linux/of_address.h> 18 + #include <linux/of_platform.h> 19 + #include <linux/slab.h> 20 + #include <linux/sys_soc.h> 21 + 22 + #include "soc.h" 23 + 24 + #define AT91_DBGU_CIDR 0x40 25 + #define AT91_DBGU_CIDR_VERSION(x) ((x) & 0x1f) 26 + #define AT91_DBGU_CIDR_EXT BIT(31) 27 + #define AT91_DBGU_CIDR_MATCH_MASK 0x7fffffe0 28 + #define AT91_DBGU_EXID 0x44 29 + 30 + struct soc_device * __init at91_soc_init(const struct at91_soc *socs) 31 + { 32 + struct soc_device_attribute *soc_dev_attr; 33 + const struct at91_soc *soc; 34 + struct soc_device *soc_dev; 35 + struct device_node *np; 36 + void __iomem *regs; 37 + u32 cidr, exid; 38 + 39 + np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-dbgu"); 40 + if (!np) 41 + np = of_find_compatible_node(NULL, NULL, 42 + "atmel,at91sam9260-dbgu"); 43 + 44 + if (!np) { 45 + pr_warn("Could not find DBGU node"); 46 + return NULL; 47 + } 48 + 49 + regs = of_iomap(np, 0); 50 + of_node_put(np); 51 + 52 + if (!regs) { 53 + pr_warn("Could not map DBGU iomem range"); 54 + return NULL; 55 + } 56 + 57 + cidr = readl(regs + AT91_DBGU_CIDR); 58 + exid = readl(regs + AT91_DBGU_EXID); 59 + 60 + iounmap(regs); 61 + 62 + for (soc = socs; soc->name; soc++) { 63 + if (soc->cidr_match != (cidr & AT91_DBGU_CIDR_MATCH_MASK)) 64 + continue; 65 + 66 + if (!(cidr & AT91_DBGU_CIDR_EXT) || soc->exid_match == exid) 67 + break; 68 + } 69 + 70 + if (!soc->name) { 71 + pr_warn("Could not find matching SoC description\n"); 72 + return NULL; 73 + } 74 + 75 + soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); 76 + if (!soc_dev_attr) 77 + return NULL; 78 + 79 + soc_dev_attr->family = soc->family; 80 + soc_dev_attr->soc_id = soc->name; 81 + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%X", 82 + AT91_DBGU_CIDR_VERSION(cidr)); 83 + soc_dev = soc_device_register(soc_dev_attr); 84 + if (IS_ERR(soc_dev)) { 85 + kfree(soc_dev_attr->revision); 86 + kfree(soc_dev_attr); 87 + pr_warn("Could not register SoC device\n"); 88 + return NULL; 89 + } 90 + 91 + if (soc->family) 92 + pr_info("Detected SoC family: %s\n", soc->family); 93 + pr_info("Detected SoC: %s, revision %X\n", soc->name, 94 + AT91_DBGU_CIDR_VERSION(cidr)); 95 + 96 + return soc_dev; 97 + }
+78
arch/arm/mach-at91/soc.h
··· 1 + /* 2 + * Copyright (C) 2015 Atmel 3 + * 4 + * Boris Brezillon <boris.brezillon@free-electrons.com 5 + * 6 + * This file is licensed under the terms of the GNU General Public 7 + * License version 2. This program is licensed "as is" without any 8 + * warranty of any kind, whether express or implied. 9 + * 10 + */ 11 + 12 + #ifndef __AT91_SOC_H 13 + #define __AT91_SOC_H 14 + 15 + #include <linux/sys_soc.h> 16 + 17 + struct at91_soc { 18 + u32 cidr_match; 19 + u32 exid_match; 20 + const char *name; 21 + const char *family; 22 + }; 23 + 24 + #define AT91_SOC(__cidr, __exid, __name, __family) \ 25 + { \ 26 + .cidr_match = (__cidr), \ 27 + .exid_match = (__exid), \ 28 + .name = (__name), \ 29 + .family = (__family), \ 30 + } 31 + 32 + struct soc_device * __init 33 + at91_soc_init(const struct at91_soc *socs); 34 + 35 + #define AT91RM9200_CIDR_MATCH 0x09290780 36 + 37 + #define AT91SAM9260_CIDR_MATCH 0x019803a0 38 + #define AT91SAM9261_CIDR_MATCH 0x019703a0 39 + #define AT91SAM9263_CIDR_MATCH 0x019607a0 40 + #define AT91SAM9G20_CIDR_MATCH 0x019905a0 41 + #define AT91SAM9RL64_CIDR_MATCH 0x019b03a0 42 + #define AT91SAM9G45_CIDR_MATCH 0x019b05a0 43 + #define AT91SAM9X5_CIDR_MATCH 0x019a05a0 44 + #define AT91SAM9N12_CIDR_MATCH 0x019a07a0 45 + 46 + #define AT91SAM9M11_EXID_MATCH 0x00000001 47 + #define AT91SAM9M10_EXID_MATCH 0x00000002 48 + #define AT91SAM9G46_EXID_MATCH 0x00000003 49 + #define AT91SAM9G45_EXID_MATCH 0x00000004 50 + 51 + #define AT91SAM9G15_EXID_MATCH 0x00000000 52 + #define AT91SAM9G35_EXID_MATCH 0x00000001 53 + #define AT91SAM9X35_EXID_MATCH 0x00000002 54 + #define AT91SAM9G25_EXID_MATCH 0x00000003 55 + #define AT91SAM9X25_EXID_MATCH 0x00000004 56 + 57 + #define AT91SAM9CN12_EXID_MATCH 0x00000005 58 + #define AT91SAM9N12_EXID_MATCH 0x00000006 59 + #define AT91SAM9CN11_EXID_MATCH 0x00000009 60 + 61 + #define AT91SAM9XE128_CIDR_MATCH 0x329973a0 62 + #define AT91SAM9XE256_CIDR_MATCH 0x329a93a0 63 + #define AT91SAM9XE512_CIDR_MATCH 0x329aa3a0 64 + 65 + #define SAMA5D3_CIDR_MATCH 0x0a5c07c0 66 + #define SAMA5D31_EXID_MATCH 0x00444300 67 + #define SAMA5D33_EXID_MATCH 0x00414300 68 + #define SAMA5D34_EXID_MATCH 0x00414301 69 + #define SAMA5D35_EXID_MATCH 0x00584300 70 + #define SAMA5D36_EXID_MATCH 0x00004301 71 + 72 + #define SAMA5D4_CIDR_MATCH 0x0a5c07c0 73 + #define SAMA5D41_EXID_MATCH 0x00000001 74 + #define SAMA5D42_EXID_MATCH 0x00000002 75 + #define SAMA5D43_EXID_MATCH 0x00000003 76 + #define SAMA5D44_EXID_MATCH 0x00000004 77 + 78 + #endif /* __AT91_SOC_H */
+4
drivers/clocksource/Kconfig
··· 143 143 select CLKSRC_OF if OF 144 144 def_bool SOC_AT91SAM9 || SOC_SAMA5 145 145 146 + config ATMEL_ST 147 + bool 148 + select CLKSRC_OF 149 + 146 150 config CLKSRC_METAG_GENERIC 147 151 def_bool y if METAG 148 152 help
+1
drivers/clocksource/Makefile
··· 1 1 obj-$(CONFIG_CLKSRC_OF) += clksrc-of.o 2 2 obj-$(CONFIG_ATMEL_PIT) += timer-atmel-pit.o 3 + obj-$(CONFIG_ATMEL_ST) += timer-atmel-st.o 3 4 obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o 4 5 obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o 5 6 obj-$(CONFIG_SCx200HR_TIMER) += scx200_hrt.o
+1
drivers/pcmcia/Kconfig
··· 278 278 279 279 config AT91_CF 280 280 tristate "AT91 CompactFlash Controller" 281 + depends on PCI 281 282 depends on PCMCIA && ARCH_AT91 282 283 depends on !ARCH_MULTIPLATFORM 283 284 help
+7 -6
drivers/pcmcia/at91_cf.c
··· 317 317 } else 318 318 cf->socket.pci_irq = nr_irqs + 1; 319 319 320 - /* pcmcia layer only remaps "real" memory not iospace */ 321 - cf->socket.io_offset = (unsigned long) devm_ioremap(&pdev->dev, 322 - cf->phys_baseaddr + CF_IO_PHYS, SZ_2K); 323 - if (!cf->socket.io_offset) { 324 - status = -ENXIO; 320 + /* 321 + * pcmcia layer only remaps "real" memory not iospace 322 + * io_offset is set to 0x10000 to avoid the check in static_find_io(). 323 + * */ 324 + cf->socket.io_offset = 0x10000; 325 + status = pci_ioremap_io(0x10000, cf->phys_baseaddr + CF_IO_PHYS); 326 + if (status) 325 327 goto fail0a; 326 - } 327 328 328 329 /* reserve chip-select regions */ 329 330 if (!devm_request_mem_region(&pdev->dev, io->start, resource_size(io), "at91_cf")) {
+1 -1
drivers/watchdog/Kconfig
··· 154 154 155 155 config AT91RM9200_WATCHDOG 156 156 tristate "AT91RM9200 watchdog" 157 - depends on SOC_AT91RM9200 157 + depends on SOC_AT91RM9200 && MFD_SYSCON 158 158 help 159 159 Watchdog timer embedded into AT91RM9200 chips. This will reboot your 160 160 system when the timeout is reached.
+54 -7
drivers/watchdog/at91rm9200_wdt.c
··· 12 12 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 13 13 14 14 #include <linux/bitops.h> 15 + #include <linux/delay.h> 15 16 #include <linux/errno.h> 16 17 #include <linux/fs.h> 17 18 #include <linux/init.h> 18 19 #include <linux/io.h> 19 20 #include <linux/kernel.h> 21 + #include <linux/mfd/syscon.h> 22 + #include <linux/mfd/syscon/atmel-st.h> 20 23 #include <linux/miscdevice.h> 21 24 #include <linux/module.h> 22 25 #include <linux/moduleparam.h> 23 26 #include <linux/platform_device.h> 27 + #include <linux/reboot.h> 28 + #include <linux/regmap.h> 24 29 #include <linux/types.h> 25 30 #include <linux/watchdog.h> 26 31 #include <linux/uaccess.h> 27 32 #include <linux/of.h> 28 33 #include <linux/of_device.h> 29 - #include <mach/at91_st.h> 30 34 31 35 #define WDT_DEFAULT_TIME 5 /* seconds */ 32 36 #define WDT_MAX_TIME 256 /* seconds */ 33 37 34 38 static int wdt_time = WDT_DEFAULT_TIME; 35 39 static bool nowayout = WATCHDOG_NOWAYOUT; 40 + static struct regmap *regmap_st; 36 41 37 42 module_param(wdt_time, int, 0); 38 43 MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default=" ··· 55 50 56 51 /* ......................................................................... */ 57 52 53 + static int at91rm9200_restart(struct notifier_block *this, 54 + unsigned long mode, void *cmd) 55 + { 56 + /* 57 + * Perform a hardware reset with the use of the Watchdog timer. 58 + */ 59 + regmap_write(regmap_st, AT91_ST_WDMR, 60 + AT91_ST_RSTEN | AT91_ST_EXTEN | 1); 61 + regmap_write(regmap_st, AT91_ST_CR, AT91_ST_WDRST); 62 + 63 + mdelay(2000); 64 + 65 + pr_emerg("Unable to restart system\n"); 66 + return NOTIFY_DONE; 67 + } 68 + 69 + static struct notifier_block at91rm9200_restart_nb = { 70 + .notifier_call = at91rm9200_restart, 71 + .priority = 192, 72 + }; 73 + 58 74 /* 59 75 * Disable the watchdog. 60 76 */ 61 77 static inline void at91_wdt_stop(void) 62 78 { 63 - at91_st_write(AT91_ST_WDMR, AT91_ST_EXTEN); 79 + regmap_write(regmap_st, AT91_ST_WDMR, AT91_ST_EXTEN); 64 80 } 65 81 66 82 /* ··· 89 63 */ 90 64 static inline void at91_wdt_start(void) 91 65 { 92 - at91_st_write(AT91_ST_WDMR, AT91_ST_EXTEN | AT91_ST_RSTEN | 66 + regmap_write(regmap_st, AT91_ST_WDMR, AT91_ST_EXTEN | AT91_ST_RSTEN | 93 67 (((65536 * wdt_time) >> 8) & AT91_ST_WDV)); 94 - at91_st_write(AT91_ST_CR, AT91_ST_WDRST); 68 + regmap_write(regmap_st, AT91_ST_CR, AT91_ST_WDRST); 95 69 } 96 70 97 71 /* ··· 99 73 */ 100 74 static inline void at91_wdt_reload(void) 101 75 { 102 - at91_st_write(AT91_ST_CR, AT91_ST_WDRST); 76 + regmap_write(regmap_st, AT91_ST_CR, AT91_ST_WDRST); 103 77 } 104 78 105 79 /* ......................................................................... */ ··· 229 203 230 204 static int at91wdt_probe(struct platform_device *pdev) 231 205 { 206 + struct device *dev = &pdev->dev; 207 + struct device *parent; 232 208 int res; 233 209 234 210 if (at91wdt_miscdev.parent) 235 211 return -EBUSY; 236 212 at91wdt_miscdev.parent = &pdev->dev; 237 213 214 + parent = dev->parent; 215 + if (!parent) { 216 + dev_err(dev, "no parent\n"); 217 + return -ENODEV; 218 + } 219 + 220 + regmap_st = syscon_node_to_regmap(parent->of_node); 221 + if (!regmap_st) 222 + return -ENODEV; 223 + 238 224 res = misc_register(&at91wdt_miscdev); 239 225 if (res) 240 226 return res; 227 + 228 + res = register_restart_handler(&at91rm9200_restart_nb); 229 + if (res) 230 + dev_warn(dev, "failed to register restart handler\n"); 241 231 242 232 pr_info("AT91 Watchdog Timer enabled (%d seconds%s)\n", 243 233 wdt_time, nowayout ? ", nowayout" : ""); ··· 262 220 263 221 static int at91wdt_remove(struct platform_device *pdev) 264 222 { 223 + struct device *dev = &pdev->dev; 265 224 int res; 225 + 226 + res = unregister_restart_handler(&at91rm9200_restart_nb); 227 + if (res) 228 + dev_warn(dev, "failed to unregister restart handler\n"); 266 229 267 230 res = misc_deregister(&at91wdt_miscdev); 268 231 if (!res) ··· 314 267 .suspend = at91wdt_suspend, 315 268 .resume = at91wdt_resume, 316 269 .driver = { 317 - .name = "at91_wdt", 270 + .name = "atmel_st_watchdog", 318 271 .of_match_table = at91_wdt_dt_ids, 319 272 }, 320 273 }; ··· 343 296 MODULE_AUTHOR("Andrew Victor"); 344 297 MODULE_DESCRIPTION("Watchdog driver for Atmel AT91RM9200"); 345 298 MODULE_LICENSE("GPL"); 346 - MODULE_ALIAS("platform:at91_wdt"); 299 + MODULE_ALIAS("platform:atmel_st_watchdog");
+49
include/linux/mfd/syscon/atmel-st.h
··· 1 + /* 2 + * Copyright (C) 2005 Ivan Kokshaysky 3 + * Copyright (C) SAN People 4 + * 5 + * System Timer (ST) - System peripherals registers. 6 + * Based on AT91RM9200 datasheet revision E. 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License as published by 10 + * the Free Software Foundation; either version 2 of the License, or 11 + * (at your option) any later version. 12 + */ 13 + 14 + #ifndef _LINUX_MFD_SYSCON_ATMEL_ST_H 15 + #define _LINUX_MFD_SYSCON_ATMEL_ST_H 16 + 17 + #include <linux/bitops.h> 18 + 19 + #define AT91_ST_CR 0x00 /* Control Register */ 20 + #define AT91_ST_WDRST BIT(0) /* Watchdog Timer Restart */ 21 + 22 + #define AT91_ST_PIMR 0x04 /* Period Interval Mode Register */ 23 + #define AT91_ST_PIV 0xffff /* Period Interval Value */ 24 + 25 + #define AT91_ST_WDMR 0x08 /* Watchdog Mode Register */ 26 + #define AT91_ST_WDV 0xffff /* Watchdog Counter Value */ 27 + #define AT91_ST_RSTEN BIT(16) /* Reset Enable */ 28 + #define AT91_ST_EXTEN BIT(17) /* External Signal Assertion Enable */ 29 + 30 + #define AT91_ST_RTMR 0x0c /* Real-time Mode Register */ 31 + #define AT91_ST_RTPRES 0xffff /* Real-time Prescalar Value */ 32 + 33 + #define AT91_ST_SR 0x10 /* Status Register */ 34 + #define AT91_ST_PITS BIT(0) /* Period Interval Timer Status */ 35 + #define AT91_ST_WDOVF BIT(1) /* Watchdog Overflow */ 36 + #define AT91_ST_RTTINC BIT(2) /* Real-time Timer Increment */ 37 + #define AT91_ST_ALMS BIT(3) /* Alarm Status */ 38 + 39 + #define AT91_ST_IER 0x14 /* Interrupt Enable Register */ 40 + #define AT91_ST_IDR 0x18 /* Interrupt Disable Register */ 41 + #define AT91_ST_IMR 0x1c /* Interrupt Mask Register */ 42 + 43 + #define AT91_ST_RTAR 0x20 /* Real-time Alarm Register */ 44 + #define AT91_ST_ALMV 0xfffff /* Alarm Value */ 45 + 46 + #define AT91_ST_CRTR 0x24 /* Current Real-time Register */ 47 + #define AT91_ST_CRTV 0xfffff /* Current Real-Time Value */ 48 + 49 + #endif /* _LINUX_MFD_SYSCON_ATMEL_ST_H */
+1 -1
include/soc/at91/at91sam9_ddrsdr.h
··· 92 92 #define AT91_DDRSDRC_UPD_MR (3 << 20) /* Update load mode register and extended mode register */ 93 93 94 94 #define AT91_DDRSDRC_MDR 0x20 /* Memory Device Register */ 95 - #define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */ 95 + #define AT91_DDRSDRC_MD (7 << 0) /* Memory Device Type */ 96 96 #define AT91_DDRSDRC_MD_SDR 0 97 97 #define AT91_DDRSDRC_MD_LOW_POWER_SDR 1 98 98 #define AT91_DDRSDRC_MD_LOW_POWER_DDR 3