mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
Compare commits
164 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2528b76a7e | ||
|
|
3ee11c1c5c | ||
|
|
8ddc8ca056 | ||
|
|
2737fc19a2 | ||
|
|
e361d6e987 | ||
|
|
93d4db55aa | ||
|
|
5b8829d430 | ||
|
|
2cdb451500 | ||
|
|
1b6584d37b | ||
|
|
7386f1496d | ||
|
|
19e13bc5c4 | ||
|
|
314e83e673 | ||
|
|
699c1af4ab | ||
|
|
fc829bbab2 | ||
|
|
2cdbc5346e | ||
|
|
6d469521b7 | ||
|
|
2e703ea0eb | ||
|
|
f9a8f8eefc | ||
|
|
a836c71a2b | ||
|
|
7a4d201cad | ||
|
|
344af464ee | ||
|
|
d44563626d | ||
|
|
998d6c4470 | ||
|
|
01cb34503a | ||
|
|
0d3ab9385a | ||
|
|
f46504b454 | ||
|
|
c3340e3a89 | ||
|
|
b5a2f01055 | ||
|
|
6e944ebc46 | ||
|
|
60f33f2a86 | ||
|
|
a9a68e1ec9 | ||
|
|
d57a0e5333 | ||
|
|
5c290db6b8 | ||
|
|
1136de70ef | ||
|
|
e27c2668ad | ||
|
|
f8d4168cb1 | ||
|
|
ff58ff04fe | ||
|
|
c2506feecd | ||
|
|
a33d6e252e | ||
|
|
63dc6735e2 | ||
|
|
2cdd23dc3c | ||
|
|
f9c3e8adef | ||
|
|
e77bb5f7af | ||
|
|
d6a23ca646 | ||
|
|
2a58f6a3be | ||
|
|
eeb9d7603c | ||
|
|
d54095c3d5 | ||
|
|
0cb23c532a | ||
|
|
3d8e9efa54 | ||
|
|
1a08248bfc | ||
|
|
cb50807575 | ||
|
|
e075d14459 | ||
|
|
74fbdf7a99 | ||
|
|
d1b7605161 | ||
|
|
24bfefefb3 | ||
|
|
871147b49e | ||
|
|
d9d9d09e3b | ||
|
|
629cbbada6 | ||
|
|
6f36b712c6 | ||
|
|
3f27eaf393 | ||
|
|
aabc070509 | ||
|
|
e03e189903 | ||
|
|
00469ca5a4 | ||
|
|
70512d3ded | ||
|
|
7ebee62c54 | ||
|
|
05ccb19f45 | ||
|
|
a37a28aee1 | ||
|
|
8c70cc3cf4 | ||
|
|
fa4f994489 | ||
|
|
a96bf1de66 | ||
|
|
f41cca18f5 | ||
|
|
b916b7b9ad | ||
|
|
71b715fa4c | ||
|
|
434d109a81 | ||
|
|
236dc75962 | ||
|
|
736c062fa5 | ||
|
|
403e95befa | ||
|
|
0b0155524b | ||
|
|
e32eb413e9 | ||
|
|
5f9f89e5e9 | ||
|
|
22581b0966 | ||
|
|
cff38c5595 | ||
|
|
3896759195 | ||
|
|
1bfea56c01 | ||
|
|
9bcd7a83eb | ||
|
|
ed34460a85 | ||
|
|
d1d52edbcb | ||
|
|
a4b64daacb | ||
|
|
60fd272f1c | ||
|
|
592b1ca154 | ||
|
|
87d34730cb | ||
|
|
a7d882664e | ||
|
|
88e0af5735 | ||
|
|
2afce7eb50 | ||
|
|
8fa93c5b1d | ||
|
|
de3f2f0e54 | ||
|
|
9ba2d7c9bd | ||
|
|
ba8d14d207 | ||
|
|
7b3d13a013 | ||
|
|
29022062c2 | ||
|
|
c407412c16 | ||
|
|
c5fa77a48c | ||
|
|
338c046fb9 | ||
|
|
402fd2ed03 | ||
|
|
64704f3239 | ||
|
|
a82f714b0d | ||
|
|
8b1fa971e2 | ||
|
|
38d310d789 | ||
|
|
fd13de5b00 | ||
|
|
91fb59ac66 | ||
|
|
25e38a3447 | ||
|
|
fbc326a52d | ||
|
|
b8e3e1688f | ||
|
|
7b519e17ae | ||
|
|
ade7184ebd | ||
|
|
b558ca6af9 | ||
|
|
639f1f69b8 | ||
|
|
52117b29cd | ||
|
|
4a3c81ca32 | ||
|
|
74af5d4594 | ||
|
|
ee72eccd73 | ||
|
|
b65b006a9e | ||
|
|
ef7adecbe3 | ||
|
|
57de9df644 | ||
|
|
03012528a5 | ||
|
|
002d474626 | ||
|
|
85784c792e | ||
|
|
67e448eff4 | ||
|
|
951b711ddb | ||
|
|
9646172ba3 | ||
|
|
b267bf16d3 | ||
|
|
26edb4df9f | ||
|
|
fd8418a524 | ||
|
|
6b0e863133 | ||
|
|
14d4d5831b | ||
|
|
b6fe34d330 | ||
|
|
54a327e10a | ||
|
|
3a4ef7682f | ||
|
|
50c05750d7 | ||
|
|
f7a39965a2 | ||
|
|
79fc36d3f6 | ||
|
|
30495c6b46 | ||
|
|
c10d667b28 | ||
|
|
ea4fd33083 | ||
|
|
6f3577b2a7 | ||
|
|
2f9f85dc02 | ||
|
|
c3d7212af9 | ||
|
|
cfe8920e41 | ||
|
|
0542e39966 | ||
|
|
8ede0a94de | ||
|
|
e94023be3d | ||
|
|
b72ed7b017 | ||
|
|
41a267df19 | ||
|
|
21d1c0f63f | ||
|
|
79c9cd1841 | ||
|
|
bf9792b560 | ||
|
|
8a98ec43d7 | ||
|
|
a2d44a193c | ||
|
|
adbd3185ad | ||
|
|
c82ee3e47a | ||
|
|
414940623d | ||
|
|
ef86b4d98a | ||
|
|
0469e48575 | ||
|
|
0705dd8a2a |
60
Documentation/video4linux/bcm2835-v4l2.txt
Normal file
60
Documentation/video4linux/bcm2835-v4l2.txt
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
BCM2835 (aka Raspberry Pi) V4L2 driver
|
||||
======================================
|
||||
|
||||
1. Copyright
|
||||
============
|
||||
|
||||
Copyright © 2013 Raspberry Pi (Trading) Ltd.
|
||||
|
||||
2. License
|
||||
==========
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
3. Quick Start
|
||||
==============
|
||||
|
||||
You need a version 1.0 or later of v4l2-ctl, available from:
|
||||
git://git.linuxtv.org/v4l-utils.git
|
||||
|
||||
$ sudo modprobe bcm2835-v4l2
|
||||
|
||||
Turn on the overlay:
|
||||
|
||||
$ v4l2-ctl --overlay=1
|
||||
|
||||
Turn off the overlay:
|
||||
|
||||
$ v4l2-ctl --overlay=0
|
||||
|
||||
Set the capture format for video:
|
||||
|
||||
$ v4l2-ctl --set-fmt-video=width=1920,height=1088,pixelformat=4
|
||||
|
||||
(Note: 1088 not 1080).
|
||||
|
||||
Capture:
|
||||
|
||||
$ v4l2-ctl --stream-mmap=3 --stream-count=100 --stream-to=somefile.h264
|
||||
|
||||
Stills capture:
|
||||
|
||||
$ v4l2-ctl --set-fmt-video=width=2592,height=1944,pixelformat=3
|
||||
$ v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=somefile.jpg
|
||||
|
||||
List of available formats:
|
||||
|
||||
$ v4l2-ctl --list-formats
|
||||
@@ -369,6 +369,23 @@ config ARCH_AT91
|
||||
This enables support for systems based on Atmel
|
||||
AT91RM9200, AT91SAM9 and SAMA5 processors.
|
||||
|
||||
config ARCH_BCM2708
|
||||
bool "Broadcom BCM2708 family"
|
||||
select CPU_V6
|
||||
select ARM_AMBA
|
||||
select HAVE_SCHED_CLOCK
|
||||
select NEED_MACH_GPIO_H
|
||||
select NEED_MACH_MEMORY_H
|
||||
select COMMON_CLK
|
||||
select ARCH_HAS_CPUFREQ
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select ARM_ERRATA_411920
|
||||
select MACH_BCM2708
|
||||
select VC4
|
||||
select FIQ
|
||||
help
|
||||
This enables support for Broadcom BCM2708 boards.
|
||||
|
||||
config ARCH_CLPS711X
|
||||
bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
@@ -777,6 +794,26 @@ config ARCH_OMAP1
|
||||
help
|
||||
Support for older TI OMAP1 (omap7xx, omap15xx or omap16xx)
|
||||
|
||||
config ARCH_BCM2709
|
||||
bool "Broadcom BCM2709 family"
|
||||
select ARCH_HAS_BARRIERS if SMP
|
||||
select CPU_V7
|
||||
select HAVE_SMP
|
||||
select ARM_AMBA
|
||||
select MIGHT_HAVE_CACHE_L2X0
|
||||
select HAVE_SCHED_CLOCK
|
||||
select NEED_MACH_MEMORY_H
|
||||
select NEED_MACH_IO_H
|
||||
select COMMON_CLK
|
||||
select ARCH_HAS_CPUFREQ
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select MACH_BCM2709
|
||||
select VC4
|
||||
select FIQ
|
||||
# select ZONE_DMA
|
||||
help
|
||||
This enables support for Broadcom BCM2709 boards.
|
||||
|
||||
endchoice
|
||||
|
||||
menu "Multiple platform selection"
|
||||
@@ -967,6 +1004,8 @@ source "arch/arm/plat-versatile/Kconfig"
|
||||
source "arch/arm/mach-vt8500/Kconfig"
|
||||
|
||||
source "arch/arm/mach-w90x900/Kconfig"
|
||||
source "arch/arm/mach-bcm2708/Kconfig"
|
||||
source "arch/arm/mach-bcm2709/Kconfig"
|
||||
|
||||
source "arch/arm/mach-zynq/Kconfig"
|
||||
|
||||
|
||||
@@ -1209,6 +1209,14 @@ choice
|
||||
options; the platform specific options are deprecated
|
||||
and will be soon removed.
|
||||
|
||||
config DEBUG_BCM2708_UART0
|
||||
bool "Broadcom BCM2708 UART0 (PL011)"
|
||||
depends on MACH_BCM2708
|
||||
help
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to UART 0. The port must have been initialised
|
||||
by the boot-loader before use.
|
||||
|
||||
endchoice
|
||||
|
||||
config DEBUG_AT91_UART
|
||||
|
||||
@@ -146,6 +146,8 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
|
||||
machine-$(CONFIG_ARCH_AT91) += at91
|
||||
machine-$(CONFIG_ARCH_AXXIA) += axxia
|
||||
machine-$(CONFIG_ARCH_BCM) += bcm
|
||||
machine-$(CONFIG_ARCH_BCM2708) += bcm2708
|
||||
machine-$(CONFIG_ARCH_BCM2709) += bcm2709
|
||||
machine-$(CONFIG_ARCH_BERLIN) += berlin
|
||||
machine-$(CONFIG_ARCH_CLPS711X) += clps711x
|
||||
machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx
|
||||
|
||||
@@ -1,5 +1,46 @@
|
||||
ifeq ($(CONFIG_OF),y)
|
||||
|
||||
dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b.dtb
|
||||
dtb-$(CONFIG_BCM2709_DT) += bcm2709-rpi-2-b.dtb
|
||||
dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b-plus.dtb
|
||||
dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-cm.dtb
|
||||
|
||||
# Raspberry Pi
|
||||
ifeq ($(CONFIG_BCM2708_DT),y)
|
||||
RPI_DT_OVERLAYS=y
|
||||
endif
|
||||
ifeq ($(CONFIG_BCM2709_DT),y)
|
||||
RPI_DT_OVERLAYS=y
|
||||
endif
|
||||
|
||||
dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += ds1307-rtc-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += hifiberry-dac-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += hifiberry-dacplus-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += hifiberry-amp-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += lirc-rpi-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += pcf2127-rtc-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += pcf8523-rtc-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb
|
||||
|
||||
dtb-$(CONFIG_MACH_ASM9260) += \
|
||||
alphascale-asm9260-devkit.dtb
|
||||
# Keep at91 dtb files sorted alphabetically for each SoC
|
||||
@@ -645,7 +686,16 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
|
||||
mt6592-evb.dtb \
|
||||
mt8127-moose.dtb \
|
||||
mt8135-evbp1.dtb
|
||||
|
||||
targets += dtbs dtbs_install
|
||||
targets += $(dtb-y)
|
||||
|
||||
endif
|
||||
|
||||
always := $(dtb-y)
|
||||
clean-files := *.dtb
|
||||
|
||||
# Enable fixups to support overlays on BCM2708 platforms
|
||||
ifeq ($(RPI_DT_OVERLAYS),y)
|
||||
DTC_FLAGS ?= -@
|
||||
endif
|
||||
|
||||
122
arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
Normal file
122
arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
Normal file
@@ -0,0 +1,122 @@
|
||||
/dts-v1/;
|
||||
|
||||
/include/ "bcm2708.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
model = "Raspberry Pi Model B+";
|
||||
|
||||
aliases {
|
||||
soc = &soc;
|
||||
spi0 = &spi0;
|
||||
i2c0 = &i2c0;
|
||||
i2c1 = &i2c1;
|
||||
i2s = &i2s;
|
||||
gpio = &gpio;
|
||||
intc = &intc;
|
||||
leds = &leds;
|
||||
sound = &sound;
|
||||
};
|
||||
|
||||
sound: sound {
|
||||
};
|
||||
};
|
||||
|
||||
&gpio {
|
||||
spi0_pins: spi0_pins {
|
||||
brcm,pins = <7 8 9 10 11>;
|
||||
brcm,function = <4>; /* alt0 */
|
||||
};
|
||||
|
||||
i2c0_pins: i2c0 {
|
||||
brcm,pins = <0 1>;
|
||||
brcm,function = <4>;
|
||||
};
|
||||
|
||||
i2c1_pins: i2c1 {
|
||||
brcm,pins = <2 3>;
|
||||
brcm,function = <4>;
|
||||
};
|
||||
|
||||
i2s_pins: i2s {
|
||||
brcm,pins = <18 19 20 21>;
|
||||
brcm,function = <4>; /* alt0 */
|
||||
};
|
||||
};
|
||||
|
||||
&mmc {
|
||||
status = "okay";
|
||||
bus-width = <4>;
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_pins>;
|
||||
|
||||
spidev@0{
|
||||
compatible = "spidev";
|
||||
reg = <0>; /* CE0 */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
compatible = "spidev";
|
||||
reg = <1>; /* CE1 */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c0_pins>;
|
||||
clock-frequency = <100000>;
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c1_pins>;
|
||||
clock-frequency = <100000>;
|
||||
};
|
||||
|
||||
&i2s {
|
||||
#sound-dai-cells = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2s_pins>;
|
||||
};
|
||||
|
||||
&leds {
|
||||
act_led: act {
|
||||
label = "led0";
|
||||
linux,default-trigger = "mmc0";
|
||||
gpios = <&gpio 47 0>;
|
||||
};
|
||||
|
||||
pwr_led: pwr {
|
||||
label = "led1";
|
||||
linux,default-trigger = "input";
|
||||
gpios = <&gpio 35 0>;
|
||||
};
|
||||
};
|
||||
|
||||
/ {
|
||||
__overrides__ {
|
||||
i2s = <&i2s>,"status";
|
||||
spi = <&spi0>,"status";
|
||||
i2c0 = <&i2c0>,"status";
|
||||
i2c1 = <&i2c1>,"status";
|
||||
i2c0_baudrate = <&i2c0>,"clock-frequency:0";
|
||||
i2c1_baudrate = <&i2c1>,"clock-frequency:0";
|
||||
|
||||
act_led_gpio = <&act_led>,"gpios:4";
|
||||
act_led_activelow = <&act_led>,"gpios:8";
|
||||
act_led_trigger = <&act_led>,"linux,default-trigger";
|
||||
|
||||
pwr_led_gpio = <&pwr_led>,"gpios:4";
|
||||
pwr_led_activelow = <&pwr_led>,"gpios:8";
|
||||
pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
|
||||
};
|
||||
};
|
||||
112
arch/arm/boot/dts/bcm2708-rpi-b.dts
Normal file
112
arch/arm/boot/dts/bcm2708-rpi-b.dts
Normal file
@@ -0,0 +1,112 @@
|
||||
/dts-v1/;
|
||||
|
||||
/include/ "bcm2708.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
model = "Raspberry Pi Model B";
|
||||
|
||||
aliases {
|
||||
soc = &soc;
|
||||
spi0 = &spi0;
|
||||
i2c0 = &i2c0;
|
||||
i2c1 = &i2c1;
|
||||
i2s = &i2s;
|
||||
gpio = &gpio;
|
||||
intc = &intc;
|
||||
leds = &leds;
|
||||
sound = &sound;
|
||||
};
|
||||
|
||||
sound: sound {
|
||||
};
|
||||
};
|
||||
|
||||
&gpio {
|
||||
spi0_pins: spi0_pins {
|
||||
brcm,pins = <7 8 9 10 11>;
|
||||
brcm,function = <4>; /* alt0 */
|
||||
};
|
||||
|
||||
i2c0_pins: i2c0 {
|
||||
brcm,pins = <0 1>;
|
||||
brcm,function = <4>;
|
||||
};
|
||||
|
||||
i2c1_pins: i2c1 {
|
||||
brcm,pins = <2 3>;
|
||||
brcm,function = <4>;
|
||||
};
|
||||
|
||||
i2s_pins: i2s {
|
||||
brcm,pins = <28 29 30 31>;
|
||||
brcm,function = <4>; /* alt0 */
|
||||
};
|
||||
};
|
||||
|
||||
&mmc {
|
||||
status = "okay";
|
||||
bus-width = <4>;
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_pins>;
|
||||
|
||||
spidev@0{
|
||||
compatible = "spidev";
|
||||
reg = <0>; /* CE0 */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
compatible = "spidev";
|
||||
reg = <1>; /* CE1 */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c0_pins>;
|
||||
clock-frequency = <100000>;
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c1_pins>;
|
||||
clock-frequency = <100000>;
|
||||
};
|
||||
|
||||
&i2s {
|
||||
#sound-dai-cells = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2s_pins>;
|
||||
};
|
||||
|
||||
&leds {
|
||||
act_led: act {
|
||||
label = "led0";
|
||||
linux,default-trigger = "mmc0";
|
||||
gpios = <&gpio 16 1>;
|
||||
};
|
||||
};
|
||||
|
||||
/ {
|
||||
__overrides__ {
|
||||
i2s = <&i2s>,"status";
|
||||
spi = <&spi0>,"status";
|
||||
i2c0 = <&i2c0>,"status";
|
||||
i2c1 = <&i2c1>,"status";
|
||||
i2c0_baudrate = <&i2c0>,"clock-frequency:0";
|
||||
i2c1_baudrate = <&i2c1>,"clock-frequency:0";
|
||||
|
||||
act_led_gpio = <&act_led>,"gpios:4";
|
||||
act_led_activelow = <&act_led>,"gpios:8";
|
||||
act_led_trigger = <&act_led>,"linux,default-trigger";
|
||||
};
|
||||
};
|
||||
7
arch/arm/boot/dts/bcm2708-rpi-cm.dts
Executable file
7
arch/arm/boot/dts/bcm2708-rpi-cm.dts
Executable file
@@ -0,0 +1,7 @@
|
||||
/dts-v1/;
|
||||
|
||||
/include/ "bcm2708-rpi-cm.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Raspberry Pi Compute Module";
|
||||
};
|
||||
34
arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
Executable file
34
arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
Executable file
@@ -0,0 +1,34 @@
|
||||
/include/ "bcm2708.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
soc = &soc;
|
||||
spi0 = &spi0;
|
||||
i2c0 = &i2c0;
|
||||
i2c1 = &i2c1;
|
||||
i2s = &i2s;
|
||||
gpio = &gpio;
|
||||
intc = &intc;
|
||||
leds = &leds;
|
||||
sound = &sound;
|
||||
};
|
||||
|
||||
sound: sound {
|
||||
};
|
||||
};
|
||||
|
||||
&leds {
|
||||
act_led: act {
|
||||
label = "led0";
|
||||
linux,default-trigger = "mmc0";
|
||||
gpios = <&gpio 47 0>;
|
||||
};
|
||||
};
|
||||
|
||||
/ {
|
||||
__overrides__ {
|
||||
act_led_gpio = <&act_led>,"gpios:4";
|
||||
act_led_activelow = <&act_led>,"gpios:8";
|
||||
act_led_trigger = <&act_led>,"linux,default-trigger";
|
||||
};
|
||||
};
|
||||
19
arch/arm/boot/dts/bcm2708.dtsi
Normal file
19
arch/arm/boot/dts/bcm2708.dtsi
Normal file
@@ -0,0 +1,19 @@
|
||||
/include/ "bcm2708_common.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
model = "BCM2708";
|
||||
|
||||
chosen {
|
||||
/* No padding required - the boot loader can do that. */
|
||||
bootargs = "";
|
||||
};
|
||||
|
||||
soc {
|
||||
ranges = <0x7e000000 0x20000000 0x01000000>;
|
||||
|
||||
arm-pmu {
|
||||
compatible = "arm,arm1176-pmu";
|
||||
};
|
||||
};
|
||||
};
|
||||
142
arch/arm/boot/dts/bcm2708_common.dtsi
Normal file
142
arch/arm/boot/dts/bcm2708_common.dtsi
Normal file
@@ -0,0 +1,142 @@
|
||||
/include/ "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
soc: soc {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
dma: dma@7e007000 {
|
||||
compatible = "brcm,bcm2835-dma";
|
||||
reg = <0x7e007000 0xf00>;
|
||||
interrupts = <1 16>,
|
||||
<1 17>,
|
||||
<1 18>,
|
||||
<1 19>,
|
||||
<1 20>,
|
||||
<1 21>,
|
||||
<1 22>,
|
||||
<1 23>,
|
||||
<1 24>,
|
||||
<1 25>,
|
||||
<1 26>,
|
||||
<1 27>,
|
||||
<1 28>;
|
||||
|
||||
#dma-cells = <1>;
|
||||
brcm,dma-channel-mask = <0x7f35>;
|
||||
};
|
||||
|
||||
intc: interrupt-controller {
|
||||
compatible = "brcm,bcm2708-armctrl-ic";
|
||||
reg = <0x7e00b200 0x200>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
mailbox: mailbox@7e00b800 {
|
||||
compatible = "brcm,bcm2708-vcio";
|
||||
reg = <0x7e00b880 0x40>;
|
||||
interrupts = <0 1>;
|
||||
};
|
||||
|
||||
gpio: gpio {
|
||||
compatible = "brcm,bcm2835-gpio";
|
||||
reg = <0x7e200000 0xb4>;
|
||||
interrupts = <2 17>, <2 18>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
mmc: mmc@7e300000 {
|
||||
compatible = "brcm,bcm2835-mmc";
|
||||
reg = <0x7e300000 0x100>;
|
||||
interrupts = <2 30>;
|
||||
clocks = <&clk_mmc>;
|
||||
dmas = <&dma 11>,
|
||||
<&dma 11>;
|
||||
dma-names = "tx", "rx";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2s: i2s@7e203000 {
|
||||
compatible = "brcm,bcm2708-i2s";
|
||||
reg = <0x7e203000 0x20>,
|
||||
<0x7e101098 0x02>;
|
||||
|
||||
//dmas = <&dma 2>,
|
||||
// <&dma 3>;
|
||||
dma-names = "tx", "rx";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
spi0: spi@7e204000 {
|
||||
compatible = "brcm,bcm2708-spi";
|
||||
reg = <0x7e204000 0x1000>;
|
||||
interrupts = <2 22>;
|
||||
clocks = <&clk_spi>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2c0: i2c@7e205000 {
|
||||
compatible = "brcm,bcm2708-i2c";
|
||||
reg = <0x7e205000 0x1000>;
|
||||
interrupts = <2 21>;
|
||||
clocks = <&clk_i2c>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2c1: i2c@7e804000 {
|
||||
compatible = "brcm,bcm2708-i2c";
|
||||
reg = <0x7e804000 0x1000>;
|
||||
interrupts = <2 21>;
|
||||
clocks = <&clk_i2c>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
leds: leds {
|
||||
compatible = "gpio-leds";
|
||||
};
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk_mmc: clock@0 {
|
||||
compatible = "fixed-clock";
|
||||
reg = <0>;
|
||||
#clock-cells = <0>;
|
||||
clock-output-names = "mmc";
|
||||
clock-frequency = <250000000>;
|
||||
};
|
||||
|
||||
clk_i2c: i2c {
|
||||
compatible = "fixed-clock";
|
||||
reg = <1>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <250000000>;
|
||||
};
|
||||
|
||||
clk_spi: clock@2 {
|
||||
compatible = "fixed-clock";
|
||||
reg = <2>;
|
||||
#clock-cells = <0>;
|
||||
clock-output-names = "spi";
|
||||
clock-frequency = <250000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
122
arch/arm/boot/dts/bcm2709-rpi-2-b.dts
Normal file
122
arch/arm/boot/dts/bcm2709-rpi-2-b.dts
Normal file
@@ -0,0 +1,122 @@
|
||||
/dts-v1/;
|
||||
|
||||
/include/ "bcm2709.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2709";
|
||||
model = "Raspberry Pi 2 Model B";
|
||||
|
||||
aliases {
|
||||
soc = &soc;
|
||||
spi0 = &spi0;
|
||||
i2c0 = &i2c0;
|
||||
i2c1 = &i2c1;
|
||||
i2s = &i2s;
|
||||
gpio = &gpio;
|
||||
intc = &intc;
|
||||
leds = &leds;
|
||||
sound = &sound;
|
||||
};
|
||||
|
||||
sound: sound {
|
||||
};
|
||||
};
|
||||
|
||||
&gpio {
|
||||
spi0_pins: spi0_pins {
|
||||
brcm,pins = <7 8 9 10 11>;
|
||||
brcm,function = <4>; /* alt0 */
|
||||
};
|
||||
|
||||
i2c0_pins: i2c0 {
|
||||
brcm,pins = <0 1>;
|
||||
brcm,function = <4>;
|
||||
};
|
||||
|
||||
i2c1_pins: i2c1 {
|
||||
brcm,pins = <2 3>;
|
||||
brcm,function = <4>;
|
||||
};
|
||||
|
||||
i2s_pins: i2s {
|
||||
brcm,pins = <18 19 20 21>;
|
||||
brcm,function = <4>; /* alt0 */
|
||||
};
|
||||
};
|
||||
|
||||
&mmc {
|
||||
status = "okay";
|
||||
bus-width = <4>;
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_pins>;
|
||||
|
||||
spidev@0{
|
||||
compatible = "spidev";
|
||||
reg = <0>; /* CE0 */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
compatible = "spidev";
|
||||
reg = <1>; /* CE1 */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c0_pins>;
|
||||
clock-frequency = <100000>;
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c1_pins>;
|
||||
clock-frequency = <100000>;
|
||||
};
|
||||
|
||||
&i2s {
|
||||
#sound-dai-cells = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2s_pins>;
|
||||
};
|
||||
|
||||
&leds {
|
||||
act_led: act {
|
||||
label = "led0";
|
||||
linux,default-trigger = "mmc0";
|
||||
gpios = <&gpio 47 0>;
|
||||
};
|
||||
|
||||
pwr_led: pwr {
|
||||
label = "led1";
|
||||
linux,default-trigger = "input";
|
||||
gpios = <&gpio 35 0>;
|
||||
};
|
||||
};
|
||||
|
||||
/ {
|
||||
__overrides__ {
|
||||
i2s = <&i2s>,"status";
|
||||
spi = <&spi0>,"status";
|
||||
i2c0 = <&i2c0>,"status";
|
||||
i2c1 = <&i2c1>,"status";
|
||||
i2c0_baudrate = <&i2c0>,"clock-frequency:0";
|
||||
i2c1_baudrate = <&i2c1>,"clock-frequency:0";
|
||||
|
||||
act_led_gpio = <&act_led>,"gpios:4";
|
||||
act_led_activelow = <&act_led>,"gpios:8";
|
||||
act_led_trigger = <&act_led>,"linux,default-trigger";
|
||||
|
||||
pwr_led_gpio = <&pwr_led>,"gpios:4";
|
||||
pwr_led_activelow = <&pwr_led>,"gpios:8";
|
||||
pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
|
||||
};
|
||||
};
|
||||
70
arch/arm/boot/dts/bcm2709.dtsi
Normal file
70
arch/arm/boot/dts/bcm2709.dtsi
Normal file
@@ -0,0 +1,70 @@
|
||||
/include/ "bcm2708_common.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2709";
|
||||
model = "BCM2709";
|
||||
|
||||
chosen {
|
||||
/* No padding required - the boot loader can do that. */
|
||||
bootargs = "";
|
||||
};
|
||||
|
||||
soc {
|
||||
ranges = <0x7e000000 0x3f000000 0x01000000>;
|
||||
|
||||
arm-pmu {
|
||||
compatible = "arm,cortex-a7-pmu";
|
||||
interrupts = <3 9>;
|
||||
};
|
||||
};
|
||||
|
||||
timer {
|
||||
compatible = "arm,armv7-timer";
|
||||
clock-frequency = <19200000>;
|
||||
interrupts = <3 0>, // PHYS_SECURE_PPI
|
||||
<3 1>, // PHYS_NONSECURE_PPI
|
||||
<3 3>, // VIRT_PPI
|
||||
<3 2>; // HYP_PPI
|
||||
always-on;
|
||||
};
|
||||
|
||||
cpus: cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
v7_cpu0: cpu@0 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a7";
|
||||
reg = <0xf00>;
|
||||
clock-frequency = <800000000>;
|
||||
};
|
||||
|
||||
v7_cpu1: cpu@1 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a7";
|
||||
reg = <0xf01>;
|
||||
clock-frequency = <800000000>;
|
||||
};
|
||||
|
||||
v7_cpu2: cpu@2 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a7";
|
||||
reg = <0xf02>;
|
||||
clock-frequency = <800000000>;
|
||||
};
|
||||
|
||||
v7_cpu3: cpu@3 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a7";
|
||||
reg = <0xf03>;
|
||||
clock-frequency = <800000000>;
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
arm_freq = <&v7_cpu0>, "clock-frequency:0",
|
||||
<&v7_cpu1>, "clock-frequency:0",
|
||||
<&v7_cpu2>, "clock-frequency:0",
|
||||
<&v7_cpu3>, "clock-frequency:0";
|
||||
};
|
||||
};
|
||||
@@ -45,7 +45,7 @@
|
||||
clock-frequency = <100000>;
|
||||
};
|
||||
|
||||
&sdhci {
|
||||
&mmc {
|
||||
status = "okay";
|
||||
bus-width = <4>;
|
||||
};
|
||||
|
||||
@@ -60,6 +60,12 @@
|
||||
reg = <0x7e104000 0x10>;
|
||||
};
|
||||
|
||||
mailbox: mailbox@7e00b800 {
|
||||
compatible = "brcm,bcm2708-vcio";
|
||||
reg = <0x7e00b880 0x40>;
|
||||
interrupts = <0 1>;
|
||||
};
|
||||
|
||||
gpio: gpio@7e200000 {
|
||||
compatible = "brcm,bcm2835-gpio";
|
||||
reg = <0x7e200000 0xb4>;
|
||||
@@ -122,11 +128,14 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sdhci: sdhci@7e300000 {
|
||||
compatible = "brcm,bcm2835-sdhci";
|
||||
mmc: mmc@7e300000 {
|
||||
compatible = "brcm,bcm2835-mmc";
|
||||
reg = <0x7e300000 0x100>;
|
||||
interrupts = <2 30>;
|
||||
clocks = <&clk_mmc>;
|
||||
dmas = <&dma 11>,
|
||||
<&dma 11>;
|
||||
dma-names = "tx", "rx";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -161,7 +170,7 @@
|
||||
reg = <0>;
|
||||
#clock-cells = <0>;
|
||||
clock-output-names = "mmc";
|
||||
clock-frequency = <100000000>;
|
||||
clock-frequency = <250000000>;
|
||||
};
|
||||
|
||||
clk_i2c: clock@1 {
|
||||
|
||||
23
arch/arm/boot/dts/bmp085_i2c-sensor-overlay.dts
Normal file
23
arch/arm/boot/dts/bmp085_i2c-sensor-overlay.dts
Normal file
@@ -0,0 +1,23 @@
|
||||
// Definitions for BMP085/BMP180 digital barometric pressure and temperature sensors from Bosch Sensortec
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
bmp085@77 {
|
||||
compatible = "bosch,bmp085";
|
||||
reg = <0x77>;
|
||||
default-oversampling = <3>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
22
arch/arm/boot/dts/ds1307-rtc-overlay.dts
Normal file
22
arch/arm/boot/dts/ds1307-rtc-overlay.dts
Normal file
@@ -0,0 +1,22 @@
|
||||
// Definitions for DS1307 Real Time Clock
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ds1307@68 {
|
||||
compatible = "maxim,ds1307";
|
||||
reg = <0x68>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
29
arch/arm/boot/dts/enc28j60-overlay.dts
Executable file
29
arch/arm/boot/dts/enc28j60-overlay.dts
Executable file
@@ -0,0 +1,29 @@
|
||||
// Overlay for the Microchip ENC28J60 Ethernet Controller
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
/* needed to avoid dtc warning */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
status = "okay";
|
||||
|
||||
spidev@0{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
enc28j60@0{
|
||||
compatible = "microchip,enc28j60";
|
||||
reg = <0>; /* CE0 */
|
||||
spi-max-frequency = <12000000>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
39
arch/arm/boot/dts/hifiberry-amp-overlay.dts
Normal file
39
arch/arm/boot/dts/hifiberry-amp-overlay.dts
Normal file
@@ -0,0 +1,39 @@
|
||||
// Definitions for HiFiBerry Amp/Amp+
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&sound>;
|
||||
__overlay__ {
|
||||
compatible = "hifiberry,hifiberry-amp";
|
||||
i2s-controller = <&i2s>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&i2s>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
tas5713@1b {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "ti,tas5713";
|
||||
reg = <0x1b>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
34
arch/arm/boot/dts/hifiberry-dac-overlay.dts
Normal file
34
arch/arm/boot/dts/hifiberry-dac-overlay.dts
Normal file
@@ -0,0 +1,34 @@
|
||||
// Definitions for HiFiBerry DAC
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&sound>;
|
||||
__overlay__ {
|
||||
compatible = "hifiberry,hifiberry-dac";
|
||||
i2s-controller = <&i2s>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&i2s>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
pcm5102a-codec {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "ti,pcm5102a";
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
39
arch/arm/boot/dts/hifiberry-dacplus-overlay.dts
Normal file
39
arch/arm/boot/dts/hifiberry-dacplus-overlay.dts
Normal file
@@ -0,0 +1,39 @@
|
||||
// Definitions for HiFiBerry DAC+
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&sound>;
|
||||
__overlay__ {
|
||||
compatible = "hifiberry,hifiberry-dacplus";
|
||||
i2s-controller = <&i2s>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&i2s>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
pcm5122@4d {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "ti,pcm5122";
|
||||
reg = <0x4d>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
39
arch/arm/boot/dts/hifiberry-digi-overlay.dts
Normal file
39
arch/arm/boot/dts/hifiberry-digi-overlay.dts
Normal file
@@ -0,0 +1,39 @@
|
||||
// Definitions for HiFiBerry Digi
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&sound>;
|
||||
__overlay__ {
|
||||
compatible = "hifiberry,hifiberry-digi";
|
||||
i2s-controller = <&i2s>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&i2s>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
wm8804@3b {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "wlf,wm8804";
|
||||
reg = <0x3b>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
87
arch/arm/boot/dts/hy28a-overlay.dts
Normal file
87
arch/arm/boot/dts/hy28a-overlay.dts
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Device Tree overlay for HY28A display
|
||||
*
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
|
||||
spidev@0{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
hy28a_pins: hy28a_pins {
|
||||
brcm,pins = <17 25 18>;
|
||||
brcm,function = <0 1 1>; /* in out out */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
/* needed to avoid dtc warning */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
hy28a: hy28a@0{
|
||||
compatible = "ilitek,ili9320";
|
||||
reg = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hy28a_pins>;
|
||||
|
||||
spi-max-frequency = <32000000>;
|
||||
spi-cpol;
|
||||
spi-cpha;
|
||||
rotate = <270>;
|
||||
bgr;
|
||||
fps = <50>;
|
||||
buswidth = <8>;
|
||||
startbyte = <0x70>;
|
||||
reset-gpios = <&gpio 25 0>;
|
||||
led-gpios = <&gpio 18 1>;
|
||||
debug = <0>;
|
||||
};
|
||||
|
||||
hy28a_ts: hy28a-ts@1 {
|
||||
compatible = "ti,ads7846";
|
||||
reg = <1>;
|
||||
|
||||
spi-max-frequency = <2000000>;
|
||||
interrupts = <17 2>; /* high-to-low edge triggered */
|
||||
interrupt-parent = <&gpio>;
|
||||
pendown-gpio = <&gpio 17 0>;
|
||||
ti,x-plate-ohms = /bits/ 16 <100>;
|
||||
ti,pressure-max = /bits/ 16 <255>;
|
||||
};
|
||||
};
|
||||
};
|
||||
__overrides__ {
|
||||
speed = <&hy28a>,"spi-max-frequency:0";
|
||||
rotate = <&hy28a>,"rotate:0";
|
||||
fps = <&hy28a>,"fps:0";
|
||||
debug = <&hy28a>,"debug:0";
|
||||
xohms = <&hy28a_ts>,"ti,x-plate-ohms;0";
|
||||
resetgpio = <&hy28a>,"reset-gpios:4",
|
||||
<&hy28a_pins>, "brcm,pins:1";
|
||||
ledgpio = <&hy28a>,"led-gpios:4",
|
||||
<&hy28a_pins>, "brcm,pins:2";
|
||||
};
|
||||
};
|
||||
142
arch/arm/boot/dts/hy28b-overlay.dts
Normal file
142
arch/arm/boot/dts/hy28b-overlay.dts
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Device Tree overlay for HY28b display shield by Texy
|
||||
*
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
|
||||
spidev@0{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
hy28b_pins: hy28b_pins {
|
||||
brcm,pins = <17 25 18>;
|
||||
brcm,function = <0 1 1>; /* in out out */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
/* needed to avoid dtc warning */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
hy28b: hy28b@0{
|
||||
compatible = "ilitek,ili9325";
|
||||
reg = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hy28b_pins>;
|
||||
|
||||
spi-max-frequency = <48000000>;
|
||||
spi-cpol;
|
||||
spi-cpha;
|
||||
rotate = <270>;
|
||||
bgr;
|
||||
fps = <50>;
|
||||
buswidth = <8>;
|
||||
startbyte = <0x70>;
|
||||
reset-gpios = <&gpio 25 0>;
|
||||
led-gpios = <&gpio 18 1>;
|
||||
|
||||
gamma = "04 1F 4 7 7 0 7 7 6 0\n0F 00 1 7 4 0 0 0 6 7";
|
||||
|
||||
init = <0x10000e7 0x0010
|
||||
0x1000000 0x0001
|
||||
0x1000001 0x0100
|
||||
0x1000002 0x0700
|
||||
0x1000003 0x1030
|
||||
0x1000004 0x0000
|
||||
0x1000008 0x0207
|
||||
0x1000009 0x0000
|
||||
0x100000a 0x0000
|
||||
0x100000c 0x0001
|
||||
0x100000d 0x0000
|
||||
0x100000f 0x0000
|
||||
0x1000010 0x0000
|
||||
0x1000011 0x0007
|
||||
0x1000012 0x0000
|
||||
0x1000013 0x0000
|
||||
0x2000032
|
||||
0x1000010 0x1590
|
||||
0x1000011 0x0227
|
||||
0x2000032
|
||||
0x1000012 0x009c
|
||||
0x2000032
|
||||
0x1000013 0x1900
|
||||
0x1000029 0x0023
|
||||
0x100002b 0x000e
|
||||
0x2000032
|
||||
0x1000020 0x0000
|
||||
0x1000021 0x0000
|
||||
0x2000032
|
||||
0x1000050 0x0000
|
||||
0x1000051 0x00ef
|
||||
0x1000052 0x0000
|
||||
0x1000053 0x013f
|
||||
0x1000060 0xa700
|
||||
0x1000061 0x0001
|
||||
0x100006a 0x0000
|
||||
0x1000080 0x0000
|
||||
0x1000081 0x0000
|
||||
0x1000082 0x0000
|
||||
0x1000083 0x0000
|
||||
0x1000084 0x0000
|
||||
0x1000085 0x0000
|
||||
0x1000090 0x0010
|
||||
0x1000092 0x0000
|
||||
0x1000093 0x0003
|
||||
0x1000095 0x0110
|
||||
0x1000097 0x0000
|
||||
0x1000098 0x0000
|
||||
0x1000007 0x0133
|
||||
0x1000020 0x0000
|
||||
0x1000021 0x0000
|
||||
0x2000064>;
|
||||
debug = <0>;
|
||||
};
|
||||
|
||||
hy28b_ts: hy28b-ts@1 {
|
||||
compatible = "ti,ads7846";
|
||||
reg = <1>;
|
||||
|
||||
spi-max-frequency = <2000000>;
|
||||
interrupts = <17 2>; /* high-to-low edge triggered */
|
||||
interrupt-parent = <&gpio>;
|
||||
pendown-gpio = <&gpio 17 0>;
|
||||
ti,x-plate-ohms = /bits/ 16 <100>;
|
||||
ti,pressure-max = /bits/ 16 <255>;
|
||||
};
|
||||
};
|
||||
};
|
||||
__overrides__ {
|
||||
speed = <&hy28b>,"spi-max-frequency:0";
|
||||
rotate = <&hy28b>,"rotate:0";
|
||||
fps = <&hy28b>,"fps:0";
|
||||
debug = <&hy28b>,"debug:0";
|
||||
xohms = <&hy28b_ts>,"ti,x-plate-ohms;0";
|
||||
resetgpio = <&hy28b>,"reset-gpios:4",
|
||||
<&hy28b_pins>, "brcm,pins:1";
|
||||
ledgpio = <&hy28b>,"led-gpios:4",
|
||||
<&hy28b_pins>, "brcm,pins:2";
|
||||
};
|
||||
};
|
||||
43
arch/arm/boot/dts/i2c-rtc-overlay.dts
Normal file
43
arch/arm/boot/dts/i2c-rtc-overlay.dts
Normal file
@@ -0,0 +1,43 @@
|
||||
// Definitions for several I2C based Real Time Clocks
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ds1307: ds1307@68 {
|
||||
compatible = "maxim,ds1307";
|
||||
reg = <0x68>;
|
||||
status = "disable";
|
||||
};
|
||||
ds3231: ds3231@68 {
|
||||
compatible = "maxim,ds3231";
|
||||
reg = <0x68>;
|
||||
status = "disable";
|
||||
};
|
||||
pcf2127: pcf2127@51 {
|
||||
compatible = "nxp,pcf2127";
|
||||
reg = <0x51>;
|
||||
status = "disable";
|
||||
};
|
||||
pcf8523: pcf8523@68 {
|
||||
compatible = "nxp,pcf8523";
|
||||
reg = <0x68>;
|
||||
status = "disable";
|
||||
};
|
||||
};
|
||||
};
|
||||
__overrides__ {
|
||||
ds1307 = <&ds1307>,"status";
|
||||
ds3231 = <&ds3231>,"status";
|
||||
pcf2127 = <&pcf2127>,"status";
|
||||
pcf8523 = <&pcf8523>,"status";
|
||||
};
|
||||
};
|
||||
39
arch/arm/boot/dts/iqaudio-dac-overlay.dts
Normal file
39
arch/arm/boot/dts/iqaudio-dac-overlay.dts
Normal file
@@ -0,0 +1,39 @@
|
||||
// Definitions for IQaudIO DAC
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&sound>;
|
||||
__overlay__ {
|
||||
compatible = "iqaudio,iqaudio-dac";
|
||||
i2s-controller = <&i2s>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&i2s>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
pcm5122@4c {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "ti,pcm5122";
|
||||
reg = <0x4c>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
39
arch/arm/boot/dts/iqaudio-dacplus-overlay.dts
Normal file
39
arch/arm/boot/dts/iqaudio-dacplus-overlay.dts
Normal file
@@ -0,0 +1,39 @@
|
||||
// Definitions for IQaudIO DAC+
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&sound>;
|
||||
__overlay__ {
|
||||
compatible = "iqaudio,iqaudio-dac";
|
||||
i2s-controller = <&i2s>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&i2s>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
pcm5122@4c {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "ti,pcm5122";
|
||||
reg = <0x4c>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
57
arch/arm/boot/dts/lirc-rpi-overlay.dts
Normal file
57
arch/arm/boot/dts/lirc-rpi-overlay.dts
Normal file
@@ -0,0 +1,57 @@
|
||||
// Definitions for lirc-rpi module
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
lirc_rpi: lirc_rpi {
|
||||
compatible = "rpi,lirc-rpi";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&lirc_pins>;
|
||||
status = "okay";
|
||||
|
||||
// Override autodetection of IR receiver circuit
|
||||
// (0 = active high, 1 = active low, -1 = no override )
|
||||
rpi,sense = <0xffffffff>;
|
||||
|
||||
// Software carrier
|
||||
// (0 = off, 1 = on)
|
||||
rpi,softcarrier = <1>;
|
||||
|
||||
// Invert output
|
||||
// (0 = off, 1 = on)
|
||||
rpi,invert = <0>;
|
||||
|
||||
// Enable debugging messages
|
||||
// (0 = off, 1 = on)
|
||||
rpi,debug = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
lirc_pins: lirc_pins {
|
||||
brcm,pins = <17 18>;
|
||||
brcm,function = <1 0>; // out in
|
||||
brcm,pull = <0 1>; // off down
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
gpio_out_pin = <&lirc_pins>,"brcm,pins:0";
|
||||
gpio_in_pin = <&lirc_pins>,"brcm,pins:4";
|
||||
gpio_in_pull = <&lirc_pins>,"brcm,pull:4";
|
||||
|
||||
sense = <&lirc_rpi>,"rpi,sense:0";
|
||||
softcarrier = <&lirc_rpi>,"rpi,softcarrier:0";
|
||||
invert = <&lirc_rpi>,"rpi,invert:0";
|
||||
debug = <&lirc_rpi>,"rpi,debug:0";
|
||||
};
|
||||
};
|
||||
19
arch/arm/boot/dts/mmc-overlay.dts
Normal file
19
arch/arm/boot/dts/mmc-overlay.dts
Normal file
@@ -0,0 +1,19 @@
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/{
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&mmc>;
|
||||
|
||||
__overlay__ {
|
||||
brcm,overclock-50 = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
overclock_50 = <&mmc>,"brcm,overclock-50:0";
|
||||
force_pio = <&mmc>,"brcm,force-pio?";
|
||||
};
|
||||
};
|
||||
109
arch/arm/boot/dts/mz61581-overlay.dts
Normal file
109
arch/arm/boot/dts/mz61581-overlay.dts
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Device Tree overlay for MZ61581-PI-EXT 2014.12.28 by Tontec
|
||||
*
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
|
||||
spidev@0{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
mz61581_pins: mz61581_pins {
|
||||
brcm,pins = <4 15 18 25>;
|
||||
brcm,function = <0 1 1 1>; /* in out out out */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
/* needed to avoid dtc warning */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
mz61581: mz61581@0{
|
||||
compatible = "samsung,s6d02a1";
|
||||
reg = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mz61581_pins>;
|
||||
|
||||
spi-max-frequency = <128000000>;
|
||||
spi-cpol;
|
||||
spi-cpha;
|
||||
|
||||
width = <320>;
|
||||
height = <480>;
|
||||
rotate = <270>;
|
||||
bgr;
|
||||
fps = <30>;
|
||||
buswidth = <8>;
|
||||
|
||||
reset-gpios = <&gpio 15 0>;
|
||||
dc-gpios = <&gpio 25 0>;
|
||||
led-gpios = <&gpio 18 0>;
|
||||
|
||||
init = <0x10000b0 00
|
||||
0x1000011
|
||||
0x20000ff
|
||||
0x10000b3 0x02 0x00 0x00 0x00
|
||||
0x10000c0 0x13 0x3b 0x00 0x02 0x00 0x01 0x00 0x43
|
||||
0x10000c1 0x08 0x16 0x08 0x08
|
||||
0x10000c4 0x11 0x07 0x03 0x03
|
||||
0x10000c6 0x00
|
||||
0x10000c8 0x03 0x03 0x13 0x5c 0x03 0x07 0x14 0x08 0x00 0x21 0x08 0x14 0x07 0x53 0x0c 0x13 0x03 0x03 0x21 0x00
|
||||
0x1000035 0x00
|
||||
0x1000036 0xa0
|
||||
0x100003a 0x55
|
||||
0x1000044 0x00 0x01
|
||||
0x10000d0 0x07 0x07 0x1d 0x03
|
||||
0x10000d1 0x03 0x30 0x10
|
||||
0x10000d2 0x03 0x14 0x04
|
||||
0x1000029
|
||||
0x100002c>;
|
||||
|
||||
/* This is a workaround to make sure the init sequence slows down and doesn't fail */
|
||||
debug = <3>;
|
||||
};
|
||||
|
||||
mz61581_ts: mz61581_ts@1 {
|
||||
compatible = "ti,ads7846";
|
||||
reg = <1>;
|
||||
|
||||
spi-max-frequency = <2000000>;
|
||||
interrupts = <4 2>; /* high-to-low edge triggered */
|
||||
interrupt-parent = <&gpio>;
|
||||
pendown-gpio = <&gpio 4 0>;
|
||||
|
||||
ti,x-plate-ohms = /bits/ 16 <60>;
|
||||
ti,pressure-max = /bits/ 16 <255>;
|
||||
};
|
||||
};
|
||||
};
|
||||
__overrides__ {
|
||||
speed = <&mz61581>, "spi-max-frequency:0";
|
||||
rotate = <&mz61581>, "rotate:0";
|
||||
fps = <&mz61581>, "fps:0";
|
||||
debug = <&mz61581>, "debug:0";
|
||||
xohms = <&mz61581_ts>,"ti,x-plate-ohms;0";
|
||||
};
|
||||
};
|
||||
22
arch/arm/boot/dts/pcf2127-rtc-overlay.dts
Normal file
22
arch/arm/boot/dts/pcf2127-rtc-overlay.dts
Normal file
@@ -0,0 +1,22 @@
|
||||
// Definitions for PCF2127 Real Time Clock
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
pcf2127@51 {
|
||||
compatible = "nxp,pcf2127";
|
||||
reg = <0x51>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
22
arch/arm/boot/dts/pcf8523-rtc-overlay.dts
Normal file
22
arch/arm/boot/dts/pcf8523-rtc-overlay.dts
Normal file
@@ -0,0 +1,22 @@
|
||||
// Definitions for PCF8523 Real Time Clock
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
pcf8523@68 {
|
||||
compatible = "nxp,pcf8523";
|
||||
reg = <0x68>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
94
arch/arm/boot/dts/piscreen-overlay.dts
Normal file
94
arch/arm/boot/dts/piscreen-overlay.dts
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Device Tree overlay for PiScreen 3.5" display shield by Ozzmaker
|
||||
*
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
|
||||
spidev@0{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
piscreen_pins: piscreen_pins {
|
||||
brcm,pins = <17 25 24 22>;
|
||||
brcm,function = <0 1 1 1>; /* in out out out */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
/* needed to avoid dtc warning */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
piscreen: piscreen@0{
|
||||
compatible = "ilitek,ili9486";
|
||||
reg = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&piscreen_pins>;
|
||||
|
||||
spi-max-frequency = <24000000>;
|
||||
rotate = <270>;
|
||||
bgr;
|
||||
fps = <30>;
|
||||
buswidth = <8>;
|
||||
regwidth = <16>;
|
||||
reset-gpios = <&gpio 25 0>;
|
||||
dc-gpios = <&gpio 24 0>;
|
||||
led-gpios = <&gpio 22 1>;
|
||||
debug = <0>;
|
||||
|
||||
init = <0x10000b0 0x00
|
||||
0x1000011
|
||||
0x20000ff
|
||||
0x100003a 0x55
|
||||
0x1000036 0x28
|
||||
0x10000c2 0x44
|
||||
0x10000c5 0x00 0x00 0x00 0x00
|
||||
0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00
|
||||
0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
|
||||
0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
|
||||
0x1000011
|
||||
0x1000029>;
|
||||
};
|
||||
|
||||
piscreen-ts@1 {
|
||||
compatible = "ti,ads7846";
|
||||
reg = <1>;
|
||||
|
||||
spi-max-frequency = <2000000>;
|
||||
interrupts = <17 2>; /* high-to-low edge triggered */
|
||||
interrupt-parent = <&gpio>;
|
||||
pendown-gpio = <&gpio 17 0>;
|
||||
ti,x-plate-ohms = /bits/ 16 <100>;
|
||||
ti,pressure-max = /bits/ 16 <255>;
|
||||
};
|
||||
};
|
||||
};
|
||||
__overrides__ {
|
||||
speed = <&piscreen>,"spi-max-frequency:0";
|
||||
rotate = <&piscreen>,"rotate:0";
|
||||
fps = <&piscreen>,"fps:0";
|
||||
debug = <&piscreen>,"debug:0";
|
||||
};
|
||||
};
|
||||
115
arch/arm/boot/dts/pitft28-resistive-overlay.dts
Normal file
115
arch/arm/boot/dts/pitft28-resistive-overlay.dts
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Device Tree overlay for Adafruit PiTFT 2.8" resistive touch screen
|
||||
*
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
|
||||
spidev@0{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
pitft_pins: pitft_pins {
|
||||
brcm,pins = <24 25>;
|
||||
brcm,function = <0 1>; /* in out */
|
||||
brcm,pull = <2 0>; /* pullup none */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
/* needed to avoid dtc warning */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
pitft: pitft@0{
|
||||
compatible = "ilitek,ili9340";
|
||||
reg = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pitft_pins>;
|
||||
|
||||
spi-max-frequency = <32000000>;
|
||||
rotate = <90>;
|
||||
fps = <25>;
|
||||
bgr;
|
||||
buswidth = <8>;
|
||||
dc-gpios = <&gpio 25 0>;
|
||||
debug = <0>;
|
||||
};
|
||||
|
||||
pitft_ts@1 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "st,stmpe610";
|
||||
reg = <1>;
|
||||
|
||||
spi-max-frequency = <500000>;
|
||||
irq-gpio = <&gpio 24 0x2>; /* IRQF_TRIGGER_FALLING */
|
||||
interrupts = <24 2>; /* high-to-low edge triggered */
|
||||
interrupt-parent = <&gpio>;
|
||||
interrupt-controller;
|
||||
|
||||
stmpe_touchscreen {
|
||||
compatible = "st,stmpe-ts";
|
||||
st,sample-time = <4>;
|
||||
st,mod-12b = <1>;
|
||||
st,ref-sel = <0>;
|
||||
st,adc-freq = <2>;
|
||||
st,ave-ctrl = <3>;
|
||||
st,touch-det-delay = <4>;
|
||||
st,settling = <2>;
|
||||
st,fraction-z = <7>;
|
||||
st,i-drive = <0>;
|
||||
};
|
||||
|
||||
stmpe_gpio: stmpe_gpio {
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stmpe-gpio";
|
||||
/*
|
||||
* only GPIO2 is wired/available
|
||||
* and it is wired to the backlight
|
||||
*/
|
||||
st,norequest-mask = <0x7b>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@3 {
|
||||
target-path = "/soc";
|
||||
__overlay__ {
|
||||
backlight {
|
||||
compatible = "gpio-backlight";
|
||||
gpios = <&stmpe_gpio 2 0>;
|
||||
default-on;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
speed = <&pitft>,"spi-max-frequency:0";
|
||||
rotate = <&pitft>,"rotate:0";
|
||||
fps = <&pitft>,"fps:0";
|
||||
debug = <&pitft>,"debug:0";
|
||||
};
|
||||
};
|
||||
34
arch/arm/boot/dts/pps-gpio-overlay.dts
Normal file
34
arch/arm/boot/dts/pps-gpio-overlay.dts
Normal file
@@ -0,0 +1,34 @@
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
fragment@0 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
pps: pps {
|
||||
compatible = "pps-gpio";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pps_pins>;
|
||||
gpios = <&gpio 18 0>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
pps_pins: pps_pins {
|
||||
brcm,pins = <18>;
|
||||
brcm,function = <0>; // in
|
||||
brcm,pull = <0>; // off
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
gpiopin = <&pps>,"gpios:4",
|
||||
<&pps_pins>,"brcm,pins:0";
|
||||
};
|
||||
};
|
||||
34
arch/arm/boot/dts/rpi-dac-overlay.dts
Normal file
34
arch/arm/boot/dts/rpi-dac-overlay.dts
Normal file
@@ -0,0 +1,34 @@
|
||||
// Definitions for RPi DAC
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&sound>;
|
||||
__overlay__ {
|
||||
compatible = "rpi,rpi-dac";
|
||||
i2s-controller = <&i2s>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&i2s>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
pcm1794a-codec {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "ti,pcm1794a";
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
82
arch/arm/boot/dts/rpi-display-overlay.dts
Normal file
82
arch/arm/boot/dts/rpi-display-overlay.dts
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Device Tree overlay for rpi-display by Watterott
|
||||
*
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
|
||||
spidev@0{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
spidev@1{
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
rpi_display_pins: rpi_display_pins {
|
||||
brcm,pins = <18 23 24 25>;
|
||||
brcm,function = <1 1 1 0>; /* out out out in */
|
||||
brcm,pull = <0 0 0 2>; /* - - - up */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
/* needed to avoid dtc warning */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
rpidisplay: rpi-display@0{
|
||||
compatible = "ilitek,ili9341";
|
||||
reg = <0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&rpi_display_pins>;
|
||||
|
||||
spi-max-frequency = <32000000>;
|
||||
rotate = <270>;
|
||||
bgr;
|
||||
fps = <30>;
|
||||
buswidth = <8>;
|
||||
reset-gpios = <&gpio 23 0>;
|
||||
dc-gpios = <&gpio 24 0>;
|
||||
led-gpios = <&gpio 18 1>;
|
||||
debug = <0>;
|
||||
};
|
||||
|
||||
rpidisplay_ts: rpi-display-ts@1 {
|
||||
compatible = "ti,ads7846";
|
||||
reg = <1>;
|
||||
|
||||
spi-max-frequency = <2000000>;
|
||||
interrupts = <25 2>; /* high-to-low edge triggered */
|
||||
interrupt-parent = <&gpio>;
|
||||
pendown-gpio = <&gpio 25 0>;
|
||||
ti,x-plate-ohms = /bits/ 16 <60>;
|
||||
ti,pressure-max = /bits/ 16 <255>;
|
||||
};
|
||||
};
|
||||
};
|
||||
__overrides__ {
|
||||
speed = <&rpidisplay>,"spi-max-frequency:0";
|
||||
rotate = <&rpidisplay>,"rotate:0";
|
||||
fps = <&rpidisplay>,"fps:0";
|
||||
debug = <&rpidisplay>,"debug:0";
|
||||
xohms = <&rpidisplay_ts>,"ti,x-plate-ohms;0";
|
||||
};
|
||||
};
|
||||
39
arch/arm/boot/dts/rpi-proto-overlay.dts
Normal file
39
arch/arm/boot/dts/rpi-proto-overlay.dts
Normal file
@@ -0,0 +1,39 @@
|
||||
// Definitions for Rpi-Proto
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&sound>;
|
||||
__overlay__ {
|
||||
compatible = "rpi,rpi-proto";
|
||||
i2s-controller = <&i2s>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&i2s>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&i2c1>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
wm8731@1a {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "wlf,wm8731";
|
||||
reg = <0x1a>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
75
arch/arm/boot/dts/sdhost-overlay.dts
Normal file
75
arch/arm/boot/dts/sdhost-overlay.dts
Normal file
@@ -0,0 +1,75 @@
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/{
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target = <&soc>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
sdhost: sdhost@7e202000 {
|
||||
compatible = "brcm,bcm2835-sdhost";
|
||||
reg = <0x7e202000 0x100>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&sdhost_pins>;
|
||||
interrupts = <2 24>;
|
||||
clocks = <&clk_sdhost>;
|
||||
dmas = <&dma 13>,
|
||||
<&dma 13>;
|
||||
dma-names = "tx", "rx";
|
||||
brcm,delay-after-stop = <0>;
|
||||
brcm,overclock-50 = <0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
clocks {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk_sdhost: clock@3 {
|
||||
compatible = "fixed-clock";
|
||||
reg = <0>;
|
||||
#clock-cells = <0>;
|
||||
clock-output-names = "sdhost";
|
||||
clock-frequency = <250000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
sdhost_pins: sdhost_pins {
|
||||
brcm,pins = <48 49 50 51 52 53>;
|
||||
brcm,function = <4>; /* alt0 */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target = <&mmc>;
|
||||
__overlay__ {
|
||||
/* Find a way to disable the other driver */
|
||||
compatible = "";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@3 {
|
||||
target-path = "/__overrides__";
|
||||
__overlay__ {
|
||||
sdhost_freq = <&clk_sdhost>,"clock-frequency:0";
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
delay_after_stop = <&sdhost>,"brcm,delay-after-stop:0";
|
||||
overclock_50 = <&sdhost>,"brcm,overclock-50:0";
|
||||
force_pio = <&sdhost>,"brcm,force-pio?";
|
||||
sdhost_freq = <&clk_sdhost>,"clock-frequency:0";
|
||||
};
|
||||
};
|
||||
18
arch/arm/boot/dts/spi-bcm2835-overlay.dts
Normal file
18
arch/arm/boot/dts/spi-bcm2835-overlay.dts
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Device tree overlay for spi-bcm2835
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
|
||||
/* setting up compatiblity to allow loading the spi-bcm2835 driver */
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
compatible = "brcm,bcm2835-spi";
|
||||
};
|
||||
};
|
||||
};
|
||||
39
arch/arm/boot/dts/w1-gpio-overlay.dts
Normal file
39
arch/arm/boot/dts/w1-gpio-overlay.dts
Normal file
@@ -0,0 +1,39 @@
|
||||
// Definitions for w1-gpio module (without external pullup)
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
|
||||
w1: onewire@0 {
|
||||
compatible = "w1-gpio";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&w1_pins>;
|
||||
gpios = <&gpio 4 0>;
|
||||
rpi,parasitic-power = <0>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
w1_pins: w1_pins {
|
||||
brcm,pins = <4>;
|
||||
brcm,function = <0>; // in (initially)
|
||||
brcm,pull = <0>; // off
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
gpiopin = <&w1>,"gpios:4",
|
||||
<&w1_pins>,"brcm,pins:0";
|
||||
pullup = <&w1>,"rpi,parasitic-power:0";
|
||||
};
|
||||
};
|
||||
41
arch/arm/boot/dts/w1-gpio-pullup-overlay.dts
Normal file
41
arch/arm/boot/dts/w1-gpio-pullup-overlay.dts
Normal file
@@ -0,0 +1,41 @@
|
||||
// Definitions for w1-gpio module (with external pullup)
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
|
||||
w1: onewire@0 {
|
||||
compatible = "w1-gpio";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&w1_pins>;
|
||||
gpios = <&gpio 4 0>, <&gpio 5 1>;
|
||||
rpi,parasitic-power = <0>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
w1_pins: w1_pins {
|
||||
brcm,pins = <4 5>;
|
||||
brcm,function = <0 1>; // in out
|
||||
brcm,pull = <0 0>; // off off
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
gpiopin = <&w1>,"gpios:4",
|
||||
<&w1_pins>,"brcm,pins:0";
|
||||
extpullup = <&w1>,"gpios:16",
|
||||
<&w1_pins>,"brcm,pins:4";
|
||||
pullup = <&w1>,"rpi,parasitic-power:0";
|
||||
};
|
||||
};
|
||||
1194
arch/arm/configs/bcm2709_defconfig
Normal file
1194
arch/arm/configs/bcm2709_defconfig
Normal file
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,6 @@ CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_RESOURCE_COUNTERS=y
|
||||
CONFIG_CGROUP_PERF=y
|
||||
CONFIG_CFS_BANDWIDTH=y
|
||||
CONFIG_RT_GROUP_SCHED=y
|
||||
@@ -18,10 +17,6 @@ CONFIG_NAMESPACES=y
|
||||
CONFIG_SCHED_AUTOGROUP=y
|
||||
CONFIG_RELAY=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_RD_BZIP2=y
|
||||
CONFIG_RD_LZMA=y
|
||||
CONFIG_RD_XZ=y
|
||||
CONFIG_RD_LZO=y
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_KALLSYMS_ALL=y
|
||||
CONFIG_EMBEDDED=y
|
||||
@@ -29,6 +24,7 @@ CONFIG_EMBEDDED=y
|
||||
CONFIG_PROFILING=y
|
||||
CONFIG_OPROFILE=y
|
||||
CONFIG_JUMP_LABEL=y
|
||||
CONFIG_CC_STACKPROTECTOR_REGULAR=y
|
||||
CONFIG_ARCH_MULTI_V6=y
|
||||
# CONFIG_ARCH_MULTI_V7 is not set
|
||||
CONFIG_ARCH_BCM=y
|
||||
@@ -38,7 +34,6 @@ CONFIG_AEABI=y
|
||||
CONFIG_KSM=y
|
||||
CONFIG_CLEANCACHE=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_CC_STACKPROTECTOR=y
|
||||
CONFIG_KEXEC=y
|
||||
CONFIG_CRASH_DUMP=y
|
||||
CONFIG_VFP=y
|
||||
@@ -57,7 +52,6 @@ CONFIG_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_STANDALONE is not set
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_SCSI_MULTI_LUN=y
|
||||
CONFIG_SCSI_CONSTANTS=y
|
||||
CONFIG_SCSI_SCAN_ASYNC=y
|
||||
CONFIG_NETDEVICES=y
|
||||
@@ -83,11 +77,17 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_DWC2=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BCM2835=y
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_MMC_SDHCI_BCM2835=y
|
||||
CONFIG_NEW_LEDS=y
|
||||
CONFIG_LEDS_CLASS=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LEDS_TRIGGERS=y
|
||||
CONFIG_LEDS_TRIGGER_TIMER=y
|
||||
CONFIG_LEDS_TRIGGER_ONESHOT=y
|
||||
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
|
||||
@@ -96,9 +96,11 @@ CONFIG_LEDS_TRIGGER_GPIO=y
|
||||
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
|
||||
CONFIG_LEDS_TRIGGER_TRANSIENT=y
|
||||
CONFIG_LEDS_TRIGGER_CAMERA=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_BCM2708=y
|
||||
CONFIG_STAGING=y
|
||||
CONFIG_USB_DWC2=y
|
||||
CONFIG_USB_DWC2_HOST=y
|
||||
CONFIG_MAILBOX=y
|
||||
CONFIG_BCM2708_MBOX=y
|
||||
# CONFIG_IOMMU_SUPPORT is not set
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT2_FS_XATTR=y
|
||||
|
||||
1189
arch/arm/configs/bcmrpi_defconfig
Normal file
1189
arch/arm/configs/bcmrpi_defconfig
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
#include <asm/assembler.h>
|
||||
|
||||
#ifndef CONFIG_ARCH_BCM2709
|
||||
/*
|
||||
* Interrupt handling. Preserves r7, r8, r9
|
||||
*/
|
||||
@@ -28,6 +29,7 @@
|
||||
#endif
|
||||
9997:
|
||||
.endm
|
||||
#endif
|
||||
|
||||
.macro arch_irq_handler, symbol_name
|
||||
.align 5
|
||||
|
||||
@@ -145,12 +145,22 @@ static inline unsigned long arch_local_save_flags(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* restore saved IRQ & FIQ state
|
||||
* restore saved IRQ state
|
||||
*/
|
||||
static inline void arch_local_irq_restore(unsigned long flags)
|
||||
{
|
||||
asm volatile(
|
||||
" msr " IRQMASK_REG_NAME_W ", %0 @ local_irq_restore"
|
||||
unsigned long temp = 0;
|
||||
flags &= ~(1 << 6);
|
||||
asm volatile (
|
||||
" mrs %0, cpsr"
|
||||
: "=r" (temp)
|
||||
:
|
||||
: "memory", "cc");
|
||||
/* Preserve FIQ bit */
|
||||
temp &= (1 << 6);
|
||||
flags = flags | temp;
|
||||
asm volatile (
|
||||
" msr cpsr_c, %0 @ local_irq_restore"
|
||||
:
|
||||
: "r" (flags)
|
||||
: "memory", "cc");
|
||||
|
||||
@@ -47,3 +47,7 @@ ENTRY(__get_fiq_regs)
|
||||
mov r0, r0 @ avoid hazard prior to ARMv4
|
||||
ret lr
|
||||
ENDPROC(__get_fiq_regs)
|
||||
|
||||
ENTRY(__FIQ_Branch)
|
||||
mov pc, r8
|
||||
ENDPROC(__FIQ_Branch)
|
||||
|
||||
@@ -680,6 +680,14 @@ ARM_BE8(rev16 ip, ip)
|
||||
ldrcc r7, [r4], #4 @ use branch for delay slot
|
||||
bcc 1b
|
||||
ret lr
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
#endif
|
||||
ENDPROC(__fixup_a_pv_table)
|
||||
|
||||
|
||||
@@ -172,6 +172,16 @@ void arch_cpu_idle_dead(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
char bcm2708_reboot_mode = 'h';
|
||||
|
||||
int __init reboot_setup(char *str)
|
||||
{
|
||||
bcm2708_reboot_mode = str[0];
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("reboot=", reboot_setup);
|
||||
|
||||
/*
|
||||
* Called by kexec, immediately prior to machine_kexec().
|
||||
*
|
||||
|
||||
52
arch/arm/mach-bcm2708/Kconfig
Normal file
52
arch/arm/mach-bcm2708/Kconfig
Normal file
@@ -0,0 +1,52 @@
|
||||
menu "Broadcom BCM2708 Implementations"
|
||||
depends on ARCH_BCM2708
|
||||
|
||||
config MACH_BCM2708
|
||||
bool "Broadcom BCM2708 Development Platform"
|
||||
select NEED_MACH_MEMORY_H
|
||||
select NEED_MACH_IO_H
|
||||
select CPU_V6
|
||||
help
|
||||
Include support for the Broadcom(R) BCM2708 platform.
|
||||
|
||||
config BCM2708_DT
|
||||
bool "BCM2708 Device Tree support"
|
||||
depends on MACH_BCM2708
|
||||
default n
|
||||
select USE_OF
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select PINCTRL
|
||||
select PINCTRL_BCM2835
|
||||
help
|
||||
Enable Device Tree support for BCM2708
|
||||
|
||||
config BCM2708_GPIO
|
||||
bool "BCM2708 gpio support"
|
||||
depends on MACH_BCM2708
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
default y
|
||||
help
|
||||
Include support for the Broadcom(R) BCM2708 gpio.
|
||||
|
||||
config BCM2708_VCMEM
|
||||
bool "Videocore Memory"
|
||||
depends on MACH_BCM2708
|
||||
default y
|
||||
help
|
||||
Helper for videocore memory access and total size allocation.
|
||||
|
||||
config BCM2708_NOL2CACHE
|
||||
bool "Videocore L2 cache disable"
|
||||
depends on MACH_BCM2708
|
||||
default n
|
||||
help
|
||||
Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt.
|
||||
|
||||
config BCM2708_SPIDEV
|
||||
bool "Bind spidev to SPI0 master"
|
||||
depends on MACH_BCM2708
|
||||
depends on SPI
|
||||
default y
|
||||
help
|
||||
Binds spidev driver to the SPI0 master
|
||||
endmenu
|
||||
7
arch/arm/mach-bcm2708/Makefile
Normal file
7
arch/arm/mach-bcm2708/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Makefile for the linux kernel.
|
||||
#
|
||||
|
||||
obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o power.o
|
||||
obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
|
||||
obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
|
||||
3
arch/arm/mach-bcm2708/Makefile.boot
Normal file
3
arch/arm/mach-bcm2708/Makefile.boot
Normal file
@@ -0,0 +1,3 @@
|
||||
zreladdr-y := 0x00008000
|
||||
params_phys-y := 0x00000100
|
||||
initrd_phys-y := 0x00800000
|
||||
315
arch/arm/mach-bcm2708/armctrl.c
Normal file
315
arch/arm/mach-bcm2708/armctrl.c
Normal file
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/armctrl.c
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
#include <asm/mach/irq.h>
|
||||
#include <mach/hardware.h>
|
||||
#include "armctrl.h"
|
||||
|
||||
/* For support of kernels >= 3.0 assume only one VIC for now*/
|
||||
static unsigned int remap_irqs[(INTERRUPT_ARASANSDIO + 1) - INTERRUPT_JPEG] = {
|
||||
INTERRUPT_VC_JPEG,
|
||||
INTERRUPT_VC_USB,
|
||||
INTERRUPT_VC_3D,
|
||||
INTERRUPT_VC_DMA2,
|
||||
INTERRUPT_VC_DMA3,
|
||||
INTERRUPT_VC_I2C,
|
||||
INTERRUPT_VC_SPI,
|
||||
INTERRUPT_VC_I2SPCM,
|
||||
INTERRUPT_VC_SDIO,
|
||||
INTERRUPT_VC_UART,
|
||||
INTERRUPT_VC_ARASANSDIO
|
||||
};
|
||||
|
||||
static void armctrl_mask_irq(struct irq_data *d)
|
||||
{
|
||||
static const unsigned int disables[4] = {
|
||||
ARM_IRQ_DIBL1,
|
||||
ARM_IRQ_DIBL2,
|
||||
ARM_IRQ_DIBL3,
|
||||
0
|
||||
};
|
||||
|
||||
if (d->irq >= FIQ_START) {
|
||||
writel(0, __io_address(ARM_IRQ_FAST));
|
||||
} else {
|
||||
unsigned int data = (unsigned int)irq_get_chip_data(d->irq);
|
||||
writel(1 << (data & 0x1f), __io_address(disables[(data >> 5) & 0x3]));
|
||||
}
|
||||
}
|
||||
|
||||
static void armctrl_unmask_irq(struct irq_data *d)
|
||||
{
|
||||
static const unsigned int enables[4] = {
|
||||
ARM_IRQ_ENBL1,
|
||||
ARM_IRQ_ENBL2,
|
||||
ARM_IRQ_ENBL3,
|
||||
0
|
||||
};
|
||||
|
||||
if (d->irq >= FIQ_START) {
|
||||
unsigned int data =
|
||||
(unsigned int)irq_get_chip_data(d->irq) - FIQ_START;
|
||||
writel(0x80 | data, __io_address(ARM_IRQ_FAST));
|
||||
} else {
|
||||
unsigned int data = (unsigned int)irq_get_chip_data(d->irq);
|
||||
writel(1 << (data & 0x1f), __io_address(enables[(data >> 5) & 0x3]));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
|
||||
#define NR_IRQS_BANK0 21
|
||||
#define NR_BANKS 3
|
||||
#define IRQS_PER_BANK 32
|
||||
|
||||
/* from drivers/irqchip/irq-bcm2835.c */
|
||||
static int armctrl_xlate(struct irq_domain *d, struct device_node *ctrlr,
|
||||
const u32 *intspec, unsigned int intsize,
|
||||
unsigned long *out_hwirq, unsigned int *out_type)
|
||||
{
|
||||
if (WARN_ON(intsize != 2))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON(intspec[0] >= NR_BANKS))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON(intspec[1] >= IRQS_PER_BANK))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON(intspec[0] == 0 && intspec[1] >= NR_IRQS_BANK0))
|
||||
return -EINVAL;
|
||||
|
||||
if (intspec[0] == 0)
|
||||
*out_hwirq = ARM_IRQ0_BASE + intspec[1];
|
||||
else if (intspec[0] == 1)
|
||||
*out_hwirq = ARM_IRQ1_BASE + intspec[1];
|
||||
else
|
||||
*out_hwirq = ARM_IRQ2_BASE + intspec[1];
|
||||
|
||||
/* reverse remap_irqs[] */
|
||||
switch (*out_hwirq) {
|
||||
case INTERRUPT_VC_JPEG:
|
||||
*out_hwirq = INTERRUPT_JPEG;
|
||||
break;
|
||||
case INTERRUPT_VC_USB:
|
||||
*out_hwirq = INTERRUPT_USB;
|
||||
break;
|
||||
case INTERRUPT_VC_3D:
|
||||
*out_hwirq = INTERRUPT_3D;
|
||||
break;
|
||||
case INTERRUPT_VC_DMA2:
|
||||
*out_hwirq = INTERRUPT_DMA2;
|
||||
break;
|
||||
case INTERRUPT_VC_DMA3:
|
||||
*out_hwirq = INTERRUPT_DMA3;
|
||||
break;
|
||||
case INTERRUPT_VC_I2C:
|
||||
*out_hwirq = INTERRUPT_I2C;
|
||||
break;
|
||||
case INTERRUPT_VC_SPI:
|
||||
*out_hwirq = INTERRUPT_SPI;
|
||||
break;
|
||||
case INTERRUPT_VC_I2SPCM:
|
||||
*out_hwirq = INTERRUPT_I2SPCM;
|
||||
break;
|
||||
case INTERRUPT_VC_SDIO:
|
||||
*out_hwirq = INTERRUPT_SDIO;
|
||||
break;
|
||||
case INTERRUPT_VC_UART:
|
||||
*out_hwirq = INTERRUPT_UART;
|
||||
break;
|
||||
case INTERRUPT_VC_ARASANSDIO:
|
||||
*out_hwirq = INTERRUPT_ARASANSDIO;
|
||||
break;
|
||||
}
|
||||
|
||||
*out_type = IRQ_TYPE_NONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_domain_ops armctrl_ops = {
|
||||
.xlate = armctrl_xlate
|
||||
};
|
||||
|
||||
void __init armctrl_dt_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
struct irq_domain *domain;
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "brcm,bcm2708-armctrl-ic");
|
||||
if (!np)
|
||||
return;
|
||||
|
||||
domain = irq_domain_add_legacy(np, BCM2708_ALLOC_IRQS,
|
||||
IRQ_ARMCTRL_START, 0,
|
||||
&armctrl_ops, NULL);
|
||||
WARN_ON(!domain);
|
||||
}
|
||||
#else
|
||||
void __init armctrl_dt_init(void) { }
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
#if defined(CONFIG_PM)
|
||||
|
||||
/* for kernels 3.xx use the new syscore_ops apis but for older kernels use the sys dev class */
|
||||
|
||||
/* Static defines
|
||||
* struct armctrl_device - VIC PM device (< 3.xx)
|
||||
* @sysdev: The system device which is registered. (< 3.xx)
|
||||
* @irq: The IRQ number for the base of the VIC.
|
||||
* @base: The register base for the VIC.
|
||||
* @resume_sources: A bitmask of interrupts for resume.
|
||||
* @resume_irqs: The IRQs enabled for resume.
|
||||
* @int_select: Save for VIC_INT_SELECT.
|
||||
* @int_enable: Save for VIC_INT_ENABLE.
|
||||
* @soft_int: Save for VIC_INT_SOFT.
|
||||
* @protect: Save for VIC_PROTECT.
|
||||
*/
|
||||
struct armctrl_info {
|
||||
void __iomem *base;
|
||||
int irq;
|
||||
u32 resume_sources;
|
||||
u32 resume_irqs;
|
||||
u32 int_select;
|
||||
u32 int_enable;
|
||||
u32 soft_int;
|
||||
u32 protect;
|
||||
} armctrl;
|
||||
|
||||
static int armctrl_suspend(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void armctrl_resume(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* armctrl_pm_register - Register a VIC for later power management control
|
||||
* @base: The base address of the VIC.
|
||||
* @irq: The base IRQ for the VIC.
|
||||
* @resume_sources: bitmask of interrupts allowed for resume sources.
|
||||
*
|
||||
* For older kernels (< 3.xx) do -
|
||||
* Register the VIC with the system device tree so that it can be notified
|
||||
* of suspend and resume requests and ensure that the correct actions are
|
||||
* taken to re-instate the settings on resume.
|
||||
*/
|
||||
static void __init armctrl_pm_register(void __iomem * base, unsigned int irq,
|
||||
u32 resume_sources)
|
||||
{
|
||||
armctrl.base = base;
|
||||
armctrl.resume_sources = resume_sources;
|
||||
armctrl.irq = irq;
|
||||
}
|
||||
|
||||
static int armctrl_set_wake(struct irq_data *d, unsigned int on)
|
||||
{
|
||||
unsigned int off = d->irq & 31;
|
||||
u32 bit = 1 << off;
|
||||
|
||||
if (!(bit & armctrl.resume_sources))
|
||||
return -EINVAL;
|
||||
|
||||
if (on)
|
||||
armctrl.resume_irqs |= bit;
|
||||
else
|
||||
armctrl.resume_irqs &= ~bit;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
static inline void armctrl_pm_register(void __iomem * base, unsigned int irq,
|
||||
u32 arg1)
|
||||
{
|
||||
}
|
||||
|
||||
#define armctrl_suspend NULL
|
||||
#define armctrl_resume NULL
|
||||
#define armctrl_set_wake NULL
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static struct syscore_ops armctrl_syscore_ops = {
|
||||
.suspend = armctrl_suspend,
|
||||
.resume = armctrl_resume,
|
||||
};
|
||||
|
||||
/**
|
||||
* armctrl_syscore_init - initicall to register VIC pm functions
|
||||
*
|
||||
* This is called via late_initcall() to register
|
||||
* the resources for the VICs due to the early
|
||||
* nature of the VIC's registration.
|
||||
*/
|
||||
static int __init armctrl_syscore_init(void)
|
||||
{
|
||||
register_syscore_ops(&armctrl_syscore_ops);
|
||||
return 0;
|
||||
}
|
||||
|
||||
late_initcall(armctrl_syscore_init);
|
||||
|
||||
static struct irq_chip armctrl_chip = {
|
||||
.name = "ARMCTRL",
|
||||
.irq_ack = NULL,
|
||||
.irq_mask = armctrl_mask_irq,
|
||||
.irq_unmask = armctrl_unmask_irq,
|
||||
.irq_set_wake = armctrl_set_wake,
|
||||
};
|
||||
|
||||
/**
|
||||
* armctrl_init - initialise a vectored interrupt controller
|
||||
* @base: iomem base address
|
||||
* @irq_start: starting interrupt number, must be muliple of 32
|
||||
* @armctrl_sources: bitmask of interrupt sources to allow
|
||||
* @resume_sources: bitmask of interrupt sources to allow for resume
|
||||
*/
|
||||
int __init armctrl_init(void __iomem * base, unsigned int irq_start,
|
||||
u32 armctrl_sources, u32 resume_sources)
|
||||
{
|
||||
unsigned int irq;
|
||||
|
||||
for (irq = 0; irq < BCM2708_ALLOC_IRQS; irq++) {
|
||||
unsigned int data = irq;
|
||||
if (irq >= INTERRUPT_JPEG && irq <= INTERRUPT_ARASANSDIO)
|
||||
data = remap_irqs[irq - INTERRUPT_JPEG];
|
||||
|
||||
irq_set_chip(irq, &armctrl_chip);
|
||||
irq_set_chip_data(irq, (void *)data);
|
||||
irq_set_handler(irq, handle_level_irq);
|
||||
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_DISABLED);
|
||||
}
|
||||
|
||||
armctrl_pm_register(base, irq_start, resume_sources);
|
||||
init_FIQ(FIQ_START);
|
||||
armctrl_dt_init();
|
||||
return 0;
|
||||
}
|
||||
27
arch/arm/mach-bcm2708/armctrl.h
Normal file
27
arch/arm/mach-bcm2708/armctrl.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/armctrl.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __BCM2708_ARMCTRL_H
|
||||
#define __BCM2708_ARMCTRL_H
|
||||
|
||||
extern int __init armctrl_init(void __iomem * base, unsigned int irq_start,
|
||||
u32 armctrl_sources, u32 resume_sources);
|
||||
|
||||
#endif
|
||||
1188
arch/arm/mach-bcm2708/bcm2708.c
Normal file
1188
arch/arm/mach-bcm2708/bcm2708.c
Normal file
File diff suppressed because it is too large
Load Diff
49
arch/arm/mach-bcm2708/bcm2708.h
Normal file
49
arch/arm/mach-bcm2708/bcm2708.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/bcm2708.h
|
||||
*
|
||||
* BCM2708 machine support header
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __BCM2708_BCM2708_H
|
||||
#define __BCM2708_BCM2708_H
|
||||
|
||||
#include <linux/amba/bus.h>
|
||||
|
||||
extern void __init bcm2708_init(void);
|
||||
extern void __init bcm2708_init_irq(void);
|
||||
extern void __init bcm2708_map_io(void);
|
||||
extern struct sys_timer bcm2708_timer;
|
||||
extern unsigned int mmc_status(struct device *dev);
|
||||
|
||||
#define AMBA_DEVICE(name, busid, base, plat) \
|
||||
static struct amba_device name##_device = { \
|
||||
.dev = { \
|
||||
.coherent_dma_mask = ~0, \
|
||||
.init_name = busid, \
|
||||
.platform_data = plat, \
|
||||
}, \
|
||||
.res = { \
|
||||
.start = base##_BASE, \
|
||||
.end = (base##_BASE) + SZ_4K - 1,\
|
||||
.flags = IORESOURCE_MEM, \
|
||||
}, \
|
||||
.irq = base##_IRQ, \
|
||||
}
|
||||
|
||||
#endif
|
||||
426
arch/arm/mach-bcm2708/bcm2708_gpio.c
Normal file
426
arch/arm/mach-bcm2708/bcm2708_gpio.c
Normal file
@@ -0,0 +1,426 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/bcm2708_gpio.c
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/slab.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <mach/platform.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
|
||||
#include <linux/platform_data/bcm2708.h>
|
||||
|
||||
#define BCM_GPIO_DRIVER_NAME "bcm2708_gpio"
|
||||
#define DRIVER_NAME BCM_GPIO_DRIVER_NAME
|
||||
#define BCM_GPIO_USE_IRQ 1
|
||||
|
||||
#define GPIOFSEL(x) (0x00+(x)*4)
|
||||
#define GPIOSET(x) (0x1c+(x)*4)
|
||||
#define GPIOCLR(x) (0x28+(x)*4)
|
||||
#define GPIOLEV(x) (0x34+(x)*4)
|
||||
#define GPIOEDS(x) (0x40+(x)*4)
|
||||
#define GPIOREN(x) (0x4c+(x)*4)
|
||||
#define GPIOFEN(x) (0x58+(x)*4)
|
||||
#define GPIOHEN(x) (0x64+(x)*4)
|
||||
#define GPIOLEN(x) (0x70+(x)*4)
|
||||
#define GPIOAREN(x) (0x7c+(x)*4)
|
||||
#define GPIOAFEN(x) (0x88+(x)*4)
|
||||
#define GPIOUD(x) (0x94+(x)*4)
|
||||
#define GPIOUDCLK(x) (0x98+(x)*4)
|
||||
|
||||
#define GPIO_BANKS 2
|
||||
|
||||
enum { GPIO_FSEL_INPUT, GPIO_FSEL_OUTPUT,
|
||||
GPIO_FSEL_ALT5, GPIO_FSEL_ALT_4,
|
||||
GPIO_FSEL_ALT0, GPIO_FSEL_ALT1,
|
||||
GPIO_FSEL_ALT2, GPIO_FSEL_ALT3,
|
||||
};
|
||||
|
||||
/* Each of the two spinlocks protects a different set of hardware
|
||||
* regiters and data structurs. This decouples the code of the IRQ from
|
||||
* the GPIO code. This also makes the case of a GPIO routine call from
|
||||
* the IRQ code simpler.
|
||||
*/
|
||||
static DEFINE_SPINLOCK(lock); /* GPIO registers */
|
||||
|
||||
struct bcm2708_gpio {
|
||||
struct list_head list;
|
||||
void __iomem *base;
|
||||
struct gpio_chip gc;
|
||||
unsigned long rising[(BCM2708_NR_GPIOS + 31) / 32];
|
||||
unsigned long falling[(BCM2708_NR_GPIOS + 31) / 32];
|
||||
unsigned long high[(BCM2708_NR_GPIOS + 31) / 32];
|
||||
unsigned long low[(BCM2708_NR_GPIOS + 31) / 32];
|
||||
};
|
||||
|
||||
static int bcm2708_set_function(struct gpio_chip *gc, unsigned offset,
|
||||
int function)
|
||||
{
|
||||
struct bcm2708_gpio *gpio = container_of(gc, struct bcm2708_gpio, gc);
|
||||
unsigned long flags;
|
||||
unsigned gpiodir;
|
||||
unsigned gpio_bank = offset / 10;
|
||||
unsigned gpio_field_offset = (offset - 10 * gpio_bank) * 3;
|
||||
|
||||
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_set_function %p (%d,%d)\n", gc, offset, function);
|
||||
if (offset >= BCM2708_NR_GPIOS)
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(&lock, flags);
|
||||
|
||||
gpiodir = readl(gpio->base + GPIOFSEL(gpio_bank));
|
||||
gpiodir &= ~(7 << gpio_field_offset);
|
||||
gpiodir |= function << gpio_field_offset;
|
||||
writel(gpiodir, gpio->base + GPIOFSEL(gpio_bank));
|
||||
spin_unlock_irqrestore(&lock, flags);
|
||||
gpiodir = readl(gpio->base + GPIOFSEL(gpio_bank));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcm2708_gpio_dir_in(struct gpio_chip *gc, unsigned offset)
|
||||
{
|
||||
return bcm2708_set_function(gc, offset, GPIO_FSEL_INPUT);
|
||||
}
|
||||
|
||||
static void bcm2708_gpio_set(struct gpio_chip *gc, unsigned offset, int value);
|
||||
static int bcm2708_gpio_dir_out(struct gpio_chip *gc, unsigned offset,
|
||||
int value)
|
||||
{
|
||||
int ret;
|
||||
ret = bcm2708_set_function(gc, offset, GPIO_FSEL_OUTPUT);
|
||||
if (ret >= 0)
|
||||
bcm2708_gpio_set(gc, offset, value);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int bcm2708_gpio_get(struct gpio_chip *gc, unsigned offset)
|
||||
{
|
||||
struct bcm2708_gpio *gpio = container_of(gc, struct bcm2708_gpio, gc);
|
||||
unsigned gpio_bank = offset / 32;
|
||||
unsigned gpio_field_offset = (offset - 32 * gpio_bank);
|
||||
unsigned lev;
|
||||
|
||||
if (offset >= BCM2708_NR_GPIOS)
|
||||
return 0;
|
||||
lev = readl(gpio->base + GPIOLEV(gpio_bank));
|
||||
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_get %p (%d)=%d\n", gc, offset, 0x1 & (lev>>gpio_field_offset));
|
||||
return 0x1 & (lev >> gpio_field_offset);
|
||||
}
|
||||
|
||||
static void bcm2708_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
||||
{
|
||||
struct bcm2708_gpio *gpio = container_of(gc, struct bcm2708_gpio, gc);
|
||||
unsigned gpio_bank = offset / 32;
|
||||
unsigned gpio_field_offset = (offset - 32 * gpio_bank);
|
||||
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_set %p (%d=%d)\n", gc, offset, value);
|
||||
if (offset >= BCM2708_NR_GPIOS)
|
||||
return;
|
||||
if (value)
|
||||
writel(1 << gpio_field_offset, gpio->base + GPIOSET(gpio_bank));
|
||||
else
|
||||
writel(1 << gpio_field_offset, gpio->base + GPIOCLR(gpio_bank));
|
||||
}
|
||||
|
||||
/**********************
|
||||
* extension to configure pullups
|
||||
*/
|
||||
int bcm2708_gpio_setpull(struct gpio_chip *gc, unsigned offset,
|
||||
bcm2708_gpio_pull_t value)
|
||||
{
|
||||
struct bcm2708_gpio *gpio = container_of(gc, struct bcm2708_gpio, gc);
|
||||
unsigned gpio_bank = offset / 32;
|
||||
unsigned gpio_field_offset = (offset - 32 * gpio_bank);
|
||||
|
||||
if (offset >= BCM2708_NR_GPIOS)
|
||||
return -EINVAL;
|
||||
|
||||
switch (value) {
|
||||
case BCM2708_PULL_UP:
|
||||
writel(2, gpio->base + GPIOUD(0));
|
||||
break;
|
||||
case BCM2708_PULL_DOWN:
|
||||
writel(1, gpio->base + GPIOUD(0));
|
||||
break;
|
||||
case BCM2708_PULL_OFF:
|
||||
writel(0, gpio->base + GPIOUD(0));
|
||||
break;
|
||||
}
|
||||
|
||||
udelay(5);
|
||||
writel(1 << gpio_field_offset, gpio->base + GPIOUDCLK(gpio_bank));
|
||||
udelay(5);
|
||||
writel(0, gpio->base + GPIOUD(0));
|
||||
writel(0 << gpio_field_offset, gpio->base + GPIOUDCLK(gpio_bank));
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bcm2708_gpio_setpull);
|
||||
|
||||
/*************************************************************************************************************************
|
||||
* bcm2708 GPIO IRQ
|
||||
*/
|
||||
|
||||
#if BCM_GPIO_USE_IRQ
|
||||
|
||||
static int bcm2708_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
|
||||
{
|
||||
return gpio_to_irq(gpio);
|
||||
}
|
||||
|
||||
static int bcm2708_gpio_irq_set_type(struct irq_data *d, unsigned type)
|
||||
{
|
||||
unsigned irq = d->irq;
|
||||
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
||||
unsigned gn = irq_to_gpio(irq);
|
||||
unsigned gb = gn / 32;
|
||||
unsigned go = gn % 32;
|
||||
|
||||
gpio->rising[gb] &= ~(1 << go);
|
||||
gpio->falling[gb] &= ~(1 << go);
|
||||
gpio->high[gb] &= ~(1 << go);
|
||||
gpio->low[gb] &= ~(1 << go);
|
||||
|
||||
if (type & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING | IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
|
||||
return -EINVAL;
|
||||
|
||||
if (type & IRQ_TYPE_EDGE_RISING)
|
||||
gpio->rising[gb] |= (1 << go);
|
||||
if (type & IRQ_TYPE_EDGE_FALLING)
|
||||
gpio->falling[gb] |= (1 << go);
|
||||
if (type & IRQ_TYPE_LEVEL_HIGH)
|
||||
gpio->high[gb] |= (1 << go);
|
||||
if (type & IRQ_TYPE_LEVEL_LOW)
|
||||
gpio->low[gb] |= (1 << go);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bcm2708_gpio_irq_mask(struct irq_data *d)
|
||||
{
|
||||
unsigned irq = d->irq;
|
||||
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
||||
unsigned gn = irq_to_gpio(irq);
|
||||
unsigned gb = gn / 32;
|
||||
unsigned long rising = readl(gpio->base + GPIOREN(gb));
|
||||
unsigned long falling = readl(gpio->base + GPIOFEN(gb));
|
||||
unsigned long high = readl(gpio->base + GPIOHEN(gb));
|
||||
unsigned long low = readl(gpio->base + GPIOLEN(gb));
|
||||
|
||||
gn = gn % 32;
|
||||
|
||||
writel(rising & ~(1 << gn), gpio->base + GPIOREN(gb));
|
||||
writel(falling & ~(1 << gn), gpio->base + GPIOFEN(gb));
|
||||
writel(high & ~(1 << gn), gpio->base + GPIOHEN(gb));
|
||||
writel(low & ~(1 << gn), gpio->base + GPIOLEN(gb));
|
||||
}
|
||||
|
||||
static void bcm2708_gpio_irq_unmask(struct irq_data *d)
|
||||
{
|
||||
unsigned irq = d->irq;
|
||||
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
||||
unsigned gn = irq_to_gpio(irq);
|
||||
unsigned gb = gn / 32;
|
||||
unsigned go = gn % 32;
|
||||
unsigned long rising = readl(gpio->base + GPIOREN(gb));
|
||||
unsigned long falling = readl(gpio->base + GPIOFEN(gb));
|
||||
unsigned long high = readl(gpio->base + GPIOHEN(gb));
|
||||
unsigned long low = readl(gpio->base + GPIOLEN(gb));
|
||||
|
||||
if (gpio->rising[gb] & (1 << go)) {
|
||||
writel(rising | (1 << go), gpio->base + GPIOREN(gb));
|
||||
} else {
|
||||
writel(rising & ~(1 << go), gpio->base + GPIOREN(gb));
|
||||
}
|
||||
|
||||
if (gpio->falling[gb] & (1 << go)) {
|
||||
writel(falling | (1 << go), gpio->base + GPIOFEN(gb));
|
||||
} else {
|
||||
writel(falling & ~(1 << go), gpio->base + GPIOFEN(gb));
|
||||
}
|
||||
|
||||
if (gpio->high[gb] & (1 << go)) {
|
||||
writel(high | (1 << go), gpio->base + GPIOHEN(gb));
|
||||
} else {
|
||||
writel(high & ~(1 << go), gpio->base + GPIOHEN(gb));
|
||||
}
|
||||
|
||||
if (gpio->low[gb] & (1 << go)) {
|
||||
writel(low | (1 << go), gpio->base + GPIOLEN(gb));
|
||||
} else {
|
||||
writel(low & ~(1 << go), gpio->base + GPIOLEN(gb));
|
||||
}
|
||||
}
|
||||
|
||||
static struct irq_chip bcm2708_irqchip = {
|
||||
.name = "GPIO",
|
||||
.irq_enable = bcm2708_gpio_irq_unmask,
|
||||
.irq_disable = bcm2708_gpio_irq_mask,
|
||||
.irq_unmask = bcm2708_gpio_irq_unmask,
|
||||
.irq_mask = bcm2708_gpio_irq_mask,
|
||||
.irq_set_type = bcm2708_gpio_irq_set_type,
|
||||
};
|
||||
|
||||
static irqreturn_t bcm2708_gpio_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
unsigned long edsr;
|
||||
unsigned bank;
|
||||
int i;
|
||||
unsigned gpio;
|
||||
unsigned level_bits;
|
||||
struct bcm2708_gpio *gpio_data = dev_id;
|
||||
|
||||
for (bank = 0; bank < GPIO_BANKS; bank++) {
|
||||
edsr = readl(__io_address(GPIO_BASE) + GPIOEDS(bank));
|
||||
level_bits = gpio_data->high[bank] | gpio_data->low[bank];
|
||||
|
||||
for_each_set_bit(i, &edsr, 32) {
|
||||
gpio = i + bank * 32;
|
||||
/* ack edge triggered IRQs immediately */
|
||||
if (!(level_bits & (1<<i)))
|
||||
writel(1<<i,
|
||||
__io_address(GPIO_BASE) + GPIOEDS(bank));
|
||||
generic_handle_irq(gpio_to_irq(gpio));
|
||||
/* ack level triggered IRQ after handling them */
|
||||
if (level_bits & (1<<i))
|
||||
writel(1<<i,
|
||||
__io_address(GPIO_BASE) + GPIOEDS(bank));
|
||||
}
|
||||
}
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static struct irqaction bcm2708_gpio_irq = {
|
||||
.name = "BCM2708 GPIO catchall handler",
|
||||
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
|
||||
.handler = bcm2708_gpio_interrupt,
|
||||
};
|
||||
|
||||
static void bcm2708_gpio_irq_init(struct bcm2708_gpio *ucb)
|
||||
{
|
||||
unsigned irq;
|
||||
|
||||
ucb->gc.to_irq = bcm2708_gpio_to_irq;
|
||||
|
||||
for (irq = GPIO_IRQ_START; irq < (GPIO_IRQ_START + GPIO_IRQS); irq++) {
|
||||
irq_set_chip_data(irq, ucb);
|
||||
irq_set_chip_and_handler(irq, &bcm2708_irqchip,
|
||||
handle_simple_irq);
|
||||
set_irq_flags(irq, IRQF_VALID);
|
||||
}
|
||||
|
||||
bcm2708_gpio_irq.dev_id = ucb;
|
||||
setup_irq(IRQ_GPIO3, &bcm2708_gpio_irq);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void bcm2708_gpio_irq_init(struct bcm2708_gpio *ucb)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* #if BCM_GPIO_USE_IRQ ***************************************************************************************************************** */
|
||||
|
||||
static int bcm2708_gpio_probe(struct platform_device *dev)
|
||||
{
|
||||
struct bcm2708_gpio *ucb;
|
||||
struct resource *res;
|
||||
int bank;
|
||||
int err = 0;
|
||||
|
||||
printk(KERN_INFO DRIVER_NAME ": bcm2708_gpio_probe %p\n", dev);
|
||||
|
||||
ucb = kzalloc(sizeof(*ucb), GFP_KERNEL);
|
||||
if (NULL == ucb) {
|
||||
printk(KERN_ERR DRIVER_NAME ": failed to allocate "
|
||||
"mailbox memory\n");
|
||||
err = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
|
||||
|
||||
platform_set_drvdata(dev, ucb);
|
||||
ucb->base = __io_address(GPIO_BASE);
|
||||
|
||||
ucb->gc.label = "bcm2708_gpio";
|
||||
ucb->gc.base = 0;
|
||||
ucb->gc.ngpio = BCM2708_NR_GPIOS;
|
||||
ucb->gc.owner = THIS_MODULE;
|
||||
|
||||
ucb->gc.direction_input = bcm2708_gpio_dir_in;
|
||||
ucb->gc.direction_output = bcm2708_gpio_dir_out;
|
||||
ucb->gc.get = bcm2708_gpio_get;
|
||||
ucb->gc.set = bcm2708_gpio_set;
|
||||
ucb->gc.can_sleep = 0;
|
||||
|
||||
for (bank = 0; bank < GPIO_BANKS; bank++) {
|
||||
writel(0, ucb->base + GPIOREN(bank));
|
||||
writel(0, ucb->base + GPIOFEN(bank));
|
||||
writel(0, ucb->base + GPIOHEN(bank));
|
||||
writel(0, ucb->base + GPIOLEN(bank));
|
||||
writel(0, ucb->base + GPIOAREN(bank));
|
||||
writel(0, ucb->base + GPIOAFEN(bank));
|
||||
writel(~0, ucb->base + GPIOEDS(bank));
|
||||
}
|
||||
|
||||
bcm2708_gpio_irq_init(ucb);
|
||||
|
||||
err = gpiochip_add(&ucb->gc);
|
||||
|
||||
err:
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
static int bcm2708_gpio_remove(struct platform_device *dev)
|
||||
{
|
||||
int err = 0;
|
||||
struct bcm2708_gpio *ucb = platform_get_drvdata(dev);
|
||||
|
||||
printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_remove %p\n", dev);
|
||||
|
||||
gpiochip_remove(&ucb->gc);
|
||||
|
||||
platform_set_drvdata(dev, NULL);
|
||||
kfree(ucb);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct platform_driver bcm2708_gpio_driver = {
|
||||
.probe = bcm2708_gpio_probe,
|
||||
.remove = bcm2708_gpio_remove,
|
||||
.driver = {
|
||||
.name = "bcm2708_gpio"},
|
||||
};
|
||||
|
||||
static int __init bcm2708_gpio_init(void)
|
||||
{
|
||||
return platform_driver_register(&bcm2708_gpio_driver);
|
||||
}
|
||||
|
||||
static void __exit bcm2708_gpio_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&bcm2708_gpio_driver);
|
||||
}
|
||||
|
||||
module_init(bcm2708_gpio_init);
|
||||
module_exit(bcm2708_gpio_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Broadcom BCM2708 GPIO driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
419
arch/arm/mach-bcm2708/include/mach/arm_control.h
Normal file
419
arch/arm/mach-bcm2708/include/mach/arm_control.h
Normal file
@@ -0,0 +1,419 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/arm_control.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __BCM2708_ARM_CONTROL_H
|
||||
#define __BCM2708_ARM_CONTROL_H
|
||||
|
||||
/*
|
||||
* Definitions and addresses for the ARM CONTROL logic
|
||||
* This file is manually generated.
|
||||
*/
|
||||
|
||||
#define ARM_BASE 0x7E00B000
|
||||
|
||||
/* Basic configuration */
|
||||
#define ARM_CONTROL0 HW_REGISTER_RW(ARM_BASE+0x000)
|
||||
#define ARM_C0_SIZ128M 0x00000000
|
||||
#define ARM_C0_SIZ256M 0x00000001
|
||||
#define ARM_C0_SIZ512M 0x00000002
|
||||
#define ARM_C0_SIZ1G 0x00000003
|
||||
#define ARM_C0_BRESP0 0x00000000
|
||||
#define ARM_C0_BRESP1 0x00000004
|
||||
#define ARM_C0_BRESP2 0x00000008
|
||||
#define ARM_C0_BOOTHI 0x00000010
|
||||
#define ARM_C0_UNUSED05 0x00000020 /* free */
|
||||
#define ARM_C0_FULLPERI 0x00000040
|
||||
#define ARM_C0_UNUSED78 0x00000180 /* free */
|
||||
#define ARM_C0_JTAGMASK 0x00000E00
|
||||
#define ARM_C0_JTAGOFF 0x00000000
|
||||
#define ARM_C0_JTAGBASH 0x00000800 /* Debug on GPIO off */
|
||||
#define ARM_C0_JTAGGPIO 0x00000C00 /* Debug on GPIO on */
|
||||
#define ARM_C0_APROTMSK 0x0000F000
|
||||
#define ARM_C0_DBG0SYNC 0x00010000 /* VPU0 halt sync */
|
||||
#define ARM_C0_DBG1SYNC 0x00020000 /* VPU1 halt sync */
|
||||
#define ARM_C0_SWDBGREQ 0x00040000 /* HW debug request */
|
||||
#define ARM_C0_PASSHALT 0x00080000 /* ARM halt passed to debugger */
|
||||
#define ARM_C0_PRIO_PER 0x00F00000 /* per priority mask */
|
||||
#define ARM_C0_PRIO_L2 0x0F000000
|
||||
#define ARM_C0_PRIO_UC 0xF0000000
|
||||
|
||||
#define ARM_C0_APROTPASS 0x0000A000 /* Translate 1:1 */
|
||||
#define ARM_C0_APROTUSER 0x00000000 /* Only user mode */
|
||||
#define ARM_C0_APROTSYST 0x0000F000 /* Only system mode */
|
||||
|
||||
|
||||
#define ARM_CONTROL1 HW_REGISTER_RW(ARM_BASE+0x440)
|
||||
#define ARM_C1_TIMER 0x00000001 /* re-route timer IRQ to VC */
|
||||
#define ARM_C1_MAIL 0x00000002 /* re-route Mail IRQ to VC */
|
||||
#define ARM_C1_BELL0 0x00000004 /* re-route Doorbell 0 to VC */
|
||||
#define ARM_C1_BELL1 0x00000008 /* re-route Doorbell 1 to VC */
|
||||
#define ARM_C1_PERSON 0x00000100 /* peripherals on */
|
||||
#define ARM_C1_REQSTOP 0x00000200 /* ASYNC bridge request stop */
|
||||
|
||||
#define ARM_STATUS HW_REGISTER_RW(ARM_BASE+0x444)
|
||||
#define ARM_S_ACKSTOP 0x80000000 /* Bridge stopped */
|
||||
#define ARM_S_READPEND 0x000003FF /* pending reads counter */
|
||||
#define ARM_S_WRITPEND 0x000FFC00 /* pending writes counter */
|
||||
|
||||
#define ARM_ERRHALT HW_REGISTER_RW(ARM_BASE+0x448)
|
||||
#define ARM_EH_PERIBURST 0x00000001 /* Burst write seen on peri bus */
|
||||
#define ARM_EH_ILLADDRS1 0x00000002 /* Address bits 25-27 error */
|
||||
#define ARM_EH_ILLADDRS2 0x00000004 /* Address bits 31-28 error */
|
||||
#define ARM_EH_VPU0HALT 0x00000008 /* VPU0 halted & in debug mode */
|
||||
#define ARM_EH_VPU1HALT 0x00000010 /* VPU1 halted & in debug mode */
|
||||
#define ARM_EH_ARMHALT 0x00000020 /* ARM in halted debug mode */
|
||||
|
||||
#define ARM_ID_SECURE HW_REGISTER_RW(ARM_BASE+0x00C)
|
||||
#define ARM_ID HW_REGISTER_RW(ARM_BASE+0x44C)
|
||||
#define ARM_IDVAL 0x364D5241
|
||||
|
||||
/* Translation memory */
|
||||
#define ARM_TRANSLATE HW_REGISTER_RW(ARM_BASE+0x100)
|
||||
/* 32 locations: 0x100.. 0x17F */
|
||||
/* 32 spare means we CAN go to 64 pages.... */
|
||||
|
||||
|
||||
/* Interrupts */
|
||||
#define ARM_IRQ_PEND0 HW_REGISTER_RW(ARM_BASE+0x200) /* Top IRQ bits */
|
||||
#define ARM_I0_TIMER 0x00000001 /* timer IRQ */
|
||||
#define ARM_I0_MAIL 0x00000002 /* Mail IRQ */
|
||||
#define ARM_I0_BELL0 0x00000004 /* Doorbell 0 */
|
||||
#define ARM_I0_BELL1 0x00000008 /* Doorbell 1 */
|
||||
#define ARM_I0_BANK1 0x00000100 /* Bank1 IRQ */
|
||||
#define ARM_I0_BANK2 0x00000200 /* Bank2 IRQ */
|
||||
|
||||
#define ARM_IRQ_PEND1 HW_REGISTER_RW(ARM_BASE+0x204) /* All bank1 IRQ bits */
|
||||
/* todo: all I1_interrupt sources */
|
||||
#define ARM_IRQ_PEND2 HW_REGISTER_RW(ARM_BASE+0x208) /* All bank2 IRQ bits */
|
||||
/* todo: all I2_interrupt sources */
|
||||
|
||||
#define ARM_IRQ_FAST HW_REGISTER_RW(ARM_BASE+0x20C) /* FIQ control */
|
||||
#define ARM_IF_INDEX 0x0000007F /* FIQ select */
|
||||
#define ARM_IF_ENABLE 0x00000080 /* FIQ enable */
|
||||
#define ARM_IF_VCMASK 0x0000003F /* FIQ = (index from VC source) */
|
||||
#define ARM_IF_TIMER 0x00000040 /* FIQ = ARM timer */
|
||||
#define ARM_IF_MAIL 0x00000041 /* FIQ = ARM Mail */
|
||||
#define ARM_IF_BELL0 0x00000042 /* FIQ = ARM Doorbell 0 */
|
||||
#define ARM_IF_BELL1 0x00000043 /* FIQ = ARM Doorbell 1 */
|
||||
#define ARM_IF_VP0HALT 0x00000044 /* FIQ = VPU0 Halt seen */
|
||||
#define ARM_IF_VP1HALT 0x00000045 /* FIQ = VPU1 Halt seen */
|
||||
#define ARM_IF_ILLEGAL 0x00000046 /* FIQ = Illegal access seen */
|
||||
|
||||
#define ARM_IRQ_ENBL1 HW_REGISTER_RW(ARM_BASE+0x210) /* Bank1 enable bits */
|
||||
#define ARM_IRQ_ENBL2 HW_REGISTER_RW(ARM_BASE+0x214) /* Bank2 enable bits */
|
||||
#define ARM_IRQ_ENBL3 HW_REGISTER_RW(ARM_BASE+0x218) /* ARM irqs enable bits */
|
||||
#define ARM_IRQ_DIBL1 HW_REGISTER_RW(ARM_BASE+0x21C) /* Bank1 disable bits */
|
||||
#define ARM_IRQ_DIBL2 HW_REGISTER_RW(ARM_BASE+0x220) /* Bank2 disable bits */
|
||||
#define ARM_IRQ_DIBL3 HW_REGISTER_RW(ARM_BASE+0x224) /* ARM irqs disable bits */
|
||||
#define ARM_IE_TIMER 0x00000001 /* Timer IRQ */
|
||||
#define ARM_IE_MAIL 0x00000002 /* Mail IRQ */
|
||||
#define ARM_IE_BELL0 0x00000004 /* Doorbell 0 */
|
||||
#define ARM_IE_BELL1 0x00000008 /* Doorbell 1 */
|
||||
#define ARM_IE_VP0HALT 0x00000010 /* VPU0 Halt */
|
||||
#define ARM_IE_VP1HALT 0x00000020 /* VPU1 Halt */
|
||||
#define ARM_IE_ILLEGAL 0x00000040 /* Illegal access seen */
|
||||
|
||||
/* Timer */
|
||||
/* For reg. fields see sp804 spec. */
|
||||
#define ARM_T_LOAD HW_REGISTER_RW(ARM_BASE+0x400)
|
||||
#define ARM_T_VALUE HW_REGISTER_RW(ARM_BASE+0x404)
|
||||
#define ARM_T_CONTROL HW_REGISTER_RW(ARM_BASE+0x408)
|
||||
#define ARM_T_IRQCNTL HW_REGISTER_RW(ARM_BASE+0x40C)
|
||||
#define ARM_T_RAWIRQ HW_REGISTER_RW(ARM_BASE+0x410)
|
||||
#define ARM_T_MSKIRQ HW_REGISTER_RW(ARM_BASE+0x414)
|
||||
#define ARM_T_RELOAD HW_REGISTER_RW(ARM_BASE+0x418)
|
||||
#define ARM_T_PREDIV HW_REGISTER_RW(ARM_BASE+0x41c)
|
||||
#define ARM_T_FREECNT HW_REGISTER_RW(ARM_BASE+0x420)
|
||||
|
||||
#define TIMER_CTRL_ONESHOT (1 << 0)
|
||||
#define TIMER_CTRL_32BIT (1 << 1)
|
||||
#define TIMER_CTRL_DIV1 (0 << 2)
|
||||
#define TIMER_CTRL_DIV16 (1 << 2)
|
||||
#define TIMER_CTRL_DIV256 (2 << 2)
|
||||
#define TIMER_CTRL_IE (1 << 5)
|
||||
#define TIMER_CTRL_PERIODIC (1 << 6)
|
||||
#define TIMER_CTRL_ENABLE (1 << 7)
|
||||
#define TIMER_CTRL_DBGHALT (1 << 8)
|
||||
#define TIMER_CTRL_ENAFREE (1 << 9)
|
||||
#define TIMER_CTRL_FREEDIV_SHIFT 16)
|
||||
#define TIMER_CTRL_FREEDIV_MASK 0xff
|
||||
|
||||
/* Semaphores, Doorbells, Mailboxes */
|
||||
#define ARM_SBM_OWN0 (ARM_BASE+0x800)
|
||||
#define ARM_SBM_OWN1 (ARM_BASE+0x900)
|
||||
#define ARM_SBM_OWN2 (ARM_BASE+0xA00)
|
||||
#define ARM_SBM_OWN3 (ARM_BASE+0xB00)
|
||||
|
||||
/* MAILBOXES
|
||||
* Register flags are common across all
|
||||
* owner registers. See end of this section
|
||||
*
|
||||
* Semaphores, Doorbells, Mailboxes Owner 0
|
||||
*
|
||||
*/
|
||||
|
||||
#define ARM_0_SEMS HW_REGISTER_RW(ARM_SBM_OWN0+0x00)
|
||||
#define ARM_0_SEM0 HW_REGISTER_RW(ARM_SBM_OWN0+0x00)
|
||||
#define ARM_0_SEM1 HW_REGISTER_RW(ARM_SBM_OWN0+0x04)
|
||||
#define ARM_0_SEM2 HW_REGISTER_RW(ARM_SBM_OWN0+0x08)
|
||||
#define ARM_0_SEM3 HW_REGISTER_RW(ARM_SBM_OWN0+0x0C)
|
||||
#define ARM_0_SEM4 HW_REGISTER_RW(ARM_SBM_OWN0+0x10)
|
||||
#define ARM_0_SEM5 HW_REGISTER_RW(ARM_SBM_OWN0+0x14)
|
||||
#define ARM_0_SEM6 HW_REGISTER_RW(ARM_SBM_OWN0+0x18)
|
||||
#define ARM_0_SEM7 HW_REGISTER_RW(ARM_SBM_OWN0+0x1C)
|
||||
#define ARM_0_BELL0 HW_REGISTER_RW(ARM_SBM_OWN0+0x40)
|
||||
#define ARM_0_BELL1 HW_REGISTER_RW(ARM_SBM_OWN0+0x44)
|
||||
#define ARM_0_BELL2 HW_REGISTER_RW(ARM_SBM_OWN0+0x48)
|
||||
#define ARM_0_BELL3 HW_REGISTER_RW(ARM_SBM_OWN0+0x4C)
|
||||
/* MAILBOX 0 access in Owner 0 area */
|
||||
/* Some addresses should ONLY be used by owner 0 */
|
||||
#define ARM_0_MAIL0_WRT HW_REGISTER_RW(ARM_SBM_OWN0+0x80) /* .. 0x8C (4 locations) */
|
||||
#define ARM_0_MAIL0_RD HW_REGISTER_RW(ARM_SBM_OWN0+0x80) /* .. 0x8C (4 locations) Normal read */
|
||||
#define ARM_0_MAIL0_POL HW_REGISTER_RW(ARM_SBM_OWN0+0x90) /* none-pop read */
|
||||
#define ARM_0_MAIL0_SND HW_REGISTER_RW(ARM_SBM_OWN0+0x94) /* Sender read (only LS 2 bits) */
|
||||
#define ARM_0_MAIL0_STA HW_REGISTER_RW(ARM_SBM_OWN0+0x98) /* Status read */
|
||||
#define ARM_0_MAIL0_CNF HW_REGISTER_RW(ARM_SBM_OWN0+0x9C) /* Config read/write */
|
||||
/* MAILBOX 1 access in Owner 0 area */
|
||||
/* Owner 0 should only WRITE to this mailbox */
|
||||
#define ARM_0_MAIL1_WRT HW_REGISTER_RW(ARM_SBM_OWN0+0xA0) /* .. 0xAC (4 locations) */
|
||||
/*#define ARM_0_MAIL1_RD HW_REGISTER_RW(ARM_SBM_OWN0+0xA0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_0_MAIL1_POL HW_REGISTER_RW(ARM_SBM_OWN0+0xB0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_0_MAIL1_SND HW_REGISTER_RW(ARM_SBM_OWN0+0xB4) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_0_MAIL1_STA HW_REGISTER_RW(ARM_SBM_OWN0+0xB8) /* Status read */
|
||||
/*#define ARM_0_MAIL1_CNF HW_REGISTER_RW(ARM_SBM_OWN0+0xBC) */ /* DO NOT USE THIS !!!!! */
|
||||
/* General SEM, BELL, MAIL config/status */
|
||||
#define ARM_0_SEMCLRDBG HW_REGISTER_RW(ARM_SBM_OWN0+0xE0) /* semaphore clear/debug register */
|
||||
#define ARM_0_BELLCLRDBG HW_REGISTER_RW(ARM_SBM_OWN0+0xE4) /* Doorbells clear/debug register */
|
||||
#define ARM_0_ALL_IRQS HW_REGISTER_RW(ARM_SBM_OWN0+0xF8) /* ALL interrupts */
|
||||
#define ARM_0_MY_IRQS HW_REGISTER_RW(ARM_SBM_OWN0+0xFC) /* IRQS pending for owner 0 */
|
||||
|
||||
/* Semaphores, Doorbells, Mailboxes Owner 1 */
|
||||
#define ARM_1_SEMS HW_REGISTER_RW(ARM_SBM_OWN1+0x00)
|
||||
#define ARM_1_SEM0 HW_REGISTER_RW(ARM_SBM_OWN1+0x00)
|
||||
#define ARM_1_SEM1 HW_REGISTER_RW(ARM_SBM_OWN1+0x04)
|
||||
#define ARM_1_SEM2 HW_REGISTER_RW(ARM_SBM_OWN1+0x08)
|
||||
#define ARM_1_SEM3 HW_REGISTER_RW(ARM_SBM_OWN1+0x0C)
|
||||
#define ARM_1_SEM4 HW_REGISTER_RW(ARM_SBM_OWN1+0x10)
|
||||
#define ARM_1_SEM5 HW_REGISTER_RW(ARM_SBM_OWN1+0x14)
|
||||
#define ARM_1_SEM6 HW_REGISTER_RW(ARM_SBM_OWN1+0x18)
|
||||
#define ARM_1_SEM7 HW_REGISTER_RW(ARM_SBM_OWN1+0x1C)
|
||||
#define ARM_1_BELL0 HW_REGISTER_RW(ARM_SBM_OWN1+0x40)
|
||||
#define ARM_1_BELL1 HW_REGISTER_RW(ARM_SBM_OWN1+0x44)
|
||||
#define ARM_1_BELL2 HW_REGISTER_RW(ARM_SBM_OWN1+0x48)
|
||||
#define ARM_1_BELL3 HW_REGISTER_RW(ARM_SBM_OWN1+0x4C)
|
||||
/* MAILBOX 0 access in Owner 0 area */
|
||||
/* Owner 1 should only WRITE to this mailbox */
|
||||
#define ARM_1_MAIL0_WRT HW_REGISTER_RW(ARM_SBM_OWN1+0x80) /* .. 0x8C (4 locations) */
|
||||
/*#define ARM_1_MAIL0_RD HW_REGISTER_RW(ARM_SBM_OWN1+0x80) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_1_MAIL0_POL HW_REGISTER_RW(ARM_SBM_OWN1+0x90) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_1_MAIL0_SND HW_REGISTER_RW(ARM_SBM_OWN1+0x94) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_1_MAIL0_STA HW_REGISTER_RW(ARM_SBM_OWN1+0x98) /* Status read */
|
||||
/*#define ARM_1_MAIL0_CNF HW_REGISTER_RW(ARM_SBM_OWN1+0x9C) */ /* DO NOT USE THIS !!!!! */
|
||||
/* MAILBOX 1 access in Owner 0 area */
|
||||
#define ARM_1_MAIL1_WRT HW_REGISTER_RW(ARM_SBM_OWN1+0xA0) /* .. 0xAC (4 locations) */
|
||||
#define ARM_1_MAIL1_RD HW_REGISTER_RW(ARM_SBM_OWN1+0xA0) /* .. 0xAC (4 locations) Normal read */
|
||||
#define ARM_1_MAIL1_POL HW_REGISTER_RW(ARM_SBM_OWN1+0xB0) /* none-pop read */
|
||||
#define ARM_1_MAIL1_SND HW_REGISTER_RW(ARM_SBM_OWN1+0xB4) /* Sender read (only LS 2 bits) */
|
||||
#define ARM_1_MAIL1_STA HW_REGISTER_RW(ARM_SBM_OWN1+0xB8) /* Status read */
|
||||
#define ARM_1_MAIL1_CNF HW_REGISTER_RW(ARM_SBM_OWN1+0xBC)
|
||||
/* General SEM, BELL, MAIL config/status */
|
||||
#define ARM_1_SEMCLRDBG HW_REGISTER_RW(ARM_SBM_OWN1+0xE0) /* semaphore clear/debug register */
|
||||
#define ARM_1_BELLCLRDBG HW_REGISTER_RW(ARM_SBM_OWN1+0xE4) /* Doorbells clear/debug register */
|
||||
#define ARM_1_MY_IRQS HW_REGISTER_RW(ARM_SBM_OWN1+0xFC) /* IRQS pending for owner 1 */
|
||||
#define ARM_1_ALL_IRQS HW_REGISTER_RW(ARM_SBM_OWN1+0xF8) /* ALL interrupts */
|
||||
|
||||
/* Semaphores, Doorbells, Mailboxes Owner 2 */
|
||||
#define ARM_2_SEMS HW_REGISTER_RW(ARM_SBM_OWN2+0x00)
|
||||
#define ARM_2_SEM0 HW_REGISTER_RW(ARM_SBM_OWN2+0x00)
|
||||
#define ARM_2_SEM1 HW_REGISTER_RW(ARM_SBM_OWN2+0x04)
|
||||
#define ARM_2_SEM2 HW_REGISTER_RW(ARM_SBM_OWN2+0x08)
|
||||
#define ARM_2_SEM3 HW_REGISTER_RW(ARM_SBM_OWN2+0x0C)
|
||||
#define ARM_2_SEM4 HW_REGISTER_RW(ARM_SBM_OWN2+0x10)
|
||||
#define ARM_2_SEM5 HW_REGISTER_RW(ARM_SBM_OWN2+0x14)
|
||||
#define ARM_2_SEM6 HW_REGISTER_RW(ARM_SBM_OWN2+0x18)
|
||||
#define ARM_2_SEM7 HW_REGISTER_RW(ARM_SBM_OWN2+0x1C)
|
||||
#define ARM_2_BELL0 HW_REGISTER_RW(ARM_SBM_OWN2+0x40)
|
||||
#define ARM_2_BELL1 HW_REGISTER_RW(ARM_SBM_OWN2+0x44)
|
||||
#define ARM_2_BELL2 HW_REGISTER_RW(ARM_SBM_OWN2+0x48)
|
||||
#define ARM_2_BELL3 HW_REGISTER_RW(ARM_SBM_OWN2+0x4C)
|
||||
/* MAILBOX 0 access in Owner 2 area */
|
||||
/* Owner 2 should only WRITE to this mailbox */
|
||||
#define ARM_2_MAIL0_WRT HW_REGISTER_RW(ARM_SBM_OWN2+0x80) /* .. 0x8C (4 locations) */
|
||||
/*#define ARM_2_MAIL0_RD HW_REGISTER_RW(ARM_SBM_OWN2+0x80) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_2_MAIL0_POL HW_REGISTER_RW(ARM_SBM_OWN2+0x90) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_2_MAIL0_SND HW_REGISTER_RW(ARM_SBM_OWN2+0x94) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_2_MAIL0_STA HW_REGISTER_RW(ARM_SBM_OWN2+0x98) /* Status read */
|
||||
/*#define ARM_2_MAIL0_CNF HW_REGISTER_RW(ARM_SBM_OWN2+0x9C) */ /* DO NOT USE THIS !!!!! */
|
||||
/* MAILBOX 1 access in Owner 2 area */
|
||||
/* Owner 2 should only WRITE to this mailbox */
|
||||
#define ARM_2_MAIL1_WRT HW_REGISTER_RW(ARM_SBM_OWN2+0xA0) /* .. 0xAC (4 locations) */
|
||||
/*#define ARM_2_MAIL1_RD HW_REGISTER_RW(ARM_SBM_OWN2+0xA0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_2_MAIL1_POL HW_REGISTER_RW(ARM_SBM_OWN2+0xB0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_2_MAIL1_SND HW_REGISTER_RW(ARM_SBM_OWN2+0xB4) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_2_MAIL1_STA HW_REGISTER_RW(ARM_SBM_OWN2+0xB8) /* Status read */
|
||||
/*#define ARM_2_MAIL1_CNF HW_REGISTER_RW(ARM_SBM_OWN2+0xBC) */ /* DO NOT USE THIS !!!!! */
|
||||
/* General SEM, BELL, MAIL config/status */
|
||||
#define ARM_2_SEMCLRDBG HW_REGISTER_RW(ARM_SBM_OWN2+0xE0) /* semaphore clear/debug register */
|
||||
#define ARM_2_BELLCLRDBG HW_REGISTER_RW(ARM_SBM_OWN2+0xE4) /* Doorbells clear/debug register */
|
||||
#define ARM_2_MY_IRQS HW_REGISTER_RW(ARM_SBM_OWN2+0xFC) /* IRQS pending for owner 2 */
|
||||
#define ARM_2_ALL_IRQS HW_REGISTER_RW(ARM_SBM_OWN2+0xF8) /* ALL interrupts */
|
||||
|
||||
/* Semaphores, Doorbells, Mailboxes Owner 3 */
|
||||
#define ARM_3_SEMS HW_REGISTER_RW(ARM_SBM_OWN3+0x00)
|
||||
#define ARM_3_SEM0 HW_REGISTER_RW(ARM_SBM_OWN3+0x00)
|
||||
#define ARM_3_SEM1 HW_REGISTER_RW(ARM_SBM_OWN3+0x04)
|
||||
#define ARM_3_SEM2 HW_REGISTER_RW(ARM_SBM_OWN3+0x08)
|
||||
#define ARM_3_SEM3 HW_REGISTER_RW(ARM_SBM_OWN3+0x0C)
|
||||
#define ARM_3_SEM4 HW_REGISTER_RW(ARM_SBM_OWN3+0x10)
|
||||
#define ARM_3_SEM5 HW_REGISTER_RW(ARM_SBM_OWN3+0x14)
|
||||
#define ARM_3_SEM6 HW_REGISTER_RW(ARM_SBM_OWN3+0x18)
|
||||
#define ARM_3_SEM7 HW_REGISTER_RW(ARM_SBM_OWN3+0x1C)
|
||||
#define ARM_3_BELL0 HW_REGISTER_RW(ARM_SBM_OWN3+0x40)
|
||||
#define ARM_3_BELL1 HW_REGISTER_RW(ARM_SBM_OWN3+0x44)
|
||||
#define ARM_3_BELL2 HW_REGISTER_RW(ARM_SBM_OWN3+0x48)
|
||||
#define ARM_3_BELL3 HW_REGISTER_RW(ARM_SBM_OWN3+0x4C)
|
||||
/* MAILBOX 0 access in Owner 3 area */
|
||||
/* Owner 3 should only WRITE to this mailbox */
|
||||
#define ARM_3_MAIL0_WRT HW_REGISTER_RW(ARM_SBM_OWN3+0x80) /* .. 0x8C (4 locations) */
|
||||
/*#define ARM_3_MAIL0_RD HW_REGISTER_RW(ARM_SBM_OWN3+0x80) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_3_MAIL0_POL HW_REGISTER_RW(ARM_SBM_OWN3+0x90) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_3_MAIL0_SND HW_REGISTER_RW(ARM_SBM_OWN3+0x94) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_3_MAIL0_STA HW_REGISTER_RW(ARM_SBM_OWN3+0x98) /* Status read */
|
||||
/*#define ARM_3_MAIL0_CNF HW_REGISTER_RW(ARM_SBM_OWN3+0x9C) */ /* DO NOT USE THIS !!!!! */
|
||||
/* MAILBOX 1 access in Owner 3 area */
|
||||
/* Owner 3 should only WRITE to this mailbox */
|
||||
#define ARM_3_MAIL1_WRT HW_REGISTER_RW(ARM_SBM_OWN3+0xA0) /* .. 0xAC (4 locations) */
|
||||
/*#define ARM_3_MAIL1_RD HW_REGISTER_RW(ARM_SBM_OWN3+0xA0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_3_MAIL1_POL HW_REGISTER_RW(ARM_SBM_OWN3+0xB0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_3_MAIL1_SND HW_REGISTER_RW(ARM_SBM_OWN3+0xB4) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_3_MAIL1_STA HW_REGISTER_RW(ARM_SBM_OWN3+0xB8) /* Status read */
|
||||
/*#define ARM_3_MAIL1_CNF HW_REGISTER_RW(ARM_SBM_OWN3+0xBC) */ /* DO NOT USE THIS !!!!! */
|
||||
/* General SEM, BELL, MAIL config/status */
|
||||
#define ARM_3_SEMCLRDBG HW_REGISTER_RW(ARM_SBM_OWN3+0xE0) /* semaphore clear/debug register */
|
||||
#define ARM_3_BELLCLRDBG HW_REGISTER_RW(ARM_SBM_OWN3+0xE4) /* Doorbells clear/debug register */
|
||||
#define ARM_3_MY_IRQS HW_REGISTER_RW(ARM_SBM_OWN3+0xFC) /* IRQS pending for owner 3 */
|
||||
#define ARM_3_ALL_IRQS HW_REGISTER_RW(ARM_SBM_OWN3+0xF8) /* ALL interrupts */
|
||||
|
||||
|
||||
|
||||
/* Mailbox flags. Valid for all owners */
|
||||
|
||||
/* Mailbox status register (...0x98) */
|
||||
#define ARM_MS_FULL 0x80000000
|
||||
#define ARM_MS_EMPTY 0x40000000
|
||||
#define ARM_MS_LEVEL 0x400000FF /* Max. value depdnds on mailbox depth parameter */
|
||||
|
||||
/* MAILBOX config/status register (...0x9C) */
|
||||
/* ANY write to this register clears the error bits! */
|
||||
#define ARM_MC_IHAVEDATAIRQEN 0x00000001 /* mailbox irq enable: has data */
|
||||
#define ARM_MC_IHAVESPACEIRQEN 0x00000002 /* mailbox irq enable: has space */
|
||||
#define ARM_MC_OPPISEMPTYIRQEN 0x00000004 /* mailbox irq enable: Opp. is empty */
|
||||
#define ARM_MC_MAIL_CLEAR 0x00000008 /* mailbox clear write 1, then 0 */
|
||||
#define ARM_MC_IHAVEDATAIRQPEND 0x00000010 /* mailbox irq pending: has space */
|
||||
#define ARM_MC_IHAVESPACEIRQPEND 0x00000020 /* mailbox irq pending: Opp. is empty */
|
||||
#define ARM_MC_OPPISEMPTYIRQPEND 0x00000040 /* mailbox irq pending */
|
||||
/* Bit 7 is unused */
|
||||
#define ARM_MC_ERRNOOWN 0x00000100 /* error : none owner read from mailbox */
|
||||
#define ARM_MC_ERROVERFLW 0x00000200 /* error : write to fill mailbox */
|
||||
#define ARM_MC_ERRUNDRFLW 0x00000400 /* error : read from empty mailbox */
|
||||
|
||||
/* Semaphore clear/debug register (...0xE0) */
|
||||
#define ARM_SD_OWN0 0x00000003 /* Owner of sem 0 */
|
||||
#define ARM_SD_OWN1 0x0000000C /* Owner of sem 1 */
|
||||
#define ARM_SD_OWN2 0x00000030 /* Owner of sem 2 */
|
||||
#define ARM_SD_OWN3 0x000000C0 /* Owner of sem 3 */
|
||||
#define ARM_SD_OWN4 0x00000300 /* Owner of sem 4 */
|
||||
#define ARM_SD_OWN5 0x00000C00 /* Owner of sem 5 */
|
||||
#define ARM_SD_OWN6 0x00003000 /* Owner of sem 6 */
|
||||
#define ARM_SD_OWN7 0x0000C000 /* Owner of sem 7 */
|
||||
#define ARM_SD_SEM0 0x00010000 /* Status of sem 0 */
|
||||
#define ARM_SD_SEM1 0x00020000 /* Status of sem 1 */
|
||||
#define ARM_SD_SEM2 0x00040000 /* Status of sem 2 */
|
||||
#define ARM_SD_SEM3 0x00080000 /* Status of sem 3 */
|
||||
#define ARM_SD_SEM4 0x00100000 /* Status of sem 4 */
|
||||
#define ARM_SD_SEM5 0x00200000 /* Status of sem 5 */
|
||||
#define ARM_SD_SEM6 0x00400000 /* Status of sem 6 */
|
||||
#define ARM_SD_SEM7 0x00800000 /* Status of sem 7 */
|
||||
|
||||
/* Doorbells clear/debug register (...0xE4) */
|
||||
#define ARM_BD_OWN0 0x00000003 /* Owner of doorbell 0 */
|
||||
#define ARM_BD_OWN1 0x0000000C /* Owner of doorbell 1 */
|
||||
#define ARM_BD_OWN2 0x00000030 /* Owner of doorbell 2 */
|
||||
#define ARM_BD_OWN3 0x000000C0 /* Owner of doorbell 3 */
|
||||
#define ARM_BD_BELL0 0x00000100 /* Status of doorbell 0 */
|
||||
#define ARM_BD_BELL1 0x00000200 /* Status of doorbell 1 */
|
||||
#define ARM_BD_BELL2 0x00000400 /* Status of doorbell 2 */
|
||||
#define ARM_BD_BELL3 0x00000800 /* Status of doorbell 3 */
|
||||
|
||||
/* MY IRQS register (...0xF8) */
|
||||
#define ARM_MYIRQ_BELL 0x00000001 /* This owner has a doorbell IRQ */
|
||||
#define ARM_MYIRQ_MAIL 0x00000002 /* This owner has a mailbox IRQ */
|
||||
|
||||
/* ALL IRQS register (...0xF8) */
|
||||
#define ARM_AIS_BELL0 0x00000001 /* Doorbell 0 IRQ pending */
|
||||
#define ARM_AIS_BELL1 0x00000002 /* Doorbell 1 IRQ pending */
|
||||
#define ARM_AIS_BELL2 0x00000004 /* Doorbell 2 IRQ pending */
|
||||
#define ARM_AIS_BELL3 0x00000008 /* Doorbell 3 IRQ pending */
|
||||
#define ARM_AIS0_HAVEDATA 0x00000010 /* MAIL 0 has data IRQ pending */
|
||||
#define ARM_AIS0_HAVESPAC 0x00000020 /* MAIL 0 has space IRQ pending */
|
||||
#define ARM_AIS0_OPPEMPTY 0x00000040 /* MAIL 0 opposite is empty IRQ */
|
||||
#define ARM_AIS1_HAVEDATA 0x00000080 /* MAIL 1 has data IRQ pending */
|
||||
#define ARM_AIS1_HAVESPAC 0x00000100 /* MAIL 1 has space IRQ pending */
|
||||
#define ARM_AIS1_OPPEMPTY 0x00000200 /* MAIL 1 opposite is empty IRQ */
|
||||
/* Note that bell-0, bell-1 and MAIL0 IRQ go only to the ARM */
|
||||
/* Whilst that bell-2, bell-3 and MAIL1 IRQ go only to the VC */
|
||||
/* */
|
||||
/* ARM JTAG BASH */
|
||||
/* */
|
||||
#define AJB_BASE 0x7e2000c0
|
||||
|
||||
#define AJBCONF HW_REGISTER_RW(AJB_BASE+0x00)
|
||||
#define AJB_BITS0 0x000000
|
||||
#define AJB_BITS4 0x000004
|
||||
#define AJB_BITS8 0x000008
|
||||
#define AJB_BITS12 0x00000C
|
||||
#define AJB_BITS16 0x000010
|
||||
#define AJB_BITS20 0x000014
|
||||
#define AJB_BITS24 0x000018
|
||||
#define AJB_BITS28 0x00001C
|
||||
#define AJB_BITS32 0x000020
|
||||
#define AJB_BITS34 0x000022
|
||||
#define AJB_OUT_MS 0x000040
|
||||
#define AJB_OUT_LS 0x000000
|
||||
#define AJB_INV_CLK 0x000080
|
||||
#define AJB_D0_RISE 0x000100
|
||||
#define AJB_D0_FALL 0x000000
|
||||
#define AJB_D1_RISE 0x000200
|
||||
#define AJB_D1_FALL 0x000000
|
||||
#define AJB_IN_RISE 0x000400
|
||||
#define AJB_IN_FALL 0x000000
|
||||
#define AJB_ENABLE 0x000800
|
||||
#define AJB_HOLD0 0x000000
|
||||
#define AJB_HOLD1 0x001000
|
||||
#define AJB_HOLD2 0x002000
|
||||
#define AJB_HOLD3 0x003000
|
||||
#define AJB_RESETN 0x004000
|
||||
#define AJB_CLKSHFT 16
|
||||
#define AJB_BUSY 0x80000000
|
||||
#define AJBTMS HW_REGISTER_RW(AJB_BASE+0x04)
|
||||
#define AJBTDI HW_REGISTER_RW(AJB_BASE+0x08)
|
||||
#define AJBTDO HW_REGISTER_RW(AJB_BASE+0x0c)
|
||||
|
||||
#endif
|
||||
62
arch/arm/mach-bcm2708/include/mach/arm_power.h
Normal file
62
arch/arm/mach-bcm2708/include/mach/arm_power.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/include/mach/arm_power.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ARM_POWER_H
|
||||
#define _ARM_POWER_H
|
||||
|
||||
/* Use meaningful names on each side */
|
||||
#ifdef __VIDEOCORE__
|
||||
#define PREFIX(x) ARM_##x
|
||||
#else
|
||||
#define PREFIX(x) BCM_##x
|
||||
#endif
|
||||
|
||||
enum {
|
||||
PREFIX(POWER_SDCARD_BIT),
|
||||
PREFIX(POWER_UART_BIT),
|
||||
PREFIX(POWER_MINIUART_BIT),
|
||||
PREFIX(POWER_USB_BIT),
|
||||
PREFIX(POWER_I2C0_BIT),
|
||||
PREFIX(POWER_I2C1_BIT),
|
||||
PREFIX(POWER_I2C2_BIT),
|
||||
PREFIX(POWER_SPI_BIT),
|
||||
PREFIX(POWER_CCP2TX_BIT),
|
||||
PREFIX(POWER_DSI_BIT),
|
||||
|
||||
PREFIX(POWER_MAX)
|
||||
};
|
||||
|
||||
enum {
|
||||
PREFIX(POWER_SDCARD) = (1 << PREFIX(POWER_SDCARD_BIT)),
|
||||
PREFIX(POWER_UART) = (1 << PREFIX(POWER_UART_BIT)),
|
||||
PREFIX(POWER_MINIUART) = (1 << PREFIX(POWER_MINIUART_BIT)),
|
||||
PREFIX(POWER_USB) = (1 << PREFIX(POWER_USB_BIT)),
|
||||
PREFIX(POWER_I2C0) = (1 << PREFIX(POWER_I2C0_BIT)),
|
||||
PREFIX(POWER_I2C1_MASK) = (1 << PREFIX(POWER_I2C1_BIT)),
|
||||
PREFIX(POWER_I2C2_MASK) = (1 << PREFIX(POWER_I2C2_BIT)),
|
||||
PREFIX(POWER_SPI_MASK) = (1 << PREFIX(POWER_SPI_BIT)),
|
||||
PREFIX(POWER_CCP2TX_MASK) = (1 << PREFIX(POWER_CCP2TX_BIT)),
|
||||
PREFIX(POWER_DSI) = (1 << PREFIX(POWER_DSI_BIT)),
|
||||
|
||||
PREFIX(POWER_MASK) = (1 << PREFIX(POWER_MAX)) - 1,
|
||||
PREFIX(POWER_NONE) = 0
|
||||
};
|
||||
|
||||
#endif
|
||||
7
arch/arm/mach-bcm2708/include/mach/clkdev.h
Normal file
7
arch/arm/mach-bcm2708/include/mach/clkdev.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef __ASM_MACH_CLKDEV_H
|
||||
#define __ASM_MACH_CLKDEV_H
|
||||
|
||||
#define __clk_get(clk) ({ 1; })
|
||||
#define __clk_put(clk) do { } while (0)
|
||||
|
||||
#endif
|
||||
22
arch/arm/mach-bcm2708/include/mach/debug-macro.S
Normal file
22
arch/arm/mach-bcm2708/include/mach/debug-macro.S
Normal file
@@ -0,0 +1,22 @@
|
||||
/* arch/arm/mach-bcm2708/include/mach/debug-macro.S
|
||||
*
|
||||
* Debugging macro include header
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
* Copyright (C) 1994-1999 Russell King
|
||||
* Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <mach/platform.h>
|
||||
|
||||
.macro addruart, rp, rv, tmp
|
||||
ldr \rp, =UART0_BASE
|
||||
ldr \rv, =IO_ADDRESS(UART0_BASE)
|
||||
.endm
|
||||
|
||||
#include <debug/pl01x.S>
|
||||
2
arch/arm/mach-bcm2708/include/mach/dma.h
Normal file
2
arch/arm/mach-bcm2708/include/mach/dma.h
Normal file
@@ -0,0 +1,2 @@
|
||||
/* This file can be removed when all the drivers have been updated */
|
||||
#include <linux/platform_data/dma-bcm2708.h>
|
||||
69
arch/arm/mach-bcm2708/include/mach/entry-macro.S
Normal file
69
arch/arm/mach-bcm2708/include/mach/entry-macro.S
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/entry-macro.S
|
||||
*
|
||||
* Low-level IRQ helper macros for BCM2708 platforms
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <mach/hardware.h>
|
||||
|
||||
.macro disable_fiq
|
||||
.endm
|
||||
|
||||
.macro get_irqnr_preamble, base, tmp
|
||||
ldr \base, =IO_ADDRESS(ARMCTRL_IC_BASE)
|
||||
.endm
|
||||
|
||||
.macro arch_ret_to_user, tmp1, tmp2
|
||||
.endm
|
||||
|
||||
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
|
||||
/* get masked status */
|
||||
ldr \irqstat, [\base, #(ARM_IRQ_PEND0 - ARMCTRL_IC_BASE)]
|
||||
mov \irqnr, #(ARM_IRQ0_BASE + 31)
|
||||
and \tmp, \irqstat, #0x300 @ save bits 8 and 9
|
||||
/* clear bits 8 and 9, and test */
|
||||
bics \irqstat, \irqstat, #0x300
|
||||
bne 1010f
|
||||
|
||||
tst \tmp, #0x100
|
||||
ldrne \irqstat, [\base, #(ARM_IRQ_PEND1 - ARMCTRL_IC_BASE)]
|
||||
movne \irqnr, #(ARM_IRQ1_BASE + 31)
|
||||
@ Mask out the interrupts also present in PEND0 - see SW-5809
|
||||
bicne \irqstat, #((1<<7) | (1<<9) | (1<<10))
|
||||
bicne \irqstat, #((1<<18) | (1<<19))
|
||||
bne 1010f
|
||||
|
||||
tst \tmp, #0x200
|
||||
ldrne \irqstat, [\base, #(ARM_IRQ_PEND2 - ARMCTRL_IC_BASE)]
|
||||
movne \irqnr, #(ARM_IRQ2_BASE + 31)
|
||||
@ Mask out the interrupts also present in PEND0 - see SW-5809
|
||||
bicne \irqstat, #((1<<21) | (1<<22) | (1<<23) | (1<<24) | (1<<25))
|
||||
bicne \irqstat, #((1<<30))
|
||||
beq 1020f
|
||||
|
||||
1010:
|
||||
@ For non-zero x, LSB(x) = 31 - CLZ(x^(x-1))
|
||||
@ N.B. CLZ is an ARM5 instruction.
|
||||
sub \tmp, \irqstat, #1
|
||||
eor \irqstat, \irqstat, \tmp
|
||||
clz \tmp, \irqstat
|
||||
sub \irqnr, \tmp
|
||||
|
||||
1020: @ EQ will be set if no irqs pending
|
||||
|
||||
.endm
|
||||
38
arch/arm/mach-bcm2708/include/mach/frc.h
Normal file
38
arch/arm/mach-bcm2708/include/mach/frc.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/timex.h
|
||||
*
|
||||
* BCM2708 free running counter (timer)
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _MACH_FRC_H
|
||||
#define _MACH_FRC_H
|
||||
|
||||
#define FRC_TICK_RATE (1000000)
|
||||
|
||||
/*! Free running counter incrementing at the CLOCK_TICK_RATE
|
||||
(slightly faster than frc_clock_ticks63()
|
||||
*/
|
||||
extern unsigned long frc_clock_ticks32(void);
|
||||
|
||||
/*! Free running counter incrementing at the CLOCK_TICK_RATE
|
||||
* Note - top bit should be ignored (see cnt32_to_63)
|
||||
*/
|
||||
extern unsigned long long frc_clock_ticks63(void);
|
||||
|
||||
#endif
|
||||
17
arch/arm/mach-bcm2708/include/mach/gpio.h
Normal file
17
arch/arm/mach-bcm2708/include/mach/gpio.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/gpio.h
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_GPIO_H
|
||||
#define __ASM_ARCH_GPIO_H
|
||||
|
||||
#define BCM2708_NR_GPIOS 54 // number of gpio lines
|
||||
|
||||
#define gpio_to_irq(x) ((x) + GPIO_IRQ_START)
|
||||
#define irq_to_gpio(x) ((x) - GPIO_IRQ_START)
|
||||
|
||||
#endif
|
||||
28
arch/arm/mach-bcm2708/include/mach/hardware.h
Normal file
28
arch/arm/mach-bcm2708/include/mach/hardware.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/hardware.h
|
||||
*
|
||||
* This file contains the hardware definitions of the BCM2708 devices.
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __ASM_ARCH_HARDWARE_H
|
||||
#define __ASM_ARCH_HARDWARE_H
|
||||
|
||||
#include <asm/sizes.h>
|
||||
#include <mach/platform.h>
|
||||
|
||||
#endif
|
||||
27
arch/arm/mach-bcm2708/include/mach/io.h
Normal file
27
arch/arm/mach-bcm2708/include/mach/io.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/io.h
|
||||
*
|
||||
* Copyright (C) 2003 ARM Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __ASM_ARM_ARCH_IO_H
|
||||
#define __ASM_ARM_ARCH_IO_H
|
||||
|
||||
#define IO_SPACE_LIMIT 0xffffffff
|
||||
|
||||
#define __io(a) __typesafe_io(a)
|
||||
|
||||
#endif
|
||||
199
arch/arm/mach-bcm2708/include/mach/irqs.h
Normal file
199
arch/arm/mach-bcm2708/include/mach/irqs.h
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/irqs.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
* Copyright (C) 2003 ARM Limited
|
||||
* Copyright (C) 2000 Deep Blue Solutions Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _BCM2708_IRQS_H_
|
||||
#define _BCM2708_IRQS_H_
|
||||
|
||||
#include <mach/platform.h>
|
||||
|
||||
/*
|
||||
* IRQ interrupts definitions are the same as the INT definitions
|
||||
* held within platform.h
|
||||
*/
|
||||
#define IRQ_ARMCTRL_START 0
|
||||
#define IRQ_TIMER0 (IRQ_ARMCTRL_START + INTERRUPT_TIMER0)
|
||||
#define IRQ_TIMER1 (IRQ_ARMCTRL_START + INTERRUPT_TIMER1)
|
||||
#define IRQ_TIMER2 (IRQ_ARMCTRL_START + INTERRUPT_TIMER2)
|
||||
#define IRQ_TIMER3 (IRQ_ARMCTRL_START + INTERRUPT_TIMER3)
|
||||
#define IRQ_CODEC0 (IRQ_ARMCTRL_START + INTERRUPT_CODEC0)
|
||||
#define IRQ_CODEC1 (IRQ_ARMCTRL_START + INTERRUPT_CODEC1)
|
||||
#define IRQ_CODEC2 (IRQ_ARMCTRL_START + INTERRUPT_CODEC2)
|
||||
#define IRQ_JPEG (IRQ_ARMCTRL_START + INTERRUPT_JPEG)
|
||||
#define IRQ_ISP (IRQ_ARMCTRL_START + INTERRUPT_ISP)
|
||||
#define IRQ_USB (IRQ_ARMCTRL_START + INTERRUPT_USB)
|
||||
#define IRQ_3D (IRQ_ARMCTRL_START + INTERRUPT_3D)
|
||||
#define IRQ_TRANSPOSER (IRQ_ARMCTRL_START + INTERRUPT_TRANSPOSER)
|
||||
#define IRQ_MULTICORESYNC0 (IRQ_ARMCTRL_START + INTERRUPT_MULTICORESYNC0)
|
||||
#define IRQ_MULTICORESYNC1 (IRQ_ARMCTRL_START + INTERRUPT_MULTICORESYNC1)
|
||||
#define IRQ_MULTICORESYNC2 (IRQ_ARMCTRL_START + INTERRUPT_MULTICORESYNC2)
|
||||
#define IRQ_MULTICORESYNC3 (IRQ_ARMCTRL_START + INTERRUPT_MULTICORESYNC3)
|
||||
#define IRQ_DMA0 (IRQ_ARMCTRL_START + INTERRUPT_DMA0)
|
||||
#define IRQ_DMA1 (IRQ_ARMCTRL_START + INTERRUPT_DMA1)
|
||||
#define IRQ_DMA2 (IRQ_ARMCTRL_START + INTERRUPT_DMA2)
|
||||
#define IRQ_DMA3 (IRQ_ARMCTRL_START + INTERRUPT_DMA3)
|
||||
#define IRQ_DMA4 (IRQ_ARMCTRL_START + INTERRUPT_DMA4)
|
||||
#define IRQ_DMA5 (IRQ_ARMCTRL_START + INTERRUPT_DMA5)
|
||||
#define IRQ_DMA6 (IRQ_ARMCTRL_START + INTERRUPT_DMA6)
|
||||
#define IRQ_DMA7 (IRQ_ARMCTRL_START + INTERRUPT_DMA7)
|
||||
#define IRQ_DMA8 (IRQ_ARMCTRL_START + INTERRUPT_DMA8)
|
||||
#define IRQ_DMA9 (IRQ_ARMCTRL_START + INTERRUPT_DMA9)
|
||||
#define IRQ_DMA10 (IRQ_ARMCTRL_START + INTERRUPT_DMA10)
|
||||
#define IRQ_DMA11 (IRQ_ARMCTRL_START + INTERRUPT_DMA11)
|
||||
#define IRQ_DMA12 (IRQ_ARMCTRL_START + INTERRUPT_DMA12)
|
||||
#define IRQ_AUX (IRQ_ARMCTRL_START + INTERRUPT_AUX)
|
||||
#define IRQ_ARM (IRQ_ARMCTRL_START + INTERRUPT_ARM)
|
||||
#define IRQ_VPUDMA (IRQ_ARMCTRL_START + INTERRUPT_VPUDMA)
|
||||
#define IRQ_HOSTPORT (IRQ_ARMCTRL_START + INTERRUPT_HOSTPORT)
|
||||
#define IRQ_VIDEOSCALER (IRQ_ARMCTRL_START + INTERRUPT_VIDEOSCALER)
|
||||
#define IRQ_CCP2TX (IRQ_ARMCTRL_START + INTERRUPT_CCP2TX)
|
||||
#define IRQ_SDC (IRQ_ARMCTRL_START + INTERRUPT_SDC)
|
||||
#define IRQ_DSI0 (IRQ_ARMCTRL_START + INTERRUPT_DSI0)
|
||||
#define IRQ_AVE (IRQ_ARMCTRL_START + INTERRUPT_AVE)
|
||||
#define IRQ_CAM0 (IRQ_ARMCTRL_START + INTERRUPT_CAM0)
|
||||
#define IRQ_CAM1 (IRQ_ARMCTRL_START + INTERRUPT_CAM1)
|
||||
#define IRQ_HDMI0 (IRQ_ARMCTRL_START + INTERRUPT_HDMI0)
|
||||
#define IRQ_HDMI1 (IRQ_ARMCTRL_START + INTERRUPT_HDMI1)
|
||||
#define IRQ_PIXELVALVE1 (IRQ_ARMCTRL_START + INTERRUPT_PIXELVALVE1)
|
||||
#define IRQ_I2CSPISLV (IRQ_ARMCTRL_START + INTERRUPT_I2CSPISLV)
|
||||
#define IRQ_DSI1 (IRQ_ARMCTRL_START + INTERRUPT_DSI1)
|
||||
#define IRQ_PWA0 (IRQ_ARMCTRL_START + INTERRUPT_PWA0)
|
||||
#define IRQ_PWA1 (IRQ_ARMCTRL_START + INTERRUPT_PWA1)
|
||||
#define IRQ_CPR (IRQ_ARMCTRL_START + INTERRUPT_CPR)
|
||||
#define IRQ_SMI (IRQ_ARMCTRL_START + INTERRUPT_SMI)
|
||||
#define IRQ_GPIO0 (IRQ_ARMCTRL_START + INTERRUPT_GPIO0)
|
||||
#define IRQ_GPIO1 (IRQ_ARMCTRL_START + INTERRUPT_GPIO1)
|
||||
#define IRQ_GPIO2 (IRQ_ARMCTRL_START + INTERRUPT_GPIO2)
|
||||
#define IRQ_GPIO3 (IRQ_ARMCTRL_START + INTERRUPT_GPIO3)
|
||||
#define IRQ_I2C (IRQ_ARMCTRL_START + INTERRUPT_I2C)
|
||||
#define IRQ_SPI (IRQ_ARMCTRL_START + INTERRUPT_SPI)
|
||||
#define IRQ_I2SPCM (IRQ_ARMCTRL_START + INTERRUPT_I2SPCM)
|
||||
#define IRQ_SDIO (IRQ_ARMCTRL_START + INTERRUPT_SDIO)
|
||||
#define IRQ_UART (IRQ_ARMCTRL_START + INTERRUPT_UART)
|
||||
#define IRQ_SLIMBUS (IRQ_ARMCTRL_START + INTERRUPT_SLIMBUS)
|
||||
#define IRQ_VEC (IRQ_ARMCTRL_START + INTERRUPT_VEC)
|
||||
#define IRQ_CPG (IRQ_ARMCTRL_START + INTERRUPT_CPG)
|
||||
#define IRQ_RNG (IRQ_ARMCTRL_START + INTERRUPT_RNG)
|
||||
#define IRQ_ARASANSDIO (IRQ_ARMCTRL_START + INTERRUPT_ARASANSDIO)
|
||||
#define IRQ_AVSPMON (IRQ_ARMCTRL_START + INTERRUPT_AVSPMON)
|
||||
|
||||
#define IRQ_ARM_TIMER (IRQ_ARMCTRL_START + INTERRUPT_ARM_TIMER)
|
||||
#define IRQ_ARM_MAILBOX (IRQ_ARMCTRL_START + INTERRUPT_ARM_MAILBOX)
|
||||
#define IRQ_ARM_DOORBELL_0 (IRQ_ARMCTRL_START + INTERRUPT_ARM_DOORBELL_0)
|
||||
#define IRQ_ARM_DOORBELL_1 (IRQ_ARMCTRL_START + INTERRUPT_ARM_DOORBELL_1)
|
||||
#define IRQ_VPU0_HALTED (IRQ_ARMCTRL_START + INTERRUPT_VPU0_HALTED)
|
||||
#define IRQ_VPU1_HALTED (IRQ_ARMCTRL_START + INTERRUPT_VPU1_HALTED)
|
||||
#define IRQ_ILLEGAL_TYPE0 (IRQ_ARMCTRL_START + INTERRUPT_ILLEGAL_TYPE0)
|
||||
#define IRQ_ILLEGAL_TYPE1 (IRQ_ARMCTRL_START + INTERRUPT_ILLEGAL_TYPE1)
|
||||
#define IRQ_PENDING1 (IRQ_ARMCTRL_START + INTERRUPT_PENDING1)
|
||||
#define IRQ_PENDING2 (IRQ_ARMCTRL_START + INTERRUPT_PENDING2)
|
||||
|
||||
#define FIQ_START HARD_IRQS
|
||||
|
||||
/*
|
||||
* FIQ interrupts definitions are the same as the INT definitions.
|
||||
*/
|
||||
#define FIQ_TIMER0 (FIQ_START+INTERRUPT_TIMER0)
|
||||
#define FIQ_TIMER1 (FIQ_START+INTERRUPT_TIMER1)
|
||||
#define FIQ_TIMER2 (FIQ_START+INTERRUPT_TIMER2)
|
||||
#define FIQ_TIMER3 (FIQ_START+INTERRUPT_TIMER3)
|
||||
#define FIQ_CODEC0 (FIQ_START+INTERRUPT_CODEC0)
|
||||
#define FIQ_CODEC1 (FIQ_START+INTERRUPT_CODEC1)
|
||||
#define FIQ_CODEC2 (FIQ_START+INTERRUPT_CODEC2)
|
||||
#define FIQ_JPEG (FIQ_START+INTERRUPT_JPEG)
|
||||
#define FIQ_ISP (FIQ_START+INTERRUPT_ISP)
|
||||
#define FIQ_USB (FIQ_START+INTERRUPT_USB)
|
||||
#define FIQ_3D (FIQ_START+INTERRUPT_3D)
|
||||
#define FIQ_TRANSPOSER (FIQ_START+INTERRUPT_TRANSPOSER)
|
||||
#define FIQ_MULTICORESYNC0 (FIQ_START+INTERRUPT_MULTICORESYNC0)
|
||||
#define FIQ_MULTICORESYNC1 (FIQ_START+INTERRUPT_MULTICORESYNC1)
|
||||
#define FIQ_MULTICORESYNC2 (FIQ_START+INTERRUPT_MULTICORESYNC2)
|
||||
#define FIQ_MULTICORESYNC3 (FIQ_START+INTERRUPT_MULTICORESYNC3)
|
||||
#define FIQ_DMA0 (FIQ_START+INTERRUPT_DMA0)
|
||||
#define FIQ_DMA1 (FIQ_START+INTERRUPT_DMA1)
|
||||
#define FIQ_DMA2 (FIQ_START+INTERRUPT_DMA2)
|
||||
#define FIQ_DMA3 (FIQ_START+INTERRUPT_DMA3)
|
||||
#define FIQ_DMA4 (FIQ_START+INTERRUPT_DMA4)
|
||||
#define FIQ_DMA5 (FIQ_START+INTERRUPT_DMA5)
|
||||
#define FIQ_DMA6 (FIQ_START+INTERRUPT_DMA6)
|
||||
#define FIQ_DMA7 (FIQ_START+INTERRUPT_DMA7)
|
||||
#define FIQ_DMA8 (FIQ_START+INTERRUPT_DMA8)
|
||||
#define FIQ_DMA9 (FIQ_START+INTERRUPT_DMA9)
|
||||
#define FIQ_DMA10 (FIQ_START+INTERRUPT_DMA10)
|
||||
#define FIQ_DMA11 (FIQ_START+INTERRUPT_DMA11)
|
||||
#define FIQ_DMA12 (FIQ_START+INTERRUPT_DMA12)
|
||||
#define FIQ_AUX (FIQ_START+INTERRUPT_AUX)
|
||||
#define FIQ_ARM (FIQ_START+INTERRUPT_ARM)
|
||||
#define FIQ_VPUDMA (FIQ_START+INTERRUPT_VPUDMA)
|
||||
#define FIQ_HOSTPORT (FIQ_START+INTERRUPT_HOSTPORT)
|
||||
#define FIQ_VIDEOSCALER (FIQ_START+INTERRUPT_VIDEOSCALER)
|
||||
#define FIQ_CCP2TX (FIQ_START+INTERRUPT_CCP2TX)
|
||||
#define FIQ_SDC (FIQ_START+INTERRUPT_SDC)
|
||||
#define FIQ_DSI0 (FIQ_START+INTERRUPT_DSI0)
|
||||
#define FIQ_AVE (FIQ_START+INTERRUPT_AVE)
|
||||
#define FIQ_CAM0 (FIQ_START+INTERRUPT_CAM0)
|
||||
#define FIQ_CAM1 (FIQ_START+INTERRUPT_CAM1)
|
||||
#define FIQ_HDMI0 (FIQ_START+INTERRUPT_HDMI0)
|
||||
#define FIQ_HDMI1 (FIQ_START+INTERRUPT_HDMI1)
|
||||
#define FIQ_PIXELVALVE1 (FIQ_START+INTERRUPT_PIXELVALVE1)
|
||||
#define FIQ_I2CSPISLV (FIQ_START+INTERRUPT_I2CSPISLV)
|
||||
#define FIQ_DSI1 (FIQ_START+INTERRUPT_DSI1)
|
||||
#define FIQ_PWA0 (FIQ_START+INTERRUPT_PWA0)
|
||||
#define FIQ_PWA1 (FIQ_START+INTERRUPT_PWA1)
|
||||
#define FIQ_CPR (FIQ_START+INTERRUPT_CPR)
|
||||
#define FIQ_SMI (FIQ_START+INTERRUPT_SMI)
|
||||
#define FIQ_GPIO0 (FIQ_START+INTERRUPT_GPIO0)
|
||||
#define FIQ_GPIO1 (FIQ_START+INTERRUPT_GPIO1)
|
||||
#define FIQ_GPIO2 (FIQ_START+INTERRUPT_GPIO2)
|
||||
#define FIQ_GPIO3 (FIQ_START+INTERRUPT_GPIO3)
|
||||
#define FIQ_I2C (FIQ_START+INTERRUPT_I2C)
|
||||
#define FIQ_SPI (FIQ_START+INTERRUPT_SPI)
|
||||
#define FIQ_I2SPCM (FIQ_START+INTERRUPT_I2SPCM)
|
||||
#define FIQ_SDIO (FIQ_START+INTERRUPT_SDIO)
|
||||
#define FIQ_UART (FIQ_START+INTERRUPT_UART)
|
||||
#define FIQ_SLIMBUS (FIQ_START+INTERRUPT_SLIMBUS)
|
||||
#define FIQ_VEC (FIQ_START+INTERRUPT_VEC)
|
||||
#define FIQ_CPG (FIQ_START+INTERRUPT_CPG)
|
||||
#define FIQ_RNG (FIQ_START+INTERRUPT_RNG)
|
||||
#define FIQ_ARASANSDIO (FIQ_START+INTERRUPT_ARASANSDIO)
|
||||
#define FIQ_AVSPMON (FIQ_START+INTERRUPT_AVSPMON)
|
||||
|
||||
#define FIQ_ARM_TIMER (FIQ_START+INTERRUPT_ARM_TIMER)
|
||||
#define FIQ_ARM_MAILBOX (FIQ_START+INTERRUPT_ARM_MAILBOX)
|
||||
#define FIQ_ARM_DOORBELL_0 (FIQ_START+INTERRUPT_ARM_DOORBELL_0)
|
||||
#define FIQ_ARM_DOORBELL_1 (FIQ_START+INTERRUPT_ARM_DOORBELL_1)
|
||||
#define FIQ_VPU0_HALTED (FIQ_START+INTERRUPT_VPU0_HALTED)
|
||||
#define FIQ_VPU1_HALTED (FIQ_START+INTERRUPT_VPU1_HALTED)
|
||||
#define FIQ_ILLEGAL_TYPE0 (FIQ_START+INTERRUPT_ILLEGAL_TYPE0)
|
||||
#define FIQ_ILLEGAL_TYPE1 (FIQ_START+INTERRUPT_ILLEGAL_TYPE1)
|
||||
#define FIQ_PENDING1 (FIQ_START+INTERRUPT_PENDING1)
|
||||
#define FIQ_PENDING2 (FIQ_START+INTERRUPT_PENDING2)
|
||||
|
||||
#define HARD_IRQS (64 + 21)
|
||||
#define FIQ_IRQS (64 + 21)
|
||||
#define GPIO_IRQ_START (HARD_IRQS + FIQ_IRQS)
|
||||
#define GPIO_IRQS (32*5)
|
||||
#define SPARE_ALLOC_IRQS 64
|
||||
#define BCM2708_ALLOC_IRQS (HARD_IRQS+FIQ_IRQS+GPIO_IRQS+SPARE_ALLOC_IRQS)
|
||||
#define FREE_IRQS 128
|
||||
#define NR_IRQS (BCM2708_ALLOC_IRQS+FREE_IRQS)
|
||||
|
||||
#endif /* _BCM2708_IRQS_H_ */
|
||||
57
arch/arm/mach-bcm2708/include/mach/memory.h
Normal file
57
arch/arm/mach-bcm2708/include/mach/memory.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/memory.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __ASM_ARCH_MEMORY_H
|
||||
#define __ASM_ARCH_MEMORY_H
|
||||
|
||||
/* Memory overview:
|
||||
|
||||
[ARMcore] <--virtual addr-->
|
||||
[ARMmmu] <--physical addr-->
|
||||
[GERTmap] <--bus add-->
|
||||
[VCperiph]
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* Physical DRAM offset.
|
||||
*/
|
||||
#define BCM_PLAT_PHYS_OFFSET UL(0x00000000)
|
||||
#define VC_ARMMEM_OFFSET UL(0x00000000) /* offset in VC of ARM memory */
|
||||
|
||||
#ifdef CONFIG_BCM2708_NOL2CACHE
|
||||
#define _REAL_BUS_OFFSET UL(0xC0000000) /* don't use L1 or L2 caches */
|
||||
#else
|
||||
#define _REAL_BUS_OFFSET UL(0x40000000) /* use L2 cache */
|
||||
#endif
|
||||
|
||||
/* We're using the memory at 64M in the VideoCore for Linux - this adjustment
|
||||
* will provide the offset into this area as well as setting the bits that
|
||||
* stop the L1 and L2 cache from being used
|
||||
*
|
||||
* WARNING: this only works because the ARM is given memory at a fixed location
|
||||
* (ARMMEM_OFFSET)
|
||||
*/
|
||||
#define BUS_OFFSET (VC_ARMMEM_OFFSET + _REAL_BUS_OFFSET)
|
||||
#define __virt_to_bus(x) ((x) + (BUS_OFFSET - PAGE_OFFSET))
|
||||
#define __bus_to_virt(x) ((x) - (BUS_OFFSET - PAGE_OFFSET))
|
||||
#define __pfn_to_bus(x) (__pfn_to_phys(x) + (BUS_OFFSET - BCM_PLAT_PHYS_OFFSET))
|
||||
#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - BCM_PLAT_PHYS_OFFSET))
|
||||
|
||||
#endif
|
||||
229
arch/arm/mach-bcm2708/include/mach/platform.h
Normal file
229
arch/arm/mach-bcm2708/include/mach/platform.h
Normal file
@@ -0,0 +1,229 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/platform.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _BCM2708_PLATFORM_H
|
||||
#define _BCM2708_PLATFORM_H
|
||||
|
||||
|
||||
/* macros to get at IO space when running virtually */
|
||||
#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
|
||||
|
||||
#define __io_address(n) IOMEM(IO_ADDRESS(n))
|
||||
|
||||
|
||||
/*
|
||||
* SDRAM
|
||||
*/
|
||||
#define BCM2708_SDRAM_BASE 0x00000000
|
||||
|
||||
/*
|
||||
* Logic expansion modules
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
* BCM2708 ARMCTRL Registers
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define HW_REGISTER_RW(addr) (addr)
|
||||
#define HW_REGISTER_RO(addr) (addr)
|
||||
|
||||
#include "arm_control.h"
|
||||
#undef ARM_BASE
|
||||
|
||||
/*
|
||||
* Definitions and addresses for the ARM CONTROL logic
|
||||
* This file is manually generated.
|
||||
*/
|
||||
|
||||
#define BCM2708_PERI_BASE 0x20000000
|
||||
#define IC0_BASE (BCM2708_PERI_BASE + 0x2000)
|
||||
#define ST_BASE (BCM2708_PERI_BASE + 0x3000) /* System Timer */
|
||||
#define MPHI_BASE (BCM2708_PERI_BASE + 0x6000) /* Message -based Parallel Host Interface */
|
||||
#define DMA_BASE (BCM2708_PERI_BASE + 0x7000) /* DMA controller */
|
||||
#define ARM_BASE (BCM2708_PERI_BASE + 0xB000) /* BCM2708 ARM control block */
|
||||
#define PM_BASE (BCM2708_PERI_BASE + 0x100000) /* Power Management, Reset controller and Watchdog registers */
|
||||
#define PCM_CLOCK_BASE (BCM2708_PERI_BASE + 0x101098) /* PCM Clock */
|
||||
#define RNG_BASE (BCM2708_PERI_BASE + 0x104000) /* Hardware RNG */
|
||||
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO */
|
||||
#define UART0_BASE (BCM2708_PERI_BASE + 0x201000) /* Uart 0 */
|
||||
#define MMCI0_BASE (BCM2708_PERI_BASE + 0x202000) /* MMC interface */
|
||||
#define I2S_BASE (BCM2708_PERI_BASE + 0x203000) /* I2S */
|
||||
#define SPI0_BASE (BCM2708_PERI_BASE + 0x204000) /* SPI0 */
|
||||
#define BSC0_BASE (BCM2708_PERI_BASE + 0x205000) /* BSC0 I2C/TWI */
|
||||
#define UART1_BASE (BCM2708_PERI_BASE + 0x215000) /* Uart 1 */
|
||||
#define EMMC_BASE (BCM2708_PERI_BASE + 0x300000) /* eMMC interface */
|
||||
#define SMI_BASE (BCM2708_PERI_BASE + 0x600000) /* SMI */
|
||||
#define BSC1_BASE (BCM2708_PERI_BASE + 0x804000) /* BSC1 I2C/TWI */
|
||||
#define USB_BASE (BCM2708_PERI_BASE + 0x980000) /* DTC_OTG USB controller */
|
||||
#define MCORE_BASE (BCM2708_PERI_BASE + 0x0000) /* Fake frame buffer device (actually the multicore sync block*/
|
||||
|
||||
#define ARMCTRL_BASE (ARM_BASE + 0x000)
|
||||
#define ARMCTRL_IC_BASE (ARM_BASE + 0x200) /* ARM interrupt controller */
|
||||
#define ARMCTRL_TIMER0_1_BASE (ARM_BASE + 0x400) /* Timer 0 and 1 */
|
||||
#define ARMCTRL_0_SBM_BASE (ARM_BASE + 0x800) /* User 0 (ARM)'s Semaphores Doorbells and Mailboxes */
|
||||
#define ARMCTRL_0_MAIL0_BASE (ARMCTRL_0_SBM_BASE + 0x80) /* User 0 (ARM)'s Mailbox 0 */
|
||||
|
||||
|
||||
/*
|
||||
* Interrupt assignments
|
||||
*/
|
||||
|
||||
#define ARM_IRQ1_BASE 0
|
||||
#define INTERRUPT_TIMER0 (ARM_IRQ1_BASE + 0)
|
||||
#define INTERRUPT_TIMER1 (ARM_IRQ1_BASE + 1)
|
||||
#define INTERRUPT_TIMER2 (ARM_IRQ1_BASE + 2)
|
||||
#define INTERRUPT_TIMER3 (ARM_IRQ1_BASE + 3)
|
||||
#define INTERRUPT_CODEC0 (ARM_IRQ1_BASE + 4)
|
||||
#define INTERRUPT_CODEC1 (ARM_IRQ1_BASE + 5)
|
||||
#define INTERRUPT_CODEC2 (ARM_IRQ1_BASE + 6)
|
||||
#define INTERRUPT_VC_JPEG (ARM_IRQ1_BASE + 7)
|
||||
#define INTERRUPT_ISP (ARM_IRQ1_BASE + 8)
|
||||
#define INTERRUPT_VC_USB (ARM_IRQ1_BASE + 9)
|
||||
#define INTERRUPT_VC_3D (ARM_IRQ1_BASE + 10)
|
||||
#define INTERRUPT_TRANSPOSER (ARM_IRQ1_BASE + 11)
|
||||
#define INTERRUPT_MULTICORESYNC0 (ARM_IRQ1_BASE + 12)
|
||||
#define INTERRUPT_MULTICORESYNC1 (ARM_IRQ1_BASE + 13)
|
||||
#define INTERRUPT_MULTICORESYNC2 (ARM_IRQ1_BASE + 14)
|
||||
#define INTERRUPT_MULTICORESYNC3 (ARM_IRQ1_BASE + 15)
|
||||
#define INTERRUPT_DMA0 (ARM_IRQ1_BASE + 16)
|
||||
#define INTERRUPT_DMA1 (ARM_IRQ1_BASE + 17)
|
||||
#define INTERRUPT_VC_DMA2 (ARM_IRQ1_BASE + 18)
|
||||
#define INTERRUPT_VC_DMA3 (ARM_IRQ1_BASE + 19)
|
||||
#define INTERRUPT_DMA4 (ARM_IRQ1_BASE + 20)
|
||||
#define INTERRUPT_DMA5 (ARM_IRQ1_BASE + 21)
|
||||
#define INTERRUPT_DMA6 (ARM_IRQ1_BASE + 22)
|
||||
#define INTERRUPT_DMA7 (ARM_IRQ1_BASE + 23)
|
||||
#define INTERRUPT_DMA8 (ARM_IRQ1_BASE + 24)
|
||||
#define INTERRUPT_DMA9 (ARM_IRQ1_BASE + 25)
|
||||
#define INTERRUPT_DMA10 (ARM_IRQ1_BASE + 26)
|
||||
#define INTERRUPT_DMA11 (ARM_IRQ1_BASE + 27)
|
||||
#define INTERRUPT_DMA12 (ARM_IRQ1_BASE + 28)
|
||||
#define INTERRUPT_AUX (ARM_IRQ1_BASE + 29)
|
||||
#define INTERRUPT_ARM (ARM_IRQ1_BASE + 30)
|
||||
#define INTERRUPT_VPUDMA (ARM_IRQ1_BASE + 31)
|
||||
|
||||
#define ARM_IRQ2_BASE 32
|
||||
#define INTERRUPT_HOSTPORT (ARM_IRQ2_BASE + 0)
|
||||
#define INTERRUPT_VIDEOSCALER (ARM_IRQ2_BASE + 1)
|
||||
#define INTERRUPT_CCP2TX (ARM_IRQ2_BASE + 2)
|
||||
#define INTERRUPT_SDC (ARM_IRQ2_BASE + 3)
|
||||
#define INTERRUPT_DSI0 (ARM_IRQ2_BASE + 4)
|
||||
#define INTERRUPT_AVE (ARM_IRQ2_BASE + 5)
|
||||
#define INTERRUPT_CAM0 (ARM_IRQ2_BASE + 6)
|
||||
#define INTERRUPT_CAM1 (ARM_IRQ2_BASE + 7)
|
||||
#define INTERRUPT_HDMI0 (ARM_IRQ2_BASE + 8)
|
||||
#define INTERRUPT_HDMI1 (ARM_IRQ2_BASE + 9)
|
||||
#define INTERRUPT_PIXELVALVE1 (ARM_IRQ2_BASE + 10)
|
||||
#define INTERRUPT_I2CSPISLV (ARM_IRQ2_BASE + 11)
|
||||
#define INTERRUPT_DSI1 (ARM_IRQ2_BASE + 12)
|
||||
#define INTERRUPT_PWA0 (ARM_IRQ2_BASE + 13)
|
||||
#define INTERRUPT_PWA1 (ARM_IRQ2_BASE + 14)
|
||||
#define INTERRUPT_CPR (ARM_IRQ2_BASE + 15)
|
||||
#define INTERRUPT_SMI (ARM_IRQ2_BASE + 16)
|
||||
#define INTERRUPT_GPIO0 (ARM_IRQ2_BASE + 17)
|
||||
#define INTERRUPT_GPIO1 (ARM_IRQ2_BASE + 18)
|
||||
#define INTERRUPT_GPIO2 (ARM_IRQ2_BASE + 19)
|
||||
#define INTERRUPT_GPIO3 (ARM_IRQ2_BASE + 20)
|
||||
#define INTERRUPT_VC_I2C (ARM_IRQ2_BASE + 21)
|
||||
#define INTERRUPT_VC_SPI (ARM_IRQ2_BASE + 22)
|
||||
#define INTERRUPT_VC_I2SPCM (ARM_IRQ2_BASE + 23)
|
||||
#define INTERRUPT_VC_SDIO (ARM_IRQ2_BASE + 24)
|
||||
#define INTERRUPT_VC_UART (ARM_IRQ2_BASE + 25)
|
||||
#define INTERRUPT_SLIMBUS (ARM_IRQ2_BASE + 26)
|
||||
#define INTERRUPT_VEC (ARM_IRQ2_BASE + 27)
|
||||
#define INTERRUPT_CPG (ARM_IRQ2_BASE + 28)
|
||||
#define INTERRUPT_RNG (ARM_IRQ2_BASE + 29)
|
||||
#define INTERRUPT_VC_ARASANSDIO (ARM_IRQ2_BASE + 30)
|
||||
#define INTERRUPT_AVSPMON (ARM_IRQ2_BASE + 31)
|
||||
|
||||
#define ARM_IRQ0_BASE 64
|
||||
#define INTERRUPT_ARM_TIMER (ARM_IRQ0_BASE + 0)
|
||||
#define INTERRUPT_ARM_MAILBOX (ARM_IRQ0_BASE + 1)
|
||||
#define INTERRUPT_ARM_DOORBELL_0 (ARM_IRQ0_BASE + 2)
|
||||
#define INTERRUPT_ARM_DOORBELL_1 (ARM_IRQ0_BASE + 3)
|
||||
#define INTERRUPT_VPU0_HALTED (ARM_IRQ0_BASE + 4)
|
||||
#define INTERRUPT_VPU1_HALTED (ARM_IRQ0_BASE + 5)
|
||||
#define INTERRUPT_ILLEGAL_TYPE0 (ARM_IRQ0_BASE + 6)
|
||||
#define INTERRUPT_ILLEGAL_TYPE1 (ARM_IRQ0_BASE + 7)
|
||||
#define INTERRUPT_PENDING1 (ARM_IRQ0_BASE + 8)
|
||||
#define INTERRUPT_PENDING2 (ARM_IRQ0_BASE + 9)
|
||||
#define INTERRUPT_JPEG (ARM_IRQ0_BASE + 10)
|
||||
#define INTERRUPT_USB (ARM_IRQ0_BASE + 11)
|
||||
#define INTERRUPT_3D (ARM_IRQ0_BASE + 12)
|
||||
#define INTERRUPT_DMA2 (ARM_IRQ0_BASE + 13)
|
||||
#define INTERRUPT_DMA3 (ARM_IRQ0_BASE + 14)
|
||||
#define INTERRUPT_I2C (ARM_IRQ0_BASE + 15)
|
||||
#define INTERRUPT_SPI (ARM_IRQ0_BASE + 16)
|
||||
#define INTERRUPT_I2SPCM (ARM_IRQ0_BASE + 17)
|
||||
#define INTERRUPT_SDIO (ARM_IRQ0_BASE + 18)
|
||||
#define INTERRUPT_UART (ARM_IRQ0_BASE + 19)
|
||||
#define INTERRUPT_ARASANSDIO (ARM_IRQ0_BASE + 20)
|
||||
|
||||
#define MAXIRQNUM (32 + 32 + 20)
|
||||
#define MAXFIQNUM (32 + 32 + 20)
|
||||
|
||||
#define MAX_TIMER 2
|
||||
#define MAX_PERIOD 699050
|
||||
#define TICKS_PER_uSEC 1
|
||||
|
||||
/*
|
||||
* These are useconds NOT ticks.
|
||||
*
|
||||
*/
|
||||
#define mSEC_1 1000
|
||||
#define mSEC_5 (mSEC_1 * 5)
|
||||
#define mSEC_10 (mSEC_1 * 10)
|
||||
#define mSEC_25 (mSEC_1 * 25)
|
||||
#define SEC_1 (mSEC_1 * 1000)
|
||||
|
||||
/*
|
||||
* Watchdog
|
||||
*/
|
||||
#define PM_RSTC (PM_BASE+0x1c)
|
||||
#define PM_RSTS (PM_BASE+0x20)
|
||||
#define PM_WDOG (PM_BASE+0x24)
|
||||
|
||||
#define PM_WDOG_RESET 0000000000
|
||||
#define PM_PASSWORD 0x5a000000
|
||||
#define PM_WDOG_TIME_SET 0x000fffff
|
||||
#define PM_RSTC_WRCFG_CLR 0xffffffcf
|
||||
#define PM_RSTC_WRCFG_SET 0x00000030
|
||||
#define PM_RSTC_WRCFG_FULL_RESET 0x00000020
|
||||
#define PM_RSTC_RESET 0x00000102
|
||||
|
||||
#define PM_RSTS_HADPOR_SET 0x00001000
|
||||
#define PM_RSTS_HADSRH_SET 0x00000400
|
||||
#define PM_RSTS_HADSRF_SET 0x00000200
|
||||
#define PM_RSTS_HADSRQ_SET 0x00000100
|
||||
#define PM_RSTS_HADWRH_SET 0x00000040
|
||||
#define PM_RSTS_HADWRF_SET 0x00000020
|
||||
#define PM_RSTS_HADWRQ_SET 0x00000010
|
||||
#define PM_RSTS_HADDRH_SET 0x00000004
|
||||
#define PM_RSTS_HADDRF_SET 0x00000002
|
||||
#define PM_RSTS_HADDRQ_SET 0x00000001
|
||||
|
||||
#define UART0_CLOCK 3000000
|
||||
|
||||
#endif
|
||||
|
||||
/* END */
|
||||
26
arch/arm/mach-bcm2708/include/mach/power.h
Normal file
26
arch/arm/mach-bcm2708/include/mach/power.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/power.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This device provides a shared mechanism for controlling the power to
|
||||
* VideoCore subsystems.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_BCM2708_POWER_H
|
||||
#define _MACH_BCM2708_POWER_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <mach/arm_power.h>
|
||||
|
||||
typedef unsigned int BCM_POWER_HANDLE_T;
|
||||
|
||||
extern int bcm_power_open(BCM_POWER_HANDLE_T *handle);
|
||||
extern int bcm_power_request(BCM_POWER_HANDLE_T handle, uint32_t request);
|
||||
extern int bcm_power_close(BCM_POWER_HANDLE_T handle);
|
||||
|
||||
#endif
|
||||
38
arch/arm/mach-bcm2708/include/mach/system.h
Normal file
38
arch/arm/mach-bcm2708/include/mach/system.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/system.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
* Copyright (C) 2003 ARM Limited
|
||||
* Copyright (C) 2000 Deep Blue Solutions Ltd
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __ASM_ARCH_SYSTEM_H
|
||||
#define __ASM_ARCH_SYSTEM_H
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/platform.h>
|
||||
|
||||
static inline void arch_idle(void)
|
||||
{
|
||||
/*
|
||||
* This should do all the clock switching
|
||||
* and wait for interrupt tricks
|
||||
*/
|
||||
cpu_do_idle();
|
||||
}
|
||||
|
||||
#endif
|
||||
23
arch/arm/mach-bcm2708/include/mach/timex.h
Normal file
23
arch/arm/mach-bcm2708/include/mach/timex.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/timex.h
|
||||
*
|
||||
* BCM2708 sysem clock frequency
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define CLOCK_TICK_RATE (1000000)
|
||||
84
arch/arm/mach-bcm2708/include/mach/uncompress.h
Normal file
84
arch/arm/mach-bcm2708/include/mach/uncompress.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* arch/arm/mach-bcn2708/include/mach/uncompress.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
* Copyright (C) 2003 ARM Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/amba/serial.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
#define UART_BAUD 115200
|
||||
|
||||
#define BCM2708_UART_DR __io(UART0_BASE + UART01x_DR)
|
||||
#define BCM2708_UART_FR __io(UART0_BASE + UART01x_FR)
|
||||
#define BCM2708_UART_IBRD __io(UART0_BASE + UART011_IBRD)
|
||||
#define BCM2708_UART_FBRD __io(UART0_BASE + UART011_FBRD)
|
||||
#define BCM2708_UART_LCRH __io(UART0_BASE + UART011_LCRH)
|
||||
#define BCM2708_UART_CR __io(UART0_BASE + UART011_CR)
|
||||
|
||||
/*
|
||||
* This does not append a newline
|
||||
*/
|
||||
static inline void putc(int c)
|
||||
{
|
||||
while (__raw_readl(BCM2708_UART_FR) & UART01x_FR_TXFF)
|
||||
barrier();
|
||||
|
||||
__raw_writel(c, BCM2708_UART_DR);
|
||||
}
|
||||
|
||||
static inline void flush(void)
|
||||
{
|
||||
int fr;
|
||||
|
||||
do {
|
||||
fr = __raw_readl(BCM2708_UART_FR);
|
||||
barrier();
|
||||
} while ((fr & (UART011_FR_TXFE | UART01x_FR_BUSY)) != UART011_FR_TXFE);
|
||||
}
|
||||
|
||||
static inline void arch_decomp_setup(void)
|
||||
{
|
||||
int temp, div, rem, frac;
|
||||
|
||||
temp = 16 * UART_BAUD;
|
||||
div = UART0_CLOCK / temp;
|
||||
rem = UART0_CLOCK % temp;
|
||||
temp = (8 * rem) / UART_BAUD;
|
||||
frac = (temp >> 1) + (temp & 1);
|
||||
|
||||
/* Make sure the UART is disabled before we start */
|
||||
__raw_writel(0, BCM2708_UART_CR);
|
||||
|
||||
/* Set the baud rate */
|
||||
__raw_writel(div, BCM2708_UART_IBRD);
|
||||
__raw_writel(frac, BCM2708_UART_FBRD);
|
||||
|
||||
/* Set the UART to 8n1, FIFO enabled */
|
||||
__raw_writel(UART01x_LCRH_WLEN_8 | UART01x_LCRH_FEN, BCM2708_UART_LCRH);
|
||||
|
||||
/* Enable the UART */
|
||||
__raw_writel(UART01x_CR_UARTEN | UART011_CR_TXE | UART011_CR_RXE,
|
||||
BCM2708_UART_CR);
|
||||
}
|
||||
|
||||
/*
|
||||
* nothing to do
|
||||
*/
|
||||
#define arch_decomp_wdog()
|
||||
35
arch/arm/mach-bcm2708/include/mach/vc_mem.h
Normal file
35
arch/arm/mach-bcm2708/include/mach/vc_mem.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*****************************************************************************
|
||||
* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved.
|
||||
*
|
||||
* Unless you and Broadcom execute a separate written software license
|
||||
* agreement governing use of this software, this software is licensed to you
|
||||
* under the terms of the GNU General Public License version 2, available at
|
||||
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
|
||||
*
|
||||
* Notwithstanding the above, under no circumstances may you combine this
|
||||
* software in any way with any other Broadcom software provided under a
|
||||
* license other than the GPL, without Broadcom's express prior written
|
||||
* consent.
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined( VC_MEM_H )
|
||||
#define VC_MEM_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define VC_MEM_IOC_MAGIC 'v'
|
||||
|
||||
#define VC_MEM_IOC_MEM_PHYS_ADDR _IOR( VC_MEM_IOC_MAGIC, 0, unsigned long )
|
||||
#define VC_MEM_IOC_MEM_SIZE _IOR( VC_MEM_IOC_MAGIC, 1, unsigned int )
|
||||
#define VC_MEM_IOC_MEM_BASE _IOR( VC_MEM_IOC_MAGIC, 2, unsigned int )
|
||||
#define VC_MEM_IOC_MEM_LOAD _IOR( VC_MEM_IOC_MAGIC, 3, unsigned int )
|
||||
|
||||
#if defined( __KERNEL__ )
|
||||
#define VC_MEM_TO_ARM_ADDR_MASK 0x3FFFFFFF
|
||||
|
||||
extern unsigned long mm_vc_mem_phys_addr;
|
||||
extern unsigned int mm_vc_mem_size;
|
||||
extern int vc_mem_get_current_size( void );
|
||||
#endif
|
||||
|
||||
#endif /* VC_MEM_H */
|
||||
181
arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h
Normal file
181
arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h
Normal file
@@ -0,0 +1,181 @@
|
||||
/*****************************************************************************
|
||||
* Copyright 2011 Broadcom Corporation. All rights reserved.
|
||||
*
|
||||
* Unless you and Broadcom execute a separate written software license
|
||||
* agreement governing use of this software, this software is licensed to you
|
||||
* under the terms of the GNU General Public License version 2, available at
|
||||
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
|
||||
*
|
||||
* Notwithstanding the above, under no circumstances may you combine this
|
||||
* software in any way with any other Broadcom software provided under a
|
||||
* license other than the GPL, without Broadcom's express prior written
|
||||
* consent.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __VC_SM_DEFS_H__INCLUDED__
|
||||
#define __VC_SM_DEFS_H__INCLUDED__
|
||||
|
||||
/* FourCC code used for VCHI connection */
|
||||
#define VC_SM_SERVER_NAME MAKE_FOURCC("SMEM")
|
||||
|
||||
/* Maximum message length */
|
||||
#define VC_SM_MAX_MSG_LEN (sizeof(VC_SM_MSG_UNION_T) + \
|
||||
sizeof(VC_SM_MSG_HDR_T))
|
||||
#define VC_SM_MAX_RSP_LEN (sizeof(VC_SM_MSG_UNION_T))
|
||||
|
||||
/* Resource name maximum size */
|
||||
#define VC_SM_RESOURCE_NAME 32
|
||||
|
||||
/* All message types supported for HOST->VC direction */
|
||||
typedef enum {
|
||||
/* Allocate shared memory block */
|
||||
VC_SM_MSG_TYPE_ALLOC,
|
||||
/* Lock allocated shared memory block */
|
||||
VC_SM_MSG_TYPE_LOCK,
|
||||
/* Unlock allocated shared memory block */
|
||||
VC_SM_MSG_TYPE_UNLOCK,
|
||||
/* Unlock allocated shared memory block, do not answer command */
|
||||
VC_SM_MSG_TYPE_UNLOCK_NOANS,
|
||||
/* Free shared memory block */
|
||||
VC_SM_MSG_TYPE_FREE,
|
||||
/* Resize a shared memory block */
|
||||
VC_SM_MSG_TYPE_RESIZE,
|
||||
/* Walk the allocated shared memory block(s) */
|
||||
VC_SM_MSG_TYPE_WALK_ALLOC,
|
||||
|
||||
/* A previously applied action will need to be reverted */
|
||||
VC_SM_MSG_TYPE_ACTION_CLEAN,
|
||||
VC_SM_MSG_TYPE_MAX
|
||||
} VC_SM_MSG_TYPE;
|
||||
|
||||
/* Type of memory to be allocated */
|
||||
typedef enum {
|
||||
VC_SM_ALLOC_CACHED,
|
||||
VC_SM_ALLOC_NON_CACHED,
|
||||
|
||||
} VC_SM_ALLOC_TYPE_T;
|
||||
|
||||
/* Message header for all messages in HOST->VC direction */
|
||||
typedef struct {
|
||||
int32_t type;
|
||||
uint32_t trans_id;
|
||||
uint8_t body[0];
|
||||
|
||||
} VC_SM_MSG_HDR_T;
|
||||
|
||||
/* Request to allocate memory (HOST->VC) */
|
||||
typedef struct {
|
||||
/* type of memory to allocate */
|
||||
VC_SM_ALLOC_TYPE_T type;
|
||||
/* byte amount of data to allocate per unit */
|
||||
uint32_t base_unit;
|
||||
/* number of unit to allocate */
|
||||
uint32_t num_unit;
|
||||
/* alignement to be applied on allocation */
|
||||
uint32_t alignement;
|
||||
/* identity of who allocated this block */
|
||||
uint32_t allocator;
|
||||
/* resource name (for easier tracking on vc side) */
|
||||
char name[VC_SM_RESOURCE_NAME];
|
||||
|
||||
} VC_SM_ALLOC_T;
|
||||
|
||||
/* Result of a requested memory allocation (VC->HOST) */
|
||||
typedef struct {
|
||||
/* Transaction identifier */
|
||||
uint32_t trans_id;
|
||||
|
||||
/* Resource handle */
|
||||
uint32_t res_handle;
|
||||
/* Pointer to resource buffer */
|
||||
void *res_mem;
|
||||
/* Resource base size (bytes) */
|
||||
uint32_t res_base_size;
|
||||
/* Resource number */
|
||||
uint32_t res_num;
|
||||
|
||||
} VC_SM_ALLOC_RESULT_T;
|
||||
|
||||
/* Request to free a previously allocated memory (HOST->VC) */
|
||||
typedef struct {
|
||||
/* Resource handle (returned from alloc) */
|
||||
uint32_t res_handle;
|
||||
/* Resource buffer (returned from alloc) */
|
||||
void *res_mem;
|
||||
|
||||
} VC_SM_FREE_T;
|
||||
|
||||
/* Request to lock a previously allocated memory (HOST->VC) */
|
||||
typedef struct {
|
||||
/* Resource handle (returned from alloc) */
|
||||
uint32_t res_handle;
|
||||
/* Resource buffer (returned from alloc) */
|
||||
void *res_mem;
|
||||
|
||||
} VC_SM_LOCK_UNLOCK_T;
|
||||
|
||||
/* Request to resize a previously allocated memory (HOST->VC) */
|
||||
typedef struct {
|
||||
/* Resource handle (returned from alloc) */
|
||||
uint32_t res_handle;
|
||||
/* Resource buffer (returned from alloc) */
|
||||
void *res_mem;
|
||||
/* Resource *new* size requested (bytes) */
|
||||
uint32_t res_new_size;
|
||||
|
||||
} VC_SM_RESIZE_T;
|
||||
|
||||
/* Result of a requested memory lock (VC->HOST) */
|
||||
typedef struct {
|
||||
/* Transaction identifier */
|
||||
uint32_t trans_id;
|
||||
|
||||
/* Resource handle */
|
||||
uint32_t res_handle;
|
||||
/* Pointer to resource buffer */
|
||||
void *res_mem;
|
||||
/* Pointer to former resource buffer if the memory
|
||||
* was reallocated */
|
||||
void *res_old_mem;
|
||||
|
||||
} VC_SM_LOCK_RESULT_T;
|
||||
|
||||
/* Generic result for a request (VC->HOST) */
|
||||
typedef struct {
|
||||
/* Transaction identifier */
|
||||
uint32_t trans_id;
|
||||
|
||||
int32_t success;
|
||||
|
||||
} VC_SM_RESULT_T;
|
||||
|
||||
/* Request to revert a previously applied action (HOST->VC) */
|
||||
typedef struct {
|
||||
/* Action of interest */
|
||||
VC_SM_MSG_TYPE res_action;
|
||||
/* Transaction identifier for the action of interest */
|
||||
uint32_t action_trans_id;
|
||||
|
||||
} VC_SM_ACTION_CLEAN_T;
|
||||
|
||||
/* Request to remove all data associated with a given allocator (HOST->VC) */
|
||||
typedef struct {
|
||||
/* Allocator identifier */
|
||||
uint32_t allocator;
|
||||
|
||||
} VC_SM_FREE_ALL_T;
|
||||
|
||||
/* Union of ALL messages */
|
||||
typedef union {
|
||||
VC_SM_ALLOC_T alloc;
|
||||
VC_SM_ALLOC_RESULT_T alloc_result;
|
||||
VC_SM_FREE_T free;
|
||||
VC_SM_ACTION_CLEAN_T action_clean;
|
||||
VC_SM_RESIZE_T resize;
|
||||
VC_SM_LOCK_RESULT_T lock_result;
|
||||
VC_SM_RESULT_T result;
|
||||
VC_SM_FREE_ALL_T free_all;
|
||||
|
||||
} VC_SM_MSG_UNION_T;
|
||||
|
||||
#endif /* __VC_SM_DEFS_H__INCLUDED__ */
|
||||
55
arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h
Normal file
55
arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*****************************************************************************
|
||||
* Copyright 2011 Broadcom Corporation. All rights reserved.
|
||||
*
|
||||
* Unless you and Broadcom execute a separate written software license
|
||||
* agreement governing use of this software, this software is licensed to you
|
||||
* under the terms of the GNU General Public License version 2, available at
|
||||
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
|
||||
*
|
||||
* Notwithstanding the above, under no circumstances may you combine this
|
||||
* software in any way with any other Broadcom software provided under a
|
||||
* license other than the GPL, without Broadcom's express prior written
|
||||
* consent.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __VC_SM_KNL_H__INCLUDED__
|
||||
#define __VC_SM_KNL_H__INCLUDED__
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
#error "This interface is for kernel use only..."
|
||||
#endif
|
||||
|
||||
/* Type of memory to be locked (ie mapped) */
|
||||
typedef enum {
|
||||
VC_SM_LOCK_CACHED,
|
||||
VC_SM_LOCK_NON_CACHED,
|
||||
|
||||
} VC_SM_LOCK_CACHE_MODE_T;
|
||||
|
||||
/* Allocate a shared memory handle and block.
|
||||
*/
|
||||
int vc_sm_alloc(VC_SM_ALLOC_T *alloc, int *handle);
|
||||
|
||||
/* Free a previously allocated shared memory handle and block.
|
||||
*/
|
||||
int vc_sm_free(int handle);
|
||||
|
||||
/* Lock a memory handle for use by kernel.
|
||||
*/
|
||||
int vc_sm_lock(int handle, VC_SM_LOCK_CACHE_MODE_T mode,
|
||||
long unsigned int *data);
|
||||
|
||||
/* Unlock a memory handle in use by kernel.
|
||||
*/
|
||||
int vc_sm_unlock(int handle, int flush, int no_vc_unlock);
|
||||
|
||||
/* Get an internal resource handle mapped from the external one.
|
||||
*/
|
||||
int vc_sm_int_handle(int handle);
|
||||
|
||||
/* Map a shared memory region for use by kernel.
|
||||
*/
|
||||
int vc_sm_map(int handle, unsigned int sm_addr, VC_SM_LOCK_CACHE_MODE_T mode,
|
||||
long unsigned int *data);
|
||||
|
||||
#endif /* __VC_SM_KNL_H__INCLUDED__ */
|
||||
82
arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h
Normal file
82
arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*****************************************************************************
|
||||
* Copyright 2011 Broadcom Corporation. All rights reserved.
|
||||
*
|
||||
* Unless you and Broadcom execute a separate written software license
|
||||
* agreement governing use of this software, this software is licensed to you
|
||||
* under the terms of the GNU General Public License version 2, available at
|
||||
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
|
||||
*
|
||||
* Notwithstanding the above, under no circumstances may you combine this
|
||||
* software in any way with any other Broadcom software provided under a
|
||||
* license other than the GPL, without Broadcom's express prior written
|
||||
* consent.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __VC_VCHI_SM_H__INCLUDED__
|
||||
#define __VC_VCHI_SM_H__INCLUDED__
|
||||
|
||||
#include "interface/vchi/vchi.h"
|
||||
|
||||
#include "vc_sm_defs.h"
|
||||
|
||||
/* Forward declare.
|
||||
*/
|
||||
typedef struct sm_instance *VC_VCHI_SM_HANDLE_T;
|
||||
|
||||
/* Initialize the shared memory service, opens up vchi connection to talk to it.
|
||||
*/
|
||||
VC_VCHI_SM_HANDLE_T vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance,
|
||||
VCHI_CONNECTION_T **vchi_connections,
|
||||
uint32_t num_connections);
|
||||
|
||||
/* Terminates the shared memory service.
|
||||
*/
|
||||
int vc_vchi_sm_stop(VC_VCHI_SM_HANDLE_T *handle);
|
||||
|
||||
/* Ask the shared memory service to allocate some memory on videocre and
|
||||
** return the result of this allocation (which upon success will be a pointer
|
||||
** to some memory in videocore space).
|
||||
*/
|
||||
int vc_vchi_sm_alloc(VC_VCHI_SM_HANDLE_T handle,
|
||||
VC_SM_ALLOC_T *alloc,
|
||||
VC_SM_ALLOC_RESULT_T *alloc_result, uint32_t *trans_id);
|
||||
|
||||
/* Ask the shared memory service to free up some memory that was previously
|
||||
** allocated by the vc_vchi_sm_alloc function call.
|
||||
*/
|
||||
int vc_vchi_sm_free(VC_VCHI_SM_HANDLE_T handle,
|
||||
VC_SM_FREE_T *free, uint32_t *trans_id);
|
||||
|
||||
/* Ask the shared memory service to lock up some memory that was previously
|
||||
** allocated by the vc_vchi_sm_alloc function call.
|
||||
*/
|
||||
int vc_vchi_sm_lock(VC_VCHI_SM_HANDLE_T handle,
|
||||
VC_SM_LOCK_UNLOCK_T *lock_unlock,
|
||||
VC_SM_LOCK_RESULT_T *lock_result, uint32_t *trans_id);
|
||||
|
||||
/* Ask the shared memory service to unlock some memory that was previously
|
||||
** allocated by the vc_vchi_sm_alloc function call.
|
||||
*/
|
||||
int vc_vchi_sm_unlock(VC_VCHI_SM_HANDLE_T handle,
|
||||
VC_SM_LOCK_UNLOCK_T *lock_unlock,
|
||||
uint32_t *trans_id, uint8_t wait_reply);
|
||||
|
||||
/* Ask the shared memory service to resize some memory that was previously
|
||||
** allocated by the vc_vchi_sm_alloc function call.
|
||||
*/
|
||||
int vc_vchi_sm_resize(VC_VCHI_SM_HANDLE_T handle,
|
||||
VC_SM_RESIZE_T *resize, uint32_t *trans_id);
|
||||
|
||||
/* Walk the allocated resources on the videocore side, the allocation will
|
||||
** show up in the log. This is purely for debug/information and takes no
|
||||
** specific actions.
|
||||
*/
|
||||
int vc_vchi_sm_walk_alloc(VC_VCHI_SM_HANDLE_T handle);
|
||||
|
||||
/* Clean up following a previously interrupted action which left the system
|
||||
** in a bad state of some sort.
|
||||
*/
|
||||
int vc_vchi_sm_clean_up(VC_VCHI_SM_HANDLE_T handle,
|
||||
VC_SM_ACTION_CLEAN_T *action_clean);
|
||||
|
||||
#endif /* __VC_VCHI_SM_H__INCLUDED__ */
|
||||
20
arch/arm/mach-bcm2708/include/mach/vmalloc.h
Normal file
20
arch/arm/mach-bcm2708/include/mach/vmalloc.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* arch/arm/mach-bcm2708/include/mach/vmalloc.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#define VMALLOC_END (0xe8000000)
|
||||
233
arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h
Normal file
233
arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h
Normal file
@@ -0,0 +1,233 @@
|
||||
/*****************************************************************************
|
||||
* Copyright 2011 Broadcom Corporation. All rights reserved.
|
||||
*
|
||||
* Unless you and Broadcom execute a separate written software license
|
||||
* agreement governing use of this software, this software is licensed to you
|
||||
* under the terms of the GNU General Public License version 2, available at
|
||||
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
|
||||
*
|
||||
* Notwithstanding the above, under no circumstances may you combine this
|
||||
* software in any way with any other Broadcom software provided under a
|
||||
* license other than the GPL, without Broadcom's express prior written
|
||||
* consent.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined(__VMCS_SM_IOCTL_H__INCLUDED__)
|
||||
#define __VMCS_SM_IOCTL_H__INCLUDED__
|
||||
|
||||
/* ---- Include Files ---------------------------------------------------- */
|
||||
|
||||
#if defined(__KERNEL__)
|
||||
#include <linux/types.h> /* Needed for standard types */
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
/* ---- Constants and Types ---------------------------------------------- */
|
||||
|
||||
#define VMCS_SM_RESOURCE_NAME 32
|
||||
#define VMCS_SM_RESOURCE_NAME_DEFAULT "sm-host-resource"
|
||||
|
||||
/* Type define used to create unique IOCTL number */
|
||||
#define VMCS_SM_MAGIC_TYPE 'I'
|
||||
|
||||
/* IOCTL commands */
|
||||
enum vmcs_sm_cmd_e {
|
||||
VMCS_SM_CMD_ALLOC = 0x5A, /* Start at 0x5A arbitrarily */
|
||||
VMCS_SM_CMD_ALLOC_SHARE,
|
||||
VMCS_SM_CMD_LOCK,
|
||||
VMCS_SM_CMD_LOCK_CACHE,
|
||||
VMCS_SM_CMD_UNLOCK,
|
||||
VMCS_SM_CMD_RESIZE,
|
||||
VMCS_SM_CMD_UNMAP,
|
||||
VMCS_SM_CMD_FREE,
|
||||
VMCS_SM_CMD_FLUSH,
|
||||
VMCS_SM_CMD_INVALID,
|
||||
|
||||
VMCS_SM_CMD_SIZE_USR_HANDLE,
|
||||
VMCS_SM_CMD_CHK_USR_HANDLE,
|
||||
|
||||
VMCS_SM_CMD_MAPPED_USR_HANDLE,
|
||||
VMCS_SM_CMD_MAPPED_USR_ADDRESS,
|
||||
VMCS_SM_CMD_MAPPED_VC_HDL_FROM_ADDR,
|
||||
VMCS_SM_CMD_MAPPED_VC_HDL_FROM_HDL,
|
||||
VMCS_SM_CMD_MAPPED_VC_ADDR_FROM_HDL,
|
||||
|
||||
VMCS_SM_CMD_VC_WALK_ALLOC,
|
||||
VMCS_SM_CMD_HOST_WALK_MAP,
|
||||
VMCS_SM_CMD_HOST_WALK_PID_ALLOC,
|
||||
VMCS_SM_CMD_HOST_WALK_PID_MAP,
|
||||
|
||||
VMCS_SM_CMD_LAST /* Do no delete */
|
||||
};
|
||||
|
||||
/* Cache type supported, conveniently matches the user space definition in
|
||||
** user-vcsm.h.
|
||||
*/
|
||||
enum vmcs_sm_cache_e {
|
||||
VMCS_SM_CACHE_NONE,
|
||||
VMCS_SM_CACHE_HOST,
|
||||
VMCS_SM_CACHE_VC,
|
||||
VMCS_SM_CACHE_BOTH,
|
||||
};
|
||||
|
||||
/* IOCTL Data structures */
|
||||
struct vmcs_sm_ioctl_alloc {
|
||||
/* user -> kernel */
|
||||
unsigned int size;
|
||||
unsigned int num;
|
||||
enum vmcs_sm_cache_e cached;
|
||||
char name[VMCS_SM_RESOURCE_NAME];
|
||||
|
||||
/* kernel -> user */
|
||||
unsigned int handle;
|
||||
/* unsigned int base_addr; */
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_alloc_share {
|
||||
/* user -> kernel */
|
||||
unsigned int handle;
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_free {
|
||||
/* user -> kernel */
|
||||
unsigned int handle;
|
||||
/* unsigned int base_addr; */
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_lock_unlock {
|
||||
/* user -> kernel */
|
||||
unsigned int handle;
|
||||
|
||||
/* kernel -> user */
|
||||
unsigned int addr;
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_lock_cache {
|
||||
/* user -> kernel */
|
||||
unsigned int handle;
|
||||
enum vmcs_sm_cache_e cached;
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_resize {
|
||||
/* user -> kernel */
|
||||
unsigned int handle;
|
||||
unsigned int new_size;
|
||||
|
||||
/* kernel -> user */
|
||||
unsigned int old_size;
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_map {
|
||||
/* user -> kernel */
|
||||
/* and kernel -> user */
|
||||
unsigned int pid;
|
||||
unsigned int handle;
|
||||
unsigned int addr;
|
||||
|
||||
/* kernel -> user */
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_walk {
|
||||
/* user -> kernel */
|
||||
unsigned int pid;
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_chk {
|
||||
/* user -> kernel */
|
||||
unsigned int handle;
|
||||
|
||||
/* kernel -> user */
|
||||
unsigned int addr;
|
||||
unsigned int size;
|
||||
enum vmcs_sm_cache_e cache;
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_size {
|
||||
/* user -> kernel */
|
||||
unsigned int handle;
|
||||
|
||||
/* kernel -> user */
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
struct vmcs_sm_ioctl_cache {
|
||||
/* user -> kernel */
|
||||
unsigned int handle;
|
||||
unsigned int addr;
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
/* IOCTL numbers */
|
||||
#define VMCS_SM_IOCTL_MEM_ALLOC\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_ALLOC,\
|
||||
struct vmcs_sm_ioctl_alloc)
|
||||
#define VMCS_SM_IOCTL_MEM_ALLOC_SHARE\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_ALLOC_SHARE,\
|
||||
struct vmcs_sm_ioctl_alloc_share)
|
||||
#define VMCS_SM_IOCTL_MEM_LOCK\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_LOCK,\
|
||||
struct vmcs_sm_ioctl_lock_unlock)
|
||||
#define VMCS_SM_IOCTL_MEM_LOCK_CACHE\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_LOCK_CACHE,\
|
||||
struct vmcs_sm_ioctl_lock_cache)
|
||||
#define VMCS_SM_IOCTL_MEM_UNLOCK\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_UNLOCK,\
|
||||
struct vmcs_sm_ioctl_lock_unlock)
|
||||
#define VMCS_SM_IOCTL_MEM_RESIZE\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_RESIZE,\
|
||||
struct vmcs_sm_ioctl_resize)
|
||||
#define VMCS_SM_IOCTL_MEM_FREE\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_FREE,\
|
||||
struct vmcs_sm_ioctl_free)
|
||||
#define VMCS_SM_IOCTL_MEM_FLUSH\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_FLUSH,\
|
||||
struct vmcs_sm_ioctl_cache)
|
||||
#define VMCS_SM_IOCTL_MEM_INVALID\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_INVALID,\
|
||||
struct vmcs_sm_ioctl_cache)
|
||||
|
||||
#define VMCS_SM_IOCTL_SIZE_USR_HDL\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_SIZE_USR_HANDLE,\
|
||||
struct vmcs_sm_ioctl_size)
|
||||
#define VMCS_SM_IOCTL_CHK_USR_HDL\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_CHK_USR_HANDLE,\
|
||||
struct vmcs_sm_ioctl_chk)
|
||||
|
||||
#define VMCS_SM_IOCTL_MAP_USR_HDL\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_MAPPED_USR_HANDLE,\
|
||||
struct vmcs_sm_ioctl_map)
|
||||
#define VMCS_SM_IOCTL_MAP_USR_ADDRESS\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_MAPPED_USR_ADDRESS,\
|
||||
struct vmcs_sm_ioctl_map)
|
||||
#define VMCS_SM_IOCTL_MAP_VC_HDL_FR_ADDR\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_MAPPED_VC_HDL_FROM_ADDR,\
|
||||
struct vmcs_sm_ioctl_map)
|
||||
#define VMCS_SM_IOCTL_MAP_VC_HDL_FR_HDL\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_MAPPED_VC_HDL_FROM_HDL,\
|
||||
struct vmcs_sm_ioctl_map)
|
||||
#define VMCS_SM_IOCTL_MAP_VC_ADDR_FR_HDL\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_MAPPED_VC_ADDR_FROM_HDL,\
|
||||
struct vmcs_sm_ioctl_map)
|
||||
|
||||
#define VMCS_SM_IOCTL_VC_WALK_ALLOC\
|
||||
_IO(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_VC_WALK_ALLOC)
|
||||
#define VMCS_SM_IOCTL_HOST_WALK_MAP\
|
||||
_IO(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_HOST_WALK_MAP)
|
||||
#define VMCS_SM_IOCTL_HOST_WALK_PID_ALLOC\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_HOST_WALK_PID_ALLOC,\
|
||||
struct vmcs_sm_ioctl_walk)
|
||||
#define VMCS_SM_IOCTL_HOST_WALK_PID_MAP\
|
||||
_IOR(VMCS_SM_MAGIC_TYPE, VMCS_SM_CMD_HOST_WALK_PID_MAP,\
|
||||
struct vmcs_sm_ioctl_walk)
|
||||
|
||||
/* ---- Variable Externs ------------------------------------------------- */
|
||||
|
||||
/* ---- Function Prototypes ---------------------------------------------- */
|
||||
|
||||
#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */
|
||||
201
arch/arm/mach-bcm2708/power.c
Normal file
201
arch/arm/mach-bcm2708/power.c
Normal file
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/power.c
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This device provides a shared mechanism for controlling the power to
|
||||
* VideoCore subsystems.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/semaphore.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/platform_data/mailbox-bcm2708.h>
|
||||
#include <mach/power.h>
|
||||
#include <mach/arm_power.h>
|
||||
|
||||
#define DRIVER_NAME "bcm2708_power"
|
||||
|
||||
#define BCM_POWER_MAXCLIENTS 4
|
||||
#define BCM_POWER_NOCLIENT (1<<31)
|
||||
|
||||
/* Some drivers expect there devices to be permanently powered */
|
||||
|
||||
#ifdef CONFIG_USB
|
||||
#define BCM_POWER_ALWAYS_ON (BCM_POWER_USB)
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
#define DPRINTK printk
|
||||
#else
|
||||
#define DPRINTK if (0) printk
|
||||
#endif
|
||||
|
||||
struct state_struct {
|
||||
uint32_t global_request;
|
||||
uint32_t client_request[BCM_POWER_MAXCLIENTS];
|
||||
struct semaphore client_mutex;
|
||||
struct semaphore mutex;
|
||||
} g_state;
|
||||
|
||||
int bcm_power_open(BCM_POWER_HANDLE_T *handle)
|
||||
{
|
||||
BCM_POWER_HANDLE_T i;
|
||||
int ret = -EBUSY;
|
||||
|
||||
down(&g_state.client_mutex);
|
||||
|
||||
for (i = 0; i < BCM_POWER_MAXCLIENTS; i++) {
|
||||
if (g_state.client_request[i] == BCM_POWER_NOCLIENT) {
|
||||
g_state.client_request[i] = BCM_POWER_NONE;
|
||||
*handle = i;
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
up(&g_state.client_mutex);
|
||||
|
||||
DPRINTK("bcm_power_open() -> %d\n", *handle);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bcm_power_open);
|
||||
|
||||
int bcm_power_request(BCM_POWER_HANDLE_T handle, uint32_t request)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
DPRINTK("bcm_power_request(%d, %x)\n", handle, request);
|
||||
|
||||
if ((handle < BCM_POWER_MAXCLIENTS) &&
|
||||
(g_state.client_request[handle] != BCM_POWER_NOCLIENT)) {
|
||||
if (down_interruptible(&g_state.mutex) != 0) {
|
||||
DPRINTK("bcm_power_request -> interrupted\n");
|
||||
return -EINTR;
|
||||
}
|
||||
|
||||
if (request != g_state.client_request[handle]) {
|
||||
uint32_t others_request = 0;
|
||||
uint32_t global_request;
|
||||
BCM_POWER_HANDLE_T i;
|
||||
|
||||
for (i = 0; i < BCM_POWER_MAXCLIENTS; i++) {
|
||||
if (i != handle)
|
||||
others_request |=
|
||||
g_state.client_request[i];
|
||||
}
|
||||
others_request &= ~BCM_POWER_NOCLIENT;
|
||||
|
||||
global_request = request | others_request;
|
||||
if (global_request != g_state.global_request) {
|
||||
uint32_t actual;
|
||||
|
||||
/* Send a request to VideoCore */
|
||||
bcm_mailbox_write(MBOX_CHAN_POWER,
|
||||
global_request << 4);
|
||||
|
||||
/* Wait for a response during power-up */
|
||||
if (global_request & ~g_state.global_request) {
|
||||
rc = bcm_mailbox_read(MBOX_CHAN_POWER,
|
||||
&actual);
|
||||
DPRINTK
|
||||
("bcm_mailbox_read -> %08x, %d\n",
|
||||
actual, rc);
|
||||
actual >>= 4;
|
||||
} else {
|
||||
rc = 0;
|
||||
actual = global_request;
|
||||
}
|
||||
|
||||
if (rc == 0) {
|
||||
if (actual != global_request) {
|
||||
printk(KERN_ERR
|
||||
"%s: prev global %x, new global %x, actual %x, request %x, others_request %x\n",
|
||||
__func__,
|
||||
g_state.global_request,
|
||||
global_request, actual, request, others_request);
|
||||
/* A failure */
|
||||
BUG_ON((others_request & actual)
|
||||
!= others_request);
|
||||
request &= actual;
|
||||
rc = -EIO;
|
||||
}
|
||||
|
||||
g_state.global_request = actual;
|
||||
g_state.client_request[handle] =
|
||||
request;
|
||||
}
|
||||
}
|
||||
}
|
||||
up(&g_state.mutex);
|
||||
} else {
|
||||
rc = -EINVAL;
|
||||
}
|
||||
DPRINTK("bcm_power_request -> %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bcm_power_request);
|
||||
|
||||
int bcm_power_close(BCM_POWER_HANDLE_T handle)
|
||||
{
|
||||
int rc;
|
||||
|
||||
DPRINTK("bcm_power_close(%d)\n", handle);
|
||||
|
||||
rc = bcm_power_request(handle, BCM_POWER_NONE);
|
||||
if (rc == 0)
|
||||
g_state.client_request[handle] = BCM_POWER_NOCLIENT;
|
||||
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bcm_power_close);
|
||||
|
||||
static int __init bcm_power_init(void)
|
||||
{
|
||||
#if defined(BCM_POWER_ALWAYS_ON)
|
||||
BCM_POWER_HANDLE_T always_on_handle;
|
||||
#endif
|
||||
int rc = 0;
|
||||
int i;
|
||||
|
||||
printk(KERN_INFO "bcm_power: Broadcom power driver\n");
|
||||
bcm_mailbox_write(MBOX_CHAN_POWER, 0);
|
||||
|
||||
for (i = 0; i < BCM_POWER_MAXCLIENTS; i++)
|
||||
g_state.client_request[i] = BCM_POWER_NOCLIENT;
|
||||
|
||||
sema_init(&g_state.client_mutex, 1);
|
||||
sema_init(&g_state.mutex, 1);
|
||||
|
||||
g_state.global_request = 0;
|
||||
|
||||
#if defined(BCM_POWER_ALWAYS_ON)
|
||||
if (BCM_POWER_ALWAYS_ON) {
|
||||
bcm_power_open(&always_on_handle);
|
||||
bcm_power_request(always_on_handle, BCM_POWER_ALWAYS_ON);
|
||||
}
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void __exit bcm_power_exit(void)
|
||||
{
|
||||
bcm_mailbox_write(MBOX_CHAN_POWER, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load after the mailbox driver is initialized (arch_initcall),
|
||||
* but before depending drivers (module_init).
|
||||
*/
|
||||
subsys_initcall(bcm_power_init);
|
||||
module_exit(bcm_power_exit);
|
||||
|
||||
MODULE_AUTHOR("Phil Elwell");
|
||||
MODULE_DESCRIPTION("Interface to BCM2708 power management");
|
||||
MODULE_LICENSE("GPL");
|
||||
431
arch/arm/mach-bcm2708/vc_mem.c
Normal file
431
arch/arm/mach-bcm2708/vc_mem.c
Normal file
@@ -0,0 +1,431 @@
|
||||
/*****************************************************************************
|
||||
* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved.
|
||||
*
|
||||
* Unless you and Broadcom execute a separate written software license
|
||||
* agreement governing use of this software, this software is licensed to you
|
||||
* under the terms of the GNU General Public License version 2, available at
|
||||
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
|
||||
*
|
||||
* Notwithstanding the above, under no circumstances may you combine this
|
||||
* software in any way with any other Broadcom software provided under a
|
||||
* license other than the GPL, without Broadcom's express prior written
|
||||
* consent.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/platform_data/mailbox-bcm2708.h>
|
||||
|
||||
#ifdef CONFIG_ARCH_KONA
|
||||
#include <chal/chal_ipc.h>
|
||||
#elif CONFIG_ARCH_BCM2708
|
||||
#else
|
||||
#include <csp/chal_ipc.h>
|
||||
#endif
|
||||
|
||||
#include "mach/vc_mem.h"
|
||||
|
||||
#define DRIVER_NAME "vc-mem"
|
||||
|
||||
// Device (/dev) related variables
|
||||
static dev_t vc_mem_devnum = 0;
|
||||
static struct class *vc_mem_class = NULL;
|
||||
static struct cdev vc_mem_cdev;
|
||||
static int vc_mem_inited = 0;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
static struct dentry *vc_mem_debugfs_entry;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Videocore memory addresses and size
|
||||
*
|
||||
* Drivers that wish to know the videocore memory addresses and sizes should
|
||||
* use these variables instead of the MM_IO_BASE and MM_ADDR_IO defines in
|
||||
* headers. This allows the other drivers to not be tied down to a a certain
|
||||
* address/size at compile time.
|
||||
*
|
||||
* In the future, the goal is to have the videocore memory virtual address and
|
||||
* size be calculated at boot time rather than at compile time. The decision of
|
||||
* where the videocore memory resides and its size would be in the hands of the
|
||||
* bootloader (and/or kernel). When that happens, the values of these variables
|
||||
* would be calculated and assigned in the init function.
|
||||
*/
|
||||
// in the 2835 VC in mapped above ARM, but ARM has full access to VC space
|
||||
unsigned long mm_vc_mem_phys_addr = 0x00000000;
|
||||
unsigned int mm_vc_mem_size = 0;
|
||||
unsigned int mm_vc_mem_base = 0;
|
||||
|
||||
EXPORT_SYMBOL(mm_vc_mem_phys_addr);
|
||||
EXPORT_SYMBOL(mm_vc_mem_size);
|
||||
EXPORT_SYMBOL(mm_vc_mem_base);
|
||||
|
||||
static uint phys_addr = 0;
|
||||
static uint mem_size = 0;
|
||||
static uint mem_base = 0;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_open
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static int
|
||||
vc_mem_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
(void) inode;
|
||||
(void) file;
|
||||
|
||||
pr_debug("%s: called file = 0x%p\n", __func__, file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_release
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static int
|
||||
vc_mem_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
(void) inode;
|
||||
(void) file;
|
||||
|
||||
pr_debug("%s: called file = 0x%p\n", __func__, file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_get_size
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static void
|
||||
vc_mem_get_size(void)
|
||||
{
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_get_base
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static void
|
||||
vc_mem_get_base(void)
|
||||
{
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_get_current_size
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
int
|
||||
vc_mem_get_current_size(void)
|
||||
{
|
||||
return mm_vc_mem_size;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(vc_mem_get_current_size);
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_ioctl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static long
|
||||
vc_mem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
(void) cmd;
|
||||
(void) arg;
|
||||
|
||||
pr_debug("%s: called file = 0x%p\n", __func__, file);
|
||||
|
||||
switch (cmd) {
|
||||
case VC_MEM_IOC_MEM_PHYS_ADDR:
|
||||
{
|
||||
pr_debug("%s: VC_MEM_IOC_MEM_PHYS_ADDR=0x%p\n",
|
||||
__func__, (void *) mm_vc_mem_phys_addr);
|
||||
|
||||
if (copy_to_user((void *) arg, &mm_vc_mem_phys_addr,
|
||||
sizeof (mm_vc_mem_phys_addr)) != 0) {
|
||||
rc = -EFAULT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VC_MEM_IOC_MEM_SIZE:
|
||||
{
|
||||
// Get the videocore memory size first
|
||||
vc_mem_get_size();
|
||||
|
||||
pr_debug("%s: VC_MEM_IOC_MEM_SIZE=%u\n", __func__,
|
||||
mm_vc_mem_size);
|
||||
|
||||
if (copy_to_user((void *) arg, &mm_vc_mem_size,
|
||||
sizeof (mm_vc_mem_size)) != 0) {
|
||||
rc = -EFAULT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VC_MEM_IOC_MEM_BASE:
|
||||
{
|
||||
// Get the videocore memory base
|
||||
vc_mem_get_base();
|
||||
|
||||
pr_debug("%s: VC_MEM_IOC_MEM_BASE=%u\n", __func__,
|
||||
mm_vc_mem_base);
|
||||
|
||||
if (copy_to_user((void *) arg, &mm_vc_mem_base,
|
||||
sizeof (mm_vc_mem_base)) != 0) {
|
||||
rc = -EFAULT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VC_MEM_IOC_MEM_LOAD:
|
||||
{
|
||||
// Get the videocore memory base
|
||||
vc_mem_get_base();
|
||||
|
||||
pr_debug("%s: VC_MEM_IOC_MEM_LOAD=%u\n", __func__,
|
||||
mm_vc_mem_base);
|
||||
|
||||
if (copy_to_user((void *) arg, &mm_vc_mem_base,
|
||||
sizeof (mm_vc_mem_base)) != 0) {
|
||||
rc = -EFAULT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return -ENOTTY;
|
||||
}
|
||||
}
|
||||
pr_debug("%s: file = 0x%p returning %d\n", __func__, file, rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_mmap
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static int
|
||||
vc_mem_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||
{
|
||||
int rc = 0;
|
||||
unsigned long length = vma->vm_end - vma->vm_start;
|
||||
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
|
||||
|
||||
pr_debug("%s: vm_start = 0x%08lx vm_end = 0x%08lx vm_pgoff = 0x%08lx\n",
|
||||
__func__, (long) vma->vm_start, (long) vma->vm_end,
|
||||
(long) vma->vm_pgoff);
|
||||
|
||||
if (offset + length > mm_vc_mem_size) {
|
||||
pr_err("%s: length %ld is too big\n", __func__, length);
|
||||
return -EINVAL;
|
||||
}
|
||||
// Do not cache the memory map
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
|
||||
rc = remap_pfn_range(vma, vma->vm_start,
|
||||
(mm_vc_mem_phys_addr >> PAGE_SHIFT) +
|
||||
vma->vm_pgoff, length, vma->vm_page_prot);
|
||||
if (rc != 0) {
|
||||
pr_err("%s: remap_pfn_range failed (rc=%d)\n", __func__, rc);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* File Operations for the driver.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static const struct file_operations vc_mem_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = vc_mem_open,
|
||||
.release = vc_mem_release,
|
||||
.unlocked_ioctl = vc_mem_ioctl,
|
||||
.mmap = vc_mem_mmap,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
static void vc_mem_debugfs_deinit(void)
|
||||
{
|
||||
debugfs_remove_recursive(vc_mem_debugfs_entry);
|
||||
vc_mem_debugfs_entry = NULL;
|
||||
}
|
||||
|
||||
|
||||
static int vc_mem_debugfs_init(
|
||||
struct device *dev)
|
||||
{
|
||||
vc_mem_debugfs_entry = debugfs_create_dir(DRIVER_NAME, NULL);
|
||||
if (!vc_mem_debugfs_entry) {
|
||||
dev_warn(dev, "could not create debugfs entry\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (!debugfs_create_x32("vc_mem_phys_addr",
|
||||
0444,
|
||||
vc_mem_debugfs_entry,
|
||||
(u32 *)&mm_vc_mem_phys_addr)) {
|
||||
dev_warn(dev, "%s:could not create vc_mem_phys entry\n",
|
||||
__func__);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!debugfs_create_x32("vc_mem_size",
|
||||
0444,
|
||||
vc_mem_debugfs_entry,
|
||||
(u32 *)&mm_vc_mem_size)) {
|
||||
dev_warn(dev, "%s:could not create vc_mem_size entry\n",
|
||||
__func__);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!debugfs_create_x32("vc_mem_base",
|
||||
0444,
|
||||
vc_mem_debugfs_entry,
|
||||
(u32 *)&mm_vc_mem_base)) {
|
||||
dev_warn(dev, "%s:could not create vc_mem_base entry\n",
|
||||
__func__);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
vc_mem_debugfs_deinit();
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DEBUG_FS */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_init
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static int __init
|
||||
vc_mem_init(void)
|
||||
{
|
||||
int rc = -EFAULT;
|
||||
struct device *dev;
|
||||
|
||||
pr_debug("%s: called\n", __func__);
|
||||
|
||||
mm_vc_mem_phys_addr = phys_addr;
|
||||
mm_vc_mem_size = mem_size;
|
||||
mm_vc_mem_base = mem_base;
|
||||
|
||||
vc_mem_get_size();
|
||||
|
||||
pr_info("vc-mem: phys_addr:0x%08lx mem_base=0x%08x mem_size:0x%08x(%u MiB)\n",
|
||||
mm_vc_mem_phys_addr, mm_vc_mem_base, mm_vc_mem_size, mm_vc_mem_size / (1024 * 1024));
|
||||
|
||||
if ((rc = alloc_chrdev_region(&vc_mem_devnum, 0, 1, DRIVER_NAME)) < 0) {
|
||||
pr_err("%s: alloc_chrdev_region failed (rc=%d)\n",
|
||||
__func__, rc);
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
cdev_init(&vc_mem_cdev, &vc_mem_fops);
|
||||
if ((rc = cdev_add(&vc_mem_cdev, vc_mem_devnum, 1)) != 0) {
|
||||
pr_err("%s: cdev_add failed (rc=%d)\n", __func__, rc);
|
||||
goto out_unregister;
|
||||
}
|
||||
|
||||
vc_mem_class = class_create(THIS_MODULE, DRIVER_NAME);
|
||||
if (IS_ERR(vc_mem_class)) {
|
||||
rc = PTR_ERR(vc_mem_class);
|
||||
pr_err("%s: class_create failed (rc=%d)\n", __func__, rc);
|
||||
goto out_cdev_del;
|
||||
}
|
||||
|
||||
dev = device_create(vc_mem_class, NULL, vc_mem_devnum, NULL,
|
||||
DRIVER_NAME);
|
||||
if (IS_ERR(dev)) {
|
||||
rc = PTR_ERR(dev);
|
||||
pr_err("%s: device_create failed (rc=%d)\n", __func__, rc);
|
||||
goto out_class_destroy;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
/* don't fail if the debug entries cannot be created */
|
||||
vc_mem_debugfs_init(dev);
|
||||
#endif
|
||||
|
||||
vc_mem_inited = 1;
|
||||
return 0;
|
||||
|
||||
device_destroy(vc_mem_class, vc_mem_devnum);
|
||||
|
||||
out_class_destroy:
|
||||
class_destroy(vc_mem_class);
|
||||
vc_mem_class = NULL;
|
||||
|
||||
out_cdev_del:
|
||||
cdev_del(&vc_mem_cdev);
|
||||
|
||||
out_unregister:
|
||||
unregister_chrdev_region(vc_mem_devnum, 1);
|
||||
|
||||
out_err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* vc_mem_exit
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
static void __exit
|
||||
vc_mem_exit(void)
|
||||
{
|
||||
pr_debug("%s: called\n", __func__);
|
||||
|
||||
if (vc_mem_inited) {
|
||||
#if CONFIG_DEBUG_FS
|
||||
vc_mem_debugfs_deinit();
|
||||
#endif
|
||||
device_destroy(vc_mem_class, vc_mem_devnum);
|
||||
class_destroy(vc_mem_class);
|
||||
cdev_del(&vc_mem_cdev);
|
||||
unregister_chrdev_region(vc_mem_devnum, 1);
|
||||
}
|
||||
}
|
||||
|
||||
module_init(vc_mem_init);
|
||||
module_exit(vc_mem_exit);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Broadcom Corporation");
|
||||
|
||||
module_param(phys_addr, uint, 0644);
|
||||
module_param(mem_size, uint, 0644);
|
||||
module_param(mem_base, uint, 0644);
|
||||
49
arch/arm/mach-bcm2709/Kconfig
Normal file
49
arch/arm/mach-bcm2709/Kconfig
Normal file
@@ -0,0 +1,49 @@
|
||||
menu "Broadcom BCM2709 Implementations"
|
||||
depends on ARCH_BCM2709
|
||||
|
||||
config MACH_BCM2709
|
||||
bool "Broadcom BCM2709 Development Platform"
|
||||
help
|
||||
Include support for the Broadcom(R) BCM2709 platform.
|
||||
|
||||
config BCM2709_DT
|
||||
bool "BCM2709 Device Tree support"
|
||||
depends on MACH_BCM2709
|
||||
default n
|
||||
select USE_OF
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select PINCTRL
|
||||
select PINCTRL_BCM2835
|
||||
help
|
||||
Enable Device Tree support for BCM2709
|
||||
|
||||
config BCM2708_GPIO
|
||||
bool "BCM2709 gpio support"
|
||||
depends on MACH_BCM2709
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
default y
|
||||
help
|
||||
Include support for the Broadcom(R) BCM2709 gpio.
|
||||
|
||||
config BCM2708_VCMEM
|
||||
bool "Videocore Memory"
|
||||
depends on MACH_BCM2709
|
||||
default y
|
||||
help
|
||||
Helper for videocore memory access and total size allocation.
|
||||
|
||||
config BCM2708_NOL2CACHE
|
||||
bool "Videocore L2 cache disable"
|
||||
depends on MACH_BCM2709
|
||||
default y
|
||||
help
|
||||
Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt.
|
||||
|
||||
config BCM2708_SPIDEV
|
||||
bool "Bind spidev to SPI0 master"
|
||||
depends on MACH_BCM2709
|
||||
depends on SPI
|
||||
default y
|
||||
help
|
||||
Binds spidev driver to the SPI0 master
|
||||
endmenu
|
||||
7
arch/arm/mach-bcm2709/Makefile
Normal file
7
arch/arm/mach-bcm2709/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Makefile for the linux kernel.
|
||||
#
|
||||
|
||||
obj-$(CONFIG_MACH_BCM2709) += bcm2709.o armctrl.o power.o
|
||||
obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
|
||||
obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
|
||||
3
arch/arm/mach-bcm2709/Makefile.boot
Normal file
3
arch/arm/mach-bcm2709/Makefile.boot
Normal file
@@ -0,0 +1,3 @@
|
||||
zreladdr-y := 0x00008000
|
||||
params_phys-y := 0x00000100
|
||||
initrd_phys-y := 0x00800000
|
||||
369
arch/arm/mach-bcm2709/armctrl.c
Normal file
369
arch/arm/mach-bcm2709/armctrl.c
Normal file
@@ -0,0 +1,369 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/armctrl.c
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
#include <asm/mach/irq.h>
|
||||
#include <mach/hardware.h>
|
||||
#include "armctrl.h"
|
||||
|
||||
/* For support of kernels >= 3.0 assume only one VIC for now*/
|
||||
static unsigned int remap_irqs[(INTERRUPT_ARASANSDIO + 1) - INTERRUPT_JPEG] = {
|
||||
INTERRUPT_VC_JPEG,
|
||||
INTERRUPT_VC_USB,
|
||||
INTERRUPT_VC_3D,
|
||||
INTERRUPT_VC_DMA2,
|
||||
INTERRUPT_VC_DMA3,
|
||||
INTERRUPT_VC_I2C,
|
||||
INTERRUPT_VC_SPI,
|
||||
INTERRUPT_VC_I2SPCM,
|
||||
INTERRUPT_VC_SDIO,
|
||||
INTERRUPT_VC_UART,
|
||||
INTERRUPT_VC_ARASANSDIO
|
||||
};
|
||||
|
||||
static void armctrl_mask_irq(struct irq_data *d)
|
||||
{
|
||||
static const unsigned int disables[4] = {
|
||||
ARM_IRQ_DIBL1,
|
||||
ARM_IRQ_DIBL2,
|
||||
ARM_IRQ_DIBL3,
|
||||
0
|
||||
};
|
||||
int i;
|
||||
if (d->irq >= FIQ_START) {
|
||||
writel(0, __io_address(ARM_IRQ_FAST));
|
||||
} else if (d->irq >= IRQ_ARM_LOCAL_CNTPSIRQ && d->irq < IRQ_ARM_LOCAL_CNTPSIRQ + 4) {
|
||||
#if 1
|
||||
unsigned int data = (unsigned int)irq_get_chip_data(d->irq) - IRQ_ARM_LOCAL_CNTPSIRQ;
|
||||
for (i=0; i<4; i++) // i = raw_smp_processor_id(); //
|
||||
{
|
||||
unsigned int val = readl(__io_address(ARM_LOCAL_TIMER_INT_CONTROL0 + 4*i));
|
||||
writel(val &~ (1 << data), __io_address(ARM_LOCAL_TIMER_INT_CONTROL0 + 4*i));
|
||||
}
|
||||
#endif
|
||||
} else if (d->irq >= IRQ_ARM_LOCAL_MAILBOX0 && d->irq < IRQ_ARM_LOCAL_MAILBOX0 + 4) {
|
||||
#if 0
|
||||
unsigned int data = (unsigned int)irq_get_chip_data(d->irq) - IRQ_ARM_LOCAL_MAILBOX0;
|
||||
for (i=0; i<4; i++) {
|
||||
unsigned int val = readl(__io_address(ARM_LOCAL_MAILBOX_INT_CONTROL0 + 4*i));
|
||||
writel(val &~ (1 << data), __io_address(ARM_LOCAL_MAILBOX_INT_CONTROL0 + 4*i));
|
||||
}
|
||||
#endif
|
||||
} else if (d->irq >= ARM_IRQ1_BASE && d->irq < ARM_IRQ_LOCAL_BASE) {
|
||||
unsigned int data = (unsigned int)irq_get_chip_data(d->irq);
|
||||
writel(1 << (data & 0x1f), __io_address(disables[(data >> 5) & 0x3]));
|
||||
} else if (d->irq == INTERRUPT_ARM_LOCAL_PMU_FAST) {
|
||||
writel(0xf, __io_address(ARM_LOCAL_PM_ROUTING_CLR));
|
||||
} else { printk("%s: %d\n", __func__, d->irq); BUG(); }
|
||||
}
|
||||
|
||||
static void armctrl_unmask_irq(struct irq_data *d)
|
||||
{
|
||||
static const unsigned int enables[4] = {
|
||||
ARM_IRQ_ENBL1,
|
||||
ARM_IRQ_ENBL2,
|
||||
ARM_IRQ_ENBL3,
|
||||
0
|
||||
};
|
||||
int i;
|
||||
if (d->irq >= FIQ_START) {
|
||||
unsigned int data;
|
||||
if (num_online_cpus() > 1) {
|
||||
data = readl(__io_address(ARM_LOCAL_GPU_INT_ROUTING));
|
||||
data &= ~0xc;
|
||||
data |= (1 << 2);
|
||||
writel(data, __io_address(ARM_LOCAL_GPU_INT_ROUTING));
|
||||
}
|
||||
/* Unmask in ARMCTRL block after routing it properly */
|
||||
data = (unsigned int)irq_get_chip_data(d->irq) - FIQ_START;
|
||||
writel(0x80 | data, __io_address(ARM_IRQ_FAST));
|
||||
} else if (d->irq >= IRQ_ARM_LOCAL_CNTPSIRQ && d->irq < IRQ_ARM_LOCAL_CNTPSIRQ + 4) {
|
||||
#if 1
|
||||
unsigned int data = (unsigned int)irq_get_chip_data(d->irq) - IRQ_ARM_LOCAL_CNTPSIRQ;
|
||||
for (i=0; i<4; i++) // i = raw_smp_processor_id();
|
||||
{
|
||||
unsigned int val = readl(__io_address(ARM_LOCAL_TIMER_INT_CONTROL0 + 4*i));
|
||||
writel(val | (1 << data), __io_address(ARM_LOCAL_TIMER_INT_CONTROL0 + 4*i));
|
||||
}
|
||||
#endif
|
||||
} else if (d->irq >= IRQ_ARM_LOCAL_MAILBOX0 && d->irq < IRQ_ARM_LOCAL_MAILBOX0 + 4) {
|
||||
#if 0
|
||||
unsigned int data = (unsigned int)irq_get_chip_data(d->irq) - IRQ_ARM_LOCAL_MAILBOX0;
|
||||
for (i=0; i<4; i++) {
|
||||
unsigned int val = readl(__io_address(ARM_LOCAL_MAILBOX_INT_CONTROL0 + 4*i));
|
||||
writel(val | (1 << data), __io_address(ARM_LOCAL_MAILBOX_INT_CONTROL0 + 4*i));
|
||||
}
|
||||
#endif
|
||||
} else if (d->irq >= ARM_IRQ1_BASE && d->irq < ARM_IRQ_LOCAL_BASE) {
|
||||
unsigned int data = (unsigned int)irq_get_chip_data(d->irq);
|
||||
writel(1 << (data & 0x1f), __io_address(enables[(data >> 5) & 0x3]));
|
||||
} else if (d->irq == INTERRUPT_ARM_LOCAL_PMU_FAST) {
|
||||
writel(0xf, __io_address(ARM_LOCAL_PM_ROUTING_SET));
|
||||
} else { printk("%s: %d\n", __func__, d->irq); BUG(); }
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
|
||||
#define NR_IRQS_BANK0 21
|
||||
#define NR_BANKS 4
|
||||
#define IRQS_PER_BANK 32
|
||||
|
||||
/* from drivers/irqchip/irq-bcm2835.c */
|
||||
static int armctrl_xlate(struct irq_domain *d, struct device_node *ctrlr,
|
||||
const u32 *intspec, unsigned int intsize,
|
||||
unsigned long *out_hwirq, unsigned int *out_type)
|
||||
{
|
||||
if (WARN_ON(intsize != 2))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON(intspec[0] >= NR_BANKS))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON(intspec[1] >= IRQS_PER_BANK))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON(intspec[0] == 0 && intspec[1] >= NR_IRQS_BANK0))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON(intspec[0] == 3 && intspec[1] > 3 && intspec[1] != 5 && intspec[1] != 9))
|
||||
return -EINVAL;
|
||||
|
||||
if (intspec[0] == 0)
|
||||
*out_hwirq = ARM_IRQ0_BASE + intspec[1];
|
||||
else if (intspec[0] == 1)
|
||||
*out_hwirq = ARM_IRQ1_BASE + intspec[1];
|
||||
else if (intspec[0] == 2)
|
||||
*out_hwirq = ARM_IRQ2_BASE + intspec[1];
|
||||
else
|
||||
*out_hwirq = ARM_IRQ_LOCAL_BASE + intspec[1];
|
||||
|
||||
/* reverse remap_irqs[] */
|
||||
switch (*out_hwirq) {
|
||||
case INTERRUPT_VC_JPEG:
|
||||
*out_hwirq = INTERRUPT_JPEG;
|
||||
break;
|
||||
case INTERRUPT_VC_USB:
|
||||
*out_hwirq = INTERRUPT_USB;
|
||||
break;
|
||||
case INTERRUPT_VC_3D:
|
||||
*out_hwirq = INTERRUPT_3D;
|
||||
break;
|
||||
case INTERRUPT_VC_DMA2:
|
||||
*out_hwirq = INTERRUPT_DMA2;
|
||||
break;
|
||||
case INTERRUPT_VC_DMA3:
|
||||
*out_hwirq = INTERRUPT_DMA3;
|
||||
break;
|
||||
case INTERRUPT_VC_I2C:
|
||||
*out_hwirq = INTERRUPT_I2C;
|
||||
break;
|
||||
case INTERRUPT_VC_SPI:
|
||||
*out_hwirq = INTERRUPT_SPI;
|
||||
break;
|
||||
case INTERRUPT_VC_I2SPCM:
|
||||
*out_hwirq = INTERRUPT_I2SPCM;
|
||||
break;
|
||||
case INTERRUPT_VC_SDIO:
|
||||
*out_hwirq = INTERRUPT_SDIO;
|
||||
break;
|
||||
case INTERRUPT_VC_UART:
|
||||
*out_hwirq = INTERRUPT_UART;
|
||||
break;
|
||||
case INTERRUPT_VC_ARASANSDIO:
|
||||
*out_hwirq = INTERRUPT_ARASANSDIO;
|
||||
break;
|
||||
}
|
||||
|
||||
*out_type = IRQ_TYPE_NONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_domain_ops armctrl_ops = {
|
||||
.xlate = armctrl_xlate
|
||||
};
|
||||
|
||||
void __init armctrl_dt_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
struct irq_domain *domain;
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "brcm,bcm2708-armctrl-ic");
|
||||
if (!np)
|
||||
return;
|
||||
|
||||
domain = irq_domain_add_legacy(np, BCM2708_ALLOC_IRQS,
|
||||
IRQ_ARMCTRL_START, 0,
|
||||
&armctrl_ops, NULL);
|
||||
WARN_ON(!domain);
|
||||
}
|
||||
#else
|
||||
void __init armctrl_dt_init(void) { }
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
#if defined(CONFIG_PM)
|
||||
|
||||
/* for kernels 3.xx use the new syscore_ops apis but for older kernels use the sys dev class */
|
||||
|
||||
/* Static defines
|
||||
* struct armctrl_device - VIC PM device (< 3.xx)
|
||||
* @sysdev: The system device which is registered. (< 3.xx)
|
||||
* @irq: The IRQ number for the base of the VIC.
|
||||
* @base: The register base for the VIC.
|
||||
* @resume_sources: A bitmask of interrupts for resume.
|
||||
* @resume_irqs: The IRQs enabled for resume.
|
||||
* @int_select: Save for VIC_INT_SELECT.
|
||||
* @int_enable: Save for VIC_INT_ENABLE.
|
||||
* @soft_int: Save for VIC_INT_SOFT.
|
||||
* @protect: Save for VIC_PROTECT.
|
||||
*/
|
||||
struct armctrl_info {
|
||||
void __iomem *base;
|
||||
int irq;
|
||||
u32 resume_sources;
|
||||
u32 resume_irqs;
|
||||
u32 int_select;
|
||||
u32 int_enable;
|
||||
u32 soft_int;
|
||||
u32 protect;
|
||||
} armctrl;
|
||||
|
||||
static int armctrl_suspend(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void armctrl_resume(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* armctrl_pm_register - Register a VIC for later power management control
|
||||
* @base: The base address of the VIC.
|
||||
* @irq: The base IRQ for the VIC.
|
||||
* @resume_sources: bitmask of interrupts allowed for resume sources.
|
||||
*
|
||||
* For older kernels (< 3.xx) do -
|
||||
* Register the VIC with the system device tree so that it can be notified
|
||||
* of suspend and resume requests and ensure that the correct actions are
|
||||
* taken to re-instate the settings on resume.
|
||||
*/
|
||||
static void __init armctrl_pm_register(void __iomem * base, unsigned int irq,
|
||||
u32 resume_sources)
|
||||
{
|
||||
armctrl.base = base;
|
||||
armctrl.resume_sources = resume_sources;
|
||||
armctrl.irq = irq;
|
||||
}
|
||||
|
||||
static int armctrl_set_wake(struct irq_data *d, unsigned int on)
|
||||
{
|
||||
unsigned int off = d->irq & 31;
|
||||
u32 bit = 1 << off;
|
||||
|
||||
if (!(bit & armctrl.resume_sources))
|
||||
return -EINVAL;
|
||||
|
||||
if (on)
|
||||
armctrl.resume_irqs |= bit;
|
||||
else
|
||||
armctrl.resume_irqs &= ~bit;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
static inline void armctrl_pm_register(void __iomem * base, unsigned int irq,
|
||||
u32 arg1)
|
||||
{
|
||||
}
|
||||
|
||||
#define armctrl_suspend NULL
|
||||
#define armctrl_resume NULL
|
||||
#define armctrl_set_wake NULL
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static struct syscore_ops armctrl_syscore_ops = {
|
||||
.suspend = armctrl_suspend,
|
||||
.resume = armctrl_resume,
|
||||
};
|
||||
|
||||
/**
|
||||
* armctrl_syscore_init - initicall to register VIC pm functions
|
||||
*
|
||||
* This is called via late_initcall() to register
|
||||
* the resources for the VICs due to the early
|
||||
* nature of the VIC's registration.
|
||||
*/
|
||||
static int __init armctrl_syscore_init(void)
|
||||
{
|
||||
register_syscore_ops(&armctrl_syscore_ops);
|
||||
return 0;
|
||||
}
|
||||
|
||||
late_initcall(armctrl_syscore_init);
|
||||
|
||||
static struct irq_chip armctrl_chip = {
|
||||
.name = "ARMCTRL",
|
||||
.irq_ack = NULL,
|
||||
.irq_mask = armctrl_mask_irq,
|
||||
.irq_unmask = armctrl_unmask_irq,
|
||||
.irq_set_wake = armctrl_set_wake,
|
||||
};
|
||||
|
||||
/**
|
||||
* armctrl_init - initialise a vectored interrupt controller
|
||||
* @base: iomem base address
|
||||
* @irq_start: starting interrupt number, must be muliple of 32
|
||||
* @armctrl_sources: bitmask of interrupt sources to allow
|
||||
* @resume_sources: bitmask of interrupt sources to allow for resume
|
||||
*/
|
||||
int __init armctrl_init(void __iomem * base, unsigned int irq_start,
|
||||
u32 armctrl_sources, u32 resume_sources)
|
||||
{
|
||||
unsigned int irq;
|
||||
|
||||
for (irq = 0; irq < BCM2708_ALLOC_IRQS; irq++) {
|
||||
unsigned int data = irq;
|
||||
if (irq >= INTERRUPT_JPEG && irq <= INTERRUPT_ARASANSDIO)
|
||||
data = remap_irqs[irq - INTERRUPT_JPEG];
|
||||
if (irq >= IRQ_ARM_LOCAL_CNTPSIRQ && irq <= IRQ_ARM_LOCAL_TIMER) {
|
||||
irq_set_percpu_devid(irq);
|
||||
irq_set_chip_and_handler(irq, &armctrl_chip, handle_percpu_devid_irq);
|
||||
set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
|
||||
} else {
|
||||
irq_set_chip_and_handler(irq, &armctrl_chip, handle_level_irq);
|
||||
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_DISABLED);
|
||||
}
|
||||
irq_set_chip_data(irq, (void *)data);
|
||||
}
|
||||
|
||||
armctrl_pm_register(base, irq_start, resume_sources);
|
||||
init_FIQ(FIQ_START);
|
||||
armctrl_dt_init();
|
||||
return 0;
|
||||
}
|
||||
27
arch/arm/mach-bcm2709/armctrl.h
Normal file
27
arch/arm/mach-bcm2709/armctrl.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/armctrl.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __BCM2708_ARMCTRL_H
|
||||
#define __BCM2708_ARMCTRL_H
|
||||
|
||||
extern int __init armctrl_init(void __iomem * base, unsigned int irq_start,
|
||||
u32 armctrl_sources, u32 resume_sources);
|
||||
|
||||
#endif
|
||||
426
arch/arm/mach-bcm2709/bcm2708_gpio.c
Normal file
426
arch/arm/mach-bcm2709/bcm2708_gpio.c
Normal file
@@ -0,0 +1,426 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/bcm2708_gpio.c
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/slab.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <mach/platform.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
|
||||
#include <linux/platform_data/bcm2708.h>
|
||||
|
||||
#define BCM_GPIO_DRIVER_NAME "bcm2708_gpio"
|
||||
#define DRIVER_NAME BCM_GPIO_DRIVER_NAME
|
||||
#define BCM_GPIO_USE_IRQ 1
|
||||
|
||||
#define GPIOFSEL(x) (0x00+(x)*4)
|
||||
#define GPIOSET(x) (0x1c+(x)*4)
|
||||
#define GPIOCLR(x) (0x28+(x)*4)
|
||||
#define GPIOLEV(x) (0x34+(x)*4)
|
||||
#define GPIOEDS(x) (0x40+(x)*4)
|
||||
#define GPIOREN(x) (0x4c+(x)*4)
|
||||
#define GPIOFEN(x) (0x58+(x)*4)
|
||||
#define GPIOHEN(x) (0x64+(x)*4)
|
||||
#define GPIOLEN(x) (0x70+(x)*4)
|
||||
#define GPIOAREN(x) (0x7c+(x)*4)
|
||||
#define GPIOAFEN(x) (0x88+(x)*4)
|
||||
#define GPIOUD(x) (0x94+(x)*4)
|
||||
#define GPIOUDCLK(x) (0x98+(x)*4)
|
||||
|
||||
#define GPIO_BANKS 2
|
||||
|
||||
enum { GPIO_FSEL_INPUT, GPIO_FSEL_OUTPUT,
|
||||
GPIO_FSEL_ALT5, GPIO_FSEL_ALT_4,
|
||||
GPIO_FSEL_ALT0, GPIO_FSEL_ALT1,
|
||||
GPIO_FSEL_ALT2, GPIO_FSEL_ALT3,
|
||||
};
|
||||
|
||||
/* Each of the two spinlocks protects a different set of hardware
|
||||
* regiters and data structurs. This decouples the code of the IRQ from
|
||||
* the GPIO code. This also makes the case of a GPIO routine call from
|
||||
* the IRQ code simpler.
|
||||
*/
|
||||
static DEFINE_SPINLOCK(lock); /* GPIO registers */
|
||||
|
||||
struct bcm2708_gpio {
|
||||
struct list_head list;
|
||||
void __iomem *base;
|
||||
struct gpio_chip gc;
|
||||
unsigned long rising[(BCM2708_NR_GPIOS + 31) / 32];
|
||||
unsigned long falling[(BCM2708_NR_GPIOS + 31) / 32];
|
||||
unsigned long high[(BCM2708_NR_GPIOS + 31) / 32];
|
||||
unsigned long low[(BCM2708_NR_GPIOS + 31) / 32];
|
||||
};
|
||||
|
||||
static int bcm2708_set_function(struct gpio_chip *gc, unsigned offset,
|
||||
int function)
|
||||
{
|
||||
struct bcm2708_gpio *gpio = container_of(gc, struct bcm2708_gpio, gc);
|
||||
unsigned long flags;
|
||||
unsigned gpiodir;
|
||||
unsigned gpio_bank = offset / 10;
|
||||
unsigned gpio_field_offset = (offset - 10 * gpio_bank) * 3;
|
||||
|
||||
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_set_function %p (%d,%d)\n", gc, offset, function);
|
||||
if (offset >= BCM2708_NR_GPIOS)
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(&lock, flags);
|
||||
|
||||
gpiodir = readl(gpio->base + GPIOFSEL(gpio_bank));
|
||||
gpiodir &= ~(7 << gpio_field_offset);
|
||||
gpiodir |= function << gpio_field_offset;
|
||||
writel(gpiodir, gpio->base + GPIOFSEL(gpio_bank));
|
||||
spin_unlock_irqrestore(&lock, flags);
|
||||
gpiodir = readl(gpio->base + GPIOFSEL(gpio_bank));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcm2708_gpio_dir_in(struct gpio_chip *gc, unsigned offset)
|
||||
{
|
||||
return bcm2708_set_function(gc, offset, GPIO_FSEL_INPUT);
|
||||
}
|
||||
|
||||
static void bcm2708_gpio_set(struct gpio_chip *gc, unsigned offset, int value);
|
||||
static int bcm2708_gpio_dir_out(struct gpio_chip *gc, unsigned offset,
|
||||
int value)
|
||||
{
|
||||
int ret;
|
||||
ret = bcm2708_set_function(gc, offset, GPIO_FSEL_OUTPUT);
|
||||
if (ret >= 0)
|
||||
bcm2708_gpio_set(gc, offset, value);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int bcm2708_gpio_get(struct gpio_chip *gc, unsigned offset)
|
||||
{
|
||||
struct bcm2708_gpio *gpio = container_of(gc, struct bcm2708_gpio, gc);
|
||||
unsigned gpio_bank = offset / 32;
|
||||
unsigned gpio_field_offset = (offset - 32 * gpio_bank);
|
||||
unsigned lev;
|
||||
|
||||
if (offset >= BCM2708_NR_GPIOS)
|
||||
return 0;
|
||||
lev = readl(gpio->base + GPIOLEV(gpio_bank));
|
||||
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_get %p (%d)=%d\n", gc, offset, 0x1 & (lev>>gpio_field_offset));
|
||||
return 0x1 & (lev >> gpio_field_offset);
|
||||
}
|
||||
|
||||
static void bcm2708_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
||||
{
|
||||
struct bcm2708_gpio *gpio = container_of(gc, struct bcm2708_gpio, gc);
|
||||
unsigned gpio_bank = offset / 32;
|
||||
unsigned gpio_field_offset = (offset - 32 * gpio_bank);
|
||||
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_set %p (%d=%d)\n", gc, offset, value);
|
||||
if (offset >= BCM2708_NR_GPIOS)
|
||||
return;
|
||||
if (value)
|
||||
writel(1 << gpio_field_offset, gpio->base + GPIOSET(gpio_bank));
|
||||
else
|
||||
writel(1 << gpio_field_offset, gpio->base + GPIOCLR(gpio_bank));
|
||||
}
|
||||
|
||||
/**********************
|
||||
* extension to configure pullups
|
||||
*/
|
||||
int bcm2708_gpio_setpull(struct gpio_chip *gc, unsigned offset,
|
||||
bcm2708_gpio_pull_t value)
|
||||
{
|
||||
struct bcm2708_gpio *gpio = container_of(gc, struct bcm2708_gpio, gc);
|
||||
unsigned gpio_bank = offset / 32;
|
||||
unsigned gpio_field_offset = (offset - 32 * gpio_bank);
|
||||
|
||||
if (offset >= BCM2708_NR_GPIOS)
|
||||
return -EINVAL;
|
||||
|
||||
switch (value) {
|
||||
case BCM2708_PULL_UP:
|
||||
writel(2, gpio->base + GPIOUD(0));
|
||||
break;
|
||||
case BCM2708_PULL_DOWN:
|
||||
writel(1, gpio->base + GPIOUD(0));
|
||||
break;
|
||||
case BCM2708_PULL_OFF:
|
||||
writel(0, gpio->base + GPIOUD(0));
|
||||
break;
|
||||
}
|
||||
|
||||
udelay(5);
|
||||
writel(1 << gpio_field_offset, gpio->base + GPIOUDCLK(gpio_bank));
|
||||
udelay(5);
|
||||
writel(0, gpio->base + GPIOUD(0));
|
||||
writel(0 << gpio_field_offset, gpio->base + GPIOUDCLK(gpio_bank));
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bcm2708_gpio_setpull);
|
||||
|
||||
/*************************************************************************************************************************
|
||||
* bcm2708 GPIO IRQ
|
||||
*/
|
||||
|
||||
#if BCM_GPIO_USE_IRQ
|
||||
|
||||
static int bcm2708_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
|
||||
{
|
||||
return gpio_to_irq(gpio);
|
||||
}
|
||||
|
||||
static int bcm2708_gpio_irq_set_type(struct irq_data *d, unsigned type)
|
||||
{
|
||||
unsigned irq = d->irq;
|
||||
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
||||
unsigned gn = irq_to_gpio(irq);
|
||||
unsigned gb = gn / 32;
|
||||
unsigned go = gn % 32;
|
||||
|
||||
gpio->rising[gb] &= ~(1 << go);
|
||||
gpio->falling[gb] &= ~(1 << go);
|
||||
gpio->high[gb] &= ~(1 << go);
|
||||
gpio->low[gb] &= ~(1 << go);
|
||||
|
||||
if (type & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING | IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
|
||||
return -EINVAL;
|
||||
|
||||
if (type & IRQ_TYPE_EDGE_RISING)
|
||||
gpio->rising[gb] |= (1 << go);
|
||||
if (type & IRQ_TYPE_EDGE_FALLING)
|
||||
gpio->falling[gb] |= (1 << go);
|
||||
if (type & IRQ_TYPE_LEVEL_HIGH)
|
||||
gpio->high[gb] |= (1 << go);
|
||||
if (type & IRQ_TYPE_LEVEL_LOW)
|
||||
gpio->low[gb] |= (1 << go);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bcm2708_gpio_irq_mask(struct irq_data *d)
|
||||
{
|
||||
unsigned irq = d->irq;
|
||||
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
||||
unsigned gn = irq_to_gpio(irq);
|
||||
unsigned gb = gn / 32;
|
||||
unsigned long rising = readl(gpio->base + GPIOREN(gb));
|
||||
unsigned long falling = readl(gpio->base + GPIOFEN(gb));
|
||||
unsigned long high = readl(gpio->base + GPIOHEN(gb));
|
||||
unsigned long low = readl(gpio->base + GPIOLEN(gb));
|
||||
|
||||
gn = gn % 32;
|
||||
|
||||
writel(rising & ~(1 << gn), gpio->base + GPIOREN(gb));
|
||||
writel(falling & ~(1 << gn), gpio->base + GPIOFEN(gb));
|
||||
writel(high & ~(1 << gn), gpio->base + GPIOHEN(gb));
|
||||
writel(low & ~(1 << gn), gpio->base + GPIOLEN(gb));
|
||||
}
|
||||
|
||||
static void bcm2708_gpio_irq_unmask(struct irq_data *d)
|
||||
{
|
||||
unsigned irq = d->irq;
|
||||
struct bcm2708_gpio *gpio = irq_get_chip_data(irq);
|
||||
unsigned gn = irq_to_gpio(irq);
|
||||
unsigned gb = gn / 32;
|
||||
unsigned go = gn % 32;
|
||||
unsigned long rising = readl(gpio->base + GPIOREN(gb));
|
||||
unsigned long falling = readl(gpio->base + GPIOFEN(gb));
|
||||
unsigned long high = readl(gpio->base + GPIOHEN(gb));
|
||||
unsigned long low = readl(gpio->base + GPIOLEN(gb));
|
||||
|
||||
if (gpio->rising[gb] & (1 << go)) {
|
||||
writel(rising | (1 << go), gpio->base + GPIOREN(gb));
|
||||
} else {
|
||||
writel(rising & ~(1 << go), gpio->base + GPIOREN(gb));
|
||||
}
|
||||
|
||||
if (gpio->falling[gb] & (1 << go)) {
|
||||
writel(falling | (1 << go), gpio->base + GPIOFEN(gb));
|
||||
} else {
|
||||
writel(falling & ~(1 << go), gpio->base + GPIOFEN(gb));
|
||||
}
|
||||
|
||||
if (gpio->high[gb] & (1 << go)) {
|
||||
writel(high | (1 << go), gpio->base + GPIOHEN(gb));
|
||||
} else {
|
||||
writel(high & ~(1 << go), gpio->base + GPIOHEN(gb));
|
||||
}
|
||||
|
||||
if (gpio->low[gb] & (1 << go)) {
|
||||
writel(low | (1 << go), gpio->base + GPIOLEN(gb));
|
||||
} else {
|
||||
writel(low & ~(1 << go), gpio->base + GPIOLEN(gb));
|
||||
}
|
||||
}
|
||||
|
||||
static struct irq_chip bcm2708_irqchip = {
|
||||
.name = "GPIO",
|
||||
.irq_enable = bcm2708_gpio_irq_unmask,
|
||||
.irq_disable = bcm2708_gpio_irq_mask,
|
||||
.irq_unmask = bcm2708_gpio_irq_unmask,
|
||||
.irq_mask = bcm2708_gpio_irq_mask,
|
||||
.irq_set_type = bcm2708_gpio_irq_set_type,
|
||||
};
|
||||
|
||||
static irqreturn_t bcm2708_gpio_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
unsigned long edsr;
|
||||
unsigned bank;
|
||||
int i;
|
||||
unsigned gpio;
|
||||
unsigned level_bits;
|
||||
struct bcm2708_gpio *gpio_data = dev_id;
|
||||
|
||||
for (bank = 0; bank < GPIO_BANKS; bank++) {
|
||||
edsr = readl(__io_address(GPIO_BASE) + GPIOEDS(bank));
|
||||
level_bits = gpio_data->high[bank] | gpio_data->low[bank];
|
||||
|
||||
for_each_set_bit(i, &edsr, 32) {
|
||||
gpio = i + bank * 32;
|
||||
/* ack edge triggered IRQs immediately */
|
||||
if (!(level_bits & (1<<i)))
|
||||
writel(1<<i,
|
||||
__io_address(GPIO_BASE) + GPIOEDS(bank));
|
||||
generic_handle_irq(gpio_to_irq(gpio));
|
||||
/* ack level triggered IRQ after handling them */
|
||||
if (level_bits & (1<<i))
|
||||
writel(1<<i,
|
||||
__io_address(GPIO_BASE) + GPIOEDS(bank));
|
||||
}
|
||||
}
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static struct irqaction bcm2708_gpio_irq = {
|
||||
.name = "BCM2708 GPIO catchall handler",
|
||||
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
|
||||
.handler = bcm2708_gpio_interrupt,
|
||||
};
|
||||
|
||||
static void bcm2708_gpio_irq_init(struct bcm2708_gpio *ucb)
|
||||
{
|
||||
unsigned irq;
|
||||
|
||||
ucb->gc.to_irq = bcm2708_gpio_to_irq;
|
||||
|
||||
for (irq = GPIO_IRQ_START; irq < (GPIO_IRQ_START + GPIO_IRQS); irq++) {
|
||||
irq_set_chip_data(irq, ucb);
|
||||
irq_set_chip_and_handler(irq, &bcm2708_irqchip,
|
||||
handle_simple_irq);
|
||||
set_irq_flags(irq, IRQF_VALID);
|
||||
}
|
||||
|
||||
bcm2708_gpio_irq.dev_id = ucb;
|
||||
setup_irq(IRQ_GPIO3, &bcm2708_gpio_irq);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void bcm2708_gpio_irq_init(struct bcm2708_gpio *ucb)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* #if BCM_GPIO_USE_IRQ ***************************************************************************************************************** */
|
||||
|
||||
static int bcm2708_gpio_probe(struct platform_device *dev)
|
||||
{
|
||||
struct bcm2708_gpio *ucb;
|
||||
struct resource *res;
|
||||
int bank;
|
||||
int err = 0;
|
||||
|
||||
printk(KERN_INFO DRIVER_NAME ": bcm2708_gpio_probe %p\n", dev);
|
||||
|
||||
ucb = kzalloc(sizeof(*ucb), GFP_KERNEL);
|
||||
if (NULL == ucb) {
|
||||
printk(KERN_ERR DRIVER_NAME ": failed to allocate "
|
||||
"mailbox memory\n");
|
||||
err = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
|
||||
|
||||
platform_set_drvdata(dev, ucb);
|
||||
ucb->base = __io_address(GPIO_BASE);
|
||||
|
||||
ucb->gc.label = "bcm2708_gpio";
|
||||
ucb->gc.base = 0;
|
||||
ucb->gc.ngpio = BCM2708_NR_GPIOS;
|
||||
ucb->gc.owner = THIS_MODULE;
|
||||
|
||||
ucb->gc.direction_input = bcm2708_gpio_dir_in;
|
||||
ucb->gc.direction_output = bcm2708_gpio_dir_out;
|
||||
ucb->gc.get = bcm2708_gpio_get;
|
||||
ucb->gc.set = bcm2708_gpio_set;
|
||||
ucb->gc.can_sleep = 0;
|
||||
|
||||
for (bank = 0; bank < GPIO_BANKS; bank++) {
|
||||
writel(0, ucb->base + GPIOREN(bank));
|
||||
writel(0, ucb->base + GPIOFEN(bank));
|
||||
writel(0, ucb->base + GPIOHEN(bank));
|
||||
writel(0, ucb->base + GPIOLEN(bank));
|
||||
writel(0, ucb->base + GPIOAREN(bank));
|
||||
writel(0, ucb->base + GPIOAFEN(bank));
|
||||
writel(~0, ucb->base + GPIOEDS(bank));
|
||||
}
|
||||
|
||||
bcm2708_gpio_irq_init(ucb);
|
||||
|
||||
err = gpiochip_add(&ucb->gc);
|
||||
|
||||
err:
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
static int bcm2708_gpio_remove(struct platform_device *dev)
|
||||
{
|
||||
int err = 0;
|
||||
struct bcm2708_gpio *ucb = platform_get_drvdata(dev);
|
||||
|
||||
printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_remove %p\n", dev);
|
||||
|
||||
gpiochip_remove(&ucb->gc);
|
||||
|
||||
platform_set_drvdata(dev, NULL);
|
||||
kfree(ucb);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct platform_driver bcm2708_gpio_driver = {
|
||||
.probe = bcm2708_gpio_probe,
|
||||
.remove = bcm2708_gpio_remove,
|
||||
.driver = {
|
||||
.name = "bcm2708_gpio"},
|
||||
};
|
||||
|
||||
static int __init bcm2708_gpio_init(void)
|
||||
{
|
||||
return platform_driver_register(&bcm2708_gpio_driver);
|
||||
}
|
||||
|
||||
static void __exit bcm2708_gpio_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&bcm2708_gpio_driver);
|
||||
}
|
||||
|
||||
module_init(bcm2708_gpio_init);
|
||||
module_exit(bcm2708_gpio_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Broadcom BCM2708 GPIO driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
1355
arch/arm/mach-bcm2709/bcm2709.c
Normal file
1355
arch/arm/mach-bcm2709/bcm2709.c
Normal file
File diff suppressed because it is too large
Load Diff
49
arch/arm/mach-bcm2709/bcm2709.h
Normal file
49
arch/arm/mach-bcm2709/bcm2709.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/bcm2708.h
|
||||
*
|
||||
* BCM2708 machine support header
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __BCM2708_BCM2708_H
|
||||
#define __BCM2708_BCM2708_H
|
||||
|
||||
#include <linux/amba/bus.h>
|
||||
|
||||
extern void __init bcm2708_init(void);
|
||||
extern void __init bcm2708_init_irq(void);
|
||||
extern void __init bcm2708_map_io(void);
|
||||
extern struct sys_timer bcm2708_timer;
|
||||
extern unsigned int mmc_status(struct device *dev);
|
||||
|
||||
#define AMBA_DEVICE(name, busid, base, plat) \
|
||||
static struct amba_device name##_device = { \
|
||||
.dev = { \
|
||||
.coherent_dma_mask = ~0, \
|
||||
.init_name = busid, \
|
||||
.platform_data = plat, \
|
||||
}, \
|
||||
.res = { \
|
||||
.start = base##_BASE, \
|
||||
.end = (base##_BASE) + SZ_4K - 1,\
|
||||
.flags = IORESOURCE_MEM, \
|
||||
}, \
|
||||
.irq = base##_IRQ, \
|
||||
}
|
||||
|
||||
#endif
|
||||
61
arch/arm/mach-bcm2709/clock.c
Normal file
61
arch/arm/mach-bcm2709/clock.c
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/clock.c
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#include <asm/clkdev.h>
|
||||
|
||||
#include "clock.h"
|
||||
|
||||
int clk_enable(struct clk *clk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(clk_enable);
|
||||
|
||||
void clk_disable(struct clk *clk)
|
||||
{
|
||||
}
|
||||
EXPORT_SYMBOL(clk_disable);
|
||||
|
||||
unsigned long clk_get_rate(struct clk *clk)
|
||||
{
|
||||
return clk->rate;
|
||||
}
|
||||
EXPORT_SYMBOL(clk_get_rate);
|
||||
|
||||
long clk_round_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
return clk->rate;
|
||||
}
|
||||
EXPORT_SYMBOL(clk_round_rate);
|
||||
|
||||
int clk_set_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
return -EIO;
|
||||
}
|
||||
EXPORT_SYMBOL(clk_set_rate);
|
||||
24
arch/arm/mach-bcm2709/clock.h
Normal file
24
arch/arm/mach-bcm2709/clock.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/clock.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
struct module;
|
||||
|
||||
struct clk {
|
||||
unsigned long rate;
|
||||
};
|
||||
21
arch/arm/mach-bcm2709/delay.S
Normal file
21
arch/arm/mach-bcm2709/delay.S
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* linux/arch/arm/lib/delay.S
|
||||
*
|
||||
* Copyright (C) 1995, 1996 Russell King
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/assembler.h>
|
||||
#include <asm/param.h>
|
||||
|
||||
.text
|
||||
.align 3 @ 8 byte alignment seems to be needed to avoid fetching stalls
|
||||
@ Delay routine
|
||||
ENTRY(bcm2708_delay)
|
||||
subs r0, r0, #1
|
||||
bhi bcm2708_delay
|
||||
mov pc, lr
|
||||
ENDPROC(bcm2708_delay)
|
||||
493
arch/arm/mach-bcm2709/include/mach/arm_control.h
Normal file
493
arch/arm/mach-bcm2709/include/mach/arm_control.h
Normal file
@@ -0,0 +1,493 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/arm_control.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __BCM2708_ARM_CONTROL_H
|
||||
#define __BCM2708_ARM_CONTROL_H
|
||||
|
||||
/*
|
||||
* Definitions and addresses for the ARM CONTROL logic
|
||||
* This file is manually generated.
|
||||
*/
|
||||
|
||||
#define ARM_BASE 0x7E00B000
|
||||
|
||||
/* Basic configuration */
|
||||
#define ARM_CONTROL0 HW_REGISTER_RW(ARM_BASE+0x000)
|
||||
#define ARM_C0_SIZ128M 0x00000000
|
||||
#define ARM_C0_SIZ256M 0x00000001
|
||||
#define ARM_C0_SIZ512M 0x00000002
|
||||
#define ARM_C0_SIZ1G 0x00000003
|
||||
#define ARM_C0_BRESP0 0x00000000
|
||||
#define ARM_C0_BRESP1 0x00000004
|
||||
#define ARM_C0_BRESP2 0x00000008
|
||||
#define ARM_C0_BOOTHI 0x00000010
|
||||
#define ARM_C0_UNUSED05 0x00000020 /* free */
|
||||
#define ARM_C0_FULLPERI 0x00000040
|
||||
#define ARM_C0_UNUSED78 0x00000180 /* free */
|
||||
#define ARM_C0_JTAGMASK 0x00000E00
|
||||
#define ARM_C0_JTAGOFF 0x00000000
|
||||
#define ARM_C0_JTAGBASH 0x00000800 /* Debug on GPIO off */
|
||||
#define ARM_C0_JTAGGPIO 0x00000C00 /* Debug on GPIO on */
|
||||
#define ARM_C0_APROTMSK 0x0000F000
|
||||
#define ARM_C0_DBG0SYNC 0x00010000 /* VPU0 halt sync */
|
||||
#define ARM_C0_DBG1SYNC 0x00020000 /* VPU1 halt sync */
|
||||
#define ARM_C0_SWDBGREQ 0x00040000 /* HW debug request */
|
||||
#define ARM_C0_PASSHALT 0x00080000 /* ARM halt passed to debugger */
|
||||
#define ARM_C0_PRIO_PER 0x00F00000 /* per priority mask */
|
||||
#define ARM_C0_PRIO_L2 0x0F000000
|
||||
#define ARM_C0_PRIO_UC 0xF0000000
|
||||
|
||||
#define ARM_C0_APROTPASS 0x0000A000 /* Translate 1:1 */
|
||||
#define ARM_C0_APROTUSER 0x00000000 /* Only user mode */
|
||||
#define ARM_C0_APROTSYST 0x0000F000 /* Only system mode */
|
||||
|
||||
|
||||
#define ARM_CONTROL1 HW_REGISTER_RW(ARM_BASE+0x440)
|
||||
#define ARM_C1_TIMER 0x00000001 /* re-route timer IRQ to VC */
|
||||
#define ARM_C1_MAIL 0x00000002 /* re-route Mail IRQ to VC */
|
||||
#define ARM_C1_BELL0 0x00000004 /* re-route Doorbell 0 to VC */
|
||||
#define ARM_C1_BELL1 0x00000008 /* re-route Doorbell 1 to VC */
|
||||
#define ARM_C1_PERSON 0x00000100 /* peripherals on */
|
||||
#define ARM_C1_REQSTOP 0x00000200 /* ASYNC bridge request stop */
|
||||
|
||||
#define ARM_STATUS HW_REGISTER_RW(ARM_BASE+0x444)
|
||||
#define ARM_S_ACKSTOP 0x80000000 /* Bridge stopped */
|
||||
#define ARM_S_READPEND 0x000003FF /* pending reads counter */
|
||||
#define ARM_S_WRITPEND 0x000FFC00 /* pending writes counter */
|
||||
|
||||
#define ARM_ERRHALT HW_REGISTER_RW(ARM_BASE+0x448)
|
||||
#define ARM_EH_PERIBURST 0x00000001 /* Burst write seen on peri bus */
|
||||
#define ARM_EH_ILLADDRS1 0x00000002 /* Address bits 25-27 error */
|
||||
#define ARM_EH_ILLADDRS2 0x00000004 /* Address bits 31-28 error */
|
||||
#define ARM_EH_VPU0HALT 0x00000008 /* VPU0 halted & in debug mode */
|
||||
#define ARM_EH_VPU1HALT 0x00000010 /* VPU1 halted & in debug mode */
|
||||
#define ARM_EH_ARMHALT 0x00000020 /* ARM in halted debug mode */
|
||||
|
||||
#define ARM_ID_SECURE HW_REGISTER_RW(ARM_BASE+0x00C)
|
||||
#define ARM_ID HW_REGISTER_RW(ARM_BASE+0x44C)
|
||||
#define ARM_IDVAL 0x364D5241
|
||||
|
||||
/* Translation memory */
|
||||
#define ARM_TRANSLATE HW_REGISTER_RW(ARM_BASE+0x100)
|
||||
/* 32 locations: 0x100.. 0x17F */
|
||||
/* 32 spare means we CAN go to 64 pages.... */
|
||||
|
||||
|
||||
/* Interrupts */
|
||||
#define ARM_IRQ_PEND0 HW_REGISTER_RW(ARM_BASE+0x200) /* Top IRQ bits */
|
||||
#define ARM_I0_TIMER 0x00000001 /* timer IRQ */
|
||||
#define ARM_I0_MAIL 0x00000002 /* Mail IRQ */
|
||||
#define ARM_I0_BELL0 0x00000004 /* Doorbell 0 */
|
||||
#define ARM_I0_BELL1 0x00000008 /* Doorbell 1 */
|
||||
#define ARM_I0_BANK1 0x00000100 /* Bank1 IRQ */
|
||||
#define ARM_I0_BANK2 0x00000200 /* Bank2 IRQ */
|
||||
|
||||
#define ARM_IRQ_PEND1 HW_REGISTER_RW(ARM_BASE+0x204) /* All bank1 IRQ bits */
|
||||
/* todo: all I1_interrupt sources */
|
||||
#define ARM_IRQ_PEND2 HW_REGISTER_RW(ARM_BASE+0x208) /* All bank2 IRQ bits */
|
||||
/* todo: all I2_interrupt sources */
|
||||
|
||||
#define ARM_IRQ_FAST HW_REGISTER_RW(ARM_BASE+0x20C) /* FIQ control */
|
||||
#define ARM_IF_INDEX 0x0000007F /* FIQ select */
|
||||
#define ARM_IF_ENABLE 0x00000080 /* FIQ enable */
|
||||
#define ARM_IF_VCMASK 0x0000003F /* FIQ = (index from VC source) */
|
||||
#define ARM_IF_TIMER 0x00000040 /* FIQ = ARM timer */
|
||||
#define ARM_IF_MAIL 0x00000041 /* FIQ = ARM Mail */
|
||||
#define ARM_IF_BELL0 0x00000042 /* FIQ = ARM Doorbell 0 */
|
||||
#define ARM_IF_BELL1 0x00000043 /* FIQ = ARM Doorbell 1 */
|
||||
#define ARM_IF_VP0HALT 0x00000044 /* FIQ = VPU0 Halt seen */
|
||||
#define ARM_IF_VP1HALT 0x00000045 /* FIQ = VPU1 Halt seen */
|
||||
#define ARM_IF_ILLEGAL 0x00000046 /* FIQ = Illegal access seen */
|
||||
|
||||
#define ARM_IRQ_ENBL1 HW_REGISTER_RW(ARM_BASE+0x210) /* Bank1 enable bits */
|
||||
#define ARM_IRQ_ENBL2 HW_REGISTER_RW(ARM_BASE+0x214) /* Bank2 enable bits */
|
||||
#define ARM_IRQ_ENBL3 HW_REGISTER_RW(ARM_BASE+0x218) /* ARM irqs enable bits */
|
||||
#define ARM_IRQ_DIBL1 HW_REGISTER_RW(ARM_BASE+0x21C) /* Bank1 disable bits */
|
||||
#define ARM_IRQ_DIBL2 HW_REGISTER_RW(ARM_BASE+0x220) /* Bank2 disable bits */
|
||||
#define ARM_IRQ_DIBL3 HW_REGISTER_RW(ARM_BASE+0x224) /* ARM irqs disable bits */
|
||||
#define ARM_IE_TIMER 0x00000001 /* Timer IRQ */
|
||||
#define ARM_IE_MAIL 0x00000002 /* Mail IRQ */
|
||||
#define ARM_IE_BELL0 0x00000004 /* Doorbell 0 */
|
||||
#define ARM_IE_BELL1 0x00000008 /* Doorbell 1 */
|
||||
#define ARM_IE_VP0HALT 0x00000010 /* VPU0 Halt */
|
||||
#define ARM_IE_VP1HALT 0x00000020 /* VPU1 Halt */
|
||||
#define ARM_IE_ILLEGAL 0x00000040 /* Illegal access seen */
|
||||
|
||||
/* Timer */
|
||||
/* For reg. fields see sp804 spec. */
|
||||
#define ARM_T_LOAD HW_REGISTER_RW(ARM_BASE+0x400)
|
||||
#define ARM_T_VALUE HW_REGISTER_RW(ARM_BASE+0x404)
|
||||
#define ARM_T_CONTROL HW_REGISTER_RW(ARM_BASE+0x408)
|
||||
#define ARM_T_IRQCNTL HW_REGISTER_RW(ARM_BASE+0x40C)
|
||||
#define ARM_T_RAWIRQ HW_REGISTER_RW(ARM_BASE+0x410)
|
||||
#define ARM_T_MSKIRQ HW_REGISTER_RW(ARM_BASE+0x414)
|
||||
#define ARM_T_RELOAD HW_REGISTER_RW(ARM_BASE+0x418)
|
||||
#define ARM_T_PREDIV HW_REGISTER_RW(ARM_BASE+0x41c)
|
||||
#define ARM_T_FREECNT HW_REGISTER_RW(ARM_BASE+0x420)
|
||||
|
||||
#define TIMER_CTRL_ONESHOT (1 << 0)
|
||||
#define TIMER_CTRL_32BIT (1 << 1)
|
||||
#define TIMER_CTRL_DIV1 (0 << 2)
|
||||
#define TIMER_CTRL_DIV16 (1 << 2)
|
||||
#define TIMER_CTRL_DIV256 (2 << 2)
|
||||
#define TIMER_CTRL_IE (1 << 5)
|
||||
#define TIMER_CTRL_PERIODIC (1 << 6)
|
||||
#define TIMER_CTRL_ENABLE (1 << 7)
|
||||
#define TIMER_CTRL_DBGHALT (1 << 8)
|
||||
#define TIMER_CTRL_ENAFREE (1 << 9)
|
||||
#define TIMER_CTRL_FREEDIV_SHIFT 16)
|
||||
#define TIMER_CTRL_FREEDIV_MASK 0xff
|
||||
|
||||
/* Semaphores, Doorbells, Mailboxes */
|
||||
#define ARM_SBM_OWN0 (ARM_BASE+0x800)
|
||||
#define ARM_SBM_OWN1 (ARM_BASE+0x900)
|
||||
#define ARM_SBM_OWN2 (ARM_BASE+0xA00)
|
||||
#define ARM_SBM_OWN3 (ARM_BASE+0xB00)
|
||||
|
||||
/* MAILBOXES
|
||||
* Register flags are common across all
|
||||
* owner registers. See end of this section
|
||||
*
|
||||
* Semaphores, Doorbells, Mailboxes Owner 0
|
||||
*
|
||||
*/
|
||||
|
||||
#define ARM_0_SEMS HW_REGISTER_RW(ARM_SBM_OWN0+0x00)
|
||||
#define ARM_0_SEM0 HW_REGISTER_RW(ARM_SBM_OWN0+0x00)
|
||||
#define ARM_0_SEM1 HW_REGISTER_RW(ARM_SBM_OWN0+0x04)
|
||||
#define ARM_0_SEM2 HW_REGISTER_RW(ARM_SBM_OWN0+0x08)
|
||||
#define ARM_0_SEM3 HW_REGISTER_RW(ARM_SBM_OWN0+0x0C)
|
||||
#define ARM_0_SEM4 HW_REGISTER_RW(ARM_SBM_OWN0+0x10)
|
||||
#define ARM_0_SEM5 HW_REGISTER_RW(ARM_SBM_OWN0+0x14)
|
||||
#define ARM_0_SEM6 HW_REGISTER_RW(ARM_SBM_OWN0+0x18)
|
||||
#define ARM_0_SEM7 HW_REGISTER_RW(ARM_SBM_OWN0+0x1C)
|
||||
#define ARM_0_BELL0 HW_REGISTER_RW(ARM_SBM_OWN0+0x40)
|
||||
#define ARM_0_BELL1 HW_REGISTER_RW(ARM_SBM_OWN0+0x44)
|
||||
#define ARM_0_BELL2 HW_REGISTER_RW(ARM_SBM_OWN0+0x48)
|
||||
#define ARM_0_BELL3 HW_REGISTER_RW(ARM_SBM_OWN0+0x4C)
|
||||
/* MAILBOX 0 access in Owner 0 area */
|
||||
/* Some addresses should ONLY be used by owner 0 */
|
||||
#define ARM_0_MAIL0_WRT HW_REGISTER_RW(ARM_SBM_OWN0+0x80) /* .. 0x8C (4 locations) */
|
||||
#define ARM_0_MAIL0_RD HW_REGISTER_RW(ARM_SBM_OWN0+0x80) /* .. 0x8C (4 locations) Normal read */
|
||||
#define ARM_0_MAIL0_POL HW_REGISTER_RW(ARM_SBM_OWN0+0x90) /* none-pop read */
|
||||
#define ARM_0_MAIL0_SND HW_REGISTER_RW(ARM_SBM_OWN0+0x94) /* Sender read (only LS 2 bits) */
|
||||
#define ARM_0_MAIL0_STA HW_REGISTER_RW(ARM_SBM_OWN0+0x98) /* Status read */
|
||||
#define ARM_0_MAIL0_CNF HW_REGISTER_RW(ARM_SBM_OWN0+0x9C) /* Config read/write */
|
||||
/* MAILBOX 1 access in Owner 0 area */
|
||||
/* Owner 0 should only WRITE to this mailbox */
|
||||
#define ARM_0_MAIL1_WRT HW_REGISTER_RW(ARM_SBM_OWN0+0xA0) /* .. 0xAC (4 locations) */
|
||||
/*#define ARM_0_MAIL1_RD HW_REGISTER_RW(ARM_SBM_OWN0+0xA0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_0_MAIL1_POL HW_REGISTER_RW(ARM_SBM_OWN0+0xB0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_0_MAIL1_SND HW_REGISTER_RW(ARM_SBM_OWN0+0xB4) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_0_MAIL1_STA HW_REGISTER_RW(ARM_SBM_OWN0+0xB8) /* Status read */
|
||||
/*#define ARM_0_MAIL1_CNF HW_REGISTER_RW(ARM_SBM_OWN0+0xBC) */ /* DO NOT USE THIS !!!!! */
|
||||
/* General SEM, BELL, MAIL config/status */
|
||||
#define ARM_0_SEMCLRDBG HW_REGISTER_RW(ARM_SBM_OWN0+0xE0) /* semaphore clear/debug register */
|
||||
#define ARM_0_BELLCLRDBG HW_REGISTER_RW(ARM_SBM_OWN0+0xE4) /* Doorbells clear/debug register */
|
||||
#define ARM_0_ALL_IRQS HW_REGISTER_RW(ARM_SBM_OWN0+0xF8) /* ALL interrupts */
|
||||
#define ARM_0_MY_IRQS HW_REGISTER_RW(ARM_SBM_OWN0+0xFC) /* IRQS pending for owner 0 */
|
||||
|
||||
/* Semaphores, Doorbells, Mailboxes Owner 1 */
|
||||
#define ARM_1_SEMS HW_REGISTER_RW(ARM_SBM_OWN1+0x00)
|
||||
#define ARM_1_SEM0 HW_REGISTER_RW(ARM_SBM_OWN1+0x00)
|
||||
#define ARM_1_SEM1 HW_REGISTER_RW(ARM_SBM_OWN1+0x04)
|
||||
#define ARM_1_SEM2 HW_REGISTER_RW(ARM_SBM_OWN1+0x08)
|
||||
#define ARM_1_SEM3 HW_REGISTER_RW(ARM_SBM_OWN1+0x0C)
|
||||
#define ARM_1_SEM4 HW_REGISTER_RW(ARM_SBM_OWN1+0x10)
|
||||
#define ARM_1_SEM5 HW_REGISTER_RW(ARM_SBM_OWN1+0x14)
|
||||
#define ARM_1_SEM6 HW_REGISTER_RW(ARM_SBM_OWN1+0x18)
|
||||
#define ARM_1_SEM7 HW_REGISTER_RW(ARM_SBM_OWN1+0x1C)
|
||||
#define ARM_1_BELL0 HW_REGISTER_RW(ARM_SBM_OWN1+0x40)
|
||||
#define ARM_1_BELL1 HW_REGISTER_RW(ARM_SBM_OWN1+0x44)
|
||||
#define ARM_1_BELL2 HW_REGISTER_RW(ARM_SBM_OWN1+0x48)
|
||||
#define ARM_1_BELL3 HW_REGISTER_RW(ARM_SBM_OWN1+0x4C)
|
||||
/* MAILBOX 0 access in Owner 0 area */
|
||||
/* Owner 1 should only WRITE to this mailbox */
|
||||
#define ARM_1_MAIL0_WRT HW_REGISTER_RW(ARM_SBM_OWN1+0x80) /* .. 0x8C (4 locations) */
|
||||
/*#define ARM_1_MAIL0_RD HW_REGISTER_RW(ARM_SBM_OWN1+0x80) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_1_MAIL0_POL HW_REGISTER_RW(ARM_SBM_OWN1+0x90) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_1_MAIL0_SND HW_REGISTER_RW(ARM_SBM_OWN1+0x94) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_1_MAIL0_STA HW_REGISTER_RW(ARM_SBM_OWN1+0x98) /* Status read */
|
||||
/*#define ARM_1_MAIL0_CNF HW_REGISTER_RW(ARM_SBM_OWN1+0x9C) */ /* DO NOT USE THIS !!!!! */
|
||||
/* MAILBOX 1 access in Owner 0 area */
|
||||
#define ARM_1_MAIL1_WRT HW_REGISTER_RW(ARM_SBM_OWN1+0xA0) /* .. 0xAC (4 locations) */
|
||||
#define ARM_1_MAIL1_RD HW_REGISTER_RW(ARM_SBM_OWN1+0xA0) /* .. 0xAC (4 locations) Normal read */
|
||||
#define ARM_1_MAIL1_POL HW_REGISTER_RW(ARM_SBM_OWN1+0xB0) /* none-pop read */
|
||||
#define ARM_1_MAIL1_SND HW_REGISTER_RW(ARM_SBM_OWN1+0xB4) /* Sender read (only LS 2 bits) */
|
||||
#define ARM_1_MAIL1_STA HW_REGISTER_RW(ARM_SBM_OWN1+0xB8) /* Status read */
|
||||
#define ARM_1_MAIL1_CNF HW_REGISTER_RW(ARM_SBM_OWN1+0xBC)
|
||||
/* General SEM, BELL, MAIL config/status */
|
||||
#define ARM_1_SEMCLRDBG HW_REGISTER_RW(ARM_SBM_OWN1+0xE0) /* semaphore clear/debug register */
|
||||
#define ARM_1_BELLCLRDBG HW_REGISTER_RW(ARM_SBM_OWN1+0xE4) /* Doorbells clear/debug register */
|
||||
#define ARM_1_MY_IRQS HW_REGISTER_RW(ARM_SBM_OWN1+0xFC) /* IRQS pending for owner 1 */
|
||||
#define ARM_1_ALL_IRQS HW_REGISTER_RW(ARM_SBM_OWN1+0xF8) /* ALL interrupts */
|
||||
|
||||
/* Semaphores, Doorbells, Mailboxes Owner 2 */
|
||||
#define ARM_2_SEMS HW_REGISTER_RW(ARM_SBM_OWN2+0x00)
|
||||
#define ARM_2_SEM0 HW_REGISTER_RW(ARM_SBM_OWN2+0x00)
|
||||
#define ARM_2_SEM1 HW_REGISTER_RW(ARM_SBM_OWN2+0x04)
|
||||
#define ARM_2_SEM2 HW_REGISTER_RW(ARM_SBM_OWN2+0x08)
|
||||
#define ARM_2_SEM3 HW_REGISTER_RW(ARM_SBM_OWN2+0x0C)
|
||||
#define ARM_2_SEM4 HW_REGISTER_RW(ARM_SBM_OWN2+0x10)
|
||||
#define ARM_2_SEM5 HW_REGISTER_RW(ARM_SBM_OWN2+0x14)
|
||||
#define ARM_2_SEM6 HW_REGISTER_RW(ARM_SBM_OWN2+0x18)
|
||||
#define ARM_2_SEM7 HW_REGISTER_RW(ARM_SBM_OWN2+0x1C)
|
||||
#define ARM_2_BELL0 HW_REGISTER_RW(ARM_SBM_OWN2+0x40)
|
||||
#define ARM_2_BELL1 HW_REGISTER_RW(ARM_SBM_OWN2+0x44)
|
||||
#define ARM_2_BELL2 HW_REGISTER_RW(ARM_SBM_OWN2+0x48)
|
||||
#define ARM_2_BELL3 HW_REGISTER_RW(ARM_SBM_OWN2+0x4C)
|
||||
/* MAILBOX 0 access in Owner 2 area */
|
||||
/* Owner 2 should only WRITE to this mailbox */
|
||||
#define ARM_2_MAIL0_WRT HW_REGISTER_RW(ARM_SBM_OWN2+0x80) /* .. 0x8C (4 locations) */
|
||||
/*#define ARM_2_MAIL0_RD HW_REGISTER_RW(ARM_SBM_OWN2+0x80) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_2_MAIL0_POL HW_REGISTER_RW(ARM_SBM_OWN2+0x90) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_2_MAIL0_SND HW_REGISTER_RW(ARM_SBM_OWN2+0x94) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_2_MAIL0_STA HW_REGISTER_RW(ARM_SBM_OWN2+0x98) /* Status read */
|
||||
/*#define ARM_2_MAIL0_CNF HW_REGISTER_RW(ARM_SBM_OWN2+0x9C) */ /* DO NOT USE THIS !!!!! */
|
||||
/* MAILBOX 1 access in Owner 2 area */
|
||||
/* Owner 2 should only WRITE to this mailbox */
|
||||
#define ARM_2_MAIL1_WRT HW_REGISTER_RW(ARM_SBM_OWN2+0xA0) /* .. 0xAC (4 locations) */
|
||||
/*#define ARM_2_MAIL1_RD HW_REGISTER_RW(ARM_SBM_OWN2+0xA0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_2_MAIL1_POL HW_REGISTER_RW(ARM_SBM_OWN2+0xB0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_2_MAIL1_SND HW_REGISTER_RW(ARM_SBM_OWN2+0xB4) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_2_MAIL1_STA HW_REGISTER_RW(ARM_SBM_OWN2+0xB8) /* Status read */
|
||||
/*#define ARM_2_MAIL1_CNF HW_REGISTER_RW(ARM_SBM_OWN2+0xBC) */ /* DO NOT USE THIS !!!!! */
|
||||
/* General SEM, BELL, MAIL config/status */
|
||||
#define ARM_2_SEMCLRDBG HW_REGISTER_RW(ARM_SBM_OWN2+0xE0) /* semaphore clear/debug register */
|
||||
#define ARM_2_BELLCLRDBG HW_REGISTER_RW(ARM_SBM_OWN2+0xE4) /* Doorbells clear/debug register */
|
||||
#define ARM_2_MY_IRQS HW_REGISTER_RW(ARM_SBM_OWN2+0xFC) /* IRQS pending for owner 2 */
|
||||
#define ARM_2_ALL_IRQS HW_REGISTER_RW(ARM_SBM_OWN2+0xF8) /* ALL interrupts */
|
||||
|
||||
/* Semaphores, Doorbells, Mailboxes Owner 3 */
|
||||
#define ARM_3_SEMS HW_REGISTER_RW(ARM_SBM_OWN3+0x00)
|
||||
#define ARM_3_SEM0 HW_REGISTER_RW(ARM_SBM_OWN3+0x00)
|
||||
#define ARM_3_SEM1 HW_REGISTER_RW(ARM_SBM_OWN3+0x04)
|
||||
#define ARM_3_SEM2 HW_REGISTER_RW(ARM_SBM_OWN3+0x08)
|
||||
#define ARM_3_SEM3 HW_REGISTER_RW(ARM_SBM_OWN3+0x0C)
|
||||
#define ARM_3_SEM4 HW_REGISTER_RW(ARM_SBM_OWN3+0x10)
|
||||
#define ARM_3_SEM5 HW_REGISTER_RW(ARM_SBM_OWN3+0x14)
|
||||
#define ARM_3_SEM6 HW_REGISTER_RW(ARM_SBM_OWN3+0x18)
|
||||
#define ARM_3_SEM7 HW_REGISTER_RW(ARM_SBM_OWN3+0x1C)
|
||||
#define ARM_3_BELL0 HW_REGISTER_RW(ARM_SBM_OWN3+0x40)
|
||||
#define ARM_3_BELL1 HW_REGISTER_RW(ARM_SBM_OWN3+0x44)
|
||||
#define ARM_3_BELL2 HW_REGISTER_RW(ARM_SBM_OWN3+0x48)
|
||||
#define ARM_3_BELL3 HW_REGISTER_RW(ARM_SBM_OWN3+0x4C)
|
||||
/* MAILBOX 0 access in Owner 3 area */
|
||||
/* Owner 3 should only WRITE to this mailbox */
|
||||
#define ARM_3_MAIL0_WRT HW_REGISTER_RW(ARM_SBM_OWN3+0x80) /* .. 0x8C (4 locations) */
|
||||
/*#define ARM_3_MAIL0_RD HW_REGISTER_RW(ARM_SBM_OWN3+0x80) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_3_MAIL0_POL HW_REGISTER_RW(ARM_SBM_OWN3+0x90) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_3_MAIL0_SND HW_REGISTER_RW(ARM_SBM_OWN3+0x94) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_3_MAIL0_STA HW_REGISTER_RW(ARM_SBM_OWN3+0x98) /* Status read */
|
||||
/*#define ARM_3_MAIL0_CNF HW_REGISTER_RW(ARM_SBM_OWN3+0x9C) */ /* DO NOT USE THIS !!!!! */
|
||||
/* MAILBOX 1 access in Owner 3 area */
|
||||
/* Owner 3 should only WRITE to this mailbox */
|
||||
#define ARM_3_MAIL1_WRT HW_REGISTER_RW(ARM_SBM_OWN3+0xA0) /* .. 0xAC (4 locations) */
|
||||
/*#define ARM_3_MAIL1_RD HW_REGISTER_RW(ARM_SBM_OWN3+0xA0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_3_MAIL1_POL HW_REGISTER_RW(ARM_SBM_OWN3+0xB0) */ /* DO NOT USE THIS !!!!! */
|
||||
/*#define ARM_3_MAIL1_SND HW_REGISTER_RW(ARM_SBM_OWN3+0xB4) */ /* DO NOT USE THIS !!!!! */
|
||||
#define ARM_3_MAIL1_STA HW_REGISTER_RW(ARM_SBM_OWN3+0xB8) /* Status read */
|
||||
/*#define ARM_3_MAIL1_CNF HW_REGISTER_RW(ARM_SBM_OWN3+0xBC) */ /* DO NOT USE THIS !!!!! */
|
||||
/* General SEM, BELL, MAIL config/status */
|
||||
#define ARM_3_SEMCLRDBG HW_REGISTER_RW(ARM_SBM_OWN3+0xE0) /* semaphore clear/debug register */
|
||||
#define ARM_3_BELLCLRDBG HW_REGISTER_RW(ARM_SBM_OWN3+0xE4) /* Doorbells clear/debug register */
|
||||
#define ARM_3_MY_IRQS HW_REGISTER_RW(ARM_SBM_OWN3+0xFC) /* IRQS pending for owner 3 */
|
||||
#define ARM_3_ALL_IRQS HW_REGISTER_RW(ARM_SBM_OWN3+0xF8) /* ALL interrupts */
|
||||
|
||||
|
||||
|
||||
/* Mailbox flags. Valid for all owners */
|
||||
|
||||
/* Mailbox status register (...0x98) */
|
||||
#define ARM_MS_FULL 0x80000000
|
||||
#define ARM_MS_EMPTY 0x40000000
|
||||
#define ARM_MS_LEVEL 0x400000FF /* Max. value depdnds on mailbox depth parameter */
|
||||
|
||||
/* MAILBOX config/status register (...0x9C) */
|
||||
/* ANY write to this register clears the error bits! */
|
||||
#define ARM_MC_IHAVEDATAIRQEN 0x00000001 /* mailbox irq enable: has data */
|
||||
#define ARM_MC_IHAVESPACEIRQEN 0x00000002 /* mailbox irq enable: has space */
|
||||
#define ARM_MC_OPPISEMPTYIRQEN 0x00000004 /* mailbox irq enable: Opp. is empty */
|
||||
#define ARM_MC_MAIL_CLEAR 0x00000008 /* mailbox clear write 1, then 0 */
|
||||
#define ARM_MC_IHAVEDATAIRQPEND 0x00000010 /* mailbox irq pending: has space */
|
||||
#define ARM_MC_IHAVESPACEIRQPEND 0x00000020 /* mailbox irq pending: Opp. is empty */
|
||||
#define ARM_MC_OPPISEMPTYIRQPEND 0x00000040 /* mailbox irq pending */
|
||||
/* Bit 7 is unused */
|
||||
#define ARM_MC_ERRNOOWN 0x00000100 /* error : none owner read from mailbox */
|
||||
#define ARM_MC_ERROVERFLW 0x00000200 /* error : write to fill mailbox */
|
||||
#define ARM_MC_ERRUNDRFLW 0x00000400 /* error : read from empty mailbox */
|
||||
|
||||
/* Semaphore clear/debug register (...0xE0) */
|
||||
#define ARM_SD_OWN0 0x00000003 /* Owner of sem 0 */
|
||||
#define ARM_SD_OWN1 0x0000000C /* Owner of sem 1 */
|
||||
#define ARM_SD_OWN2 0x00000030 /* Owner of sem 2 */
|
||||
#define ARM_SD_OWN3 0x000000C0 /* Owner of sem 3 */
|
||||
#define ARM_SD_OWN4 0x00000300 /* Owner of sem 4 */
|
||||
#define ARM_SD_OWN5 0x00000C00 /* Owner of sem 5 */
|
||||
#define ARM_SD_OWN6 0x00003000 /* Owner of sem 6 */
|
||||
#define ARM_SD_OWN7 0x0000C000 /* Owner of sem 7 */
|
||||
#define ARM_SD_SEM0 0x00010000 /* Status of sem 0 */
|
||||
#define ARM_SD_SEM1 0x00020000 /* Status of sem 1 */
|
||||
#define ARM_SD_SEM2 0x00040000 /* Status of sem 2 */
|
||||
#define ARM_SD_SEM3 0x00080000 /* Status of sem 3 */
|
||||
#define ARM_SD_SEM4 0x00100000 /* Status of sem 4 */
|
||||
#define ARM_SD_SEM5 0x00200000 /* Status of sem 5 */
|
||||
#define ARM_SD_SEM6 0x00400000 /* Status of sem 6 */
|
||||
#define ARM_SD_SEM7 0x00800000 /* Status of sem 7 */
|
||||
|
||||
/* Doorbells clear/debug register (...0xE4) */
|
||||
#define ARM_BD_OWN0 0x00000003 /* Owner of doorbell 0 */
|
||||
#define ARM_BD_OWN1 0x0000000C /* Owner of doorbell 1 */
|
||||
#define ARM_BD_OWN2 0x00000030 /* Owner of doorbell 2 */
|
||||
#define ARM_BD_OWN3 0x000000C0 /* Owner of doorbell 3 */
|
||||
#define ARM_BD_BELL0 0x00000100 /* Status of doorbell 0 */
|
||||
#define ARM_BD_BELL1 0x00000200 /* Status of doorbell 1 */
|
||||
#define ARM_BD_BELL2 0x00000400 /* Status of doorbell 2 */
|
||||
#define ARM_BD_BELL3 0x00000800 /* Status of doorbell 3 */
|
||||
|
||||
/* MY IRQS register (...0xF8) */
|
||||
#define ARM_MYIRQ_BELL 0x00000001 /* This owner has a doorbell IRQ */
|
||||
#define ARM_MYIRQ_MAIL 0x00000002 /* This owner has a mailbox IRQ */
|
||||
|
||||
/* ALL IRQS register (...0xF8) */
|
||||
#define ARM_AIS_BELL0 0x00000001 /* Doorbell 0 IRQ pending */
|
||||
#define ARM_AIS_BELL1 0x00000002 /* Doorbell 1 IRQ pending */
|
||||
#define ARM_AIS_BELL2 0x00000004 /* Doorbell 2 IRQ pending */
|
||||
#define ARM_AIS_BELL3 0x00000008 /* Doorbell 3 IRQ pending */
|
||||
#define ARM_AIS0_HAVEDATA 0x00000010 /* MAIL 0 has data IRQ pending */
|
||||
#define ARM_AIS0_HAVESPAC 0x00000020 /* MAIL 0 has space IRQ pending */
|
||||
#define ARM_AIS0_OPPEMPTY 0x00000040 /* MAIL 0 opposite is empty IRQ */
|
||||
#define ARM_AIS1_HAVEDATA 0x00000080 /* MAIL 1 has data IRQ pending */
|
||||
#define ARM_AIS1_HAVESPAC 0x00000100 /* MAIL 1 has space IRQ pending */
|
||||
#define ARM_AIS1_OPPEMPTY 0x00000200 /* MAIL 1 opposite is empty IRQ */
|
||||
/* Note that bell-0, bell-1 and MAIL0 IRQ go only to the ARM */
|
||||
/* Whilst that bell-2, bell-3 and MAIL1 IRQ go only to the VC */
|
||||
/* */
|
||||
/* ARM JTAG BASH */
|
||||
/* */
|
||||
#define AJB_BASE 0x7e2000c0
|
||||
|
||||
#define AJBCONF HW_REGISTER_RW(AJB_BASE+0x00)
|
||||
#define AJB_BITS0 0x000000
|
||||
#define AJB_BITS4 0x000004
|
||||
#define AJB_BITS8 0x000008
|
||||
#define AJB_BITS12 0x00000C
|
||||
#define AJB_BITS16 0x000010
|
||||
#define AJB_BITS20 0x000014
|
||||
#define AJB_BITS24 0x000018
|
||||
#define AJB_BITS28 0x00001C
|
||||
#define AJB_BITS32 0x000020
|
||||
#define AJB_BITS34 0x000022
|
||||
#define AJB_OUT_MS 0x000040
|
||||
#define AJB_OUT_LS 0x000000
|
||||
#define AJB_INV_CLK 0x000080
|
||||
#define AJB_D0_RISE 0x000100
|
||||
#define AJB_D0_FALL 0x000000
|
||||
#define AJB_D1_RISE 0x000200
|
||||
#define AJB_D1_FALL 0x000000
|
||||
#define AJB_IN_RISE 0x000400
|
||||
#define AJB_IN_FALL 0x000000
|
||||
#define AJB_ENABLE 0x000800
|
||||
#define AJB_HOLD0 0x000000
|
||||
#define AJB_HOLD1 0x001000
|
||||
#define AJB_HOLD2 0x002000
|
||||
#define AJB_HOLD3 0x003000
|
||||
#define AJB_RESETN 0x004000
|
||||
#define AJB_CLKSHFT 16
|
||||
#define AJB_BUSY 0x80000000
|
||||
#define AJBTMS HW_REGISTER_RW(AJB_BASE+0x04)
|
||||
#define AJBTDI HW_REGISTER_RW(AJB_BASE+0x08)
|
||||
#define AJBTDO HW_REGISTER_RW(AJB_BASE+0x0c)
|
||||
|
||||
#define ARM_LOCAL_BASE 0x40000000
|
||||
#define ARM_LOCAL_CONTROL HW_REGISTER_RW(ARM_LOCAL_BASE+0x000)
|
||||
#define ARM_LOCAL_PRESCALER HW_REGISTER_RW(ARM_LOCAL_BASE+0x008)
|
||||
#define ARM_LOCAL_GPU_INT_ROUTING HW_REGISTER_RW(ARM_LOCAL_BASE+0x00C)
|
||||
#define ARM_LOCAL_PM_ROUTING_SET HW_REGISTER_RW(ARM_LOCAL_BASE+0x010)
|
||||
#define ARM_LOCAL_PM_ROUTING_CLR HW_REGISTER_RW(ARM_LOCAL_BASE+0x014)
|
||||
#define ARM_LOCAL_TIMER_LS HW_REGISTER_RW(ARM_LOCAL_BASE+0x01C)
|
||||
#define ARM_LOCAL_TIMER_MS HW_REGISTER_RW(ARM_LOCAL_BASE+0x020)
|
||||
#define ARM_LOCAL_INT_ROUTING HW_REGISTER_RW(ARM_LOCAL_BASE+0x024)
|
||||
#define ARM_LOCAL_AXI_COUNT HW_REGISTER_RW(ARM_LOCAL_BASE+0x02C)
|
||||
#define ARM_LOCAL_AXI_IRQ HW_REGISTER_RW(ARM_LOCAL_BASE+0x030)
|
||||
#define ARM_LOCAL_TIMER_CONTROL HW_REGISTER_RW(ARM_LOCAL_BASE+0x034)
|
||||
#define ARM_LOCAL_TIMER_WRITE HW_REGISTER_RW(ARM_LOCAL_BASE+0x038)
|
||||
|
||||
#define ARM_LOCAL_TIMER_INT_CONTROL0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x040)
|
||||
#define ARM_LOCAL_TIMER_INT_CONTROL1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x044)
|
||||
#define ARM_LOCAL_TIMER_INT_CONTROL2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x048)
|
||||
#define ARM_LOCAL_TIMER_INT_CONTROL3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x04C)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX_INT_CONTROL0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x050)
|
||||
#define ARM_LOCAL_MAILBOX_INT_CONTROL1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x054)
|
||||
#define ARM_LOCAL_MAILBOX_INT_CONTROL2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x058)
|
||||
#define ARM_LOCAL_MAILBOX_INT_CONTROL3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x05C)
|
||||
|
||||
#define ARM_LOCAL_IRQ_PENDING0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x060)
|
||||
#define ARM_LOCAL_IRQ_PENDING1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x064)
|
||||
#define ARM_LOCAL_IRQ_PENDING2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x068)
|
||||
#define ARM_LOCAL_IRQ_PENDING3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x06C)
|
||||
|
||||
#define ARM_LOCAL_FIQ_PENDING0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x070)
|
||||
#define ARM_LOCAL_FIQ_PENDING1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x074)
|
||||
#define ARM_LOCAL_FIQ_PENDING2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x078)
|
||||
#define ARM_LOCAL_FIQ_PENDING3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x07C)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX0_SET0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x080)
|
||||
#define ARM_LOCAL_MAILBOX1_SET0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x084)
|
||||
#define ARM_LOCAL_MAILBOX2_SET0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x088)
|
||||
#define ARM_LOCAL_MAILBOX3_SET0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x08C)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX0_SET1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x090)
|
||||
#define ARM_LOCAL_MAILBOX1_SET1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x094)
|
||||
#define ARM_LOCAL_MAILBOX2_SET1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x098)
|
||||
#define ARM_LOCAL_MAILBOX3_SET1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x09C)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX0_SET2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0A0)
|
||||
#define ARM_LOCAL_MAILBOX1_SET2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0A4)
|
||||
#define ARM_LOCAL_MAILBOX2_SET2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0A8)
|
||||
#define ARM_LOCAL_MAILBOX3_SET2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0AC)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX0_SET3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0B0)
|
||||
#define ARM_LOCAL_MAILBOX1_SET3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0B4)
|
||||
#define ARM_LOCAL_MAILBOX2_SET3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0B8)
|
||||
#define ARM_LOCAL_MAILBOX3_SET3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0BC)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX0_CLR0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0C0)
|
||||
#define ARM_LOCAL_MAILBOX1_CLR0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0C4)
|
||||
#define ARM_LOCAL_MAILBOX2_CLR0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0C8)
|
||||
#define ARM_LOCAL_MAILBOX3_CLR0 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0CC)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX0_CLR1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0D0)
|
||||
#define ARM_LOCAL_MAILBOX1_CLR1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0D4)
|
||||
#define ARM_LOCAL_MAILBOX2_CLR1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0D8)
|
||||
#define ARM_LOCAL_MAILBOX3_CLR1 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0DC)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX0_CLR2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0E0)
|
||||
#define ARM_LOCAL_MAILBOX1_CLR2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0E4)
|
||||
#define ARM_LOCAL_MAILBOX2_CLR2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0E8)
|
||||
#define ARM_LOCAL_MAILBOX3_CLR2 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0EC)
|
||||
|
||||
#define ARM_LOCAL_MAILBOX0_CLR3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0F0)
|
||||
#define ARM_LOCAL_MAILBOX1_CLR3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0F4)
|
||||
#define ARM_LOCAL_MAILBOX2_CLR3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0F8)
|
||||
#define ARM_LOCAL_MAILBOX3_CLR3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0FC)
|
||||
|
||||
#endif
|
||||
62
arch/arm/mach-bcm2709/include/mach/arm_power.h
Normal file
62
arch/arm/mach-bcm2709/include/mach/arm_power.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-bcm2708/include/mach/arm_power.h
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ARM_POWER_H
|
||||
#define _ARM_POWER_H
|
||||
|
||||
/* Use meaningful names on each side */
|
||||
#ifdef __VIDEOCORE__
|
||||
#define PREFIX(x) ARM_##x
|
||||
#else
|
||||
#define PREFIX(x) BCM_##x
|
||||
#endif
|
||||
|
||||
enum {
|
||||
PREFIX(POWER_SDCARD_BIT),
|
||||
PREFIX(POWER_UART_BIT),
|
||||
PREFIX(POWER_MINIUART_BIT),
|
||||
PREFIX(POWER_USB_BIT),
|
||||
PREFIX(POWER_I2C0_BIT),
|
||||
PREFIX(POWER_I2C1_BIT),
|
||||
PREFIX(POWER_I2C2_BIT),
|
||||
PREFIX(POWER_SPI_BIT),
|
||||
PREFIX(POWER_CCP2TX_BIT),
|
||||
PREFIX(POWER_DSI_BIT),
|
||||
|
||||
PREFIX(POWER_MAX)
|
||||
};
|
||||
|
||||
enum {
|
||||
PREFIX(POWER_SDCARD) = (1 << PREFIX(POWER_SDCARD_BIT)),
|
||||
PREFIX(POWER_UART) = (1 << PREFIX(POWER_UART_BIT)),
|
||||
PREFIX(POWER_MINIUART) = (1 << PREFIX(POWER_MINIUART_BIT)),
|
||||
PREFIX(POWER_USB) = (1 << PREFIX(POWER_USB_BIT)),
|
||||
PREFIX(POWER_I2C0) = (1 << PREFIX(POWER_I2C0_BIT)),
|
||||
PREFIX(POWER_I2C1_MASK) = (1 << PREFIX(POWER_I2C1_BIT)),
|
||||
PREFIX(POWER_I2C2_MASK) = (1 << PREFIX(POWER_I2C2_BIT)),
|
||||
PREFIX(POWER_SPI_MASK) = (1 << PREFIX(POWER_SPI_BIT)),
|
||||
PREFIX(POWER_CCP2TX_MASK) = (1 << PREFIX(POWER_CCP2TX_BIT)),
|
||||
PREFIX(POWER_DSI) = (1 << PREFIX(POWER_DSI_BIT)),
|
||||
|
||||
PREFIX(POWER_MASK) = (1 << PREFIX(POWER_MAX)) - 1,
|
||||
PREFIX(POWER_NONE) = 0
|
||||
};
|
||||
|
||||
#endif
|
||||
3
arch/arm/mach-bcm2709/include/mach/barriers.h
Normal file
3
arch/arm/mach-bcm2709/include/mach/barriers.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#define mb() dsb()
|
||||
#define rmb() dsb()
|
||||
#define wmb() mb()
|
||||
7
arch/arm/mach-bcm2709/include/mach/clkdev.h
Normal file
7
arch/arm/mach-bcm2709/include/mach/clkdev.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef __ASM_MACH_CLKDEV_H
|
||||
#define __ASM_MACH_CLKDEV_H
|
||||
|
||||
#define __clk_get(clk) ({ 1; })
|
||||
#define __clk_put(clk) do { } while (0)
|
||||
|
||||
#endif
|
||||
22
arch/arm/mach-bcm2709/include/mach/debug-macro.S
Normal file
22
arch/arm/mach-bcm2709/include/mach/debug-macro.S
Normal file
@@ -0,0 +1,22 @@
|
||||
/* arch/arm/mach-bcm2708/include/mach/debug-macro.S
|
||||
*
|
||||
* Debugging macro include header
|
||||
*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
* Copyright (C) 1994-1999 Russell King
|
||||
* Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <mach/platform.h>
|
||||
|
||||
.macro addruart, rp, rv, tmp
|
||||
ldr \rp, =UART0_BASE
|
||||
ldr \rv, =IO_ADDRESS(UART0_BASE)
|
||||
.endm
|
||||
|
||||
#include <debug/pl01x.S>
|
||||
2
arch/arm/mach-bcm2709/include/mach/dma.h
Normal file
2
arch/arm/mach-bcm2709/include/mach/dma.h
Normal file
@@ -0,0 +1,2 @@
|
||||
/* This file can be removed when all the drivers have been updated */
|
||||
#include <linux/platform_data/dma-bcm2708.h>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user