diff --git a/.gitignore b/.gitignore index 24a9643d..e90a97b5 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ libshared.a *.a dump.dtb fs +dump +*.cfg diff --git a/Makefile b/Makefile index 5cdc133f..d9cd5455 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,37 @@ -MODE ?= virt -LOAD_ADDR ?= 0x41000000 +#top make +ARCH ?= aarch64-none-elf +CC := $(ARCH)-gcc +LD := $(ARCH)-ld +AR := $(ARCH)-ar +OBJCOPY := $(ARCH)-objcopy -.PHONY: all kernel user shared clean raspi virt run debug +#common flags +CFLAGS_BASE ?= -g -O0 -std=c17 -nostdlib -ffreestanding \ + -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables \ + -Wall -Wextra -mcpu=cortex-a72 +LDFLAGS_BASE ?= + +#build vars +LOAD_ADDR ?= 0x41000000 +XHCI_CTX_SIZE ?= 32 +QEMU ?= true +MODE ?= virt + +#export +export ARCH CC LD AR OBJCOPY CFLAGS_BASE LDFLAGS_BASE LOAD_ADDR XHCI_CTX_SIZE QEMU + +#config filesystem +OS := $(shell uname) +FS_DIRS := fs/redos/user + +ifeq ($(OS),Darwin) +BOOTFS := /Volumes/bootfs +else +BOOTFS := /media/bootfs +endif + +#targets +.PHONY: all shared user kernel clean raspi virt run debug dump prepare-fs help install all: shared user kernel @echo "Build complete." @@ -10,27 +40,58 @@ all: shared user kernel shared: $(MAKE) -C shared -user: +user: prepare-fs $(MAKE) -C user kernel: - $(MAKE) -C kernel LOAD_ADDR=$(LOAD_ADDR) + $(MAKE) -C kernel LOAD_ADDR=$(LOAD_ADDR) XHCI_CTX_SIZE=$(XHCI_CTX_SIZE) QEMU=$(QEMU) clean: $(MAKE) -C shared clean + $(MAKE) -C user clean $(MAKE) -C kernel clean - $(MAKE) -C user clean + @echo "removing fs dirs" + rm -rf $(FS_DIRS) + @echo "removing images" + rm -f kernel.img kernel.elf disk.img dump raspi: - $(MAKE) LOAD_ADDR=0x80000 all + $(MAKE) LOAD_ADDR=0x80000 XHCI_CTX_SIZE=64 QEMU=true all virt: - $(MAKE) LOAD_ADDR=0x41000000 all + $(MAKE) LOAD_ADDR=0x41000000 XHCI_CTX_SIZE=32 QEMU=true all + +run: + $(MAKE) $(MODE) + ./run_$(MODE) debug: $(MAKE) $(MODE) ./rundebug MODE=$(MODE) $(ARGS) + +dump: + $(OBJCOPY) -O binary kernel.elf kernel.img + aarch64-none-elf-objdump -D kernel.elf > dump + +install: + $(MAKE) clean + $(MAKE) LOAD_ADDR=0x80000 XHCI_CTX_SIZE=64 QEMU=false all + cp kernel.img $(BOOTFS)/kernel8.img + cp kernel.img $(BOOTFS)/kernel_2712.img + cp config.txt $(BOOTFS)/config.txt -run: - $(MAKE) $(MODE) - ./run_$(MODE) \ No newline at end of file +prepare-fs: + @echo "creating dirs" + @mkdir -p $(FS_DIRS) + +help: + @printf "usage:\n\ + make all build the os\n\ + make clean remove all build artifacts\n\ + make raspi build for raspberry\n\ + make virt build for qemu virt board\n\ + make run build and run in virt mode\n\ + make debug build and run with debugger\n\ + make dump disassemble kernel.elf\n\ + make install create raspi kernel and mount it on a bootable partition\n\ + make prepare-fs create directories for the filesystem\n\n" diff --git a/README.md b/README.md index e4a39eb0..d8408208 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ ## Summary The REDACTED Operating System is a 64 bit operating system meant to run on ARM processors. -It currently runs entirely in QEMU, either in an entirely virtual machine using QEMU's `virt` board, or emulating a Raspberry Pi 4B. It currently most likely will not work on real hardware (not on the raspi 5 anyway, haven't tested on a 4B) +It can run entirely in QEMU, either in an entirely virtual machine using QEMU's `virt` board, or emulating a Raspberry Pi 4B. +It also has preliminary support for the Raspberry Pi 5, and possibly 4B and 3B, though these last two are largely untested. Its GUI is heavily inspired by video game consoles, and the OS is entirely controllable via keyboard (with future mouse and possibly gamepad support) It has limited support for third party processes, currently limited to entirely self-contained programs. The `shared` library is provided for syscalls and common functions but it should be used as a static library embedded into the final executable `.elf` file. @@ -53,7 +54,7 @@ In addition to the code located in the system's 3 main folders, a few other file - debug: attaches gdb to an instance of QEMU running REDACTED OS. The instance must be run with the `debug` argument as `./run debug` in order for gdb to attach and control its execution. It can support automatically running a command inside gdb such as adding a breakpoint by passing it as an argument as `./debug b kernel_main` - rundebug: a shortcut for running both the `run` and `debug` commands. It can pass arguments for the debug command, which in turn will pass them to gdb - createfs: creates a filesystem image for the system to read. The image does not contain kernel code and is not used to boot the system, but is still required to boot the system, and contains user processes. The script is written specifically for macOS, as it relies on the diskutil commands to create the image. There isn't a linux or windows version for it, but a filesystem image can be created manually and placed in the root directory with the name disk.img -- Makefile: can compile and run the system. `make run` compiles the system for the virt board, passing MODE=virt/raspi specifies which board to compile for. It creates the filesystem image and executes the correct `./run` command. `make debug` compiles the system, creates the filesystem and executes the OS and gdb, through the `./rundebug` command. `make all` simply compiles and creates the filesystem image. `make clean` cleans compiled files. +- Makefile: can compile and run the system. `make run` compiles the system for the virt board, passing MODE=virt/raspi specifies which board to compile for, default is virt. It creates the filesystem image and executes the correct `./run` command. `make debug` compiles the system, creates the filesystem and executes the OS and gdb, through the `./rundebug` command. `make all` simply compiles and creates the filesystem image. `make clean` cleans compiled files. The `make install` command performs a clean build and attempts to install onto a raspberry-pi-formatted sd card in its `bootfs` partition. ## Compiling @@ -62,6 +63,7 @@ The OS currently only runs on QEMU, so QEMU needs to be installed as well. The s Running `make run` or `make all` followed by `./run` is the fastest way to run the system, using the default configuration (virt board for QEMU). Further explanations on these commands and their options provided in the Supporting Files section. Running `make run MODE=virt/raspi` can select which board to compile the code for. In order to run the OS, you'll need to create a folder called fs inside the project's root directory. This folder will contain user processes. It must have the following subfolders: /redos/user/, with user processes placed inside with the .elf extension. The `user` process will automatically be placed in that folder when compiling. A script called `createfs` will run automatically to create an image from the fs folder. This script currently only works on MacOS and Linux host systems, it will need to be adapted to run on Windows systems. Since my main host system is Mac, there's a chance the linux version won't be up to date if any changes need to be made. +Running `make install` will perform a clean build for the raspberry pi and copy the resulting kernel image and the provided `config.txt` file to a partition called `bootfs`, which should be created using Raspberry Pi Imager on an SD card. It should be possible to then boot the system onto a Raspberry Pi 5, 4B or 3B, although support may be limited. It is recommended to use a UART debug probe along with the `screen` command running on the development machine to see the system's console output and debug potential issues. Github Actions should automatically compile changes made to the `main` branch using Mac, so a compiled version of the system with all the files needed to run it should be found there. This includes the fs folder, containing the filesystem, but you'll need to recompile the `disk.img` filesystem with `createfs` for any changes made to this folder to be reflected. Currently it only builds a version for the virt board. diff --git a/config.txt b/config.txt new file mode 100755 index 00000000..114b8016 --- /dev/null +++ b/config.txt @@ -0,0 +1,55 @@ +# For more options and information see +# http://rptl.io/configtxt +# Some settings may impact device functionality. See link above for details + +# Uncomment some or all of these to enable the optional hardware interfaces +#dtparam=i2c_arm=on +#dtparam=i2s=on +#dtparam=spi=on + +# Enable audio (loads snd_bcm2835) +dtparam=audio=on + +# Additional overlays and parameters are documented +# /boot/firmware/overlays/README + +# Automatically load overlays for detected cameras +camera_auto_detect=1 + +# Automatically load overlays for detected DSI displays +display_auto_detect=1 + +# Automatically load initramfs files, if found +auto_initramfs=1 + +# Enable DRM VC4 V3D driver +dtoverlay=vc4-kms-v3d +max_framebuffers=2 + +# Don't have the firmware create an initial video= setting in cmdline.txt. +# Use the kernel's default instead. +disable_fw_kms_setup=1 + +# Run in 64-bit mode +arm_64bit=1 + +# Disable compensation for displays with overscan +disable_overscan=1 + +# Run as fast as firmware / board allows +arm_boost=1 + +pciex4_reset=0 + +[cm4] +# Enable host mode on the 2711 built-in XHCI USB controller. +# This line should be removed if the legacy DWC2 controller is required +# (e.g. for USB device mode) or if USB support is not required. +otg_mode=1 + +[cm5] +#dtoverlay=dwc2,dr_mode=host + +[all] +gpu_mem=512 +framebuffer_depth=32 \ No newline at end of file diff --git a/dtbs/rpi4b.dts b/dtbs/rpi4b.dts new file mode 100644 index 00000000..dd52906a --- /dev/null +++ b/dtbs/rpi4b.dts @@ -0,0 +1,2728 @@ +/dts-v1/; + +/memreserve/ 0x0000000000000000 0x0000000000001000; +/ { + compatible = "raspberrypi,4-model-b", "brcm,bcm2711"; + model = "Raspberry Pi 4 Model B"; + #address-cells = <0x02>; + #size-cells = <0x01>; + interrupt-parent = <0x01>; + + aliases { + serial0 = "/soc/serial@7e215040"; + serial1 = "/soc/serial@7e201000"; + emmc2bus = "/emmc2bus"; + ethernet0 = "/scb/ethernet@7d580000"; + pcie0 = "/scb/pcie@7d500000"; + blconfig = "/reserved-memory/nvram@0"; + blpubkey = "/reserved-memory/nvram@1"; + bluetooth = "/soc/serial@7e201000/bluetooth"; + aux = "/soc/aux@7e215000"; + sound = "/soc/sound"; + soc = "/soc"; + dma = "/soc/dma-controller@7e007000"; + watchdog = "/soc/watchdog@7e100000"; + random = "/soc/rng@7e104000"; + mailbox = "/soc/mailbox@7e00b880"; + gpio = "/soc/gpio@7e200000"; + uart0 = "/soc/serial@7e201000"; + uart1 = "/soc/serial@7e215040"; + sdhost = "/soc/mmc@7e202000"; + mmc = "/soc/mmc@7e300000"; + mmc1 = "/soc/mmcnr@7e300000"; + mmc0 = "/emmc2bus/mmc@7e340000"; + i2s = "/soc/i2s@7e203000"; + i2c0 = "/soc/i2c0mux/i2c@0"; + i2c1 = "/soc/i2c@7e804000"; + i2c10 = "/soc/i2c0mux/i2c@1"; + i2c = "/soc/i2c@7e804000"; + spi0 = "/soc/spi@7e204000"; + spi1 = "/soc/spi@7e215080"; + spi2 = "/soc/spi@7e2150c0"; + usb = "/soc/usb@7e980000"; + leds = "/leds"; + fb = "/soc/fb"; + thermal = "/soc/avs-monitor@7d5d2000/thermal"; + axiperf = "/soc/axiperf"; + uart2 = "/soc/serial@7e201400"; + uart3 = "/soc/serial@7e201600"; + uart4 = "/soc/serial@7e201800"; + uart5 = "/soc/serial@7e201a00"; + serial2 = "/soc/serial@7e201400"; + serial3 = "/soc/serial@7e201600"; + serial4 = "/soc/serial@7e201800"; + serial5 = "/soc/serial@7e201a00"; + mmc2 = "/soc/mmc@7e202000"; + i2c3 = "/soc/i2c@7e205600"; + i2c4 = "/soc/i2c@7e205800"; + i2c5 = "/soc/i2c@7e205a00"; + i2c6 = "/soc/i2c@7e205c00"; + i2c20 = "/soc/i2c@7ef04500"; + i2c21 = "/soc/i2c@7ef09500"; + spi3 = "/soc/spi@7e204600"; + spi4 = "/soc/spi@7e204800"; + spi5 = "/soc/spi@7e204a00"; + spi6 = "/soc/spi@7e204c00"; + phandle = <0x4f>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0"; + phandle = <0x54>; + }; + + reserved-memory { + #address-cells = <0x02>; + #size-cells = <0x01>; + ranges; + phandle = <0x5c>; + + linux,cma { + compatible = "shared-dma-pool"; + size = <0x4000000>; + reusable; + linux,cma-default; + alloc-ranges = <0x00 0x00 0x30000000>; + phandle = <0x5d>; + }; + + nvram@0 { + compatible = "raspberrypi,bootloader-config", "nvmem-rmem"; + #address-cells = <0x01>; + #size-cells = <0x01>; + reg = <0x00 0x00 0x00>; + no-map; + status = "disabled"; + phandle = <0x5e>; + }; + + nvram@1 { + compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem"; + #address-cells = <0x01>; + #size-cells = <0x01>; + reg = <0x00 0x00 0x00>; + no-map; + status = "disabled"; + phandle = <0x5f>; + }; + }; + + thermal-zones { + + cpu-thermal { + polling-delay-passive = <0x00>; + polling-delay = <0x3e8>; + coefficients = <0xfffffe19 0x641b8>; + thermal-sensors = <0x02>; + phandle = <0x60>; + + trips { + phandle = <0x61>; + + cpu-crit { + temperature = <0x1adb0>; + hysteresis = <0x00>; + type = "critical"; + }; + }; + + cooling-maps { + phandle = <0x62>; + }; + }; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x01>; + ranges = <0x7e000000 0x00 0xfe000000 0x1800000 0x7c000000 0x00 0xfc000000 0x2000000 0x40000000 0x00 0xff800000 0x800000>; + dma-ranges = <0xc0000000 0x00 0x00 0x40000000 0x7c000000 0x00 0xfc000000 0x3800000>; + phandle = <0x63>; + + timer@7e003000 { + compatible = "brcm,bcm2835-system-timer"; + reg = <0x7e003000 0x1000>; + interrupts = <0x00 0x40 0x04 0x00 0x41 0x04 0x00 0x42 0x04 0x00 0x43 0x04>; + clock-frequency = <0xf4240>; + status = "disabled"; + phandle = <0x64>; + }; + + txp@7e004000 { + compatible = "brcm,bcm2835-txp"; + reg = <0x7e004000 0x20>; + interrupts = <0x00 0x4b 0x04>; + status = "disabled"; + phandle = <0x65>; + }; + + cprman@7e101000 { + compatible = "brcm,bcm2711-cprman"; + #clock-cells = <0x01>; + reg = <0x7e101000 0x2000>; + clocks = <0x03 0x04 0x00 0x04 0x01 0x04 0x02 0x05 0x00 0x05 0x01 0x05 0x02>; + firmware = <0x06>; + phandle = <0x08>; + }; + + mailbox@7e00b880 { + compatible = "brcm,bcm2835-mbox"; + reg = <0x7e00b880 0x40>; + interrupts = <0x00 0x21 0x04>; + #mbox-cells = <0x00>; + phandle = <0x31>; + }; + + gpio@7e200000 { + compatible = "brcm,bcm2711-gpio"; + reg = <0x7e200000 0xb4>; + interrupts = <0x00 0x71 0x04 0x00 0x72 0x04>; + gpio-controller; + #gpio-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x02>; + gpio-ranges = <0x07 0x00 0x00 0x3a>; + gpio-line-names = "ID_SDA", "ID_SCL", "GPIO2", "GPIO3", "GPIO4", "GPIO5", "GPIO6", "GPIO7", "GPIO8", "GPIO9", "GPIO10", "GPIO11", "GPIO12", "GPIO13", "GPIO14", "GPIO15", "GPIO16", "GPIO17", "GPIO18", "GPIO19", "GPIO20", "GPIO21", "GPIO22", "GPIO23", "GPIO24", "GPIO25", "GPIO26", "GPIO27", "RGMII_MDIO", "RGMIO_MDC", "CTS0", "RTS0", "TXD0", "RXD0", "SD1_CLK", "SD1_CMD", "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3", "PWM0_MISO", "PWM1_MOSI", "STATUS_LED_G_CLK", "SPIFLASH_CE_N", "SDA0", "SCL0", "RGMII_RXCLK", "RGMII_RXCTL", "RGMII_RXD0", "RGMII_RXD1", "RGMII_RXD2", "RGMII_RXD3", "RGMII_TXCLK", "RGMII_TXCTL", "RGMII_TXD0", "RGMII_TXD1", "RGMII_TXD2", "RGMII_TXD3"; + phandle = <0x07>; + + dpi-gpio0 { + brcm,pins = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b>; + brcm,function = <0x06>; + phandle = <0x66>; + }; + + emmc-gpio22 { + brcm,pins = <0x16 0x17 0x18 0x19 0x1a 0x1b>; + brcm,function = <0x07>; + phandle = <0x67>; + }; + + emmc-gpio34 { + brcm,pins = <0x22 0x23 0x24 0x25 0x26 0x27>; + brcm,function = <0x07>; + brcm,pull = <0x00 0x02 0x02 0x02 0x02 0x02>; + phandle = <0x68>; + }; + + emmc-gpio48 { + brcm,pins = <0x30 0x31 0x32 0x33 0x34 0x35>; + brcm,function = <0x07>; + phandle = <0x13>; + }; + + gpclk0-gpio4 { + brcm,pins = <0x04>; + brcm,function = <0x04>; + phandle = <0x69>; + }; + + gpclk1-gpio5 { + brcm,pins = <0x05>; + brcm,function = <0x04>; + phandle = <0x6a>; + }; + + gpclk1-gpio42 { + brcm,pins = <0x2a>; + brcm,function = <0x04>; + phandle = <0x6b>; + }; + + gpclk1-gpio44 { + brcm,pins = <0x2c>; + brcm,function = <0x04>; + phandle = <0x6c>; + }; + + gpclk2-gpio6 { + brcm,pins = <0x06>; + brcm,function = <0x04>; + phandle = <0x6d>; + }; + + gpclk2-gpio43 { + brcm,pins = <0x2b>; + brcm,function = <0x04>; + brcm,pull = <0x00>; + phandle = <0x6e>; + }; + + i2c0if-gpio0 { + brcm,pins = <0x00 0x01>; + brcm,function = <0x04>; + phandle = <0x35>; + }; + + i2c0if-gpio28 { + brcm,pins = <0x1c 0x1d>; + brcm,function = <0x04>; + phandle = <0x6f>; + }; + + i2c0if-gpio44 { + brcm,pins = <0x2c 0x2d>; + brcm,function = <0x05>; + phandle = <0x36>; + }; + + i2c1-gpio2 { + brcm,pins = <0x02 0x03>; + brcm,function = <0x04>; + phandle = <0x70>; + }; + + i2c1-gpio44 { + brcm,pins = <0x2c 0x2d>; + brcm,function = <0x06>; + phandle = <0x71>; + }; + + jtag-gpio22 { + brcm,pins = <0x16 0x17 0x18 0x19 0x1a 0x1b>; + brcm,function = <0x03>; + phandle = <0x72>; + }; + + pcm-gpio18 { + brcm,pins = <0x12 0x13 0x14 0x15>; + brcm,function = <0x04>; + phandle = <0x73>; + }; + + pcm-gpio28 { + brcm,pins = <0x1c 0x1d 0x1e 0x1f>; + brcm,function = <0x06>; + phandle = <0x74>; + }; + + sdhost-gpio48 { + brcm,pins = <0x30 0x31 0x32 0x33 0x34 0x35>; + brcm,function = <0x04>; + phandle = <0x75>; + }; + + spi0-gpio7 { + brcm,pins = <0x07 0x08 0x09 0x0a 0x0b>; + brcm,function = <0x04>; + phandle = <0x76>; + }; + + spi0-gpio35 { + brcm,pins = <0x23 0x24 0x25 0x26 0x27>; + brcm,function = <0x04>; + phandle = <0x77>; + }; + + spi1-gpio16 { + brcm,pins = <0x10 0x11 0x12 0x13 0x14 0x15>; + brcm,function = <0x03>; + phandle = <0x78>; + }; + + spi2-gpio40 { + brcm,pins = <0x28 0x29 0x2a 0x2b 0x2c 0x2d>; + brcm,function = <0x03>; + phandle = <0x79>; + }; + + uart0-gpio14 { + brcm,pins = <0x0e 0x0f>; + brcm,function = <0x04>; + phandle = <0x7a>; + }; + + uart0-ctsrts-gpio16 { + brcm,pins = <0x10 0x11>; + brcm,function = <0x07>; + phandle = <0x7b>; + }; + + uart0-ctsrts-gpio30 { + brcm,pins = <0x1e 0x1f>; + brcm,function = <0x07>; + brcm,pull = <0x02 0x00>; + phandle = <0x7c>; + }; + + uart0-gpio32 { + brcm,pins = <0x20 0x21>; + brcm,function = <0x07>; + brcm,pull = <0x00 0x02>; + phandle = <0x7d>; + }; + + uart0-gpio36 { + brcm,pins = <0x24 0x25>; + brcm,function = <0x06>; + phandle = <0x7e>; + }; + + uart0-ctsrts-gpio38 { + brcm,pins = <0x26 0x27>; + brcm,function = <0x06>; + phandle = <0x7f>; + }; + + uart1-gpio14 { + brcm,pins = <0x0e 0x0f>; + brcm,function = <0x02>; + phandle = <0x80>; + }; + + uart1-ctsrts-gpio16 { + brcm,pins = <0x10 0x11>; + brcm,function = <0x02>; + phandle = <0x81>; + }; + + uart1-gpio32 { + brcm,pins = <0x20 0x21>; + brcm,function = <0x02>; + phandle = <0x82>; + }; + + uart1-ctsrts-gpio30 { + brcm,pins = <0x1e 0x1f>; + brcm,function = <0x02>; + phandle = <0x83>; + }; + + uart1-gpio40 { + brcm,pins = <0x28 0x29>; + brcm,function = <0x02>; + phandle = <0x84>; + }; + + uart1-ctsrts-gpio42 { + brcm,pins = <0x2a 0x2b>; + brcm,function = <0x02>; + phandle = <0x85>; + }; + + gpclk0-gpio49 { + phandle = <0x86>; + + pin-gpclk { + pins = "gpio49"; + function = "alt1"; + bias-disable; + }; + }; + + gpclk1-gpio50 { + phandle = <0x87>; + + pin-gpclk { + pins = "gpio50"; + function = "alt1"; + bias-disable; + }; + }; + + gpclk2-gpio51 { + phandle = <0x88>; + + pin-gpclk { + pins = "gpio51"; + function = "alt1"; + bias-disable; + }; + }; + + i2c0if-gpio46 { + phandle = <0x89>; + + pin-sda { + function = "alt0"; + pins = "gpio46"; + bias-pull-up; + }; + + pin-scl { + function = "alt0"; + pins = "gpio47"; + bias-disable; + }; + }; + + i2c1-gpio46 { + phandle = <0x8a>; + + pin-sda { + function = "alt1"; + pins = "gpio46"; + bias-pull-up; + }; + + pin-scl { + function = "alt1"; + pins = "gpio47"; + bias-disable; + }; + }; + + i2c3-gpio2 { + phandle = <0x8b>; + + pin-sda { + function = "alt5"; + pins = "gpio2"; + bias-pull-up; + }; + + pin-scl { + function = "alt5"; + pins = "gpio3"; + bias-disable; + }; + }; + + i2c3-gpio4 { + phandle = <0x8c>; + + pin-sda { + function = "alt5"; + pins = "gpio4"; + bias-pull-up; + }; + + pin-scl { + function = "alt5"; + pins = "gpio5"; + bias-disable; + }; + }; + + i2c4-gpio6 { + phandle = <0x8d>; + + pin-sda { + function = "alt5"; + pins = "gpio6"; + bias-pull-up; + }; + + pin-scl { + function = "alt5"; + pins = "gpio7"; + bias-disable; + }; + }; + + i2c4-gpio8 { + phandle = <0x8e>; + + pin-sda { + function = "alt5"; + pins = "gpio8"; + bias-pull-up; + }; + + pin-scl { + function = "alt5"; + pins = "gpio9"; + bias-disable; + }; + }; + + i2c5-gpio10 { + phandle = <0x8f>; + + pin-sda { + function = "alt5"; + pins = "gpio10"; + bias-pull-up; + }; + + pin-scl { + function = "alt5"; + pins = "gpio11"; + bias-disable; + }; + }; + + i2c5-gpio12 { + phandle = <0x90>; + + pin-sda { + function = "alt5"; + pins = "gpio12"; + bias-pull-up; + }; + + pin-scl { + function = "alt5"; + pins = "gpio13"; + bias-disable; + }; + }; + + i2c6-gpio0 { + phandle = <0x91>; + + pin-sda { + function = "alt5"; + pins = "gpio0"; + bias-pull-up; + }; + + pin-scl { + function = "alt5"; + pins = "gpio1"; + bias-disable; + }; + }; + + i2c6-gpio22 { + phandle = <0x92>; + + pin-sda { + function = "alt5"; + pins = "gpio22"; + bias-pull-up; + }; + + pin-scl { + function = "alt5"; + pins = "gpio23"; + bias-disable; + }; + }; + + i2c-slave-gpio8 { + phandle = <0x93>; + + pins-i2c-slave { + pins = "gpio8", "gpio9", "gpio10", "gpio11"; + function = "alt3"; + }; + }; + + jtag-gpio48 { + phandle = <0x94>; + + pins-jtag { + pins = "gpio48", "gpio49", "gpio50", "gpio51", "gpio52", "gpio53"; + function = "alt4"; + }; + }; + + mii-gpio28 { + phandle = <0x95>; + + pins-mii { + pins = "gpio28", "gpio29", "gpio30", "gpio31"; + function = "alt4"; + }; + }; + + mii-gpio36 { + phandle = <0x96>; + + pins-mii { + pins = "gpio36", "gpio37", "gpio38", "gpio39"; + function = "alt5"; + }; + }; + + pcm-gpio50 { + phandle = <0x97>; + + pins-pcm { + pins = "gpio50", "gpio51", "gpio52", "gpio53"; + function = "alt2"; + }; + }; + + pwm0-0-gpio12 { + phandle = <0x98>; + + pin-pwm { + pins = "gpio12"; + function = "alt0"; + bias-disable; + }; + }; + + pwm0-0-gpio18 { + phandle = <0x99>; + + pin-pwm { + pins = "gpio18"; + function = "alt5"; + bias-disable; + }; + }; + + pwm1-0-gpio40 { + phandle = <0x28>; + + pin-pwm { + pins = "gpio40"; + function = "alt0"; + bias-disable; + }; + }; + + pwm0-1-gpio13 { + phandle = <0x9a>; + + pin-pwm { + pins = "gpio13"; + function = "alt0"; + bias-disable; + }; + }; + + pwm0-1-gpio19 { + phandle = <0x9b>; + + pin-pwm { + pins = "gpio19"; + function = "alt5"; + bias-disable; + }; + }; + + pwm1-1-gpio41 { + phandle = <0x29>; + + pin-pwm { + pins = "gpio41"; + function = "alt0"; + bias-disable; + }; + }; + + pwm0-1-gpio45 { + phandle = <0x9c>; + + pin-pwm { + pins = "gpio45"; + function = "alt0"; + bias-disable; + }; + }; + + pwm0-0-gpio52 { + phandle = <0x9d>; + + pin-pwm { + pins = "gpio52"; + function = "alt1"; + bias-disable; + }; + }; + + pwm0-1-gpio53 { + phandle = <0x9e>; + + pin-pwm { + pins = "gpio53"; + function = "alt1"; + bias-disable; + }; + }; + + rgmii-gpio35 { + phandle = <0x9f>; + + pin-start-stop { + pins = "gpio35"; + function = "alt4"; + }; + + pin-rx-ok { + pins = "gpio36"; + function = "alt4"; + }; + }; + + rgmii-irq-gpio34 { + phandle = <0xa0>; + + pin-irq { + pins = "gpio34"; + function = "alt5"; + }; + }; + + rgmii-irq-gpio39 { + phandle = <0xa1>; + + pin-irq { + pins = "gpio39"; + function = "alt4"; + }; + }; + + rgmii-mdio-gpio28 { + phandle = <0xa2>; + + pins-mdio { + pins = "gpio28", "gpio29"; + function = "alt5"; + }; + }; + + rgmii-mdio-gpio37 { + phandle = <0xa3>; + + pins-mdio { + pins = "gpio37", "gpio38"; + function = "alt4"; + }; + }; + + spi0-gpio46 { + phandle = <0xa4>; + + pins-spi { + pins = "gpio46", "gpio47", "gpio48", "gpio49"; + function = "alt2"; + }; + }; + + spi2-gpio46 { + phandle = <0xa5>; + + pins-spi { + pins = "gpio46", "gpio47", "gpio48", "gpio49", "gpio50"; + function = "alt5"; + }; + }; + + spi3-gpio0 { + phandle = <0xa6>; + + pins-spi { + pins = "gpio0", "gpio1", "gpio2", "gpio3"; + function = "alt3"; + }; + }; + + spi4-gpio4 { + phandle = <0xa7>; + + pins-spi { + pins = "gpio4", "gpio5", "gpio6", "gpio7"; + function = "alt3"; + }; + }; + + spi5-gpio12 { + phandle = <0xa8>; + + pins-spi { + pins = "gpio12", "gpio13", "gpio14", "gpio15"; + function = "alt3"; + }; + }; + + spi6-gpio18 { + phandle = <0xa9>; + + pins-spi { + pins = "gpio18", "gpio19", "gpio20", "gpio21"; + function = "alt3"; + }; + }; + + uart2-gpio0 { + phandle = <0xaa>; + + pin-tx { + pins = "gpio0"; + function = "alt4"; + bias-disable; + }; + + pin-rx { + pins = "gpio1"; + function = "alt4"; + bias-pull-up; + }; + }; + + uart2-ctsrts-gpio2 { + phandle = <0xab>; + + pin-cts { + pins = "gpio2"; + function = "alt4"; + bias-pull-up; + }; + + pin-rts { + pins = "gpio3"; + function = "alt4"; + bias-disable; + }; + }; + + uart3-gpio4 { + phandle = <0xac>; + + pin-tx { + pins = "gpio4"; + function = "alt4"; + bias-disable; + }; + + pin-rx { + pins = "gpio5"; + function = "alt4"; + bias-pull-up; + }; + }; + + uart3-ctsrts-gpio6 { + phandle = <0xad>; + + pin-cts { + pins = "gpio6"; + function = "alt4"; + bias-pull-up; + }; + + pin-rts { + pins = "gpio7"; + function = "alt4"; + bias-disable; + }; + }; + + uart4-gpio8 { + phandle = <0xae>; + + pin-tx { + pins = "gpio8"; + function = "alt4"; + bias-disable; + }; + + pin-rx { + pins = "gpio9"; + function = "alt4"; + bias-pull-up; + }; + }; + + uart4-ctsrts-gpio10 { + phandle = <0xaf>; + + pin-cts { + pins = "gpio10"; + function = "alt4"; + bias-pull-up; + }; + + pin-rts { + pins = "gpio11"; + function = "alt4"; + bias-disable; + }; + }; + + uart5-gpio12 { + phandle = <0xb0>; + + pin-tx { + pins = "gpio12"; + function = "alt4"; + bias-disable; + }; + + pin-rx { + pins = "gpio13"; + function = "alt4"; + bias-pull-up; + }; + }; + + uart5-ctsrts-gpio14 { + phandle = <0xb1>; + + pin-cts { + pins = "gpio14"; + function = "alt4"; + bias-pull-up; + }; + + pin-rts { + pins = "gpio15"; + function = "alt4"; + bias-disable; + }; + }; + + gpioout { + brcm,pins = <0x06>; + brcm,function = <0x01>; + phandle = <0xb2>; + }; + + alt0 { + brcm,pins = <0x04 0x05 0x07 0x08 0x09 0x0a 0x0b>; + brcm,function = <0x04>; + phandle = <0xb3>; + }; + + dpi_18bit_cpadhi_gpio0 { + brcm,pins = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x14 0x15 0x16 0x17 0x18 0x19>; + brcm,function = <0x06>; + brcm,pull = <0x00>; + phandle = <0xb4>; + }; + + dpi_18bit_cpadhi_gpio2 { + brcm,pins = <0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x14 0x15 0x16 0x17 0x18 0x19>; + brcm,function = <0x06>; + phandle = <0xb5>; + }; + + dpi_18bit_gpio0 { + brcm,pins = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x14 0x15>; + brcm,function = <0x06>; + phandle = <0xb6>; + }; + + dpi_18bit_gpio2 { + brcm,pins = <0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x14 0x15>; + brcm,function = <0x06>; + phandle = <0xb7>; + }; + + dpi_16bit_gpio0 { + brcm,pins = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13>; + brcm,function = <0x06>; + phandle = <0xb8>; + }; + + dpi_16bit_gpio2 { + brcm,pins = <0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13>; + brcm,function = <0x06>; + phandle = <0xb9>; + }; + + dpi_16bit_cpadhi_gpio0 { + brcm,pins = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x14 0x15 0x16 0x17 0x18>; + brcm,function = <0x06>; + phandle = <0xba>; + }; + + dpi_16bit_cpadhi_gpio2 { + brcm,pins = <0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x14 0x15 0x16 0x17 0x18>; + brcm,function = <0x06>; + phandle = <0xbb>; + }; + + spi0_pins { + brcm,pins = <0x09 0x0a 0x0b>; + brcm,function = <0x04>; + phandle = <0x0e>; + }; + + spi0_cs_pins { + brcm,pins = <0x08 0x07>; + brcm,function = <0x01>; + phandle = <0x0f>; + }; + + spi3_pins { + brcm,pins = <0x01 0x02 0x03>; + brcm,function = <0x07>; + phandle = <0x1c>; + }; + + spi3_cs_pins { + brcm,pins = <0x00 0x18>; + brcm,function = <0x01>; + phandle = <0x1d>; + }; + + spi4_pins { + brcm,pins = <0x05 0x06 0x07>; + brcm,function = <0x07>; + phandle = <0x1e>; + }; + + spi4_cs_pins { + brcm,pins = <0x04 0x19>; + brcm,function = <0x01>; + phandle = <0x1f>; + }; + + spi5_pins { + brcm,pins = <0x0d 0x0e 0x0f>; + brcm,function = <0x07>; + phandle = <0x20>; + }; + + spi5_cs_pins { + brcm,pins = <0x0c 0x1a>; + brcm,function = <0x01>; + phandle = <0x21>; + }; + + spi6_pins { + brcm,pins = <0x13 0x14 0x15>; + brcm,function = <0x07>; + phandle = <0x22>; + }; + + spi6_cs_pins { + brcm,pins = <0x12 0x1b>; + brcm,function = <0x01>; + phandle = <0x23>; + }; + + i2c0 { + brcm,pins = <0x00 0x01>; + brcm,function = <0x04>; + brcm,pull = <0x02>; + phandle = <0xbc>; + }; + + i2c1 { + brcm,pins = <0x02 0x03>; + brcm,function = <0x04>; + brcm,pull = <0x02>; + phandle = <0x15>; + }; + + i2c3 { + brcm,pins = <0x04 0x05>; + brcm,function = <0x02>; + brcm,pull = <0x02>; + phandle = <0x24>; + }; + + i2c4 { + brcm,pins = <0x08 0x09>; + brcm,function = <0x02>; + brcm,pull = <0x02>; + phandle = <0x25>; + }; + + i2c5 { + brcm,pins = <0x0c 0x0d>; + brcm,function = <0x02>; + brcm,pull = <0x02>; + phandle = <0x26>; + }; + + i2c6 { + brcm,pins = <0x16 0x17>; + brcm,function = <0x02>; + brcm,pull = <0x02>; + phandle = <0x27>; + }; + + i2s { + brcm,pins = <0x12 0x13 0x14 0x15>; + brcm,function = <0x04>; + phandle = <0x0d>; + }; + + sdio_pins { + brcm,pins = <0x22 0x23 0x24 0x25 0x26 0x27>; + brcm,function = <0x07>; + brcm,pull = <0x00 0x02 0x02 0x02 0x02 0x02>; + phandle = <0x33>; + }; + + uart2_pins { + brcm,pins = <0x00 0x01>; + brcm,function = <0x03>; + brcm,pull = <0x00 0x02>; + phandle = <0x18>; + }; + + uart3_pins { + brcm,pins = <0x04 0x05>; + brcm,function = <0x03>; + brcm,pull = <0x00 0x02>; + phandle = <0x19>; + }; + + uart4_pins { + brcm,pins = <0x08 0x09>; + brcm,function = <0x03>; + brcm,pull = <0x00 0x02>; + phandle = <0x1a>; + }; + + uart5_pins { + brcm,pins = <0x0c 0x0d>; + brcm,function = <0x03>; + brcm,pull = <0x00 0x02>; + phandle = <0x1b>; + }; + + bt_pins { + brcm,pins = "-"; + brcm,function = <0x00>; + brcm,pull = <0x02>; + phandle = <0x0a>; + }; + + uart0_pins { + brcm,pins = <0x20 0x21>; + brcm,function = <0x07>; + brcm,pull = <0x00 0x02>; + phandle = <0x09>; + }; + + uart1_pins { + brcm,pins; + brcm,function; + brcm,pull; + phandle = <0x12>; + }; + + uart1_bt_pins { + brcm,pins = <0x20 0x21 0x1e 0x1f>; + brcm,function = <0x02>; + brcm,pull = <0x00 0x02 0x02 0x00>; + phandle = <0xbd>; + }; + + audio_pins { + brcm,pins = <0x28 0x29>; + brcm,function = <0x04>; + brcm,pull = <0x00>; + phandle = <0x32>; + }; + }; + + serial@7e201000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7e201000 0x200>; + interrupts = <0x00 0x79 0x04>; + clocks = <0x08 0x13 0x08 0x14>; + clock-names = "uartclk", "apb_pclk"; + arm,primecell-periphid = <0x341011>; + status = "okay"; + cts-event-workaround; + pinctrl-names = "default"; + pinctrl-0 = <0x09 0x0a>; + uart-has-rtscts; + skip-init; + phandle = <0x43>; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <0x2dc6c0>; + shutdown-gpios = <0x0b 0x00 0x00>; + local-bd-address = [00 00 00 00 00 00]; + fallback-bd-address; + status = "okay"; + phandle = <0x41>; + }; + }; + + mmc@7e202000 { + compatible = "brcm,bcm2835-sdhost"; + reg = <0x7e202000 0x100>; + interrupts = <0x00 0x78 0x04>; + clocks = <0x08 0x14>; + status = "disabled"; + dmas = <0x0c 0x2000000d>; + dma-names = "rx-tx"; + bus-width = <0x04>; + brcm,overclock-50 = <0x00>; + brcm,pio-limit = <0x01>; + firmware = <0x06>; + phandle = <0x4b>; + }; + + i2s@7e203000 { + compatible = "brcm,bcm2835-i2s"; + reg = <0x7e203000 0x24>; + clocks = <0x08 0x1f>; + status = "disabled"; + #sound-dai-cells = <0x00>; + dmas = <0x0c 0x02 0x0c 0x03>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <0x0d>; + phandle = <0x45>; + }; + + spi@7e204000 { + compatible = "brcm,bcm2835-spi"; + reg = <0x7e204000 0x200>; + interrupts = <0x00 0x76 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + dmas = <0x0c 0x06 0x0c 0x07>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <0x0e 0x0f>; + cs-gpios = <0x07 0x08 0x01 0x07 0x07 0x01>; + phandle = <0x46>; + + spidev@0 { + compatible = "spidev"; + reg = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x7735940>; + phandle = <0xbe>; + }; + + spidev@1 { + compatible = "spidev"; + reg = <0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x7735940>; + phandle = <0xbf>; + }; + }; + + i2c@7e205000 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7e205000 0x200>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + clock-frequency = <0x186a0>; + phandle = <0x34>; + }; + + dpi@7e208000 { + compatible = "brcm,bcm2835-dpi"; + reg = <0x7e208000 0x8c>; + clocks = <0x08 0x14 0x08 0x2c>; + clock-names = "core", "pixel"; + status = "disabled"; + phandle = <0xc0>; + }; + + dsi@7e209000 { + compatible = "brcm,bcm2835-dsi0"; + reg = <0x7e209000 0x78>; + interrupts = <0x00 0x64 0x04>; + #address-cells = <0x01>; + #size-cells = <0x00>; + #clock-cells = <0x01>; + clocks = <0x08 0x22 0x08 0x2f 0x08 0x31>; + clock-names = "phy", "escape", "pixel"; + clock-output-names = "dsi0_byte", "dsi0_ddr2", "dsi0_ddr"; + status = "disabled"; + power-domains = <0x10 0x11>; + phandle = <0x04>; + }; + + aux@7e215000 { + compatible = "brcm,bcm2835-aux"; + #clock-cells = <0x01>; + reg = <0x7e215000 0x08>; + clocks = <0x08 0x14>; + phandle = <0x11>; + }; + + serial@7e215040 { + compatible = "brcm,bcm2835-aux-uart"; + reg = <0x7e215040 0x40>; + interrupts = <0x00 0x5d 0x04>; + clocks = <0x11 0x00>; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <0x12>; + skip-init; + phandle = <0x44>; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <0x38400>; + shutdown-gpios = <0x0b 0x00 0x00>; + local-bd-address = [00 00 00 00 00 00]; + fallback-bd-address; + status = "disabled"; + phandle = <0x42>; + }; + }; + + spi@7e215080 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e215080 0x40>; + interrupts = <0x00 0x5d 0x04>; + clocks = <0x11 0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + phandle = <0xc1>; + }; + + spi@7e2150c0 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e2150c0 0x40>; + interrupts = <0x00 0x5d 0x04>; + clocks = <0x11 0x02>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + phandle = <0xc2>; + }; + + pwm@7e20c000 { + compatible = "brcm,bcm2835-pwm"; + reg = <0x7e20c000 0x28>; + clocks = <0x08 0x1e>; + assigned-clocks = <0x08 0x1e>; + assigned-clock-rates = <0x2faf080>; + #pwm-cells = <0x03>; + status = "disabled"; + phandle = <0xc3>; + }; + + mmc@7e300000 { + compatible = "brcm,bcm2835-mmc", "brcm,bcm2835-sdhci"; + reg = <0x7e300000 0x100>; + interrupts = <0x00 0x7e 0x04>; + clocks = <0x08 0x1c>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x13>; + bus-width = <0x04>; + dmas = <0x0c 0x0b>; + dma-names = "rx-tx"; + brcm,overclock-50 = <0x00>; + phandle = <0x4c>; + }; + + hvs@7e400000 { + compatible = "brcm,bcm2711-hvs"; + reg = <0x7e400000 0x8000>; + interrupts = <0x00 0x61 0x04>; + clocks = <0x14 0x04>; + status = "disabled"; + phandle = <0xc4>; + }; + + dsi@7e700000 { + compatible = "brcm,bcm2711-dsi1"; + reg = <0x7e700000 0x8c>; + interrupts = <0x00 0x6c 0x04>; + #address-cells = <0x01>; + #size-cells = <0x00>; + #clock-cells = <0x01>; + clocks = <0x08 0x23 0x08 0x30 0x08 0x32>; + clock-names = "phy", "escape", "pixel"; + clock-output-names = "dsi1_byte", "dsi1_ddr2", "dsi1_ddr"; + status = "disabled"; + power-domains = <0x10 0x12>; + phandle = <0x05>; + }; + + csi@7e800000 { + compatible = "brcm,bcm2835-unicam"; + reg = <0x7e800000 0x800 0x7e802000 0x04>; + reg-names = "unicam", "cmi"; + interrupts = <0x00 0x66 0x04>; + brcm,num-data-lanes = <0x02>; + status = "disabled"; + clocks = <0x08 0x2d 0x14 0x04>; + clock-names = "lp", "vpu"; + power-domains = <0x10 0x0c>; + phandle = <0x51>; + + port { + }; + }; + + csi@7e801000 { + compatible = "brcm,bcm2835-unicam"; + reg = <0x7e801000 0x800 0x7e802004 0x04>; + reg-names = "unicam", "cmi"; + interrupts = <0x00 0x67 0x04>; + brcm,num-data-lanes = <0x02>; + status = "disabled"; + clocks = <0x08 0x2e 0x14 0x04>; + clock-names = "lp", "vpu"; + power-domains = <0x10 0x0d>; + phandle = <0x50>; + + port { + }; + }; + + i2c@7e804000 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7e804000 0x1000>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x15>; + clock-frequency = <0x186a0>; + phandle = <0x48>; + }; + + usb@7e980000 { + compatible = "brcm,bcm2708-usb"; + reg = <0x7e980000 0x10000 0x7e00b200 0x200>; + interrupts = <0x00 0x49 0x04 0x00 0x28 0x04>; + #address-cells = <0x01>; + #size-cells = <0x00>; + clocks = <0x16>; + clock-names = "otg"; + phys = <0x17>; + phy-names = "usb2-phy"; + power-domains = <0x10 0x06>; + interrupt-names = "usb", "soft"; + status = "disabled"; + phandle = <0xc5>; + }; + + interrupt-controller@40000000 { + compatible = "brcm,bcm2836-l1-intc"; + reg = <0x40000000 0x100>; + phandle = <0xc6>; + }; + + interrupt-controller@40041000 { + interrupt-controller; + #interrupt-cells = <0x03>; + compatible = "arm,gic-400"; + reg = <0x40041000 0x1000 0x40042000 0x2000 0x40044000 0x2000 0x40046000 0x2000>; + interrupts = <0x01 0x09 0xf04>; + phandle = <0x01>; + }; + + avs-monitor@7d5d2000 { + compatible = "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"; + reg = <0x7d5d2000 0xf00>; + phandle = <0xc7>; + + thermal { + compatible = "brcm,bcm2711-thermal"; + #thermal-sensor-cells = <0x00>; + phandle = <0x02>; + }; + }; + + dma-controller@7e007000 { + compatible = "brcm,bcm2835-dma"; + reg = <0x7e007000 0xb00>; + interrupts = <0x00 0x50 0x04 0x00 0x51 0x04 0x00 0x52 0x04 0x00 0x53 0x04 0x00 0x54 0x04 0x00 0x55 0x04 0x00 0x56 0x04 0x00 0x57 0x04 0x00 0x57 0x04 0x00 0x58 0x04 0x00 0x58 0x04>; + interrupt-names = "dma0", "dma1", "dma2", "dma3", "dma4", "dma5", "dma6", "dma7", "dma8", "dma9", "dma10"; + #dma-cells = <0x01>; + brcm,dma-channel-mask = <0x7f5>; + phandle = <0x0c>; + }; + + watchdog@7e100000 { + compatible = "brcm,bcm2711-pm", "brcm,bcm2835-pm-wdt"; + #power-domain-cells = <0x01>; + #reset-cells = <0x01>; + reg = <0x7e100000 0x114 0x7e00a000 0x24 0x7ec11000 0x20>; + reg-names = "pm", "asb", "rpivid_asb"; + clocks = <0x08 0x15 0x08 0x1d 0x08 0x17 0x08 0x16>; + clock-names = "v3d", "peri_image", "h264", "isp"; + system-power-controller; + phandle = <0x49>; + }; + + rng@7e104000 { + compatible = "brcm,bcm2711-rng200"; + reg = <0x7e104000 0x28>; + status = "okay"; + phandle = <0x4a>; + }; + + serial@7e201400 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7e201400 0x200>; + interrupts = <0x00 0x79 0x04>; + clocks = <0x08 0x13 0x08 0x14>; + clock-names = "uartclk", "apb_pclk"; + arm,primecell-periphid = <0x341011>; + status = "disabled"; + pinctrl-0 = <0x18>; + pinctrl-names = "default"; + phandle = <0xc8>; + }; + + serial@7e201600 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7e201600 0x200>; + interrupts = <0x00 0x79 0x04>; + clocks = <0x08 0x13 0x08 0x14>; + clock-names = "uartclk", "apb_pclk"; + arm,primecell-periphid = <0x341011>; + status = "disabled"; + pinctrl-0 = <0x19>; + pinctrl-names = "default"; + phandle = <0xc9>; + }; + + serial@7e201800 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7e201800 0x200>; + interrupts = <0x00 0x79 0x04>; + clocks = <0x08 0x13 0x08 0x14>; + clock-names = "uartclk", "apb_pclk"; + arm,primecell-periphid = <0x341011>; + status = "disabled"; + pinctrl-0 = <0x1a>; + pinctrl-names = "default"; + phandle = <0xca>; + }; + + serial@7e201a00 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7e201a00 0x200>; + interrupts = <0x00 0x79 0x04>; + clocks = <0x08 0x13 0x08 0x14>; + clock-names = "uartclk", "apb_pclk"; + arm,primecell-periphid = <0x341011>; + status = "disabled"; + pinctrl-0 = <0x1b>; + pinctrl-names = "default"; + phandle = <0xcb>; + }; + + spi@7e204600 { + compatible = "brcm,bcm2835-spi"; + reg = <0x7e204600 0x200>; + interrupts = <0x00 0x76 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-0 = <0x1c 0x1d>; + pinctrl-names = "default"; + phandle = <0xcc>; + }; + + spi@7e204800 { + compatible = "brcm,bcm2835-spi"; + reg = <0x7e204800 0x200>; + interrupts = <0x00 0x76 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-0 = <0x1e 0x1f>; + pinctrl-names = "default"; + phandle = <0xcd>; + }; + + spi@7e204a00 { + compatible = "brcm,bcm2835-spi"; + reg = <0x7e204a00 0x200>; + interrupts = <0x00 0x76 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-0 = <0x20 0x21>; + pinctrl-names = "default"; + phandle = <0xce>; + }; + + spi@7e204c00 { + compatible = "brcm,bcm2835-spi"; + reg = <0x7e204c00 0x200>; + interrupts = <0x00 0x76 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-0 = <0x22 0x23>; + pinctrl-names = "default"; + phandle = <0xcf>; + }; + + i2c@7e205600 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7e205600 0x200>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-0 = <0x24>; + pinctrl-names = "default"; + phandle = <0xd0>; + }; + + i2c@7e205800 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7e205800 0x200>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-0 = <0x25>; + pinctrl-names = "default"; + phandle = <0xd1>; + }; + + i2c@7e205a00 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7e205a00 0x200>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-0 = <0x26>; + pinctrl-names = "default"; + phandle = <0xd2>; + }; + + i2c@7e205c00 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7e205c00 0x200>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x08 0x14>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + pinctrl-0 = <0x27>; + pinctrl-names = "default"; + phandle = <0xd3>; + }; + + pixelvalve@7e206000 { + compatible = "brcm,bcm2711-pixelvalve0"; + reg = <0x7e206000 0x100>; + interrupts = <0x00 0x6d 0x04>; + status = "disabled"; + phandle = <0xd4>; + }; + + pixelvalve@7e207000 { + compatible = "brcm,bcm2711-pixelvalve1"; + reg = <0x7e207000 0x100>; + interrupts = <0x00 0x6e 0x04>; + status = "disabled"; + phandle = <0xd5>; + }; + + pixelvalve@7e20a000 { + compatible = "brcm,bcm2711-pixelvalve2"; + reg = <0x7e20a000 0x100>; + interrupts = <0x00 0x65 0x04>; + status = "disabled"; + phandle = <0xd6>; + }; + + pwm@7e20c800 { + compatible = "brcm,bcm2835-pwm"; + reg = <0x7e20c800 0x28>; + clocks = <0x08 0x1e>; + assigned-clocks = <0x08 0x1e>; + assigned-clock-rates = <0x2faf080>; + #pwm-cells = <0x03>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x28 0x29>; + phandle = <0xd7>; + }; + + pixelvalve@7e216000 { + compatible = "brcm,bcm2711-pixelvalve4"; + reg = <0x7e216000 0x100>; + interrupts = <0x00 0x6e 0x04>; + status = "disabled"; + phandle = <0xd8>; + }; + + pixelvalve@7ec12000 { + compatible = "brcm,bcm2711-pixelvalve3"; + reg = <0x7ec12000 0x100>; + interrupts = <0x00 0x6a 0x04>; + status = "disabled"; + phandle = <0xd9>; + }; + + vec@7ec13000 { + compatible = "brcm,bcm2711-vec"; + reg = <0x7ec13000 0x1000>; + clocks = <0x14 0x0f>; + interrupts = <0x00 0x7b 0x04>; + status = "disabled"; + power-domains = <0x10 0x07>; + phandle = <0xda>; + }; + + clock@7ef00000 { + compatible = "brcm,brcm2711-dvp"; + reg = <0x7ef00000 0x10>; + clocks = <0x2a>; + #clock-cells = <0x01>; + #reset-cells = <0x01>; + status = "disabled"; + phandle = <0x2b>; + }; + + interrupt-controller@7ef00100 { + compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; + reg = <0x7ef00100 0x30>; + interrupts = <0x00 0x60 0x01>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x2c>; + }; + + hdmi@7ef00700 { + compatible = "brcm,bcm2711-hdmi0"; + reg = <0x7ef00700 0x300 0x7ef00300 0x200 0x7ef00f00 0x80 0x7ef00f80 0x80 0x7ef01b00 0x200 0x7ef01f00 0x400 0x7ef00200 0x80 0x7ef04300 0x100 0x7ef20000 0x100 0x7ef00100 0x30>; + reg-names = "hdmi", "dvp", "phy", "rm", "packet", "metadata", "csc", "cec", "hd", "intr2"; + clock-names = "hdmi", "bvb", "audio", "cec"; + resets = <0x2b 0x00>; + interrupt-parent = <0x2c>; + interrupts = <0x00 0x01 0x02 0x03 0x04 0x05>; + interrupt-names = "cec-tx", "cec-rx", "cec-low", "wakeup", "hpd-connected", "hpd-removed"; + ddc = <0x2d>; + dmas = <0x2e 0x41fa000a>; + dma-names = "audio-rx"; + status = "disabled"; + clocks = <0x14 0x0d 0x14 0x0e 0x2b 0x00 0x2f>; + wifi-2.4ghz-coexistence; + phandle = <0x55>; + }; + + i2c@7ef04500 { + compatible = "brcm,bcm2711-hdmi-i2c"; + reg = <0x7ef04500 0x100 0x7ef00b00 0x300>; + reg-names = "bsc", "auto-i2c"; + clock-frequency = <0x17cdc>; + status = "disabled"; + phandle = <0x2d>; + }; + + hdmi@7ef05700 { + compatible = "brcm,bcm2711-hdmi1"; + reg = <0x7ef05700 0x300 0x7ef05300 0x200 0x7ef05f00 0x80 0x7ef05f80 0x80 0x7ef06b00 0x200 0x7ef06f00 0x400 0x7ef00280 0x80 0x7ef09300 0x100 0x7ef20000 0x100 0x7ef00100 0x30>; + reg-names = "hdmi", "dvp", "phy", "rm", "packet", "metadata", "csc", "cec", "hd", "intr2"; + ddc = <0x30>; + clock-names = "hdmi", "bvb", "audio", "cec"; + resets = <0x2b 0x01>; + interrupt-parent = <0x2c>; + interrupts = <0x08 0x07 0x06 0x09 0x0a 0x0b>; + interrupt-names = "cec-tx", "cec-rx", "cec-low", "wakeup", "hpd-connected", "hpd-removed"; + dmas = <0x2e 0x41fa0011>; + dma-names = "audio-rx"; + status = "disabled"; + clocks = <0x14 0x0d 0x14 0x0e 0x2b 0x01 0x2f>; + wifi-2.4ghz-coexistence; + phandle = <0x56>; + }; + + i2c@7ef09500 { + compatible = "brcm,bcm2711-hdmi-i2c"; + reg = <0x7ef09500 0x100 0x7ef05b00 0x300>; + reg-names = "bsc", "auto-i2c"; + clock-frequency = <0x17cdc>; + status = "disabled"; + phandle = <0x30>; + }; + + firmware { + compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; + mboxes = <0x31>; + phandle = <0x06>; + + clocks { + compatible = "raspberrypi,firmware-clocks"; + #clock-cells = <0x01>; + phandle = <0x14>; + }; + + gpio { + compatible = "raspberrypi,firmware-gpio"; + gpio-controller; + #gpio-cells = <0x02>; + status = "okay"; + gpio-line-names = "BT_ON", "WL_ON", "PWR_LED_OFF", "GLOBAL_RESET", "VDD_SD_IO_SEL", "CAM_GPIO", "SD_PWR_ON", "SD_OC_N"; + phandle = <0x0b>; + }; + + reset { + compatible = "raspberrypi,firmware-reset"; + #reset-cells = <0x01>; + phandle = <0x3f>; + }; + + vcio { + compatible = "raspberrypi,vcio"; + phandle = <0xdb>; + }; + }; + + power { + compatible = "raspberrypi,bcm2835-power"; + firmware = <0x06>; + #power-domain-cells = <0x01>; + phandle = <0x10>; + }; + + mailbox@7e00b840 { + compatible = "brcm,bcm2711-vchiq"; + reg = <0x7e00b840 0x3c>; + interrupts = <0x00 0x22 0x04>; + pinctrl-names = "default"; + pinctrl-0 = <0x32>; + phandle = <0xdc>; + }; + + mmcnr@7e300000 { + compatible = "brcm,bcm2835-mmc", "brcm,bcm2835-sdhci"; + reg = <0x7e300000 0x100>; + interrupts = <0x00 0x7e 0x04>; + clocks = <0x08 0x1c>; + dmas = <0x0c 0x0b>; + dma-names = "rx-tx"; + brcm,overclock-50 = <0x00>; + non-removable; + status = "okay"; + #address-cells = <0x01>; + #size-cells = <0x00>; + pinctrl-names = "default"; + pinctrl-0 = <0x33>; + bus-width = <0x04>; + phandle = <0x4d>; + + wifi@1 { + reg = <0x01>; + compatible = "brcm,bcm4329-fmac"; + phandle = <0xdd>; + }; + }; + + firmwarekms@7e600000 { + compatible = "raspberrypi,rpi-firmware-kms-2711"; + reg = <0x7e600000 0x100>; + interrupts = <0x00 0x70 0x04>; + brcm,firmware = <0x06>; + status = "disabled"; + phandle = <0xde>; + }; + + smi@7e600000 { + compatible = "brcm,bcm2835-smi"; + reg = <0x7e600000 0x100>; + interrupts = <0x00 0x70 0x04>; + clocks = <0x08 0x2a>; + assigned-clocks = <0x08 0x2a>; + assigned-clock-rates = <0x7735940>; + dmas = <0x0c 0x04>; + dma-names = "rx-tx"; + status = "disabled"; + phandle = <0xdf>; + }; + + axiperf { + compatible = "brcm,bcm2711-axiperf"; + reg = <0x7e009800 0x100 0x7ee08000 0x100>; + firmware = <0x06>; + status = "disabled"; + phandle = <0x4e>; + }; + + i2c0mux { + compatible = "i2c-mux-pinctrl"; + #address-cells = <0x01>; + #size-cells = <0x00>; + i2c-parent = <0x34>; + status = "disabled"; + pinctrl-names = "i2c0", "i2c_csi_dsi"; + pinctrl-0 = <0x35>; + pinctrl-1 = <0x36>; + phandle = <0x47>; + + i2c@0 { + reg = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0xe0>; + }; + + i2c@1 { + reg = <0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0xe1>; + }; + }; + + gpiomem { + compatible = "brcm,bcm2835-gpiomem"; + reg = <0x7e200000 0x1000>; + }; + + fb { + compatible = "brcm,bcm2708-fb"; + firmware = <0x06>; + status = "okay"; + phandle = <0xe2>; + }; + + sound { + status = "disabled"; + phandle = <0xe3>; + }; + + nvmem { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x01>; + + nvmem_otp { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x06>; + reg = <0x00 0xa6>; + status = "okay"; + phandle = <0xe4>; + }; + + nvmem_cust { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x06>; + reg = <0x01 0x08>; + status = "okay"; + phandle = <0x57>; + }; + + nvmem_priv { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x06>; + reg = <0x03 0x08>; + status = "okay"; + phandle = <0x58>; + }; + }; + }; + + clocks { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x00>; + + clk-osc { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "osc"; + clock-frequency = <0x337f980>; + phandle = <0x03>; + }; + + clk-usb { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "otg"; + clock-frequency = <0x1c9c3800>; + phandle = <0x16>; + }; + }; + + phy { + compatible = "usb-nop-xceiv"; + #phy-cells = <0x00>; + phandle = <0x17>; + }; + + gpu { + compatible = "brcm,bcm2711-vc5"; + status = "disabled"; + raspberrypi,firmware = <0x06>; + phandle = <0xe5>; + }; + + clk-27M { + #clock-cells = <0x00>; + compatible = "fixed-clock"; + clock-frequency = <0x19bfcc0>; + clock-output-names = "27MHz-clock"; + phandle = <0x2f>; + }; + + clk-108M { + #clock-cells = <0x00>; + compatible = "fixed-clock"; + clock-frequency = <0x66ff300>; + clock-output-names = "108MHz-clock"; + phandle = <0x2a>; + }; + + emmc2bus { + compatible = "simple-bus"; + #address-cells = <0x02>; + #size-cells = <0x01>; + ranges = <0x00 0x7e000000 0x00 0xfe000000 0x1800000>; + dma-ranges = <0x00 0xc0000000 0x00 0x00 0x40000000>; + phandle = <0xe6>; + + mmc@7e340000 { + compatible = "brcm,bcm2711-emmc2"; + reg = <0x00 0x7e340000 0x100>; + interrupts = <0x00 0x7e 0x04>; + clocks = <0x08 0x33>; + status = "okay"; + vqmmc-supply = <0x37>; + vmmc-supply = <0x38>; + broken-cd; + mmc-ddr-3_3v; + phandle = <0x59>; + }; + }; + + pmu { + compatible = "arm,cortex-a72-pmu"; + interrupts = <0x00 0x10 0x04 0x00 0x11 0x04 0x00 0x12 0x04 0x00 0x13 0x04>; + interrupt-affinity = <0x39 0x3a 0x3b 0x3c>; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <0x01 0x0d 0xf08 0x01 0x0e 0xf08 0x01 0x0b 0xf08 0x01 0x0a 0xf08>; + }; + + cpus { + #address-cells = <0x01>; + #size-cells = <0x00>; + enable-method = "brcm,bcm2836-smp"; + phandle = <0xe7>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <0x00>; + enable-method = "spin-table"; + cpu-release-addr = <0x00 0xd8>; + d-cache-size = <0x8000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0xc000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x3d>; + phandle = <0x39>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <0x01>; + enable-method = "spin-table"; + cpu-release-addr = <0x00 0xe0>; + d-cache-size = <0x8000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0xc000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x3d>; + phandle = <0x3a>; + }; + + cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <0x02>; + enable-method = "spin-table"; + cpu-release-addr = <0x00 0xe8>; + d-cache-size = <0x8000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0xc000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x3d>; + phandle = <0x3b>; + }; + + cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <0x03>; + enable-method = "spin-table"; + cpu-release-addr = <0x00 0xf0>; + d-cache-size = <0x8000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0xc000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x3d>; + phandle = <0x3c>; + }; + + l2-cache0 { + compatible = "cache"; + cache-unified; + cache-size = <0x100000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + phandle = <0x3d>; + }; + }; + + scb { + compatible = "simple-bus"; + #address-cells = <0x02>; + #size-cells = <0x02>; + ranges = <0x00 0x7c000000 0x00 0xfc000000 0x00 0x3800000 0x00 0x40000000 0x00 0xff800000 0x00 0x800000 0x06 0x00 0x06 0x00 0x00 0x40000000 0x00 0x00 0x00 0x00 0x00 0xfc000000>; + dma-ranges = <0x04 0x7c000000 0x00 0xfc000000 0x00 0x3800000 0x00 0x00 0x00 0x00 0x04 0x00>; + phandle = <0xe8>; + + pcie@7d500000 { + compatible = "brcm,bcm2711-pcie"; + reg = <0x00 0x7d500000 0x00 0x9310>; + device_type = "pci"; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupts = <0x00 0x93 0x04 0x00 0x94 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0x8f 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0x90 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0x91 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0x92 0x04>; + msi-controller; + msi-parent = <0x3e>; + ranges = <0x2000000 0x00 0xc0000000 0x06 0x00 0x00 0x40000000>; + dma-ranges = <0x2000000 0x00 0x00 0x00 0x00 0x00 0xc0000000>; + brcm,enable-ssc; + phandle = <0x3e>; + + pci@0,0 { + device_type = "pci"; + #address-cells = <0x03>; + #size-cells = <0x02>; + ranges; + reg = <0x00 0x00 0x00 0x00 0x00>; + + usb@0,0 { + reg = <0x00 0x00 0x00 0x00 0x00>; + resets = <0x3f 0x00>; + }; + }; + }; + + ethernet@7d580000 { + compatible = "brcm,bcm2711-genet-v5"; + reg = <0x00 0x7d580000 0x00 0x10000>; + #address-cells = <0x01>; + #size-cells = <0x01>; + interrupts = <0x00 0x9d 0x04 0x00 0x9e 0x04>; + status = "okay"; + phy-handle = <0x40>; + phy-mode = "rgmii-rxid"; + phandle = <0xe9>; + + mdio@e14 { + compatible = "brcm,genet-mdio-v5"; + reg = <0xe14 0x08>; + reg-names = "mdio"; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0xea>; + + ethernet-phy@1 { + reg = <0x01>; + led-modes = <0x00 0x08>; + phandle = <0x40>; + }; + }; + }; + + codec@7eb10000 { + compatible = "brcm,bcm2711-hevc-dec", "raspberrypi,hevc-dec"; + reg = <0x00 0x7eb00000 0x00 0x10000 0x00 0x7eb10000 0x00 0x1000>; + reg-names = "hevc", "intc"; + interrupts = <0x00 0x62 0x04>; + clocks = <0x14 0x0b>; + phandle = <0xeb>; + }; + + dma@7e007b00 { + compatible = "brcm,bcm2711-dma"; + reg = <0x00 0x7e007b00 0x00 0x400>; + interrupts = <0x00 0x59 0x04 0x00 0x5a 0x04 0x00 0x5b 0x04 0x00 0x5c 0x04>; + interrupt-names = "dma11", "dma12", "dma13", "dma14"; + #dma-cells = <0x01>; + brcm,dma-channel-mask = <0x7000>; + phandle = <0x2e>; + }; + + xhci@7e9c0000 { + compatible = "generic-xhci"; + status = "disabled"; + reg = <0x00 0x7e9c0000 0x00 0x100000>; + interrupts = <0x00 0xb0 0x04>; + power-domains = <0x10 0x06>; + phandle = <0xec>; + }; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00 0x00 0x00>; + }; + + leds { + compatible = "gpio-leds"; + phandle = <0xed>; + + led-act { + label = "ACT"; + default-state = "off"; + linux,default-trigger = "mmc0"; + gpios = <0x07 0x2a 0x00>; + phandle = <0x5a>; + }; + + led-pwr { + label = "PWR"; + gpios = <0x0b 0x02 0x01>; + default-state = "off"; + linux,default-trigger = "default-on"; + phandle = <0x5b>; + }; + }; + + cam1_clk { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0xee>; + }; + + cam0_regulator { + compatible = "regulator-fixed"; + regulator-name = "cam0-reg"; + enable-active-high; + status = "disabled"; + phandle = <0xef>; + }; + + cam0_clk { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0xf0>; + }; + + cam_dummy_reg { + compatible = "regulator-fixed"; + regulator-name = "cam-dummy-reg"; + status = "okay"; + phandle = <0x52>; + }; + + __overrides__ { + cam0-pwdn-ctrl; + cam0-pwdn; + cam0-led-ctrl; + cam0-led; + bdaddr = "", "", "", "Alocal-bd-address[", "", "", "", "Afallback-bd-address?=0", "", "", "", "Blocal-bd-address[", "", "", "", "Bfallback-bd-address?=0"; + krnbt = "", "", "", "Astatus"; + krnbt_baudrate = "", "", "", "Amax-speed:0", "", "", "", "Bmax-speed:0"; + cache_line_size; + uart0 = "", "", "", "Cstatus"; + uart1 = "", "", "", "Dstatus"; + i2s = "", "", "", "Estatus"; + spi = "", "", "", "Fstatus"; + i2c0 = "", "", "", "4status", "", "", "", "Gstatus"; + i2c1 = "", "", "", "Hstatus"; + i2c = "", "", "", "Hstatus"; + i2c_arm = "", "", "", "Hstatus"; + i2c_vc = "", "", "", "4status", "", "", "", "Gstatus"; + i2c0_baudrate = "", "", "", "4clock-frequency:0"; + i2c1_baudrate = "", "", "", "Hclock-frequency:0"; + i2c_baudrate = "", "", "", "Hclock-frequency:0"; + i2c_arm_baudrate = "", "", "", "Hclock-frequency:0"; + i2c_vc_baudrate = "", "", "", "4clock-frequency:0"; + watchdog = "", "", "", "Istatus"; + random = "", "", "", "Jstatus"; + sd_overclock = "", "", "", "Kbrcm,overclock-50:0"; + sd_force_pio = "", "", "", "Kbrcm,force-pio?"; + sd_pio_limit = "", "", "", "Kbrcm,pio-limit:0"; + sd_debug = "", "", "", "Kbrcm,debug"; + sdio_overclock = "", "", "", "Lbrcm,overclock-50:0", "", "", "", "Mbrcm,overclock-50:0"; + axiperf = "", "", "", "Nstatus"; + drm_fb0_vc4 = "", "", "", "Odrm-fb0=", "/gpu"; + drm_fb1_vc4 = "", "", "", "Odrm-fb1=", "/gpu"; + drm_fb2_vc4 = "", "", "", "Odrm-fb2=", "/gpu"; + cam1_sync = "", "", "", "Psync-gpios:0=", "", "", "", "\a", "", "", "Psync-gpios:4", "", "", "", "Psync-gpios:8=", "", "", "", ""; + cam1_sync_inverted = [00 00 00 50 73 79 6e 63 2d 67 70 69 6f 73 3a 30 3d 00 00 00 00 07 00 00 00 50 73 79 6e 63 2d 67 70 69 6f 73 3a 34 00 00 00 00 50 73 79 6e 63 2d 67 70 69 6f 73 3a 38 3d 00 00 00 00 01]; + cam0_sync = "", "", "", "Qsync-gpios:0=", "", "", "", "\a", "", "", "Qsync-gpios:4", "", "", "", "Qsync-gpios:8=", "", "", "", ""; + cam0_sync_inverted = [00 00 00 51 73 79 6e 63 2d 67 70 69 6f 73 3a 30 3d 00 00 00 00 07 00 00 00 51 73 79 6e 63 2d 67 70 69 6f 73 3a 34 00 00 00 00 51 73 79 6e 63 2d 67 70 69 6f 73 3a 38 3d 00 00 00 00 01]; + cam0_reg = "", "", "", "Rstatus"; + cam0_reg_gpio = [00 00 00 52 67 70 69 6f 3a 34 00 00 00 00 52 67 70 69 6f 3a 30 3d 00 00 00 00 07]; + cam1_reg = "", "", "", "Sstatus"; + cam1_reg_gpio = [00 00 00 53 67 70 69 6f 3a 34 00 00 00 00 53 67 70 69 6f 3a 30 3d 00 00 00 00 07]; + strict_gpiod = "", "", "", "Tbootargs=pinctrl_bcm2835.persist_gpio_outputs=n"; + arm_freq; + eee = "", "", "", "Tbootargs{on='',off='genet.eee=N'}"; + hdmi = "", "", "", "Ustatus", "", "", "", "Vstatus"; + nvmem_cust_rw = "", "", "", "Wrw?"; + nvmem_priv_rw = "", "", "", "Xrw?"; + pcie = "", "", "", ">status"; + sd = "", "", "", "Ystatus"; + sd_poll_once = "", "", "", "Ynon-removable?"; + spi_dma4 = <0x46 0x646d6173 0x3a303d00 0x2e 0x46 0x646d6173 0x3a383d00 0x2e>; + i2s_dma4 = <0x45 0x646d6173 0x3a303d00 0x2e 0x45 0x646d6173 0x3a383d00 0x2e>; + audio = "", "", "", "Tbootargs{on='snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1',off='snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_hdmi=0'}"; + act_led_gpio = "", "", "", "Zgpios:4"; + act_led_activelow = "", "", "", "Zgpios:8"; + act_led_trigger = "", "", "", "Zlinux,default-trigger"; + pwr_led_gpio = "", "", "", "[gpios:4"; + pwr_led_activelow = "", "", "", "[gpios:8"; + pwr_led_trigger = "", "", "", "[linux,default-trigger"; + eth_led0 = "", "", "", "@led-modes:0"; + eth_led1 = "", "", "", "@led-modes:4"; + }; + + regulator-cam1 { + compatible = "regulator-fixed"; + regulator-name = "cam1-reg"; + enable-active-high; + gpio = <0x0b 0x05 0x00>; + phandle = <0x53>; + }; + + regulator-sd-io-1v8 { + compatible = "regulator-gpio"; + regulator-name = "vdd-sd-io"; + regulator-min-microvolt = <0x1b7740>; + regulator-max-microvolt = <0x325aa0>; + regulator-boot-on; + regulator-always-on; + regulator-settling-time-us = <0x1388>; + gpios = <0x0b 0x04 0x00>; + states = <0x1b7740 0x01 0x325aa0 0x00>; + status = "okay"; + phandle = <0x37>; + }; + + regulator-sd-vcc { + compatible = "regulator-fixed"; + regulator-name = "vcc-sd"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + regulator-boot-on; + enable-active-high; + gpio = <0x0b 0x06 0x00>; + phandle = <0x38>; + }; + + fixedregulator_3v3 { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <0x325aa0>; + regulator-min-microvolt = <0x325aa0>; + regulator-name = "3v3"; + phandle = <0xf1>; + }; + + fixedregulator_5v0 { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <0x4c4b40>; + regulator-min-microvolt = <0x4c4b40>; + regulator-name = "5v0"; + phandle = <0xf2>; + }; + + zone_dma { + #address-cells = <0x01>; + #size-cells = <0x01>; + dma-ranges = <0x00 0x00 0x00 0x40000000>; + }; + + v3dbus { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x02>; + ranges = <0x7c500000 0x00 0xfc500000 0x00 0x3300000 0x40000000 0x00 0xff800000 0x00 0x800000>; + dma-ranges = <0x00 0x00 0x00 0x04 0x00>; + phandle = <0xf3>; + + v3d@7ec04000 { + compatible = "brcm,2711-v3d"; + reg = <0x7ec00000 0x00 0x4000 0x7ec04000 0x00 0x4000>; + reg-names = "hub", "core0"; + power-domains = <0x49 0x01>; + resets = <0x49 0x00>; + clocks = <0x14 0x05>; + clocks-names = "v3d"; + interrupts = <0x00 0x4a 0x04>; + status = "disabled"; + phandle = <0xf4>; + }; + }; + + __symbols__ { + aliases = "/aliases"; + chosen = "/chosen"; + rmem = "/reserved-memory"; + cma = "/reserved-memory/linux,cma"; + blconfig = "/reserved-memory/nvram@0"; + blpubkey = "/reserved-memory/nvram@1"; + cpu_thermal = "/thermal-zones/cpu-thermal"; + thermal_trips = "/thermal-zones/cpu-thermal/trips"; + cooling_maps = "/thermal-zones/cpu-thermal/cooling-maps"; + soc = "/soc"; + system_timer = "/soc/timer@7e003000"; + txp = "/soc/txp@7e004000"; + clocks = "/soc/cprman@7e101000"; + mailbox = "/soc/mailbox@7e00b880"; + gpio = "/soc/gpio@7e200000"; + dpi_gpio0 = "/soc/gpio@7e200000/dpi-gpio0"; + emmc_gpio22 = "/soc/gpio@7e200000/emmc-gpio22"; + emmc_gpio34 = "/soc/gpio@7e200000/emmc-gpio34"; + emmc_gpio48 = "/soc/gpio@7e200000/emmc-gpio48"; + gpclk0_gpio4 = "/soc/gpio@7e200000/gpclk0-gpio4"; + gpclk1_gpio5 = "/soc/gpio@7e200000/gpclk1-gpio5"; + gpclk1_gpio42 = "/soc/gpio@7e200000/gpclk1-gpio42"; + gpclk1_gpio44 = "/soc/gpio@7e200000/gpclk1-gpio44"; + gpclk2_gpio6 = "/soc/gpio@7e200000/gpclk2-gpio6"; + gpclk2_gpio43 = "/soc/gpio@7e200000/gpclk2-gpio43"; + i2c0_gpio0 = "/soc/gpio@7e200000/i2c0if-gpio0"; + i2c0_gpio28 = "/soc/gpio@7e200000/i2c0if-gpio28"; + i2c0_gpio44 = "/soc/gpio@7e200000/i2c0if-gpio44"; + i2c1_gpio2 = "/soc/gpio@7e200000/i2c1-gpio2"; + i2c1_gpio44 = "/soc/gpio@7e200000/i2c1-gpio44"; + jtag_gpio22 = "/soc/gpio@7e200000/jtag-gpio22"; + pcm_gpio18 = "/soc/gpio@7e200000/pcm-gpio18"; + pcm_gpio28 = "/soc/gpio@7e200000/pcm-gpio28"; + sdhost_gpio48 = "/soc/gpio@7e200000/sdhost-gpio48"; + spi0_gpio7 = "/soc/gpio@7e200000/spi0-gpio7"; + spi0_gpio35 = "/soc/gpio@7e200000/spi0-gpio35"; + spi1_gpio16 = "/soc/gpio@7e200000/spi1-gpio16"; + spi2_gpio40 = "/soc/gpio@7e200000/spi2-gpio40"; + uart0_gpio14 = "/soc/gpio@7e200000/uart0-gpio14"; + uart0_ctsrts_gpio16 = "/soc/gpio@7e200000/uart0-ctsrts-gpio16"; + uart0_ctsrts_gpio30 = "/soc/gpio@7e200000/uart0-ctsrts-gpio30"; + uart0_gpio32 = "/soc/gpio@7e200000/uart0-gpio32"; + uart0_gpio36 = "/soc/gpio@7e200000/uart0-gpio36"; + uart0_ctsrts_gpio38 = "/soc/gpio@7e200000/uart0-ctsrts-gpio38"; + uart1_gpio14 = "/soc/gpio@7e200000/uart1-gpio14"; + uart1_ctsrts_gpio16 = "/soc/gpio@7e200000/uart1-ctsrts-gpio16"; + uart1_gpio32 = "/soc/gpio@7e200000/uart1-gpio32"; + uart1_ctsrts_gpio30 = "/soc/gpio@7e200000/uart1-ctsrts-gpio30"; + uart1_gpio40 = "/soc/gpio@7e200000/uart1-gpio40"; + uart1_ctsrts_gpio42 = "/soc/gpio@7e200000/uart1-ctsrts-gpio42"; + gpclk0_gpio49 = "/soc/gpio@7e200000/gpclk0-gpio49"; + gpclk1_gpio50 = "/soc/gpio@7e200000/gpclk1-gpio50"; + gpclk2_gpio51 = "/soc/gpio@7e200000/gpclk2-gpio51"; + i2c0_gpio46 = "/soc/gpio@7e200000/i2c0if-gpio46"; + i2c1_gpio46 = "/soc/gpio@7e200000/i2c1-gpio46"; + i2c3_gpio2 = "/soc/gpio@7e200000/i2c3-gpio2"; + i2c3_gpio4 = "/soc/gpio@7e200000/i2c3-gpio4"; + i2c4_gpio6 = "/soc/gpio@7e200000/i2c4-gpio6"; + i2c4_gpio8 = "/soc/gpio@7e200000/i2c4-gpio8"; + i2c5_gpio10 = "/soc/gpio@7e200000/i2c5-gpio10"; + i2c5_gpio12 = "/soc/gpio@7e200000/i2c5-gpio12"; + i2c6_gpio0 = "/soc/gpio@7e200000/i2c6-gpio0"; + i2c6_gpio22 = "/soc/gpio@7e200000/i2c6-gpio22"; + i2c_slave_gpio8 = "/soc/gpio@7e200000/i2c-slave-gpio8"; + jtag_gpio48 = "/soc/gpio@7e200000/jtag-gpio48"; + mii_gpio28 = "/soc/gpio@7e200000/mii-gpio28"; + mii_gpio36 = "/soc/gpio@7e200000/mii-gpio36"; + pcm_gpio50 = "/soc/gpio@7e200000/pcm-gpio50"; + pwm0_0_gpio12 = "/soc/gpio@7e200000/pwm0-0-gpio12"; + pwm0_0_gpio18 = "/soc/gpio@7e200000/pwm0-0-gpio18"; + pwm1_0_gpio40 = "/soc/gpio@7e200000/pwm1-0-gpio40"; + pwm0_1_gpio13 = "/soc/gpio@7e200000/pwm0-1-gpio13"; + pwm0_1_gpio19 = "/soc/gpio@7e200000/pwm0-1-gpio19"; + pwm1_1_gpio41 = "/soc/gpio@7e200000/pwm1-1-gpio41"; + pwm0_1_gpio45 = "/soc/gpio@7e200000/pwm0-1-gpio45"; + pwm0_0_gpio52 = "/soc/gpio@7e200000/pwm0-0-gpio52"; + pwm0_1_gpio53 = "/soc/gpio@7e200000/pwm0-1-gpio53"; + rgmii_gpio35 = "/soc/gpio@7e200000/rgmii-gpio35"; + rgmii_irq_gpio34 = "/soc/gpio@7e200000/rgmii-irq-gpio34"; + rgmii_irq_gpio39 = "/soc/gpio@7e200000/rgmii-irq-gpio39"; + rgmii_mdio_gpio28 = "/soc/gpio@7e200000/rgmii-mdio-gpio28"; + rgmii_mdio_gpio37 = "/soc/gpio@7e200000/rgmii-mdio-gpio37"; + spi0_gpio46 = "/soc/gpio@7e200000/spi0-gpio46"; + spi2_gpio46 = "/soc/gpio@7e200000/spi2-gpio46"; + spi3_gpio0 = "/soc/gpio@7e200000/spi3-gpio0"; + spi4_gpio4 = "/soc/gpio@7e200000/spi4-gpio4"; + spi5_gpio12 = "/soc/gpio@7e200000/spi5-gpio12"; + spi6_gpio18 = "/soc/gpio@7e200000/spi6-gpio18"; + uart2_gpio0 = "/soc/gpio@7e200000/uart2-gpio0"; + uart2_ctsrts_gpio2 = "/soc/gpio@7e200000/uart2-ctsrts-gpio2"; + uart3_gpio4 = "/soc/gpio@7e200000/uart3-gpio4"; + uart3_ctsrts_gpio6 = "/soc/gpio@7e200000/uart3-ctsrts-gpio6"; + uart4_gpio8 = "/soc/gpio@7e200000/uart4-gpio8"; + uart4_ctsrts_gpio10 = "/soc/gpio@7e200000/uart4-ctsrts-gpio10"; + uart5_gpio12 = "/soc/gpio@7e200000/uart5-gpio12"; + uart5_ctsrts_gpio14 = "/soc/gpio@7e200000/uart5-ctsrts-gpio14"; + gpioout = "/soc/gpio@7e200000/gpioout"; + alt0 = "/soc/gpio@7e200000/alt0"; + dpi_18bit_cpadhi_gpio0 = "/soc/gpio@7e200000/dpi_18bit_cpadhi_gpio0"; + dpi_18bit_cpadhi_gpio2 = "/soc/gpio@7e200000/dpi_18bit_cpadhi_gpio2"; + dpi_18bit_gpio0 = "/soc/gpio@7e200000/dpi_18bit_gpio0"; + dpi_18bit_gpio2 = "/soc/gpio@7e200000/dpi_18bit_gpio2"; + dpi_16bit_gpio0 = "/soc/gpio@7e200000/dpi_16bit_gpio0"; + dpi_16bit_gpio2 = "/soc/gpio@7e200000/dpi_16bit_gpio2"; + dpi_16bit_cpadhi_gpio0 = "/soc/gpio@7e200000/dpi_16bit_cpadhi_gpio0"; + dpi_16bit_cpadhi_gpio2 = "/soc/gpio@7e200000/dpi_16bit_cpadhi_gpio2"; + spi0_pins = "/soc/gpio@7e200000/spi0_pins"; + spi0_cs_pins = "/soc/gpio@7e200000/spi0_cs_pins"; + spi3_pins = "/soc/gpio@7e200000/spi3_pins"; + spi3_cs_pins = "/soc/gpio@7e200000/spi3_cs_pins"; + spi4_pins = "/soc/gpio@7e200000/spi4_pins"; + spi4_cs_pins = "/soc/gpio@7e200000/spi4_cs_pins"; + spi5_pins = "/soc/gpio@7e200000/spi5_pins"; + spi5_cs_pins = "/soc/gpio@7e200000/spi5_cs_pins"; + spi6_pins = "/soc/gpio@7e200000/spi6_pins"; + spi6_cs_pins = "/soc/gpio@7e200000/spi6_cs_pins"; + i2c0_pins = "/soc/gpio@7e200000/i2c0"; + i2c1_pins = "/soc/gpio@7e200000/i2c1"; + i2c3_pins = "/soc/gpio@7e200000/i2c3"; + i2c4_pins = "/soc/gpio@7e200000/i2c4"; + i2c5_pins = "/soc/gpio@7e200000/i2c5"; + i2c6_pins = "/soc/gpio@7e200000/i2c6"; + i2s_pins = "/soc/gpio@7e200000/i2s"; + sdio_pins = "/soc/gpio@7e200000/sdio_pins"; + uart2_pins = "/soc/gpio@7e200000/uart2_pins"; + uart3_pins = "/soc/gpio@7e200000/uart3_pins"; + uart4_pins = "/soc/gpio@7e200000/uart4_pins"; + uart5_pins = "/soc/gpio@7e200000/uart5_pins"; + bt_pins = "/soc/gpio@7e200000/bt_pins"; + uart0_pins = "/soc/gpio@7e200000/uart0_pins"; + uart1_pins = "/soc/gpio@7e200000/uart1_pins"; + uart1_bt_pins = "/soc/gpio@7e200000/uart1_bt_pins"; + audio_pins = "/soc/gpio@7e200000/audio_pins"; + uart0 = "/soc/serial@7e201000"; + bt = "/soc/serial@7e201000/bluetooth"; + sdhost = "/soc/mmc@7e202000"; + i2s_clk_consumer = "/soc/i2s@7e203000"; + i2s_clk_producer = "/soc/i2s@7e203000"; + i2s = "/soc/i2s@7e203000"; + spi0 = "/soc/spi@7e204000"; + spi = "/soc/spi@7e204000"; + spidev0 = "/soc/spi@7e204000/spidev@0"; + spidev1 = "/soc/spi@7e204000/spidev@1"; + i2c0if = "/soc/i2c@7e205000"; + dpi = "/soc/dpi@7e208000"; + dsi0 = "/soc/dsi@7e209000"; + aux = "/soc/aux@7e215000"; + uart1 = "/soc/serial@7e215040"; + minibt = "/soc/serial@7e215040/bluetooth"; + spi1 = "/soc/spi@7e215080"; + spi2 = "/soc/spi@7e2150c0"; + pwm = "/soc/pwm@7e20c000"; + mmc = "/soc/mmc@7e300000"; + sdhci = "/soc/mmc@7e300000"; + hvs = "/soc/hvs@7e400000"; + dsi1 = "/soc/dsi@7e700000"; + csi0 = "/soc/csi@7e800000"; + csi1 = "/soc/csi@7e801000"; + i2c_arm = "/soc/i2c@7e804000"; + i2c1 = "/soc/i2c@7e804000"; + usb = "/soc/usb@7e980000"; + local_intc = "/soc/interrupt-controller@40000000"; + gicv2 = "/soc/interrupt-controller@40041000"; + avs_monitor = "/soc/avs-monitor@7d5d2000"; + thermal = "/soc/avs-monitor@7d5d2000/thermal"; + dma = "/soc/dma-controller@7e007000"; + watchdog = "/soc/watchdog@7e100000"; + pm = "/soc/watchdog@7e100000"; + random = "/soc/rng@7e104000"; + uart2 = "/soc/serial@7e201400"; + uart3 = "/soc/serial@7e201600"; + uart4 = "/soc/serial@7e201800"; + uart5 = "/soc/serial@7e201a00"; + spi3 = "/soc/spi@7e204600"; + spi4 = "/soc/spi@7e204800"; + spi5 = "/soc/spi@7e204a00"; + spi6 = "/soc/spi@7e204c00"; + i2c3 = "/soc/i2c@7e205600"; + i2c4 = "/soc/i2c@7e205800"; + i2c5 = "/soc/i2c@7e205a00"; + i2c6 = "/soc/i2c@7e205c00"; + pixelvalve0 = "/soc/pixelvalve@7e206000"; + pixelvalve1 = "/soc/pixelvalve@7e207000"; + pixelvalve2 = "/soc/pixelvalve@7e20a000"; + pwm1 = "/soc/pwm@7e20c800"; + pixelvalve4 = "/soc/pixelvalve@7e216000"; + pixelvalve3 = "/soc/pixelvalve@7ec12000"; + vec = "/soc/vec@7ec13000"; + dvp = "/soc/clock@7ef00000"; + aon_intr = "/soc/interrupt-controller@7ef00100"; + hdmi0 = "/soc/hdmi@7ef00700"; + ddc0 = "/soc/i2c@7ef04500"; + hdmi1 = "/soc/hdmi@7ef05700"; + ddc1 = "/soc/i2c@7ef09500"; + firmware = "/soc/firmware"; + firmware_clocks = "/soc/firmware/clocks"; + expgpio = "/soc/firmware/gpio"; + reset = "/soc/firmware/reset"; + vcio = "/soc/firmware/vcio"; + power = "/soc/power"; + vchiq = "/soc/mailbox@7e00b840"; + mmcnr = "/soc/mmcnr@7e300000"; + brcmf = "/soc/mmcnr@7e300000/wifi@1"; + firmwarekms = "/soc/firmwarekms@7e600000"; + smi = "/soc/smi@7e600000"; + axiperf = "/soc/axiperf"; + i2c0mux = "/soc/i2c0mux"; + i2c_csi_dsi0 = "/soc/i2c0mux/i2c@0"; + i2c_vc = "/soc/i2c0mux/i2c@0"; + i2c0 = "/soc/i2c0mux/i2c@0"; + i2c_csi_dsi = "/soc/i2c0mux/i2c@1"; + fb = "/soc/fb"; + sound = "/soc/sound"; + nvmem_otp = "/soc/nvmem/nvmem_otp"; + nvmem_cust = "/soc/nvmem/nvmem_cust"; + nvmem_priv = "/soc/nvmem/nvmem_priv"; + clk_osc = "/clocks/clk-osc"; + clk_usb = "/clocks/clk-usb"; + usbphy = "/phy"; + vc4 = "/gpu"; + clk_27MHz = "/clk-27M"; + clk_108MHz = "/clk-108M"; + emmc2bus = "/emmc2bus"; + emmc2 = "/emmc2bus/mmc@7e340000"; + cpus = "/cpus"; + cpu0 = "/cpus/cpu@0"; + cpu1 = "/cpus/cpu@1"; + cpu2 = "/cpus/cpu@2"; + cpu3 = "/cpus/cpu@3"; + l2 = "/cpus/l2-cache0"; + scb = "/scb"; + pcie0 = "/scb/pcie@7d500000"; + genet = "/scb/ethernet@7d580000"; + genet_mdio = "/scb/ethernet@7d580000/mdio@e14"; + phy1 = "/scb/ethernet@7d580000/mdio@e14/ethernet-phy@1"; + hevc_dec = "/scb/codec@7eb10000"; + dma40 = "/scb/dma@7e007b00"; + xhci = "/scb/xhci@7e9c0000"; + leds = "/leds"; + led_act = "/leds/led-act"; + led_pwr = "/leds/led-pwr"; + cam1_clk = "/cam1_clk"; + cam0_regulator = "/cam0_regulator"; + cam0_clk = "/cam0_clk"; + cam0_reg = "/cam_dummy_reg"; + cam_dummy_reg = "/cam_dummy_reg"; + cam1_reg = "/regulator-cam1"; + sd_io_1v8_reg = "/regulator-sd-io-1v8"; + sd_vcc_reg = "/regulator-sd-vcc"; + vdd_3v3_reg = "/fixedregulator_3v3"; + vdd_5v0_reg = "/fixedregulator_5v0"; + v3dbus = "/v3dbus"; + v3d = "/v3dbus/v3d@7ec04000"; + }; +}; diff --git a/dtbs/rpi5b.dts b/dtbs/rpi5b.dts new file mode 100644 index 00000000..6b49f3ba --- /dev/null +++ b/dtbs/rpi5b.dts @@ -0,0 +1,3292 @@ +/dts-v1/; + +/ { + compatible = "raspberrypi,5-model-b", "brcm,bcm2712"; + #address-cells = <0x02>; + #size-cells = <0x01>; + interrupt-parent = <0x01>; + model = "Raspberry Pi 5"; + + clocks { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0x76>; + + clk-osc { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "osc"; + clock-frequency = <0x337f980>; + phandle = <0x77>; + }; + + clk-vpu { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0x2cb41780>; + clock-output-names = "vpu-clock"; + phandle = <0x0f>; + }; + + clk-uart { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0x8ca000>; + clock-output-names = "uart-clock"; + phandle = <0x0e>; + }; + + clk-emmc2 { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0xbebc200>; + clock-output-names = "emmc2-clock"; + phandle = <0x08>; + }; + + clk-usb { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "otg"; + clock-frequency = <0x1c9c3800>; + phandle = <0x46>; + }; + + clk_xosc { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "xosc"; + clock-frequency = <0x2faf080>; + phandle = <0x29>; + }; + + sdio_src { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "src"; + clock-frequency = <0x3b9aca00>; + phandle = <0x3c>; + }; + + sdhci_core { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "core"; + clock-frequency = <0x2faf080>; + phandle = <0x3d>; + }; + + clksrc_gp0 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x21>; + clock-output-names = "clksrc_gp0"; + phandle = <0x78>; + }; + + clksrc_gp1 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x22>; + clock-output-names = "clksrc_gp1"; + phandle = <0x79>; + }; + + clksrc_gp2 { + status = "disabled"; + compatible = "fixed-factor-clock"; + clock-div = <0x01>; + clock-mult = <0x01>; + #clock-cells = <0x00>; + clocks = <0x02 0x23>; + clock-output-names = "clksrc_gp2"; + phandle = <0x7a>; + }; + + clksrc_gp3 { + status = "disabled"; + compatible = "fixed-factor-clock"; + clock-div = <0x01>; + clock-mult = <0x01>; + #clock-cells = <0x00>; + clocks = <0x02 0x24>; + clock-output-names = "clksrc_gp3"; + phandle = <0x7b>; + }; + + clksrc_gp4 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x25>; + clock-output-names = "clksrc_gp4"; + phandle = <0x7c>; + }; + + clksrc_gp5 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x26>; + clock-output-names = "clksrc_gp5"; + phandle = <0x7d>; + }; + }; + + cpus { + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0x7e>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x00>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x03>; + phandle = <0x4e>; + + l2-cache-l0 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x03>; + }; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x100>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x05>; + phandle = <0x4f>; + + l2-cache-l1 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x05>; + }; + }; + + cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x200>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x06>; + phandle = <0x50>; + + l2-cache-l2 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x06>; + }; + }; + + cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x300>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x07>; + phandle = <0x51>; + + l2-cache-l3 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x07>; + }; + }; + + l3-cache { + compatible = "cache"; + cache-size = <0x200000>; + cache-line-size = <0x40>; + cache-sets = <0x800>; + cache-level = <0x03>; + cache-unified; + phandle = <0x04>; + }; + }; + + psci { + method = "smc"; + compatible = "arm,psci-1.0", "arm,psci-0.2"; + }; + + reserved-memory { + ranges; + #address-cells = <0x02>; + #size-cells = <0x01>; + phandle = <0x7f>; + + atf@0 { + reg = <0x00 0x00 0x80000>; + no-map; + }; + + linux,cma { + compatible = "shared-dma-pool"; + size = <0x4000000>; + reusable; + linux,cma-default; + alloc-ranges = <0x00 0x00 0x40000000>; + phandle = <0x80>; + }; + + nvram@0 { + compatible = "raspberrypi,bootloader-config", "nvmem-rmem"; + #address-cells = <0x01>; + #size-cells = <0x01>; + reg = <0x00 0x00 0x00>; + no-map; + status = "disabled"; + phandle = <0x81>; + }; + + nvram@1 { + compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem"; + #address-cells = <0x01>; + #size-cells = <0x01>; + reg = <0x00 0x00 0x00>; + no-map; + status = "disabled"; + phandle = <0x82>; + }; + }; + + soc@107c000000 { + compatible = "simple-bus"; + ranges = <0x00 0x10 0x00 0x80000000>; + #address-cells = <0x01>; + #size-cells = <0x01>; + phandle = <0x83>; + + reset-controller@119500 { + compatible = "brcm,bcm7216-pcie-sata-rescal"; + reg = <0x119500 0x10>; + #reset-cells = <0x00>; + phandle = <0x23>; + }; + + mmc@fff000 { + compatible = "brcm,bcm2712-sdhci", "brcm,sdhci-brcmstb"; + reg = <0xfff000 0x260 0xfff400 0x200>; + reg-names = "host", "cfg"; + interrupts = <0x00 0x111 0x04>; + clocks = <0x08>; + clock-names = "sw_sdio"; + mmc-ddr-3_3v; + pinctrl-0 = <0x09 0x0a>; + pinctrl-names = "default"; + vqmmc-supply = <0x0b>; + vmmc-supply = <0x0c>; + bus-width = <0x04>; + sd-uhs-sdr50; + sd-uhs-ddr50; + sd-uhs-sdr104; + supports-cqe = <0x01>; + cd-gpios = <0x0d 0x05 0x01>; + status = "okay"; + phandle = <0x74>; + }; + + reset-controller@1504318 { + compatible = "brcm,brcmstb-reset"; + reg = <0x1504318 0x30>; + #reset-cells = <0x01>; + phandle = <0x24>; + }; + + timer@7c003000 { + compatible = "brcm,bcm2835-system-timer"; + reg = <0x7c003000 0x1000>; + interrupts = <0x00 0x40 0x04 0x00 0x41 0x04 0x00 0x42 0x04 0x00 0x43 0x04>; + clock-frequency = <0xf4240>; + phandle = <0x84>; + }; + + mailbox@7c013880 { + compatible = "brcm,bcm2835-mbox"; + reg = <0x7c013880 0x40>; + interrupts = <0x00 0x21 0x04>; + #mbox-cells = <0x00>; + phandle = <0x22>; + }; + + interrupt-controller@7cd00000 { + compatible = "brcm,bcm2836-l1-intc"; + reg = <0x7cd00000 0x100>; + phandle = <0x85>; + }; + + serial@7d001000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7d001000 0x200>; + interrupts = <0x00 0x79 0x04>; + clocks = <0x0e 0x0f>; + clock-names = "uartclk", "apb_pclk"; + arm,primecell-periphid = <0x341011>; + status = "okay"; + phandle = <0x86>; + }; + + interrupt-controller@7d517000 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d517000 0x10>; + interrupts = <0x00 0xf7 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + }; + + gpio@7d517c00 { + compatible = "brcm,brcmstb-gpio"; + reg = <0x7d517c00 0x40>; + gpio-controller; + #gpio-cells = <0x02>; + brcm,gpio-bank-widths = <0x11 0x06>; + brcm,gpio-direct; + gpio-line-names = "RP1_SDA", "RP1_SCL", "RP1_RUN", "SD_IOVDD_SEL", "SD_PWR_ON", "SD_CDET_N", "SD_FLG_N", "-", "2712_WAKE", "2712_STAT_LED", "-", "-", "PMIC_INT", "UART_TX_FS", "UART_RX_FS", "-", "-", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "HDMI0_SCL", "HDMI0_SDA", "HDMI1_SCL", "HDMI1_SDA", "PMIC_SCL", "PMIC_SDA"; + phandle = <0x0d>; + + rp1_run_hog { + gpio-hog; + gpios = <0x02 0x00>; + output-high; + line-name = "RP1 RUN pin"; + }; + }; + + interrupt-controller@7fff9000 { + compatible = "arm,gic-400"; + reg = <0x7fff9000 0x1000 0x7fffa000 0x2000 0x7fffc000 0x2000 0x7fffe000 0x2000>; + interrupt-controller; + #interrupt-cells = <0x03>; + interrupts = <0x01 0x09 0xf04>; + phandle = <0x01>; + }; + + interrupt-controller@7d510600 { + compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; + reg = <0x7d510600 0x30>; + interrupts = <0x00 0xef 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x14>; + }; + + pixelvalve@7c410000 { + compatible = "brcm,bcm2712-pixelvalve0"; + reg = <0x7c410000 0x100>; + interrupts = <0x00 0x65 0x04>; + status = "disabled"; + phandle = <0x87>; + }; + + pixelvalve@7c411000 { + compatible = "brcm,bcm2712-pixelvalve1"; + reg = <0x7c411000 0x100>; + interrupts = <0x00 0x6e 0x04>; + status = "disabled"; + phandle = <0x88>; + }; + + mop@7c500000 { + compatible = "brcm,bcm2712-mop"; + reg = <0x7c500000 0x28>; + interrupt-parent = <0x10>; + interrupts = <0x01>; + status = "disabled"; + phandle = <0x89>; + }; + + moplet@7c501000 { + compatible = "brcm,bcm2712-moplet"; + reg = <0x7c501000 0x20>; + interrupt-parent = <0x10>; + interrupts = <0x00>; + status = "disabled"; + phandle = <0x8a>; + }; + + interrupt-controller@7c502000 { + compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; + reg = <0x7c502000 0x30>; + interrupts = <0x00 0x61 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x10>; + }; + + clock@7c700000 { + compatible = "brcm,brcm2711-dvp"; + reg = <0x7c700000 0x10>; + clocks = <0x11>; + #clock-cells = <0x01>; + #reset-cells = <0x01>; + phandle = <0x13>; + }; + + i2c@7d508200 { + compatible = "brcm,brcmstb-i2c"; + reg = <0x7d508200 0x58>; + interrupt-parent = <0x12>; + interrupts = <0x01>; + clock-frequency = <0x17cdc>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + phandle = <0x15>; + }; + + i2c@7d508280 { + compatible = "brcm,brcmstb-i2c"; + reg = <0x7d508280 0x58>; + interrupt-parent = <0x12>; + interrupts = <0x02>; + clock-frequency = <0x17cdc>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + phandle = <0x19>; + }; + + intc@7d508380 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d508380 0x10>; + interrupts = <0x00 0xf2 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x12>; + }; + + intc@7d508400 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d508400 0x10>; + interrupts = <0x00 0xf4 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x1f>; + }; + + hdmi@7ef00700 { + compatible = "brcm,bcm2712-hdmi0"; + reg = <0x7c701400 0x300 0x7c701000 0x200 0x7c701d00 0x300 0x7c702000 0x80 0x7c703800 0x200 0x7c704000 0x800 0x7c700100 0x80 0x7d510800 0x100 0x7c720000 0x100>; + reg-names = "hdmi", "dvp", "phy", "rm", "packet", "metadata", "csc", "cec", "hd"; + resets = <0x13 0x01>; + interrupt-parent = <0x14>; + interrupts = <0x01 0x02 0x03 0x07 0x08>; + interrupt-names = "cec-tx", "cec-rx", "cec-low", "hpd-connected", "hpd-removed"; + ddc = <0x15>; + status = "disabled"; + dmas = <0x16 0x41fa000a>; + dma-names = "audio-rx"; + clocks = <0x17 0x0d 0x17 0x0e 0x13 0x00 0x18>; + clock-names = "hdmi", "bvb", "audio", "cec"; + phandle = <0x8b>; + }; + + hdmi@7ef05700 { + compatible = "brcm,bcm2712-hdmi1"; + reg = <0x7c706400 0x300 0x7c706000 0x200 0x7c706d00 0x300 0x7c707000 0x80 0x7c708800 0x200 0x7c709000 0x800 0x7c700180 0x80 0x7d511000 0x100 0x7c720000 0x100>; + reg-names = "hdmi", "dvp", "phy", "rm", "packet", "metadata", "csc", "cec", "hd"; + resets = <0x13 0x02>; + interrupt-parent = <0x14>; + interrupts = <0x0b 0x0c 0x0d 0x0e 0x0f>; + interrupt-names = "cec-tx", "cec-rx", "cec-low", "hpd-connected", "hpd-removed"; + ddc = <0x19>; + status = "disabled"; + dmas = <0x16 0x41fa0011>; + dma-names = "audio-rx"; + clocks = <0x17 0x0d 0x17 0x0e 0x13 0x01 0x18>; + clock-names = "hdmi", "bvb", "audio", "cec"; + phandle = <0x8c>; + }; + + axiperf@7c012800 { + compatible = "brcm,bcm2712-axiperf"; + reg = <0x7c012800 0x100 0x7e000000 0x100>; + firmware = <0x1a>; + status = "disabled"; + phandle = <0x5e>; + }; + + spi@7d004000 { + compatible = "brcm,bcm2835-spi"; + reg = <0x7d004000 0x200>; + interrupts = <0x00 0x76 0x04>; + clocks = <0x0f>; + num-cs = <0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "okay"; + dmas = <0x16 0x06 0x16 0x07>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + cs-gpios = <0x1b 0x01 0x01>; + pinctrl-0 = <0x1c 0x1d>; + phandle = <0x8d>; + + spidev@0 { + compatible = "spidev"; + reg = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x1312d00>; + status = "okay"; + phandle = <0x8e>; + }; + }; + + i2c@7d005600 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7d005600 0x20>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x0f>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + clock-frequency = <0x61a80>; + pinctrl-0 = <0x1e>; + pinctrl-names = "default"; + phandle = <0x8f>; + }; + + watchdog@7d200000 { + compatible = "brcm,bcm2712-pm"; + reg = <0x7d200000 0x308>; + reg-names = "pm"; + #power-domain-cells = <0x01>; + #reset-cells = <0x01>; + system-power-controller; + phandle = <0x4c>; + }; + + rng@7d208000 { + compatible = "brcm,bcm2711-rng200"; + reg = <0x7d208000 0x28>; + status = "okay"; + phandle = <0x6c>; + }; + + intc@7d503000 { + compatible = "brcm,l2-intc"; + reg = <0x7d503000 0x18>; + interrupts = <0x00 0xee 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x59>; + }; + + pinctrl@7d504100 { + compatible = "brcm,bcm2712-pinctrl"; + reg = <0x7d504100 0x30>; + phandle = <0x90>; + + uarta_24_pins { + phandle = <0x20>; + + pin_rts { + function = "uart0"; + pins = "gpio24"; + bias-disable; + }; + + pin_cts { + function = "uart0"; + pins = "gpio25"; + bias-pull-up; + }; + + pin_txd { + function = "uart0"; + pins = "gpio26"; + bias-disable; + }; + + pin_rxd { + function = "uart0"; + pins = "gpio27"; + bias-pull-up; + }; + }; + + sdio2_30_pins { + phandle = <0x4a>; + + pin_clk { + function = "sd2"; + pins = "gpio30"; + bias-disable; + }; + + pin_cmd { + function = "sd2"; + pins = "gpio31"; + bias-pull-up; + }; + + pins_dat { + function = "sd2"; + pins = "gpio32", "gpio33", "gpio34", "gpio35"; + bias-pull-up; + }; + }; + + pwr_button_pins { + function = "gpio"; + pins = "gpio20"; + bias-pull-up; + phandle = <0x75>; + }; + + wl_on_pins { + function = "gpio"; + pins = "gpio28"; + phandle = <0x5a>; + }; + + bt_shutdown_pins { + function = "gpio"; + pins = "gpio29"; + phandle = <0x21>; + }; + + emmc_sd_pulls { + pins = "emmc_cmd", "emmc_dat0", "emmc_dat1", "emmc_dat2", "emmc_dat3"; + bias-pull-up; + phandle = <0x09>; + }; + + spi10_gpio2 { + function = "vc_spi0"; + pins = "gpio2", "gpio3", "gpio4"; + bias-disable; + phandle = <0x1c>; + }; + + spi10_cs_gpio1 { + function = "gpio"; + pins = "gpio1"; + bias-pull-up; + phandle = <0x1d>; + }; + }; + + gpio@7d508500 { + compatible = "brcm,brcmstb-gpio"; + reg = <0x7d508500 0x40>; + interrupt-parent = <0x1f>; + interrupts = <0x00>; + gpio-controller; + #gpio-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x02>; + brcm,gpio-bank-widths = <0x20 0x04>; + brcm,gpio-direct; + gpio-line-names = "-", "2712_BOOT_CS_N", "2712_BOOT_MISO", "2712_BOOT_MOSI", "2712_BOOT_SCLK", "-", "-", "-", "-", "-", "-", "-", "-", "-", "PCIE_SDA", "PCIE_SCL", "-", "-", "-", "-", "PWR_GPIO", "2712_G21_FS", "-", "-", "BT_RTS", "BT_CTS", "BT_TXD", "BT_RXD", "WL_ON", "BT_ON", "WIFI_SDIO_CLK", "WIFI_SDIO_CMD", "WIFI_SDIO_D0", "WIFI_SDIO_D1", "WIFI_SDIO_D2", "WIFI_SDIO_D3"; + phandle = <0x1b>; + }; + + serial@7d50c000 { + compatible = "brcm,bcm7271-uart"; + reg = <0x7d50c000 0x20>; + reg-names = "uart"; + reg-shift = <0x02>; + reg-io-width = <0x04>; + interrupts = <0x00 0x114 0x04>; + skip-init; + status = "okay"; + uart-has-rtscts; + auto-flow-control; + clock-frequency = <0x5b8d800>; + pinctrl-0 = <0x20 0x21>; + pinctrl-names = "default"; + phandle = <0x91>; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <0x2dc6c0>; + shutdown-gpios = <0x1b 0x1d 0x00>; + local-bd-address = [00 00 00 00 00 00]; + phandle = <0x5f>; + }; + }; + + pinctrl@7d510700 { + compatible = "brcm,bcm2712-aon-pinctrl"; + reg = <0x7d510700 0x20>; + phandle = <0x92>; + + i2c3_m4_agpio0_pins { + function = "vc_i2c3"; + pins = "aon_gpio0", "aon_gpio1"; + bias-pull-up; + phandle = <0x1e>; + }; + + bsc_m1_agpio13_pins { + function = "bsc_m1"; + pins = "aon_gpio13", "aon_gpio14"; + bias-pull-up; + phandle = <0x93>; + }; + + bsc_pmu_sgpio4_pins { + function = "avs_pmu_bsc"; + pins = "aon_sgpio4", "aon_sgpio5"; + phandle = <0x94>; + }; + + bsc_m2_sgpio4_pins { + function = "bsc_m2"; + pins = "aon_sgpio4", "aon_sgpio5"; + phandle = <0x95>; + }; + + pwm_aon_agpio1_pins { + function = "aon_pwm"; + pins = "aon_gpio1", "aon_gpio2"; + phandle = <0x96>; + }; + + pwm_aon_agpio4_pins { + function = "vc_pwm0"; + pins = "aon_gpio4", "aon_gpio5"; + phandle = <0x97>; + }; + + pwm_aon_agpio7_pins { + function = "aon_pwm"; + pins = "aon_gpio7", "aon_gpio9"; + phandle = <0x98>; + }; + + emmc_aon_cd_pins { + function = "sd_card_g"; + pins = "aon_gpio5"; + bias-pull-up; + phandle = <0x0a>; + }; + + aon_pwm_1pin { + function = "aon_pwm"; + pins = "aon_gpio9"; + phandle = <0x99>; + }; + }; + + intc@7d517ac0 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d517ac0 0x10>; + interrupts = <0x00 0xf5 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x9a>; + }; + + avs-monitor@7d542000 { + compatible = "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"; + reg = <0x7d542000 0xf00>; + status = "okay"; + phandle = <0x9b>; + + thermal { + compatible = "brcm,bcm2711-thermal"; + #thermal-sensor-cells = <0x00>; + phandle = <0x52>; + }; + }; + + firmware { + compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; + #address-cells = <0x01>; + #size-cells = <0x01>; + mboxes = <0x22>; + dma-ranges; + phandle = <0x1a>; + + clocks { + compatible = "raspberrypi,firmware-clocks"; + #clock-cells = <0x01>; + phandle = <0x17>; + }; + + reset { + compatible = "raspberrypi,firmware-reset"; + #reset-cells = <0x01>; + phandle = <0x9c>; + }; + + vcio { + compatible = "raspberrypi,vcio"; + phandle = <0x9d>; + }; + }; + + power { + compatible = "raspberrypi,bcm2835-power"; + firmware = <0x1a>; + #power-domain-cells = <0x01>; + phandle = <0x48>; + }; + + fb { + compatible = "brcm,bcm2708-fb"; + firmware = <0x1a>; + phandle = <0x9e>; + }; + + rpi_rtc { + compatible = "raspberrypi,rpi-rtc"; + firmware = <0x1a>; + trickle-charge-microvolt = <0x00>; + phandle = <0x6d>; + }; + + nvmem { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x01>; + + nvmem_otp { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x1a>; + reg = <0x00 0xc0>; + phandle = <0x9f>; + }; + + nvmem_cust { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x1a>; + reg = <0x01 0x08>; + phandle = <0x68>; + }; + + nvmem_mac { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x1a>; + reg = <0x02 0x06>; + phandle = <0x69>; + }; + + nvmem_priv { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x1a>; + reg = <0x03 0x10>; + phandle = <0x6a>; + }; + }; + + fixedregulator_3v3 { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <0x325aa0>; + regulator-min-microvolt = <0x325aa0>; + regulator-name = "3v3"; + phandle = <0xa0>; + }; + + fixedregulator_5v0 { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <0x4c4b40>; + regulator-min-microvolt = <0x4c4b40>; + regulator-name = "5v0"; + phandle = <0xa1>; + }; + + gpiomem@7d508500 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d508500 0x40>; + chardev-name = "gpiomem1"; + }; + + gpiomem@7d517c00 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d517c00 0x40>; + chardev-name = "gpiomem2"; + }; + + gpiomem@7d504100 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d504100 0x20>; + chardev-name = "gpiomem3"; + }; + + gpiomem@7d510700 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d510700 0x20>; + chardev-name = "gpiomem4"; + }; + + sound { + status = "disabled"; + phandle = <0xa2>; + }; + }; + + axi { + compatible = "simple-bus"; + #address-cells = <0x02>; + #size-cells = <0x02>; + ranges = <0x00 0x00 0x00 0x00 0x10 0x00 0x10 0x00 0x10 0x00 0x01 0x00 0x14 0x00 0x14 0x00 0x04 0x00 0x18 0x00 0x18 0x00 0x04 0x00 0x1c 0x00 0x1c 0x00 0x04 0x00>; + dma-ranges = <0x00 0x00 0x00 0x00 0x10 0x00 0x10 0x00 0x10 0x00 0x01 0x00 0x14 0x00 0x14 0x00 0x04 0x00 0x18 0x00 0x18 0x00 0x04 0x00 0x1c 0x00 0x1c 0x00 0x04 0x00>; + phandle = <0xa3>; + + gpu { + compatible = "brcm,bcm2712-vc6"; + status = "disabled"; + phandle = <0xa4>; + }; + + pcie@1000100000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x100000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x00>; + max-link-speed = <0x02>; + num-lanes = <0x01>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xd5 0x04 0x00 0xd6 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xd1 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xd2 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xd3 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xd4 0x04>; + resets = <0x23 0x24 0x2a>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x25>; + ranges = <0x2000000 0x00 0x00 0x17 0x00 0x00 0xfffffffc 0x43000000 0x04 0x00 0x14 0x00 0x03 0x00>; + dma-ranges = <0x43000000 0x10 0x00 0x00 0x00 0x10 0x00>; + status = "disabled"; + phandle = <0x25>; + }; + + pcie@1000110000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x110000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x01>; + max-link-speed = <0x02>; + num-lanes = <0x01>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xdf 0x04 0x00 0xe0 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xdb 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xdc 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xdd 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xde 0x04>; + resets = <0x23 0x24 0x2b>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x26>; + ranges = <0x2000000 0x00 0x80000000 0x1b 0x80000000 0x00 0x80000000 0x43000000 0x04 0x00 0x18 0x00 0x03 0x80000000>; + dma-ranges = <0x3000000 0x10 0x00 0x00 0x00 0x10 0x00 0x3000000 0xff 0xfffff000 0x10 0x131000 0x00 0x1000>; + status = "disabled"; + brcm,fifo-qos-map = <0x3030303>; + brcm,clkreq-mode = "safe"; + phandle = <0x67>; + }; + + pcie@1000120000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x120000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x02>; + max-link-speed = <0x02>; + num-lanes = <0x04>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xe9 0x04 0x00 0xea 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xe5 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xe6 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xe7 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xe8 0x04>; + resets = <0x23 0x24 0x2c>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x27>; + ranges = <0x2000000 0x00 0x00 0x1f 0x00 0x00 0xfffffffc 0x43000000 0x04 0x00 0x1c 0x00 0x03 0x00>; + dma-ranges = <0x2000000 0x00 0x00 0x1f 0x00 0x00 0x400000 0x43000000 0x10 0x00 0x00 0x00 0x10 0x00 0x3000000 0xff 0xfffff000 0x10 0x130000 0x00 0x1000>; + status = "okay"; + brcm,vdm-qos-map = <0x8080809 0xa0a0b0b>; + aspm-no-l0s; + phandle = <0xa5>; + + rp1 { + compatible = "simple-bus"; + #address-cells = <0x02>; + #size-cells = <0x02>; + #interrupt-cells = <0x02>; + interrupt-controller; + interrupt-parent = <0x28>; + ranges = <0xc0 0x40000000 0x2000000 0x00 0x00 0x00 0x410000>; + dma-ranges = <0x10 0x00 0x43000000 0x10 0x00 0x10 0x00 0xc0 0x40000000 0x2000000 0x00 0x00 0x00 0x410000 0x00 0x00 0x2000000 0x10 0x00 0x10 0x00>; + phandle = <0x28>; + + mailbox@8000 { + compatible = "raspberrypi,rp1-mbox"; + status = "okay"; + reg = <0xc0 0x40008000 0x00 0x4000>; + interrupts = <0x3a 0x04>; + #mbox-cells = <0x01>; + phandle = <0x5b>; + }; + + clocks@18000 { + compatible = "raspberrypi,rp1-clocks"; + #clock-cells = <0x01>; + reg = <0xc0 0x40018000 0x00 0x10038>; + clocks = <0x29>; + assigned-clocks = <0x02 0x00 0x02 0x01 0x02 0x03 0x02 0x09 0x02 0x10 0x02 0x04 0x02 0x0a 0x02 0x0c 0x02 0x06 0x02 0x0d 0x02 0x1f 0x02 0x20 0x02 0x1d>; + assigned-clock-rates = <0x3b9aca00 0x5b8d8000 0xbebc200 0x7735940 0x7735940 0x3a98000 0x927c000 0xbebc200 0x5f5e100 0x2faf080 0xf4240 0xbebc200 0x2faf080>; + phandle = <0x02>; + }; + + serial@30000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40030000 0x00 0x100>; + interrupts = <0x19 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + pinctrl-0 = <0x2a>; + phandle = <0x70>; + }; + + serial@34000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40034000 0x00 0x100>; + interrupts = <0x2a 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa6>; + }; + + serial@38000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40038000 0x00 0x100>; + interrupts = <0x2b 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa7>; + }; + + serial@3c000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x4003c000 0x00 0x100>; + interrupts = <0x2c 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa8>; + }; + + serial@40000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40040000 0x00 0x100>; + interrupts = <0x2d 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa9>; + }; + + serial@44000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40044000 0x00 0x100>; + interrupts = <0x2e 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xaa>; + }; + + spi@4c000 { + reg = <0xc0 0x4004c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x38 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x37 0x2b 0x36>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xab>; + }; + + spi@50000 { + reg = <0xc0 0x40050000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x13 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x0d 0x2b 0x0c>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x2c 0x2d>; + cs-gpios = <0x2e 0x08 0x01 0x2e 0x07 0x01>; + phandle = <0x6e>; + + spidev@0 { + compatible = "spidev"; + reg = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x7735940>; + phandle = <0xac>; + }; + + spidev@1 { + compatible = "spidev"; + reg = <0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x7735940>; + phandle = <0xad>; + }; + }; + + spi@54000 { + reg = <0xc0 0x40054000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x14 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x0f 0x2b 0x0e>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xae>; + }; + + spi@58000 { + reg = <0xc0 0x40058000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x15 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x11 0x2b 0x10>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x2f>; + phandle = <0xaf>; + }; + + spi@5c000 { + reg = <0xc0 0x4005c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x16 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x13 0x2b 0x12>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x30>; + phandle = <0xb0>; + }; + + spi@60000 { + reg = <0xc0 0x40060000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x17 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x00>; + #size-cells = <0x00>; + num-cs = <0x01>; + spi-slave; + dmas = <0x2b 0x15 0x2b 0x14>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x31>; + phandle = <0xb1>; + + slave { + compatible = "spidev"; + spi-max-frequency = <0xf4240>; + }; + }; + + spi@64000 { + reg = <0xc0 0x40064000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x18 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x17 0x2b 0x16>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x32>; + phandle = <0xb2>; + }; + + spi@68000 { + reg = <0xc0 0x40068000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x36 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x33 0x2b 0x32>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xb3>; + }; + + spi@6c000 { + reg = <0xc0 0x4006c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x37 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x00>; + #size-cells = <0x00>; + num-cs = <0x01>; + spi-slave; + dmas = <0x2b 0x35 0x2b 0x34>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xb4>; + + slave { + compatible = "spidev"; + spi-max-frequency = <0xf4240>; + }; + }; + + i2c@70000 { + reg = <0xc0 0x40070000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x07 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-0 = <0x33>; + pinctrl-names = "default"; + clock-frequency = <0x186a0>; + phandle = <0x66>; + }; + + i2c@74000 { + reg = <0xc0 0x40074000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x08 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x34>; + clock-frequency = <0x186a0>; + phandle = <0x63>; + }; + + i2c@78000 { + reg = <0xc0 0x40078000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x09 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x35>; + phandle = <0xb5>; + }; + + i2c@7c000 { + reg = <0xc0 0x4007c000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0a 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x36>; + phandle = <0xb6>; + }; + + i2c@80000 { + reg = <0xc0 0x40080000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0b 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-0 = <0x37>; + pinctrl-names = "default"; + clock-frequency = <0x186a0>; + symlink = "i2c-4"; + phandle = <0x64>; + }; + + i2c@84000 { + reg = <0xc0 0x40084000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0c 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + phandle = <0xb7>; + }; + + i2c@88000 { + reg = <0xc0 0x40088000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0d 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-0 = <0x38>; + pinctrl-names = "default"; + clock-frequency = <0x186a0>; + symlink = "i2c-6"; + phandle = <0x65>; + }; + + audio_out@94000 { + compatible = "raspberrypi,rp1-audio-out"; + reg = <0xc0 0x40094000 0x00 0x4000>; + clocks = <0x02 0x14>; + assigned-clocks = <0x02 0x14>; + assigned-clock-rates = <0x927c000>; + assigned-clock-parents = <0x02 0x0a>; + dmas = <0x2b 0x1d>; + dma-maxburst = <0x04>; + dma-names = "tx"; + #sound-dai-cells = <0x00>; + status = "disabled"; + phandle = <0xb8>; + }; + + pwm@98000 { + compatible = "raspberrypi,rp1-pwm"; + reg = <0xc0 0x40098000 0x00 0x100>; + #pwm-cells = <0x03>; + clocks = <0x02 0x11>; + assigned-clocks = <0x02 0x11>; + assigned-clock-rates = <0x2faf080>; + status = "disabled"; + phandle = <0xb9>; + }; + + pwm@9c000 { + compatible = "raspberrypi,rp1-pwm"; + reg = <0xc0 0x4009c000 0x00 0x100>; + #pwm-cells = <0x03>; + clocks = <0x02 0x12>; + assigned-clocks = <0x02 0x12>; + assigned-clock-rates = <0x2faf080>; + status = "disabled"; + pinctrl-0 = <0x39>; + pinctrl-names = "default"; + phandle = <0x61>; + }; + + i2s@a0000 { + reg = <0xc0 0x400a0000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + clock-names = "i2sclk"; + #sound-dai-cells = <0x00>; + dmas = <0x2b 0x20 0x2b 0x1f>; + dma-names = "tx", "rx"; + dma-maxburst = <0x04>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x3a>; + phandle = <0xba>; + }; + + i2s@a4000 { + reg = <0xc0 0x400a4000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + clock-names = "i2sclk"; + #sound-dai-cells = <0x00>; + dmas = <0x2b 0x22 0x2b 0x21>; + dma-names = "tx", "rx"; + dma-maxburst = <0x04>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x3b>; + phandle = <0xbb>; + }; + + i2s@a8000 { + reg = <0xc0 0x400a8000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + status = "disabled"; + phandle = <0xbc>; + }; + + sdio_clk0@b0004 { + compatible = "raspberrypi,rp1-sdio-clk"; + reg = <0xc0 0x400b0004 0x00 0x1c>; + clocks = <0x3c 0x3d>; + clock-names = "src", "base"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x42>; + }; + + sdio_clk1@b4004 { + compatible = "raspberrypi,rp1-sdio-clk"; + reg = <0xc0 0x400b4004 0x00 0x1c>; + clocks = <0x3c 0x3d>; + clock-names = "src", "base"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x43>; + }; + + adc@c8000 { + compatible = "raspberrypi,rp1-adc"; + reg = <0xc0 0x400c8000 0x00 0x4000>; + clocks = <0x02 0x1e>; + clock-names = "adcclk"; + #clock-cells = <0x00>; + vref-supply = <0x3e>; + status = "okay"; + phandle = <0xbd>; + }; + + gpio@d0000 { + reg = <0xc0 0x400d0000 0x00 0xc000 0xc0 0x400e0000 0x00 0xc000 0xc0 0x400f0000 0x00 0xc000>; + compatible = "raspberrypi,rp1-gpio"; + interrupts = <0x00 0x04 0x01 0x04 0x02 0x04>; + gpio-controller; + #gpio-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x02>; + gpio-ranges = <0x2e 0x00 0x00 0x36>; + status = "okay"; + gpio-line-names = "ID_SDA", "ID_SCL", "GPIO2", "GPIO3", "GPIO4", "GPIO5", "GPIO6", "GPIO7", "GPIO8", "GPIO9", "GPIO10", "GPIO11", "GPIO12", "GPIO13", "GPIO14", "GPIO15", "GPIO16", "GPIO17", "GPIO18", "GPIO19", "GPIO20", "GPIO21", "GPIO22", "GPIO23", "GPIO24", "GPIO25", "GPIO26", "GPIO27", "PCIE_RP1_WAKE", "FAN_TACH", "HOST_SDA", "HOST_SCL", "ETH_RST_N", "-", "CD0_IO0_MICCLK", "CD0_IO0_MICDAT0", "RP1_PCIE_CLKREQ_N", "-", "CD0_SDA", "CD0_SCL", "CD1_SDA", "CD1_SCL", "USB_VBUS_EN", "USB_OC_N", "RP1_STAT_LED", "FAN_PWM", "CD1_IO0_MICCLK", "2712_WAKE", "CD1_IO1_MICDAT1", "EN_MAX_USB_CUR", "-", "-", "-", "-"; + phandle = <0x2e>; + + rp1_uart0_14_15 { + phandle = <0x2a>; + + pin_txd { + function = "uart0"; + pins = "gpio14"; + bias-disable; + }; + + pin_rxd { + function = "uart0"; + pins = "gpio15"; + bias-pull-up; + }; + }; + + rp1_uart0_ctsrts_16_17 { + phandle = <0xbe>; + + pin_cts { + function = "uart0"; + pins = "gpio16"; + bias-pull-up; + }; + + pin_rts { + function = "uart0"; + pins = "gpio17"; + bias-disable; + }; + }; + + rp1_uart1_0_1 { + phandle = <0xbf>; + + pin_txd { + function = "uart1"; + pins = "gpio0"; + bias-disable; + }; + + pin_rxd { + function = "uart1"; + pins = "gpio1"; + bias-pull-up; + }; + }; + + rp1_uart1_ctsrts_2_3 { + phandle = <0xc0>; + + pin_cts { + function = "uart1"; + pins = "gpio2"; + bias-pull-up; + }; + + pin_rts { + function = "uart1"; + pins = "gpio3"; + bias-disable; + }; + }; + + rp1_uart2_4_5 { + phandle = <0xc1>; + + pin_txd { + function = "uart2"; + pins = "gpio4"; + bias-disable; + }; + + pin_rxd { + function = "uart2"; + pins = "gpio5"; + bias-pull-up; + }; + }; + + rp1_uart2_ctsrts_6_7 { + phandle = <0xc2>; + + pin_cts { + function = "uart2"; + pins = "gpio6"; + bias-pull-up; + }; + + pin_rts { + function = "uart2"; + pins = "gpio7"; + bias-disable; + }; + }; + + rp1_uart3_8_9 { + phandle = <0xc3>; + + pin_txd { + function = "uart3"; + pins = "gpio8"; + bias-disable; + }; + + pin_rxd { + function = "uart3"; + pins = "gpio9"; + bias-pull-up; + }; + }; + + rp1_uart3_ctsrts_10_11 { + phandle = <0xc4>; + + pin_cts { + function = "uart3"; + pins = "gpio10"; + bias-pull-up; + }; + + pin_rts { + function = "uart3"; + pins = "gpio11"; + bias-disable; + }; + }; + + rp1_uart4_12_13 { + phandle = <0xc5>; + + pin_txd { + function = "uart4"; + pins = "gpio12"; + bias-disable; + }; + + pin_rxd { + function = "uart4"; + pins = "gpio13"; + bias-pull-up; + }; + }; + + rp1_uart4_ctsrts_14_15 { + phandle = <0xc6>; + + pin_cts { + function = "uart4"; + pins = "gpio14"; + bias-pull-up; + }; + + pin_rts { + function = "uart4"; + pins = "gpio15"; + bias-disable; + }; + }; + + rp1_sdio0_22_27 { + phandle = <0xc7>; + + pin_clk { + function = "sd0"; + pins = "gpio22"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pin_cmd { + function = "sd0"; + pins = "gpio23"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pins_dat { + function = "sd0"; + pins = "gpio24", "gpio25", "gpio26", "gpio27"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + }; + + rp1_sdio1_28_33 { + phandle = <0xc8>; + + pin_clk { + function = "sd1"; + pins = "gpio28"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pin_cmd { + function = "sd1"; + pins = "gpio29"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pins_dat { + function = "sd1"; + pins = "gpio30", "gpio31", "gpio32", "gpio33"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + }; + + rp1_i2s0_18_21 { + function = "i2s0"; + pins = "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0x3a>; + }; + + rp1_i2s1_18_21 { + function = "i2s1"; + pins = "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0x3b>; + }; + + rp1_i2c4_34_35 { + function = "i2c4"; + pins = "gpio34", "gpio35"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xc9>; + }; + + rp1_i2c6_38_39 { + function = "i2c6"; + pins = "gpio38", "gpio39"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x38>; + }; + + rp1_i2c4_40_41 { + function = "i2c4"; + pins = "gpio40", "gpio41"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x37>; + }; + + rp1_i2c5_44_45 { + function = "i2c5"; + pins = "gpio44", "gpio45"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xca>; + }; + + rp1_i2c0_0_1 { + function = "i2c0"; + pins = "gpio0", "gpio1"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x33>; + }; + + rp1_i2c0_8_9 { + function = "i2c0"; + pins = "gpio8", "gpio9"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcb>; + }; + + rp1_i2c1_2_3 { + function = "i2c1"; + pins = "gpio2", "gpio3"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x34>; + }; + + rp1_i2c1_10_11 { + function = "i2c1"; + pins = "gpio10", "gpio11"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcc>; + }; + + rp1_i2c2_4_5 { + function = "i2c2"; + pins = "gpio4", "gpio5"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x35>; + }; + + rp1_i2c2_12_13 { + function = "i2c2"; + pins = "gpio12", "gpio13"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcd>; + }; + + rp1_i2c3_6_7 { + function = "i2c3"; + pins = "gpio6", "gpio7"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x36>; + }; + + rp1_i2c3_14_15 { + function = "i2c3"; + pins = "gpio14", "gpio15"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xce>; + }; + + rp1_i2c3_22_23 { + function = "i2c3"; + pins = "gpio22", "gpio23"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcf>; + }; + + rp1_dpi_16bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19"; + bias-disable; + phandle = <0xd0>; + }; + + rp1_dpi_16bit_cpadhi_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24"; + bias-disable; + phandle = <0xd1>; + }; + + rp1_dpi_16bit_pad666_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xd2>; + }; + + rp1_dpi_18bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0xd3>; + }; + + rp1_dpi_18bit_cpadhi_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xd4>; + }; + + rp1_dpi_24bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27"; + bias-disable; + phandle = <0xd5>; + }; + + rp1_dpi_hvsync { + function = "dpi"; + pins = "gpio2", "gpio3"; + bias-disable; + phandle = <0xd6>; + }; + + rp1_dpi_16bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19"; + bias-disable; + phandle = <0xd7>; + }; + + rp1_dpi_16bit_cpadhi_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24"; + bias-disable; + phandle = <0xd8>; + }; + + rp1_dpi_16bit_pad666_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xd9>; + }; + + rp1_dpi_18bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0xda>; + }; + + rp1_dpi_18bit_cpadhi_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xdb>; + }; + + rp1_dpi_24bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27"; + bias-disable; + phandle = <0xdc>; + }; + + rp1_gpclksrc0_gpio4 { + function = "gpclk0"; + pins = "gpio4"; + bias-disable; + phandle = <0xdd>; + }; + + rp1_gpclksrc0_gpio20 { + function = "gpclk0"; + pins = "gpio20"; + bias-disable; + phandle = <0xde>; + }; + + rp1_gpclksrc1_gpio5 { + function = "gpclk1"; + pins = "gpio5"; + bias-disable; + phandle = <0xdf>; + }; + + rp1_gpclksrc1_gpio18 { + function = "gpclk1"; + pins = "gpio18"; + bias-disable; + phandle = <0xe0>; + }; + + rp1_gpclksrc1_gpio21 { + function = "gpclk1"; + pins = "gpio21"; + bias-disable; + phandle = <0xe1>; + }; + + rp1_pwm1_gpio45 { + function = "pwm1"; + pins = "gpio45"; + bias-pull-down; + phandle = <0x39>; + }; + + rp1_spi0_gpio9 { + function = "spi0"; + pins = "gpio9", "gpio10", "gpio11"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x2c>; + }; + + rp1_spi0_cs_gpio7 { + function = "spi0"; + pins = "gpio7", "gpio8"; + bias-pull-up; + phandle = <0x2d>; + }; + + rp1_spi1_gpio19 { + function = "spi1"; + pins = "gpio19", "gpio20", "gpio21"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0xe2>; + }; + + rp1_spi2_gpio1 { + function = "spi2"; + pins = "gpio1", "gpio2", "gpio3"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x2f>; + }; + + rp1_spi3_gpio5 { + function = "spi3"; + pins = "gpio5", "gpio6", "gpio7"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x30>; + }; + + rp1_spi4_gpio9 { + function = "spi4"; + pins = "gpio9", "gpio10", "gpio11"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x31>; + }; + + rp1_spi5_gpio13 { + function = "spi5"; + pins = "gpio13", "gpio14", "gpio15"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x32>; + }; + + rp1_spi8_gpio49 { + function = "spi8"; + pins = "gpio49", "gpio50", "gpio51"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0xe3>; + }; + + rp1_spi8_cs_gpio52 { + function = "spi0"; + pins = "gpio52", "gpio53"; + bias-pull-up; + phandle = <0xe4>; + }; + + rp1_audio_out_12_13 { + function = "aaud"; + pins = "gpio12", "gpio13"; + bias-disable; + phandle = <0xe5>; + }; + + usb_vbus_pins { + function = "vbus1"; + pins = "gpio42", "gpio43"; + phandle = <0x44>; + }; + }; + + ethernet@100000 { + reg = <0xc0 0x40100000 0x00 0x4000>; + compatible = "raspberrypi,rp1-gem", "cdns,macb"; + #address-cells = <0x01>; + #size-cells = <0x00>; + interrupts = <0x06 0x04>; + clocks = <0x02 0x0c 0x02 0x0c 0x02 0x1d 0x02 0x10>; + clock-names = "pclk", "hclk", "tsu_clk", "tx_clk"; + phy-mode = "rgmii-id"; + cdns,aw2w-max-pipe = [08]; + cdns,ar2r-max-pipe = [08]; + cdns,use-aw2b-fill; + local-mac-address = [00 00 00 00 00 00]; + status = "okay"; + phy-handle = <0x3f>; + phy-reset-gpios = <0x2e 0x20 0x01>; + phy-reset-duration = <0x05>; + phandle = <0xe6>; + + ethernet-phy@1 { + reg = <0x01>; + brcm,powerdown-enable; + eee-broken-1000t; + eee-broken-100tx; + phandle = <0x3f>; + }; + }; + + csi@110000 { + compatible = "raspberrypi,rp1-cfe"; + reg = <0xc0 0x40110000 0x00 0x100 0xc0 0x40114000 0x00 0x100 0xc0 0x40120000 0x00 0x100 0xc0 0x40124000 0x00 0x1000>; + interrupts = <0x2f 0x04>; + clocks = <0x02 0x16>; + assigned-clocks = <0x02 0x16>; + assigned-clock-rates = <0x17d7840>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + iommus = <0x40>; + phandle = <0xe7>; + }; + + csi@128000 { + compatible = "raspberrypi,rp1-cfe"; + reg = <0xc0 0x40128000 0x00 0x100 0xc0 0x4012c000 0x00 0x100 0xc0 0x40138000 0x00 0x100 0xc0 0x4013c000 0x00 0x1000>; + interrupts = <0x30 0x04>; + clocks = <0x02 0x17>; + assigned-clocks = <0x02 0x17>; + assigned-clock-rates = <0x17d7840>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + iommus = <0x40>; + phandle = <0xe8>; + }; + + pio@178000 { + reg = <0xc0 0x40178000 0x00 0x20>; + compatible = "raspberrypi,rp1-pio"; + firmware = <0x41>; + dmas = <0x2b 0x38 0x2b 0x39 0x2b 0x3a 0x2b 0x3b 0x2b 0x3c 0x2b 0x3d 0x2b 0x3e 0x2b 0x3f>; + dma-names = "tx0", "rx0", "tx1", "rx1", "tx2", "rx2", "tx3", "rx3"; + status = "okay"; + phandle = <0xe9>; + }; + + mmc@180000 { + reg = <0xc0 0x40180000 0x00 0x100>; + compatible = "raspberrypi,rp1-dwcmshc"; + interrupts = <0x11 0x04>; + clocks = <0x02 0x0c 0x3d 0x02 0x1f 0x42>; + clock-names = "bus", "core", "timeout", "sdio"; + no-1-8-v; + bus-width = <0x04>; + vmmc-supply = <0x3e>; + broken-cd; + status = "disabled"; + phandle = <0xea>; + }; + + mmc@184000 { + reg = <0xc0 0x40184000 0x00 0x100>; + compatible = "raspberrypi,rp1-dwcmshc"; + interrupts = <0x12 0x04>; + clocks = <0x02 0x0c 0x3d 0x02 0x1f 0x43>; + clock-names = "bus", "core", "timeout", "sdio"; + bus-width = <0x04>; + vmmc-supply = <0x3e>; + sdhci-caps-mask = <0x03 0x00>; + broken-cd; + status = "disabled"; + phandle = <0xeb>; + }; + + dma@188000 { + reg = <0xc0 0x40188000 0x00 0x1000>; + compatible = "snps,axi-dma-1.01a"; + interrupts = <0x28 0x04>; + clocks = <0x02 0x0e 0x02 0x0c>; + clock-names = "core-clk", "cfgr-clk"; + #dma-cells = <0x01>; + dma-channels = <0x08>; + snps,dma-masters = <0x01>; + snps,dma-targets = <0x40>; + snps,data-width = <0x04>; + snps,block-size = <0x40000 0x40000 0x40000 0x40000 0x40000 0x40000 0x40000 0x40000>; + snps,priority = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07>; + snps,axi-max-burst-len = <0x04>; + status = "okay"; + phandle = <0x2b>; + }; + + usb@200000 { + reg = <0xc0 0x40200000 0x00 0x100000>; + compatible = "snps,dwc3"; + dr_mode = "host"; + usb3-lpm-capable; + snps,axi-pipe-limit = [08]; + snps,dis_rxdet_inp3_quirk; + snps,enhanced-nak-fs-quirk; + snps,parkmode-disable-ss-quirk; + snps,parkmode-disable-hs-quirk; + snps,parkmode-disable-fsls-quirk; + snps,tx-max-burst = [08]; + snps,tx-thr-num-pkt = [02]; + interrupts = <0x1f 0x01>; + status = "okay"; + pinctrl-0 = <0x44>; + pinctrl-names = "default"; + phandle = <0xec>; + }; + + usb@300000 { + reg = <0xc0 0x40300000 0x00 0x100000>; + compatible = "snps,dwc3"; + dr_mode = "host"; + usb3-lpm-capable; + snps,axi-pipe-limit = [08]; + snps,dis_rxdet_inp3_quirk; + snps,enhanced-nak-fs-quirk; + snps,parkmode-disable-ss-quirk; + snps,parkmode-disable-hs-quirk; + snps,parkmode-disable-fsls-quirk; + snps,tx-max-burst = [08]; + snps,tx-thr-num-pkt = [02]; + interrupts = <0x24 0x01>; + status = "okay"; + phandle = <0xed>; + }; + + dsi@110000 { + compatible = "raspberrypi,rp1dsi"; + status = "disabled"; + reg = <0xc0 0x40118000 0x00 0x1000 0xc0 0x4011c000 0x00 0x1000 0xc0 0x40120000 0x00 0x1000>; + interrupts = <0x2f 0x04>; + clocks = <0x02 0x16 0x02 0x29 0x02 0x2d 0x29 0x02 0x03>; + clock-names = "cfgclk", "dpiclk", "byteclk", "refclk", "pllsys"; + assigned-clocks = <0x02 0x16>; + assigned-clock-rates = <0x17d7840>; + iommus = <0x40>; + phandle = <0xee>; + }; + + dsi@128000 { + compatible = "raspberrypi,rp1dsi"; + status = "disabled"; + reg = <0xc0 0x40130000 0x00 0x1000 0xc0 0x40134000 0x00 0x1000 0xc0 0x40138000 0x00 0x1000>; + interrupts = <0x30 0x04>; + clocks = <0x02 0x17 0x02 0x2a 0x02 0x2e 0x29 0x02 0x03>; + clock-names = "cfgclk", "dpiclk", "byteclk", "refclk", "pllsys"; + assigned-clocks = <0x02 0x17>; + assigned-clock-rates = <0x17d7840>; + iommus = <0x40>; + phandle = <0xef>; + }; + + vec@144000 { + compatible = "raspberrypi,rp1vec"; + status = "disabled"; + reg = <0xc0 0x40144000 0x00 0x1000 0xc0 0x40140000 0x00 0x1000>; + interrupts = <0x31 0x04>; + clocks = <0x02 0x27>; + assigned-clocks = <0x02 0x02 0x02 0x0b 0x02 0x27>; + assigned-clock-rates = <0x46cf7100 0x66ff300 0x66ff300>; + assigned-clock-parents = <0x00 0x02 0x02 0x02 0x0b>; + iommus = <0x40>; + phandle = <0xf0>; + }; + + dpi@148000 { + compatible = "raspberrypi,rp1dpi"; + status = "disabled"; + reg = <0xc0 0x40148000 0x00 0x1000 0xc0 0x40140000 0x00 0x1000>; + interrupts = <0x31 0x04>; + clocks = <0x02 0x28 0x02 0x05 0x02 0x02>; + clock-names = "dpiclk", "plldiv", "pllcore"; + assigned-clocks = <0x02 0x28>; + assigned-clock-parents = <0x02 0x05>; + iommus = <0x40>; + phandle = <0xf1>; + }; + + sram@400000 { + compatible = "mmio-sram"; + reg = <0xc0 0x40400000 0x00 0x10000>; + #address-cells = <0x01>; + #size-cells = <0x01>; + ranges = <0x00 0xc0 0x40400000 0x10000>; + phandle = <0xf2>; + + shmem@ff00 { + compatible = "raspberrypi,rp1-shmem"; + reg = <0xff00 0x100>; + phandle = <0x5c>; + }; + }; + + gpiomem@d0000 { + compatible = "raspberrypi,gpiomem"; + reg = <0xc0 0x400d0000 0x00 0x30000>; + chardev-name = "gpiomem0"; + }; + }; + }; + + msi-controller@1000130000 { + compatible = "brcm,bcm2712-mip"; + reg = <0x10 0x130000 0x00 0xc0 0xff 0xfffff000 0x00 0x1000>; + msi-controller; + msi-ranges = <0x01 0x00 0x80 0x01 0x40>; + brcm,msi-offset = <0x00>; + phandle = <0x27>; + }; + + msi-controller@1000131000 { + compatible = "brcm,bcm2712-mip"; + reg = <0x10 0x131000 0x00 0xc0 0xff 0xfffff000 0x00 0x1000>; + msi-controller; + msi-ranges = <0x01 0x00 0xf7 0x01 0x08>; + brcm,msi-offset = <0x08>; + phandle = <0x26>; + }; + + iommu@5100 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5100 0x00 0x80>; + cache = <0x45>; + #iommu-cells = <0x00>; + phandle = <0x49>; + }; + + iommu@5200 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5200 0x00 0x80>; + cache = <0x45>; + #iommu-cells = <0x00>; + #interconnect-cells = <0x00>; + phandle = <0x4d>; + }; + + iommu@5280 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5280 0x00 0x80>; + cache = <0x45>; + #iommu-cells = <0x00>; + dma-iova-offset = <0x10 0x00>; + phandle = <0x40>; + }; + + iommuc@5b00 { + compatible = "brcm,bcm2712-iommuc"; + reg = <0x10 0x5b00 0x00 0x80>; + phandle = <0x45>; + }; + + dma@10000 { + compatible = "brcm,bcm2712-dma"; + reg = <0x10 0x10000 0x00 0x600>; + interrupts = <0x00 0x50 0x04 0x00 0x51 0x04 0x00 0x52 0x04 0x00 0x53 0x04 0x00 0x54 0x04 0x00 0x55 0x04>; + interrupt-names = "dma0", "dma1", "dma2", "dma3", "dma4", "dma5"; + #dma-cells = <0x01>; + brcm,dma-channel-mask = <0x3f>; + phandle = <0xf3>; + }; + + dma@10600 { + compatible = "brcm,bcm2712-dma"; + reg = <0x10 0x10600 0x00 0x600>; + interrupts = <0x00 0x56 0x04 0x00 0x57 0x04 0x00 0x58 0x04 0x00 0x59 0x04 0x00 0x5a 0x04 0x00 0x5b 0x04>; + interrupt-names = "dma6", "dma7", "dma8", "dma9", "dma10", "dma11"; + #dma-cells = <0x01>; + brcm,dma-channel-mask = <0x7c0>; + phandle = <0x16>; + }; + + syscon@400018 { + compatible = "brcm,syscon-piarbctl", "syscon", "simple-mfd"; + reg = <0x10 0x400018 0x00 0x18>; + phandle = <0xf4>; + }; + + usb@480000 { + compatible = "brcm,bcm2835-usb"; + reg = <0x10 0x480000 0x00 0x10000>; + interrupts = <0x00 0x49 0x04>; + #address-cells = <0x01>; + #size-cells = <0x00>; + clocks = <0x46>; + clock-names = "otg"; + phys = <0x47>; + phy-names = "usb2-phy"; + status = "disabled"; + power-domains = <0x48 0x06>; + phandle = <0xf5>; + }; + + codec@800000 { + compatible = "brcm,bcm2712-hevc-dec", "raspberrypi,hevc-dec"; + reg = <0x10 0x800000 0x00 0x10000 0x10 0x840000 0x00 0x1000>; + reg-names = "hevc", "intc"; + interrupts = <0x00 0x62 0x04>; + clocks = <0x17 0x0b>; + clock-names = "hevc"; + iommus = <0x49>; + phandle = <0xf6>; + }; + + pisp_be@880000 { + compatible = "raspberrypi,pispbe"; + reg = <0x10 0x880000 0x00 0x4000>; + interrupts = <0x00 0x48 0x04>; + clocks = <0x17 0x07>; + clocks-names = "isp_be"; + status = "okay"; + iommus = <0x49>; + phandle = <0xf7>; + }; + + mmc@1100000 { + compatible = "brcm,bcm2712-sdhci"; + reg = <0x10 0x1100000 0x00 0x260 0x10 0x1100400 0x00 0x200>; + reg-names = "host", "cfg"; + interrupts = <0x00 0x112 0x04>; + clocks = <0x08>; + sdhci-caps-mask = <0xc000 0x00>; + sdhci-caps = <0x00 0x00>; + supports-cqe = <0x01>; + mmc-ddr-3_3v; + status = "okay"; + pinctrl-0 = <0x4a>; + pinctrl-names = "default"; + bus-width = <0x04>; + vmmc-supply = <0x4b>; + sd-uhs-ddr50; + non-removable; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0xf8>; + + wifi@1 { + reg = <0x01>; + compatible = "brcm,bcm4329-fmac"; + local-mac-address = [00 00 00 00 00 00]; + phandle = <0x71>; + }; + }; + + v3d@2000000 { + compatible = "brcm,2712-v3d"; + reg = <0x10 0x2000000 0x00 0x4000 0x10 0x2008000 0x00 0x6000 0x10 0x2030800 0x00 0x700>; + reg-names = "hub", "core0", "sms"; + power-domains = <0x4c 0x01>; + resets = <0x4c 0x00>; + clocks = <0x17 0x05>; + clocks-names = "v3d"; + interrupts = <0x00 0xfa 0x04 0x00 0xf9 0x04>; + status = "disabled"; + phandle = <0xf9>; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <0x01 0x0d 0xf08 0x01 0x0e 0xf08 0x01 0x0b 0xf08 0x01 0x0a 0xf08 0x01 0x0c 0xf08>; + }; + + clk-27M { + #clock-cells = <0x00>; + compatible = "fixed-clock"; + clock-frequency = <0x19bfcc0>; + clock-output-names = "27MHz-clock"; + phandle = <0x18>; + }; + + clk-108M { + #clock-cells = <0x00>; + compatible = "fixed-clock"; + clock-frequency = <0x66ff300>; + clock-output-names = "108MHz-clock"; + phandle = <0x11>; + }; + + hvs@107c580000 { + compatible = "brcm,bcm2712-hvs"; + reg = <0x10 0x7c580000 0x1a000>; + interrupt-parent = <0x10>; + interrupts = <0x02 0x09 0x10>; + interrupt-names = "ch0-eof", "ch1-eof", "ch2-eof"; + iommus = <0x4d>; + status = "disabled"; + clocks = <0x17 0x04 0x17 0x10>; + clock-names = "core", "disp"; + phandle = <0xfa>; + }; + + arm-pmu { + compatible = "arm,cortex-a76-pmu"; + interrupts = <0x00 0x10 0x04 0x00 0x11 0x04 0x00 0x12 0x04 0x00 0x13 0x04>; + interrupt-affinity = <0x4e 0x4f 0x50 0x51>; + }; + + thermal-zones { + + cpu-thermal { + polling-delay-passive = <0x3e8>; + polling-delay = <0x3e8>; + coefficients = <0xfffffdda 0x6ddd0>; + thermal-sensors = <0x52>; + phandle = <0xfb>; + + trips { + phandle = <0xfc>; + + cpu-crit { + temperature = <0x1adb0>; + hysteresis = <0x00>; + type = "critical"; + phandle = <0x58>; + }; + + cpu-tepid { + temperature = <0xc350>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x53>; + }; + + cpu-warm { + temperature = <0xea60>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x55>; + }; + + cpu-hot { + temperature = <0x107ac>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x56>; + }; + + cpu-vhot { + temperature = <0x124f8>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x57>; + }; + }; + + cooling-maps { + phandle = <0xfd>; + + tepid { + trip = <0x53>; + cooling-device = <0x54 0x01 0x01>; + }; + + warm { + trip = <0x55>; + cooling-device = <0x54 0x02 0x02>; + }; + + hot { + trip = <0x56>; + cooling-device = <0x54 0x03 0x03>; + }; + + vhot { + trip = <0x57>; + cooling-device = <0x54 0x04 0x04>; + }; + + melt { + trip = <0x58>; + cooling-device = <0x54 0x04 0x04>; + }; + }; + }; + }; + + firmwarekms { + compatible = "raspberrypi,rpi-firmware-kms-2712"; + interrupt-parent = <0x59>; + interrupts = <0x13>; + brcm,firmware = <0x1a>; + status = "disabled"; + phandle = <0xfe>; + }; + + phy { + compatible = "usb-nop-xceiv"; + #phy-cells = <0x00>; + phandle = <0x47>; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00 0x00 0x28000000>; + }; + + leds { + compatible = "gpio-leds"; + phandle = <0xff>; + + led-pwr { + label = "PWR"; + gpios = <0x2e 0x2c 0x01>; + default-state = "off"; + linux,default-trigger = "none"; + phandle = <0x6b>; + }; + + led-act { + label = "ACT"; + gpios = <0x0d 0x09 0x01>; + default-state = "off"; + linux,default-trigger = "mmc0"; + phandle = <0x5d>; + }; + }; + + sd-io-1v8-reg { + compatible = "regulator-gpio"; + regulator-name = "vdd-sd-io"; + regulator-min-microvolt = <0x1b7740>; + regulator-max-microvolt = <0x325aa0>; + regulator-boot-on; + regulator-always-on; + regulator-settling-time-us = <0x1388>; + gpios = <0x0d 0x03 0x00>; + states = <0x1b7740 0x01 0x325aa0 0x00>; + phandle = <0x0b>; + }; + + sd-vcc-reg { + compatible = "regulator-fixed"; + regulator-name = "vcc-sd"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + regulator-boot-on; + enable-active-high; + gpios = <0x0d 0x04 0x00>; + phandle = <0x0c>; + }; + + wl-on-reg { + compatible = "regulator-fixed"; + regulator-name = "wl-on-regulator"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + pinctrl-0 = <0x5a>; + pinctrl-names = "default"; + gpio = <0x1b 0x1c 0x00>; + startup-delay-us = <0x249f0>; + enable-active-high; + phandle = <0x4b>; + }; + + cam1_clk { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x100>; + }; + + cam0_clk { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x101>; + }; + + cam0_reg { + compatible = "regulator-fixed"; + regulator-name = "cam0_reg"; + enable-active-high; + gpio = <0x2e 0x22 0x00>; + phandle = <0x72>; + }; + + cam1_reg { + compatible = "regulator-fixed"; + regulator-name = "cam1_reg"; + enable-active-high; + gpio = <0x2e 0x2e 0x00>; + phandle = <0x73>; + }; + + cam_dummy_reg { + compatible = "regulator-fixed"; + regulator-name = "cam-dummy-reg"; + phandle = <0x102>; + }; + + dummy { + phandle = <0x103>; + }; + + i2c0if { + phandle = <0x104>; + }; + + i2c0mux { + phandle = <0x105>; + }; + + rp1_firmware { + compatible = "raspberrypi,rp1-firmware", "simple-mfd"; + mboxes = <0x5b 0x00>; + shmem = <0x5c>; + phandle = <0x41>; + }; + + rp1_vdd_3v3 { + compatible = "regulator-fixed"; + regulator-name = "vdd-3v3"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + regulator-always-on; + phandle = <0x3e>; + }; + + chosen { + bootargs = "reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0"; + stdout-path = "serial10:115200n8"; + phandle = <0x6f>; + }; + + aliases { + blconfig = "/reserved-memory/nvram@0"; + blpubkey = "/reserved-memory/nvram@1"; + bluetooth = "/soc@107c000000/serial@7d50c000/bluetooth"; + console = "/soc@107c000000/serial@7d001000"; + drm-dsi1 = "/axi/pcie@1000120000/rp1/dsi@110000"; + drm-dsi2 = "/axi/pcie@1000120000/rp1/dsi@128000"; + ethernet0 = "/axi/pcie@1000120000/rp1/ethernet@100000"; + fb = "/soc@107c000000/fb"; + gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000"; + gpio1 = "/soc@107c000000/gpio@7d508500"; + gpio2 = "/soc@107c000000/gpio@7d517c00"; + gpio3 = "/soc@107c000000/pinctrl@7d504100"; + gpio4 = "/soc@107c000000/pinctrl@7d510700"; + gpiochip0 = "/axi/pcie@1000120000/rp1/gpio@d0000"; + gpiochip10 = "/soc@107c000000/gpio@7d508500"; + i2c = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + i2c10 = "/axi/pcie@1000120000/rp1/i2c@88000"; + i2c11 = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c12 = "/soc@107c000000/i2c@7d005600"; + mailbox = "/soc@107c000000/mailbox@7c013880"; + mmc0 = "/soc@107c000000/mmc@fff000"; + pio0 = "/axi/pcie@1000120000/rp1/pio@178000"; + serial0 = "/axi/pcie@1000120000/rp1/serial@30000"; + serial1 = "/axi/pcie@1000120000/rp1/serial@34000"; + serial10 = "/soc@107c000000/serial@7d001000"; + serial2 = "/axi/pcie@1000120000/rp1/serial@38000"; + serial3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + serial4 = "/axi/pcie@1000120000/rp1/serial@40000"; + spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + spi10 = "/soc@107c000000/spi@7d004000"; + spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + uart10 = "/soc@107c000000/serial@7d001000"; + uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + usb0 = "/axi/pcie@1000120000/rp1/usb@200000"; + usb1 = "/axi/pcie@1000120000/rp1/usb@300000"; + wifi0 = "/axi/mmc@1100000/wifi@1"; + phandle = <0x62>; + }; + + __overrides__ { + act_led_gpio = [00 00 00 5d 67 70 69 6f 73 3a 34 00 00 00 00 5d 67 70 69 6f 73 3a 30 3d 00 00 00 00 2e]; + act_led_activelow = "", "", "", "]gpios:8"; + act_led_trigger = "", "", "", "]linux,default-trigger"; + axiperf = "", "", "", "^status"; + bdaddr = "", "", "", "_local-bd-address["; + button_debounce = "", "", "", "`debounce-interval:0"; + cooling_fan = "", "", "", "Tstatus", "", "", "", "astatus"; + drm_fb0_rp1_dpi = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb0_rp1_dsi0 = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb0_rp1_dsi1 = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb0_vc4 = "", "", "", "bdrm-fb0=", "/axi/gpu"; + drm_fb1_rp1_dpi = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb1_rp1_dsi0 = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb1_rp1_dsi1 = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb1_vc4 = "", "", "", "bdrm-fb1=", "/axi/gpu"; + drm_fb2_rp1_dpi = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb2_rp1_dsi0 = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb2_rp1_dsi1 = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb2_vc4 = "", "", "", "bdrm-fb2=", "/axi/gpu"; + eth_led0 = "", "", "", "?led-modes:0"; + eth_led1 = "", "", "", "?led-modes:4"; + fan_temp0 = "", "", "", "Stemperature:0"; + fan_temp0_hyst = "", "", "", "Shysteresis:0"; + fan_temp0_speed = "", "", "", "Tcooling-levels:4"; + fan_temp1 = "", "", "", "Utemperature:0"; + fan_temp1_hyst = "", "", "", "Uhysteresis:0"; + fan_temp1_speed = "", "", "", "Tcooling-levels:8"; + fan_temp2 = "", "", "", "Vtemperature:0"; + fan_temp2_hyst = "", "", "", "Vhysteresis:0"; + fan_temp2_speed = "", "", "", "Tcooling-levels:12"; + fan_temp3 = "", "", "", "Wtemperature:0"; + fan_temp3_hyst = "", "", "", "Whysteresis:0"; + fan_temp3_speed = "", "", "", "Tcooling-levels:16"; + i2c = "", "", "", "cstatus"; + i2c_arm = "", "", "", "cstatus"; + i2c_arm_baudrate = "", "", "", "cclock-frequency:0"; + i2c_baudrate = "", "", "", "cclock-frequency:0"; + i2c_csi_dsi = "", "", "", "dstatus"; + i2c_csi_dsi0 = "", "", "", "estatus"; + i2c_csi_dsi1 = "", "", "", "dstatus"; + i2c_vc = "", "", "", "fstatus"; + i2c_vc_baudrate = "", "", "", "fclock-frequency:0"; + i2c0 = "", "", "", "fstatus"; + i2c0_baudrate = "", "", "", "fclock-frequency:0"; + i2c1 = "", "", "", "cstatus"; + i2c1_baudrate = "", "", "", "cclock-frequency:0"; + krnbt = "", "", "", "_status"; + nvme = "", "", "", "gstatus"; + nvmem_cust_rw = "", "", "", "hrw?"; + nvmem_mac_rw = "", "", "", "irw?"; + nvmem_priv_rw = "", "", "", "jrw?"; + pcie_tperst_clk_ms = "", "", "", "gbrcm,tperst-clk-ms:0"; + pciex1 = "", "", "", "gstatus"; + pciex1_gen = "", "", "", "gmax-link-speed:0"; + pciex1_no_l0s = "", "", "", "gaspm-no-l0s?"; + pciex1_tperst_clk_ms = "", "", "", "gbrcm,tperst-clk-ms:0"; + pwr_led_gpio = "", "", "", "kgpios:4"; + pwr_led_activelow = "", "", "", "kgpios:8"; + pwr_led_trigger = "", "", "", "klinux,default-trigger"; + random = "", "", "", "lstatus"; + rtc = "", "", "", "mstatus"; + rtc_bbat_vchg = "", "", "", "mtrickle-charge-microvolt:0"; + spi = "", "", "", "nstatus"; + strict_gpiod = "", "", "", "obootargs=pinctrl_rp1.persist_gpio_outputs=n"; + suspend = "", "", "", "`linux,code:0=205"; + uart0 = "", "", "", "pstatus"; + uart0_console = "", "", "", "pstatus", "", "", "", "bconsole=", "/axi/pcie@1000120000/rp1/serial@30000"; + uart0_dma = [00 00 00 70 64 6d 61 73 3a 30 3d 00 00 00 00 2b 00 00 00 70 64 6d 61 73 3a 34 3d 00 00 00 00 1a 00 00 00 70 64 6d 61 73 3a 38 3d 00 00 00 00 2b 00 00 00 70 64 6d 61 73 3a 31 32 3d 00 00 00 00 19 00 00 00 70 64 6d 61 2d 6e 61 6d 65 73 5b 3d 37 34 37 38 30 30 37 32 37 38 30 30 00]; + wifiaddr = "", "", "", "qlocal-mac-address["; + cam0_reg = "", "", "", "rstatus"; + cam0_reg_gpio = [00 00 00 72 67 70 69 6f 3a 34 00 00 00 00 72 67 70 69 6f 3a 30 3d 00 00 00 00 2e]; + cam1_reg = "", "", "", "sstatus"; + cam1_reg_gpio = [00 00 00 73 67 70 69 6f 3a 34 00 00 00 00 73 67 70 69 6f 3a 30 3d 00 00 00 00 2e]; + sd_cqe = "", "", "", "tsupports-cqe:0"; + }; + + cooling_fan { + status = "disabled"; + compatible = "pwm-fan"; + #cooling-cells = <0x02>; + cooling-min-state = <0x00>; + cooling-max-state = <0x03>; + cooling-levels = <0x00 0x4b 0x7d 0xaf 0xfa>; + pwms = <0x61 0x03 0xa25e 0x01>; + rpm-regmap = <0x61>; + rpm-offset = <0x3c>; + phandle = <0x54>; + }; + + pwr_button { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <0x75>; + status = "okay"; + + pwr { + label = "pwr_button"; + linux,code = <0x74>; + gpios = <0x1b 0x14 0x01>; + debounce-interval = <0x32>; + phandle = <0x60>; + }; + }; + + __symbols__ { + clocks = "/clocks"; + clk_osc = "/clocks/clk-osc"; + clk_vpu = "/clocks/clk-vpu"; + clk_uart = "/clocks/clk-uart"; + clk_emmc2 = "/clocks/clk-emmc2"; + clk_usb = "/clocks/clk-usb"; + clk_xosc = "/clocks/clk_xosc"; + sdio_src = "/clocks/sdio_src"; + sdhci_core = "/clocks/sdhci_core"; + clksrc_gp0 = "/clocks/clksrc_gp0"; + clksrc_gp1 = "/clocks/clksrc_gp1"; + clksrc_gp2 = "/clocks/clksrc_gp2"; + clksrc_gp3 = "/clocks/clksrc_gp3"; + clksrc_gp4 = "/clocks/clksrc_gp4"; + clksrc_gp5 = "/clocks/clksrc_gp5"; + cpus = "/cpus"; + cpu0 = "/cpus/cpu@0"; + l2_cache_l0 = "/cpus/cpu@0/l2-cache-l0"; + cpu1 = "/cpus/cpu@1"; + l2_cache_l1 = "/cpus/cpu@1/l2-cache-l1"; + cpu2 = "/cpus/cpu@2"; + l2_cache_l2 = "/cpus/cpu@2/l2-cache-l2"; + cpu3 = "/cpus/cpu@3"; + l2_cache_l3 = "/cpus/cpu@3/l2-cache-l3"; + l3_cache = "/cpus/l3-cache"; + rmem = "/reserved-memory"; + cma = "/reserved-memory/linux,cma"; + blconfig = "/reserved-memory/nvram@0"; + blpubkey = "/reserved-memory/nvram@1"; + soc = "/soc@107c000000"; + pcie_rescal = "/soc@107c000000/reset-controller@119500"; + sdio1 = "/soc@107c000000/mmc@fff000"; + bcm_reset = "/soc@107c000000/reset-controller@1504318"; + system_timer = "/soc@107c000000/timer@7c003000"; + mailbox = "/soc@107c000000/mailbox@7c013880"; + local_intc = "/soc@107c000000/interrupt-controller@7cd00000"; + uart10 = "/soc@107c000000/serial@7d001000"; + gio_aon = "/soc@107c000000/gpio@7d517c00"; + gicv2 = "/soc@107c000000/interrupt-controller@7fff9000"; + aon_intr = "/soc@107c000000/interrupt-controller@7d510600"; + pixelvalve0 = "/soc@107c000000/pixelvalve@7c410000"; + pixelvalve1 = "/soc@107c000000/pixelvalve@7c411000"; + mop = "/soc@107c000000/mop@7c500000"; + moplet = "/soc@107c000000/moplet@7c501000"; + disp_intr = "/soc@107c000000/interrupt-controller@7c502000"; + dvp = "/soc@107c000000/clock@7c700000"; + ddc0 = "/soc@107c000000/i2c@7d508200"; + ddc1 = "/soc@107c000000/i2c@7d508280"; + bsc_irq = "/soc@107c000000/intc@7d508380"; + main_irq = "/soc@107c000000/intc@7d508400"; + hdmi0 = "/soc@107c000000/hdmi@7ef00700"; + hdmi1 = "/soc@107c000000/hdmi@7ef05700"; + axiperf = "/soc@107c000000/axiperf@7c012800"; + spi10 = "/soc@107c000000/spi@7d004000"; + spidev10 = "/soc@107c000000/spi@7d004000/spidev@0"; + i2c10 = "/soc@107c000000/i2c@7d005600"; + pm = "/soc@107c000000/watchdog@7d200000"; + random = "/soc@107c000000/rng@7d208000"; + cpu_l2_irq = "/soc@107c000000/intc@7d503000"; + pinctrl = "/soc@107c000000/pinctrl@7d504100"; + uarta_24_pins = "/soc@107c000000/pinctrl@7d504100/uarta_24_pins"; + sdio2_30_pins = "/soc@107c000000/pinctrl@7d504100/sdio2_30_pins"; + pwr_button_pins = "/soc@107c000000/pinctrl@7d504100/pwr_button_pins"; + wl_on_pins = "/soc@107c000000/pinctrl@7d504100/wl_on_pins"; + bt_shutdown_pins = "/soc@107c000000/pinctrl@7d504100/bt_shutdown_pins"; + emmc_sd_pulls = "/soc@107c000000/pinctrl@7d504100/emmc_sd_pulls"; + spi10_pins = "/soc@107c000000/pinctrl@7d504100/spi10_gpio2"; + spi10_gpio2 = "/soc@107c000000/pinctrl@7d504100/spi10_gpio2"; + spi10_cs_pins = "/soc@107c000000/pinctrl@7d504100/spi10_cs_gpio1"; + spi10_cs_gpio1 = "/soc@107c000000/pinctrl@7d504100/spi10_cs_gpio1"; + gio = "/soc@107c000000/gpio@7d508500"; + uarta = "/soc@107c000000/serial@7d50c000"; + bluetooth = "/soc@107c000000/serial@7d50c000/bluetooth"; + pinctrl_aon = "/soc@107c000000/pinctrl@7d510700"; + i2c3_m4_agpio0_pins = "/soc@107c000000/pinctrl@7d510700/i2c3_m4_agpio0_pins"; + bsc_m1_agpio13_pins = "/soc@107c000000/pinctrl@7d510700/bsc_m1_agpio13_pins"; + bsc_pmu_sgpio4_pins = "/soc@107c000000/pinctrl@7d510700/bsc_pmu_sgpio4_pins"; + bsc_m2_sgpio4_pins = "/soc@107c000000/pinctrl@7d510700/bsc_m2_sgpio4_pins"; + pwm_aon_agpio1_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio1_pins"; + pwm_aon_agpio4_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio4_pins"; + pwm_aon_agpio7_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio7_pins"; + emmc_aon_cd_pins = "/soc@107c000000/pinctrl@7d510700/emmc_aon_cd_pins"; + aon_pwm_1pin = "/soc@107c000000/pinctrl@7d510700/aon_pwm_1pin"; + main_aon_irq = "/soc@107c000000/intc@7d517ac0"; + avs_monitor = "/soc@107c000000/avs-monitor@7d542000"; + thermal = "/soc@107c000000/avs-monitor@7d542000/thermal"; + firmware = "/soc@107c000000/firmware"; + firmware_clocks = "/soc@107c000000/firmware/clocks"; + reset = "/soc@107c000000/firmware/reset"; + vcio = "/soc@107c000000/firmware/vcio"; + power = "/soc@107c000000/power"; + fb = "/soc@107c000000/fb"; + rpi_rtc = "/soc@107c000000/rpi_rtc"; + nvmem_otp = "/soc@107c000000/nvmem/nvmem_otp"; + nvmem_cust = "/soc@107c000000/nvmem/nvmem_cust"; + nvmem_mac = "/soc@107c000000/nvmem/nvmem_mac"; + nvmem_priv = "/soc@107c000000/nvmem/nvmem_priv"; + vdd_3v3_reg = "/soc@107c000000/fixedregulator_3v3"; + vdd_5v0_reg = "/soc@107c000000/fixedregulator_5v0"; + sound = "/soc@107c000000/sound"; + axi = "/axi"; + vc4 = "/axi/gpu"; + pcie0 = "/axi/pcie@1000100000"; + pciex1 = "/axi/pcie@1000110000"; + pcie1 = "/axi/pcie@1000110000"; + pciex4 = "/axi/pcie@1000120000"; + rp1_target = "/axi/pcie@1000120000"; + pcie2 = "/axi/pcie@1000120000"; + rp1 = "/axi/pcie@1000120000/rp1"; + rp1_mbox = "/axi/pcie@1000120000/rp1/mailbox@8000"; + rp1_clocks = "/axi/pcie@1000120000/rp1/clocks@18000"; + uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + rp1_uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + rp1_uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + rp1_uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + rp1_uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + rp1_uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + rp1_uart5 = "/axi/pcie@1000120000/rp1/serial@44000"; + rp1_spi8 = "/axi/pcie@1000120000/rp1/spi@4c000"; + spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + rp1_spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + spidev0 = "/axi/pcie@1000120000/rp1/spi@50000/spidev@0"; + spidev1 = "/axi/pcie@1000120000/rp1/spi@50000/spidev@1"; + spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + rp1_spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + rp1_spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + rp1_spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + rp1_spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + rp1_spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + rp1_spi6 = "/axi/pcie@1000120000/rp1/spi@68000"; + rp1_spi7 = "/axi/pcie@1000120000/rp1/spi@6c000"; + i2c_vc = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + rp1_i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c_arm = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + rp1_i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + rp1_i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + rp1_i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + i2c_csi_dsi = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c_csi_dsi1 = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c4 = "/axi/pcie@1000120000/rp1/i2c@80000"; + rp1_i2c4 = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c5 = "/axi/pcie@1000120000/rp1/i2c@84000"; + rp1_i2c5 = "/axi/pcie@1000120000/rp1/i2c@84000"; + i2c_csi_dsi0 = "/axi/pcie@1000120000/rp1/i2c@88000"; + i2c6 = "/axi/pcie@1000120000/rp1/i2c@88000"; + rp1_i2c6 = "/axi/pcie@1000120000/rp1/i2c@88000"; + rp1_audio_out = "/axi/pcie@1000120000/rp1/audio_out@94000"; + pwm = "/axi/pcie@1000120000/rp1/pwm@98000"; + pwm0 = "/axi/pcie@1000120000/rp1/pwm@98000"; + rp1_pwm0 = "/axi/pcie@1000120000/rp1/pwm@98000"; + pwm1 = "/axi/pcie@1000120000/rp1/pwm@9c000"; + rp1_pwm1 = "/axi/pcie@1000120000/rp1/pwm@9c000"; + i2s_clk_producer = "/axi/pcie@1000120000/rp1/i2s@a0000"; + i2s = "/axi/pcie@1000120000/rp1/i2s@a0000"; + rp1_i2s0 = "/axi/pcie@1000120000/rp1/i2s@a0000"; + i2s_clk_consumer = "/axi/pcie@1000120000/rp1/i2s@a4000"; + rp1_i2s1 = "/axi/pcie@1000120000/rp1/i2s@a4000"; + rp1_i2s2 = "/axi/pcie@1000120000/rp1/i2s@a8000"; + rp1_sdio_clk0 = "/axi/pcie@1000120000/rp1/sdio_clk0@b0004"; + rp1_sdio_clk1 = "/axi/pcie@1000120000/rp1/sdio_clk1@b4004"; + rp1_adc = "/axi/pcie@1000120000/rp1/adc@c8000"; + gpio = "/axi/pcie@1000120000/rp1/gpio@d0000"; + rp1_gpio = "/axi/pcie@1000120000/rp1/gpio@d0000"; + uart0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_14_15"; + rp1_uart0_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_14_15"; + uart0_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_ctsrts_16_17"; + rp1_uart0_ctsrts_16_17 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_ctsrts_16_17"; + uart1_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_0_1"; + rp1_uart1_0_1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_0_1"; + uart1_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_ctsrts_2_3"; + rp1_uart1_ctsrts_2_3 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_ctsrts_2_3"; + uart2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_4_5"; + rp1_uart2_4_5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_4_5"; + uart2_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_ctsrts_6_7"; + rp1_uart2_ctsrts_6_7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_ctsrts_6_7"; + uart3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_8_9"; + rp1_uart3_8_9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_8_9"; + uart3_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_ctsrts_10_11"; + rp1_uart3_ctsrts_10_11 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_ctsrts_10_11"; + uart4_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_12_13"; + rp1_uart4_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_12_13"; + uart4_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_ctsrts_14_15"; + rp1_uart4_ctsrts_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_ctsrts_14_15"; + rp1_sdio0_22_27 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_sdio0_22_27"; + rp1_sdio1_28_33 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_sdio1_28_33"; + rp1_i2s0_18_21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2s0_18_21"; + rp1_i2s1_18_21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2s1_18_21"; + rp1_i2c4_34_35 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c4_34_35"; + rp1_i2c6_38_39 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c6_38_39"; + rp1_i2c4_40_41 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c4_40_41"; + rp1_i2c5_44_45 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c5_44_45"; + i2c0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_0_1"; + rp1_i2c0_0_1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_0_1"; + rp1_i2c0_8_9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_8_9"; + i2c1_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_2_3"; + rp1_i2c1_2_3 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_2_3"; + rp1_i2c1_10_11 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_10_11"; + i2c2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_4_5"; + rp1_i2c2_4_5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_4_5"; + rp1_i2c2_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_12_13"; + i2c3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_6_7"; + rp1_i2c3_6_7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_6_7"; + rp1_i2c3_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_14_15"; + rp1_i2c3_22_23 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_22_23"; + dpi_16bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio2"; + rp1_dpi_16bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio2"; + dpi_16bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio2"; + rp1_dpi_16bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio2"; + rp1_dpi_16bit_pad666_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_pad666_gpio2"; + dpi_18bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio2"; + rp1_dpi_18bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio2"; + dpi_18bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio2"; + rp1_dpi_18bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio2"; + dpi_gpio1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio2"; + rp1_dpi_24bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio2"; + rp1_dpi_hvsync = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_hvsync"; + dpi_16bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio0"; + rp1_dpi_16bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio0"; + dpi_16bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio0"; + rp1_dpi_16bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio0"; + rp1_dpi_16bit_pad666_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_pad666_gpio0"; + dpi_18bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio0"; + rp1_dpi_18bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio0"; + dpi_18bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio0"; + rp1_dpi_18bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio0"; + dpi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio0"; + rp1_dpi_24bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio0"; + rp1_gpclksrc0_gpio4 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc0_gpio4"; + rp1_gpclksrc0_gpio20 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc0_gpio20"; + rp1_gpclksrc1_gpio5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio5"; + rp1_gpclksrc1_gpio18 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio18"; + rp1_gpclksrc1_gpio21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio21"; + rp1_pwm1_gpio45 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_pwm1_gpio45"; + spi0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_gpio9"; + rp1_spi0_gpio9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_gpio9"; + spi0_cs_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_cs_gpio7"; + rp1_spi0_cs_gpio7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_cs_gpio7"; + rp1_spi1_gpio19 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi1_gpio19"; + spi2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi2_gpio1"; + rp1_spi2_gpio1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi2_gpio1"; + spi3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi3_gpio5"; + rp1_spi3_gpio5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi3_gpio5"; + spi4_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi4_gpio9"; + rp1_spi4_gpio9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi4_gpio9"; + spi5_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi5_gpio13"; + rp1_spi5_gpio13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi5_gpio13"; + rp1_spi8_gpio49 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi8_gpio49"; + rp1_spi8_cs_gpio52 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi8_cs_gpio52"; + rp1_audio_out_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_audio_out_12_13"; + usb_vbus_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/usb_vbus_pins"; + rp1_eth = "/axi/pcie@1000120000/rp1/ethernet@100000"; + phy1 = "/axi/pcie@1000120000/rp1/ethernet@100000/ethernet-phy@1"; + csi0 = "/axi/pcie@1000120000/rp1/csi@110000"; + rp1_csi0 = "/axi/pcie@1000120000/rp1/csi@110000"; + csi1 = "/axi/pcie@1000120000/rp1/csi@128000"; + rp1_csi1 = "/axi/pcie@1000120000/rp1/csi@128000"; + pio = "/axi/pcie@1000120000/rp1/pio@178000"; + rp1_pio = "/axi/pcie@1000120000/rp1/pio@178000"; + rp1_mmc0 = "/axi/pcie@1000120000/rp1/mmc@180000"; + rp1_mmc1 = "/axi/pcie@1000120000/rp1/mmc@184000"; + rp1_dma = "/axi/pcie@1000120000/rp1/dma@188000"; + rp1_usb0 = "/axi/pcie@1000120000/rp1/usb@200000"; + rp1_usb1 = "/axi/pcie@1000120000/rp1/usb@300000"; + dsi0 = "/axi/pcie@1000120000/rp1/dsi@110000"; + rp1_dsi0 = "/axi/pcie@1000120000/rp1/dsi@110000"; + dsi1 = "/axi/pcie@1000120000/rp1/dsi@128000"; + rp1_dsi1 = "/axi/pcie@1000120000/rp1/dsi@128000"; + vec = "/axi/pcie@1000120000/rp1/vec@144000"; + rp1_vec = "/axi/pcie@1000120000/rp1/vec@144000"; + dpi = "/axi/pcie@1000120000/rp1/dpi@148000"; + rp1_dpi = "/axi/pcie@1000120000/rp1/dpi@148000"; + sram = "/axi/pcie@1000120000/rp1/sram@400000"; + rp1_fw_shmem = "/axi/pcie@1000120000/rp1/sram@400000/shmem@ff00"; + mip0 = "/axi/msi-controller@1000130000"; + mip1 = "/axi/msi-controller@1000131000"; + iommu2 = "/axi/iommu@5100"; + iommu4 = "/axi/iommu@5200"; + iommu5 = "/axi/iommu@5280"; + iommuc = "/axi/iommuc@5b00"; + dma32 = "/axi/dma@10000"; + dma40 = "/axi/dma@10600"; + syscon_piarbctl = "/axi/syscon@400018"; + usb = "/axi/usb@480000"; + hevc_dec = "/axi/codec@800000"; + pisp_be = "/axi/pisp_be@880000"; + sdio2 = "/axi/mmc@1100000"; + wifi = "/axi/mmc@1100000/wifi@1"; + v3d = "/axi/v3d@2000000"; + clk_27MHz = "/clk-27M"; + clk_108MHz = "/clk-108M"; + hvs = "/hvs@107c580000"; + cpu_thermal = "/thermal-zones/cpu-thermal"; + thermal_trips = "/thermal-zones/cpu-thermal/trips"; + cpu_crit = "/thermal-zones/cpu-thermal/trips/cpu-crit"; + cpu_tepid = "/thermal-zones/cpu-thermal/trips/cpu-tepid"; + cpu_warm = "/thermal-zones/cpu-thermal/trips/cpu-warm"; + cpu_hot = "/thermal-zones/cpu-thermal/trips/cpu-hot"; + cpu_vhot = "/thermal-zones/cpu-thermal/trips/cpu-vhot"; + cooling_maps = "/thermal-zones/cpu-thermal/cooling-maps"; + firmwarekms = "/firmwarekms"; + usbphy = "/phy"; + leds = "/leds"; + led_pwr = "/leds/led-pwr"; + led_act = "/leds/led-act"; + sd_io_1v8_reg = "/sd-io-1v8-reg"; + sd_vcc_reg = "/sd-vcc-reg"; + wl_on_reg = "/wl-on-reg"; + cam1_clk = "/cam1_clk"; + cam0_clk = "/cam0_clk"; + cam0_reg = "/cam0_reg"; + cam1_reg = "/cam1_reg"; + cam_dummy_reg = "/cam_dummy_reg"; + aux = "/dummy"; + dummy = "/dummy"; + i2c0if = "/i2c0if"; + i2c0mux = "/i2c0mux"; + rp1_firmware = "/rp1_firmware"; + rp1_vdd_3v3 = "/rp1_vdd_3v3"; + chosen = "/chosen"; + aliases = "/aliases"; + fan = "/cooling_fan"; + pwr_key = "/pwr_button/pwr"; + }; +}; diff --git a/dtbs/rpi5b2.dts b/dtbs/rpi5b2.dts new file mode 100644 index 00000000..adea0115 --- /dev/null +++ b/dtbs/rpi5b2.dts @@ -0,0 +1,3292 @@ +/dts-v1/; + +/ { + compatible = "raspberrypi,5-model-b", "brcm,bcm2712"; + #address-cells = <0x02>; + #size-cells = <0x01>; + interrupt-parent = <0x01>; + model = "Raspberry Pi 5"; + + clocks { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0x76>; + + clk-osc { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "osc"; + clock-frequency = <0x337f980>; + phandle = <0x77>; + }; + + clk-vpu { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0x2cb41780>; + clock-output-names = "vpu-clock"; + phandle = <0x0f>; + }; + + clk-uart { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0x8ca000>; + clock-output-names = "uart-clock"; + phandle = <0x0e>; + }; + + clk-emmc2 { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0xbebc200>; + clock-output-names = "emmc2-clock"; + phandle = <0x08>; + }; + + clk-usb { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "otg"; + clock-frequency = <0x1c9c3800>; + phandle = <0x46>; + }; + + clk_xosc { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "xosc"; + clock-frequency = <0x2faf080>; + phandle = <0x29>; + }; + + sdio_src { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "src"; + clock-frequency = <0x3b9aca00>; + phandle = <0x3c>; + }; + + sdhci_core { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "core"; + clock-frequency = <0x2faf080>; + phandle = <0x3d>; + }; + + clksrc_gp0 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x21>; + clock-output-names = "clksrc_gp0"; + phandle = <0x78>; + }; + + clksrc_gp1 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x22>; + clock-output-names = "clksrc_gp1"; + phandle = <0x79>; + }; + + clksrc_gp2 { + status = "disabled"; + compatible = "fixed-factor-clock"; + clock-div = <0x01>; + clock-mult = <0x01>; + #clock-cells = <0x00>; + clocks = <0x02 0x23>; + clock-output-names = "clksrc_gp2"; + phandle = <0x7a>; + }; + + clksrc_gp3 { + status = "disabled"; + compatible = "fixed-factor-clock"; + clock-div = <0x01>; + clock-mult = <0x01>; + #clock-cells = <0x00>; + clocks = <0x02 0x24>; + clock-output-names = "clksrc_gp3"; + phandle = <0x7b>; + }; + + clksrc_gp4 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x25>; + clock-output-names = "clksrc_gp4"; + phandle = <0x7c>; + }; + + clksrc_gp5 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x26>; + clock-output-names = "clksrc_gp5"; + phandle = <0x7d>; + }; + }; + + cpus { + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0x7e>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x00>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x03>; + phandle = <0x4e>; + + l2-cache-l0 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x03>; + }; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x100>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x05>; + phandle = <0x4f>; + + l2-cache-l1 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x05>; + }; + }; + + cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x200>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x06>; + phandle = <0x50>; + + l2-cache-l2 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x06>; + }; + }; + + cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x300>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x07>; + phandle = <0x51>; + + l2-cache-l3 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x07>; + }; + }; + + l3-cache { + compatible = "cache"; + cache-size = <0x200000>; + cache-line-size = <0x40>; + cache-sets = <0x800>; + cache-level = <0x03>; + cache-unified; + phandle = <0x04>; + }; + }; + + psci { + method = "smc"; + compatible = "arm,psci-1.0", "arm,psci-0.2"; + }; + + reserved-memory { + ranges; + #address-cells = <0x02>; + #size-cells = <0x01>; + phandle = <0x7f>; + + atf@0 { + reg = <0x00 0x00 0x80000>; + no-map; + }; + + linux,cma { + compatible = "shared-dma-pool"; + size = <0x4000000>; + reusable; + linux,cma-default; + alloc-ranges = <0x00 0x00 0x40000000>; + phandle = <0x80>; + }; + + nvram@0 { + compatible = "raspberrypi,bootloader-config", "nvmem-rmem"; + #address-cells = <0x01>; + #size-cells = <0x01>; + reg = <0x00 0x00 0x00>; + no-map; + status = "disabled"; + phandle = <0x81>; + }; + + nvram@1 { + compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem"; + #address-cells = <0x01>; + #size-cells = <0x01>; + reg = <0x00 0x00 0x00>; + no-map; + status = "disabled"; + phandle = <0x82>; + }; + }; + + soc@107c000000 { + compatible = "simple-bus"; + ranges = <0x00 0x10 0x00 0x80000000>; + #address-cells = <0x01>; + #size-cells = <0x01>; + phandle = <0x83>; + + reset-controller@119500 { + compatible = "brcm,bcm7216-pcie-sata-rescal"; + reg = <0x119500 0x10>; + #reset-cells = <0x00>; + phandle = <0x23>; + }; + + mmc@fff000 { + compatible = "brcm,bcm2712-sdhci", "brcm,sdhci-brcmstb"; + reg = <0xfff000 0x260 0xfff400 0x200>; + reg-names = "host", "cfg"; + interrupts = <0x00 0x111 0x04>; + clocks = <0x08>; + clock-names = "sw_sdio"; + mmc-ddr-3_3v; + pinctrl-0 = <0x09 0x0a>; + pinctrl-names = "default"; + vqmmc-supply = <0x0b>; + vmmc-supply = <0x0c>; + bus-width = <0x04>; + sd-uhs-sdr50; + sd-uhs-ddr50; + sd-uhs-sdr104; + supports-cqe = <0x01>; + cd-gpios = <0x0d 0x05 0x01>; + status = "okay"; + phandle = <0x74>; + }; + + reset-controller@1504318 { + compatible = "brcm,brcmstb-reset"; + reg = <0x1504318 0x30>; + #reset-cells = <0x01>; + phandle = <0x24>; + }; + + timer@7c003000 { + compatible = "brcm,bcm2835-system-timer"; + reg = <0x7c003000 0x1000>; + interrupts = <0x00 0x40 0x04 0x00 0x41 0x04 0x00 0x42 0x04 0x00 0x43 0x04>; + clock-frequency = <0xf4240>; + phandle = <0x84>; + }; + + mailbox@7c013880 { + compatible = "brcm,bcm2835-mbox"; + reg = <0x7c013880 0x40>; + interrupts = <0x00 0x21 0x04>; + #mbox-cells = <0x00>; + phandle = <0x22>; + }; + + interrupt-controller@7cd00000 { + compatible = "brcm,bcm2836-l1-intc"; + reg = <0x7cd00000 0x100>; + phandle = <0x85>; + }; + + serial@7d001000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7d001000 0x200>; + interrupts = <0x00 0x78 0x04>; + clocks = <0x0e 0x0f>; + clock-names = "uartclk", "apb_pclk"; + arm,primecell-periphid = <0x341011>; + status = "okay"; + phandle = <0x86>; + }; + + interrupt-controller@7d517000 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d517000 0x10>; + interrupts = <0x00 0xf7 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + }; + + gpio@7d517c00 { + compatible = "brcm,brcmstb-gpio"; + reg = <0x7d517c00 0x40>; + gpio-controller; + #gpio-cells = <0x02>; + brcm,gpio-bank-widths = <0x0f 0x06>; + brcm,gpio-direct; + gpio-line-names = "RP1_SDA", "RP1_SCL", "RP1_RUN", "SD_IOVDD_SEL", "SD_PWR_ON", "SD_CDET_N", "SD_FLG_N", "", "2712_WAKE", "2712_STAT_LED", "", "", "PMIC_INT", "UART_TX_FS", "UART_RX_FS", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "HDMI0_SCL", "HDMI0_SDA", "HDMI1_SCL", "HDMI1_SDA", "PMIC_SCL", "PMIC_SDA"; + phandle = <0x0d>; + + rp1_run_hog { + gpio-hog; + gpios = <0x02 0x00>; + output-high; + line-name = "RP1 RUN pin"; + }; + }; + + interrupt-controller@7fff9000 { + compatible = "arm,gic-400"; + reg = <0x7fff9000 0x1000 0x7fffa000 0x2000 0x7fffc000 0x2000 0x7fffe000 0x2000>; + interrupt-controller; + #interrupt-cells = <0x03>; + interrupts = <0x01 0x09 0xf04>; + phandle = <0x01>; + }; + + interrupt-controller@7d510600 { + compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; + reg = <0x7d510600 0x30>; + interrupts = <0x00 0xef 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x14>; + }; + + pixelvalve@7c410000 { + compatible = "brcm,bcm2712-pixelvalve0"; + reg = <0x7c410000 0x100>; + interrupts = <0x00 0x65 0x04>; + status = "disabled"; + phandle = <0x87>; + }; + + pixelvalve@7c411000 { + compatible = "brcm,bcm2712-pixelvalve1"; + reg = <0x7c411000 0x100>; + interrupts = <0x00 0x6e 0x04>; + status = "disabled"; + phandle = <0x88>; + }; + + mop@7c500000 { + compatible = "brcm,bcm2712-mop"; + reg = <0x7c500000 0x28>; + interrupt-parent = <0x10>; + interrupts = <0x01>; + status = "disabled"; + phandle = <0x89>; + }; + + moplet@7c501000 { + compatible = "brcm,bcm2712-moplet"; + reg = <0x7c501000 0x20>; + interrupt-parent = <0x10>; + interrupts = <0x00>; + status = "disabled"; + phandle = <0x8a>; + }; + + interrupt-controller@7c502000 { + compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; + reg = <0x7c502000 0x30>; + interrupts = <0x00 0x61 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x10>; + }; + + clock@7c700000 { + compatible = "brcm,brcm2711-dvp"; + reg = <0x7c700000 0x10>; + clocks = <0x11>; + #clock-cells = <0x01>; + #reset-cells = <0x01>; + phandle = <0x13>; + }; + + i2c@7d508200 { + compatible = "brcm,brcmstb-i2c"; + reg = <0x7d508200 0x58>; + interrupt-parent = <0x12>; + interrupts = <0x01>; + clock-frequency = <0x17cdc>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + phandle = <0x15>; + }; + + i2c@7d508280 { + compatible = "brcm,brcmstb-i2c"; + reg = <0x7d508280 0x58>; + interrupt-parent = <0x12>; + interrupts = <0x02>; + clock-frequency = <0x17cdc>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + phandle = <0x19>; + }; + + intc@7d508380 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d508380 0x10>; + interrupts = <0x00 0xf2 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x12>; + }; + + intc@7d508400 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d508400 0x10>; + interrupts = <0x00 0xf4 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x1f>; + }; + + hdmi@7ef00700 { + compatible = "brcm,bcm2712-hdmi0"; + reg = <0x7c701400 0x300 0x7c701000 0x200 0x7c701d00 0x300 0x7c702000 0x80 0x7c703800 0x200 0x7c704000 0x800 0x7c700100 0x80 0x7d510800 0x100 0x7c720000 0x100>; + reg-names = "hdmi", "dvp", "phy", "rm", "packet", "metadata", "csc", "cec", "hd"; + resets = <0x13 0x01>; + interrupt-parent = <0x14>; + interrupts = <0x01 0x02 0x03 0x07 0x08>; + interrupt-names = "cec-tx", "cec-rx", "cec-low", "hpd-connected", "hpd-removed"; + ddc = <0x15>; + status = "disabled"; + dmas = <0x16 0x41fa000c>; + dma-names = "audio-rx"; + clocks = <0x17 0x0d 0x17 0x0e 0x13 0x00 0x18>; + clock-names = "hdmi", "bvb", "audio", "cec"; + phandle = <0x8b>; + }; + + hdmi@7ef05700 { + compatible = "brcm,bcm2712-hdmi1"; + reg = <0x7c706400 0x300 0x7c706000 0x200 0x7c706d00 0x300 0x7c707000 0x80 0x7c708800 0x200 0x7c709000 0x800 0x7c700180 0x80 0x7d511000 0x100 0x7c720000 0x100>; + reg-names = "hdmi", "dvp", "phy", "rm", "packet", "metadata", "csc", "cec", "hd"; + resets = <0x13 0x02>; + interrupt-parent = <0x14>; + interrupts = <0x0b 0x0c 0x0d 0x0e 0x0f>; + interrupt-names = "cec-tx", "cec-rx", "cec-low", "hpd-connected", "hpd-removed"; + ddc = <0x19>; + status = "disabled"; + dmas = <0x16 0x41fa000d>; + dma-names = "audio-rx"; + clocks = <0x17 0x0d 0x17 0x0e 0x13 0x01 0x18>; + clock-names = "hdmi", "bvb", "audio", "cec"; + phandle = <0x8c>; + }; + + axiperf@7c012800 { + compatible = "brcm,bcm2712-axiperf"; + reg = <0x7c012800 0x100 0x7e000000 0x100>; + firmware = <0x1a>; + status = "disabled"; + phandle = <0x5e>; + }; + + spi@7d004000 { + compatible = "brcm,bcm2835-spi"; + reg = <0x7d004000 0x200>; + interrupts = <0x00 0x76 0x04>; + clocks = <0x0f>; + num-cs = <0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "okay"; + dmas = <0x16 0x03 0x16 0x04>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + cs-gpios = <0x1b 0x01 0x01>; + pinctrl-0 = <0x1c 0x1d>; + phandle = <0x8d>; + + spidev@0 { + compatible = "spidev"; + reg = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x1312d00>; + status = "okay"; + phandle = <0x8e>; + }; + }; + + i2c@7d005600 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7d005600 0x20>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x0f>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + clock-frequency = <0x61a80>; + pinctrl-0 = <0x1e>; + pinctrl-names = "default"; + phandle = <0x8f>; + }; + + watchdog@7d200000 { + compatible = "brcm,bcm2712-pm"; + reg = <0x7d200000 0x308>; + reg-names = "pm"; + #power-domain-cells = <0x01>; + #reset-cells = <0x01>; + system-power-controller; + phandle = <0x4c>; + }; + + rng@7d208000 { + compatible = "brcm,bcm2711-rng200"; + reg = <0x7d208000 0x28>; + status = "okay"; + phandle = <0x6c>; + }; + + intc@7d503000 { + compatible = "brcm,l2-intc"; + reg = <0x7d503000 0x18>; + interrupts = <0x00 0xee 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x59>; + }; + + pinctrl@7d504100 { + compatible = "brcm,bcm2712d0-pinctrl"; + reg = <0x7d504100 0x20>; + phandle = <0x90>; + + uarta_24_pins { + phandle = <0x20>; + + pin_rts { + function = "uart0"; + pins = "gpio24"; + bias-disable; + }; + + pin_cts { + function = "uart0"; + pins = "gpio25"; + bias-pull-up; + }; + + pin_txd { + function = "uart0"; + pins = "gpio26"; + bias-disable; + }; + + pin_rxd { + function = "uart0"; + pins = "gpio27"; + bias-pull-up; + }; + }; + + sdio2_30_pins { + phandle = <0x4a>; + + pin_clk { + function = "sd2"; + pins = "gpio30"; + bias-disable; + }; + + pin_cmd { + function = "sd2"; + pins = "gpio31"; + bias-pull-up; + }; + + pins_dat { + function = "sd2"; + pins = "gpio32", "gpio33", "gpio34", "gpio35"; + bias-pull-up; + }; + }; + + pwr_button_pins { + function = "gpio"; + pins = "gpio20"; + bias-pull-up; + phandle = <0x75>; + }; + + wl_on_pins { + function = "gpio"; + pins = "gpio28"; + phandle = <0x5a>; + }; + + bt_shutdown_pins { + function = "gpio"; + pins = "gpio29"; + phandle = <0x21>; + }; + + emmc_sd_pulls { + pins = "emmc_cmd", "emmc_dat0", "emmc_dat1", "emmc_dat2", "emmc_dat3"; + bias-pull-up; + phandle = <0x09>; + }; + + spi10_gpio2 { + function = "vc_spi0"; + pins = "gpio2", "gpio3", "gpio4"; + bias-disable; + phandle = <0x1c>; + }; + + spi10_cs_gpio1 { + function = "gpio"; + pins = "gpio1"; + bias-pull-up; + phandle = <0x1d>; + }; + }; + + gpio@7d508500 { + compatible = "brcm,brcmstb-gpio"; + reg = <0x7d508500 0x40>; + interrupt-parent = <0x1f>; + interrupts = <0x00>; + gpio-controller; + #gpio-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x02>; + brcm,gpio-bank-widths = <0x20 0x04>; + brcm,gpio-direct; + gpio-line-names = "", "2712_BOOT_CS_N", "2712_BOOT_MISO", "2712_BOOT_MOSI", "2712_BOOT_SCLK", "", "", "", "", "", "-", "-", "-", "-", "PCIE_SDA", "PCIE_SCL", "", "", "-", "-", "PWR_GPIO", "2712_G21_FS", "-", "-", "BT_RTS", "BT_CTS", "BT_TXD", "BT_RXD", "WL_ON", "BT_ON", "WIFI_SDIO_CLK", "WIFI_SDIO_CMD", "WIFI_SDIO_D0", "WIFI_SDIO_D1", "WIFI_SDIO_D2", "WIFI_SDIO_D3"; + phandle = <0x1b>; + }; + + serial@7d50c000 { + compatible = "brcm,bcm7271-uart"; + reg = <0x7d50c000 0x20>; + reg-names = "uart"; + reg-shift = <0x02>; + reg-io-width = <0x04>; + interrupts = <0x00 0x114 0x04>; + skip-init; + status = "okay"; + uart-has-rtscts; + auto-flow-control; + clock-frequency = <0x5b8d800>; + pinctrl-0 = <0x20 0x21>; + pinctrl-names = "default"; + phandle = <0x91>; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <0x2dc6c0>; + shutdown-gpios = <0x1b 0x1d 0x00>; + local-bd-address = [00 00 00 00 00 00]; + phandle = <0x5f>; + }; + }; + + pinctrl@7d510700 { + compatible = "brcm,bcm2712d0-aon-pinctrl"; + reg = <0x7d510700 0x1c>; + phandle = <0x92>; + + i2c3_m4_agpio0_pins { + function = "vc_i2c3"; + pins = "aon_gpio0", "aon_gpio1"; + bias-pull-up; + phandle = <0x1e>; + }; + + bsc_m1_agpio13_pins { + function = "bsc_m1"; + pins = "aon_gpio13", "aon_gpio14"; + bias-pull-up; + phandle = <0x93>; + }; + + bsc_pmu_sgpio4_pins { + function = "avs_pmu_bsc"; + pins = "aon_sgpio4", "aon_sgpio5"; + phandle = <0x94>; + }; + + bsc_m2_sgpio4_pins { + function = "bsc_m2"; + pins = "aon_sgpio4", "aon_sgpio5"; + phandle = <0x95>; + }; + + pwm_aon_agpio1_pins { + function = "aon_pwm"; + pins = "aon_gpio1", "aon_gpio2"; + phandle = <0x96>; + }; + + pwm_aon_agpio4_pins { + function = "vc_pwm0"; + pins = "aon_gpio4", "aon_gpio5"; + phandle = <0x97>; + }; + + pwm_aon_agpio7_pins { + function = "aon_pwm"; + pins = "aon_gpio7", "aon_gpio9"; + phandle = <0x98>; + }; + + emmc_aon_cd_pins { + function = "sd_card_g"; + pins = "aon_gpio5"; + bias-pull-up; + phandle = <0x0a>; + }; + + aon_pwm_1pin { + function = "aon_pwm"; + pins = "aon_gpio9"; + phandle = <0x99>; + }; + }; + + intc@7d517ac0 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d517ac0 0x10>; + interrupts = <0x00 0xf5 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x9a>; + }; + + avs-monitor@7d542000 { + compatible = "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"; + reg = <0x7d542000 0xf00>; + status = "okay"; + phandle = <0x9b>; + + thermal { + compatible = "brcm,bcm2711-thermal"; + #thermal-sensor-cells = <0x00>; + phandle = <0x52>; + }; + }; + + firmware { + compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; + #address-cells = <0x01>; + #size-cells = <0x01>; + mboxes = <0x22>; + dma-ranges; + phandle = <0x1a>; + + clocks { + compatible = "raspberrypi,firmware-clocks"; + #clock-cells = <0x01>; + phandle = <0x17>; + }; + + reset { + compatible = "raspberrypi,firmware-reset"; + #reset-cells = <0x01>; + phandle = <0x9c>; + }; + + vcio { + compatible = "raspberrypi,vcio"; + phandle = <0x9d>; + }; + }; + + power { + compatible = "raspberrypi,bcm2835-power"; + firmware = <0x1a>; + #power-domain-cells = <0x01>; + phandle = <0x48>; + }; + + fb { + compatible = "brcm,bcm2708-fb"; + firmware = <0x1a>; + phandle = <0x9e>; + }; + + rpi_rtc { + compatible = "raspberrypi,rpi-rtc"; + firmware = <0x1a>; + trickle-charge-microvolt = <0x00>; + phandle = <0x6d>; + }; + + nvmem { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x01>; + + nvmem_otp { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x1a>; + reg = <0x00 0xc0>; + phandle = <0x9f>; + }; + + nvmem_cust { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x1a>; + reg = <0x01 0x08>; + phandle = <0x68>; + }; + + nvmem_mac { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x1a>; + reg = <0x02 0x06>; + phandle = <0x69>; + }; + + nvmem_priv { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x1a>; + reg = <0x03 0x10>; + phandle = <0x6a>; + }; + }; + + fixedregulator_3v3 { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <0x325aa0>; + regulator-min-microvolt = <0x325aa0>; + regulator-name = "3v3"; + phandle = <0xa0>; + }; + + fixedregulator_5v0 { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <0x4c4b40>; + regulator-min-microvolt = <0x4c4b40>; + regulator-name = "5v0"; + phandle = <0xa1>; + }; + + gpiomem@7d508500 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d508500 0x40>; + chardev-name = "gpiomem1"; + }; + + gpiomem@7d517c00 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d517c00 0x40>; + chardev-name = "gpiomem2"; + }; + + gpiomem@7d504100 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d504100 0x20>; + chardev-name = "gpiomem3"; + }; + + gpiomem@7d510700 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d510700 0x20>; + chardev-name = "gpiomem4"; + }; + + sound { + status = "disabled"; + phandle = <0xa2>; + }; + }; + + axi { + compatible = "simple-bus"; + #address-cells = <0x02>; + #size-cells = <0x02>; + ranges = <0x00 0x00 0x00 0x00 0x10 0x00 0x10 0x00 0x10 0x00 0x01 0x00 0x14 0x00 0x14 0x00 0x04 0x00 0x18 0x00 0x18 0x00 0x04 0x00 0x1c 0x00 0x1c 0x00 0x04 0x00>; + dma-ranges = <0x00 0x00 0x00 0x00 0x10 0x00 0x10 0x00 0x10 0x00 0x01 0x00 0x14 0x00 0x14 0x00 0x04 0x00 0x18 0x00 0x18 0x00 0x04 0x00 0x1c 0x00 0x1c 0x00 0x04 0x00>; + phandle = <0xa3>; + + gpu { + compatible = "brcm,bcm2712d0-vc6", "brcm,bcm2712-vc6"; + status = "disabled"; + phandle = <0xa4>; + }; + + pcie@1000100000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x100000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x00>; + max-link-speed = <0x02>; + num-lanes = <0x01>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xd5 0x04 0x00 0xd6 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xd1 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xd2 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xd3 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xd4 0x04>; + resets = <0x23 0x24 0x2a>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x25>; + ranges = <0x2000000 0x00 0x00 0x17 0x00 0x00 0xfffffffc 0x43000000 0x04 0x00 0x14 0x00 0x03 0x00>; + dma-ranges = <0x43000000 0x10 0x00 0x00 0x00 0x10 0x00>; + status = "disabled"; + phandle = <0x25>; + }; + + pcie@1000110000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x110000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x01>; + max-link-speed = <0x02>; + num-lanes = <0x01>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xdf 0x04 0x00 0xe0 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xdb 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xdc 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xdd 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xde 0x04>; + resets = <0x23 0x24 0x2b>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x26>; + ranges = <0x2000000 0x00 0x80000000 0x1b 0x80000000 0x00 0x80000000 0x43000000 0x04 0x00 0x18 0x00 0x03 0x80000000>; + dma-ranges = <0x3000000 0x10 0x00 0x00 0x00 0x10 0x00 0x3000000 0xff 0xfffff000 0x10 0x131000 0x00 0x1000>; + status = "disabled"; + brcm,fifo-qos-map = <0x3030303>; + brcm,clkreq-mode = "safe"; + phandle = <0x67>; + }; + + pcie@1000120000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x120000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x02>; + max-link-speed = <0x02>; + num-lanes = <0x04>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xe9 0x04 0x00 0xea 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xe5 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xe6 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xe7 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xe8 0x04>; + resets = <0x23 0x24 0x2c>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x27>; + ranges = <0x2000000 0x00 0x00 0x1f 0x00 0x00 0xfffffffc 0x43000000 0x04 0x00 0x1c 0x00 0x03 0x00>; + dma-ranges = <0x2000000 0x00 0x00 0x1f 0x00 0x00 0x400000 0x43000000 0x10 0x00 0x00 0x00 0x10 0x00 0x3000000 0xff 0xfffff000 0x10 0x130000 0x00 0x1000>; + status = "okay"; + brcm,vdm-qos-map = <0x8080809 0xa0a0b0b>; + aspm-no-l0s; + phandle = <0xa5>; + + rp1 { + compatible = "simple-bus"; + #address-cells = <0x02>; + #size-cells = <0x02>; + #interrupt-cells = <0x02>; + interrupt-controller; + interrupt-parent = <0x28>; + ranges = <0xc0 0x40000000 0x2000000 0x00 0x00 0x00 0x410000>; + dma-ranges = <0x10 0x00 0x43000000 0x10 0x00 0x10 0x00 0xc0 0x40000000 0x2000000 0x00 0x00 0x00 0x410000 0x00 0x00 0x2000000 0x10 0x00 0x10 0x00>; + phandle = <0x28>; + + mailbox@8000 { + compatible = "raspberrypi,rp1-mbox"; + status = "okay"; + reg = <0xc0 0x40008000 0x00 0x4000>; + interrupts = <0x3a 0x04>; + #mbox-cells = <0x01>; + phandle = <0x5b>; + }; + + clocks@18000 { + compatible = "raspberrypi,rp1-clocks"; + #clock-cells = <0x01>; + reg = <0xc0 0x40018000 0x00 0x10038>; + clocks = <0x29>; + assigned-clocks = <0x02 0x00 0x02 0x01 0x02 0x03 0x02 0x09 0x02 0x10 0x02 0x04 0x02 0x0a 0x02 0x0c 0x02 0x06 0x02 0x0d 0x02 0x1f 0x02 0x20 0x02 0x1d>; + assigned-clock-rates = <0x3b9aca00 0x5b8d8000 0xbebc200 0x7735940 0x7735940 0x3a98000 0x927c000 0xbebc200 0x5f5e100 0x2faf080 0xf4240 0xbebc200 0x2faf080>; + phandle = <0x02>; + }; + + serial@30000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40030000 0x00 0x100>; + interrupts = <0x19 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + pinctrl-0 = <0x2a>; + phandle = <0x70>; + }; + + serial@34000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40034000 0x00 0x100>; + interrupts = <0x2a 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa6>; + }; + + serial@38000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40038000 0x00 0x100>; + interrupts = <0x2b 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa7>; + }; + + serial@3c000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x4003c000 0x00 0x100>; + interrupts = <0x2c 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa8>; + }; + + serial@40000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40040000 0x00 0x100>; + interrupts = <0x2d 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa9>; + }; + + serial@44000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40044000 0x00 0x100>; + interrupts = <0x2e 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xaa>; + }; + + spi@4c000 { + reg = <0xc0 0x4004c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x38 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x37 0x2b 0x36>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xab>; + }; + + spi@50000 { + reg = <0xc0 0x40050000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x13 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x0d 0x2b 0x0c>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x2c 0x2d>; + cs-gpios = <0x2e 0x08 0x01 0x2e 0x07 0x01>; + phandle = <0x6e>; + + spidev@0 { + compatible = "spidev"; + reg = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x7735940>; + phandle = <0xac>; + }; + + spidev@1 { + compatible = "spidev"; + reg = <0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x7735940>; + phandle = <0xad>; + }; + }; + + spi@54000 { + reg = <0xc0 0x40054000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x14 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x0f 0x2b 0x0e>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xae>; + }; + + spi@58000 { + reg = <0xc0 0x40058000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x15 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x11 0x2b 0x10>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x2f>; + phandle = <0xaf>; + }; + + spi@5c000 { + reg = <0xc0 0x4005c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x16 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x13 0x2b 0x12>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x30>; + phandle = <0xb0>; + }; + + spi@60000 { + reg = <0xc0 0x40060000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x17 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x00>; + #size-cells = <0x00>; + num-cs = <0x01>; + spi-slave; + dmas = <0x2b 0x15 0x2b 0x14>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x31>; + phandle = <0xb1>; + + slave { + compatible = "spidev"; + spi-max-frequency = <0xf4240>; + }; + }; + + spi@64000 { + reg = <0xc0 0x40064000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x18 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x17 0x2b 0x16>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x32>; + phandle = <0xb2>; + }; + + spi@68000 { + reg = <0xc0 0x40068000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x36 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2b 0x33 0x2b 0x32>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xb3>; + }; + + spi@6c000 { + reg = <0xc0 0x4006c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x37 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x00>; + #size-cells = <0x00>; + num-cs = <0x01>; + spi-slave; + dmas = <0x2b 0x35 0x2b 0x34>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xb4>; + + slave { + compatible = "spidev"; + spi-max-frequency = <0xf4240>; + }; + }; + + i2c@70000 { + reg = <0xc0 0x40070000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x07 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-0 = <0x33>; + pinctrl-names = "default"; + clock-frequency = <0x186a0>; + phandle = <0x66>; + }; + + i2c@74000 { + reg = <0xc0 0x40074000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x08 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x34>; + clock-frequency = <0x186a0>; + phandle = <0x63>; + }; + + i2c@78000 { + reg = <0xc0 0x40078000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x09 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x35>; + phandle = <0xb5>; + }; + + i2c@7c000 { + reg = <0xc0 0x4007c000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0a 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x36>; + phandle = <0xb6>; + }; + + i2c@80000 { + reg = <0xc0 0x40080000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0b 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-0 = <0x37>; + pinctrl-names = "default"; + clock-frequency = <0x186a0>; + symlink = "i2c-4"; + phandle = <0x64>; + }; + + i2c@84000 { + reg = <0xc0 0x40084000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0c 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + phandle = <0xb7>; + }; + + i2c@88000 { + reg = <0xc0 0x40088000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0d 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-0 = <0x38>; + pinctrl-names = "default"; + clock-frequency = <0x186a0>; + symlink = "i2c-6"; + phandle = <0x65>; + }; + + audio_out@94000 { + compatible = "raspberrypi,rp1-audio-out"; + reg = <0xc0 0x40094000 0x00 0x4000>; + clocks = <0x02 0x14>; + assigned-clocks = <0x02 0x14>; + assigned-clock-rates = <0x927c000>; + assigned-clock-parents = <0x02 0x0a>; + dmas = <0x2b 0x1d>; + dma-maxburst = <0x04>; + dma-names = "tx"; + #sound-dai-cells = <0x00>; + status = "disabled"; + phandle = <0xb8>; + }; + + pwm@98000 { + compatible = "raspberrypi,rp1-pwm"; + reg = <0xc0 0x40098000 0x00 0x100>; + #pwm-cells = <0x03>; + clocks = <0x02 0x11>; + assigned-clocks = <0x02 0x11>; + assigned-clock-rates = <0x2faf080>; + status = "disabled"; + phandle = <0xb9>; + }; + + pwm@9c000 { + compatible = "raspberrypi,rp1-pwm"; + reg = <0xc0 0x4009c000 0x00 0x100>; + #pwm-cells = <0x03>; + clocks = <0x02 0x12>; + assigned-clocks = <0x02 0x12>; + assigned-clock-rates = <0x2faf080>; + status = "disabled"; + pinctrl-0 = <0x39>; + pinctrl-names = "default"; + phandle = <0x61>; + }; + + i2s@a0000 { + reg = <0xc0 0x400a0000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + clock-names = "i2sclk"; + #sound-dai-cells = <0x00>; + dmas = <0x2b 0x20 0x2b 0x1f>; + dma-names = "tx", "rx"; + dma-maxburst = <0x04>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x3a>; + phandle = <0xba>; + }; + + i2s@a4000 { + reg = <0xc0 0x400a4000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + clock-names = "i2sclk"; + #sound-dai-cells = <0x00>; + dmas = <0x2b 0x22 0x2b 0x21>; + dma-names = "tx", "rx"; + dma-maxburst = <0x04>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x3b>; + phandle = <0xbb>; + }; + + i2s@a8000 { + reg = <0xc0 0x400a8000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + status = "disabled"; + phandle = <0xbc>; + }; + + sdio_clk0@b0004 { + compatible = "raspberrypi,rp1-sdio-clk"; + reg = <0xc0 0x400b0004 0x00 0x1c>; + clocks = <0x3c 0x3d>; + clock-names = "src", "base"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x42>; + }; + + sdio_clk1@b4004 { + compatible = "raspberrypi,rp1-sdio-clk"; + reg = <0xc0 0x400b4004 0x00 0x1c>; + clocks = <0x3c 0x3d>; + clock-names = "src", "base"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x43>; + }; + + adc@c8000 { + compatible = "raspberrypi,rp1-adc"; + reg = <0xc0 0x400c8000 0x00 0x4000>; + clocks = <0x02 0x1e>; + clock-names = "adcclk"; + #clock-cells = <0x00>; + vref-supply = <0x3e>; + status = "okay"; + phandle = <0xbd>; + }; + + gpio@d0000 { + reg = <0xc0 0x400d0000 0x00 0xc000 0xc0 0x400e0000 0x00 0xc000 0xc0 0x400f0000 0x00 0xc000>; + compatible = "raspberrypi,rp1-gpio"; + interrupts = <0x00 0x04 0x01 0x04 0x02 0x04>; + gpio-controller; + #gpio-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x02>; + gpio-ranges = <0x2e 0x00 0x00 0x36>; + status = "okay"; + gpio-line-names = "ID_SDA", "ID_SCL", "GPIO2", "GPIO3", "GPIO4", "GPIO5", "GPIO6", "GPIO7", "GPIO8", "GPIO9", "GPIO10", "GPIO11", "GPIO12", "GPIO13", "GPIO14", "GPIO15", "GPIO16", "GPIO17", "GPIO18", "GPIO19", "GPIO20", "GPIO21", "GPIO22", "GPIO23", "GPIO24", "GPIO25", "GPIO26", "GPIO27", "PCIE_RP1_WAKE", "FAN_TACH", "HOST_SDA", "HOST_SCL", "ETH_RST_N", "-", "CD0_IO0_MICCLK", "CD0_IO0_MICDAT0", "RP1_PCIE_CLKREQ_N", "-", "CD0_SDA", "CD0_SCL", "CD1_SDA", "CD1_SCL", "USB_VBUS_EN", "USB_OC_N", "RP1_STAT_LED", "FAN_PWM", "CD1_IO0_MICCLK", "2712_WAKE", "CD1_IO1_MICDAT1", "EN_MAX_USB_CUR", "-", "-", "-", "-"; + phandle = <0x2e>; + + rp1_uart0_14_15 { + phandle = <0x2a>; + + pin_txd { + function = "uart0"; + pins = "gpio14"; + bias-disable; + }; + + pin_rxd { + function = "uart0"; + pins = "gpio15"; + bias-pull-up; + }; + }; + + rp1_uart0_ctsrts_16_17 { + phandle = <0xbe>; + + pin_cts { + function = "uart0"; + pins = "gpio16"; + bias-pull-up; + }; + + pin_rts { + function = "uart0"; + pins = "gpio17"; + bias-disable; + }; + }; + + rp1_uart1_0_1 { + phandle = <0xbf>; + + pin_txd { + function = "uart1"; + pins = "gpio0"; + bias-disable; + }; + + pin_rxd { + function = "uart1"; + pins = "gpio1"; + bias-pull-up; + }; + }; + + rp1_uart1_ctsrts_2_3 { + phandle = <0xc0>; + + pin_cts { + function = "uart1"; + pins = "gpio2"; + bias-pull-up; + }; + + pin_rts { + function = "uart1"; + pins = "gpio3"; + bias-disable; + }; + }; + + rp1_uart2_4_5 { + phandle = <0xc1>; + + pin_txd { + function = "uart2"; + pins = "gpio4"; + bias-disable; + }; + + pin_rxd { + function = "uart2"; + pins = "gpio5"; + bias-pull-up; + }; + }; + + rp1_uart2_ctsrts_6_7 { + phandle = <0xc2>; + + pin_cts { + function = "uart2"; + pins = "gpio6"; + bias-pull-up; + }; + + pin_rts { + function = "uart2"; + pins = "gpio7"; + bias-disable; + }; + }; + + rp1_uart3_8_9 { + phandle = <0xc3>; + + pin_txd { + function = "uart3"; + pins = "gpio8"; + bias-disable; + }; + + pin_rxd { + function = "uart3"; + pins = "gpio9"; + bias-pull-up; + }; + }; + + rp1_uart3_ctsrts_10_11 { + phandle = <0xc4>; + + pin_cts { + function = "uart3"; + pins = "gpio10"; + bias-pull-up; + }; + + pin_rts { + function = "uart3"; + pins = "gpio11"; + bias-disable; + }; + }; + + rp1_uart4_12_13 { + phandle = <0xc5>; + + pin_txd { + function = "uart4"; + pins = "gpio12"; + bias-disable; + }; + + pin_rxd { + function = "uart4"; + pins = "gpio13"; + bias-pull-up; + }; + }; + + rp1_uart4_ctsrts_14_15 { + phandle = <0xc6>; + + pin_cts { + function = "uart4"; + pins = "gpio14"; + bias-pull-up; + }; + + pin_rts { + function = "uart4"; + pins = "gpio15"; + bias-disable; + }; + }; + + rp1_sdio0_22_27 { + phandle = <0xc7>; + + pin_clk { + function = "sd0"; + pins = "gpio22"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pin_cmd { + function = "sd0"; + pins = "gpio23"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pins_dat { + function = "sd0"; + pins = "gpio24", "gpio25", "gpio26", "gpio27"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + }; + + rp1_sdio1_28_33 { + phandle = <0xc8>; + + pin_clk { + function = "sd1"; + pins = "gpio28"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pin_cmd { + function = "sd1"; + pins = "gpio29"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pins_dat { + function = "sd1"; + pins = "gpio30", "gpio31", "gpio32", "gpio33"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + }; + + rp1_i2s0_18_21 { + function = "i2s0"; + pins = "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0x3a>; + }; + + rp1_i2s1_18_21 { + function = "i2s1"; + pins = "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0x3b>; + }; + + rp1_i2c4_34_35 { + function = "i2c4"; + pins = "gpio34", "gpio35"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xc9>; + }; + + rp1_i2c6_38_39 { + function = "i2c6"; + pins = "gpio38", "gpio39"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x38>; + }; + + rp1_i2c4_40_41 { + function = "i2c4"; + pins = "gpio40", "gpio41"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x37>; + }; + + rp1_i2c5_44_45 { + function = "i2c5"; + pins = "gpio44", "gpio45"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xca>; + }; + + rp1_i2c0_0_1 { + function = "i2c0"; + pins = "gpio0", "gpio1"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x33>; + }; + + rp1_i2c0_8_9 { + function = "i2c0"; + pins = "gpio8", "gpio9"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcb>; + }; + + rp1_i2c1_2_3 { + function = "i2c1"; + pins = "gpio2", "gpio3"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x34>; + }; + + rp1_i2c1_10_11 { + function = "i2c1"; + pins = "gpio10", "gpio11"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcc>; + }; + + rp1_i2c2_4_5 { + function = "i2c2"; + pins = "gpio4", "gpio5"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x35>; + }; + + rp1_i2c2_12_13 { + function = "i2c2"; + pins = "gpio12", "gpio13"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcd>; + }; + + rp1_i2c3_6_7 { + function = "i2c3"; + pins = "gpio6", "gpio7"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x36>; + }; + + rp1_i2c3_14_15 { + function = "i2c3"; + pins = "gpio14", "gpio15"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xce>; + }; + + rp1_i2c3_22_23 { + function = "i2c3"; + pins = "gpio22", "gpio23"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcf>; + }; + + rp1_dpi_16bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19"; + bias-disable; + phandle = <0xd0>; + }; + + rp1_dpi_16bit_cpadhi_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24"; + bias-disable; + phandle = <0xd1>; + }; + + rp1_dpi_16bit_pad666_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xd2>; + }; + + rp1_dpi_18bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0xd3>; + }; + + rp1_dpi_18bit_cpadhi_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xd4>; + }; + + rp1_dpi_24bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27"; + bias-disable; + phandle = <0xd5>; + }; + + rp1_dpi_hvsync { + function = "dpi"; + pins = "gpio2", "gpio3"; + bias-disable; + phandle = <0xd6>; + }; + + rp1_dpi_16bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19"; + bias-disable; + phandle = <0xd7>; + }; + + rp1_dpi_16bit_cpadhi_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24"; + bias-disable; + phandle = <0xd8>; + }; + + rp1_dpi_16bit_pad666_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xd9>; + }; + + rp1_dpi_18bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0xda>; + }; + + rp1_dpi_18bit_cpadhi_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xdb>; + }; + + rp1_dpi_24bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27"; + bias-disable; + phandle = <0xdc>; + }; + + rp1_gpclksrc0_gpio4 { + function = "gpclk0"; + pins = "gpio4"; + bias-disable; + phandle = <0xdd>; + }; + + rp1_gpclksrc0_gpio20 { + function = "gpclk0"; + pins = "gpio20"; + bias-disable; + phandle = <0xde>; + }; + + rp1_gpclksrc1_gpio5 { + function = "gpclk1"; + pins = "gpio5"; + bias-disable; + phandle = <0xdf>; + }; + + rp1_gpclksrc1_gpio18 { + function = "gpclk1"; + pins = "gpio18"; + bias-disable; + phandle = <0xe0>; + }; + + rp1_gpclksrc1_gpio21 { + function = "gpclk1"; + pins = "gpio21"; + bias-disable; + phandle = <0xe1>; + }; + + rp1_pwm1_gpio45 { + function = "pwm1"; + pins = "gpio45"; + bias-pull-down; + phandle = <0x39>; + }; + + rp1_spi0_gpio9 { + function = "spi0"; + pins = "gpio9", "gpio10", "gpio11"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x2c>; + }; + + rp1_spi0_cs_gpio7 { + function = "spi0"; + pins = "gpio7", "gpio8"; + bias-pull-up; + phandle = <0x2d>; + }; + + rp1_spi1_gpio19 { + function = "spi1"; + pins = "gpio19", "gpio20", "gpio21"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0xe2>; + }; + + rp1_spi2_gpio1 { + function = "spi2"; + pins = "gpio1", "gpio2", "gpio3"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x2f>; + }; + + rp1_spi3_gpio5 { + function = "spi3"; + pins = "gpio5", "gpio6", "gpio7"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x30>; + }; + + rp1_spi4_gpio9 { + function = "spi4"; + pins = "gpio9", "gpio10", "gpio11"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x31>; + }; + + rp1_spi5_gpio13 { + function = "spi5"; + pins = "gpio13", "gpio14", "gpio15"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x32>; + }; + + rp1_spi8_gpio49 { + function = "spi8"; + pins = "gpio49", "gpio50", "gpio51"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0xe3>; + }; + + rp1_spi8_cs_gpio52 { + function = "spi0"; + pins = "gpio52", "gpio53"; + bias-pull-up; + phandle = <0xe4>; + }; + + rp1_audio_out_12_13 { + function = "aaud"; + pins = "gpio12", "gpio13"; + bias-disable; + phandle = <0xe5>; + }; + + usb_vbus_pins { + function = "vbus1"; + pins = "gpio42", "gpio43"; + phandle = <0x44>; + }; + }; + + ethernet@100000 { + reg = <0xc0 0x40100000 0x00 0x4000>; + compatible = "raspberrypi,rp1-gem", "cdns,macb"; + #address-cells = <0x01>; + #size-cells = <0x00>; + interrupts = <0x06 0x04>; + clocks = <0x02 0x0c 0x02 0x0c 0x02 0x1d 0x02 0x10>; + clock-names = "pclk", "hclk", "tsu_clk", "tx_clk"; + phy-mode = "rgmii-id"; + cdns,aw2w-max-pipe = [08]; + cdns,ar2r-max-pipe = [08]; + cdns,use-aw2b-fill; + local-mac-address = [00 00 00 00 00 00]; + status = "okay"; + phy-handle = <0x3f>; + phy-reset-gpios = <0x2e 0x20 0x01>; + phy-reset-duration = <0x05>; + phandle = <0xe6>; + + ethernet-phy@1 { + reg = <0x01>; + brcm,powerdown-enable; + eee-broken-1000t; + eee-broken-100tx; + phandle = <0x3f>; + }; + }; + + csi@110000 { + compatible = "raspberrypi,rp1-cfe"; + reg = <0xc0 0x40110000 0x00 0x100 0xc0 0x40114000 0x00 0x100 0xc0 0x40120000 0x00 0x100 0xc0 0x40124000 0x00 0x1000>; + interrupts = <0x2f 0x04>; + clocks = <0x02 0x16>; + assigned-clocks = <0x02 0x16>; + assigned-clock-rates = <0x17d7840>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + iommus = <0x40>; + phandle = <0xe7>; + }; + + csi@128000 { + compatible = "raspberrypi,rp1-cfe"; + reg = <0xc0 0x40128000 0x00 0x100 0xc0 0x4012c000 0x00 0x100 0xc0 0x40138000 0x00 0x100 0xc0 0x4013c000 0x00 0x1000>; + interrupts = <0x30 0x04>; + clocks = <0x02 0x17>; + assigned-clocks = <0x02 0x17>; + assigned-clock-rates = <0x17d7840>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + iommus = <0x40>; + phandle = <0xe8>; + }; + + pio@178000 { + reg = <0xc0 0x40178000 0x00 0x20>; + compatible = "raspberrypi,rp1-pio"; + firmware = <0x41>; + dmas = <0x2b 0x38 0x2b 0x39 0x2b 0x3a 0x2b 0x3b 0x2b 0x3c 0x2b 0x3d 0x2b 0x3e 0x2b 0x3f>; + dma-names = "tx0", "rx0", "tx1", "rx1", "tx2", "rx2", "tx3", "rx3"; + status = "okay"; + phandle = <0xe9>; + }; + + mmc@180000 { + reg = <0xc0 0x40180000 0x00 0x100>; + compatible = "raspberrypi,rp1-dwcmshc"; + interrupts = <0x11 0x04>; + clocks = <0x02 0x0c 0x3d 0x02 0x1f 0x42>; + clock-names = "bus", "core", "timeout", "sdio"; + no-1-8-v; + bus-width = <0x04>; + vmmc-supply = <0x3e>; + broken-cd; + status = "disabled"; + phandle = <0xea>; + }; + + mmc@184000 { + reg = <0xc0 0x40184000 0x00 0x100>; + compatible = "raspberrypi,rp1-dwcmshc"; + interrupts = <0x12 0x04>; + clocks = <0x02 0x0c 0x3d 0x02 0x1f 0x43>; + clock-names = "bus", "core", "timeout", "sdio"; + bus-width = <0x04>; + vmmc-supply = <0x3e>; + sdhci-caps-mask = <0x03 0x00>; + broken-cd; + status = "disabled"; + phandle = <0xeb>; + }; + + dma@188000 { + reg = <0xc0 0x40188000 0x00 0x1000>; + compatible = "snps,axi-dma-1.01a"; + interrupts = <0x28 0x04>; + clocks = <0x02 0x0e 0x02 0x0c>; + clock-names = "core-clk", "cfgr-clk"; + #dma-cells = <0x01>; + dma-channels = <0x08>; + snps,dma-masters = <0x01>; + snps,dma-targets = <0x40>; + snps,data-width = <0x04>; + snps,block-size = <0x40000 0x40000 0x40000 0x40000 0x40000 0x40000 0x40000 0x40000>; + snps,priority = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07>; + snps,axi-max-burst-len = <0x04>; + status = "okay"; + phandle = <0x2b>; + }; + + usb@200000 { + reg = <0xc0 0x40200000 0x00 0x100000>; + compatible = "snps,dwc3"; + dr_mode = "host"; + usb3-lpm-capable; + snps,axi-pipe-limit = [08]; + snps,dis_rxdet_inp3_quirk; + snps,enhanced-nak-fs-quirk; + snps,parkmode-disable-ss-quirk; + snps,parkmode-disable-hs-quirk; + snps,parkmode-disable-fsls-quirk; + snps,tx-max-burst = [08]; + snps,tx-thr-num-pkt = [02]; + interrupts = <0x1f 0x01>; + status = "okay"; + pinctrl-0 = <0x44>; + pinctrl-names = "default"; + phandle = <0xec>; + }; + + usb@300000 { + reg = <0xc0 0x40300000 0x00 0x100000>; + compatible = "snps,dwc3"; + dr_mode = "host"; + usb3-lpm-capable; + snps,axi-pipe-limit = [08]; + snps,dis_rxdet_inp3_quirk; + snps,enhanced-nak-fs-quirk; + snps,parkmode-disable-ss-quirk; + snps,parkmode-disable-hs-quirk; + snps,parkmode-disable-fsls-quirk; + snps,tx-max-burst = [08]; + snps,tx-thr-num-pkt = [02]; + interrupts = <0x24 0x01>; + status = "okay"; + phandle = <0xed>; + }; + + dsi@110000 { + compatible = "raspberrypi,rp1dsi"; + status = "disabled"; + reg = <0xc0 0x40118000 0x00 0x1000 0xc0 0x4011c000 0x00 0x1000 0xc0 0x40120000 0x00 0x1000>; + interrupts = <0x2f 0x04>; + clocks = <0x02 0x16 0x02 0x29 0x02 0x2d 0x29 0x02 0x03>; + clock-names = "cfgclk", "dpiclk", "byteclk", "refclk", "pllsys"; + assigned-clocks = <0x02 0x16>; + assigned-clock-rates = <0x17d7840>; + iommus = <0x40>; + phandle = <0xee>; + }; + + dsi@128000 { + compatible = "raspberrypi,rp1dsi"; + status = "disabled"; + reg = <0xc0 0x40130000 0x00 0x1000 0xc0 0x40134000 0x00 0x1000 0xc0 0x40138000 0x00 0x1000>; + interrupts = <0x30 0x04>; + clocks = <0x02 0x17 0x02 0x2a 0x02 0x2e 0x29 0x02 0x03>; + clock-names = "cfgclk", "dpiclk", "byteclk", "refclk", "pllsys"; + assigned-clocks = <0x02 0x17>; + assigned-clock-rates = <0x17d7840>; + iommus = <0x40>; + phandle = <0xef>; + }; + + vec@144000 { + compatible = "raspberrypi,rp1vec"; + status = "disabled"; + reg = <0xc0 0x40144000 0x00 0x1000 0xc0 0x40140000 0x00 0x1000>; + interrupts = <0x31 0x04>; + clocks = <0x02 0x27>; + assigned-clocks = <0x02 0x02 0x02 0x0b 0x02 0x27>; + assigned-clock-rates = <0x46cf7100 0x66ff300 0x66ff300>; + assigned-clock-parents = <0x00 0x02 0x02 0x02 0x0b>; + iommus = <0x40>; + phandle = <0xf0>; + }; + + dpi@148000 { + compatible = "raspberrypi,rp1dpi"; + status = "disabled"; + reg = <0xc0 0x40148000 0x00 0x1000 0xc0 0x40140000 0x00 0x1000>; + interrupts = <0x31 0x04>; + clocks = <0x02 0x28 0x02 0x05 0x02 0x02>; + clock-names = "dpiclk", "plldiv", "pllcore"; + assigned-clocks = <0x02 0x28>; + assigned-clock-parents = <0x02 0x05>; + iommus = <0x40>; + phandle = <0xf1>; + }; + + sram@400000 { + compatible = "mmio-sram"; + reg = <0xc0 0x40400000 0x00 0x10000>; + #address-cells = <0x01>; + #size-cells = <0x01>; + ranges = <0x00 0xc0 0x40400000 0x10000>; + phandle = <0xf2>; + + shmem@ff00 { + compatible = "raspberrypi,rp1-shmem"; + reg = <0xff00 0x100>; + phandle = <0x5c>; + }; + }; + + gpiomem@d0000 { + compatible = "raspberrypi,gpiomem"; + reg = <0xc0 0x400d0000 0x00 0x30000>; + chardev-name = "gpiomem0"; + }; + }; + }; + + msi-controller@1000130000 { + compatible = "brcm,bcm2712-mip"; + reg = <0x10 0x130000 0x00 0xc0 0xff 0xfffff000 0x00 0x1000>; + msi-controller; + msi-ranges = <0x01 0x00 0x80 0x01 0x40>; + brcm,msi-offset = <0x00>; + phandle = <0x27>; + }; + + msi-controller@1000131000 { + compatible = "brcm,bcm2712-mip"; + reg = <0x10 0x131000 0x00 0xc0 0xff 0xfffff000 0x00 0x1000>; + msi-controller; + msi-ranges = <0x01 0x00 0xf7 0x01 0x08>; + brcm,msi-offset = <0x08>; + phandle = <0x26>; + }; + + iommu@5100 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5100 0x00 0x80>; + cache = <0x45>; + #iommu-cells = <0x00>; + phandle = <0x49>; + }; + + iommu@5200 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5200 0x00 0x80>; + cache = <0x45>; + #iommu-cells = <0x00>; + #interconnect-cells = <0x00>; + phandle = <0x4d>; + }; + + iommu@5280 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5280 0x00 0x80>; + cache = <0x45>; + #iommu-cells = <0x00>; + dma-iova-offset = <0x10 0x00>; + phandle = <0x40>; + }; + + iommuc@5b00 { + compatible = "brcm,bcm2712-iommuc"; + reg = <0x10 0x5b00 0x00 0x80>; + phandle = <0x45>; + }; + + dma@10000 { + compatible = "brcm,bcm2712-dma"; + reg = <0x10 0x10000 0x00 0x600>; + interrupts = <0x00 0x50 0x04 0x00 0x51 0x04 0x00 0x52 0x04 0x00 0x53 0x04 0x00 0x54 0x04 0x00 0x55 0x04>; + interrupt-names = "dma0", "dma1", "dma2", "dma3", "dma4", "dma5"; + #dma-cells = <0x01>; + brcm,dma-channel-mask = <0x3f>; + phandle = <0xf3>; + }; + + dma@10600 { + compatible = "brcm,bcm2712-dma"; + reg = <0x10 0x10600 0x00 0x600>; + interrupts = <0x00 0x56 0x04 0x00 0x57 0x04 0x00 0x58 0x04 0x00 0x59 0x04 0x00 0x5a 0x04 0x00 0x5b 0x04>; + interrupt-names = "dma6", "dma7", "dma8", "dma9", "dma10", "dma11"; + #dma-cells = <0x01>; + brcm,dma-channel-mask = <0x7c0>; + phandle = <0x16>; + }; + + syscon@400018 { + compatible = "brcm,syscon-piarbctl", "syscon", "simple-mfd"; + reg = <0x10 0x400018 0x00 0x18>; + phandle = <0xf4>; + }; + + usb@480000 { + compatible = "brcm,bcm2835-usb"; + reg = <0x10 0x480000 0x00 0x10000>; + interrupts = <0x00 0x49 0x04>; + #address-cells = <0x01>; + #size-cells = <0x00>; + clocks = <0x46>; + clock-names = "otg"; + phys = <0x47>; + phy-names = "usb2-phy"; + status = "disabled"; + power-domains = <0x48 0x06>; + phandle = <0xf5>; + }; + + codec@800000 { + compatible = "brcm,bcm2712-hevc-dec", "raspberrypi,hevc-dec"; + reg = <0x10 0x800000 0x00 0x10000 0x10 0x840000 0x00 0x1000>; + reg-names = "hevc", "intc"; + interrupts = <0x00 0x62 0x04>; + clocks = <0x17 0x0b>; + clock-names = "hevc"; + iommus = <0x49>; + phandle = <0xf6>; + }; + + pisp_be@880000 { + compatible = "raspberrypi,pispbe"; + reg = <0x10 0x880000 0x00 0x4000>; + interrupts = <0x00 0x48 0x04>; + clocks = <0x17 0x07>; + clocks-names = "isp_be"; + status = "okay"; + iommus = <0x49>; + phandle = <0xf7>; + }; + + mmc@1100000 { + compatible = "brcm,bcm2712-sdhci"; + reg = <0x10 0x1100000 0x00 0x260 0x10 0x1100400 0x00 0x200>; + reg-names = "host", "cfg"; + interrupts = <0x00 0x112 0x04>; + clocks = <0x08>; + sdhci-caps-mask = <0xc000 0x00>; + sdhci-caps = <0x00 0x00>; + supports-cqe = <0x01>; + mmc-ddr-3_3v; + status = "okay"; + pinctrl-0 = <0x4a>; + pinctrl-names = "default"; + bus-width = <0x04>; + vmmc-supply = <0x4b>; + sd-uhs-ddr50; + non-removable; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0xf8>; + + wifi@1 { + reg = <0x01>; + compatible = "brcm,bcm4329-fmac"; + local-mac-address = [00 00 00 00 00 00]; + phandle = <0x71>; + }; + }; + + v3d@2000000 { + compatible = "brcm,2712-v3d"; + reg = <0x10 0x2000000 0x00 0x4000 0x10 0x2008000 0x00 0x6000 0x10 0x2030800 0x00 0x700>; + reg-names = "hub", "core0", "sms"; + power-domains = <0x4c 0x01>; + resets = <0x4c 0x00>; + clocks = <0x17 0x05>; + clocks-names = "v3d"; + interrupts = <0x00 0xfa 0x04 0x00 0xf9 0x04>; + status = "disabled"; + phandle = <0xf9>; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <0x01 0x0d 0xf08 0x01 0x0e 0xf08 0x01 0x0b 0xf08 0x01 0x0a 0xf08 0x01 0x0c 0xf08>; + }; + + clk-27M { + #clock-cells = <0x00>; + compatible = "fixed-clock"; + clock-frequency = <0x19bfcc0>; + clock-output-names = "27MHz-clock"; + phandle = <0x18>; + }; + + clk-108M { + #clock-cells = <0x00>; + compatible = "fixed-clock"; + clock-frequency = <0x66ff300>; + clock-output-names = "108MHz-clock"; + phandle = <0x11>; + }; + + hvs@107c580000 { + compatible = "brcm,bcm2712-hvs"; + reg = <0x10 0x7c580000 0x1a000>; + interrupt-parent = <0x10>; + interrupts = <0x02 0x09 0x10>; + interrupt-names = "ch0-eof", "ch1-eof", "ch2-eof"; + iommus = <0x4d>; + status = "disabled"; + clocks = <0x17 0x04 0x17 0x10>; + clock-names = "core", "disp"; + phandle = <0xfa>; + }; + + arm-pmu { + compatible = "arm,cortex-a76-pmu"; + interrupts = <0x00 0x10 0x04 0x00 0x11 0x04 0x00 0x12 0x04 0x00 0x13 0x04>; + interrupt-affinity = <0x4e 0x4f 0x50 0x51>; + }; + + thermal-zones { + + cpu-thermal { + polling-delay-passive = <0x3e8>; + polling-delay = <0x3e8>; + coefficients = <0xfffffdda 0x6ddd0>; + thermal-sensors = <0x52>; + phandle = <0xfb>; + + trips { + phandle = <0xfc>; + + cpu-crit { + temperature = <0x1adb0>; + hysteresis = <0x00>; + type = "critical"; + phandle = <0x58>; + }; + + cpu-tepid { + temperature = <0xc350>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x53>; + }; + + cpu-warm { + temperature = <0xea60>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x55>; + }; + + cpu-hot { + temperature = <0x107ac>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x56>; + }; + + cpu-vhot { + temperature = <0x124f8>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x57>; + }; + }; + + cooling-maps { + phandle = <0xfd>; + + tepid { + trip = <0x53>; + cooling-device = <0x54 0x01 0x01>; + }; + + warm { + trip = <0x55>; + cooling-device = <0x54 0x02 0x02>; + }; + + hot { + trip = <0x56>; + cooling-device = <0x54 0x03 0x03>; + }; + + vhot { + trip = <0x57>; + cooling-device = <0x54 0x04 0x04>; + }; + + melt { + trip = <0x58>; + cooling-device = <0x54 0x04 0x04>; + }; + }; + }; + }; + + firmwarekms { + compatible = "raspberrypi,rpi-firmware-kms-2712"; + interrupt-parent = <0x59>; + interrupts = <0x13>; + brcm,firmware = <0x1a>; + status = "disabled"; + phandle = <0xfe>; + }; + + phy { + compatible = "usb-nop-xceiv"; + #phy-cells = <0x00>; + phandle = <0x47>; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00 0x00 0x28000000>; + }; + + leds { + compatible = "gpio-leds"; + phandle = <0xff>; + + led-pwr { + label = "PWR"; + gpios = <0x2e 0x2c 0x01>; + default-state = "off"; + linux,default-trigger = "none"; + phandle = <0x6b>; + }; + + led-act { + label = "ACT"; + gpios = <0x0d 0x09 0x01>; + default-state = "off"; + linux,default-trigger = "mmc0"; + phandle = <0x5d>; + }; + }; + + sd-io-1v8-reg { + compatible = "regulator-gpio"; + regulator-name = "vdd-sd-io"; + regulator-min-microvolt = <0x1b7740>; + regulator-max-microvolt = <0x325aa0>; + regulator-boot-on; + regulator-always-on; + regulator-settling-time-us = <0x1388>; + gpios = <0x0d 0x03 0x00>; + states = <0x1b7740 0x01 0x325aa0 0x00>; + phandle = <0x0b>; + }; + + sd-vcc-reg { + compatible = "regulator-fixed"; + regulator-name = "vcc-sd"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + regulator-boot-on; + enable-active-high; + gpios = <0x0d 0x04 0x00>; + phandle = <0x0c>; + }; + + wl-on-reg { + compatible = "regulator-fixed"; + regulator-name = "wl-on-regulator"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + pinctrl-0 = <0x5a>; + pinctrl-names = "default"; + gpio = <0x1b 0x1c 0x00>; + startup-delay-us = <0x249f0>; + enable-active-high; + phandle = <0x4b>; + }; + + cam1_clk { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x100>; + }; + + cam0_clk { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x101>; + }; + + cam0_reg { + compatible = "regulator-fixed"; + regulator-name = "cam0_reg"; + enable-active-high; + gpio = <0x2e 0x22 0x00>; + phandle = <0x72>; + }; + + cam1_reg { + compatible = "regulator-fixed"; + regulator-name = "cam1_reg"; + enable-active-high; + gpio = <0x2e 0x2e 0x00>; + phandle = <0x73>; + }; + + cam_dummy_reg { + compatible = "regulator-fixed"; + regulator-name = "cam-dummy-reg"; + phandle = <0x102>; + }; + + dummy { + phandle = <0x103>; + }; + + i2c0if { + phandle = <0x104>; + }; + + i2c0mux { + phandle = <0x105>; + }; + + rp1_firmware { + compatible = "raspberrypi,rp1-firmware", "simple-mfd"; + mboxes = <0x5b 0x00>; + shmem = <0x5c>; + phandle = <0x41>; + }; + + rp1_vdd_3v3 { + compatible = "regulator-fixed"; + regulator-name = "vdd-3v3"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + regulator-always-on; + phandle = <0x3e>; + }; + + chosen { + bootargs = "reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0"; + stdout-path = "serial10:115200n8"; + phandle = <0x6f>; + }; + + aliases { + blconfig = "/reserved-memory/nvram@0"; + blpubkey = "/reserved-memory/nvram@1"; + bluetooth = "/soc@107c000000/serial@7d50c000/bluetooth"; + console = "/soc@107c000000/serial@7d001000"; + drm-dsi1 = "/axi/pcie@1000120000/rp1/dsi@110000"; + drm-dsi2 = "/axi/pcie@1000120000/rp1/dsi@128000"; + ethernet0 = "/axi/pcie@1000120000/rp1/ethernet@100000"; + fb = "/soc@107c000000/fb"; + gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000"; + gpio1 = "/soc@107c000000/gpio@7d508500"; + gpio2 = "/soc@107c000000/gpio@7d517c00"; + gpio3 = "/soc@107c000000/pinctrl@7d504100"; + gpio4 = "/soc@107c000000/pinctrl@7d510700"; + gpiochip0 = "/axi/pcie@1000120000/rp1/gpio@d0000"; + gpiochip10 = "/soc@107c000000/gpio@7d508500"; + i2c = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + i2c10 = "/axi/pcie@1000120000/rp1/i2c@88000"; + i2c11 = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c12 = "/soc@107c000000/i2c@7d005600"; + mailbox = "/soc@107c000000/mailbox@7c013880"; + mmc0 = "/soc@107c000000/mmc@fff000"; + pio0 = "/axi/pcie@1000120000/rp1/pio@178000"; + serial0 = "/axi/pcie@1000120000/rp1/serial@30000"; + serial1 = "/axi/pcie@1000120000/rp1/serial@34000"; + serial10 = "/soc@107c000000/serial@7d001000"; + serial2 = "/axi/pcie@1000120000/rp1/serial@38000"; + serial3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + serial4 = "/axi/pcie@1000120000/rp1/serial@40000"; + spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + spi10 = "/soc@107c000000/spi@7d004000"; + spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + uart10 = "/soc@107c000000/serial@7d001000"; + uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + usb0 = "/axi/pcie@1000120000/rp1/usb@200000"; + usb1 = "/axi/pcie@1000120000/rp1/usb@300000"; + wifi0 = "/axi/mmc@1100000/wifi@1"; + phandle = <0x62>; + }; + + __overrides__ { + act_led_gpio = [00 00 00 5d 67 70 69 6f 73 3a 34 00 00 00 00 5d 67 70 69 6f 73 3a 30 3d 00 00 00 00 2e]; + act_led_activelow = "", "", "", "]gpios:8"; + act_led_trigger = "", "", "", "]linux,default-trigger"; + axiperf = "", "", "", "^status"; + bdaddr = "", "", "", "_local-bd-address["; + button_debounce = "", "", "", "`debounce-interval:0"; + cooling_fan = "", "", "", "Tstatus", "", "", "", "astatus"; + drm_fb0_rp1_dpi = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb0_rp1_dsi0 = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb0_rp1_dsi1 = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb0_vc4 = "", "", "", "bdrm-fb0=", "/axi/gpu"; + drm_fb1_rp1_dpi = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb1_rp1_dsi0 = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb1_rp1_dsi1 = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb1_vc4 = "", "", "", "bdrm-fb1=", "/axi/gpu"; + drm_fb2_rp1_dpi = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb2_rp1_dsi0 = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb2_rp1_dsi1 = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb2_vc4 = "", "", "", "bdrm-fb2=", "/axi/gpu"; + eth_led0 = "", "", "", "?led-modes:0"; + eth_led1 = "", "", "", "?led-modes:4"; + fan_temp0 = "", "", "", "Stemperature:0"; + fan_temp0_hyst = "", "", "", "Shysteresis:0"; + fan_temp0_speed = "", "", "", "Tcooling-levels:4"; + fan_temp1 = "", "", "", "Utemperature:0"; + fan_temp1_hyst = "", "", "", "Uhysteresis:0"; + fan_temp1_speed = "", "", "", "Tcooling-levels:8"; + fan_temp2 = "", "", "", "Vtemperature:0"; + fan_temp2_hyst = "", "", "", "Vhysteresis:0"; + fan_temp2_speed = "", "", "", "Tcooling-levels:12"; + fan_temp3 = "", "", "", "Wtemperature:0"; + fan_temp3_hyst = "", "", "", "Whysteresis:0"; + fan_temp3_speed = "", "", "", "Tcooling-levels:16"; + i2c = "", "", "", "cstatus"; + i2c_arm = "", "", "", "cstatus"; + i2c_arm_baudrate = "", "", "", "cclock-frequency:0"; + i2c_baudrate = "", "", "", "cclock-frequency:0"; + i2c_csi_dsi = "", "", "", "dstatus"; + i2c_csi_dsi0 = "", "", "", "estatus"; + i2c_csi_dsi1 = "", "", "", "dstatus"; + i2c_vc = "", "", "", "fstatus"; + i2c_vc_baudrate = "", "", "", "fclock-frequency:0"; + i2c0 = "", "", "", "fstatus"; + i2c0_baudrate = "", "", "", "fclock-frequency:0"; + i2c1 = "", "", "", "cstatus"; + i2c1_baudrate = "", "", "", "cclock-frequency:0"; + krnbt = "", "", "", "_status"; + nvme = "", "", "", "gstatus"; + nvmem_cust_rw = "", "", "", "hrw?"; + nvmem_mac_rw = "", "", "", "irw?"; + nvmem_priv_rw = "", "", "", "jrw?"; + pcie_tperst_clk_ms = "", "", "", "gbrcm,tperst-clk-ms:0"; + pciex1 = "", "", "", "gstatus"; + pciex1_gen = "", "", "", "gmax-link-speed:0"; + pciex1_no_l0s = "", "", "", "gaspm-no-l0s?"; + pciex1_tperst_clk_ms = "", "", "", "gbrcm,tperst-clk-ms:0"; + pwr_led_gpio = "", "", "", "kgpios:4"; + pwr_led_activelow = "", "", "", "kgpios:8"; + pwr_led_trigger = "", "", "", "klinux,default-trigger"; + random = "", "", "", "lstatus"; + rtc = "", "", "", "mstatus"; + rtc_bbat_vchg = "", "", "", "mtrickle-charge-microvolt:0"; + spi = "", "", "", "nstatus"; + strict_gpiod = "", "", "", "obootargs=pinctrl_rp1.persist_gpio_outputs=n"; + suspend = "", "", "", "`linux,code:0=205"; + uart0 = "", "", "", "pstatus"; + uart0_console = "", "", "", "pstatus", "", "", "", "bconsole=", "/axi/pcie@1000120000/rp1/serial@30000"; + uart0_dma = [00 00 00 70 64 6d 61 73 3a 30 3d 00 00 00 00 2b 00 00 00 70 64 6d 61 73 3a 34 3d 00 00 00 00 1a 00 00 00 70 64 6d 61 73 3a 38 3d 00 00 00 00 2b 00 00 00 70 64 6d 61 73 3a 31 32 3d 00 00 00 00 19 00 00 00 70 64 6d 61 2d 6e 61 6d 65 73 5b 3d 37 34 37 38 30 30 37 32 37 38 30 30 00]; + wifiaddr = "", "", "", "qlocal-mac-address["; + cam0_reg = "", "", "", "rstatus"; + cam0_reg_gpio = [00 00 00 72 67 70 69 6f 3a 34 00 00 00 00 72 67 70 69 6f 3a 30 3d 00 00 00 00 2e]; + cam1_reg = "", "", "", "sstatus"; + cam1_reg_gpio = [00 00 00 73 67 70 69 6f 3a 34 00 00 00 00 73 67 70 69 6f 3a 30 3d 00 00 00 00 2e]; + sd_cqe = "", "", "", "tsupports-cqe:0"; + }; + + cooling_fan { + status = "disabled"; + compatible = "pwm-fan"; + #cooling-cells = <0x02>; + cooling-min-state = <0x00>; + cooling-max-state = <0x03>; + cooling-levels = <0x00 0x4b 0x7d 0xaf 0xfa>; + pwms = <0x61 0x03 0xa25e 0x01>; + rpm-regmap = <0x61>; + rpm-offset = <0x3c>; + phandle = <0x54>; + }; + + pwr_button { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <0x75>; + status = "okay"; + + pwr { + label = "pwr_button"; + linux,code = <0x74>; + gpios = <0x1b 0x14 0x01>; + debounce-interval = <0x32>; + phandle = <0x60>; + }; + }; + + __symbols__ { + clocks = "/clocks"; + clk_osc = "/clocks/clk-osc"; + clk_vpu = "/clocks/clk-vpu"; + clk_uart = "/clocks/clk-uart"; + clk_emmc2 = "/clocks/clk-emmc2"; + clk_usb = "/clocks/clk-usb"; + clk_xosc = "/clocks/clk_xosc"; + sdio_src = "/clocks/sdio_src"; + sdhci_core = "/clocks/sdhci_core"; + clksrc_gp0 = "/clocks/clksrc_gp0"; + clksrc_gp1 = "/clocks/clksrc_gp1"; + clksrc_gp2 = "/clocks/clksrc_gp2"; + clksrc_gp3 = "/clocks/clksrc_gp3"; + clksrc_gp4 = "/clocks/clksrc_gp4"; + clksrc_gp5 = "/clocks/clksrc_gp5"; + cpus = "/cpus"; + cpu0 = "/cpus/cpu@0"; + l2_cache_l0 = "/cpus/cpu@0/l2-cache-l0"; + cpu1 = "/cpus/cpu@1"; + l2_cache_l1 = "/cpus/cpu@1/l2-cache-l1"; + cpu2 = "/cpus/cpu@2"; + l2_cache_l2 = "/cpus/cpu@2/l2-cache-l2"; + cpu3 = "/cpus/cpu@3"; + l2_cache_l3 = "/cpus/cpu@3/l2-cache-l3"; + l3_cache = "/cpus/l3-cache"; + rmem = "/reserved-memory"; + cma = "/reserved-memory/linux,cma"; + blconfig = "/reserved-memory/nvram@0"; + blpubkey = "/reserved-memory/nvram@1"; + soc = "/soc@107c000000"; + pcie_rescal = "/soc@107c000000/reset-controller@119500"; + sdio1 = "/soc@107c000000/mmc@fff000"; + bcm_reset = "/soc@107c000000/reset-controller@1504318"; + system_timer = "/soc@107c000000/timer@7c003000"; + mailbox = "/soc@107c000000/mailbox@7c013880"; + local_intc = "/soc@107c000000/interrupt-controller@7cd00000"; + uart10 = "/soc@107c000000/serial@7d001000"; + gio_aon = "/soc@107c000000/gpio@7d517c00"; + gicv2 = "/soc@107c000000/interrupt-controller@7fff9000"; + aon_intr = "/soc@107c000000/interrupt-controller@7d510600"; + pixelvalve0 = "/soc@107c000000/pixelvalve@7c410000"; + pixelvalve1 = "/soc@107c000000/pixelvalve@7c411000"; + mop = "/soc@107c000000/mop@7c500000"; + moplet = "/soc@107c000000/moplet@7c501000"; + disp_intr = "/soc@107c000000/interrupt-controller@7c502000"; + dvp = "/soc@107c000000/clock@7c700000"; + ddc0 = "/soc@107c000000/i2c@7d508200"; + ddc1 = "/soc@107c000000/i2c@7d508280"; + bsc_irq = "/soc@107c000000/intc@7d508380"; + main_irq = "/soc@107c000000/intc@7d508400"; + hdmi0 = "/soc@107c000000/hdmi@7ef00700"; + hdmi1 = "/soc@107c000000/hdmi@7ef05700"; + axiperf = "/soc@107c000000/axiperf@7c012800"; + spi10 = "/soc@107c000000/spi@7d004000"; + spidev10 = "/soc@107c000000/spi@7d004000/spidev@0"; + i2c10 = "/soc@107c000000/i2c@7d005600"; + pm = "/soc@107c000000/watchdog@7d200000"; + random = "/soc@107c000000/rng@7d208000"; + cpu_l2_irq = "/soc@107c000000/intc@7d503000"; + pinctrl = "/soc@107c000000/pinctrl@7d504100"; + uarta_24_pins = "/soc@107c000000/pinctrl@7d504100/uarta_24_pins"; + sdio2_30_pins = "/soc@107c000000/pinctrl@7d504100/sdio2_30_pins"; + pwr_button_pins = "/soc@107c000000/pinctrl@7d504100/pwr_button_pins"; + wl_on_pins = "/soc@107c000000/pinctrl@7d504100/wl_on_pins"; + bt_shutdown_pins = "/soc@107c000000/pinctrl@7d504100/bt_shutdown_pins"; + emmc_sd_pulls = "/soc@107c000000/pinctrl@7d504100/emmc_sd_pulls"; + spi10_pins = "/soc@107c000000/pinctrl@7d504100/spi10_gpio2"; + spi10_gpio2 = "/soc@107c000000/pinctrl@7d504100/spi10_gpio2"; + spi10_cs_pins = "/soc@107c000000/pinctrl@7d504100/spi10_cs_gpio1"; + spi10_cs_gpio1 = "/soc@107c000000/pinctrl@7d504100/spi10_cs_gpio1"; + gio = "/soc@107c000000/gpio@7d508500"; + uarta = "/soc@107c000000/serial@7d50c000"; + bluetooth = "/soc@107c000000/serial@7d50c000/bluetooth"; + pinctrl_aon = "/soc@107c000000/pinctrl@7d510700"; + i2c3_m4_agpio0_pins = "/soc@107c000000/pinctrl@7d510700/i2c3_m4_agpio0_pins"; + bsc_m1_agpio13_pins = "/soc@107c000000/pinctrl@7d510700/bsc_m1_agpio13_pins"; + bsc_pmu_sgpio4_pins = "/soc@107c000000/pinctrl@7d510700/bsc_pmu_sgpio4_pins"; + bsc_m2_sgpio4_pins = "/soc@107c000000/pinctrl@7d510700/bsc_m2_sgpio4_pins"; + pwm_aon_agpio1_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio1_pins"; + pwm_aon_agpio4_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio4_pins"; + pwm_aon_agpio7_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio7_pins"; + emmc_aon_cd_pins = "/soc@107c000000/pinctrl@7d510700/emmc_aon_cd_pins"; + aon_pwm_1pin = "/soc@107c000000/pinctrl@7d510700/aon_pwm_1pin"; + main_aon_irq = "/soc@107c000000/intc@7d517ac0"; + avs_monitor = "/soc@107c000000/avs-monitor@7d542000"; + thermal = "/soc@107c000000/avs-monitor@7d542000/thermal"; + firmware = "/soc@107c000000/firmware"; + firmware_clocks = "/soc@107c000000/firmware/clocks"; + reset = "/soc@107c000000/firmware/reset"; + vcio = "/soc@107c000000/firmware/vcio"; + power = "/soc@107c000000/power"; + fb = "/soc@107c000000/fb"; + rpi_rtc = "/soc@107c000000/rpi_rtc"; + nvmem_otp = "/soc@107c000000/nvmem/nvmem_otp"; + nvmem_cust = "/soc@107c000000/nvmem/nvmem_cust"; + nvmem_mac = "/soc@107c000000/nvmem/nvmem_mac"; + nvmem_priv = "/soc@107c000000/nvmem/nvmem_priv"; + vdd_3v3_reg = "/soc@107c000000/fixedregulator_3v3"; + vdd_5v0_reg = "/soc@107c000000/fixedregulator_5v0"; + sound = "/soc@107c000000/sound"; + axi = "/axi"; + vc4 = "/axi/gpu"; + pcie0 = "/axi/pcie@1000100000"; + pciex1 = "/axi/pcie@1000110000"; + pcie1 = "/axi/pcie@1000110000"; + pciex4 = "/axi/pcie@1000120000"; + rp1_target = "/axi/pcie@1000120000"; + pcie2 = "/axi/pcie@1000120000"; + rp1 = "/axi/pcie@1000120000/rp1"; + rp1_mbox = "/axi/pcie@1000120000/rp1/mailbox@8000"; + rp1_clocks = "/axi/pcie@1000120000/rp1/clocks@18000"; + uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + rp1_uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + rp1_uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + rp1_uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + rp1_uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + rp1_uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + rp1_uart5 = "/axi/pcie@1000120000/rp1/serial@44000"; + rp1_spi8 = "/axi/pcie@1000120000/rp1/spi@4c000"; + spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + rp1_spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + spidev0 = "/axi/pcie@1000120000/rp1/spi@50000/spidev@0"; + spidev1 = "/axi/pcie@1000120000/rp1/spi@50000/spidev@1"; + spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + rp1_spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + rp1_spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + rp1_spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + rp1_spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + rp1_spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + rp1_spi6 = "/axi/pcie@1000120000/rp1/spi@68000"; + rp1_spi7 = "/axi/pcie@1000120000/rp1/spi@6c000"; + i2c_vc = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + rp1_i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c_arm = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + rp1_i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + rp1_i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + rp1_i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + i2c_csi_dsi = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c_csi_dsi1 = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c4 = "/axi/pcie@1000120000/rp1/i2c@80000"; + rp1_i2c4 = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c5 = "/axi/pcie@1000120000/rp1/i2c@84000"; + rp1_i2c5 = "/axi/pcie@1000120000/rp1/i2c@84000"; + i2c_csi_dsi0 = "/axi/pcie@1000120000/rp1/i2c@88000"; + i2c6 = "/axi/pcie@1000120000/rp1/i2c@88000"; + rp1_i2c6 = "/axi/pcie@1000120000/rp1/i2c@88000"; + rp1_audio_out = "/axi/pcie@1000120000/rp1/audio_out@94000"; + pwm = "/axi/pcie@1000120000/rp1/pwm@98000"; + pwm0 = "/axi/pcie@1000120000/rp1/pwm@98000"; + rp1_pwm0 = "/axi/pcie@1000120000/rp1/pwm@98000"; + pwm1 = "/axi/pcie@1000120000/rp1/pwm@9c000"; + rp1_pwm1 = "/axi/pcie@1000120000/rp1/pwm@9c000"; + i2s_clk_producer = "/axi/pcie@1000120000/rp1/i2s@a0000"; + i2s = "/axi/pcie@1000120000/rp1/i2s@a0000"; + rp1_i2s0 = "/axi/pcie@1000120000/rp1/i2s@a0000"; + i2s_clk_consumer = "/axi/pcie@1000120000/rp1/i2s@a4000"; + rp1_i2s1 = "/axi/pcie@1000120000/rp1/i2s@a4000"; + rp1_i2s2 = "/axi/pcie@1000120000/rp1/i2s@a8000"; + rp1_sdio_clk0 = "/axi/pcie@1000120000/rp1/sdio_clk0@b0004"; + rp1_sdio_clk1 = "/axi/pcie@1000120000/rp1/sdio_clk1@b4004"; + rp1_adc = "/axi/pcie@1000120000/rp1/adc@c8000"; + gpio = "/axi/pcie@1000120000/rp1/gpio@d0000"; + rp1_gpio = "/axi/pcie@1000120000/rp1/gpio@d0000"; + uart0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_14_15"; + rp1_uart0_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_14_15"; + uart0_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_ctsrts_16_17"; + rp1_uart0_ctsrts_16_17 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_ctsrts_16_17"; + uart1_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_0_1"; + rp1_uart1_0_1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_0_1"; + uart1_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_ctsrts_2_3"; + rp1_uart1_ctsrts_2_3 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_ctsrts_2_3"; + uart2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_4_5"; + rp1_uart2_4_5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_4_5"; + uart2_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_ctsrts_6_7"; + rp1_uart2_ctsrts_6_7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_ctsrts_6_7"; + uart3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_8_9"; + rp1_uart3_8_9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_8_9"; + uart3_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_ctsrts_10_11"; + rp1_uart3_ctsrts_10_11 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_ctsrts_10_11"; + uart4_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_12_13"; + rp1_uart4_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_12_13"; + uart4_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_ctsrts_14_15"; + rp1_uart4_ctsrts_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_ctsrts_14_15"; + rp1_sdio0_22_27 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_sdio0_22_27"; + rp1_sdio1_28_33 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_sdio1_28_33"; + rp1_i2s0_18_21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2s0_18_21"; + rp1_i2s1_18_21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2s1_18_21"; + rp1_i2c4_34_35 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c4_34_35"; + rp1_i2c6_38_39 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c6_38_39"; + rp1_i2c4_40_41 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c4_40_41"; + rp1_i2c5_44_45 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c5_44_45"; + i2c0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_0_1"; + rp1_i2c0_0_1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_0_1"; + rp1_i2c0_8_9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_8_9"; + i2c1_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_2_3"; + rp1_i2c1_2_3 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_2_3"; + rp1_i2c1_10_11 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_10_11"; + i2c2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_4_5"; + rp1_i2c2_4_5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_4_5"; + rp1_i2c2_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_12_13"; + i2c3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_6_7"; + rp1_i2c3_6_7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_6_7"; + rp1_i2c3_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_14_15"; + rp1_i2c3_22_23 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_22_23"; + dpi_16bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio2"; + rp1_dpi_16bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio2"; + dpi_16bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio2"; + rp1_dpi_16bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio2"; + rp1_dpi_16bit_pad666_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_pad666_gpio2"; + dpi_18bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio2"; + rp1_dpi_18bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio2"; + dpi_18bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio2"; + rp1_dpi_18bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio2"; + dpi_gpio1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio2"; + rp1_dpi_24bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio2"; + rp1_dpi_hvsync = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_hvsync"; + dpi_16bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio0"; + rp1_dpi_16bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio0"; + dpi_16bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio0"; + rp1_dpi_16bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio0"; + rp1_dpi_16bit_pad666_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_pad666_gpio0"; + dpi_18bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio0"; + rp1_dpi_18bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio0"; + dpi_18bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio0"; + rp1_dpi_18bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio0"; + dpi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio0"; + rp1_dpi_24bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio0"; + rp1_gpclksrc0_gpio4 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc0_gpio4"; + rp1_gpclksrc0_gpio20 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc0_gpio20"; + rp1_gpclksrc1_gpio5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio5"; + rp1_gpclksrc1_gpio18 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio18"; + rp1_gpclksrc1_gpio21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio21"; + rp1_pwm1_gpio45 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_pwm1_gpio45"; + spi0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_gpio9"; + rp1_spi0_gpio9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_gpio9"; + spi0_cs_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_cs_gpio7"; + rp1_spi0_cs_gpio7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_cs_gpio7"; + rp1_spi1_gpio19 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi1_gpio19"; + spi2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi2_gpio1"; + rp1_spi2_gpio1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi2_gpio1"; + spi3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi3_gpio5"; + rp1_spi3_gpio5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi3_gpio5"; + spi4_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi4_gpio9"; + rp1_spi4_gpio9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi4_gpio9"; + spi5_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi5_gpio13"; + rp1_spi5_gpio13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi5_gpio13"; + rp1_spi8_gpio49 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi8_gpio49"; + rp1_spi8_cs_gpio52 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi8_cs_gpio52"; + rp1_audio_out_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_audio_out_12_13"; + usb_vbus_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/usb_vbus_pins"; + rp1_eth = "/axi/pcie@1000120000/rp1/ethernet@100000"; + phy1 = "/axi/pcie@1000120000/rp1/ethernet@100000/ethernet-phy@1"; + csi0 = "/axi/pcie@1000120000/rp1/csi@110000"; + rp1_csi0 = "/axi/pcie@1000120000/rp1/csi@110000"; + csi1 = "/axi/pcie@1000120000/rp1/csi@128000"; + rp1_csi1 = "/axi/pcie@1000120000/rp1/csi@128000"; + pio = "/axi/pcie@1000120000/rp1/pio@178000"; + rp1_pio = "/axi/pcie@1000120000/rp1/pio@178000"; + rp1_mmc0 = "/axi/pcie@1000120000/rp1/mmc@180000"; + rp1_mmc1 = "/axi/pcie@1000120000/rp1/mmc@184000"; + rp1_dma = "/axi/pcie@1000120000/rp1/dma@188000"; + rp1_usb0 = "/axi/pcie@1000120000/rp1/usb@200000"; + rp1_usb1 = "/axi/pcie@1000120000/rp1/usb@300000"; + dsi0 = "/axi/pcie@1000120000/rp1/dsi@110000"; + rp1_dsi0 = "/axi/pcie@1000120000/rp1/dsi@110000"; + dsi1 = "/axi/pcie@1000120000/rp1/dsi@128000"; + rp1_dsi1 = "/axi/pcie@1000120000/rp1/dsi@128000"; + vec = "/axi/pcie@1000120000/rp1/vec@144000"; + rp1_vec = "/axi/pcie@1000120000/rp1/vec@144000"; + dpi = "/axi/pcie@1000120000/rp1/dpi@148000"; + rp1_dpi = "/axi/pcie@1000120000/rp1/dpi@148000"; + sram = "/axi/pcie@1000120000/rp1/sram@400000"; + rp1_fw_shmem = "/axi/pcie@1000120000/rp1/sram@400000/shmem@ff00"; + mip0 = "/axi/msi-controller@1000130000"; + mip1 = "/axi/msi-controller@1000131000"; + iommu2 = "/axi/iommu@5100"; + iommu4 = "/axi/iommu@5200"; + iommu5 = "/axi/iommu@5280"; + iommuc = "/axi/iommuc@5b00"; + dma32 = "/axi/dma@10000"; + dma40 = "/axi/dma@10600"; + syscon_piarbctl = "/axi/syscon@400018"; + usb = "/axi/usb@480000"; + hevc_dec = "/axi/codec@800000"; + pisp_be = "/axi/pisp_be@880000"; + sdio2 = "/axi/mmc@1100000"; + wifi = "/axi/mmc@1100000/wifi@1"; + v3d = "/axi/v3d@2000000"; + clk_27MHz = "/clk-27M"; + clk_108MHz = "/clk-108M"; + hvs = "/hvs@107c580000"; + cpu_thermal = "/thermal-zones/cpu-thermal"; + thermal_trips = "/thermal-zones/cpu-thermal/trips"; + cpu_crit = "/thermal-zones/cpu-thermal/trips/cpu-crit"; + cpu_tepid = "/thermal-zones/cpu-thermal/trips/cpu-tepid"; + cpu_warm = "/thermal-zones/cpu-thermal/trips/cpu-warm"; + cpu_hot = "/thermal-zones/cpu-thermal/trips/cpu-hot"; + cpu_vhot = "/thermal-zones/cpu-thermal/trips/cpu-vhot"; + cooling_maps = "/thermal-zones/cpu-thermal/cooling-maps"; + firmwarekms = "/firmwarekms"; + usbphy = "/phy"; + leds = "/leds"; + led_pwr = "/leds/led-pwr"; + led_act = "/leds/led-act"; + sd_io_1v8_reg = "/sd-io-1v8-reg"; + sd_vcc_reg = "/sd-vcc-reg"; + wl_on_reg = "/wl-on-reg"; + cam1_clk = "/cam1_clk"; + cam0_clk = "/cam0_clk"; + cam0_reg = "/cam0_reg"; + cam1_reg = "/cam1_reg"; + cam_dummy_reg = "/cam_dummy_reg"; + aux = "/dummy"; + dummy = "/dummy"; + i2c0if = "/i2c0if"; + i2c0mux = "/i2c0mux"; + rp1_firmware = "/rp1_firmware"; + rp1_vdd_3v3 = "/rp1_vdd_3v3"; + chosen = "/chosen"; + aliases = "/aliases"; + fan = "/cooling_fan"; + pwr_key = "/pwr_button/pwr"; + }; +}; diff --git a/dtbs/rpicm5lio.dts b/dtbs/rpicm5lio.dts new file mode 100644 index 00000000..709196cc --- /dev/null +++ b/dtbs/rpicm5lio.dts @@ -0,0 +1,3324 @@ +/dts-v1/; + +/ { + compatible = "raspberrypi,5-compute-module", "brcm,bcm2712"; + #address-cells = <0x02>; + #size-cells = <0x01>; + interrupt-parent = <0x01>; + model = "Raspberry Pi Compute Module 5 Lite"; + + clocks { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0x76>; + + clk-osc { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "osc"; + clock-frequency = <0x337f980>; + phandle = <0x77>; + }; + + clk-vpu { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0x2cb41780>; + clock-output-names = "vpu-clock"; + phandle = <0x0e>; + }; + + clk-uart { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0x8ca000>; + clock-output-names = "uart-clock"; + phandle = <0x0d>; + }; + + clk-emmc2 { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-frequency = <0xbebc200>; + clock-output-names = "emmc2-clock"; + phandle = <0x08>; + }; + + clk-usb { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "otg"; + clock-frequency = <0x1c9c3800>; + phandle = <0x44>; + }; + + clk_xosc { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "xosc"; + clock-frequency = <0x2faf080>; + phandle = <0x28>; + }; + + sdio_src { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "src"; + clock-frequency = <0x3b9aca00>; + phandle = <0x3a>; + }; + + sdhci_core { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + clock-output-names = "core"; + clock-frequency = <0x2faf080>; + phandle = <0x3b>; + }; + + clksrc_gp0 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x21>; + clock-output-names = "clksrc_gp0"; + phandle = <0x78>; + }; + + clksrc_gp1 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x22>; + clock-output-names = "clksrc_gp1"; + phandle = <0x79>; + }; + + clksrc_gp2 { + status = "disabled"; + compatible = "fixed-factor-clock"; + clock-div = <0x01>; + clock-mult = <0x01>; + #clock-cells = <0x00>; + clocks = <0x02 0x23>; + clock-output-names = "clksrc_gp2"; + phandle = <0x7a>; + }; + + clksrc_gp3 { + status = "disabled"; + compatible = "fixed-factor-clock"; + clock-div = <0x01>; + clock-mult = <0x01>; + #clock-cells = <0x00>; + clocks = <0x02 0x24>; + clock-output-names = "clksrc_gp3"; + phandle = <0x7b>; + }; + + clksrc_gp4 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x25>; + clock-output-names = "clksrc_gp4"; + phandle = <0x7c>; + }; + + clksrc_gp5 { + status = "disabled"; + compatible = "fixed-factor-clock"; + #clock-cells = <0x00>; + clock-div = <0x01>; + clock-mult = <0x01>; + clocks = <0x02 0x26>; + clock-output-names = "clksrc_gp5"; + phandle = <0x7d>; + }; + }; + + cpus { + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0x7e>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x00>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x03>; + phandle = <0x4d>; + + l2-cache-l0 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x03>; + }; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x100>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x05>; + phandle = <0x4e>; + + l2-cache-l1 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x05>; + }; + }; + + cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x200>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x06>; + phandle = <0x4f>; + + l2-cache-l2 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x06>; + }; + }; + + cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a76"; + reg = <0x300>; + enable-method = "psci"; + d-cache-size = <0x10000>; + d-cache-line-size = <0x40>; + d-cache-sets = <0x100>; + i-cache-size = <0x10000>; + i-cache-line-size = <0x40>; + i-cache-sets = <0x100>; + next-level-cache = <0x07>; + phandle = <0x50>; + + l2-cache-l3 { + compatible = "cache"; + cache-size = <0x80000>; + cache-line-size = <0x40>; + cache-sets = <0x400>; + cache-level = <0x02>; + cache-unified; + next-level-cache = <0x04>; + phandle = <0x07>; + }; + }; + + l3-cache { + compatible = "cache"; + cache-size = <0x200000>; + cache-line-size = <0x40>; + cache-sets = <0x800>; + cache-level = <0x03>; + cache-unified; + phandle = <0x04>; + }; + }; + + psci { + method = "smc"; + compatible = "arm,psci-1.0", "arm,psci-0.2"; + }; + + reserved-memory { + ranges; + #address-cells = <0x02>; + #size-cells = <0x01>; + phandle = <0x7f>; + + atf@0 { + reg = <0x00 0x00 0x80000>; + no-map; + }; + + linux,cma { + compatible = "shared-dma-pool"; + size = <0x4000000>; + reusable; + linux,cma-default; + alloc-ranges = <0x00 0x00 0x40000000>; + phandle = <0x80>; + }; + + nvram@0 { + compatible = "raspberrypi,bootloader-config", "nvmem-rmem"; + #address-cells = <0x01>; + #size-cells = <0x01>; + reg = <0x00 0x00 0x00>; + no-map; + status = "disabled"; + phandle = <0x81>; + }; + + nvram@1 { + compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem"; + #address-cells = <0x01>; + #size-cells = <0x01>; + reg = <0x00 0x00 0x00>; + no-map; + status = "disabled"; + phandle = <0x82>; + }; + }; + + soc@107c000000 { + compatible = "simple-bus"; + ranges = <0x00 0x10 0x00 0x80000000>; + #address-cells = <0x01>; + #size-cells = <0x01>; + phandle = <0x83>; + + reset-controller@119500 { + compatible = "brcm,bcm7216-pcie-sata-rescal"; + reg = <0x119500 0x10>; + #reset-cells = <0x00>; + phandle = <0x22>; + }; + + mmc@fff000 { + compatible = "brcm,bcm2712-sdhci", "brcm,sdhci-brcmstb"; + reg = <0xfff000 0x260 0xfff400 0x200>; + reg-names = "host", "cfg"; + interrupts = <0x00 0x111 0x04>; + clocks = <0x08>; + clock-names = "sw_sdio"; + mmc-ddr-3_3v; + pinctrl-0 = <0x09 0x0a>; + pinctrl-names = "default"; + vqmmc-supply = <0x0b>; + vmmc-supply = <0x0c>; + bus-width = <0x08>; + sd-uhs-sdr50; + sd-uhs-ddr50; + sd-uhs-sdr104; + mmc-hs200-1_8v; + broken-cd; + supports-cqe = <0x01>; + status = "okay"; + phandle = <0x74>; + }; + + reset-controller@1504318 { + compatible = "brcm,brcmstb-reset"; + reg = <0x1504318 0x30>; + #reset-cells = <0x01>; + phandle = <0x23>; + }; + + timer@7c003000 { + compatible = "brcm,bcm2835-system-timer"; + reg = <0x7c003000 0x1000>; + interrupts = <0x00 0x40 0x04 0x00 0x41 0x04 0x00 0x42 0x04 0x00 0x43 0x04>; + clock-frequency = <0xf4240>; + phandle = <0x84>; + }; + + mailbox@7c013880 { + compatible = "brcm,bcm2835-mbox"; + reg = <0x7c013880 0x40>; + interrupts = <0x00 0x21 0x04>; + #mbox-cells = <0x00>; + phandle = <0x21>; + }; + + interrupt-controller@7cd00000 { + compatible = "brcm,bcm2836-l1-intc"; + reg = <0x7cd00000 0x100>; + phandle = <0x85>; + }; + + serial@7d001000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x7d001000 0x200>; + interrupts = <0x00 0x79 0x04>; + clocks = <0x0d 0x0e>; + clock-names = "uartclk", "apb_pclk"; + arm,primecell-periphid = <0x341011>; + status = "okay"; + phandle = <0x86>; + }; + + interrupt-controller@7d517000 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d517000 0x10>; + interrupts = <0x00 0xf7 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + }; + + gpio@7d517c00 { + compatible = "brcm,brcmstb-gpio"; + reg = <0x7d517c00 0x40>; + gpio-controller; + #gpio-cells = <0x02>; + brcm,gpio-bank-widths = <0x11 0x06>; + brcm,gpio-direct; + gpio-line-names = "RP1_SDA", "RP1_SCL", "RP1_RUN", "SD_IOVDD_SEL", "SD_PWR_ON", "ANT1", "ANT2", "-", "2712_WAKE", "2712_STAT_LED", "-", "-", "PMIC_INT", "UART_TX_FS", "UART_RX_FS", "-", "-", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "HDMI0_SCL", "HDMI0_SDA", "HDMI1_SCL", "HDMI1_SDA", "PMIC_SCL", "PMIC_SDA"; + phandle = <0x59>; + + rp1_run_hog { + gpio-hog; + gpios = <0x02 0x00>; + output-high; + line-name = "RP1 RUN pin"; + }; + + ant1-hog { + gpio-hog; + gpios = <0x05 0x00>; + output-high; + line-name = "ant1"; + phandle = <0x72>; + }; + + ant2-hog { + gpio-hog; + gpios = <0x06 0x00>; + output-low; + line-name = "ant2"; + phandle = <0x73>; + }; + }; + + interrupt-controller@7fff9000 { + compatible = "arm,gic-400"; + reg = <0x7fff9000 0x1000 0x7fffa000 0x2000 0x7fffc000 0x2000 0x7fffe000 0x2000>; + interrupt-controller; + #interrupt-cells = <0x03>; + interrupts = <0x01 0x09 0xf04>; + phandle = <0x01>; + }; + + interrupt-controller@7d510600 { + compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; + reg = <0x7d510600 0x30>; + interrupts = <0x00 0xef 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x13>; + }; + + pixelvalve@7c410000 { + compatible = "brcm,bcm2712-pixelvalve0"; + reg = <0x7c410000 0x100>; + interrupts = <0x00 0x65 0x04>; + status = "disabled"; + phandle = <0x87>; + }; + + pixelvalve@7c411000 { + compatible = "brcm,bcm2712-pixelvalve1"; + reg = <0x7c411000 0x100>; + interrupts = <0x00 0x6e 0x04>; + status = "disabled"; + phandle = <0x88>; + }; + + mop@7c500000 { + compatible = "brcm,bcm2712-mop"; + reg = <0x7c500000 0x28>; + interrupt-parent = <0x0f>; + interrupts = <0x01>; + status = "disabled"; + phandle = <0x89>; + }; + + moplet@7c501000 { + compatible = "brcm,bcm2712-moplet"; + reg = <0x7c501000 0x20>; + interrupt-parent = <0x0f>; + interrupts = <0x00>; + status = "disabled"; + phandle = <0x8a>; + }; + + interrupt-controller@7c502000 { + compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; + reg = <0x7c502000 0x30>; + interrupts = <0x00 0x61 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x0f>; + }; + + clock@7c700000 { + compatible = "brcm,brcm2711-dvp"; + reg = <0x7c700000 0x10>; + clocks = <0x10>; + #clock-cells = <0x01>; + #reset-cells = <0x01>; + phandle = <0x12>; + }; + + i2c@7d508200 { + compatible = "brcm,brcmstb-i2c"; + reg = <0x7d508200 0x58>; + interrupt-parent = <0x11>; + interrupts = <0x01>; + clock-frequency = <0x17cdc>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + phandle = <0x14>; + }; + + i2c@7d508280 { + compatible = "brcm,brcmstb-i2c"; + reg = <0x7d508280 0x58>; + interrupt-parent = <0x11>; + interrupts = <0x02>; + clock-frequency = <0x17cdc>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + phandle = <0x18>; + }; + + intc@7d508380 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d508380 0x10>; + interrupts = <0x00 0xf2 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x11>; + }; + + intc@7d508400 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d508400 0x10>; + interrupts = <0x00 0xf4 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x1e>; + }; + + hdmi@7ef00700 { + compatible = "brcm,bcm2712-hdmi0"; + reg = <0x7c701400 0x300 0x7c701000 0x200 0x7c701d00 0x300 0x7c702000 0x80 0x7c703800 0x200 0x7c704000 0x800 0x7c700100 0x80 0x7d510800 0x100 0x7c720000 0x100>; + reg-names = "hdmi", "dvp", "phy", "rm", "packet", "metadata", "csc", "cec", "hd"; + resets = <0x12 0x01>; + interrupt-parent = <0x13>; + interrupts = <0x01 0x02 0x03 0x07 0x08>; + interrupt-names = "cec-tx", "cec-rx", "cec-low", "hpd-connected", "hpd-removed"; + ddc = <0x14>; + status = "disabled"; + dmas = <0x15 0x41fa000a>; + dma-names = "audio-rx"; + clocks = <0x16 0x0d 0x16 0x0e 0x12 0x00 0x17>; + clock-names = "hdmi", "bvb", "audio", "cec"; + phandle = <0x8b>; + }; + + hdmi@7ef05700 { + compatible = "brcm,bcm2712-hdmi1"; + reg = <0x7c706400 0x300 0x7c706000 0x200 0x7c706d00 0x300 0x7c707000 0x80 0x7c708800 0x200 0x7c709000 0x800 0x7c700180 0x80 0x7d511000 0x100 0x7c720000 0x100>; + reg-names = "hdmi", "dvp", "phy", "rm", "packet", "metadata", "csc", "cec", "hd"; + resets = <0x12 0x02>; + interrupt-parent = <0x13>; + interrupts = <0x0b 0x0c 0x0d 0x0e 0x0f>; + interrupt-names = "cec-tx", "cec-rx", "cec-low", "hpd-connected", "hpd-removed"; + ddc = <0x18>; + status = "disabled"; + dmas = <0x15 0x41fa0011>; + dma-names = "audio-rx"; + clocks = <0x16 0x0d 0x16 0x0e 0x12 0x01 0x17>; + clock-names = "hdmi", "bvb", "audio", "cec"; + phandle = <0x8c>; + }; + + axiperf@7c012800 { + compatible = "brcm,bcm2712-axiperf"; + reg = <0x7c012800 0x100 0x7e000000 0x100>; + firmware = <0x19>; + status = "disabled"; + phandle = <0x5e>; + }; + + spi@7d004000 { + compatible = "brcm,bcm2835-spi"; + reg = <0x7d004000 0x200>; + interrupts = <0x00 0x76 0x04>; + clocks = <0x0e>; + num-cs = <0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "okay"; + dmas = <0x15 0x06 0x15 0x07>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + cs-gpios = <0x1a 0x01 0x01>; + pinctrl-0 = <0x1b 0x1c>; + phandle = <0x8d>; + + spidev@0 { + compatible = "spidev"; + reg = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x1312d00>; + status = "okay"; + phandle = <0x8e>; + }; + }; + + i2c@7d005600 { + compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; + reg = <0x7d005600 0x20>; + interrupts = <0x00 0x75 0x04>; + clocks = <0x0e>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + clock-frequency = <0x61a80>; + pinctrl-0 = <0x1d>; + pinctrl-names = "default"; + phandle = <0x8f>; + }; + + watchdog@7d200000 { + compatible = "brcm,bcm2712-pm"; + reg = <0x7d200000 0x308>; + reg-names = "pm"; + #power-domain-cells = <0x01>; + #reset-cells = <0x01>; + system-power-controller; + phandle = <0x4b>; + }; + + rng@7d208000 { + compatible = "brcm,bcm2711-rng200"; + reg = <0x7d208000 0x28>; + status = "okay"; + phandle = <0x6b>; + }; + + intc@7d503000 { + compatible = "brcm,l2-intc"; + reg = <0x7d503000 0x18>; + interrupts = <0x00 0xee 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + phandle = <0x58>; + }; + + pinctrl@7d504100 { + compatible = "brcm,bcm2712-pinctrl"; + reg = <0x7d504100 0x30>; + phandle = <0x90>; + + uarta_24_pins { + phandle = <0x1f>; + + pin_rts { + function = "uart0"; + pins = "gpio24"; + bias-disable; + }; + + pin_cts { + function = "uart0"; + pins = "gpio25"; + bias-pull-up; + }; + + pin_txd { + function = "uart0"; + pins = "gpio26"; + bias-disable; + }; + + pin_rxd { + function = "uart0"; + pins = "gpio27"; + bias-pull-up; + }; + }; + + sdio2_30_pins { + phandle = <0x48>; + + pin_clk { + function = "sd2"; + pins = "gpio30"; + bias-disable; + }; + + pin_cmd { + function = "sd2"; + pins = "gpio31"; + bias-pull-up; + }; + + pins_dat { + function = "sd2"; + pins = "gpio32", "gpio33", "gpio34", "gpio35"; + bias-pull-up; + }; + }; + + pwr_button_pins { + function = "gpio"; + pins = "gpio20"; + bias-pull-up; + phandle = <0x75>; + }; + + wl_on_pins { + function = "gpio"; + pins = "gpio28"; + phandle = <0x5a>; + }; + + bt_shutdown_pins { + function = "gpio"; + pins = "gpio29"; + phandle = <0x20>; + }; + + emmc_ds_pull { + pins = "emmc_ds"; + bias-pull-down; + phandle = <0x0a>; + }; + + emmc_cmddat_pulls { + pins = "emmc_cmd", "emmc_dat0", "emmc_dat1", "emmc_dat2", "emmc_dat3", "emmc_dat4", "emmc_dat5", "emmc_dat6", "emmc_dat7"; + bias-pull-up; + phandle = <0x09>; + }; + + spi10_gpio2 { + function = "vc_spi0"; + pins = "gpio2", "gpio3", "gpio4"; + bias-disable; + phandle = <0x1b>; + }; + + spi10_cs_gpio1 { + function = "gpio"; + pins = "gpio1"; + bias-pull-up; + phandle = <0x1c>; + }; + }; + + gpio@7d508500 { + compatible = "brcm,brcmstb-gpio"; + reg = <0x7d508500 0x40>; + interrupt-parent = <0x1e>; + interrupts = <0x00>; + gpio-controller; + #gpio-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x02>; + brcm,gpio-bank-widths = <0x20 0x04>; + brcm,gpio-direct; + gpio-line-names = "-", "2712_BOOT_CS_N", "2712_BOOT_MISO", "2712_BOOT_MOSI", "2712_BOOT_SCLK", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "PWR_GPIO", "2712_G21_FS", "-", "-", "BT_RTS", "BT_CTS", "BT_TXD", "BT_RXD", "WL_ON", "BT_ON", "WIFI_SDIO_CLK", "WIFI_SDIO_CMD", "WIFI_SDIO_D0", "WIFI_SDIO_D1", "WIFI_SDIO_D2", "WIFI_SDIO_D3"; + phandle = <0x1a>; + }; + + serial@7d50c000 { + compatible = "brcm,bcm7271-uart"; + reg = <0x7d50c000 0x20>; + reg-names = "uart"; + reg-shift = <0x02>; + reg-io-width = <0x04>; + interrupts = <0x00 0x114 0x04>; + skip-init; + status = "okay"; + uart-has-rtscts; + auto-flow-control; + clock-frequency = <0x5b8d800>; + pinctrl-0 = <0x1f 0x20>; + pinctrl-names = "default"; + phandle = <0x91>; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <0x2dc6c0>; + shutdown-gpios = <0x1a 0x1d 0x00>; + local-bd-address = [00 00 00 00 00 00]; + phandle = <0x5f>; + }; + }; + + pinctrl@7d510700 { + compatible = "brcm,bcm2712-aon-pinctrl"; + reg = <0x7d510700 0x20>; + phandle = <0x92>; + + i2c3_m4_agpio0_pins { + function = "vc_i2c3"; + pins = "aon_gpio0", "aon_gpio1"; + bias-pull-up; + phandle = <0x1d>; + }; + + bsc_m1_agpio13_pins { + function = "bsc_m1"; + pins = "aon_gpio13", "aon_gpio14"; + bias-pull-up; + phandle = <0x93>; + }; + + bsc_pmu_sgpio4_pins { + function = "avs_pmu_bsc"; + pins = "aon_sgpio4", "aon_sgpio5"; + phandle = <0x94>; + }; + + bsc_m2_sgpio4_pins { + function = "bsc_m2"; + pins = "aon_sgpio4", "aon_sgpio5"; + phandle = <0x95>; + }; + + pwm_aon_agpio1_pins { + function = "aon_pwm"; + pins = "aon_gpio1", "aon_gpio2"; + phandle = <0x96>; + }; + + pwm_aon_agpio4_pins { + function = "vc_pwm0"; + pins = "aon_gpio4", "aon_gpio5"; + phandle = <0x97>; + }; + + pwm_aon_agpio7_pins { + function = "aon_pwm"; + pins = "aon_gpio7", "aon_gpio9"; + phandle = <0x98>; + }; + + ant_pins { + function = "gpio"; + pins = "aon_gpio5", "aon_gpio6"; + phandle = <0x49>; + }; + + aon_pwm_1pin { + function = "aon_pwm"; + pins = "aon_gpio9"; + phandle = <0x99>; + }; + }; + + intc@7d517ac0 { + compatible = "brcm,bcm7271-l2-intc"; + reg = <0x7d517ac0 0x10>; + interrupts = <0x00 0xf5 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + status = "disabled"; + phandle = <0x9a>; + }; + + avs-monitor@7d542000 { + compatible = "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"; + reg = <0x7d542000 0xf00>; + status = "okay"; + phandle = <0x9b>; + + thermal { + compatible = "brcm,bcm2711-thermal"; + #thermal-sensor-cells = <0x00>; + phandle = <0x51>; + }; + }; + + firmware { + compatible = "raspberrypi,bcm2835-firmware", "simple-mfd"; + #address-cells = <0x01>; + #size-cells = <0x01>; + mboxes = <0x21>; + dma-ranges; + phandle = <0x19>; + + clocks { + compatible = "raspberrypi,firmware-clocks"; + #clock-cells = <0x01>; + phandle = <0x16>; + }; + + reset { + compatible = "raspberrypi,firmware-reset"; + #reset-cells = <0x01>; + phandle = <0x9c>; + }; + + vcio { + compatible = "raspberrypi,vcio"; + phandle = <0x9d>; + }; + }; + + power { + compatible = "raspberrypi,bcm2835-power"; + firmware = <0x19>; + #power-domain-cells = <0x01>; + phandle = <0x46>; + }; + + fb { + compatible = "brcm,bcm2708-fb"; + firmware = <0x19>; + phandle = <0x9e>; + }; + + rpi_rtc { + compatible = "raspberrypi,rpi-rtc"; + firmware = <0x19>; + trickle-charge-microvolt = <0x00>; + phandle = <0x6c>; + }; + + nvmem { + compatible = "simple-bus"; + #address-cells = <0x01>; + #size-cells = <0x01>; + + nvmem_otp { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x19>; + reg = <0x00 0xc0>; + phandle = <0x9f>; + }; + + nvmem_cust { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x19>; + reg = <0x01 0x08>; + phandle = <0x67>; + }; + + nvmem_mac { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x19>; + reg = <0x02 0x06>; + phandle = <0x68>; + }; + + nvmem_priv { + compatible = "raspberrypi,rpi-otp"; + firmware = <0x19>; + reg = <0x03 0x10>; + phandle = <0x69>; + }; + }; + + fixedregulator_3v3 { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <0x325aa0>; + regulator-min-microvolt = <0x325aa0>; + regulator-name = "3v3"; + phandle = <0xa0>; + }; + + fixedregulator_5v0 { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <0x4c4b40>; + regulator-min-microvolt = <0x4c4b40>; + regulator-name = "5v0"; + phandle = <0xa1>; + }; + + gpiomem@7d508500 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d508500 0x40>; + chardev-name = "gpiomem1"; + }; + + gpiomem@7d517c00 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d517c00 0x40>; + chardev-name = "gpiomem2"; + }; + + gpiomem@7d504100 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d504100 0x20>; + chardev-name = "gpiomem3"; + }; + + gpiomem@7d510700 { + compatible = "raspberrypi,gpiomem"; + reg = <0x7d510700 0x20>; + chardev-name = "gpiomem4"; + }; + + sound { + status = "disabled"; + phandle = <0xa2>; + }; + }; + + axi { + compatible = "simple-bus"; + #address-cells = <0x02>; + #size-cells = <0x02>; + ranges = <0x00 0x00 0x00 0x00 0x10 0x00 0x10 0x00 0x10 0x00 0x01 0x00 0x14 0x00 0x14 0x00 0x04 0x00 0x18 0x00 0x18 0x00 0x04 0x00 0x1c 0x00 0x1c 0x00 0x04 0x00>; + dma-ranges = <0x00 0x00 0x00 0x00 0x10 0x00 0x10 0x00 0x10 0x00 0x01 0x00 0x14 0x00 0x14 0x00 0x04 0x00 0x18 0x00 0x18 0x00 0x04 0x00 0x1c 0x00 0x1c 0x00 0x04 0x00>; + phandle = <0xa3>; + + gpu { + compatible = "brcm,bcm2712-vc6"; + status = "disabled"; + phandle = <0xa4>; + }; + + pcie@1000100000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x100000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x00>; + max-link-speed = <0x02>; + num-lanes = <0x01>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xd5 0x04 0x00 0xd6 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xd1 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xd2 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xd3 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xd4 0x04>; + resets = <0x22 0x23 0x2a>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x24>; + ranges = <0x2000000 0x00 0x00 0x17 0x00 0x00 0xfffffffc 0x43000000 0x04 0x00 0x14 0x00 0x03 0x00>; + dma-ranges = <0x43000000 0x10 0x00 0x00 0x00 0x10 0x00>; + status = "disabled"; + phandle = <0x24>; + }; + + pcie@1000110000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x110000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x01>; + max-link-speed = <0x02>; + num-lanes = <0x01>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xdf 0x04 0x00 0xe0 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xdb 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xdc 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xdd 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xde 0x04>; + resets = <0x22 0x23 0x2b>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x25>; + ranges = <0x2000000 0x00 0x80000000 0x1b 0x80000000 0x00 0x80000000 0x43000000 0x04 0x00 0x18 0x00 0x03 0x80000000>; + dma-ranges = <0x3000000 0x10 0x00 0x00 0x00 0x10 0x00 0x3000000 0xff 0xfffff000 0x10 0x131000 0x00 0x1000>; + status = "disabled"; + brcm,fifo-qos-map = <0x3030303>; + phandle = <0x66>; + }; + + pcie@1000120000 { + compatible = "brcm,bcm2712-pcie"; + reg = <0x10 0x120000 0x00 0x9310>; + device_type = "pci"; + linux,pci-domain = <0x02>; + max-link-speed = <0x02>; + num-lanes = <0x04>; + #address-cells = <0x03>; + #interrupt-cells = <0x01>; + #size-cells = <0x02>; + interrupt-parent = <0x01>; + interrupts = <0x00 0xe9 0x04 0x00 0xea 0x04>; + interrupt-names = "pcie", "msi"; + interrupt-map-mask = <0x00 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0xe5 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0xe6 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0xe7 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0xe8 0x04>; + resets = <0x22 0x23 0x2c>; + reset-names = "rescal", "bridge"; + msi-controller; + msi-parent = <0x26>; + ranges = <0x2000000 0x00 0x00 0x1f 0x00 0x00 0xfffffffc 0x43000000 0x04 0x00 0x1c 0x00 0x03 0x00>; + dma-ranges = <0x2000000 0x00 0x00 0x1f 0x00 0x00 0x400000 0x43000000 0x10 0x00 0x00 0x00 0x10 0x00 0x3000000 0xff 0xfffff000 0x10 0x130000 0x00 0x1000>; + status = "okay"; + brcm,vdm-qos-map = <0x8080809 0xa0a0b0b>; + aspm-no-l0s; + phandle = <0xa5>; + + rp1 { + compatible = "simple-bus"; + #address-cells = <0x02>; + #size-cells = <0x02>; + #interrupt-cells = <0x02>; + interrupt-controller; + interrupt-parent = <0x27>; + ranges = <0xc0 0x40000000 0x2000000 0x00 0x00 0x00 0x410000>; + dma-ranges = <0x10 0x00 0x43000000 0x10 0x00 0x10 0x00 0xc0 0x40000000 0x2000000 0x00 0x00 0x00 0x410000 0x00 0x00 0x2000000 0x10 0x00 0x10 0x00>; + phandle = <0x27>; + + mailbox@8000 { + compatible = "raspberrypi,rp1-mbox"; + status = "okay"; + reg = <0xc0 0x40008000 0x00 0x4000>; + interrupts = <0x3a 0x04>; + #mbox-cells = <0x01>; + phandle = <0x5b>; + }; + + clocks@18000 { + compatible = "raspberrypi,rp1-clocks"; + #clock-cells = <0x01>; + reg = <0xc0 0x40018000 0x00 0x10038>; + clocks = <0x28>; + assigned-clocks = <0x02 0x00 0x02 0x01 0x02 0x03 0x02 0x09 0x02 0x10 0x02 0x04 0x02 0x0a 0x02 0x0c 0x02 0x06 0x02 0x0d 0x02 0x1f 0x02 0x20 0x02 0x1d>; + assigned-clock-rates = <0x3b9aca00 0x5b8d8000 0xbebc200 0x7735940 0x7735940 0x3a98000 0x927c000 0xbebc200 0x5f5e100 0x2faf080 0xf4240 0xbebc200 0x2faf080>; + phandle = <0x02>; + }; + + serial@30000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40030000 0x00 0x100>; + interrupts = <0x19 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + pinctrl-0 = <0x29>; + phandle = <0x6f>; + }; + + serial@34000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40034000 0x00 0x100>; + interrupts = <0x2a 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa6>; + }; + + serial@38000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40038000 0x00 0x100>; + interrupts = <0x2b 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa7>; + }; + + serial@3c000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x4003c000 0x00 0x100>; + interrupts = <0x2c 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa8>; + }; + + serial@40000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40040000 0x00 0x100>; + interrupts = <0x2d 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xa9>; + }; + + serial@44000 { + compatible = "arm,pl011-axi"; + reg = <0xc0 0x40044000 0x00 0x100>; + interrupts = <0x2e 0x04>; + clocks = <0x02 0x0f 0x02 0x06>; + clock-names = "uartclk", "apb_pclk"; + pinctrl-names = "default"; + arm,primecell-periphid = <0x341011>; + uart-has-rtscts; + cts-event-workaround; + skip-init; + status = "disabled"; + phandle = <0xaa>; + }; + + spi@4c000 { + reg = <0xc0 0x4004c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x38 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2a 0x37 0x2a 0x36>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xab>; + }; + + spi@50000 { + reg = <0xc0 0x40050000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x13 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2a 0x0d 0x2a 0x0c>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x2b 0x2c>; + cs-gpios = <0x2d 0x08 0x01 0x2d 0x07 0x01>; + phandle = <0x6d>; + + spidev@0 { + compatible = "spidev"; + reg = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x7735940>; + phandle = <0xac>; + }; + + spidev@1 { + compatible = "spidev"; + reg = <0x01>; + #address-cells = <0x01>; + #size-cells = <0x00>; + spi-max-frequency = <0x7735940>; + phandle = <0xad>; + }; + }; + + spi@54000 { + reg = <0xc0 0x40054000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x14 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2a 0x0f 0x2a 0x0e>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xae>; + }; + + spi@58000 { + reg = <0xc0 0x40058000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x15 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2a 0x11 0x2a 0x10>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x2e>; + phandle = <0xaf>; + }; + + spi@5c000 { + reg = <0xc0 0x4005c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x16 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2a 0x13 0x2a 0x12>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x2f>; + phandle = <0xb0>; + }; + + spi@60000 { + reg = <0xc0 0x40060000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x17 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x00>; + #size-cells = <0x00>; + num-cs = <0x01>; + spi-slave; + dmas = <0x2a 0x15 0x2a 0x14>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x30>; + phandle = <0xb1>; + + slave { + compatible = "spidev"; + spi-max-frequency = <0xf4240>; + }; + }; + + spi@64000 { + reg = <0xc0 0x40064000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x18 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2a 0x17 0x2a 0x16>; + dma-names = "tx", "rx"; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x31>; + phandle = <0xb2>; + }; + + spi@68000 { + reg = <0xc0 0x40068000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x36 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x01>; + #size-cells = <0x00>; + num-cs = <0x02>; + dmas = <0x2a 0x33 0x2a 0x32>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xb3>; + }; + + spi@6c000 { + reg = <0xc0 0x4006c000 0x00 0x130>; + compatible = "snps,dw-apb-ssi"; + interrupts = <0x37 0x04>; + clocks = <0x02 0x0c>; + clock-names = "ssi_clk"; + #address-cells = <0x00>; + #size-cells = <0x00>; + num-cs = <0x01>; + spi-slave; + dmas = <0x2a 0x35 0x2a 0x34>; + dma-names = "tx", "rx"; + status = "disabled"; + phandle = <0xb4>; + + slave { + compatible = "spidev"; + spi-max-frequency = <0xf4240>; + }; + }; + + i2c@70000 { + reg = <0xc0 0x40070000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x07 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-0 = <0x32>; + pinctrl-names = "default"; + clock-frequency = <0x186a0>; + symlink = "i2c-11"; + phandle = <0x64>; + }; + + i2c@74000 { + reg = <0xc0 0x40074000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x08 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x33>; + clock-frequency = <0x186a0>; + phandle = <0x63>; + }; + + i2c@78000 { + reg = <0xc0 0x40078000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x09 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x34>; + phandle = <0xb5>; + }; + + i2c@7c000 { + reg = <0xc0 0x4007c000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0a 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x35>; + phandle = <0xb6>; + }; + + i2c@80000 { + reg = <0xc0 0x40080000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0b 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + phandle = <0xb7>; + }; + + i2c@84000 { + reg = <0xc0 0x40084000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0c 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + phandle = <0xb8>; + }; + + i2c@88000 { + reg = <0xc0 0x40088000 0x00 0x1000>; + compatible = "snps,designware-i2c"; + interrupts = <0x0d 0x04>; + clocks = <0x02 0x0c>; + i2c-scl-rising-time-ns = <0x41>; + i2c-scl-falling-time-ns = <0x64>; + status = "disabled"; + pinctrl-0 = <0x36>; + pinctrl-names = "default"; + clock-frequency = <0x186a0>; + symlink = "i2c-6"; + phandle = <0x65>; + }; + + audio_out@94000 { + compatible = "raspberrypi,rp1-audio-out"; + reg = <0xc0 0x40094000 0x00 0x4000>; + clocks = <0x02 0x14>; + assigned-clocks = <0x02 0x14>; + assigned-clock-rates = <0x927c000>; + assigned-clock-parents = <0x02 0x0a>; + dmas = <0x2a 0x1d>; + dma-maxburst = <0x04>; + dma-names = "tx"; + #sound-dai-cells = <0x00>; + status = "disabled"; + phandle = <0xb9>; + }; + + pwm@98000 { + compatible = "raspberrypi,rp1-pwm"; + reg = <0xc0 0x40098000 0x00 0x100>; + #pwm-cells = <0x03>; + clocks = <0x02 0x11>; + assigned-clocks = <0x02 0x11>; + assigned-clock-rates = <0x2faf080>; + status = "disabled"; + phandle = <0xba>; + }; + + pwm@9c000 { + compatible = "raspberrypi,rp1-pwm"; + reg = <0xc0 0x4009c000 0x00 0x100>; + #pwm-cells = <0x03>; + clocks = <0x02 0x12>; + assigned-clocks = <0x02 0x12>; + assigned-clock-rates = <0x2faf080>; + status = "disabled"; + pinctrl-0 = <0x37>; + pinctrl-names = "default"; + phandle = <0x61>; + }; + + i2s@a0000 { + reg = <0xc0 0x400a0000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + clock-names = "i2sclk"; + #sound-dai-cells = <0x00>; + dmas = <0x2a 0x20 0x2a 0x1f>; + dma-names = "tx", "rx"; + dma-maxburst = <0x04>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x38>; + phandle = <0xbb>; + }; + + i2s@a4000 { + reg = <0xc0 0x400a4000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + clock-names = "i2sclk"; + #sound-dai-cells = <0x00>; + dmas = <0x2a 0x22 0x2a 0x21>; + dma-names = "tx", "rx"; + dma-maxburst = <0x04>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x39>; + phandle = <0xbc>; + }; + + i2s@a8000 { + reg = <0xc0 0x400a8000 0x00 0x1000>; + compatible = "snps,designware-i2s"; + clocks = <0x02 0x15>; + status = "disabled"; + phandle = <0xbd>; + }; + + sdio_clk0@b0004 { + compatible = "raspberrypi,rp1-sdio-clk"; + reg = <0xc0 0x400b0004 0x00 0x1c>; + clocks = <0x3a 0x3b>; + clock-names = "src", "base"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x40>; + }; + + sdio_clk1@b4004 { + compatible = "raspberrypi,rp1-sdio-clk"; + reg = <0xc0 0x400b4004 0x00 0x1c>; + clocks = <0x3a 0x3b>; + clock-names = "src", "base"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x41>; + }; + + adc@c8000 { + compatible = "raspberrypi,rp1-adc"; + reg = <0xc0 0x400c8000 0x00 0x4000>; + clocks = <0x02 0x1e>; + clock-names = "adcclk"; + #clock-cells = <0x00>; + vref-supply = <0x3c>; + status = "okay"; + phandle = <0xbe>; + }; + + gpio@d0000 { + reg = <0xc0 0x400d0000 0x00 0xc000 0xc0 0x400e0000 0x00 0xc000 0xc0 0x400f0000 0x00 0xc000>; + compatible = "raspberrypi,rp1-gpio"; + interrupts = <0x00 0x04 0x01 0x04 0x02 0x04>; + gpio-controller; + #gpio-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x02>; + gpio-ranges = <0x2d 0x00 0x00 0x36>; + status = "okay"; + gpio-line-names = "ID_SDA", "ID_SCL", "GPIO2", "GPIO3", "GPIO4", "GPIO5", "GPIO6", "GPIO7", "GPIO8", "GPIO9", "GPIO10", "GPIO11", "GPIO12", "GPIO13", "GPIO14", "GPIO15", "GPIO16", "GPIO17", "GPIO18", "GPIO19", "GPIO20", "GPIO21", "GPIO22", "GPIO23", "GPIO24", "GPIO25", "GPIO26", "GPIO27", "PCIE_PWR_EN", "FAN_TACH", "HOST_SDA", "HOST_SCL", "ETH_RST_N", "PCIE_DET_WAKE", "CD0_IO0_MICCLK", "CD0_IO0_MICDAT0", "RP1_PCIE_CLKREQ_N", "ETH_IRQ_N", "SDA0", "SCL0", "-", "-", "USB_VBUS_EN", "-", "RP1_STAT_LED", "FAN_PWM", "-", "2712_WAKE", "-", "-", "-", "-", "-", "-"; + phandle = <0x2d>; + + rp1_uart0_14_15 { + phandle = <0x29>; + + pin_txd { + function = "uart0"; + pins = "gpio14"; + bias-disable; + }; + + pin_rxd { + function = "uart0"; + pins = "gpio15"; + bias-pull-up; + }; + }; + + rp1_uart0_ctsrts_16_17 { + phandle = <0xbf>; + + pin_cts { + function = "uart0"; + pins = "gpio16"; + bias-pull-up; + }; + + pin_rts { + function = "uart0"; + pins = "gpio17"; + bias-disable; + }; + }; + + rp1_uart1_0_1 { + phandle = <0xc0>; + + pin_txd { + function = "uart1"; + pins = "gpio0"; + bias-disable; + }; + + pin_rxd { + function = "uart1"; + pins = "gpio1"; + bias-pull-up; + }; + }; + + rp1_uart1_ctsrts_2_3 { + phandle = <0xc1>; + + pin_cts { + function = "uart1"; + pins = "gpio2"; + bias-pull-up; + }; + + pin_rts { + function = "uart1"; + pins = "gpio3"; + bias-disable; + }; + }; + + rp1_uart2_4_5 { + phandle = <0xc2>; + + pin_txd { + function = "uart2"; + pins = "gpio4"; + bias-disable; + }; + + pin_rxd { + function = "uart2"; + pins = "gpio5"; + bias-pull-up; + }; + }; + + rp1_uart2_ctsrts_6_7 { + phandle = <0xc3>; + + pin_cts { + function = "uart2"; + pins = "gpio6"; + bias-pull-up; + }; + + pin_rts { + function = "uart2"; + pins = "gpio7"; + bias-disable; + }; + }; + + rp1_uart3_8_9 { + phandle = <0xc4>; + + pin_txd { + function = "uart3"; + pins = "gpio8"; + bias-disable; + }; + + pin_rxd { + function = "uart3"; + pins = "gpio9"; + bias-pull-up; + }; + }; + + rp1_uart3_ctsrts_10_11 { + phandle = <0xc5>; + + pin_cts { + function = "uart3"; + pins = "gpio10"; + bias-pull-up; + }; + + pin_rts { + function = "uart3"; + pins = "gpio11"; + bias-disable; + }; + }; + + rp1_uart4_12_13 { + phandle = <0xc6>; + + pin_txd { + function = "uart4"; + pins = "gpio12"; + bias-disable; + }; + + pin_rxd { + function = "uart4"; + pins = "gpio13"; + bias-pull-up; + }; + }; + + rp1_uart4_ctsrts_14_15 { + phandle = <0xc7>; + + pin_cts { + function = "uart4"; + pins = "gpio14"; + bias-pull-up; + }; + + pin_rts { + function = "uart4"; + pins = "gpio15"; + bias-disable; + }; + }; + + rp1_sdio0_22_27 { + phandle = <0xc8>; + + pin_clk { + function = "sd0"; + pins = "gpio22"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pin_cmd { + function = "sd0"; + pins = "gpio23"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pins_dat { + function = "sd0"; + pins = "gpio24", "gpio25", "gpio26", "gpio27"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + }; + + rp1_sdio1_28_33 { + phandle = <0xc9>; + + pin_clk { + function = "sd1"; + pins = "gpio28"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pin_cmd { + function = "sd1"; + pins = "gpio29"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + + pins_dat { + function = "sd1"; + pins = "gpio30", "gpio31", "gpio32", "gpio33"; + bias-pull-up; + drive-strength = <0x0c>; + slew-rate = <0x01>; + }; + }; + + rp1_i2s0_18_21 { + function = "i2s0"; + pins = "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0x38>; + }; + + rp1_i2s1_18_21 { + function = "i2s1"; + pins = "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0x39>; + }; + + rp1_i2c4_34_35 { + function = "i2c4"; + pins = "gpio34", "gpio35"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xca>; + }; + + rp1_i2c6_38_39 { + function = "i2c6"; + pins = "gpio38", "gpio39"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x36>; + }; + + rp1_i2c4_40_41 { + function = "i2c4"; + pins = "gpio40", "gpio41"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcb>; + }; + + rp1_i2c5_44_45 { + function = "i2c5"; + pins = "gpio44", "gpio45"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcc>; + }; + + rp1_i2c0_0_1 { + function = "i2c0"; + pins = "gpio0", "gpio1"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x32>; + }; + + rp1_i2c0_8_9 { + function = "i2c0"; + pins = "gpio8", "gpio9"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcd>; + }; + + rp1_i2c1_2_3 { + function = "i2c1"; + pins = "gpio2", "gpio3"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x33>; + }; + + rp1_i2c1_10_11 { + function = "i2c1"; + pins = "gpio10", "gpio11"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xce>; + }; + + rp1_i2c2_4_5 { + function = "i2c2"; + pins = "gpio4", "gpio5"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x34>; + }; + + rp1_i2c2_12_13 { + function = "i2c2"; + pins = "gpio12", "gpio13"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xcf>; + }; + + rp1_i2c3_6_7 { + function = "i2c3"; + pins = "gpio6", "gpio7"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0x35>; + }; + + rp1_i2c3_14_15 { + function = "i2c3"; + pins = "gpio14", "gpio15"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xd0>; + }; + + rp1_i2c3_22_23 { + function = "i2c3"; + pins = "gpio22", "gpio23"; + drive-strength = <0x0c>; + bias-pull-up; + phandle = <0xd1>; + }; + + rp1_dpi_16bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19"; + bias-disable; + phandle = <0xd2>; + }; + + rp1_dpi_16bit_cpadhi_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24"; + bias-disable; + phandle = <0xd3>; + }; + + rp1_dpi_16bit_pad666_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xd4>; + }; + + rp1_dpi_18bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0xd5>; + }; + + rp1_dpi_18bit_cpadhi_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xd6>; + }; + + rp1_dpi_24bit_gpio2 { + function = "dpi"; + pins = "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27"; + bias-disable; + phandle = <0xd7>; + }; + + rp1_dpi_hvsync { + function = "dpi"; + pins = "gpio2", "gpio3"; + bias-disable; + phandle = <0xd8>; + }; + + rp1_dpi_16bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19"; + bias-disable; + phandle = <0xd9>; + }; + + rp1_dpi_16bit_cpadhi_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24"; + bias-disable; + phandle = <0xda>; + }; + + rp1_dpi_16bit_pad666_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xdb>; + }; + + rp1_dpi_18bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21"; + bias-disable; + phandle = <0xdc>; + }; + + rp1_dpi_18bit_cpadhi_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25"; + bias-disable; + phandle = <0xdd>; + }; + + rp1_dpi_24bit_gpio0 { + function = "dpi"; + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27"; + bias-disable; + phandle = <0xde>; + }; + + rp1_gpclksrc0_gpio4 { + function = "gpclk0"; + pins = "gpio4"; + bias-disable; + phandle = <0xdf>; + }; + + rp1_gpclksrc0_gpio20 { + function = "gpclk0"; + pins = "gpio20"; + bias-disable; + phandle = <0xe0>; + }; + + rp1_gpclksrc1_gpio5 { + function = "gpclk1"; + pins = "gpio5"; + bias-disable; + phandle = <0xe1>; + }; + + rp1_gpclksrc1_gpio18 { + function = "gpclk1"; + pins = "gpio18"; + bias-disable; + phandle = <0xe2>; + }; + + rp1_gpclksrc1_gpio21 { + function = "gpclk1"; + pins = "gpio21"; + bias-disable; + phandle = <0xe3>; + }; + + rp1_pwm1_gpio45 { + function = "pwm1"; + pins = "gpio45"; + bias-pull-down; + phandle = <0x37>; + }; + + rp1_spi0_gpio9 { + function = "spi0"; + pins = "gpio9", "gpio10", "gpio11"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x2b>; + }; + + rp1_spi0_cs_gpio7 { + function = "spi0"; + pins = "gpio7", "gpio8"; + bias-pull-up; + phandle = <0x2c>; + }; + + rp1_spi1_gpio19 { + function = "spi1"; + pins = "gpio19", "gpio20", "gpio21"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0xe4>; + }; + + rp1_spi2_gpio1 { + function = "spi2"; + pins = "gpio1", "gpio2", "gpio3"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x2e>; + }; + + rp1_spi3_gpio5 { + function = "spi3"; + pins = "gpio5", "gpio6", "gpio7"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x2f>; + }; + + rp1_spi4_gpio9 { + function = "spi4"; + pins = "gpio9", "gpio10", "gpio11"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x30>; + }; + + rp1_spi5_gpio13 { + function = "spi5"; + pins = "gpio13", "gpio14", "gpio15"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0x31>; + }; + + rp1_spi8_gpio49 { + function = "spi8"; + pins = "gpio49", "gpio50", "gpio51"; + bias-disable; + drive-strength = <0x0c>; + slew-rate = <0x01>; + phandle = <0xe5>; + }; + + rp1_spi8_cs_gpio52 { + function = "spi0"; + pins = "gpio52", "gpio53"; + bias-pull-up; + phandle = <0xe6>; + }; + + rp1_audio_out_12_13 { + function = "aaud"; + pins = "gpio12", "gpio13"; + bias-disable; + phandle = <0xe7>; + }; + + usb_vbus_pins { + function = "vbus1"; + pins = "gpio42", "gpio43"; + phandle = <0x42>; + }; + + micclk1_hog { + gpio-hog; + gpios = <0x2e 0x00>; + output-high; + }; + + micdat1_hog { + gpio-hog; + gpios = <0x30 0x00>; + output-high; + }; + }; + + ethernet@100000 { + reg = <0xc0 0x40100000 0x00 0x4000>; + compatible = "raspberrypi,rp1-gem", "cdns,macb"; + #address-cells = <0x01>; + #size-cells = <0x00>; + interrupts = <0x06 0x04>; + clocks = <0x02 0x0c 0x02 0x0c 0x02 0x1d 0x02 0x10>; + clock-names = "pclk", "hclk", "tsu_clk", "tx_clk"; + phy-mode = "rgmii-id"; + cdns,aw2w-max-pipe = [08]; + cdns,ar2r-max-pipe = [08]; + cdns,use-aw2b-fill; + local-mac-address = [00 00 00 00 00 00]; + status = "okay"; + phy-handle = <0x3d>; + phy-reset-gpios = <0x2d 0x20 0x01>; + phy-reset-duration = <0x05>; + phandle = <0xe8>; + + ethernet-phy@1 { + reg = <0x01>; + brcm,powerdown-enable; + interrupt-parent = <0x2d>; + interrupts = <0x25 0x08>; + eee-broken-1000t; + eee-broken-100tx; + phandle = <0x3d>; + }; + }; + + csi@110000 { + compatible = "raspberrypi,rp1-cfe"; + reg = <0xc0 0x40110000 0x00 0x100 0xc0 0x40114000 0x00 0x100 0xc0 0x40120000 0x00 0x100 0xc0 0x40124000 0x00 0x1000>; + interrupts = <0x2f 0x04>; + clocks = <0x02 0x16>; + assigned-clocks = <0x02 0x16>; + assigned-clock-rates = <0x17d7840>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + iommus = <0x3e>; + phandle = <0xe9>; + }; + + csi@128000 { + compatible = "raspberrypi,rp1-cfe"; + reg = <0xc0 0x40128000 0x00 0x100 0xc0 0x4012c000 0x00 0x100 0xc0 0x40138000 0x00 0x100 0xc0 0x4013c000 0x00 0x1000>; + interrupts = <0x30 0x04>; + clocks = <0x02 0x17>; + assigned-clocks = <0x02 0x17>; + assigned-clock-rates = <0x17d7840>; + #address-cells = <0x01>; + #size-cells = <0x00>; + status = "disabled"; + iommus = <0x3e>; + phandle = <0xea>; + }; + + pio@178000 { + reg = <0xc0 0x40178000 0x00 0x20>; + compatible = "raspberrypi,rp1-pio"; + firmware = <0x3f>; + dmas = <0x2a 0x38 0x2a 0x39 0x2a 0x3a 0x2a 0x3b 0x2a 0x3c 0x2a 0x3d 0x2a 0x3e 0x2a 0x3f>; + dma-names = "tx0", "rx0", "tx1", "rx1", "tx2", "rx2", "tx3", "rx3"; + status = "okay"; + phandle = <0xeb>; + }; + + mmc@180000 { + reg = <0xc0 0x40180000 0x00 0x100>; + compatible = "raspberrypi,rp1-dwcmshc"; + interrupts = <0x11 0x04>; + clocks = <0x02 0x0c 0x3b 0x02 0x1f 0x40>; + clock-names = "bus", "core", "timeout", "sdio"; + no-1-8-v; + bus-width = <0x04>; + vmmc-supply = <0x3c>; + broken-cd; + status = "disabled"; + phandle = <0xec>; + }; + + mmc@184000 { + reg = <0xc0 0x40184000 0x00 0x100>; + compatible = "raspberrypi,rp1-dwcmshc"; + interrupts = <0x12 0x04>; + clocks = <0x02 0x0c 0x3b 0x02 0x1f 0x41>; + clock-names = "bus", "core", "timeout", "sdio"; + bus-width = <0x04>; + vmmc-supply = <0x3c>; + sdhci-caps-mask = <0x03 0x00>; + broken-cd; + status = "disabled"; + phandle = <0xed>; + }; + + dma@188000 { + reg = <0xc0 0x40188000 0x00 0x1000>; + compatible = "snps,axi-dma-1.01a"; + interrupts = <0x28 0x04>; + clocks = <0x02 0x0e 0x02 0x0c>; + clock-names = "core-clk", "cfgr-clk"; + #dma-cells = <0x01>; + dma-channels = <0x08>; + snps,dma-masters = <0x01>; + snps,dma-targets = <0x40>; + snps,data-width = <0x04>; + snps,block-size = <0x40000 0x40000 0x40000 0x40000 0x40000 0x40000 0x40000 0x40000>; + snps,priority = <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07>; + snps,axi-max-burst-len = <0x04>; + status = "okay"; + phandle = <0x2a>; + }; + + usb@200000 { + reg = <0xc0 0x40200000 0x00 0x100000>; + compatible = "snps,dwc3"; + dr_mode = "host"; + usb3-lpm-capable; + snps,axi-pipe-limit = [08]; + snps,dis_rxdet_inp3_quirk; + snps,enhanced-nak-fs-quirk; + snps,parkmode-disable-ss-quirk; + snps,parkmode-disable-hs-quirk; + snps,parkmode-disable-fsls-quirk; + snps,tx-max-burst = [08]; + snps,tx-thr-num-pkt = [02]; + interrupts = <0x1f 0x01>; + status = "okay"; + pinctrl-0 = <0x42>; + pinctrl-names = "default"; + phandle = <0xee>; + }; + + usb@300000 { + reg = <0xc0 0x40300000 0x00 0x100000>; + compatible = "snps,dwc3"; + dr_mode = "host"; + usb3-lpm-capable; + snps,axi-pipe-limit = [08]; + snps,dis_rxdet_inp3_quirk; + snps,enhanced-nak-fs-quirk; + snps,parkmode-disable-ss-quirk; + snps,parkmode-disable-hs-quirk; + snps,parkmode-disable-fsls-quirk; + snps,tx-max-burst = [08]; + snps,tx-thr-num-pkt = [02]; + interrupts = <0x24 0x01>; + status = "okay"; + phandle = <0xef>; + }; + + dsi@110000 { + compatible = "raspberrypi,rp1dsi"; + status = "disabled"; + reg = <0xc0 0x40118000 0x00 0x1000 0xc0 0x4011c000 0x00 0x1000 0xc0 0x40120000 0x00 0x1000>; + interrupts = <0x2f 0x04>; + clocks = <0x02 0x16 0x02 0x29 0x02 0x2d 0x28 0x02 0x03>; + clock-names = "cfgclk", "dpiclk", "byteclk", "refclk", "pllsys"; + assigned-clocks = <0x02 0x16>; + assigned-clock-rates = <0x17d7840>; + iommus = <0x3e>; + phandle = <0xf0>; + }; + + dsi@128000 { + compatible = "raspberrypi,rp1dsi"; + status = "disabled"; + reg = <0xc0 0x40130000 0x00 0x1000 0xc0 0x40134000 0x00 0x1000 0xc0 0x40138000 0x00 0x1000>; + interrupts = <0x30 0x04>; + clocks = <0x02 0x17 0x02 0x2a 0x02 0x2e 0x28 0x02 0x03>; + clock-names = "cfgclk", "dpiclk", "byteclk", "refclk", "pllsys"; + assigned-clocks = <0x02 0x17>; + assigned-clock-rates = <0x17d7840>; + iommus = <0x3e>; + phandle = <0xf1>; + }; + + vec@144000 { + compatible = "raspberrypi,rp1vec"; + status = "disabled"; + reg = <0xc0 0x40144000 0x00 0x1000 0xc0 0x40140000 0x00 0x1000>; + interrupts = <0x31 0x04>; + clocks = <0x02 0x27>; + assigned-clocks = <0x02 0x02 0x02 0x0b 0x02 0x27>; + assigned-clock-rates = <0x46cf7100 0x66ff300 0x66ff300>; + assigned-clock-parents = <0x00 0x02 0x02 0x02 0x0b>; + iommus = <0x3e>; + phandle = <0xf2>; + }; + + dpi@148000 { + compatible = "raspberrypi,rp1dpi"; + status = "disabled"; + reg = <0xc0 0x40148000 0x00 0x1000 0xc0 0x40140000 0x00 0x1000>; + interrupts = <0x31 0x04>; + clocks = <0x02 0x28 0x02 0x05 0x02 0x02>; + clock-names = "dpiclk", "plldiv", "pllcore"; + assigned-clocks = <0x02 0x28>; + assigned-clock-parents = <0x02 0x05>; + iommus = <0x3e>; + phandle = <0xf3>; + }; + + sram@400000 { + compatible = "mmio-sram"; + reg = <0xc0 0x40400000 0x00 0x10000>; + #address-cells = <0x01>; + #size-cells = <0x01>; + ranges = <0x00 0xc0 0x40400000 0x10000>; + phandle = <0xf4>; + + shmem@ff00 { + compatible = "raspberrypi,rp1-shmem"; + reg = <0xff00 0x100>; + phandle = <0x5c>; + }; + }; + + gpiomem@d0000 { + compatible = "raspberrypi,gpiomem"; + reg = <0xc0 0x400d0000 0x00 0x30000>; + chardev-name = "gpiomem0"; + }; + }; + }; + + msi-controller@1000130000 { + compatible = "brcm,bcm2712-mip"; + reg = <0x10 0x130000 0x00 0xc0 0xff 0xfffff000 0x00 0x1000>; + msi-controller; + msi-ranges = <0x01 0x00 0x80 0x01 0x40>; + brcm,msi-offset = <0x00>; + phandle = <0x26>; + }; + + msi-controller@1000131000 { + compatible = "brcm,bcm2712-mip"; + reg = <0x10 0x131000 0x00 0xc0 0xff 0xfffff000 0x00 0x1000>; + msi-controller; + msi-ranges = <0x01 0x00 0xf7 0x01 0x08>; + brcm,msi-offset = <0x08>; + phandle = <0x25>; + }; + + iommu@5100 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5100 0x00 0x80>; + cache = <0x43>; + #iommu-cells = <0x00>; + phandle = <0x47>; + }; + + iommu@5200 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5200 0x00 0x80>; + cache = <0x43>; + #iommu-cells = <0x00>; + #interconnect-cells = <0x00>; + phandle = <0x4c>; + }; + + iommu@5280 { + compatible = "brcm,bcm2712-iommu"; + reg = <0x10 0x5280 0x00 0x80>; + cache = <0x43>; + #iommu-cells = <0x00>; + dma-iova-offset = <0x10 0x00>; + phandle = <0x3e>; + }; + + iommuc@5b00 { + compatible = "brcm,bcm2712-iommuc"; + reg = <0x10 0x5b00 0x00 0x80>; + phandle = <0x43>; + }; + + dma@10000 { + compatible = "brcm,bcm2712-dma"; + reg = <0x10 0x10000 0x00 0x600>; + interrupts = <0x00 0x50 0x04 0x00 0x51 0x04 0x00 0x52 0x04 0x00 0x53 0x04 0x00 0x54 0x04 0x00 0x55 0x04>; + interrupt-names = "dma0", "dma1", "dma2", "dma3", "dma4", "dma5"; + #dma-cells = <0x01>; + brcm,dma-channel-mask = <0x3f>; + phandle = <0xf5>; + }; + + dma@10600 { + compatible = "brcm,bcm2712-dma"; + reg = <0x10 0x10600 0x00 0x600>; + interrupts = <0x00 0x56 0x04 0x00 0x57 0x04 0x00 0x58 0x04 0x00 0x59 0x04 0x00 0x5a 0x04 0x00 0x5b 0x04>; + interrupt-names = "dma6", "dma7", "dma8", "dma9", "dma10", "dma11"; + #dma-cells = <0x01>; + brcm,dma-channel-mask = <0x7c0>; + phandle = <0x15>; + }; + + syscon@400018 { + compatible = "brcm,syscon-piarbctl", "syscon", "simple-mfd"; + reg = <0x10 0x400018 0x00 0x18>; + phandle = <0xf6>; + }; + + usb@480000 { + compatible = "brcm,bcm2835-usb"; + reg = <0x10 0x480000 0x00 0x10000>; + interrupts = <0x00 0x49 0x04>; + #address-cells = <0x01>; + #size-cells = <0x00>; + clocks = <0x44>; + clock-names = "otg"; + phys = <0x45>; + phy-names = "usb2-phy"; + status = "disabled"; + power-domains = <0x46 0x06>; + phandle = <0xf7>; + }; + + codec@800000 { + compatible = "brcm,bcm2712-hevc-dec", "raspberrypi,hevc-dec"; + reg = <0x10 0x800000 0x00 0x10000 0x10 0x840000 0x00 0x1000>; + reg-names = "hevc", "intc"; + interrupts = <0x00 0x62 0x04>; + clocks = <0x16 0x0b>; + clock-names = "hevc"; + iommus = <0x47>; + phandle = <0xf8>; + }; + + pisp_be@880000 { + compatible = "raspberrypi,pispbe"; + reg = <0x10 0x880000 0x00 0x4000>; + interrupts = <0x00 0x48 0x04>; + clocks = <0x16 0x07>; + clocks-names = "isp_be"; + status = "okay"; + iommus = <0x47>; + phandle = <0xf9>; + }; + + mmc@1100000 { + compatible = "brcm,bcm2712-sdhci"; + reg = <0x10 0x1100000 0x00 0x260 0x10 0x1100400 0x00 0x200>; + reg-names = "host", "cfg"; + interrupts = <0x00 0x112 0x04>; + clocks = <0x08>; + sdhci-caps-mask = <0xc000 0x00>; + sdhci-caps = <0x00 0x00>; + supports-cqe = <0x01>; + mmc-ddr-3_3v; + status = "okay"; + pinctrl-0 = <0x48 0x49>; + pinctrl-names = "default"; + bus-width = <0x04>; + vmmc-supply = <0x4a>; + sd-uhs-ddr50; + non-removable; + #address-cells = <0x01>; + #size-cells = <0x00>; + phandle = <0xfa>; + + wifi@1 { + reg = <0x01>; + compatible = "brcm,bcm4329-fmac"; + local-mac-address = [00 00 00 00 00 00]; + phandle = <0x70>; + }; + }; + + v3d@2000000 { + compatible = "brcm,2712-v3d"; + reg = <0x10 0x2000000 0x00 0x4000 0x10 0x2008000 0x00 0x6000 0x10 0x2030800 0x00 0x700>; + reg-names = "hub", "core0", "sms"; + power-domains = <0x4b 0x01>; + resets = <0x4b 0x00>; + clocks = <0x16 0x05>; + clocks-names = "v3d"; + interrupts = <0x00 0xfa 0x04 0x00 0xf9 0x04>; + status = "disabled"; + phandle = <0xfb>; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <0x01 0x0d 0xf08 0x01 0x0e 0xf08 0x01 0x0b 0xf08 0x01 0x0a 0xf08 0x01 0x0c 0xf08>; + }; + + clk-27M { + #clock-cells = <0x00>; + compatible = "fixed-clock"; + clock-frequency = <0x19bfcc0>; + clock-output-names = "27MHz-clock"; + phandle = <0x17>; + }; + + clk-108M { + #clock-cells = <0x00>; + compatible = "fixed-clock"; + clock-frequency = <0x66ff300>; + clock-output-names = "108MHz-clock"; + phandle = <0x10>; + }; + + hvs@107c580000 { + compatible = "brcm,bcm2712-hvs"; + reg = <0x10 0x7c580000 0x1a000>; + interrupt-parent = <0x0f>; + interrupts = <0x02 0x09 0x10>; + interrupt-names = "ch0-eof", "ch1-eof", "ch2-eof"; + iommus = <0x4c>; + status = "disabled"; + clocks = <0x16 0x04 0x16 0x10>; + clock-names = "core", "disp"; + phandle = <0xfc>; + }; + + arm-pmu { + compatible = "arm,cortex-a76-pmu"; + interrupts = <0x00 0x10 0x04 0x00 0x11 0x04 0x00 0x12 0x04 0x00 0x13 0x04>; + interrupt-affinity = <0x4d 0x4e 0x4f 0x50>; + }; + + thermal-zones { + + cpu-thermal { + polling-delay-passive = <0x3e8>; + polling-delay = <0x3e8>; + coefficients = <0xfffffdda 0x6ddd0>; + thermal-sensors = <0x51>; + phandle = <0xfd>; + + trips { + phandle = <0xfe>; + + cpu-crit { + temperature = <0x1adb0>; + hysteresis = <0x00>; + type = "critical"; + phandle = <0x57>; + }; + + cpu-tepid { + temperature = <0xc350>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x52>; + }; + + cpu-warm { + temperature = <0xea60>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x54>; + }; + + cpu-hot { + temperature = <0x107ac>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x55>; + }; + + cpu-vhot { + temperature = <0x124f8>; + hysteresis = <0x1388>; + type = "active"; + phandle = <0x56>; + }; + }; + + cooling-maps { + phandle = <0xff>; + + tepid { + trip = <0x52>; + cooling-device = <0x53 0x01 0x01>; + }; + + warm { + trip = <0x54>; + cooling-device = <0x53 0x02 0x02>; + }; + + hot { + trip = <0x55>; + cooling-device = <0x53 0x03 0x03>; + }; + + vhot { + trip = <0x56>; + cooling-device = <0x53 0x04 0x04>; + }; + + melt { + trip = <0x57>; + cooling-device = <0x53 0x04 0x04>; + }; + }; + }; + }; + + firmwarekms { + compatible = "raspberrypi,rpi-firmware-kms-2712"; + interrupt-parent = <0x58>; + interrupts = <0x13>; + brcm,firmware = <0x19>; + status = "disabled"; + phandle = <0x100>; + }; + + phy { + compatible = "usb-nop-xceiv"; + #phy-cells = <0x00>; + phandle = <0x45>; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00 0x00 0x28000000>; + }; + + leds { + compatible = "gpio-leds"; + phandle = <0x101>; + + led-pwr { + label = "PWR"; + gpios = <0x2d 0x2c 0x01>; + default-state = "off"; + linux,default-trigger = "none"; + phandle = <0x6a>; + }; + + led-act { + label = "ACT"; + gpios = <0x59 0x09 0x01>; + default-state = "off"; + linux,default-trigger = "mmc0"; + phandle = <0x5d>; + }; + }; + + sd-io-1v8-reg { + compatible = "regulator-gpio"; + regulator-name = "vdd-sd-io"; + regulator-min-microvolt = <0x1b7740>; + regulator-max-microvolt = <0x325aa0>; + regulator-always-on; + regulator-settling-time-us = <0x1388>; + gpios = <0x59 0x03 0x00>; + states = <0x1b7740 0x01 0x325aa0 0x00>; + phandle = <0x0b>; + }; + + sd-vcc-reg { + compatible = "regulator-fixed"; + regulator-name = "vcc-sd"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + regulator-boot-on; + enable-active-high; + gpios = <0x59 0x04 0x00>; + phandle = <0x0c>; + }; + + wl-on-reg { + compatible = "regulator-fixed"; + regulator-name = "wl-on-regulator"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + pinctrl-0 = <0x5a>; + pinctrl-names = "default"; + gpio = <0x1a 0x1c 0x00>; + startup-delay-us = <0x249f0>; + enable-active-high; + phandle = <0x4a>; + }; + + cam1_clk { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x102>; + }; + + cam0_clk { + compatible = "fixed-clock"; + #clock-cells = <0x00>; + status = "disabled"; + phandle = <0x103>; + }; + + cam0_reg { + compatible = "regulator-fixed"; + regulator-name = "cam0_reg"; + enable-active-high; + gpio = <0x2d 0x22 0x00>; + phandle = <0x71>; + }; + + cam_dummy_reg { + compatible = "regulator-fixed"; + regulator-name = "cam-dummy-reg"; + phandle = <0x104>; + }; + + dummy { + phandle = <0x105>; + }; + + i2c0if { + phandle = <0x106>; + }; + + i2c0mux { + phandle = <0x107>; + }; + + rp1_firmware { + compatible = "raspberrypi,rp1-firmware", "simple-mfd"; + mboxes = <0x5b 0x00>; + shmem = <0x5c>; + phandle = <0x3f>; + }; + + rp1_vdd_3v3 { + compatible = "regulator-fixed"; + regulator-name = "vdd-3v3"; + regulator-min-microvolt = <0x325aa0>; + regulator-max-microvolt = <0x325aa0>; + regulator-always-on; + phandle = <0x3c>; + }; + + chosen { + bootargs = "reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0"; + stdout-path = "serial10:115200n8"; + phandle = <0x6e>; + }; + + aliases { + blconfig = "/reserved-memory/nvram@0"; + blpubkey = "/reserved-memory/nvram@1"; + bluetooth = "/soc@107c000000/serial@7d50c000/bluetooth"; + console = "/soc@107c000000/serial@7d001000"; + drm-dsi1 = "/axi/pcie@1000120000/rp1/dsi@110000"; + drm-dsi2 = "/axi/pcie@1000120000/rp1/dsi@128000"; + ethernet0 = "/axi/pcie@1000120000/rp1/ethernet@100000"; + fb = "/soc@107c000000/fb"; + gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000"; + gpio1 = "/soc@107c000000/gpio@7d508500"; + gpio2 = "/soc@107c000000/gpio@7d517c00"; + gpio3 = "/soc@107c000000/pinctrl@7d504100"; + gpio4 = "/soc@107c000000/pinctrl@7d510700"; + gpiochip0 = "/axi/pcie@1000120000/rp1/gpio@d0000"; + gpiochip10 = "/soc@107c000000/gpio@7d508500"; + i2c = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + i2c10 = "/axi/pcie@1000120000/rp1/i2c@88000"; + i2c11 = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c12 = "/soc@107c000000/i2c@7d005600"; + mailbox = "/soc@107c000000/mailbox@7c013880"; + mmc0 = "/soc@107c000000/mmc@fff000"; + pio0 = "/axi/pcie@1000120000/rp1/pio@178000"; + serial0 = "/axi/pcie@1000120000/rp1/serial@30000"; + serial1 = "/axi/pcie@1000120000/rp1/serial@34000"; + serial10 = "/soc@107c000000/serial@7d001000"; + serial2 = "/axi/pcie@1000120000/rp1/serial@38000"; + serial3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + serial4 = "/axi/pcie@1000120000/rp1/serial@40000"; + spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + spi10 = "/soc@107c000000/spi@7d004000"; + spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + uart10 = "/soc@107c000000/serial@7d001000"; + uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + usb0 = "/axi/pcie@1000120000/rp1/usb@200000"; + usb1 = "/axi/pcie@1000120000/rp1/usb@300000"; + wifi0 = "/axi/mmc@1100000/wifi@1"; + phandle = <0x62>; + }; + + __overrides__ { + act_led_gpio = [00 00 00 5d 67 70 69 6f 73 3a 34 00 00 00 00 5d 67 70 69 6f 73 3a 30 3d 00 00 00 00 2d]; + act_led_activelow = "", "", "", "]gpios:8"; + act_led_trigger = "", "", "", "]linux,default-trigger"; + axiperf = "", "", "", "^status"; + bdaddr = "", "", "", "_local-bd-address["; + button_debounce = "", "", "", "`debounce-interval:0"; + cooling_fan = "", "", "", "Sstatus", "", "", "", "astatus"; + drm_fb0_rp1_dpi = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb0_rp1_dsi0 = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb0_rp1_dsi1 = "", "", "", "bdrm-fb0=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb0_vc4 = "", "", "", "bdrm-fb0=", "/axi/gpu"; + drm_fb1_rp1_dpi = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb1_rp1_dsi0 = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb1_rp1_dsi1 = "", "", "", "bdrm-fb1=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb1_vc4 = "", "", "", "bdrm-fb1=", "/axi/gpu"; + drm_fb2_rp1_dpi = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dpi@148000"; + drm_fb2_rp1_dsi0 = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dsi@110000"; + drm_fb2_rp1_dsi1 = "", "", "", "bdrm-fb2=", "/axi/pcie@1000120000/rp1/dsi@128000"; + drm_fb2_vc4 = "", "", "", "bdrm-fb2=", "/axi/gpu"; + eth_led0 = "", "", "", "=led-modes:0"; + eth_led1 = "", "", "", "=led-modes:4"; + fan_temp0 = "", "", "", "Rtemperature:0"; + fan_temp0_hyst = "", "", "", "Rhysteresis:0"; + fan_temp0_speed = "", "", "", "Scooling-levels:4"; + fan_temp1 = "", "", "", "Ttemperature:0"; + fan_temp1_hyst = "", "", "", "Thysteresis:0"; + fan_temp1_speed = "", "", "", "Scooling-levels:8"; + fan_temp2 = "", "", "", "Utemperature:0"; + fan_temp2_hyst = "", "", "", "Uhysteresis:0"; + fan_temp2_speed = "", "", "", "Scooling-levels:12"; + fan_temp3 = "", "", "", "Vtemperature:0"; + fan_temp3_hyst = "", "", "", "Vhysteresis:0"; + fan_temp3_speed = "", "", "", "Scooling-levels:16"; + i2c = "", "", "", "cstatus"; + i2c_arm = "", "", "", "cstatus"; + i2c_arm_baudrate = "", "", "", "cclock-frequency:0"; + i2c_baudrate = "", "", "", "cclock-frequency:0"; + i2c_csi_dsi = "", "", "", "dstatus"; + i2c_csi_dsi0 = "", "", "", "estatus"; + i2c_csi_dsi1 = "", "", "", "dstatus"; + i2c_vc = "", "", "", "dstatus"; + i2c_vc_baudrate = "", "", "", "dclock-frequency:0"; + i2c0 = "", "", "", "dstatus"; + i2c0_baudrate = "", "", "", "dclock-frequency:0"; + i2c1 = "", "", "", "cstatus"; + i2c1_baudrate = "", "", "", "cclock-frequency:0"; + krnbt = "", "", "", "_status"; + nvme = "", "", "", "fstatus"; + nvmem_cust_rw = "", "", "", "grw?"; + nvmem_mac_rw = "", "", "", "hrw?"; + nvmem_priv_rw = "", "", "", "irw?"; + pcie_tperst_clk_ms = "", "", "", "fbrcm,tperst-clk-ms:0"; + pciex1 = "", "", "", "fstatus"; + pciex1_gen = "", "", "", "fmax-link-speed:0"; + pciex1_no_l0s = "", "", "", "faspm-no-l0s?"; + pciex1_tperst_clk_ms = "", "", "", "fbrcm,tperst-clk-ms:0"; + pwr_led_gpio = "", "", "", "jgpios:4"; + pwr_led_activelow = "", "", "", "jgpios:8"; + pwr_led_trigger = "", "", "", "jlinux,default-trigger"; + random = "", "", "", "kstatus"; + rtc = "", "", "", "lstatus"; + rtc_bbat_vchg = "", "", "", "ltrickle-charge-microvolt:0"; + spi = "", "", "", "mstatus"; + strict_gpiod = "", "", "", "nbootargs=pinctrl_rp1.persist_gpio_outputs=n"; + suspend = "", "", "", "`linux,code:0=205"; + uart0 = "", "", "", "ostatus"; + uart0_console = "", "", "", "ostatus", "", "", "", "bconsole=", "/axi/pcie@1000120000/rp1/serial@30000"; + uart0_dma = [00 00 00 6f 64 6d 61 73 3a 30 3d 00 00 00 00 2a 00 00 00 6f 64 6d 61 73 3a 34 3d 00 00 00 00 1a 00 00 00 6f 64 6d 61 73 3a 38 3d 00 00 00 00 2a 00 00 00 6f 64 6d 61 73 3a 31 32 3d 00 00 00 00 19 00 00 00 6f 64 6d 61 2d 6e 61 6d 65 73 5b 3d 37 34 37 38 30 30 37 32 37 38 30 30 00]; + wifiaddr = "", "", "", "plocal-mac-address["; + cam0_reg = "", "", "", "qstatus"; + cam0_reg_gpio = [00 00 00 71 67 70 69 6f 3a 34 00 00 00 00 71 67 70 69 6f 3a 30 3d 00 00 00 00 2d]; + cam1_reg = "", "", "", "qstatus"; + cam1_reg_gpio = [00 00 00 71 67 70 69 6f 3a 34 00 00 00 00 71 67 70 69 6f 3a 30 3d 00 00 00 00 2d]; + ant1 = "", "", "", "routput-high?=on", "", "", "", "routput-low?=off", "", "", "", "soutput-high?=off", "", "", "", "soutput-low?=on"; + ant2 = "", "", "", "routput-high?=off", "", "", "", "routput-low?=on", "", "", "", "soutput-high?=on", "", "", "", "soutput-low?=off"; + noant = "", "", "", "routput-high?=off", "", "", "", "routput-low?=on", "", "", "", "soutput-high?=off", "", "", "", "soutput-low?=on"; + noanthogs = "", "", "", "rstatus=disabled", "", "", "", "sstatus=disabled"; + sd = "", "", "", "tstatus"; + sd_poll_once = "", "", "", "tnon-removable?"; + sd_cqe = "", "", "", "tsupports-cqe:0"; + }; + + cooling_fan { + status = "disabled"; + compatible = "pwm-fan"; + #cooling-cells = <0x02>; + cooling-min-state = <0x00>; + cooling-max-state = <0x03>; + cooling-levels = <0x00 0x4b 0x7d 0xaf 0xfa>; + pwms = <0x61 0x03 0xa25e 0x01>; + rpm-regmap = <0x61>; + rpm-offset = <0x3c>; + phandle = <0x53>; + }; + + pwr_button { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <0x75>; + status = "okay"; + + pwr { + label = "pwr_button"; + linux,code = <0x74>; + gpios = <0x1a 0x14 0x01>; + debounce-interval = <0x32>; + phandle = <0x60>; + }; + }; + + __symbols__ { + clocks = "/clocks"; + clk_osc = "/clocks/clk-osc"; + clk_vpu = "/clocks/clk-vpu"; + clk_uart = "/clocks/clk-uart"; + clk_emmc2 = "/clocks/clk-emmc2"; + clk_usb = "/clocks/clk-usb"; + clk_xosc = "/clocks/clk_xosc"; + sdio_src = "/clocks/sdio_src"; + sdhci_core = "/clocks/sdhci_core"; + clksrc_gp0 = "/clocks/clksrc_gp0"; + clksrc_gp1 = "/clocks/clksrc_gp1"; + clksrc_gp2 = "/clocks/clksrc_gp2"; + clksrc_gp3 = "/clocks/clksrc_gp3"; + clksrc_gp4 = "/clocks/clksrc_gp4"; + clksrc_gp5 = "/clocks/clksrc_gp5"; + cpus = "/cpus"; + cpu0 = "/cpus/cpu@0"; + l2_cache_l0 = "/cpus/cpu@0/l2-cache-l0"; + cpu1 = "/cpus/cpu@1"; + l2_cache_l1 = "/cpus/cpu@1/l2-cache-l1"; + cpu2 = "/cpus/cpu@2"; + l2_cache_l2 = "/cpus/cpu@2/l2-cache-l2"; + cpu3 = "/cpus/cpu@3"; + l2_cache_l3 = "/cpus/cpu@3/l2-cache-l3"; + l3_cache = "/cpus/l3-cache"; + rmem = "/reserved-memory"; + cma = "/reserved-memory/linux,cma"; + blconfig = "/reserved-memory/nvram@0"; + blpubkey = "/reserved-memory/nvram@1"; + soc = "/soc@107c000000"; + pcie_rescal = "/soc@107c000000/reset-controller@119500"; + sdio1 = "/soc@107c000000/mmc@fff000"; + bcm_reset = "/soc@107c000000/reset-controller@1504318"; + system_timer = "/soc@107c000000/timer@7c003000"; + mailbox = "/soc@107c000000/mailbox@7c013880"; + local_intc = "/soc@107c000000/interrupt-controller@7cd00000"; + uart10 = "/soc@107c000000/serial@7d001000"; + gio_aon = "/soc@107c000000/gpio@7d517c00"; + ant1 = "/soc@107c000000/gpio@7d517c00/ant1-hog"; + ant2 = "/soc@107c000000/gpio@7d517c00/ant2-hog"; + gicv2 = "/soc@107c000000/interrupt-controller@7fff9000"; + aon_intr = "/soc@107c000000/interrupt-controller@7d510600"; + pixelvalve0 = "/soc@107c000000/pixelvalve@7c410000"; + pixelvalve1 = "/soc@107c000000/pixelvalve@7c411000"; + mop = "/soc@107c000000/mop@7c500000"; + moplet = "/soc@107c000000/moplet@7c501000"; + disp_intr = "/soc@107c000000/interrupt-controller@7c502000"; + dvp = "/soc@107c000000/clock@7c700000"; + ddc0 = "/soc@107c000000/i2c@7d508200"; + ddc1 = "/soc@107c000000/i2c@7d508280"; + bsc_irq = "/soc@107c000000/intc@7d508380"; + main_irq = "/soc@107c000000/intc@7d508400"; + hdmi0 = "/soc@107c000000/hdmi@7ef00700"; + hdmi1 = "/soc@107c000000/hdmi@7ef05700"; + axiperf = "/soc@107c000000/axiperf@7c012800"; + spi10 = "/soc@107c000000/spi@7d004000"; + spidev10 = "/soc@107c000000/spi@7d004000/spidev@0"; + i2c10 = "/soc@107c000000/i2c@7d005600"; + pm = "/soc@107c000000/watchdog@7d200000"; + random = "/soc@107c000000/rng@7d208000"; + cpu_l2_irq = "/soc@107c000000/intc@7d503000"; + pinctrl = "/soc@107c000000/pinctrl@7d504100"; + uarta_24_pins = "/soc@107c000000/pinctrl@7d504100/uarta_24_pins"; + sdio2_30_pins = "/soc@107c000000/pinctrl@7d504100/sdio2_30_pins"; + pwr_button_pins = "/soc@107c000000/pinctrl@7d504100/pwr_button_pins"; + wl_on_pins = "/soc@107c000000/pinctrl@7d504100/wl_on_pins"; + bt_shutdown_pins = "/soc@107c000000/pinctrl@7d504100/bt_shutdown_pins"; + emmc_ds_pull = "/soc@107c000000/pinctrl@7d504100/emmc_ds_pull"; + emmc_cmddat_pulls = "/soc@107c000000/pinctrl@7d504100/emmc_cmddat_pulls"; + spi10_pins = "/soc@107c000000/pinctrl@7d504100/spi10_gpio2"; + spi10_gpio2 = "/soc@107c000000/pinctrl@7d504100/spi10_gpio2"; + spi10_cs_pins = "/soc@107c000000/pinctrl@7d504100/spi10_cs_gpio1"; + spi10_cs_gpio1 = "/soc@107c000000/pinctrl@7d504100/spi10_cs_gpio1"; + gio = "/soc@107c000000/gpio@7d508500"; + uarta = "/soc@107c000000/serial@7d50c000"; + bluetooth = "/soc@107c000000/serial@7d50c000/bluetooth"; + pinctrl_aon = "/soc@107c000000/pinctrl@7d510700"; + i2c3_m4_agpio0_pins = "/soc@107c000000/pinctrl@7d510700/i2c3_m4_agpio0_pins"; + bsc_m1_agpio13_pins = "/soc@107c000000/pinctrl@7d510700/bsc_m1_agpio13_pins"; + bsc_pmu_sgpio4_pins = "/soc@107c000000/pinctrl@7d510700/bsc_pmu_sgpio4_pins"; + bsc_m2_sgpio4_pins = "/soc@107c000000/pinctrl@7d510700/bsc_m2_sgpio4_pins"; + pwm_aon_agpio1_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio1_pins"; + pwm_aon_agpio4_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio4_pins"; + pwm_aon_agpio7_pins = "/soc@107c000000/pinctrl@7d510700/pwm_aon_agpio7_pins"; + ant_pins = "/soc@107c000000/pinctrl@7d510700/ant_pins"; + aon_pwm_1pin = "/soc@107c000000/pinctrl@7d510700/aon_pwm_1pin"; + main_aon_irq = "/soc@107c000000/intc@7d517ac0"; + avs_monitor = "/soc@107c000000/avs-monitor@7d542000"; + thermal = "/soc@107c000000/avs-monitor@7d542000/thermal"; + firmware = "/soc@107c000000/firmware"; + firmware_clocks = "/soc@107c000000/firmware/clocks"; + reset = "/soc@107c000000/firmware/reset"; + vcio = "/soc@107c000000/firmware/vcio"; + power = "/soc@107c000000/power"; + fb = "/soc@107c000000/fb"; + rpi_rtc = "/soc@107c000000/rpi_rtc"; + nvmem_otp = "/soc@107c000000/nvmem/nvmem_otp"; + nvmem_cust = "/soc@107c000000/nvmem/nvmem_cust"; + nvmem_mac = "/soc@107c000000/nvmem/nvmem_mac"; + nvmem_priv = "/soc@107c000000/nvmem/nvmem_priv"; + vdd_3v3_reg = "/soc@107c000000/fixedregulator_3v3"; + vdd_5v0_reg = "/soc@107c000000/fixedregulator_5v0"; + sound = "/soc@107c000000/sound"; + axi = "/axi"; + vc4 = "/axi/gpu"; + pcie0 = "/axi/pcie@1000100000"; + pciex1 = "/axi/pcie@1000110000"; + pcie1 = "/axi/pcie@1000110000"; + pciex4 = "/axi/pcie@1000120000"; + rp1_target = "/axi/pcie@1000120000"; + pcie2 = "/axi/pcie@1000120000"; + rp1 = "/axi/pcie@1000120000/rp1"; + rp1_mbox = "/axi/pcie@1000120000/rp1/mailbox@8000"; + rp1_clocks = "/axi/pcie@1000120000/rp1/clocks@18000"; + uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + rp1_uart0 = "/axi/pcie@1000120000/rp1/serial@30000"; + uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + rp1_uart1 = "/axi/pcie@1000120000/rp1/serial@34000"; + uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + rp1_uart2 = "/axi/pcie@1000120000/rp1/serial@38000"; + uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + rp1_uart3 = "/axi/pcie@1000120000/rp1/serial@3c000"; + uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + rp1_uart4 = "/axi/pcie@1000120000/rp1/serial@40000"; + rp1_uart5 = "/axi/pcie@1000120000/rp1/serial@44000"; + rp1_spi8 = "/axi/pcie@1000120000/rp1/spi@4c000"; + spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + rp1_spi0 = "/axi/pcie@1000120000/rp1/spi@50000"; + spidev0 = "/axi/pcie@1000120000/rp1/spi@50000/spidev@0"; + spidev1 = "/axi/pcie@1000120000/rp1/spi@50000/spidev@1"; + spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + rp1_spi1 = "/axi/pcie@1000120000/rp1/spi@54000"; + spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + rp1_spi2 = "/axi/pcie@1000120000/rp1/spi@58000"; + spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + rp1_spi3 = "/axi/pcie@1000120000/rp1/spi@5c000"; + spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + rp1_spi4 = "/axi/pcie@1000120000/rp1/spi@60000"; + spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + rp1_spi5 = "/axi/pcie@1000120000/rp1/spi@64000"; + rp1_spi6 = "/axi/pcie@1000120000/rp1/spi@68000"; + rp1_spi7 = "/axi/pcie@1000120000/rp1/spi@6c000"; + i2c_csi_dsi = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c_csi_dsi1 = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c_vc = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + rp1_i2c0 = "/axi/pcie@1000120000/rp1/i2c@70000"; + i2c_arm = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + rp1_i2c1 = "/axi/pcie@1000120000/rp1/i2c@74000"; + i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + rp1_i2c2 = "/axi/pcie@1000120000/rp1/i2c@78000"; + i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + rp1_i2c3 = "/axi/pcie@1000120000/rp1/i2c@7c000"; + i2c4 = "/axi/pcie@1000120000/rp1/i2c@80000"; + rp1_i2c4 = "/axi/pcie@1000120000/rp1/i2c@80000"; + i2c5 = "/axi/pcie@1000120000/rp1/i2c@84000"; + rp1_i2c5 = "/axi/pcie@1000120000/rp1/i2c@84000"; + i2c_csi_dsi0 = "/axi/pcie@1000120000/rp1/i2c@88000"; + i2c6 = "/axi/pcie@1000120000/rp1/i2c@88000"; + rp1_i2c6 = "/axi/pcie@1000120000/rp1/i2c@88000"; + rp1_audio_out = "/axi/pcie@1000120000/rp1/audio_out@94000"; + pwm = "/axi/pcie@1000120000/rp1/pwm@98000"; + pwm0 = "/axi/pcie@1000120000/rp1/pwm@98000"; + rp1_pwm0 = "/axi/pcie@1000120000/rp1/pwm@98000"; + pwm1 = "/axi/pcie@1000120000/rp1/pwm@9c000"; + rp1_pwm1 = "/axi/pcie@1000120000/rp1/pwm@9c000"; + i2s_clk_producer = "/axi/pcie@1000120000/rp1/i2s@a0000"; + i2s = "/axi/pcie@1000120000/rp1/i2s@a0000"; + rp1_i2s0 = "/axi/pcie@1000120000/rp1/i2s@a0000"; + i2s_clk_consumer = "/axi/pcie@1000120000/rp1/i2s@a4000"; + rp1_i2s1 = "/axi/pcie@1000120000/rp1/i2s@a4000"; + rp1_i2s2 = "/axi/pcie@1000120000/rp1/i2s@a8000"; + rp1_sdio_clk0 = "/axi/pcie@1000120000/rp1/sdio_clk0@b0004"; + rp1_sdio_clk1 = "/axi/pcie@1000120000/rp1/sdio_clk1@b4004"; + rp1_adc = "/axi/pcie@1000120000/rp1/adc@c8000"; + gpio = "/axi/pcie@1000120000/rp1/gpio@d0000"; + rp1_gpio = "/axi/pcie@1000120000/rp1/gpio@d0000"; + uart0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_14_15"; + rp1_uart0_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_14_15"; + uart0_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_ctsrts_16_17"; + rp1_uart0_ctsrts_16_17 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart0_ctsrts_16_17"; + uart1_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_0_1"; + rp1_uart1_0_1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_0_1"; + uart1_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_ctsrts_2_3"; + rp1_uart1_ctsrts_2_3 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart1_ctsrts_2_3"; + uart2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_4_5"; + rp1_uart2_4_5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_4_5"; + uart2_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_ctsrts_6_7"; + rp1_uart2_ctsrts_6_7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart2_ctsrts_6_7"; + uart3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_8_9"; + rp1_uart3_8_9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_8_9"; + uart3_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_ctsrts_10_11"; + rp1_uart3_ctsrts_10_11 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart3_ctsrts_10_11"; + uart4_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_12_13"; + rp1_uart4_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_12_13"; + uart4_ctsrts_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_ctsrts_14_15"; + rp1_uart4_ctsrts_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_uart4_ctsrts_14_15"; + rp1_sdio0_22_27 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_sdio0_22_27"; + rp1_sdio1_28_33 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_sdio1_28_33"; + rp1_i2s0_18_21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2s0_18_21"; + rp1_i2s1_18_21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2s1_18_21"; + rp1_i2c4_34_35 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c4_34_35"; + rp1_i2c6_38_39 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c6_38_39"; + rp1_i2c4_40_41 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c4_40_41"; + rp1_i2c5_44_45 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c5_44_45"; + i2c0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_0_1"; + rp1_i2c0_0_1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_0_1"; + rp1_i2c0_8_9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c0_8_9"; + i2c1_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_2_3"; + rp1_i2c1_2_3 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_2_3"; + rp1_i2c1_10_11 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c1_10_11"; + i2c2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_4_5"; + rp1_i2c2_4_5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_4_5"; + rp1_i2c2_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c2_12_13"; + i2c3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_6_7"; + rp1_i2c3_6_7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_6_7"; + rp1_i2c3_14_15 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_14_15"; + rp1_i2c3_22_23 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_i2c3_22_23"; + dpi_16bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio2"; + rp1_dpi_16bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio2"; + dpi_16bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio2"; + rp1_dpi_16bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio2"; + rp1_dpi_16bit_pad666_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_pad666_gpio2"; + dpi_18bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio2"; + rp1_dpi_18bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio2"; + dpi_18bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio2"; + rp1_dpi_18bit_cpadhi_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio2"; + dpi_gpio1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio2"; + rp1_dpi_24bit_gpio2 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio2"; + rp1_dpi_hvsync = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_hvsync"; + dpi_16bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio0"; + rp1_dpi_16bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_gpio0"; + dpi_16bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio0"; + rp1_dpi_16bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_cpadhi_gpio0"; + rp1_dpi_16bit_pad666_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_16bit_pad666_gpio0"; + dpi_18bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio0"; + rp1_dpi_18bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_gpio0"; + dpi_18bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio0"; + rp1_dpi_18bit_cpadhi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_18bit_cpadhi_gpio0"; + dpi_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio0"; + rp1_dpi_24bit_gpio0 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_dpi_24bit_gpio0"; + rp1_gpclksrc0_gpio4 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc0_gpio4"; + rp1_gpclksrc0_gpio20 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc0_gpio20"; + rp1_gpclksrc1_gpio5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio5"; + rp1_gpclksrc1_gpio18 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio18"; + rp1_gpclksrc1_gpio21 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_gpclksrc1_gpio21"; + rp1_pwm1_gpio45 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_pwm1_gpio45"; + spi0_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_gpio9"; + rp1_spi0_gpio9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_gpio9"; + spi0_cs_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_cs_gpio7"; + rp1_spi0_cs_gpio7 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi0_cs_gpio7"; + rp1_spi1_gpio19 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi1_gpio19"; + spi2_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi2_gpio1"; + rp1_spi2_gpio1 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi2_gpio1"; + spi3_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi3_gpio5"; + rp1_spi3_gpio5 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi3_gpio5"; + spi4_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi4_gpio9"; + rp1_spi4_gpio9 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi4_gpio9"; + spi5_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi5_gpio13"; + rp1_spi5_gpio13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi5_gpio13"; + rp1_spi8_gpio49 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi8_gpio49"; + rp1_spi8_cs_gpio52 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_spi8_cs_gpio52"; + rp1_audio_out_12_13 = "/axi/pcie@1000120000/rp1/gpio@d0000/rp1_audio_out_12_13"; + usb_vbus_pins = "/axi/pcie@1000120000/rp1/gpio@d0000/usb_vbus_pins"; + rp1_eth = "/axi/pcie@1000120000/rp1/ethernet@100000"; + phy1 = "/axi/pcie@1000120000/rp1/ethernet@100000/ethernet-phy@1"; + csi0 = "/axi/pcie@1000120000/rp1/csi@110000"; + rp1_csi0 = "/axi/pcie@1000120000/rp1/csi@110000"; + csi1 = "/axi/pcie@1000120000/rp1/csi@128000"; + rp1_csi1 = "/axi/pcie@1000120000/rp1/csi@128000"; + pio = "/axi/pcie@1000120000/rp1/pio@178000"; + rp1_pio = "/axi/pcie@1000120000/rp1/pio@178000"; + rp1_mmc0 = "/axi/pcie@1000120000/rp1/mmc@180000"; + rp1_mmc1 = "/axi/pcie@1000120000/rp1/mmc@184000"; + rp1_dma = "/axi/pcie@1000120000/rp1/dma@188000"; + rp1_usb0 = "/axi/pcie@1000120000/rp1/usb@200000"; + rp1_usb1 = "/axi/pcie@1000120000/rp1/usb@300000"; + dsi0 = "/axi/pcie@1000120000/rp1/dsi@110000"; + rp1_dsi0 = "/axi/pcie@1000120000/rp1/dsi@110000"; + dsi1 = "/axi/pcie@1000120000/rp1/dsi@128000"; + rp1_dsi1 = "/axi/pcie@1000120000/rp1/dsi@128000"; + vec = "/axi/pcie@1000120000/rp1/vec@144000"; + rp1_vec = "/axi/pcie@1000120000/rp1/vec@144000"; + dpi = "/axi/pcie@1000120000/rp1/dpi@148000"; + rp1_dpi = "/axi/pcie@1000120000/rp1/dpi@148000"; + sram = "/axi/pcie@1000120000/rp1/sram@400000"; + rp1_fw_shmem = "/axi/pcie@1000120000/rp1/sram@400000/shmem@ff00"; + mip0 = "/axi/msi-controller@1000130000"; + mip1 = "/axi/msi-controller@1000131000"; + iommu2 = "/axi/iommu@5100"; + iommu4 = "/axi/iommu@5200"; + iommu5 = "/axi/iommu@5280"; + iommuc = "/axi/iommuc@5b00"; + dma32 = "/axi/dma@10000"; + dma40 = "/axi/dma@10600"; + syscon_piarbctl = "/axi/syscon@400018"; + usb = "/axi/usb@480000"; + hevc_dec = "/axi/codec@800000"; + pisp_be = "/axi/pisp_be@880000"; + sdio2 = "/axi/mmc@1100000"; + wifi = "/axi/mmc@1100000/wifi@1"; + v3d = "/axi/v3d@2000000"; + clk_27MHz = "/clk-27M"; + clk_108MHz = "/clk-108M"; + hvs = "/hvs@107c580000"; + cpu_thermal = "/thermal-zones/cpu-thermal"; + thermal_trips = "/thermal-zones/cpu-thermal/trips"; + cpu_crit = "/thermal-zones/cpu-thermal/trips/cpu-crit"; + cpu_tepid = "/thermal-zones/cpu-thermal/trips/cpu-tepid"; + cpu_warm = "/thermal-zones/cpu-thermal/trips/cpu-warm"; + cpu_hot = "/thermal-zones/cpu-thermal/trips/cpu-hot"; + cpu_vhot = "/thermal-zones/cpu-thermal/trips/cpu-vhot"; + cooling_maps = "/thermal-zones/cpu-thermal/cooling-maps"; + firmwarekms = "/firmwarekms"; + usbphy = "/phy"; + leds = "/leds"; + led_pwr = "/leds/led-pwr"; + led_act = "/leds/led-act"; + sd_io_1v8_reg = "/sd-io-1v8-reg"; + sd_vcc_reg = "/sd-vcc-reg"; + wl_on_reg = "/wl-on-reg"; + cam1_clk = "/cam1_clk"; + cam0_clk = "/cam0_clk"; + cam1_reg = "/cam0_reg"; + cam0_reg = "/cam0_reg"; + cam_dummy_reg = "/cam_dummy_reg"; + aux = "/dummy"; + dummy = "/dummy"; + i2c0if = "/i2c0if"; + i2c0mux = "/i2c0mux"; + rp1_firmware = "/rp1_firmware"; + rp1_vdd_3v3 = "/rp1_vdd_3v3"; + chosen = "/chosen"; + aliases = "/aliases"; + fan = "/cooling_fan"; + pwr_key = "/pwr_button/pwr"; + }; +}; diff --git a/virt.dts b/dtbs/virt.dts similarity index 100% rename from virt.dts rename to dtbs/virt.dts diff --git a/kernel/Makefile b/kernel/Makefile index cf9780d7..c6b00990 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,35 +1,35 @@ -ARCH= aarch64-none-elf -CC = $(ARCH)-gcc -LD = $(ARCH)-ld -OBJCOPY = $(ARCH)-objcopy +#kernel +# toolchain (inherited from top-level) -CFLAGS = -g -O0 -std=c17 -nostdlib -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wall -Wextra -mcpu=cortex-a72 -I. -I../shared -I../user +CFLAGS := $(CFLAGS_BASE) -I. -I../shared -I../user -DXHCI_CTX_SIZE=$(XHCI_CTX_SIZE) +ifeq ($(QEMU),true) + CFLAGS += -DQEMU +endif -LDFLAGS = -T $(shell ls *.ld) --defsym=LOAD_ADDR=$(LOAD_ADDR) +LDFLAGS := $(LDFLAGS_BASE) -T $(shell ls *.ld) --defsym=LOAD_ADDR=$(LOAD_ADDR) -C_SRC = $(shell find . -name '*.c') -ASM_SRC = $(shell find . -name '*.S') -CPP_SRC = $(shell find . -name '*.cpp') -OBJ = $(C_SRC:.c=.o) $(CPP_SRC:.cpp=.o) $(ASM_SRC:.S=.o) -OBJL = $(filter-out ./boot.o, $(OBJ)) +CLEAN_OBJS := $(shell find . -name '*.o') +C_SRC := $(shell find . -name '*.c') +ASM_SRC := $(shell find . -name '*.S') +CPP_SRC := $(shell find . -name '*.cpp') +OBJ := $(C_SRC:.c=.o) $(ASM_SRC:.S=.o) $(CPP_SRC:.cpp=.o) +OBJL := $(filter-out ./boot.o,$(OBJ)) -TARGET = kernel.img -ELF = kernel.elf +ELF := ../kernel.elf +TARGET := ../kernel.img all: $(TARGET) $(TARGET): ../shared/libshared.a $(OBJ) - $(LD) $(LDFLAGS) -o ../$(ELF) $(OBJL) ../shared/libshared.a - $(OBJCOPY) -O binary ../$(ELF) ../$(TARGET) + $(LD) $(LDFLAGS) -o $(ELF) $(OBJL) ../shared/libshared.a + $(OBJCOPY) -O binary $(ELF) $@ %.o: %.S $(CC) $(CFLAGS) -c $< -o $@ - %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ - %.o: %.cpp $(CC) $(CFLAGS) -fno-rtti -c $< -o $@ clean: - rm -f $(shell find . -name '*.o') ../$(ELF) ../$(TARGET) $(TARGET) \ No newline at end of file + rm -f $(CLEAN_OBJS) $(ELF) $(TARGET) diff --git a/kernel/async.c b/kernel/async.c index c057563f..8b37a2bf 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -17,15 +17,20 @@ void delay(uint32_t ms) { } } +#define WAIT_COND (*reg & expected_value) == expected_value +#define WAIT_CHECK (match > 0) ^ condition + bool wait(uint32_t *reg, uint32_t expected_value, bool match, uint32_t timeout){ - bool condition; - do { - delay(1); - timeout--; + bool condition = WAIT_COND; + while (WAIT_CHECK) { + if (timeout != 0){ + timeout--; + delay(1); + } + condition = WAIT_COND; if (timeout == 0) - return false; - condition = (*reg & expected_value) == expected_value; - } while ((match > 0) ^ condition); + return WAIT_CHECK; + } return true; } \ No newline at end of file diff --git a/kernel/boot.S b/kernel/boot.S index cc4b195d..489f2c5b 100644 --- a/kernel/boot.S +++ b/kernel/boot.S @@ -1,3 +1,5 @@ +#include "sysregs.h" + .global _start .section .text _start: @@ -60,16 +62,11 @@ drop_el3: b.ne el2_entry msr sctlr_el2, xzr - mrs x0, hcr_el2 - orr x0, x0, #(1<<19) - msr hcr_el2, x0 - mrs x0, scr_el3 - orr x0, x0, #(1<<10) - orr x0, x0, #(1<<0) + ldr x0, =SCR_VALUE msr scr_el3, x0 - mov x0, #0b01001//DAIF 0000 + ldr x0, =SPSR3_VALUE msr spsr_el3, x0 adr x0, el2_entry @@ -80,27 +77,30 @@ el2_entry: mrs x0, CurrentEL lsr x0, x0, #2 cmp x0, #2 - b.ne el1_non_secure + b.ne stack_setup + + ldr x0, =CNTHCTL_VALUE + msr cnthctl_el2, x0 + + msr cntvoff_el2, xzr mov x0, #3 << 20 msr cpacr_el1, x0 - ldr x0, =0x30C00800 + ldr x0, =SCTLR_VALUE_MMU_DISABLED msr sctlr_el1, x0 - mrs x0, hcr_el2 - orr x0, x0, #(1<<31) + ldr x0, =HCR_RW msr hcr_el2, x0 mov x0, 0x1C5 msr spsr_el2, x0 - adr x0, el1_non_secure + adr x0, stack_setup msr elr_el2, x0 eret -el1_non_secure: stack_setup: ldr x1, =stack_top mov sp, x1 diff --git a/kernel/console/kconsole/kconsole.cpp b/kernel/console/kconsole/kconsole.cpp index 948ddf4c..aaefe82d 100644 --- a/kernel/console/kconsole/kconsole.cpp +++ b/kernel/console/kconsole/kconsole.cpp @@ -1,11 +1,7 @@ #include "kconsole.hpp" -#include "memory/kalloc.h" -#include "graph/graphics.h" #include "console/serial/uart.h" -KernelConsole::KernelConsole() - : cursor_x(0), cursor_y(0), scroll_row_offset(0) -{ +KernelConsole::KernelConsole() : cursor_x(0), cursor_y(0), is_initialized(false){ resize(); clear(); } @@ -13,111 +9,109 @@ KernelConsole::KernelConsole() bool KernelConsole::check_ready(){ if (!gpu_ready()) return false; if (!is_initialized){ - is_initialized = true; + is_initialized= true; resize(); clear(); } return true; } -void KernelConsole::resize() { - gpu_size screen = gpu_get_screen_size(); - columns = screen.width / char_width; - rows = screen.height / char_height; +void KernelConsole::resize(){ + gpu_size screen_size = gpu_get_screen_size(); + columns = screen_size.width / char_width; + rows = screen_size.height / char_height; - if (buffer_header_size > 0) - temp_free(buffer,buffer_header_size); - if (buffer_data_size > 0) - temp_free(row_data,buffer_data_size); - - buffer_header_size = rows * sizeof(char*); - buffer = (char**)talloc(rows * sizeof(char*)); - buffer_data_size = rows * columns * sizeof(char); + if (row_data) temp_free(row_data, buffer_data_size); + buffer_data_size = rows * columns; row_data = (char*)talloc(buffer_data_size); - - for (unsigned int i = 0; i < rows; i++) { - buffer[i] = row_data + (i * columns); - } -} - -void KernelConsole::put_char(char c) { - if (!check_ready()) - return; - - if (c == '\n') { - newline(); + if (!row_data){ + rows = columns = 0; + row_ring.clear(); return; } - if (cursor_x >= columns) - newline(); - - buffer[(scroll_row_offset + cursor_y) % rows][cursor_x] = c; - gpu_draw_char({cursor_x * char_width, cursor_y * char_height}, c, 1, 0xFFFFFFFF); - cursor_x++; + row_ring.clear(); + for (uint32_t i = 0; i < rows; i++) row_ring.push(i); } -void KernelConsole::put_string(const char *str) { - if (!check_ready()) +void KernelConsole::put_char(char c){ + if (!check_ready()) return; + if (c == '\n'){ + newline(); return; - for (uint32_t i = 0; str[i] != 0; i++) { - put_char(str[i]); } + if (cursor_x >= columns) newline(); + + uint32_t row_index; + if (row_ring.pop(row_index)){ + row_ring.push(row_index); + char* line = row_data + row_index * columns; + line[cursor_x] = c; + gpu_draw_char({cursor_x * char_width, cursor_y * char_height}, c, 1, 0xFFFFFFFF); + cursor_x++; + } +} + +void KernelConsole::put_string(const char* str){ + if (!check_ready()) return; + for (uint32_t i = 0; str[i]; i++) put_char(str[i]); gpu_flush(); } -void KernelConsole::put_hex(uint64_t value) { - if (!check_ready()) - return; +void KernelConsole::put_hex(uint64_t value){ + if (!check_ready()) return; put_char('0'); put_char('x'); bool started = false; - for (uint32_t i = 60;; i -= 4) { + for (uint32_t i = 60 ;; i -= 4){ uint8_t nibble = (value >> i) & 0xF; - char curr_char = nibble < 10 ? '0' + nibble : 'A' + (nibble - 10); - if (started || curr_char != '0' || i == 0) { + char current_char = nibble < 10 ? '0' + nibble : 'A' + (nibble - 10); + if (started || current_char != '0' || i == 0){ started = true; - put_char(curr_char); + put_char(current_char); } if (i == 0) break; } - gpu_flush(); } -void KernelConsole::newline() { - if (!check_ready()) - return; - for (unsigned x = cursor_x; x < columns; x++){ - buffer[(scroll_row_offset + cursor_y) % rows][x] = 0; +void KernelConsole::newline(){ + if (!check_ready()) return; + uint32_t row_index; + if (row_ring.pop(row_index)){ + char* line = row_data + row_index * columns; + for (uint32_t x = cursor_x; x < columns; x++) line[x] = 0; + row_ring.push(row_index); } cursor_x = 0; cursor_y++; - if (cursor_y >= rows) { + if (cursor_y >= rows){ scroll(); cursor_y = rows - 1; } } -void KernelConsole::scroll() { - if (!check_ready()) - return; - - scroll_row_offset = (scroll_row_offset + 1) % rows; - - for (unsigned int x = 0; x < columns; x++) { - buffer[(scroll_row_offset + rows - 1) % rows][x] = 0; +void KernelConsole::scroll(){ + if (!check_ready()) return; + uint32_t row_index; + if (row_ring.pop(row_index)){ + char* line = row_data + row_index * columns; + for (uint32_t x = 0; x < columns; x++) line[x] = 0; + row_ring.push(row_index); } - redraw(); } void KernelConsole::redraw(){ screen_clear(); - for (unsigned int y = 0; y < rows; y++) { - for (unsigned int x = 0; x < columns; x++) { - char c = buffer[(scroll_row_offset + y) % rows][x]; - gpu_draw_char({x * char_width, y * char_height}, c, 1, 0xFFFFFFFF); + for (uint32_t y = 0; y < rows; y++){ + uint32_t row_index; + if (row_ring.pop(row_index)){ + row_ring.push(row_index); + char* line = row_data + row_index * columns; + for (uint32_t x = 0; x < columns; x++){ + gpu_draw_char({x * char_width, y * char_height}, line[x], 1, 0xFFFFFFFF); + } } } } @@ -126,15 +120,15 @@ void KernelConsole::screen_clear(){ gpu_clear(0x0); } -void KernelConsole::clear() { +void KernelConsole::clear(){ screen_clear(); - for (unsigned int y = 0; y < rows; y++) { - for (unsigned int x = 0; x < columns; x++) { - buffer[y][x] = 0; + for (uint32_t i = 0; i < rows; i++){ + uint32_t row_index; + if (row_ring.pop(row_index)){ + char* line = row_data + row_index * columns; + for (uint32_t x = 0; x < columns; x++) line[x] = 0; + row_ring.push(row_index); } } - cursor_x = 0; - cursor_y = 0; - scroll_row_offset = 0; - gpu_flush(); -} \ No newline at end of file + cursor_x = cursor_y = 0; +} diff --git a/kernel/console/kconsole/kconsole.h b/kernel/console/kconsole/kconsole.h index 84ced522..c381bbc2 100644 --- a/kernel/console/kconsole/kconsole.h +++ b/kernel/console/kconsole/kconsole.h @@ -11,4 +11,4 @@ void kconsole_clear(); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/kernel/console/kconsole/kconsole.hpp b/kernel/console/kconsole/kconsole.hpp index f1556f14..feefa40f 100644 --- a/kernel/console/kconsole/kconsole.hpp +++ b/kernel/console/kconsole/kconsole.hpp @@ -1,14 +1,18 @@ #pragma once #include "types.h" +#include "data_struct/ring_buffer.hpp" +#include "graph/graphics.h" +#include "memory/kalloc.h" -class KernelConsole { +class KernelConsole{ public: KernelConsole(); void put_char(char c); - void put_string(const char *str); + void put_string(const char* str); void put_hex(uint64_t value); + void newline(); void scroll(); void clear(); @@ -19,18 +23,17 @@ class KernelConsole { void screen_clear(); void redraw(); - unsigned int cursor_x; - unsigned int cursor_y; - unsigned int columns; - unsigned int rows; - bool is_initialized = false; - int scroll_row_offset = 0; - static constexpr int char_width = 8; - static constexpr int char_height = 16; - char** buffer; - char* row_data; + uint32_t cursor_x, cursor_y; + uint32_t columns, rows; + bool is_initialized; + + static constexpr uint32_t char_width=8; + static constexpr uint32_t char_height=16; + static constexpr uint32_t max_rows=128; - uint64_t buffer_header_size; - uint64_t buffer_data_size; + RingBuffer row_ring; + char* row_data; + uint32_t buffer_data_size; }; -extern KernelConsole kconsole; \ No newline at end of file + +extern KernelConsole kconsole; diff --git a/kernel/console/kio.c b/kernel/console/kio.c index a046813d..9ce4a181 100644 --- a/kernel/console/kio.c +++ b/kernel/console/kio.c @@ -32,12 +32,14 @@ void kprintf_args(const char *fmt, const uint64_t *args, uint32_t arg_count){ void kprintf_args_raw(const char *fmt, const uint64_t *args, uint32_t arg_count){ kstring s = kstring_format_args(fmt, args, arg_count); puts(s.data); + putc('\r'); putc('\n'); temp_free(s.data,256); } void kprintf_l(const char *fmt){ puts(fmt); + putc('\r'); putc('\n'); } diff --git a/kernel/console/serial/uart.c b/kernel/console/serial/uart.c index 1427062d..f81cf570 100644 --- a/kernel/console/serial/uart.c +++ b/kernel/console/serial/uart.c @@ -3,6 +3,7 @@ #include "exceptions/irq.h" #include "gpio.h" #include "hw/hw.h" +#include "mailbox/mailbox.h" #define UART0_DR (UART0_BASE + 0x00) #define UART0_FR (UART0_BASE + 0x18) @@ -11,24 +12,51 @@ #define UART0_LCRH (UART0_BASE + 0x2C) #define UART0_CR (UART0_BASE + 0x30) +#define UART_FIFO 4 +#define UART_WLEN 5 + +#define UART_EN 0 +#define UART_TXE 8 +#define UART_RXE 9 + +#define UART_8B_WLEN 0b11 + uint64_t get_uart_base(){ return UART0_BASE; } +volatile uint32_t uart_mbox[9] __attribute__((aligned(16))) = { + 36, 0, MBOX_CLKRATE_TAG, 12, 8, 2, 0, 0, 0 +}; + void enable_uart() { write32(UART0_CR, 0x0); + uint32_t ibrd = 1; + uint32_t fbrd = 40; + uint32_t baud = 115200; + if (BOARD_TYPE == 2){ - enable_gpio_pin(14); - enable_gpio_pin(15); + if (RPI_BOARD != 5){ + enable_gpio_pin(14); + enable_gpio_pin(15); + } + if (RPI_BOARD >= 4) + if (mailbox_call(uart_mbox,8)){ + uint32_t uart_clk = uart_mbox[6]; + ibrd = uart_clk / (16 * baud); + uint32_t rem = uart_clk % (16 * baud); + fbrd = (rem * 64 + baud/2) / baud; + } } - write32(UART0_IBRD, 1); - write32(UART0_FBRD, 40); + write32(UART0_IBRD, ibrd); + write32(UART0_FBRD, fbrd); + - write32(UART0_LCRH, (1 << 4) | (1 << 5) | (1 << 6)); + write32(UART0_LCRH, (1 << UART_FIFO) | (UART_8B_WLEN << UART_WLEN)); - write32(UART0_CR, (1 << 0) | (1 << 8) | (1 << 9)); + write32(UART0_CR, (1 << UART_EN) | (1 << UART_TXE) | (1 << UART_RXE)); } void uart_raw_putc(const char c) { diff --git a/kernel/exceptions/exception_handler.c b/kernel/exceptions/exception_handler.c index 3f34039b..a7e38c1c 100644 --- a/kernel/exceptions/exception_handler.c +++ b/kernel/exceptions/exception_handler.c @@ -24,7 +24,7 @@ void handle_exception(const char* type) { disable_visual();//Disable visual kprintf, since it has additional memory accesses that could be faulting - kstring s = kstring_format("%s \nESR_EL1: %x\nELR_EL1: %x\nFAR_EL1: %x",(uint64_t)kstring_l(type).data,esr,elr,far); + kstring s = kstring_format("%s \r\nESR_EL1: %x\r\nELR_EL1: %x\r\nFAR_EL1: %x",(uint64_t)kstring_l(type).data,esr,elr,far); panic(s.data); } @@ -36,18 +36,18 @@ void handle_exception_with_info(const char* type, uint64_t info) { disable_visual();//Disable visual kprintf, since it has additional memory accesses that could be faulting - kstring s = kstring_format("%s \nESR_EL1: %x\nELR_EL1: %x\nFAR_EL1: %x",(uint64_t)kstring_l(type).data,esr,elr,far); + kstring s = kstring_format("%s \r\nESR_EL1: %x\r\nELR_EL1: %x\r\nFAR_EL1: %x",(uint64_t)kstring_l(type).data,esr,elr,far); panic_with_info(s.data, info); } -void fiq_el1_handler(){ handle_exception("FIQ EXCEPTION\n"); } +void fiq_el1_handler(){ handle_exception("FIQ EXCEPTION\r\n"); } -void error_el1_handler(){ handle_exception("ERROR EXCEPTION\n"); } +void error_el1_handler(){ handle_exception("ERROR EXCEPTION\r\n"); } void draw_panic_screen(kstring s){ - gpu_clear(0x0000FF); + gpu_clear(0xFF0000FF); uint32_t scale = 3; - gpu_draw_string(*(string *)&s, (gpu_point){20,20}, scale, 0xFFFFFF); + gpu_draw_string(*(string *)&s, (gpu_point){20,20}, scale, 0xFFFFFFFF); gpu_flush(); } @@ -58,15 +58,15 @@ void panic(const char* panic_msg) { panic_triggered = true; uart_raw_puts("*** "); uart_raw_puts(PANIC_TEXT); - uart_raw_puts(" ***\n"); + uart_raw_puts(" ***\r\n"); uart_raw_puts(panic_msg); - uart_raw_putc('\n'); - uart_raw_puts("System Halted"); + uart_raw_puts("\r\n"); + uart_raw_puts("System Halted\r\n"); if (!old_panic_triggered){ - kstring s = kstring_format("%s\n%s\nSystem Halted",(uint64_t)PANIC_TEXT,(uint64_t)panic_msg); + kstring s = kstring_format("%s\r\n%s\r\nSystem Halted",(uint64_t)PANIC_TEXT,(uint64_t)panic_msg); draw_panic_screen(s); } - while (1);//TODO: OPT + while (1); } void panic_with_info(const char* msg, uint64_t info) { @@ -81,16 +81,16 @@ void panic_with_info(const char* msg, uint64_t info) { panic_triggered = true; uart_raw_puts("*** "); uart_raw_puts(PANIC_TEXT); - uart_raw_puts(" ***\n"); + uart_raw_puts(" ***\r\n"); uart_raw_puts(msg); - uart_raw_putc('\n'); + uart_raw_puts("\r\n"); uart_raw_puts("Additional info: "); uart_puthex(info); - uart_raw_putc('\n'); - uart_raw_puts("System Halted"); + uart_raw_puts("\r\n"); + uart_raw_puts("System Halted\r\n"); if (!old_panic_triggered){ - kstring s = kstring_format("%s\n%s\nError code: %x\nSystem Halted",(uint64_t)PANIC_TEXT,(uint64_t)msg,info); + kstring s = kstring_format("%s\r\n%s\r\nError code: %x\r\nSystem Halted",(uint64_t)PANIC_TEXT,(uint64_t)msg,info); draw_panic_screen(s); } - while (1);//TODO: OPT + while (1); } \ No newline at end of file diff --git a/kernel/exceptions/irq.c b/kernel/exceptions/irq.c index a1c0ea74..c39159c8 100644 --- a/kernel/exceptions/irq.c +++ b/kernel/exceptions/irq.c @@ -3,10 +3,11 @@ #include "memory/memory_access.h" #include "process/scheduler.h" #include "input/input_dispatch.h" -#include "input/xhci_types.h" +#include "input/usb_types.h" #include "pci.h" #include "console/serial/uart.h" #include "networking/network.h" +#include "hw/hw.h" #define IRQ_TIMER 30 #define SLEEP_TIMER 27 @@ -14,6 +15,10 @@ extern void irq_el1_asm_handler(); static void gic_enable_irq(uint32_t irq, uint8_t priority, uint8_t cpu_target) { + if (RPI_BOARD == 3){ + write32(GICD_BASE + 0x210, 1 << irq); + return; + } uint32_t reg_offset = (irq / 32) * 4; uint32_t bit = 1 << (irq % 32); @@ -32,21 +37,27 @@ static void gic_enable_irq(uint32_t irq, uint8_t priority, uint8_t cpu_target) { } void irq_init() { - write8(GICD_BASE, 0); // Disable Distributor - write8(GICC_BASE, 0); // Disable CPU Interface + if (RPI_BOARD != 3){ + write32(GICD_BASE, 0); // Disable Distributor + write32(GICC_BASE, 0); // Disable CPU Interface + } gic_enable_irq(IRQ_TIMER, 0x80, 0); - gic_enable_irq(MSI_OFFSET + XHCI_IRQ, 0x80, 0); + gic_enable_irq(MSI_OFFSET + INPUT_IRQ, 0x80, 0); gic_enable_irq(MSI_OFFSET + NET_IRQ, 0x80, 0); gic_enable_irq(MSI_OFFSET + NET_IRQ + 1, 0x80, 0); gic_enable_irq(SLEEP_TIMER, 0x80, 0); - write32(GICC_BASE + 0x004, 0xF0); //Priority + if (RPI_BOARD != 3){ + write32(GICC_BASE + 0x004, 0xF0); //Priority - write8(GICC_BASE, 1); // Enable CPU Interface - write8(GICD_BASE, 1); // Enable Distributor + write32(GICC_BASE, 1); // Enable CPU Interface + write32(GICD_BASE, 1); // Enable Distributor - kprintf("[GIC] GIC enabled\n"); + kprintf_l("[GIC] GIC enabled"); + } else { + kprintf_l("Interrupts initialized"); + } } void enable_interrupt() { @@ -65,30 +76,33 @@ void irq_el1_handler() { if (ksp != 0){ asm volatile ("mov sp, %0" :: "r"(ksp)); } - uint32_t irq = read32(GICC_BASE + 0xC); + uint32_t irq; + if (RPI_BOARD == 3){ + irq = 31 - __builtin_clz(read32(GICD_BASE + 0x204)); + } else irq = read32(GICC_BASE + 0xC); if (irq == IRQ_TIMER) { - write32(GICC_BASE + 0x10, irq); + if (RPI_BOARD != 3) write32(GICC_BASE + 0x10, irq); switch_proc(INTERRUPT); - } else if (irq == MSI_OFFSET + XHCI_IRQ){ + } else if (irq == MSI_OFFSET + INPUT_IRQ){ handle_input_interrupt(); - write32(GICC_BASE + 0x10, irq); + if (RPI_BOARD != 3) write32(GICC_BASE + 0x10, irq); process_restore(); } else if (irq == SLEEP_TIMER){ wake_processes(); - write32(GICC_BASE + 0x10, irq); + if (RPI_BOARD != 3) write32(GICC_BASE + 0x10, irq); process_restore(); } else if (irq == MSI_OFFSET + NET_IRQ){ network_handle_download_interrupt(); - write32(GICC_BASE + 0x10, irq); + if (RPI_BOARD != 3) write32(GICC_BASE + 0x10, irq); process_restore(); } else if (irq == MSI_OFFSET + NET_IRQ + 1){ network_handle_upload_interrupt(); - write32(GICC_BASE + 0x10, irq); + if (RPI_BOARD != 3) write32(GICC_BASE + 0x10, irq); process_restore(); } else { kprintf_raw("[GIC error] Received unknown interrupt"); - write32(GICC_BASE + 0x10, irq); + if (RPI_BOARD != 3) write32(GICC_BASE + 0x10, irq); process_restore(); } } diff --git a/kernel/filesystem/disk.cpp b/kernel/filesystem/disk.cpp index 39ba9067..07b971d4 100644 --- a/kernel/filesystem/disk.cpp +++ b/kernel/filesystem/disk.cpp @@ -4,10 +4,12 @@ #include "virtio_blk_pci.h" #include "sdhci.hpp" #include "hw/hw.h" +#include "console/kio.h" +#include "mbr.h" static bool disk_enable_verbose; SDHCI sdhci_driver; -FAT32FS fs_driver; +FAT32FS *fs_driver; void disk_verbose(){ disk_enable_verbose = true; @@ -34,7 +36,9 @@ bool find_disk(){ } bool disk_init(){ - return fs_driver.init(); + uint32_t f32_partition = mbr_find_partition(0xC); + fs_driver = new FAT32FS(); + return fs_driver->init(f32_partition); } void disk_write(const void *buffer, uint32_t sector, uint32_t count){ @@ -49,9 +53,11 @@ void disk_read(void *buffer, uint32_t sector, uint32_t count){ } void* read_file(char *path){ - return fs_driver.read_file(path); + if (!fs_driver) return 0; + return fs_driver->read_file(path); } string_list* list_directory_contents(char *path){ - return fs_driver.list_contents(path); + if (!fs_driver) return 0; + return fs_driver->list_contents(path); } \ No newline at end of file diff --git a/kernel/filesystem/exfat.cpp b/kernel/filesystem/exfat.cpp index d9c8f7ea..d0429884 100644 --- a/kernel/filesystem/exfat.cpp +++ b/kernel/filesystem/exfat.cpp @@ -21,7 +21,7 @@ void* ExFATFS::read_cluster(uint32_t cluster_start, uint32_t cluster_size, uint3 void* buffer = (char*)allocate_in_page(fs_page, cluster_count * cluster_size * 512, ALIGN_64B, true, true); - disk_read(buffer, lba, count); + disk_read(buffer, partition_first_sector + lba, count); return buffer; } @@ -107,19 +107,21 @@ void* ExFATFS::read_full_file(uint32_t cluster_start, uint32_t cluster_size, uin void ExFATFS::read_FAT(uint32_t location, uint32_t size, uint8_t count){ uint32_t* fat = (uint32_t*)allocate_in_page(fs_page, size * count * 512, ALIGN_64B, true, true); - disk_read((void*)fat, location, size); + disk_read((void*)fat, partition_first_sector + location, size); kprintf("FAT: %x (%x)",location*512,size * count * 512); uint32_t total_entries = (size * count * 512) / 4; // for (uint32_t i = 0; i < total_entries; i++) // if (fat[i] != 0) kprintf("[%i] = %x", i, fat[i]); } -bool ExFATFS::init(){ +bool ExFATFS::init(uint32_t partition_sector){ fs_page = alloc_page(0x1000, true, true, false); mbs = (exfat_mbs*)allocate_in_page(fs_page, 512, ALIGN_64B, true, true); + + partition_first_sector = partition_sector; - disk_read((void*)mbs, 0, 1); + disk_read((void*)mbs, partition_first_sector, 1); if (mbs->bootsignature != 0xAA55){ kprintf("[exfat] Wrong boot signature %x",mbs->bootsignature); diff --git a/kernel/filesystem/exfat.hpp b/kernel/filesystem/exfat.hpp index b044bf39..eab9f18c 100644 --- a/kernel/filesystem/exfat.hpp +++ b/kernel/filesystem/exfat.hpp @@ -77,9 +77,10 @@ class ExFATFS; typedef void* (*ef_entry_handler)(ExFATFS *instance, file_entry*, fileinfo_entry*, filename_entry*, char *seek); +//TODO: Unify fs classes under parent class, including the identifier for the partition so it can be found on mbr class ExFATFS { public: - bool init(); + bool init(uint32_t partition_sector); void* read_full_file(uint32_t cluster_start, uint32_t cluster_size, uint32_t cluster_count, uint64_t file_size, uint32_t root_index); void* read_file(char *path); string_list* list_contents(char *path); @@ -93,6 +94,7 @@ class ExFATFS { exfat_mbs* mbs; void *fs_page; + uint32_t partition_first_sector; static void* read_entry_handler(ExFATFS *instance, file_entry *entry, fileinfo_entry *info, filename_entry *name, char *seek); static void* list_entries_handler(ExFATFS *instance, file_entry *entry, fileinfo_entry *info, filename_entry *name, char *seek); diff --git a/kernel/filesystem/fat32.cpp b/kernel/filesystem/fat32.cpp index b51264c3..00eca4dd 100644 --- a/kernel/filesystem/fat32.cpp +++ b/kernel/filesystem/fat32.cpp @@ -2,6 +2,7 @@ #include "disk.h" #include "memory/page_allocator.h" #include "console/kio.h" +#include "memory/memory_access.h" #include "std/string.h" #include "std/memfunctions.h" #include "math/math.h" @@ -21,6 +22,51 @@ char* FAT32FS::advance_path(char *path){ return path; } +bool FAT32FS::init(uint32_t partition_sector){ + fs_page = alloc_page(0x1000, true, true, false); + + mbs = (fat32_mbs*)allocate_in_page(fs_page, 512, ALIGN_64B, true, true); + + partition_first_sector = partition_sector; + + disk_read((void*)mbs, partition_first_sector, 1); + + kprintf("[fat32] Reading fat32 mbs at %x. %x",partition_first_sector, mbs->jumpboot[0]); + + if (mbs->boot_signature != 0xAA55){ + kprintf("[fat32] Wrong boot signature %x",mbs->boot_signature); + uint8_t *bytes = ((uint8_t*)mbs); + for (int i = 0; i < 512; i++){ + uint64_t _args[] = { bytes[i] }; \ + kputf_args_raw("%x",_args,1); + } + kprintf("Failed to read"); + return false; + } + if (mbs->signature != 0x29 && mbs->signature != 0x28){ + kprintf("[fat32 error] Wrong signature %x",mbs->signature); + return false; + } + + uint16_t num_sectors = read_unaligned16(&mbs->num_sectors); + + cluster_count = (num_sectors == 0 ? mbs->large_num_sectors : num_sectors)/mbs->sectors_per_cluster; + data_start_sector = mbs->reserved_sectors + (mbs->sectors_per_fat * mbs->number_of_fats); + + if (mbs->first_cluster_of_root_directory > cluster_count){ + kprintf("[fat32 error] root directory cluster not found"); + return false; + } + + bytes_per_sector = read_unaligned16(&mbs->bytes_per_sector); + + kprintf("FAT32 Volume uses %i cluster size", bytes_per_sector); + kprintf("Data start at %x",data_start_sector*512); + read_FAT(mbs->reserved_sectors, mbs->sectors_per_fat, mbs->number_of_fats); + + return true; +} + void* FAT32FS::read_cluster(uint32_t cluster_start, uint32_t cluster_size, uint32_t cluster_count, uint32_t root_index){ uint32_t lba = cluster_start + ((root_index - 2) * cluster_size); @@ -33,7 +79,7 @@ void* FAT32FS::read_cluster(uint32_t cluster_start, uint32_t cluster_size, uint3 uint32_t next_index = root_index; for (int i = 0; i < cluster_count; i++){ kprintfv("Cluster %i = %x (%x)",i,next_index,(cluster_start + ((next_index - 2) * cluster_size)) * 512); - disk_read(buffer + (i * cluster_size * 512), cluster_start + ((next_index - 2) * cluster_size), cluster_size); + disk_read(buffer + (i * cluster_size * 512), partition_first_sector + cluster_start + ((next_index - 2) * cluster_size), cluster_size); next_index = fat[next_index]; if (next_index >= 0x0FFFFFF8) return buffer; } @@ -116,6 +162,7 @@ void* FAT32FS::walk_directory(uint32_t cluster_count, uint32_t root_index, char } void* FAT32FS::list_directory(uint32_t cluster_count, uint32_t root_index) { + if (!mbs) return 0; uint32_t cluster_size = mbs->sectors_per_cluster; char *buffer = (char*)read_cluster(data_start_sector, cluster_size, cluster_count, root_index); f32file_entry *entry = 0; @@ -177,62 +224,20 @@ void* FAT32FS::read_full_file(uint32_t cluster_start, uint32_t cluster_size, uin void FAT32FS::read_FAT(uint32_t location, uint32_t size, uint8_t count){ fat = (uint32_t*)allocate_in_page(fs_page, size * count * 512, ALIGN_64B, true, true); - disk_read((void*)fat, location, size); + disk_read((void*)fat, partition_first_sector + location, size); total_fat_entries = (size * count * 512) / 4; } uint32_t FAT32FS::count_FAT(uint32_t first){ uint32_t entry = fat[first]; int count = 1; - while (entry < 0x0FFFFFF8){ + while (entry < 0x0FFFFFF8 && entry != 0){ entry = fat[entry]; count++; } return count; } -uint16_t read_unaligned16(const uint8_t *p) { - return (uint16_t)p[0] | ((uint16_t)p[1] << 8); -} - -#define MBS_NUM_SECTORS read_unaligned16(mbs8 + 0x13) - -bool FAT32FS::init(){ - fs_page = alloc_page(0x1000, true, true, false); - - mbs = (fat32_mbs*)allocate_in_page(fs_page, 512, ALIGN_64B, true, true); - - disk_read((void*)mbs, 0, 1); - - if (mbs->boot_signature != 0xAA55){ - kprintf("[fat32] Wrong boot signature %x",mbs->boot_signature); - return false; - } - if (mbs->signature != 0x29 && mbs->signature != 0x28){ - kprintf("[fat32 error] Wrong signature %x",mbs->signature); - return false; - } - - uint8_t *mbs8 = (uint8_t*)mbs; - - cluster_count = (MBS_NUM_SECTORS == 0 ? mbs->large_num_sectors : MBS_NUM_SECTORS)/mbs->sectors_per_cluster; - data_start_sector = mbs->reserved_sectors + (mbs->sectors_per_fat * mbs->number_of_fats); - - if (mbs->first_cluster_of_root_directory > cluster_count){ - kprintf("[fat32 error] root directory cluster not found"); - return false; - } - - bytes_per_sector = read_unaligned16(mbs8 + 0xB); - - kprintf("FAT32 Volume uses %i cluster size", bytes_per_sector); - kprintf("Data start at %x",data_start_sector*512); - - read_FAT(mbs->reserved_sectors, mbs->sectors_per_fat, mbs->number_of_fats); - - return true; -} - void* FAT32FS::read_entry_handler(FAT32FS *instance, f32file_entry *entry, char *filename, char *seek) { if (entry->flags.volume_id) return 0; @@ -252,6 +257,7 @@ void* FAT32FS::read_entry_handler(FAT32FS *instance, f32file_entry *entry, char } void* FAT32FS::read_file(char *path){ + if (!mbs) return 0; path = advance_path(path); uint32_t count = count_FAT(mbs->first_cluster_of_root_directory); @@ -278,8 +284,9 @@ void* FAT32FS::list_entries_handler(FAT32FS *instance, f32file_entry *entry, cha } string_list* FAT32FS::list_contents(char *path){ + if (!mbs) return 0; path = advance_path(path); uint32_t count = count_FAT(mbs->first_cluster_of_root_directory); return (string_list*)walk_directory(count, mbs->first_cluster_of_root_directory, path, list_entries_handler); -} \ No newline at end of file +} diff --git a/kernel/filesystem/fat32.hpp b/kernel/filesystem/fat32.hpp index b142535e..f62296bd 100644 --- a/kernel/filesystem/fat32.hpp +++ b/kernel/filesystem/fat32.hpp @@ -79,7 +79,7 @@ typedef void* (*f32_entry_handler)(FAT32FS *instance, f32file_entry*, char *file class FAT32FS { public: - bool init(); + bool init(uint32_t partition_sector); void* read_file(char *path); string_list* list_contents(char *path); @@ -92,13 +92,14 @@ class FAT32FS { void* read_cluster(uint32_t cluster_start, uint32_t cluster_size, uint32_t cluster_count, uint32_t root_index); char* advance_path(char *path); - fat32_mbs* mbs; - void *fs_page; - uint32_t cluster_count; - uint32_t data_start_sector; - uint32_t* fat; - uint32_t total_fat_entries; - uint16_t bytes_per_sector; + fat32_mbs* mbs = 0x0; + void *fs_page = 0x0; + uint32_t cluster_count = 0; + uint32_t data_start_sector = 0; + uint32_t* fat = 0x0; + uint32_t total_fat_entries = 0; + uint16_t bytes_per_sector = 0; + uint32_t partition_first_sector = 0; static void* read_entry_handler(FAT32FS *instance, f32file_entry *entry, char *filename, char *seek); static void* list_entries_handler(FAT32FS *instance, f32file_entry *entry, char *filename, char *seek); diff --git a/kernel/filesystem/mbr.c b/kernel/filesystem/mbr.c new file mode 100644 index 00000000..6a8da58a --- /dev/null +++ b/kernel/filesystem/mbr.c @@ -0,0 +1,27 @@ +#include "mbr.h" +#include "memory/page_allocator.h" +#include "memory/memory_access.h" +#include "disk.h" +#include "console/kio.h" + +void* mbr_page; + +uint32_t mbr_find_partition(uint8_t partition_type){ + mbr_page = alloc_page(0x1000, true, true, false); + + mbr *mbr_entry = (mbr*)allocate_in_page(mbr_page, 512, ALIGN_64B, true, true); + + disk_read((void*)mbr_entry, 0, 1); + + uint32_t offset = 0; + + for (uint8_t i = 0; i < 4; i++){ + partition_entry *entry = &mbr_entry->partitions[i]; + kprintf("MBR Partition %i = %x -> %x",i, entry->type, read_unaligned32(&entry->first_sector)); + if (entry->type == partition_type){ + offset = read_unaligned32(&entry->first_sector); + } + } + + return offset; +} \ No newline at end of file diff --git a/kernel/filesystem/mbr.h b/kernel/filesystem/mbr.h new file mode 100644 index 00000000..68c26cab --- /dev/null +++ b/kernel/filesystem/mbr.h @@ -0,0 +1,29 @@ +#pragma once + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct partition_entry +{ + uint8_t status; + uint8_t first_sector_chs[3]; + uint8_t type; + uint8_t last_sector_chs[3]; + uint32_t first_sector; + uint32_t num_sectors; +}__attribute__((packed)) partition_entry; + +typedef struct mbr { + uint8_t bootstrap[0x1BE]; + partition_entry partitions[4]; + uint16_t signature; +}__attribute__((packed, aligned(1))) mbr; + +uint32_t mbr_find_partition(uint8_t partition_type); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/kernel/filesystem/sdhci.cpp b/kernel/filesystem/sdhci.cpp index 917196ca..89c5831b 100644 --- a/kernel/filesystem/sdhci.cpp +++ b/kernel/filesystem/sdhci.cpp @@ -105,7 +105,7 @@ bool SDHCI::switch_clock_rate(uint32_t target_rate) { volatile uint32_t mbox[8] __attribute__((aligned(16))) = { 32, 0, - 0x00030002, 8, 0, 1, 0,//Request clock rate for 1 (EMMC) + MBOX_CLKRATE_TAG, 8, 0, 1, 0,//Request clock rate for 1 (EMMC) 0 }; @@ -152,7 +152,7 @@ bool SDHCI::init() { setup_clock(); - kprintf("[SDHCI] Controller ready"); + kprintf("[SDHCI] Controller ready CTL0 %x",regs->ctrl0); regs->interrupt = 0; regs->irpt_en = 0xFFFFFFFF; @@ -168,15 +168,15 @@ bool SDHCI::init() { switch_clock_rate(25000000); - bool v2_card = 0; - if (!issue_command(IF_COND, 0)){ + v2_card = 0; + if (!issue_command(IF_COND, 0x1AA)){ if (!(regs->interrupt & 0x10000)){ kprintf("[SDHCI error] IFCOND error"); return false; } kprintfv("[SDHCI] Timeout on IFCOND. Defaulting to V1"); } else { - if ((regs->resp0 & 0xFF) != 0xAA) { + if ((regs->resp0 & 0xFFF) != 0x1AA) { kprintf("[SDHCI error] IFCOND pattern mismatch"); return false; } @@ -263,9 +263,11 @@ bool SDHCI::read(void *buffer, uint32_t sector, uint32_t count){ regs->blksize_count = (count << 16) | 512; uint32_t command = multiple ? READ_MULTIPLE : READ_ONE; uint32_t flags = multiple ? 0b110110 : 0b010000; +#if QEMU + sector *= 512; +#endif for (int i = 5; i >= 0; i--){ - //TODO: Byte addressing works here, instead of block addressing. Not sure that's normal or if it's card-specific - if (issue_command(command, sector * 512, flags)) break; + if (issue_command(command, sector, flags)) break; if (i == 0) { kprintf("[SDHCI error] read request timeout"); return false; } delay(500); } diff --git a/kernel/filesystem/sdhci.hpp b/kernel/filesystem/sdhci.hpp index c2ba2037..21ebf979 100644 --- a/kernel/filesystem/sdhci.hpp +++ b/kernel/filesystem/sdhci.hpp @@ -38,5 +38,6 @@ class SDHCI { bool switch_clock_rate(uint32_t target_rate); uint32_t clock_rate; uint32_t rca; + bool v2_card; bool verbose; }; \ No newline at end of file diff --git a/kernel/graph/drivers/videocore/videocore.cpp b/kernel/graph/drivers/videocore/videocore.cpp index 44c83cc2..77bc5d01 100644 --- a/kernel/graph/drivers/videocore/videocore.cpp +++ b/kernel/graph/drivers/videocore/videocore.cpp @@ -13,6 +13,8 @@ #define RGB_FORMAT_XRGB8888 ((uint32_t)('X') | ((uint32_t)('R') << 8) | ((uint32_t)('2') << 16) | ((uint32_t)('4') << 24)) +#define BUS_ADDRESS(addr) ((addr) & ~0xC0000000) + VideoCoreGPUDriver* VideoCoreGPUDriver::try_init(gpu_size preferred_screen_size){ VideoCoreGPUDriver* driver = new VideoCoreGPUDriver(); if (driver->init(preferred_screen_size)) @@ -21,55 +23,49 @@ VideoCoreGPUDriver* VideoCoreGPUDriver::try_init(gpu_size preferred_screen_size) return nullptr; } -volatile uint32_t rmbox[36] __attribute__((aligned(16))) = { - 25 * 4,// Buf size +volatile uint32_t rmbox[40] __attribute__((aligned(16))) = { + 30 * 4,// Buf size 0,// Request. Code 0 - 0x00048003, 8, 0, 640, 480,// Physical size - 0x00048004, 8, 0, 0, 0,// Virtual size - 0x00048005, 4, 0, 32,// Depth - 0x00040008, 4, 0, 0,//Pitch - 0x00048006, 4, 0, 0, //BGR + MBOX_VC_PHYS_SIZE_TAG, 8, 0, 0, 0,// Physical size + MBOX_VC_VIRT_SIZE_TAG, 8, 0, 0, 0,// Virtual size + MBOX_VC_DEPTH_TAG | MBOX_SET_VALUE, 4, 4, 32,// Depth + MBOX_VC_PITCH_TAG, 4, 0, 0,//Pitch + MBOX_VC_FORMAT_TAG | MBOX_SET_VALUE, 4, 4, 0, //BGR + MBOX_VC_FRAMEBUFFER_TAG, 8, 0, 16, 0, 0,// End -};//TODO: Screen resolution seems fixed at 640x480 (on QEMU at least). Setting it to anything else hangs the system - -volatile uint32_t fb_mbox[36] __attribute__((aligned(16))) = { - 32, 0, - 0x00040001, 8, 0, 16, 0, - 0 }; bool VideoCoreGPUDriver::init(gpu_size preferred_screen_size){ kprintf("Initializing VideoCore GPU"); - if (mailbox_call(rmbox, 8)) { - uint32_t phys_w = rmbox[5]; - uint32_t phys_h = rmbox[6]; - uint32_t virt_w = rmbox[10]; - uint32_t virt_h = rmbox[11]; - uint32_t depth = rmbox[15]; - stride = rmbox[19]; - - bpp = depth/8; - - screen_size = (gpu_size){phys_w,phys_h}; - kprintf("Size %ix%i (%ix%i) (%ix%i) | %i (%i)",phys_w,phys_h,virt_w,virt_h,screen_size.width,screen_size.height,depth, stride); - - fb_set_stride(bpp * screen_size.width); - fb_set_bounds(screen_size.width,screen_size.height); - if (!mailbox_call(fb_mbox, 8)){ - kprintf("Error"); - return false; - } - framebuffer = fb_mbox[5]; - size_t fb_size = fb_mbox[6]; - page = alloc_page(0x1000, true, true, false); - back_framebuffer = (uintptr_t)allocate_in_page(page, fb_size, ALIGN_16B, true, true); - kprintf("Framebuffer allocated to %x. BPP %i. Stride %i",framebuffer, bpp, stride/bpp); - //TODO: Mark the fb memory as used in the page allocator manually - for (size_t i = framebuffer; i < framebuffer + fb_size; i += GRANULE_4KB) - register_device_memory(i,i); - return true; + + if (!mailbox_call(rmbox, 8)) { + kprintf("Failed videocore setup"); + return false; } - return false; + uint32_t phys_w = rmbox[5]; + uint32_t phys_h = rmbox[6]; + uint32_t virt_w = rmbox[10]; + uint32_t virt_h = rmbox[11]; + uint32_t depth = rmbox[15]; + stride = rmbox[19]; + + bpp = depth/8; + + screen_size = (gpu_size){phys_w,phys_h}; + kprintf("Size %ix%i (%ix%i) (%ix%i) | %i (%i)",phys_w,phys_h,virt_w,virt_h,screen_size.width,screen_size.height,depth, stride); + + fb_set_stride(stride); + fb_set_bounds(screen_size.width,screen_size.height); + + framebuffer = rmbox[27]; + size_t fb_size = rmbox[28]; + page = alloc_page(0x1000, true, true, false); + back_framebuffer = (uintptr_t)allocate_in_page(page, fb_size, ALIGN_16B, true, true); + kprintf("Framebuffer allocated to %x (%i). BPP %i. Stride %i",framebuffer, fb_size, bpp, stride/bpp); + mark_used(framebuffer,count_pages(fb_size,PAGE_SIZE)); + for (size_t i = framebuffer; i < framebuffer + fb_size; i += GRANULE_4KB) + register_device_memory(i,i); + return true; } void VideoCoreGPUDriver::flush(){ @@ -136,4 +132,4 @@ void VideoCoreGPUDriver::draw_string(string s, uint32_t x, uint32_t y, uint32_t uint32_t VideoCoreGPUDriver::get_char_size(uint32_t scale){ return fb_get_char_size(max(1,scale-1));//TODO: Screen resolution seems fixed at 640x480 (on QEMU at least). So we make the font smaller -} \ No newline at end of file +} diff --git a/kernel/graph/drivers/virtio_gpu_pci/virtio_gpu_pci.cpp b/kernel/graph/drivers/virtio_gpu_pci/virtio_gpu_pci.cpp index f9c440e7..089ea033 100644 --- a/kernel/graph/drivers/virtio_gpu_pci/virtio_gpu_pci.cpp +++ b/kernel/graph/drivers/virtio_gpu_pci/virtio_gpu_pci.cpp @@ -58,8 +58,7 @@ bool VirtioGPUDriver::init(gpu_size preferred_screen_size){ kprintf("Stride %i",screen_size.width * BPP); framebuffer_size = screen_size.width * screen_size.height * BPP; - framebuffer_size = (framebuffer_size); - framebuffer = talloc(framebuffer_size); + framebuffer = (uintptr_t)allocate_in_page(gpu_dev.memory_page, framebuffer_size, ALIGN_4KB, true, true); fb_set_bounds(screen_size.width,screen_size.height); @@ -113,8 +112,7 @@ typedef struct virtio_2d_resource { } virtio_2d_resource; gpu_size VirtioGPUDriver::get_display_info(){ - //TODO: replace talloc as we did in disk - virtio_gpu_ctrl_hdr* cmd = (virtio_gpu_ctrl_hdr*)talloc(sizeof(virtio_gpu_ctrl_hdr)); + virtio_gpu_ctrl_hdr* cmd = (virtio_gpu_ctrl_hdr*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_gpu_ctrl_hdr), ALIGN_4KB, true, true); cmd->type = VIRTIO_GPU_CMD_GET_DISPLAY_INFO; cmd->flags = 0; cmd->fence_id = 0; @@ -124,18 +122,18 @@ gpu_size VirtioGPUDriver::get_display_info(){ cmd->padding[1] = 0; cmd->padding[2] = 0; - virtio_gpu_resp_display_info* resp = (virtio_gpu_resp_display_info*)talloc(sizeof(virtio_gpu_resp_display_info)); + virtio_gpu_resp_display_info* resp = (virtio_gpu_resp_display_info*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_gpu_resp_display_info), ALIGN_4KB, true, true); if (!virtio_send(&gpu_dev, gpu_dev.common_cfg->queue_desc, gpu_dev.common_cfg->queue_driver, gpu_dev.common_cfg->queue_device, (uintptr_t)cmd, sizeof(virtio_gpu_ctrl_hdr), (uintptr_t)resp, sizeof(virtio_gpu_resp_display_info), VIRTQ_DESC_F_WRITE)){ - temp_free(cmd, sizeof(virtio_gpu_ctrl_hdr)); - temp_free(resp, sizeof(virtio_gpu_resp_display_info)); + free_from_page((void*)cmd, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)resp, sizeof(virtio_gpu_resp_display_info)); return (gpu_size){0, 0}; } if (resp->hdr.type != 0x1101) { - temp_free(cmd, sizeof(virtio_gpu_ctrl_hdr)); - temp_free(resp, sizeof(virtio_gpu_resp_display_info)); + free_from_page((void*)(void*)cmd, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)resp, sizeof(virtio_gpu_resp_display_info)); return (gpu_size){0, 0}; } @@ -151,13 +149,13 @@ gpu_size VirtioGPUDriver::get_display_info(){ } scanout_found = false; - temp_free(cmd, sizeof(virtio_gpu_ctrl_hdr)); - temp_free(resp, sizeof(virtio_gpu_resp_display_info)); + free_from_page((void*)cmd, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)resp, sizeof(virtio_gpu_resp_display_info)); return (gpu_size){0, 0}; } bool VirtioGPUDriver::create_2d_resource(gpu_size size) { - virtio_2d_resource* cmd = (virtio_2d_resource*)talloc(sizeof(virtio_2d_resource)); + virtio_2d_resource* cmd = (virtio_2d_resource*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_2d_resource), ALIGN_4KB, true, true); cmd->hdr.type = VIRTIO_GPU_CMD_RESOURCE_CREATE_2D; cmd->hdr.flags = 0; @@ -172,23 +170,23 @@ bool VirtioGPUDriver::create_2d_resource(gpu_size size) { cmd->width = size.width; cmd->height = size.height; - virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)talloc(sizeof(virtio_gpu_ctrl_hdr)); + virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_gpu_ctrl_hdr), ALIGN_4KB, true, true); if (!virtio_send(&gpu_dev, gpu_dev.common_cfg->queue_desc, gpu_dev.common_cfg->queue_driver, gpu_dev.common_cfg->queue_device, (uintptr_t)cmd, sizeof(virtio_2d_resource), (uintptr_t)resp, sizeof(virtio_gpu_ctrl_hdr), VIRTQ_DESC_F_WRITE)){ - temp_free(cmd, sizeof(virtio_2d_resource)); - temp_free(resp, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)cmd, sizeof(virtio_2d_resource)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return false; } if (resp->type != 0x1100) { - temp_free(cmd, sizeof(virtio_2d_resource)); - temp_free(resp, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)cmd, sizeof(virtio_2d_resource)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return false; } - temp_free(cmd, sizeof(virtio_2d_resource)); - temp_free(resp, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)cmd, sizeof(virtio_2d_resource)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return true; } @@ -205,7 +203,7 @@ typedef struct virtio_backing_cmd { }__attribute__((packed)) virtio_backing_cmd; bool VirtioGPUDriver::attach_backing() { - virtio_backing_cmd* cmd = (virtio_backing_cmd*)talloc(sizeof(virtio_backing_cmd)); + virtio_backing_cmd* cmd = (virtio_backing_cmd*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_backing_cmd), ALIGN_4KB, true, true); cmd->hdr.type = VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING; cmd->hdr.flags = 0; @@ -222,23 +220,23 @@ bool VirtioGPUDriver::attach_backing() { cmd->entries[0].length = framebuffer_size; cmd->entries[0].padding = 0; - virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)talloc(sizeof(virtio_gpu_ctrl_hdr)); + virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_gpu_ctrl_hdr), ALIGN_4KB, true, true); if (!virtio_send2(&gpu_dev, gpu_dev.common_cfg->queue_desc, gpu_dev.common_cfg->queue_driver, gpu_dev.common_cfg->queue_device, (uintptr_t)cmd, sizeof(*cmd), (uintptr_t)resp, sizeof(virtio_gpu_ctrl_hdr), VIRTQ_DESC_F_NEXT)){ - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)cmd, sizeof(*cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return false; } if (resp->type != 0x1100) { - temp_free(cmd, sizeof(virtio_backing_cmd)); - temp_free(resp, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)cmd, sizeof(virtio_backing_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return false; } - temp_free(cmd, sizeof(virtio_backing_cmd)); - temp_free(resp, sizeof(virtio_gpu_ctrl_hdr)); + free_from_page((void*)cmd, sizeof(virtio_backing_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return true; } @@ -250,7 +248,7 @@ typedef struct virtio_scanout_cmd { }__attribute__((packed)) virtio_scanout_cmd; bool VirtioGPUDriver::set_scanout() { - virtio_scanout_cmd* cmd = (virtio_scanout_cmd*)talloc(sizeof(virtio_scanout_cmd)); + virtio_scanout_cmd* cmd = (virtio_scanout_cmd*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_scanout_cmd), ALIGN_4KB, true, true); cmd->r.x = 0; cmd->r.y = 0; @@ -269,23 +267,23 @@ bool VirtioGPUDriver::set_scanout() { cmd->hdr.padding[1] = 0; cmd->hdr.padding[2] = 0; - virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)talloc(sizeof(virtio_gpu_ctrl_hdr)); + virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_gpu_ctrl_hdr), ALIGN_4KB, true, true); if (!virtio_send(&gpu_dev, gpu_dev.common_cfg->queue_desc, gpu_dev.common_cfg->queue_driver, gpu_dev.common_cfg->queue_device, (uintptr_t)cmd, sizeof(*cmd), (uintptr_t)resp, sizeof(virtio_gpu_ctrl_hdr), VIRTQ_DESC_F_WRITE)){ - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + free_from_page((void*)cmd, sizeof(virtio_scanout_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return false; } if (resp->type != 0x1100) { - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + free_from_page((void*)cmd, sizeof(virtio_scanout_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return false; } - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + free_from_page((void*)cmd, sizeof(virtio_scanout_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return true; } @@ -298,7 +296,7 @@ typedef struct virtio_transfer_cmd { }__attribute__((packed)) virtio_transfer_cmd; bool VirtioGPUDriver::transfer_to_host(gpu_rect rect) { - virtio_transfer_cmd* cmd = (virtio_transfer_cmd*)talloc(sizeof(virtio_transfer_cmd)); + virtio_transfer_cmd* cmd = (virtio_transfer_cmd*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_transfer_cmd), ALIGN_4KB, true, true); cmd->hdr.type = VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D; cmd->hdr.flags = 0; @@ -314,23 +312,23 @@ bool VirtioGPUDriver::transfer_to_host(gpu_rect rect) { cmd->rect.width = rect.size.width; cmd->rect.height = rect.size.height; - virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)talloc(sizeof(virtio_gpu_ctrl_hdr)); + virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_gpu_ctrl_hdr), ALIGN_4KB, true, true); if (!virtio_send(&gpu_dev, gpu_dev.common_cfg->queue_desc, gpu_dev.common_cfg->queue_driver, gpu_dev.common_cfg->queue_device, - (uintptr_t)cmd, sizeof(*cmd), (uintptr_t)resp, sizeof(*resp), VIRTQ_DESC_F_WRITE)){ - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + (uintptr_t)cmd, sizeof(virtio_transfer_cmd), (uintptr_t)resp, sizeof(virtio_gpu_ctrl_hdr), VIRTQ_DESC_F_WRITE)){ + free_from_page((void*)cmd, sizeof(virtio_transfer_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return false; } if (resp->type != 0x1100) { - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + free_from_page((void*)cmd, sizeof(virtio_transfer_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return false; } - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + free_from_page((void*)cmd, sizeof(virtio_transfer_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return true; } @@ -352,7 +350,7 @@ void VirtioGPUDriver::flush() { } } - virtio_flush_cmd* cmd = (virtio_flush_cmd*)talloc(sizeof(virtio_flush_cmd)); + virtio_flush_cmd* cmd = (virtio_flush_cmd*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_flush_cmd), ALIGN_4KB, true, true); cmd->hdr.type = VIRTIO_GPU_CMD_RESOURCE_FLUSH; cmd->hdr.flags = 0; @@ -367,23 +365,23 @@ void VirtioGPUDriver::flush() { cmd->rect.width = screen_size.width; cmd->rect.height = screen_size.height; - virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)talloc(sizeof(virtio_gpu_ctrl_hdr)); + virtio_gpu_ctrl_hdr* resp = (virtio_gpu_ctrl_hdr*)allocate_in_page(gpu_dev.memory_page, sizeof(virtio_gpu_ctrl_hdr), ALIGN_4KB, true, true); if (!virtio_send(&gpu_dev, gpu_dev.common_cfg->queue_desc, gpu_dev.common_cfg->queue_driver, gpu_dev.common_cfg->queue_device, - (uintptr_t)cmd, sizeof(*cmd), (uintptr_t)resp, sizeof(*resp), VIRTQ_DESC_F_WRITE)){ - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + (uintptr_t)cmd, sizeof(virtio_flush_cmd), (uintptr_t)resp, sizeof(virtio_gpu_ctrl_hdr), VIRTQ_DESC_F_WRITE)){ + free_from_page((void*)cmd, sizeof(virtio_flush_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return; } if (resp->type != 0x1100) { - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + free_from_page((void*)cmd, sizeof(virtio_flush_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return; } - temp_free(cmd, sizeof(*cmd)); - temp_free(resp, sizeof(*resp)); + free_from_page((void*)cmd, sizeof(virtio_flush_cmd)); + free_from_page((void*)resp, sizeof(virtio_gpu_ctrl_hdr)); return; } diff --git a/kernel/graph/graphics.cpp b/kernel/graph/graphics.cpp index c59fa1ac..ba3e632a 100644 --- a/kernel/graph/graphics.cpp +++ b/kernel/graph/graphics.cpp @@ -14,10 +14,12 @@ static bool _gpu_ready; GPUDriver *gpu_driver; void gpu_init(gpu_size preferred_screen_size){ - if (VirtioGPUDriver *vgd = VirtioGPUDriver::try_init(preferred_screen_size)){ - gpu_driver = vgd; - } else if (RamFBGPUDriver *rfb = RamFBGPUDriver::try_init(preferred_screen_size)){ - gpu_driver = rfb; + if (BOARD_TYPE == 1){ + if (VirtioGPUDriver *vgd = VirtioGPUDriver::try_init(preferred_screen_size)){ + gpu_driver = vgd; + } else if (RamFBGPUDriver *rfb = RamFBGPUDriver::try_init(preferred_screen_size)){ + gpu_driver = rfb; + } } else if (BOARD_TYPE == 2){ gpu_driver = VideoCoreGPUDriver::try_init(preferred_screen_size); } diff --git a/kernel/hw/hw.c b/kernel/hw/hw.c index 0067a6b6..847d7f0d 100644 --- a/kernel/hw/hw.c +++ b/kernel/hw/hw.c @@ -3,8 +3,9 @@ #include "gpio.h" uint8_t BOARD_TYPE; +uint8_t RPI_BOARD; uint8_t USE_DTB = 0; -uint8_t USE_PCI = 0; +uintptr_t PCI_BASE = 0; uintptr_t RAM_START = 0; uintptr_t RAM_SIZE = 0; uintptr_t CRAM_START = 0; @@ -15,10 +16,11 @@ uintptr_t MMIO_BASE = 0; uintptr_t GICD_BASE = 0; uintptr_t GICC_BASE = 0; uintptr_t SDHCI_BASE = 0; - -uint8_t RPI_BOARD; -uint8_t GPIO_BASE; -uint8_t GPIO_PIN_BASE; +uintptr_t MAILBOX_BASE = 0; +uintptr_t GPIO_BASE; +uintptr_t GPIO_PIN_BASE; +uintptr_t DWC2_BASE; +uint32_t MSI_OFFSET; void detect_hardware(){ if (BOARD_TYPE == 1){ @@ -27,38 +29,53 @@ void detect_hardware(){ CRAM_END = 0x60000000; RAM_START = 0x40000000; CRAM_START = 0x43600000; - USE_PCI = 1; + PCI_BASE = 0x4010000000; GICD_BASE = 0x08000000; GICC_BASE = 0x08010000; - + MSI_OFFSET = 50; } else { uint32_t reg; asm volatile ("mrs %x0, midr_el1" : "=r" (reg)); uint32_t raspi = (reg >> 4) & 0xFFF; switch (raspi) { case 0xD08: //4B. Cortex A72 - MMIO_BASE = 0xFE000000; - RPI_BOARD = 4; - GPIO_PIN_BASE = 0x50; + MMIO_BASE = 0xFE000000; + RPI_BOARD = 4; + GPIO_PIN_BASE = 0x50; + GICD_BASE = MMIO_BASE + 0x1841000; + GICC_BASE = MMIO_BASE + 0x1842000; break; case 0xD0B: //5. Cortex A76 - MMIO_BASE = 0x107C000000UL; - RPI_BOARD = 5; - GPIO_PIN_BASE = 0x50; + MMIO_BASE = 0x107C000000UL; + RPI_BOARD = 5; + GICD_BASE = MMIO_BASE + 0x3FF9000; + GICC_BASE = MMIO_BASE + 0x3FFA000; + MAILBOX_BASE = MMIO_BASE + 0x13880; + SDHCI_BASE = MMIO_BASE + 0xFFF000UL; + UART0_BASE = MMIO_BASE + 0x1001000; + XHCI_BASE = 0x1F00300000UL; + PCI_BASE = 0x1000120000UL; + break; + default: + RPI_BOARD = 3; + MMIO_BASE = 0x3F000000; + GICD_BASE = MMIO_BASE + 0xB200; break; - default: MMIO_BASE = 0x3F000000; break; } - GPIO_BASE = MMIO_BASE + 0x200000; - GICD_BASE = MMIO_BASE + 0x1841000; - GICC_BASE = MMIO_BASE + 0x1842000; - UART0_BASE = MMIO_BASE + 0x201000; - SDHCI_BASE = MMIO_BASE + 0x300000; - XHCI_BASE = MMIO_BASE + 0x9C0000; + if (RPI_BOARD != 5){ + GPIO_BASE = MMIO_BASE + 0x200000; + MAILBOX_BASE = MMIO_BASE + 0xB880; + UART0_BASE = MMIO_BASE + 0x201000; + SDHCI_BASE = MMIO_BASE + 0x300000; + XHCI_BASE = MMIO_BASE + 0x9C0000; + } + DWC2_BASE = MMIO_BASE + 0x980000; RAM_START = 0x10000000; CRAM_END = (MMIO_BASE - 0x10000000) & 0xF0000000; RAM_START = 0x10000000; CRAM_START = 0x13600000; - reset_gpio(); + MSI_OFFSET = 0; + if (RPI_BOARD != 5) reset_gpio(); } } diff --git a/kernel/hw/hw.h b/kernel/hw/hw.h index 7633c348..acb6ea2a 100644 --- a/kernel/hw/hw.h +++ b/kernel/hw/hw.h @@ -6,7 +6,7 @@ extern uint8_t BOARD_TYPE; extern uint8_t USE_DTB; -extern uint8_t USE_PCI; +extern uintptr_t PCI_BASE; extern uintptr_t RAM_START; extern uintptr_t RAM_SIZE; @@ -23,11 +23,17 @@ extern uintptr_t GICC_BASE; extern uintptr_t SDHCI_BASE; -extern uint8_t GPIO_BASE; +extern uintptr_t GPIO_BASE; -extern uint8_t GPIO_PIN_BASE; +extern uintptr_t GPIO_PIN_BASE; extern uint8_t RPI_BOARD; +extern uintptr_t MAILBOX_BASE; + +extern uintptr_t DWC2_BASE; + +extern uint32_t MSI_OFFSET; + void detect_hardware(); void print_hardware(); \ No newline at end of file diff --git a/kernel/input/USBDevice.cpp b/kernel/input/USBDevice.cpp index 0a65e9ca..35650988 100644 --- a/kernel/input/USBDevice.cpp +++ b/kernel/input/USBDevice.cpp @@ -1,6 +1,6 @@ #include "USBDevice.hpp" #include "USBKeyboard.hpp" -#include "xhci_types.h" +#include "usb_types.h" #include "console/kio.h" USBDevice::USBDevice(uint32_t capacity, uint8_t address) : address(address) { @@ -21,7 +21,7 @@ void USBDevice::process_data(uint8_t endpoint_id, USBDriver *driver){ ep->process_data(driver); } -void USBDevice::register_endpoint(uint8_t endpoint, xhci_device_types type, uint16_t packet_size){ +void USBDevice::register_endpoint(uint8_t endpoint, usb_device_types type, uint16_t packet_size){ if (endpoint >= endpoints.max_size()) return; USBEndpoint *newendpoint; switch (type){ diff --git a/kernel/input/USBDevice.hpp b/kernel/input/USBDevice.hpp index a3e4a4e2..61b80f16 100644 --- a/kernel/input/USBDevice.hpp +++ b/kernel/input/USBDevice.hpp @@ -1,6 +1,6 @@ #pragma once #include "types.h" -#include "xhci_types.h" +#include "usb_types.h" #include "std/std.hpp" #include "console/kio.h" @@ -8,13 +8,13 @@ class USBDriver; class USBEndpoint { public: - USBEndpoint(uint8_t endpoint, xhci_device_types type, uint16_t packet_size): endpoint(endpoint), type(type), packet_size(packet_size) { } + USBEndpoint(uint8_t endpoint, usb_device_types type, uint16_t packet_size): endpoint(endpoint), type(type), packet_size(packet_size) { } virtual void request_data(USBDriver *driver) = 0; virtual void process_data(USBDriver *driver) = 0; uint8_t endpoint; - xhci_device_types type; + usb_device_types type; uint16_t packet_size; }; @@ -25,7 +25,7 @@ class USBDevice { void process_data(uint8_t endpoint_id, USBDriver *driver); - void register_endpoint(uint8_t endpoint, xhci_device_types type, uint16_t packet_size); + void register_endpoint(uint8_t endpoint, usb_device_types type, uint16_t packet_size); void poll_inputs(USBDriver *driver); diff --git a/kernel/input/USBKeyboard.cpp b/kernel/input/USBKeyboard.cpp index a37d5760..8f23f876 100644 --- a/kernel/input/USBKeyboard.cpp +++ b/kernel/input/USBKeyboard.cpp @@ -11,10 +11,8 @@ void USBKeyboard::request_data(USBDriver *driver){ buffer = alloc_page(packet_size, true, true, true); } - if (!driver->poll(slot_id, endpoint, buffer, packet_size)){ - + if (!driver->poll(slot_id, endpoint, buffer, packet_size)) return; - } if (!driver->use_interrupts){ process_keypress((keypress*)buffer); @@ -23,13 +21,13 @@ void USBKeyboard::request_data(USBDriver *driver){ } void USBKeyboard::process_data(USBDriver *driver){ - if (!requesting){ + if (!requesting) return; - } process_keypress((keypress*)buffer); - request_data(driver); + if (driver->use_interrupts) + request_data(driver); } void USBKeyboard::process_keypress(keypress *rkp){ @@ -41,10 +39,12 @@ void USBKeyboard::process_keypress(keypress *rkp){ // kprintf_raw("Mod: %i", kp.modifier); for (int i = 0; i < 6; i++){ kp.keys[i] = rkp->keys[i]; - // kprintf_raw("Key [%i]: %i", i, kp.keys[i]); + // kprintf_raw("Key [%i]: %x", i, kp.keys[i]); } last_keypress = kp; register_keypress(kp); } else repeated_keypresses++; + + requesting = false; } \ No newline at end of file diff --git a/kernel/input/USBKeyboard.hpp b/kernel/input/USBKeyboard.hpp index 1d0b7883..1f11f7a9 100644 --- a/kernel/input/USBKeyboard.hpp +++ b/kernel/input/USBKeyboard.hpp @@ -3,7 +3,7 @@ #include "types.h" #include "USBDevice.hpp" #include "keypress.h" -#include "xhci_types.h" +#include "usb_types.h" class USBKeyboard: public USBEndpoint { public: @@ -12,7 +12,6 @@ class USBKeyboard: public USBEndpoint { void process_data(USBDriver *driver) override; private: void process_keypress(keypress *rkp); - trb* latest_ring; bool requesting = false; uint8_t slot_id; diff --git a/kernel/input/USBManager.cpp b/kernel/input/USBManager.cpp index 3efd8f75..6b1827c9 100644 --- a/kernel/input/USBManager.cpp +++ b/kernel/input/USBManager.cpp @@ -14,7 +14,7 @@ void USBManager::register_device(uint8_t address){ devices.add(address,newdevice); } -void USBManager::register_endpoint(uint8_t slot_id, uint8_t endpoint, xhci_device_types type, uint16_t packet_size){ +void USBManager::register_endpoint(uint8_t slot_id, uint8_t endpoint, usb_device_types type, uint16_t packet_size){ if (slot_id >= devices.max_size()) return; USBDevice *dev = devices[slot_id]; if (dev) diff --git a/kernel/input/USBManager.hpp b/kernel/input/USBManager.hpp index efcb9830..1cf0d013 100644 --- a/kernel/input/USBManager.hpp +++ b/kernel/input/USBManager.hpp @@ -1,6 +1,6 @@ #pragma once #include "types.h" -#include "xhci_types.h" +#include "usb_types.h" #include "std/std.hpp" #include "USBDevice.hpp" @@ -12,7 +12,7 @@ class USBManager { IndexMap devices; void register_device(uint8_t address); - void register_endpoint(uint8_t slot_id, uint8_t endpoint, xhci_device_types type, uint16_t packet_size); + void register_endpoint(uint8_t slot_id, uint8_t endpoint, usb_device_types type, uint16_t packet_size); void request_data(uint8_t slot_id, uint8_t endpoint_id, USBDriver *driver); void process_data(uint8_t slot_id, uint8_t endpoint_id, USBDriver *driver); void poll_inputs(USBDriver *driver); diff --git a/kernel/input/dwc2.cpp b/kernel/input/dwc2.cpp index 5da780f6..99ccc72f 100644 --- a/kernel/input/dwc2.cpp +++ b/kernel/input/dwc2.cpp @@ -4,8 +4,9 @@ #include "memory/page_allocator.h" #include "std/string.h" #include "memory/mmu.h" +#include "hw/hw.h" -#define DWC2_BASE 0xFE980000 +#define DWC2_INT_DATA 0b11 dwc2_host_channel* DWC2Driver::get_channel(uint16_t channel){ return (dwc2_host_channel *)(DWC2_BASE + 0x500 + (channel * 0x20)); @@ -59,7 +60,7 @@ bool DWC2Driver::init() { if (!wait(&host->port, 1, true, 2000)){ kprintf("[DWC2] No device connected %x",host->port); - return false; + return true; } if (!port_reset(&host->port)){ @@ -154,7 +155,7 @@ bool DWC2Driver::request_sized_descriptor(uint8_t address, uint8_t endpoint, uin return true; } -bool DWC2Driver::configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, xhci_device_types type){ +bool DWC2Driver::configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, usb_device_types type){ uint8_t ep_address = endpoint->bEndpointAddress; uint8_t ep_num = ep_address & 0x0F; @@ -221,10 +222,12 @@ bool DWC2Driver::poll(uint8_t address, uint8_t endpoint, void *out_buf, uint16_t return false; } + bool found_input = (endpoint_channel->interrupt & DWC2_INT_DATA) == DWC2_INT_DATA; + endpoint_channel->interrupt = 0xFFFFFFFF; endpoint_channel->cchar &= ~(1 << 31); - return true; + return found_input; } void DWC2Driver::handle_hub_routing(uint8_t hub, uint8_t port){ diff --git a/kernel/input/dwc2.hpp b/kernel/input/dwc2.hpp index adabfe50..2b268076 100644 --- a/kernel/input/dwc2.hpp +++ b/kernel/input/dwc2.hpp @@ -2,7 +2,7 @@ #include "usb.hpp" #include "std/indexmap.hpp" -#include "xhci_types.h" +#include "usb_types.h" typedef struct { uint32_t gotgctl; @@ -49,7 +49,7 @@ class DWC2Driver: public USBDriver { bool init() override; bool request_sized_descriptor(uint8_t address, uint8_t endpoint, uint8_t rType, uint8_t request, uint8_t type, uint16_t descriptor_index, uint16_t wIndex, uint16_t descriptor_size, void *out_descriptor) override; uint8_t address_device(uint8_t address) override; - bool configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, xhci_device_types type) override; + bool configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, usb_device_types type) override; void handle_hub_routing(uint8_t hub, uint8_t port) override; bool poll(uint8_t address, uint8_t endpoint, void *out_buf, uint16_t size) override; void handle_interrupt() override; diff --git a/kernel/input/input_dispatch.cpp b/kernel/input/input_dispatch.cpp index 7f3993ec..6a4e5b55 100644 --- a/kernel/input/input_dispatch.cpp +++ b/kernel/input/input_dispatch.cpp @@ -5,6 +5,7 @@ #include "xhci.hpp" #include "hw/hw.h" #include "std/std.hpp" +#include "kernel_processes/kprocess_loader.h" process_t* focused_proc; @@ -14,13 +15,13 @@ typedef struct { bool triggered; } shortcut; -shortcut shortcuts[16]; +shortcut shortcuts[16] = {0}; uint16_t shortcut_count = 0; bool secure_mode = false; -USBDriver *input_driver; +USBDriver *input_driver = 0x0; void register_keypress(keypress kp) { if (!secure_mode){ @@ -51,7 +52,8 @@ uint16_t sys_subscribe_shortcut_current(keypress kp){ uint16_t sys_subscribe_shortcut(uint16_t pid, keypress kp){ shortcuts[shortcut_count] = (shortcut){ .kp = kp, - .pid = pid + .pid = pid, + .triggered = false }; return shortcut_count++; } @@ -88,8 +90,6 @@ bool is_new_keypress(keypress* current, keypress* previous) { } bool sys_read_input(int pid, keypress *out){ - if (BOARD_TYPE == 2) - input_driver->poll_inputs(); process_t *process = get_proc_by_pid(pid); if (process->input_buffer.read_index == process->input_buffer.write_index) return false; @@ -99,7 +99,8 @@ bool sys_read_input(int pid, keypress *out){ } bool sys_shortcut_triggered_current(uint16_t sid){ - return sys_shortcut_triggered(get_current_proc_pid(), sid); + bool value = sys_shortcut_triggered(get_current_proc_pid(), sid); + return value; } bool sys_shortcut_triggered(uint16_t pid, uint16_t sid){ @@ -111,7 +112,7 @@ bool sys_shortcut_triggered(uint16_t pid, uint16_t sid){ } bool input_init(){ - if (BOARD_TYPE == 2){ + if (BOARD_TYPE == 2 && RPI_BOARD != 5){ input_driver = new DWC2Driver();//TODO: QEMU & 3 Only return input_driver->init(); } else { @@ -120,6 +121,25 @@ bool input_init(){ } } +void input_process_poll(){ + while (1){ + input_driver->poll_inputs(); + } +} + +void input_process_fake_interrupts(){ + while (1){ + input_driver->handle_interrupt(); + } +} + +void init_input_process(){ + if (!input_driver->use_interrupts) + create_kernel_process("input_poll", &input_process_poll); + if (input_driver->quirk_simulate_interrupts) + create_kernel_process("input_int_mock", &input_process_fake_interrupts); +} + void handle_input_interrupt(){ if (input_driver->use_interrupts) input_driver->handle_interrupt(); } \ No newline at end of file diff --git a/kernel/input/input_dispatch.h b/kernel/input/input_dispatch.h index 9976c6ff..aa969517 100644 --- a/kernel/input/input_dispatch.h +++ b/kernel/input/input_dispatch.h @@ -29,6 +29,8 @@ bool input_init(); void handle_input_interrupt(); +void init_input_process(); + #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/kernel/input/usb.cpp b/kernel/input/usb.cpp index 1c7d658f..291f7851 100644 --- a/kernel/input/usb.cpp +++ b/kernel/input/usb.cpp @@ -3,7 +3,7 @@ #include "async.h" #include "std/string.h" #include "memory/page_allocator.h" -#include "xhci_types.h" +#include "usb_types.h" uint16_t USBDriver::packet_size(uint16_t speed){ switch (speed) { @@ -19,6 +19,10 @@ uint16_t USBDriver::packet_size(uint16_t speed){ bool USBDriver::setup_device(uint8_t address, uint16_t port){ address = address_device(address); + if (address == 0){ + kprintf("[USB error] failed to address device"); + return false; + } usb_device_descriptor* descriptor = (usb_device_descriptor*)allocate_in_page(mem_page, sizeof(usb_device_descriptor), ALIGN_64B, true, true); if (!request_descriptor(address, 0, 0x80, 6, USB_DEVICE_DESCRIPTOR, 0, 0, descriptor)){ @@ -102,7 +106,10 @@ bool USBDriver::get_configuration(uint8_t address){ uint8_t* report_descriptor; uint16_t report_length; - xhci_device_types dev_type; + usb_device_types dev_type; + + kprintf("[USB] set configuration %i for device %i", config->bConfigurationValue, address); + request_sized_descriptor(address, 0, 0, 9, 0, config->bConfigurationValue, 0, 0, 0); for (uint16_t i = 0; i < total_length;){ usb_descriptor_header* header = (usb_descriptor_header*)&config->data[i]; @@ -133,19 +140,22 @@ bool USBDriver::get_configuration(uint8_t address){ break; default: + dev_type = UNKNOWN; break; } interface_index++; break; } case 0x21: { //HID - usb_hid_descriptor *hid = (usb_hid_descriptor *)&config->data[i]; - for (uint8_t j = 0; j < hid->bNumDescriptors; j++){ - if (hid->descriptors[j].bDescriptorType == 0x22){//REPORT HID - report_length = hid->descriptors[j].wDescriptorLength; - report_descriptor = (uint8_t*)allocate_in_page(mem_page, report_length, ALIGN_64B, true, true); - request_descriptor(address, 0, 0x81, 6, 0x22, 0, interface_index-1, report_descriptor); - kprintf("[USB] retrieved report descriptor of length %i at %x", report_length, (uintptr_t)report_descriptor); + if (dev_type != UNKNOWN){ + usb_hid_descriptor *hid = (usb_hid_descriptor *)&config->data[i]; + for (uint8_t j = 0; j < hid->bNumDescriptors; j++){ + if (hid->descriptors[j].bDescriptorType == 0x22){//REPORT HID + report_length = hid->descriptors[j].wDescriptorLength; + report_descriptor = (uint8_t*)allocate_in_page(mem_page, report_length, ALIGN_64B, true, true); + request_descriptor(address, 0, 0x81, 6, 0x22, 0, interface_index-1, report_descriptor); + kprintf("[USB] retrieved report descriptor of length %i at %x", report_length, (uintptr_t)report_descriptor); + } } } break; @@ -153,7 +163,8 @@ bool USBDriver::get_configuration(uint8_t address){ case 0x5: {//Endpoint usb_endpoint_descriptor *endpoint = (usb_endpoint_descriptor*)&config->data[i]; - if (!configure_endpoint(address, endpoint, config->bConfigurationValue, dev_type)) return false; + if (dev_type != UNKNOWN) + configure_endpoint(address, endpoint, config->bConfigurationValue, dev_type); need_new_endpoint = true; break; diff --git a/kernel/input/usb.hpp b/kernel/input/usb.hpp index 7fbf1c4b..4f562665 100644 --- a/kernel/input/usb.hpp +++ b/kernel/input/usb.hpp @@ -2,7 +2,7 @@ #include "types.h" #include "keypress.h" -#include "xhci_types.h" +#include "usb_types.h" #include "USBManager.hpp" class USBDriver { @@ -16,12 +16,13 @@ class USBDriver { void hub_enumerate(uint8_t address); virtual bool setup_device(uint8_t address, uint16_t port); virtual uint8_t address_device(uint8_t address) = 0; - virtual bool configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, xhci_device_types type) = 0; + virtual bool configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, usb_device_types type) = 0; virtual void handle_hub_routing(uint8_t hub, uint8_t port) = 0; virtual bool poll(uint8_t address, uint8_t endpoint, void *out_buf, uint16_t size) = 0; void poll_inputs(); virtual void handle_interrupt() = 0; - bool use_interrupts; + bool use_interrupts = false; + bool quirk_simulate_interrupts = false; ~USBDriver() = default; protected: void *mem_page; diff --git a/kernel/input/usb_types.h b/kernel/input/usb_types.h new file mode 100644 index 00000000..02fded37 --- /dev/null +++ b/kernel/input/usb_types.h @@ -0,0 +1,105 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "types.h" + +#define INPUT_IRQ 36 + +typedef struct __attribute__((packed)) { + uint8_t bmRequestType; + uint8_t bRequest; + uint16_t wValue; + uint16_t wIndex; + uint16_t wLength; +} usb_setup_packet; + +typedef struct __attribute__((packed)) { + uint8_t bLength; + uint8_t bDescriptorType; +} usb_descriptor_header ; + +typedef struct __attribute__((packed)) { + usb_descriptor_header header; + uint16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint16_t idVendor; + uint16_t idProduct; + uint16_t bcdDevice; + uint8_t iManufacturer; + uint8_t iProduct; + uint8_t iSerialNumber; + uint8_t bNumConfigurations; +} usb_device_descriptor; + +typedef struct __attribute__((packed)) { + usb_descriptor_header header; + uint16_t wTotalLength; + uint8_t bNumInterfaces; + uint8_t bConfigurationValue; + uint8_t iConfiguration; + uint8_t bmAttributes; + uint8_t bMaxPower; + uint8_t data[255]; +} usb_configuration_descriptor; + +typedef struct __attribute__((packed)) { + usb_descriptor_header header; + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t bNumEndpoints; + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; + uint8_t iInterface; +} usb_interface_descriptor; + +typedef struct __attribute__((packed)) { + usb_descriptor_header header; + uint16_t bcdHID; + uint8_t bCountryCode; + uint8_t bNumDescriptors; + struct { + uint8_t bDescriptorType; + uint8_t wDescriptorLength; + }__attribute__((packed)) descriptors[1]; +//TODO: wDescriptorLength is supposed to be 16, but for some reason the descriptor from usb-kbd is 8. Will need to fix this once we do a real device +} usb_hid_descriptor; + +typedef struct __attribute__((packed)) { + usb_descriptor_header header; + uint8_t bEndpointAddress; + uint8_t bmAttributes; + uint8_t wMaxPacketSize; + uint8_t bInterval; +//TODO: wMaxPacketSize is supposed to be 16, but for some reason the descriptor from usb-kbd is 8. Will need to fix this once we do a real device +} usb_endpoint_descriptor; + +typedef struct __attribute__((packed)) { + usb_descriptor_header header; + uint16_t lang_ids[126]; +} usb_string_language_descriptor; + +typedef struct __attribute__((packed)){ + usb_descriptor_header header; + uint16_t unicode_string[126]; +} usb_string_descriptor; + +typedef enum { + UNKNOWN, + KEYBOARD, + MOUSE +} usb_device_types; + +#define USB_DEVICE_DESCRIPTOR 1 +#define USB_CONFIGURATION_DESCRIPTOR 2 +#define USB_STRING_DESCRIPTOR 3 + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/kernel/input/xhci.cpp b/kernel/input/xhci.cpp index a86d25d4..8b1101c9 100644 --- a/kernel/input/xhci.cpp +++ b/kernel/input/xhci.cpp @@ -3,10 +3,12 @@ #include "async.h" #include "usb.hpp" #include "pci.h" -#include "xhci_types.h" +#include "usb_types.h" #include "hw/hw.h" #include "memory/memory_access.h" #include "std/memfunctions.h" +#include "async.h" +#include "memory/memory_access.h" uint64_t awaited_addr; uint32_t awaited_type; @@ -16,8 +18,9 @@ uint32_t awaited_type; awaited_type = (type); \ interrupter->iman &= ~1; \ action; \ - await_response((uintptr_t)(addr), (type)); \ + bool response = await_response((uintptr_t)(addr), (type)); \ interrupter->iman |= 1; \ + response; \ }) #define kprintfv(fmt, ...) \ @@ -39,13 +42,33 @@ bool XHCIDriver::check_fatal_error() { #define CHECK_XHCI_FIELD(field) (op->field != 0 ? (kprintf_raw("[xHCI Error] wrong " #field " %x", op->field), false) : (kprintfv("[xHCI] Correct " #field " value"), true)) +#define XHCI_EP_TYPE_INT_IN 7 +#define XHCI_EP_TYPE_INT_OUT 3 +#define XHCI_EP_TYPE_ISO_IN 5 +#define XHCI_EP_TYPE_ISO_OUT 1 + +#define XHCI_SPEED_UNDEFINED 0 +#define XHCI_SPEED_FULL_SPEED 1 +#define XHCI_SPEED_LOW_SPEED 2 +#define XHCI_SPEED_HIGH_SPEED 3 +#define XHCI_SPEED_SUPER_SPEED 4 +#define XHCI_SPEED_SUPER_SPEED_PLUS 5 + +#define XHCI_EP_DISABLED 0 +#define XHCI_EP_CONTROL 4 + bool XHCIDriver::init(){ uint64_t addr, mmio, mmio_size; + bool use_pci = false; + use_interrupts = true; if (XHCI_BASE){ addr = XHCI_BASE; mmio = addr; - } else if (USE_PCI) { + if (BOARD_TYPE == 2 && RPI_BOARD >= 5) + quirk_simulate_interrupts = !pci_setup_msi_rp1(36, true); + } else if (PCI_BASE) { addr = find_pci_device(0x1B36, 0xD); + use_pci = true; } if (!addr){ kprintf_raw("[PCI] xHCI device not found"); @@ -53,55 +76,56 @@ bool XHCIDriver::init(){ } kprintfv("[xHCI] init"); - if (USE_PCI){ + if (use_pci){ if (!(*(uint16_t*)(addr + 0x06) & (1 << 4))){ - kprintfv("[xHCI] Wrong capabilities list"); + kprintf("[xHCI] Wrong capabilities list"); return false; } pci_enable_device(addr); if (!pci_setup_bar(addr, 0, &mmio, &mmio_size)){ - kprintfv("[xHCI] BARs not set up"); + kprintf("[xHCI] BARs not set up"); return false; } pci_register(mmio, mmio_size); - uint8_t interrupts_ok = pci_setup_interrupts(addr, XHCI_IRQ, 1); + uint8_t interrupts_ok = pci_setup_interrupts(addr, INPUT_IRQ, 1); switch(interrupts_ok){ case 0: - kprintf_raw("[xHCI] Failed to setup interrupts"); - return false; + kprintf("[xHCI] Failed to setup interrupts"); + quirk_simulate_interrupts = true; + break; case 1: - kprintf_raw("[xHCI] Interrupts setup with MSI-X %i",XHCI_IRQ); + kprintfv("[xHCI] Interrupts setup with MSI-X %i",INPUT_IRQ); break; default: - kprintf_raw("[xHCI] Interrupts setup with MSI %i",XHCI_IRQ); + kprintfv("[xHCI] Interrupts setup with MSI %i",INPUT_IRQ); break; } kprintfv("[xHCI] BARs set up @ %x (%x)",mmio,mmio_size); } - cap = (xhci_cap_regs*)(uintptr_t)mmio; + cap = (xhci_cap_regs*)mmio; kprintfv("[xHCI] caplength %x",cap->caplength); - uint64_t op_base = mmio + cap->caplength; - op = (xhci_op_regs*)(uintptr_t)op_base; - ports = (xhci_port_regs*)((uintptr_t)op_base + 0x400); + uintptr_t op_base = mmio + cap->caplength; + op = (xhci_op_regs*)op_base; + ports = (xhci_port_regs*)(op_base + 0x400); db_base = mmio + (cap->dboff & ~0x1F); rt_base = mmio + (cap->rtsoff & ~0x1F); kprintfv("[xHCI] Resetting controller"); op->usbcmd &= ~1; - while (op->usbcmd & 1); + wait(&op->usbcmd, 1, false, 16); kprintfv("[xHCI] Clear complete"); op->usbcmd |= (1 << 1); - while (op->usbcmd & 1); + wait(&op->usbcmd, 1 << 1, false, 1000); kprintfv("[xHCI] Reset complete"); - while (op->usbsts & (1 << 11)); + wait(&op->usbsts, 1 << 11, false, 1000); kprintfv("[xHCI] Device ready"); if (!CHECK_XHCI_FIELD(usbcmd)) return false; @@ -153,14 +177,16 @@ bool XHCIDriver::init(){ kprintfv("[xHCI] command ring allocated at %x. crcr now %x",(uintptr_t)command_ring.ring, op->crcr); - if (!enable_events()) + if (!enable_events()){ + kprintf("[xHCI error] failed to enable events"); return false; + } kprintfv("[xHCI] event configuration finished"); op->usbcmd |= (1 << 2);//Interrupt enable op->usbcmd |= 1;//Run - while ((op->usbsts & 0x1)); + wait (&op->usbsts, 0x1, false, 1000); endpoint_map = IndexMap(255 * 5); context_map = IndexMap(255 * 5); @@ -173,30 +199,32 @@ bool XHCIDriver::init(){ if (ports[i].portsc.ccs && ports[i].portsc.csc){ if (!port_reset(i)){ kprintf("[xHCI] Failed to reset port %i",i); - return false; + continue; } if (!setup_device(0,i)){ - kprintf_raw("[xHCI] Failed to configure device at port %i",i); - return false; + kprintf("[xHCI] Failed to configure device at port %i",i); } } - return true; } bool XHCIDriver::port_reset(uint16_t port){ + kprintf("[xHCI] port %i",port); + xhci_port_regs* port_info = &ports[port]; if (port_info->portsc.pp == 0){ port_info->portsc.pp = 1; + delay(20); + //Read back after delay to ensure - // if (port_info->portsc.pp == 0){ - // kprintf_raw("[xHCI error] failed to power on port %i",port); - // return false; - // } + if (port_info->portsc.pp == 0){ + kprintf_raw("[xHCI error] failed to power on port %i",port); + return false; + } } port_info->portsc.csc = 1; @@ -204,12 +232,23 @@ bool XHCIDriver::port_reset(uint16_t port){ port_info->portsc.prc = 1; //TODO: if usb3 - //portsc.wpr = 1; + // port_info->portsc.wpr = 1; //else - return AWAIT(0, { - port_info->portsc.pr = 1; - },TRB_TYPE_PORT_STATUS_CHANGE); + if (!AWAIT(0, { port_info->portsc.pr = 1; },TRB_TYPE_PORT_STATUS_CHANGE)){ + kprintf("[xHCI error] failed port reset"); + return false; + } + + port_info->portsc.prc = 1; + port_info->portsc.wrc = 1; + port_info->portsc.csc = 1; + port_info->portsc.pec = 1; + port_info->portsc.ped = 0; + + delay(300); + + return port_info->portsc.ped != 0; } bool XHCIDriver::enable_events(){ @@ -244,8 +283,6 @@ bool XHCIDriver::enable_events(){ op->usbsts = 1 << 3;//Enable interrupts interrupter->iman |= 1;//Clear pending interrupts - use_interrupts = true; - return !check_fatal_error(); } @@ -271,18 +308,19 @@ void XHCIDriver::ring_doorbell(uint32_t slot, uint32_t endpoint) { bool XHCIDriver::await_response(uint64_t command, uint32_t type){ while (1){ if (check_fatal_error()){ - kprintf_raw("[xHCI error] USBSTS value %x",op->usbsts); + kprintf("[xHCI error] USBSTS value %x",op->usbsts); awaited_type = 0; return false; } for (; event_ring.index < MAX_TRB_AMOUNT; event_ring.index++){ last_event = &event_ring.ring[event_ring.index]; if (!wait(&last_event->control, event_ring.cycle_bit, true, 2000)){ + kprintf("[xHCI error] Timeout awaiting response to %x command of type %x", command, type); awaited_type = 0; return false; } - // kprintf_raw("[xHCI] A response at %i of type %x as a response to %x",event_ring.index, (last_event->control & TRB_TYPE_MASK) >> 10, last_event->parameter); - // kprintf_raw("[xHCI] %x vs %x = %i and %x vs %x = %i", (ev->control & TRB_TYPE_MASK) >> 10, type, (ev->control & TRB_TYPE_MASK) >> 10 == type, ev->parameter, command, command == 0 || ev->parameter == command); + // kprintf("[xHCI] A response at %i of type %x as a response to %x",event_ring.index, (last_event->control & TRB_TYPE_MASK) >> 10, last_event->parameter); + // kprintf("[xHCI] %x vs %x = %i and %x vs %x = %i", (ev->control & TRB_TYPE_MASK) >> 10, type, (ev->control & TRB_TYPE_MASK) >> 10 == type, ev->parameter, command, command == 0 || ev->parameter == command); if (event_ring.index == MAX_TRB_AMOUNT - 1){ event_ring.index = 0; event_ring.cycle_bit = !event_ring.cycle_bit; @@ -351,11 +389,11 @@ bool XHCIDriver::setup_device(uint8_t address, uint16_t port){ ctx->device_context.slot_f0.context_entries = 1; ctx->device_context.slot_f1.root_hub_port_num = port + 1; - ctx->device_context.endpoints[0].endpoint_f0.endpoint_state = 0;//Disabled - ctx->device_context.endpoints[0].endpoint_f1.endpoint_type = 4;//Type = control + ctx->device_context.endpoints[0].endpoint_f0.endpoint_state = XHCI_EP_DISABLED; + ctx->device_context.endpoints[0].endpoint_f1.endpoint_type = XHCI_EP_CONTROL; ctx->device_context.endpoints[0].endpoint_f0.interval = 0; ctx->device_context.endpoints[0].endpoint_f1.error_count = 3; - ctx->device_context.endpoints[0].endpoint_f1.max_packet_size = packet_size(ctx->device_context.slot_f0.speed);//Packet size. Guessed from port speed + ctx->device_context.endpoints[0].endpoint_f1.max_packet_size = packet_size(ctx->device_context.slot_f0.speed); transfer_ring->ring = (trb*)allocate_in_page(mem_page, MAX_TRB_AMOUNT * sizeof(trb), ALIGN_64B, true, true); kprintfv("Transfer ring at %x %i",(uintptr_t)transfer_ring->ring, address << 8); @@ -379,6 +417,8 @@ bool XHCIDriver::request_sized_descriptor(uint8_t address, uint8_t endpoint, uin .wLength = descriptor_size }; + // kprintf("RT: %x R: %x V: %x I: %x L: %x",packet.bmRequestType,packet.bRequest,packet.wValue,packet.wIndex,packet.wLength); + bool is_in = (rType & 0x80) != 0; xhci_ring *transfer_ring = &endpoint_map[address << 8 | endpoint]; @@ -387,13 +427,15 @@ bool XHCIDriver::request_sized_descriptor(uint8_t address, uint8_t endpoint, uin memcpy(&setup_trb->parameter, &packet, sizeof(packet)); setup_trb->status = sizeof(usb_setup_packet); //bit 4 = chain. Bit 16 direction (3 = IN, 2 = OUT, 0 = NO DATA) - setup_trb->control = (3 << 16) | (TRB_TYPE_SETUP_STAGE << 10) | (1 << 6) | (1 << 4) | transfer_ring->cycle_bit; - - trb* data = &transfer_ring->ring[transfer_ring->index++]; - data->parameter = (uintptr_t)out_descriptor; - data->status = packet.wLength; - //bit 16 = direction - data->control = (1 << 16) | (TRB_TYPE_DATA_STAGE << 10) | (0 << 4) | transfer_ring->cycle_bit; + setup_trb->control = (3 << 16) | (TRB_TYPE_SETUP_STAGE << 10) | (1 << 6) | ((descriptor_size > 0) << 4) | transfer_ring->cycle_bit; + + if (descriptor_size > 0){ + trb* data = &transfer_ring->ring[transfer_ring->index++]; + data->parameter = (uintptr_t)out_descriptor; + data->status = packet.wLength; + //bit 16 = direction + data->control = (1 << 16) | (TRB_TYPE_DATA_STAGE << 10) | (0 << 4) | transfer_ring->cycle_bit; + } trb* status_trb = &transfer_ring->ring[transfer_ring->index++]; status_trb->parameter = 0; @@ -407,7 +449,7 @@ bool XHCIDriver::request_sized_descriptor(uint8_t address, uint8_t endpoint, uin transfer_ring->index = 0; } - return AWAIT((uintptr_t)status_trb, {ring_doorbell(address, 1);}, TRB_TYPE_TRANSFER); + return AWAIT(0, {ring_doorbell(address, 1);}, TRB_TYPE_TRANSFER);//TODO: Devices can respond with an error to any of the 3 stages } uint8_t XHCIDriver::address_device(uint8_t address){ @@ -427,23 +469,49 @@ uint8_t XHCIDriver::get_ep_type(usb_endpoint_descriptor* descriptor) { return (descriptor->bEndpointAddress & 0x80 ? 1 << 2 : 0) | (descriptor->bmAttributes & 0x3); } -bool XHCIDriver::configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, xhci_device_types type){ +uint32_t XHCIDriver::calculate_interval(uint32_t speed, uint32_t received_interval){ + if (speed >= XHCI_SPEED_HIGH_SPEED) + { + if (received_interval < 1) + received_interval = 1; + + if (received_interval > 16) + received_interval = 16; + + return received_interval-1; + } + + uint32_t i; + for (i = 3; i < 11; i++) + if (125 * (1 << i) >= 1000 * received_interval) break; + + return i; +} + +bool XHCIDriver::configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, usb_device_types type){ kprintfv("[xHCI] endpoint address %x",endpoint->bEndpointAddress); uint8_t ep_address = endpoint->bEndpointAddress; uint8_t ep_dir = (ep_address & 0x80) ? 1 : 0; // 1 IN, 0 OUT uint8_t ep_num = ((ep_address & 0x0F) * 2) + ep_dir; uint8_t ep_type = endpoint->bmAttributes & 0x03; // 0 = Control, 1 = Iso, 2 = Bulk, 3 = Interrupt + + if (ep_type != 3){ + kprintf("[xHCI implementation warning] Endpoint type %i not supported. Ignored",ep_type); + return true; + } kprintf_raw("[xHCI] endpoint %i info. Direction %i type %i",ep_num, ep_dir, ep_type); xhci_input_context* ctx = context_map[address << 8]; + xhci_device_context* context = (xhci_device_context*)dcbaap[address]; - ctx->control_context.add_flags = (1 << 0) | (1 << ep_num); - ctx->device_context.slot_f0.context_entries = 2; //2 entries: EP0 + EP1 - ctx->device_context.endpoints[ep_num-1].endpoint_f0.interval = endpoint->bInterval; + if (ep_num > ctx->device_context.slot_f0.context_entries) + ctx->device_context.slot_f0.context_entries = ep_num; + ctx->device_context.slot_f0.speed = context->slot_f0.speed; + ctx->device_context.endpoints[ep_num-1].endpoint_f0.interval = calculate_interval(context->slot_f0.speed, endpoint->bInterval); - ctx->device_context.endpoints[ep_num-1].endpoint_f0.endpoint_state = 0; + ctx->device_context.endpoints[ep_num-1].endpoint_f0.endpoint_state = XHCI_EP_DISABLED; ctx->device_context.endpoints[ep_num-1].endpoint_f1.endpoint_type = get_ep_type(endpoint); ctx->device_context.endpoints[ep_num-1].endpoint_f1.max_packet_size = endpoint->wMaxPacketSize; ctx->device_context.endpoints[ep_num-1].endpoint_f4.max_esit_payload_lo = endpoint->wMaxPacketSize; @@ -456,7 +524,7 @@ bool XHCIDriver::configure_endpoint(uint8_t address, usb_endpoint_descriptor *en make_ring_link(ep_ring->ring, ep_ring->cycle_bit); ctx->device_context.endpoints[ep_num-1].endpoint_f23.dcs = ep_ring->cycle_bit; ctx->device_context.endpoints[ep_num-1].endpoint_f23.ring_ptr = ((uintptr_t)ep_ring->ring) >> 4; - ctx->device_context.endpoints[ep_num-1].endpoint_f4.average_trb_length = 8; + ctx->device_context.endpoints[ep_num-1].endpoint_f4.average_trb_length = sizeof(trb); if (!issue_command((uintptr_t)ctx, 0, (address << 24) | (TRB_TYPE_CONFIG_EP << 10))){ kprintf_raw("[xHCI] Failed to configure endpoint %i for address %i",ep_num,address); @@ -501,19 +569,27 @@ void XHCIDriver::handle_interrupt(){ if (type == awaited_type && (awaited_addr == 0 || (awaited_addr & 0xFFFFFFFFFFFFFFFF) == addr)) return; kprintfv("[xHCI] >>> Unhandled interrupt %i %x",event_ring.index,type); - switch (type){ - case TRB_TYPE_TRANSFER: { - uint8_t slot_id = (ev->control & TRB_SLOT_MASK) >> 24; - uint8_t endpoint_id = (ev->control & TRB_ENDPOINT_MASK) >> 16; - kprintfv("Received input from slot %i endpoint %i",slot_id, endpoint_id); - - usb_manager->process_data(slot_id,endpoint_id, this); - break; - } - case TRB_TYPE_PORT_STATUS_CHANGE: { - kprintfv("[xHCI] Port status change. Ignored for now"); - break; + uint8_t completion_code = (ev->status >> 24) & 0xFF; + if (completion_code == 1 || completion_code == 4){ + switch (type){ + case TRB_TYPE_TRANSFER: { + uint8_t slot_id = (ev->control & TRB_SLOT_MASK) >> 24; + uint8_t endpoint_id = (ev->control & TRB_ENDPOINT_MASK) >> 16; + kprintfv("Received input from slot %i endpoint %i",slot_id, endpoint_id); + + if (completion_code == 4) + usb_manager->request_data(slot_id,endpoint_id,this); + else + usb_manager->process_data(slot_id,endpoint_id, this); + break; + } + case TRB_TYPE_PORT_STATUS_CHANGE: { + kprintfv("[xHCI] Port status change. Ignored for now"); + break; + } } + } else { + kprintf("[xHCI error] wrong status %i on command type %x", completion_code, ((ev->control & TRB_TYPE_MASK) >> 10)); } event_ring.index++; if (event_ring.index == MAX_TRB_AMOUNT - 1){ diff --git a/kernel/input/xhci.hpp b/kernel/input/xhci.hpp index 234bb97a..862f195d 100644 --- a/kernel/input/xhci.hpp +++ b/kernel/input/xhci.hpp @@ -1,7 +1,8 @@ #pragma once #include "usb.hpp" -#include "xhci_types.h" +#include "usb_types.h" +#include "xhci_types.hpp" typedef struct xhci_ring { trb* ring; @@ -15,7 +16,7 @@ class XHCIDriver : public USBDriver { bool init() override; bool request_sized_descriptor(uint8_t address, uint8_t endpoint, uint8_t rType, uint8_t request, uint8_t type, uint16_t descriptor_index, uint16_t wIndex, uint16_t descriptor_size, void *out_descriptor) override; uint8_t address_device(uint8_t address) override; - bool configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, xhci_device_types type) override; + bool configure_endpoint(uint8_t address, usb_endpoint_descriptor *endpoint, uint8_t configuration_value, usb_device_types type) override; void handle_hub_routing(uint8_t hub, uint8_t port) override; bool poll(uint8_t address, uint8_t endpoint, void *out_buf, uint16_t size) override; bool setup_device(uint8_t address, uint16_t port) override; @@ -31,6 +32,7 @@ class XHCIDriver : public USBDriver { void ring_doorbell(uint32_t slot, uint32_t endpoint); bool await_response(uint64_t command, uint32_t type); uint8_t get_ep_type(usb_endpoint_descriptor* descriptor); + uint32_t calculate_interval(uint32_t speed, uint32_t received_interval); void make_ring_link_control(trb* ring, bool cycle); void make_ring_link(trb* ring, bool cycle); diff --git a/kernel/input/xhci_types.h b/kernel/input/xhci_types.hpp similarity index 69% rename from kernel/input/xhci_types.h rename to kernel/input/xhci_types.hpp index 34484fac..b291d81b 100644 --- a/kernel/input/xhci_types.h +++ b/kernel/input/xhci_types.hpp @@ -1,9 +1,5 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - #include "types.h" #define TRB_TYPE_NORMAL 1 @@ -34,8 +30,6 @@ extern "C" { #define XHCI_USBSTS_HSE (1 << 2) #define XHCI_USBSTS_CE (1 << 12) -#define XHCI_IRQ 31 - typedef struct { uint64_t parameter; uint32_t status; @@ -95,10 +89,10 @@ typedef union { uint32_t wpr : 1; }; uint32_t value; -} portstatuscontrol; +} port_status_control; typedef struct { - portstatuscontrol portsc; + port_status_control portsc; uint32_t portpmsc; uint32_t portli; uint32_t rsvd; @@ -144,7 +138,11 @@ typedef struct { uint32_t drop_flags; uint32_t add_flags; uint64_t reserved[3]; +#if XHCI_CTX_SIZE == 64 + uint32_t pad[8]; +#endif }__attribute__((packed)) xhci_input_control_context; +static_assert(sizeof(xhci_input_control_context) == XHCI_CTX_SIZE); typedef union { @@ -247,108 +245,27 @@ typedef struct { slot_field2 slot_f2; slot_field3 slot_f3; uint32_t slot_rsvd[4]; +#if XHCI_CTX_SIZE == 64 + uint32_t pad[8]; +#endif struct { endpoint_field0 endpoint_f0; endpoint_field1 endpoint_f1; endpoint_field23 endpoint_f23; endpoint_field4 endpoint_f4; uint32_t ep_rsvd[3]; - } endpoints[31]; -} xhci_device_context; +#if XHCI_CTX_SIZE == 64 + uint32_t pad[8]; +#endif + }__attribute__((packed)) endpoints[31]; +}__attribute__((packed)) xhci_device_context; +static_assert(sizeof(xhci_device_context) == XHCI_CTX_SIZE * 32); typedef struct { xhci_input_control_context control_context; xhci_device_context device_context; } xhci_input_context; -typedef struct __attribute__((packed)) { - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -} usb_setup_packet; - -typedef struct __attribute__((packed)) { - uint8_t bLength; - uint8_t bDescriptorType; -} usb_descriptor_header ; - -typedef struct __attribute__((packed)) { - usb_descriptor_header header; - uint16_t bcdUSB; - uint8_t bDeviceClass; - uint8_t bDeviceSubClass; - uint8_t bDeviceProtocol; - uint8_t bMaxPacketSize0; - uint16_t idVendor; - uint16_t idProduct; - uint16_t bcdDevice; - uint8_t iManufacturer; - uint8_t iProduct; - uint8_t iSerialNumber; - uint8_t bNumConfigurations; -} usb_device_descriptor; - -typedef struct __attribute__((packed)) { - usb_descriptor_header header; - uint16_t wTotalLength; - uint8_t bNumInterfaces; - uint8_t bConfigurationValue; - uint8_t iConfiguration; - uint8_t bmAttributes; - uint8_t bMaxPower; - uint8_t data[255]; -} usb_configuration_descriptor; - -typedef struct __attribute__((packed)) { - usb_descriptor_header header; - uint8_t bInterfaceNumber; - uint8_t bAlternateSetting; - uint8_t bNumEndpoints; - uint8_t bInterfaceClass; - uint8_t bInterfaceSubClass; - uint8_t bInterfaceProtocol; - uint8_t iInterface; -} usb_interface_descriptor; - -typedef struct __attribute__((packed)) { - usb_descriptor_header header; - uint16_t bcdHID; - uint8_t bCountryCode; - uint8_t bNumDescriptors; - struct { - uint8_t bDescriptorType; - uint8_t wDescriptorLength; - }__attribute__((packed)) descriptors[1]; -//TODO: wDescriptorLength is supposed to be 16, but for some reason the descriptor from usb-kbd is 8. Will need to fix this once we do a real device -} usb_hid_descriptor; - -typedef struct __attribute__((packed)) { - usb_descriptor_header header; - uint8_t bEndpointAddress; - uint8_t bmAttributes; - uint8_t wMaxPacketSize; - uint8_t bInterval; -//TODO: wMaxPacketSize is supposed to be 16, but for some reason the descriptor from usb-kbd is 8. Will need to fix this once we do a real device -} usb_endpoint_descriptor; - -typedef struct __attribute__((packed)) { - usb_descriptor_header header; - uint16_t lang_ids[126]; -} usb_string_language_descriptor; - -typedef struct __attribute__((packed)){ - usb_descriptor_header header; - uint16_t unicode_string[126]; -} usb_string_descriptor; - -typedef enum { - NONE, - KEYBOARD, - MOUSE -} xhci_device_types; - typedef struct { uint8_t transfer_cycle_bit; uint32_t transfer_index; @@ -358,7 +275,7 @@ typedef struct { } xhci_usb_device; typedef struct { - xhci_device_types type; + usb_device_types type; trb* endpoint_transfer_ring; uint32_t endpoint_transfer_index; uint8_t endpoint_transfer_cycle_bit; @@ -367,12 +284,4 @@ typedef struct { uint8_t poll_endpoint; uint16_t report_length; uint8_t *report_descriptor; - } xhci_usb_device_endpoint; - -#define USB_DEVICE_DESCRIPTOR 1 -#define USB_CONFIGURATION_DESCRIPTOR 2 -#define USB_STRING_DESCRIPTOR 3 - -#ifdef __cplusplus -} -#endif \ No newline at end of file + } xhci_usb_device_endpoint; \ No newline at end of file diff --git a/kernel/kernel.c b/kernel/kernel.c index 5c3c37c2..34e58048 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -13,7 +13,6 @@ #include "filesystem/disk.h" #include "kernel_processes/boot/bootprocess.h" #include "input/input_dispatch.h" -#include "kernel_processes/monitor/monitor_processes.h" #include "networking/processes/net_proc.h" #include "memory/page_allocator.h" #include "networking/network.h" @@ -28,11 +27,12 @@ void kernel_main() { enable_uart(); kprintf_l("UART output enabled"); // enable_talloc_verbose(); + uint64_t seed; - asm volatile("mrs %0, cntvct_el0" : "=r"(seed)); //virtual timer counter as entropy source for rng seed + asm volatile("mrs %0, cntvct_el0" : "=r"(seed)); rng_init_global(seed); kprintf("Random init. seed: %i\n", seed); - //kprintf("Next32: %i\n", rng_next32(&global_rng)); + set_exception_vectors(); kprintf_l("Exception vectors set"); @@ -59,6 +59,9 @@ void kernel_main() { kprintf("GPU initialized"); kprintf("Initializing disk..."); + + if (BOARD_TYPE == 2 && RPI_BOARD >= 5) + pci_setup_rp1(); // disk_verbose(); if (!find_disk()) @@ -69,6 +72,7 @@ void kernel_main() { panic("Input initialization error"); bool network_available = network_init(); + init_input_process(); mmu_init(); kprintf_l("MMU Mapped"); @@ -86,9 +90,8 @@ void kernel_main() { kprintf_l("Starting scheduler"); - disable_interrupt(); start_scheduler(); panic("Kernel did not activate any process"); -} +} \ No newline at end of file diff --git a/kernel/kernel_processes/boot/bootprocess.cpp b/kernel/kernel_processes/boot/bootprocess.cpp index 3860de55..b18528a6 100644 --- a/kernel/kernel_processes/boot/bootprocess.cpp +++ b/kernel/kernel_processes/boot/bootprocess.cpp @@ -3,15 +3,16 @@ #include "../kprocess_loader.h" #include "console/kio.h" -BootSM state_machine; +BootSM *state_machine; extern "C" __attribute__((section(".text.kcoreprocesses"))) void eval_bootscreen() { while (1){ - state_machine.eval_state(); + state_machine->eval_state(); } } extern "C" void init_bootprocess() { + state_machine = new BootSM(); create_kernel_process("bootsm",eval_bootscreen); - state_machine.initialize(); + state_machine->initialize(); } diff --git a/kernel/kernel_processes/boot/bootprocess_sm.cpp b/kernel/kernel_processes/boot/bootprocess_sm.cpp index 761f337e..6a590036 100644 --- a/kernel/kernel_processes/boot/bootprocess_sm.cpp +++ b/kernel/kernel_processes/boot/bootprocess_sm.cpp @@ -13,7 +13,7 @@ void BootSM::initialize(){ } BootSM::BootStates BootSM::eval_state(){ - if (current_proc->state == process_t::process_state::STOPPED) + if (!current_proc || current_proc->state == process_t::process_state::STOPPED) AdvanceToState(GetNextState()); return current_state; diff --git a/kernel/kernel_processes/boot/bootscreen.c b/kernel/kernel_processes/boot/bootscreen.c index fd648315..25b9f32d 100644 --- a/kernel/kernel_processes/boot/bootscreen.c +++ b/kernel/kernel_processes/boot/bootscreen.c @@ -21,7 +21,7 @@ void boot_draw_name(gpu_point screen_middle,int xoffset, int yoffset){ int xo = screen_middle.x - mid_offset + xoffset; int yo = screen_middle.y + yoffset; gpu_fill_rect((gpu_rect){{xo,yo}, {char_size * (s.length/BOOTSCREEN_NUM_LINES), char_size * BOOTSCREEN_NUM_LINES}},BG_COLOR); - gpu_draw_string(s, (gpu_point){xo, yo}, scale, 0xFFFFFF); + gpu_draw_string(s, (gpu_point){xo, yo}, scale, 0xFFFFFFFF); free(s.data,s.mem_length); } @@ -76,7 +76,7 @@ void boot_draw_lines(gpu_point current_point, gpu_point next_point, gpu_size siz lerp(i, ccurrent.x, cnext.x, csteps), lerp(i, ccurrent.y, cnext.y, csteps) }; - gpu_draw_pixel(interpolated, 0xFFFFFF); + gpu_draw_pixel(interpolated, 0xFFFFFFFF); } } keypress kp; @@ -85,7 +85,6 @@ void boot_draw_lines(gpu_point current_point, gpu_point next_point, gpu_size siz stop_current_process(); } gpu_flush(); - // sleep(0); } } diff --git a/kernel/kernel_processes/boot/login_screen.c b/kernel/kernel_processes/boot/login_screen.c index 45f842eb..8d8f8c49 100644 --- a/kernel/kernel_processes/boot/login_screen.c +++ b/kernel/kernel_processes/boot/login_screen.c @@ -10,6 +10,7 @@ #include "std/string.h" #include "syscalls/syscalls.h" +//TODO: properly handle keypad static const char hid_keycode_to_char[256] = { [0x04] = 'a', [0x05] = 'b', [0x06] = 'c', [0x07] = 'd', [0x08] = 'e', [0x09] = 'f', [0x0A] = 'g', [0x0B] = 'h', @@ -24,7 +25,7 @@ static const char hid_keycode_to_char[256] = { [0x28] = '\n', [0x2C] = ' ', [0x2D] = '-', [0x2E] = '=', [0x2F] = '[', [0x30] = ']', [0x31] = '\\', [0x33] = ';', [0x34] = '\'', [0x35] = '`', [0x36] = ',', [0x37] = '.', - [0x38] = '/', + [0x38] = '/', [0x58] = '\n', }; bool keypress_contains(keypress *kp, char key, uint8_t modifier){ @@ -46,9 +47,9 @@ void login_screen(){ const char* name = BOOTSCREEN_TEXT; string title = string_l(name); string subtitle = string_l("Login"); + gpu_clear(BG_COLOR); while (1) { - gpu_clear(BG_COLOR); gpu_size screen_size = gpu_get_screen_size(); gpu_point screen_middle = {screen_size.width/2,screen_size.height/2}; string s = string_repeat('*',min(len,20)); @@ -58,17 +59,17 @@ void login_screen(){ int yo = screen_middle.y; int height = char_size * 2; - gpu_draw_string(title, (gpu_point){screen_middle.x - ((title.length/2) * char_size), yo - char_size*9}, scale, 0xFFFFFF); - gpu_draw_string(subtitle, (gpu_point){screen_middle.x - ((subtitle.length/2) * char_size), yo - char_size*6}, scale, 0xFFFFFF); + gpu_draw_string(title, (gpu_point){screen_middle.x - ((title.length/2) * char_size), yo - char_size*9}, scale, 0xFFFFFFFF); + gpu_draw_string(subtitle, (gpu_point){screen_middle.x - ((subtitle.length/2) * char_size), yo - char_size*6}, scale, 0xFFFFFFFF); gpu_fill_rect((gpu_rect){{xo,yo - char_size/2}, {screen_size.width / 3, height}},BG_COLOR+0x111111); - gpu_draw_string(s, (gpu_point){xo, yo}, scale, 0xFFFFFF); + gpu_draw_string(s, (gpu_point){xo, yo}, scale, 0xFFFFFFFF); keypress kp; if (sys_read_input_current(&kp)){ for (int i = 0; i < 6; i++){ char key = kp.keys[i]; if (hid_keycode_to_char[(uint8_t)key]){ - if (key == KEY_ENTER){ + if (key == KEY_ENTER || key == KEY_KEYPAD_ENTER){ if (strcmp(buf,default_pwd, false) == 0){ free(s.data,s.mem_length); free(title.data,title.mem_length); diff --git a/kernel/kernel_processes/monitor/monitor_processes.c b/kernel/kernel_processes/monitor/monitor_processes.c index 18149b56..bcca64e7 100644 --- a/kernel/kernel_processes/monitor/monitor_processes.c +++ b/kernel/kernel_processes/monitor/monitor_processes.c @@ -170,5 +170,10 @@ void monitor_procs(){ } process_t* start_process_monitor(){ +#if QEMU return create_kernel_process("procmonitor",monitor_procs); +#else + //TODO: disabled process monitor since shortcuts seem broken on rpi + return 0x0;//create_kernel_process("procmonitor",monitor_procs); +#endif } \ No newline at end of file diff --git a/kernel/kernel_processes/windows/desktop.cpp b/kernel/kernel_processes/windows/desktop.cpp index 85884f3b..bb99ffc1 100644 --- a/kernel/kernel_processes/windows/desktop.cpp +++ b/kernel/kernel_processes/windows/desktop.cpp @@ -59,10 +59,9 @@ void Desktop::draw_desktop(){ keypress kp; gpu_point old_selected = selected; while (sys_read_input_current(&kp)){ - //TODO: there's a crash when moving in the desktop with no processes loaded. Memcpy for (int i = 0; i < 6; i++){ char key = kp.keys[i]; - if (key == KEY_ENTER){ + if (key == KEY_ENTER || key == KEY_KEYPAD_ENTER){ activate_current(); return; } @@ -150,7 +149,7 @@ void Desktop::draw_tile(uint32_t column, uint32_t row){ single_label->set_text(namestr); single_label->set_bg_color(BG_COLOR+0x111111); - single_label->set_text_color(0xFFFFFF); + single_label->set_text_color(0xFFFFFFFF); single_label->set_font_size(3); single_label->rect = inner_rect; single_label->set_alignment(HorizontalAlignment::HorizontalCenter, VerticalAlignment::VerticalCenter); @@ -158,7 +157,7 @@ void Desktop::draw_tile(uint32_t column, uint32_t row){ extension_label->set_text(extstr); extension_label->set_bg_color(BG_COLOR+0x111111); - extension_label->set_text_color(0xFFFFFF); + extension_label->set_text_color(0xFFFFFFFF); extension_label->set_font_size(1); extension_label->rect = (gpu_rect){10 + ((tile_size.width + 10)*column)+ (sel ? border*2 : border), 50 + ((tile_size.height + 10) *row) + (sel ? border*2 : border), 1, 1}; extension_label->set_alignment(HorizontalAlignment::Leading, VerticalAlignment::Top); diff --git a/kernel/kstring.c b/kernel/kstring.c index 3cfe197b..e4157794 100644 --- a/kernel/kstring.c +++ b/kernel/kstring.c @@ -5,69 +5,87 @@ #include "std/memfunctions.h" //TODO: we can most likely get rid of this class now and use string entirely -static uint32_t compute_length(const char *s, uint32_t max_length) { +static uint32_t compute_length(const char *s, uint32_t max_length){ + if (s == NULL) return 0; + uint32_t len = 0; - while ((max_length == 0 || len < max_length) && s[len] != '\0') { - len++; - } + while ((max_length == 0 || len < max_length) && s[len] != '\0') len++; + return len; } -kstring kstring_l(const char *literal) { +kstring kstring_l(const char *literal){ + + if (literal == NULL) return (kstring){.data = NULL, .length = 0}; + uint32_t len = compute_length(literal, 0); - char *buf = (char*)talloc(len+1); - for (uint32_t i = 0; i < len; i++) - buf[i] = literal[i]; - buf[len] = 0; - return (kstring){ .data = buf, .length = len }; + char *buf = (char*)talloc(len + 1); + if (!buf) return (kstring){ .data = NULL, .length = 0}; + + for (uint32_t i = 0; i < len; i++) buf[i] = literal[i]; + + buf[len] = '\0'; + return (kstring){.data = buf, .length = len}; } kstring kstring_repeat(char symbol, uint32_t amount){ char *buf = (char*)talloc(amount + 1); + if(!buf) return (kstring){ .data = NULL, .length = 0}; + memset(buf, symbol, amount); - buf[amount] = 0; - return (kstring){ .data = buf, .length = amount }; + buf[amount] = '\0'; + return (kstring){.data = buf, .length = amount}; } kstring kstring_tail(const char *array, uint32_t max_length){ + if (array == NULL) return (kstring){.data = NULL, .length = 0}; + uint32_t len = compute_length(array, 0); - int offset = len-max_length; - if (offset < 0) - offset = 0; + int offset = (int)len - (int)max_length; + if (offset < 0) offset = 0; + uint32_t adjusted_len = len - offset; - char *buf = (char*)talloc(adjusted_len + 1); - for (uint32_t i = offset; i < len; i++) - buf[i-offset] = array[i]; - buf[len-offset] = 0; - return (kstring){ .data = buf, .length = adjusted_len }; + char *buf = (char*)talloc(adjusted_len+1); + if (!buf) return (kstring){.data = NULL, .length = 0}; + + for (uint32_t i = 0; i < adjusted_len; i++) buf[i] = array[offset + i]; + + buf[adjusted_len] = '\0'; + return (kstring){ .data = buf, .length = adjusted_len}; } -kstring kstring_ca_max(const char *array, uint32_t max_length) { - uint32_t len = compute_length(array, max_length); - char *buf = (char*)talloc(len + 1); - for (uint32_t i = 0; i < len; i++) - buf[i] = array[i]; - buf[len] = 0; - return (kstring){ .data = buf, .length = len }; +kstring kstring_ca_max(const char *array, uint32_t max_length){ + if(array == NULL) return (kstring){ .data = NULL, .length = 0 }; + + uint32_t len=compute_length(array, max_length); + char *buf = (char*)talloc(len+1); + if(!buf) return (kstring){.data = NULL, .length = 0}; + + for(uint32_t i = 0; i < len; i++) buf[i] = array[i]; + + buf[len] = '\0'; + return (kstring){.data = buf, .length = len}; } kstring kstring_c(const char c){ char *buf = (char*)talloc(2); + if(!buf) return (kstring){ .data = NULL, .length = 0 }; + buf[0] = c; - buf[1] = 0; - return (kstring){ .data = buf, .length = 1 }; + buf[1] = '\0'; + return (kstring){.data = buf, .length = 1}; } -kstring kstring_from_hex(uint64_t value) { +kstring kstring_from_hex(uint64_t value){ char *buf = (char*)talloc(18); uint32_t len = 0; buf[len++] = '0'; buf[len++] = 'x'; bool started = false; - for (uint32_t i = 60;; i -= 4) { - uint8_t nibble = (value >> i) & 0xF; - char curr_char = nibble < 10 ? '0' + nibble : 'A' + (nibble - 10); + for (uint32_t i = 60;; i -= 4){ + uint8_t nibble = (value>>i)&0xF; + char curr_char = nibble < 10 ? '0' + nibble : 'A'+(nibble - 10); if (started || curr_char != '0' || i == 0) { started = true; buf[len++] = curr_char; @@ -76,82 +94,99 @@ kstring kstring_from_hex(uint64_t value) { } buf[len] = 0; - return (kstring){ .data = buf, .length = len }; + return (kstring){.data = buf, .length = len}; } -kstring kstring_from_bin(uint64_t value) { +kstring kstring_from_bin(uint64_t value){ char *buf = (char*)talloc(67); uint32_t len = 0; buf[len++] = '0'; buf[len++] = 'b'; bool started = false; - for (uint32_t i = 60;; i --) { + for (uint32_t i = 60;; i--){ char bit = (value >> i) & 1 ? '1' : '0'; - if (started || bit != '0' || i == 0) { + if (started || bit != '0' || i == 0){ started = true; buf[len++] = bit; } if (i == 0) break; } - buf[len] = 0; return (kstring){ .data = buf, .length = len }; } -bool kstring_equals(kstring a, kstring b) { - return strcmp(a.data,b.data, false) == 0; +bool kstring_equals(kstring a, kstring b){ + return strcmp(a.data, b.data, false) == 0; } -kstring kstring_format_args(const char *fmt, const uint64_t *args, uint32_t arg_count) { +kstring kstring_format_args(const char *fmt, const uint64_t *args, uint32_t arg_count){ + if(fmt == NULL) return (kstring){ .data = NULL, .length = 0 }; + + if(arg_count > 0 && args == NULL) return (kstring){ .data = NULL, .length = 0 }; + char *buf = (char*)talloc(256); + if (!buf) return (kstring){ .data = NULL, .length = 0 }; + uint32_t len = 0; uint32_t arg_index = 0; - - for (uint32_t i = 0; fmt[i] && len < 255; i++) { - if (fmt[i] == '%' && fmt[i+1]) { + for (uint32_t i = 0; fmt[i] && len < 255; i++){ + if (fmt[i] == '%' && fmt[i + 1]) { i++; - if (arg_index >= arg_count) break; - if (fmt[i] == 'x') { + if (arg_index >= arg_count){ + buf[len++] = '%'; + buf[len++] = fmt[i]; + continue; + } + switch(fmt[i]){ + case 'x': { uint64_t val = args[arg_index++]; kstring hex = kstring_from_hex(val); for (uint32_t j = 0; j < hex.length && len < 255; j++) buf[len++] = hex.data[j]; - temp_free(hex.data,hex.length); - } else if (fmt[i] == 'b') { + temp_free(hex.data, hex.length); + break; + } + case 'b': { uint64_t val = args[arg_index++]; kstring bin = kstring_from_bin(val); for (uint32_t j = 0; j < bin.length && len < 255; j++) buf[len++] = bin.data[j]; - temp_free(bin.data,bin.length); - } else if (fmt[i] == 'c') { + temp_free(bin.data, bin.length); + break; + } + case 'c': { uint64_t val = args[arg_index++]; buf[len++] = (char)val; - } else if (fmt[i] == 's') { + break; + } + case 's': { const char *str = (const char *)(uintptr_t)args[arg_index++]; - for (uint32_t j = 0; str[j] && len < 255; j++) buf[len++] = str[j]; - } else if (fmt[i] == 'i') { + if (str){ + for (uint32_t j = 0; str[j] && len < 255; j++) buf[len++] = str[j]; + } + break; + } + case 'i': { uint64_t val = args[arg_index++]; char temp[21]; uint32_t temp_len = 0; bool negative = false; - - if ((int)val < 0) { + if ((int64_t)val < 0){ negative = true; - val = (uint64_t)(-(int)val); + val = (uint64_t)(-(int64_t)val); } - do { temp[temp_len++] = '0' + (val % 10); val /= 10; - } while (val && temp_len < 20); - - if (negative && temp_len < 20) { + } while (val && temp_len < sizeof(temp)-1); + if (negative && temp_len < sizeof(temp)-1){ temp[temp_len++] = '-'; } - - for (int j = temp_len - 1; j >= 0 && len < 255; j--) { + for (int j = temp_len - 1; j >= 0 && len < 255; j--){ buf[len++] = temp[j]; } - } else { + break; + } + default: buf[len++] = '%'; buf[len++] = fmt[i]; } @@ -159,7 +194,6 @@ kstring kstring_format_args(const char *fmt, const uint64_t *args, uint32_t arg_ buf[len++] = fmt[i]; } } - - buf[len] = 0; + buf[len] = '\0'; return (kstring){ .data = buf, .length = len }; -} \ No newline at end of file +} diff --git a/kernel/mailbox/mailbox.c b/kernel/mailbox/mailbox.c index ac52f2e1..89772770 100644 --- a/kernel/mailbox/mailbox.c +++ b/kernel/mailbox/mailbox.c @@ -11,5 +11,6 @@ int mailbox_call(volatile uint32_t* mbox, uint8_t channel) { uint32_t resp = MBOX_READ; if ((resp & 0xF) == channel && (resp & ~0xF) == addr) return mbox[1] == 0x80000000; + else return false; } } \ No newline at end of file diff --git a/kernel/mailbox/mailbox.h b/kernel/mailbox/mailbox.h index bd28d6c7..ccf7924e 100644 --- a/kernel/mailbox/mailbox.h +++ b/kernel/mailbox/mailbox.h @@ -3,8 +3,6 @@ #include "types.h" #include "hw/hw.h" -#define MAILBOX_BASE (MMIO_BASE + 0xB880) - #define MBOX_READ (*(volatile uint32_t*)(MAILBOX_BASE + 0x00)) #define MBOX_STATUS (*(volatile uint32_t*)(MAILBOX_BASE + 0x18)) #define MBOX_WRITE (*(volatile uint32_t*)(MAILBOX_BASE + 0x20)) @@ -12,6 +10,20 @@ #define MBOX_FULL 0x80000000 #define MBOX_EMPTY 0x40000000 +#define MBOX_VC_BASE 0x40000 +#define MBOX_VC_FRAMEBUFFER_TAG (MBOX_VC_BASE + 0x1) +#define MBOX_VC_PHYS_SIZE_TAG (MBOX_VC_BASE + 0x3) +#define MBOX_VC_VIRT_SIZE_TAG (MBOX_VC_BASE + 0x4) +#define MBOX_VC_DEPTH_TAG (MBOX_VC_BASE + 0x5) +#define MBOX_VC_FORMAT_TAG (MBOX_VC_BASE + 0x6) +#define MBOX_VC_ALPHA_TAG (MBOX_VC_BASE + 0x7) +#define MBOX_VC_PITCH_TAG (MBOX_VC_BASE + 0x8) +#define MBOX_VC_OFFSET_TAG (MBOX_VC_BASE + 0x9) + +#define MBOX_CLKRATE_TAG 0x30002 + +#define MBOX_SET_VALUE 0x8000 + #ifdef __cplusplus extern "C" { #endif diff --git a/kernel/memory/memory_access.c b/kernel/memory/memory_access.c index 8c97971d..7d238272 100644 --- a/kernel/memory/memory_access.c +++ b/kernel/memory/memory_access.c @@ -38,4 +38,22 @@ void write(uint64_t addr, uint64_t value) { uint64_t read(uint64_t addr) { return read64(addr); +} + +uint16_t read_unaligned16(const uint16_t *up) { + uint8_t *p = (uint8_t*)up; + return (uint16_t)p[0] | ((uint16_t)p[1] << 8); +} + +uint32_t read_unaligned32(const uint32_t *up) { + uint8_t *p = (uint8_t*)up; + return (uint32_t)p[0] | ((uint32_t)p[1] << 8) | ((uint32_t)p[2] << 16) | ((uint32_t)p[3] << 24); +} + +void write_unaligned32(uint32_t *up, uint32_t value) { + uint8_t *p = (uint8_t*)up; + p[0] = (uint8_t)(value & 0xFF); + p[1] = (uint8_t)((value >> 8) & 0xFF); + p[2] = (uint8_t)((value >> 16) & 0xFF); + p[3] = (uint8_t)((value >> 24) & 0xFF); } \ No newline at end of file diff --git a/kernel/memory/memory_access.h b/kernel/memory/memory_access.h index cb17e1af..abd0533d 100644 --- a/kernel/memory/memory_access.h +++ b/kernel/memory/memory_access.h @@ -12,4 +12,16 @@ uint64_t read64(uintptr_t addr); void write64(uintptr_t addr, uint64_t value); void write(uint64_t addr, uint64_t value); uint64_t read(uint64_t addr); -void write_barrier(); \ No newline at end of file +void write_barrier(); + +#ifdef __cplusplus +extern "C" { +#endif + +uint16_t read_unaligned16(const uint16_t *p); +uint32_t read_unaligned32(const uint32_t *p); +void write_unaligned32(uint32_t *p, uint32_t value); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/kernel/memory/mmu.c b/kernel/memory/mmu.c index 046beb27..1ecb6fdc 100644 --- a/kernel/memory/mmu.c +++ b/kernel/memory/mmu.c @@ -16,12 +16,18 @@ #define PD_TABLE 0b11 #define PD_BLOCK 0b01 -#define PD_ACCESS (1 << 10) + +#define UXN_BIT 54 +#define PXN_BIT 53 +#define AF_BIT 10 +#define SH_BIT 8 +#define AP_BIT 6 +#define MAIR_BIT 2 #define PAGE_TABLE_ENTRIES 512 #define PAGE_SIZE PAGE_TABLE_ENTRIES * 8 -uint64_t page_table_l1[PAGE_TABLE_ENTRIES] __attribute__((aligned(PAGE_SIZE))); +uint64_t page_table_l0[PAGE_TABLE_ENTRIES] __attribute__((aligned(PAGE_SIZE))); static bool mmu_verbose; @@ -38,72 +44,66 @@ void mmu_enable_verbose(){ }) void mmu_map_2mb(uint64_t va, uint64_t pa, uint64_t attr_index) { - uint64_t l1_index = (va >> 37) & 0x1FF; - uint64_t l2_index = (va >> 30) & 0x1FF; - uint64_t l3_index = (va >> 21) & 0x1FF; + uint64_t l0_index = (va >> 39) & 0x1FF; + uint64_t l1_index = (va >> 30) & 0x1FF; + uint64_t l2_index = (va >> 21) & 0x1FF; - kprintfv("[MMU] Mapping 2mb memory %x at [%i][%i][%i] for EL1", va, l1_index,l2_index,l3_index); + kprintfv("[MMU] Mapping 2mb memory %x at [%i][%i][%i] for EL1", va, l0_index,l1_index,l2_index); - if (!(page_table_l1[l1_index] & 1)) { - uint64_t* l2 = (uint64_t*)talloc(PAGE_SIZE); - for (int i = 0; i < PAGE_TABLE_ENTRIES; i++) l2[i] = 0; - page_table_l1[l1_index] = ((uint64_t)l2 & 0xFFFFFFFFF000ULL) | PD_TABLE; + if (!(page_table_l0[l0_index] & 1)) { + uint64_t* l1 = (uint64_t*)talloc(PAGE_SIZE); + page_table_l0[l0_index] = ((uint64_t)l1 & 0xFFFFFFFFF000ULL) | PD_TABLE; } - uint64_t* l2 = (uint64_t*)(page_table_l1[l1_index] & 0xFFFFFFFFF000ULL); + uint64_t* l1 = (uint64_t*)(page_table_l0[l0_index] & 0xFFFFFFFFF000ULL); - if (!(l2[l2_index] & 1)) { - uint64_t* l3 = (uint64_t*)talloc(PAGE_SIZE); - for (int i = 0; i < PAGE_TABLE_ENTRIES; i++) l3[i] = 0; - l2[l2_index] = ((uint64_t)l3 & 0xFFFFFFFFF000ULL) | PD_TABLE; + if (!(l1[l1_index] & 1)) { + uint64_t* l2 = (uint64_t*)talloc(PAGE_SIZE); + l1[l1_index] = ((uint64_t)l2 & 0xFFFFFFFFF000ULL) | PD_TABLE; } - uint64_t* l3 = (uint64_t*)(l2[l2_index] & 0xFFFFFFFFF000ULL); + uint64_t* l2 = (uint64_t*)(l1[l1_index] & 0xFFFFFFFFF000ULL); //For now we make this not executable. We'll need to to separate read_write, read_only and executable sections - uint64_t attr = ((uint64_t)1 << 54) | ((uint64_t)0 << 53) | PD_ACCESS | (0b11 << 8) | (0b00 << 6) | (attr_index << 2) | PD_BLOCK; - l3[l3_index] = (pa & 0xFFFFFFFFF000ULL) | attr; + uint64_t attr = ((uint64_t)1 << UXN_BIT) | ((uint64_t)0 << PXN_BIT) | (1 << AF_BIT) | (0b11 << SH_BIT) | (0b00 << AP_BIT) | (attr_index << MAIR_BIT) | PD_BLOCK; + l2[l2_index] = (pa & 0xFFFFFFFFF000ULL) | attr; } //Level 0 = EL0, Level 1 = EL1, Level 2 = Shared void mmu_map_4kb(uint64_t va, uint64_t pa, uint64_t attr_index, uint64_t level) { - uint64_t l1_index = (va >> 37) & 0x1FF; - uint64_t l2_index = (va >> 30) & 0x1FF; - uint64_t l3_index = (va >> 21) & 0x1FF; - uint64_t l4_index = (va >> 12) & 0x1FF; - - if (!(page_table_l1[l1_index] & 1)) { + uint64_t l0_index = (va >> 39) & 0x1FF; + uint64_t l1_index = (va >> 30) & 0x1FF; + uint64_t l2_index = (va >> 21) & 0x1FF; + uint64_t l3_index = (va >> 12) & 0x1FF; + + if (!(page_table_l0[l0_index] & 1)) { + uint64_t* l1 = (uint64_t*)talloc(PAGE_SIZE); + page_table_l0[l0_index] = ((uint64_t)l1 & 0xFFFFFFFFF000ULL) | PD_TABLE; + } + + uint64_t* l1 = (uint64_t*)(page_table_l0[l0_index] & 0xFFFFFFFFF000ULL); + if (!(l1[l1_index] & 1)) { uint64_t* l2 = (uint64_t*)talloc(PAGE_SIZE); - for (int i = 0; i < PAGE_TABLE_ENTRIES; i++) l2[i] = 0; - page_table_l1[l1_index] = ((uint64_t)l2 & 0xFFFFFFFFF000ULL) | PD_TABLE; + l1[l1_index] = ((uint64_t)l2 & 0xFFFFFFFFF000ULL) | PD_TABLE; } - uint64_t* l2 = (uint64_t*)(page_table_l1[l1_index] & 0xFFFFFFFFF000ULL); - if (!(l2[l2_index] & 1)) { + uint64_t* l2 = (uint64_t*)(l1[l1_index] & 0xFFFFFFFFF000ULL); + uint64_t l2_val = l2[l2_index]; + if (!(l2_val & 1)) { uint64_t* l3 = (uint64_t*)talloc(PAGE_SIZE); - for (int i = 0; i < PAGE_TABLE_ENTRIES; i++) l3[i] = 0; l2[l2_index] = ((uint64_t)l3 & 0xFFFFFFFFF000ULL) | PD_TABLE; - } - - uint64_t* l3 = (uint64_t*)(l2[l2_index] & 0xFFFFFFFFF000ULL); - uint64_t l3_val = l3[l3_index]; - if (!(l3_val & 1)) { - uint64_t* l4 = (uint64_t*)talloc(PAGE_SIZE); - for (int i = 0; i < PAGE_TABLE_ENTRIES; i++) l4[i] = 0; - l3[l3_index] = ((uint64_t)l4 & 0xFFFFFFFFF000ULL) | PD_TABLE; - } else if ((l3_val & 0b11) == PD_BLOCK){ - kprintf_raw("[MMU error]: Region not mapped for address %x, already mapped at higher granularity [%i][%i][%i][%i]",va, l1_index,l2_index,l3_index,l4_index); + } else if ((l2_val & 0b11) == PD_BLOCK){ + kprintf_raw("[MMU error]: Region not mapped for address %x, already mapped at higher granularity [%i][%i][%i][%i]",va, l0_index,l1_index,l2_index,l3_index); return; } - uint64_t* l4 = (uint64_t*)(l3[l3_index] & 0xFFFFFFFFF000ULL); + uint64_t* l3 = (uint64_t*)(l2[l2_index] & 0xFFFFFFFFF000ULL); - if (l4[l4_index] & 1){ + if (l3[l3_index] & 1){ kprintf_raw("[MMU warning]: Section already mapped %x",va); return; } - //54 = UXN level | 53 = PXN !level | 8 = share | 6 = Access permission uint8_t permission; switch (level) @@ -115,10 +115,10 @@ void mmu_map_4kb(uint64_t va, uint64_t pa, uint64_t attr_index, uint64_t level) default: break; } - uint64_t attr = ((uint64_t)(level == 1) << 54) | ((uint64_t)0 << 53) | PD_ACCESS | (0b11 << 8) | (permission << 6) | (attr_index << 2) | 0b11; - kprintfv("[MMU] Mapping 4kb memory %x at [%i][%i][%i][%i] for EL%i = %x | %x permission: %i", va, l1_index,l2_index,l3_index,l4_index,level,pa,attr,permission); + uint64_t attr = ((uint64_t)(level == 1) << UXN_BIT) | ((uint64_t)0 << PXN_BIT) | (1 << AF_BIT) | (0b01 << SH_BIT) | (permission << AP_BIT) | (attr_index << MAIR_BIT) | 0b11; + kprintfv("[MMU] Mapping 4kb memory %x at [%i][%i][%i][%i] for EL%i = %x | %x permission: %i", va, l0_index,l1_index,l2_index,l3_index,level,pa,attr,permission); - l4[l4_index] = (pa & 0xFFFFFFFFF000ULL) | attr; + l3[l3_index] = (pa & 0xFFFFFFFFF000ULL) | attr; } static inline void mmu_flush_all() { @@ -138,30 +138,29 @@ static inline void mmu_flush_icache() { } void mmu_unmap(uint64_t va, uint64_t pa){ - - uint64_t l1_index = (va >> 37) & 0x1FF; - uint64_t l2_index = (va >> 30) & 0x1FF; - uint64_t l3_index = (va >> 21) & 0x1FF; - uint64_t l4_index = (va >> 12) & 0x1FF; + uint64_t l0_index = (va >> 39) & 0x1FF; + uint64_t l1_index = (va >> 30) & 0x1FF; + uint64_t l2_index = (va >> 21) & 0x1FF; + uint64_t l3_index = (va >> 12) & 0x1FF; - kprintfv("[MMU] Unmapping 4kb memory %x at [%i][%i][%i][%i] for EL1", va, l1_index,l2_index,l3_index, l4_index); - if (!(page_table_l1[l1_index] & 1)) return; + kprintfv("[MMU] Unmapping 4kb memory %x at [%i][%i][%i][%i] for EL1", va, l0_index,l1_index,l2_index, l3_index); + if (!(page_table_l0[l0_index] & 1)) return; - uint64_t* l2 = (uint64_t*)(page_table_l1[l1_index] & 0xFFFFFFFFF000ULL); - if (!(l2[l2_index] & 1)) return; + uint64_t* l1 = (uint64_t*)(page_table_l0[l0_index] & 0xFFFFFFFFF000ULL); + if (!(l1[l1_index] & 1)) return; - uint64_t* l3 = (uint64_t*)(l2[l2_index] & 0xFFFFFFFFF000ULL); - uint64_t l3_val = l3[l3_index]; + uint64_t* l2 = (uint64_t*)(l1[l1_index] & 0xFFFFFFFFF000ULL); + uint64_t l3_val = l2[l2_index]; if (!(l3_val & 1)) return; else if ((l3_val & 0b11) == PD_BLOCK){ - l3[l3_index] = 0; + l2[l2_index] = 0; return; } - uint64_t* l4 = (uint64_t*)(l3[l3_index] & 0xFFFFFFFFF000ULL); + uint64_t* l3 = (uint64_t*)(l2[l2_index] & 0xFFFFFFFFF000ULL); - l4[l4_index] = 0; + l3[l3_index] = 0; mmu_flush_all(); mmu_flush_icache(); @@ -169,7 +168,7 @@ void mmu_unmap(uint64_t va, uint64_t pa){ void mmu_alloc(){ for (int i = 0; i < PAGE_TABLE_ENTRIES; i++) { - page_table_l1[i] = 0; + page_table_l0[i] = 0; } } @@ -189,6 +188,10 @@ void mmu_init() { for (uint64_t addr = get_shared_start(); addr <= get_shared_end(); addr += GRANULE_4KB) mmu_map_4kb(addr, addr, MAIR_IDX_NORMAL, 2); + if (XHCI_BASE) + for (uint64_t addr = XHCI_BASE; addr <= XHCI_BASE + 0x1000; addr += GRANULE_4KB) + mmu_map_4kb(addr, addr, MAIR_IDX_DEVICE, 1); + uint64_t dstart; uint64_t dsize; if (dtb_addresses(&dstart,&dsize)){ @@ -206,7 +209,7 @@ void mmu_init() { asm volatile ("dsb ish"); asm volatile ("isb"); - asm volatile ("msr ttbr0_el1, %0" :: "r"(page_table_l1)); + asm volatile ("msr ttbr0_el1, %0" :: "r"(page_table_l0)); asm volatile ( "mrs x0, sctlr_el1\n" @@ -241,24 +244,24 @@ void register_proc_memory(uint64_t va, uint64_t pa, bool kernel){ } void debug_mmu_address(uint64_t va){ - uint64_t l1_index = (va >> 37) & 0x1FF; - uint64_t l2_index = (va >> 30) & 0x1FF; - uint64_t l3_index = (va >> 21) & 0x1FF; - uint64_t l4_index = (va >> 12) & 0x1FF; + uint64_t l0_index = (va >> 37) & 0x1FF; + uint64_t l1_index = (va >> 30) & 0x1FF; + uint64_t l2_index = (va >> 21) & 0x1FF; + uint64_t l3_index = (va >> 12) & 0x1FF; - kprintf_raw("Address is meant to be mapped to [%i][%i][%i][%i]",l1_index,l2_index,l3_index,l4_index); + kprintf_raw("Address %x is meant to be mapped to [%i][%i][%i][%i]",va, l0_index,l1_index,l2_index,l3_index); - if (!(page_table_l1[l1_index] & 1)) { + if (!(page_table_l0[l0_index] & 1)) { kprintf_raw("L1 Table missing"); return; } - uint64_t* l2 = (uint64_t*)(page_table_l1[l1_index] & 0xFFFFFFFFF000ULL); - if (!(l2[l2_index] & 1)) { + uint64_t* l1 = (uint64_t*)(page_table_l0[l0_index] & 0xFFFFFFFFF000ULL); + if (!(l1[l1_index] & 1)) { kprintf_raw("L2 Table missing"); return; } - uint64_t* l3 = (uint64_t*)(l2[l2_index] & 0xFFFFFFFFF000ULL); - uint64_t l3_val = l3[l3_index]; + uint64_t* l2 = (uint64_t*)(l1[l1_index] & 0xFFFFFFFFF000ULL); + uint64_t l3_val = l2[l2_index]; if (!(l3_val & 1)) { kprintf_raw("L3 Table missing"); return; @@ -270,8 +273,8 @@ void debug_mmu_address(uint64_t va){ return; } - uint64_t* l4 = (uint64_t*)(l3[l3_index] & 0xFFFFFFFFF000ULL); - uint64_t l4_val = l4[l4_index]; + uint64_t* l3 = (uint64_t*)(l2[l2_index] & 0xFFFFFFFFF000ULL); + uint64_t l4_val = l3[l3_index]; if (!(l4_val & 1)){ kprintf_raw("L4 Table entry missing"); return; diff --git a/kernel/memory/page_allocator.c b/kernel/memory/page_allocator.c index be8d3325..553d52a6 100644 --- a/kernel/memory/page_allocator.c +++ b/kernel/memory/page_allocator.c @@ -13,7 +13,6 @@ #define BOOT_PUD_ATTR PD_TABLE #define PAGE_TABLE_ENTRIES 65536 -#define PAGE_SIZE 4096 uint64_t mem_bitmap[PAGE_TABLE_ENTRIES] __attribute__((aligned(PAGE_SIZE))); @@ -101,6 +100,27 @@ void* alloc_page(uint64_t size, bool kernel, bool device, bool full) { return 0; } +void mark_used(uintptr_t address, size_t pages) +{ + if ((address & (PAGE_SIZE - 1)) != 0) { + kprintf("[mark_used error] address %x not aligned", address); + return; + } + if (pages == 0) return; + + uint64_t start = count_pages(get_user_ram_start(),PAGE_SIZE); + + uint64_t page_index = (address / (PAGE_SIZE * 64)) - (start/64); + + for (size_t j = 0; j < pages; j++) { + uint64_t idx = page_index + j; + uint64_t i = idx / 64; + uint64_t bit = idx % 64; + + mem_bitmap[i] |= (1ULL << bit); + } +} + void* allocate_in_page(void *page, uint64_t size, uint16_t alignment, bool kernel, bool device){ size = (size + alignment - 1) & ~(alignment - 1); diff --git a/kernel/memory/page_allocator.h b/kernel/memory/page_allocator.h index 37bb79e3..7e6f93e3 100644 --- a/kernel/memory/page_allocator.h +++ b/kernel/memory/page_allocator.h @@ -6,6 +6,7 @@ #define ALIGN_4KB 0x1000 #define ALIGN_16B 0x10 #define ALIGN_64B 0x40 +#define PAGE_SIZE 4096 void page_alloc_enable_verbose(); void page_allocator_init(); @@ -15,10 +16,13 @@ extern "C" { #endif void* alloc_page(uint64_t size, bool kernel, bool device, bool full); void free_page(void* ptr, uint64_t size); +void mark_used(uintptr_t address, size_t pages); void* allocate_in_page(void *page, uint64_t size, uint16_t alignment, bool kernel, bool device); void free_from_page(void* ptr, uint64_t size); +int count_pages(uint64_t i1,uint64_t i2); + void free_sized(sizedptr ptr); #ifdef __cplusplus diff --git a/kernel/networking/drivers/virtio_net_pci/virtio_net_pci.cpp b/kernel/networking/drivers/virtio_net_pci/virtio_net_pci.cpp index 4011d439..66f63bb8 100644 --- a/kernel/networking/drivers/virtio_net_pci/virtio_net_pci.cpp +++ b/kernel/networking/drivers/virtio_net_pci/virtio_net_pci.cpp @@ -47,6 +47,8 @@ VirtioNetDriver* VirtioNetDriver::try_init(){ return nullptr; } + + bool VirtioNetDriver::init(){ uint64_t addr = find_pci_device(0x1AF4, 0x1000); if (!addr){ @@ -73,14 +75,12 @@ bool VirtioNetDriver::init(){ kprintf_raw("[VIRTIO_NET] Interrupts setup with MSI %i,%i",NET_IRQ,NET_IRQ+1); break; } - pci_enable_device(addr); if (!virtio_init_device(&vnp_net_dev)) { kprintf("[VIRTIO_NET error] Failed network initialization"); return false; } - kprintf("[VIRTIO_NET] Device set up at %x",(uintptr_t)vnp_net_dev.device_cfg); select_queue(&vnp_net_dev, RECEIVE_QUEUE); @@ -109,6 +109,7 @@ bool VirtioNetDriver::init(){ return true; } + void VirtioNetDriver::get_mac(network_connection_ctx *context){ virtio_net_config* net_config = (virtio_net_config*)vnp_net_dev.device_cfg; kprintfv("[VIRTIO_NET] %x:%x:%x:%x:%x:%x", net_config->mac[0], net_config->mac[1], net_config->mac[2], net_config->mac[3], net_config->mac[4], net_config->mac[5]); @@ -184,4 +185,4 @@ void VirtioNetDriver::send_packet(sizedptr packet){ void VirtioNetDriver::enable_verbose(){ verbose = true; -} \ No newline at end of file +} diff --git a/kernel/networking/network_dispatch.cpp b/kernel/networking/network_dispatch.cpp index 01066c65..f1a1ba8c 100644 --- a/kernel/networking/network_dispatch.cpp +++ b/kernel/networking/network_dispatch.cpp @@ -12,6 +12,7 @@ #include "net/icmp.h" #include "memory/page_allocator.h" #include "std/memfunctions.h" +#include "hw/hw.h" NetworkDispatch::NetworkDispatch(){ ports = IndexMap(UINT16_MAX); @@ -21,7 +22,7 @@ NetworkDispatch::NetworkDispatch(){ } NetDriver* NetworkDispatch::select_driver(){ - return VirtioNetDriver::try_init(); + return BOARD_TYPE == 1 ? VirtioNetDriver::try_init() : 0x0; } bool NetworkDispatch::init(){ diff --git a/kernel/networking/processes/net_proc.c b/kernel/networking/processes/net_proc.c index 84b7bfdc..81122989 100644 --- a/kernel/networking/processes/net_proc.c +++ b/kernel/networking/processes/net_proc.c @@ -68,7 +68,6 @@ void test_network(){ unbind_port(8888); } - uint32_t negotiate_dhcp(){ kprintf("Sending DHCP request"); network_connection_ctx *ctx = network_get_context(); @@ -130,9 +129,7 @@ uint32_t negotiate_dhcp(){ //DNS (8 bytes) (6) //TODO: Make subsequent DHCP requests (renewals and requests) directed to the server ctx->ip = local_ip; - test_network(); - return lease_time; } @@ -150,4 +147,4 @@ void dhcp_daemon(){ process_t* launch_net_process(){ return create_kernel_process("dhcp_daemon",dhcp_daemon); -} \ No newline at end of file +} diff --git a/kernel/pci.c b/kernel/pci.c index b2e0ba19..f194cd48 100644 --- a/kernel/pci.c +++ b/kernel/pci.c @@ -25,10 +25,6 @@ #define PCI_CAPABILITY_PCIE 0x10 #define PCI_CAPABILITY_MSIX 0x11 -static uint64_t pci_base; - -#define NINIT pci_base == 0x0 - static bool pci_verbose = false; void pci_enable_verbose(){ @@ -92,6 +88,8 @@ struct acpi_mcfg_t { #define RSDP_SEARCH_START 0x000E0000 #define RSDP_SEARCH_END 0x00100000 +bool initialized; + void* find_rsdp() { for (uint64_t addr = RSDP_SEARCH_START; addr < RSDP_SEARCH_END; addr += 16) { const char* sig = (const char*)(uintptr_t)addr; @@ -119,13 +117,15 @@ void* find_rsdp() { } void find_pci(){ - pci_base = 0x4010000000; - for (uint64_t addr = pci_base; addr < pci_base + 0x10000000; addr += GRANULE_2MB) - register_device_memory_2mb(addr, addr); + if (!initialized){ + initialized = true; + for (uint64_t addr = PCI_BASE; addr < PCI_BASE + 0x10000000; addr += GRANULE_2MB) + register_device_memory_2mb(addr, addr); + } } uint64_t pci_make_addr(uint32_t bus, uint32_t slot, uint32_t func, uint32_t offset){ - return pci_base + return PCI_BASE | (((uint64_t)bus) << 20) | (((uint64_t)slot) << 15) | (((uint64_t)func) << 12) @@ -133,8 +133,8 @@ uint64_t pci_make_addr(uint32_t bus, uint32_t slot, uint32_t func, uint32_t offs } uint64_t pci_get_bar_address(uint64_t base, uint8_t offset, uint8_t index){ - if (NINIT) - find_pci(); + if (!PCI_BASE) + return 0; return base + offset + (index * 4); } @@ -214,17 +214,17 @@ uint64_t pci_setup_bar(uint64_t pci_addr, uint32_t bar_index, uint64_t *mmio_sta uint64_t find_pci_device(uint32_t vendor_id, uint32_t device_id) { - if (!USE_PCI) + if (!PCI_BASE) return 0; - - if (NINIT) + + if (!initialized) find_pci(); for (uint32_t bus = 0; bus < PCI_BUS_MAX; bus++) { for (uint32_t slot = 0; slot < PCI_SLOT_MAX; slot++) { for (uint32_t func = 0; func < PCI_FUNC_MAX; func++) { uint64_t device_address = pci_make_addr(bus, slot, func, 0x00); - uint64_t vendor_device = read(device_address); + uint64_t vendor_device = read32(device_address); if ((vendor_device & 0xFFFF) == vendor_id && ((vendor_device >> 16) & 0xFFFF) == device_id) { kprintf("[PCI] Found device at bus %i, slot %i, func %i", bus, slot, func); @@ -258,6 +258,104 @@ void pci_register(uint64_t mmio_addr, uint64_t mmio_size){ register_device_memory(addr,addr); } +#pragma region Interrupts + +#define RP1_INT_PCI_MASK_CLR 0x4514 +#define RP1_INT_PCI_BAR_L 0x4044 +#define RP1_INT_PCI_BAR_H 0x4048 +#define RP1_INT_PCI_CONFIG 0x404c + +#define RP1_MSI_BAR_TRANSL_VIRT_L 0x402c +#define RP1_MSI_BAR_TRANSL_VIRT_H 0x4030 +#define RP1_MSI_BAR_TRANSL_PHYS_L 0x40ac +#define RP1_MSI_BAR_TRANSL_PHYS_H 0x40b0 + +#define RP1_INT_BASE 0x1F00108000UL + +#define IRQ_NUMBER__MASK 0x3FF +#define IRQ_EDGE_TRIG__MASK 0x400 +#define IRQ_FROM_RP1__MASK 0x800 + +#define MSIX_CFG(irq) (0x008 + (irq)*4) +#define MSIX_CFG_ENABLE (1ULL << 0) +#define MSIX_CFG_TEST (1ULL << 1) +#define MSIX_CFG_IACK (1ULL << 2) +#define MSIX_CFG_IACK_ENABLE (1ULL << 3) + +#define RP1_INT_SET (RP1_INT_BASE + 0x800) +#define RP1_INT_CLR (RP1_INT_BASE + 0xC00) +#define RP1_INT_STAT_LOW (RP1_INT_BASE + 0x108) +#define RP1_INT_STAT_HIGH (RP1_INT_BASE + 0x10C) + +bool pci_setup_rp1() { + uint64_t pci_addr = find_pci_device(0x1de4,1); + // dump_pci_config(pci_addr); + kprintf("RP1 %x",pci_addr); + uint8_t cap_ptr = read8(pci_addr + 0x34); + while (cap_ptr) { + uint8_t cap_id = read8(pci_addr + cap_ptr); + if (cap_id == PCI_CAPABILITY_MSIX){ + uint16_t msg_ctrl = read16(pci_addr + cap_ptr + 0x2); + kprintf("Enabled? %x",(msg_ctrl >> 15) & 1); + msg_ctrl |= (1 << 15); // Clear MSI-X Enable bit + write16(pci_addr + cap_ptr + 0x2, msg_ctrl); + msg_ctrl = read16(pci_addr + cap_ptr + 0x2); + kprintf("Enabled? %x",(msg_ctrl >> 15) & 1); + } + cap_ptr = read8(pci_addr + cap_ptr + 1); + } + uint64_t bar_addr = pci_get_bar_address(pci_addr, PCI_BAR_BASE_OFFSET, 1); + uint64_t bar_addr2 = pci_get_bar_address(pci_addr, PCI_BAR_BASE_OFFSET, 2); + + uintptr_t msi_pci_addr = 0xFFFFFFF000UL; + uintptr_t msi_phys_addr = 0x1000130000UL; + + //Translate pci address to phys address + + write32(pci_addr + RP1_MSI_BAR_TRANSL_VIRT_L, (msi_pci_addr & 0xFFFFFFFF) | 0x1C); + write32(pci_addr + RP1_MSI_BAR_TRANSL_VIRT_H, (msi_pci_addr >> 32) & 0xFFFFFFFF); + write32(pci_addr + RP1_MSI_BAR_TRANSL_PHYS_L, (msi_phys_addr & 0xFFFFFFFF) | 1); + write32(pci_addr + RP1_MSI_BAR_TRANSL_PHYS_H, (msi_phys_addr >> 32) & 0xFFFFFFFF); + + write32(pci_addr + RP1_INT_PCI_MASK_CLR, UINT32_MAX);//Unmask all interrupts + write32(pci_addr + RP1_INT_PCI_BAR_L, (msi_pci_addr & UINT32_MAX) | 1);//Set address and enable + write32(pci_addr + RP1_INT_PCI_BAR_H, (msi_pci_addr >> 32) & UINT32_MAX); + write32(pci_addr + RP1_INT_PCI_CONFIG, 0xffe03210);//ffe0 32 messages, 3210 arbitrary unique value + + for (int i = 0; i < 6; i++) + kprintf("BAR %i = %x",i,pci_read_address_bar(pci_addr, i)); + kprintf("INTa? %i",read8 (pci_addr + 0x3D)); + kprintf("CMD %b",read16(pci_addr + PCI_COMMAND_REGISTER)); + + return true; + +} + +bool pci_setup_msi_rp1(uint8_t irq_line, bool edge_triggered) { + + kprintf("Sanity 1 %i",read32(0x1F00108000)); + + if (edge_triggered) + write32(RP1_INT_CLR + MSIX_CFG(irq_line), MSIX_CFG_IACK_ENABLE); + else + write32(RP1_INT_SET + MSIX_CFG(irq_line), MSIX_CFG_IACK_ENABLE); + + kprintf("Sanity 2 %i",read32(RP1_INT_SET + MSIX_CFG(irq_line))); + kprintf("Sanity 3 %i",read32(RP1_INT_CLR + MSIX_CFG(irq_line))); + + write32(RP1_INT_SET + MSIX_CFG(irq_line), MSIX_CFG_ENABLE); + + kprintf("Sanity 4 %i",read32(RP1_INT_SET + MSIX_CFG(irq_line))); + + write32(RP1_INT_SET + MSIX_CFG(irq_line), MSIX_CFG_TEST); + + kprintf("Sanity 5 %i",read32(RP1_INT_SET + MSIX_CFG(irq_line))); + + kprintf("Fired? %b", read32(RP1_INT_STAT_HIGH) << 32 | read32(RP1_INT_STAT_LOW)); + + return false; +} + bool pci_setup_msi(uint64_t pci_addr, uint8_t irq_line) { uint8_t cap_ptr = read8(pci_addr + 0x34); while (cap_ptr) { diff --git a/kernel/pci.h b/kernel/pci.h index f2b17652..3c800afc 100644 --- a/kernel/pci.h +++ b/kernel/pci.h @@ -6,8 +6,6 @@ extern "C" { #endif -#define MSI_OFFSET 50 - typedef struct { uint64_t base_addr; uint64_t size; @@ -26,6 +24,9 @@ bool pci_setup_msi(uint64_t pci_addr, uint8_t irq_vector); uint8_t pci_setup_interrupts(uint64_t pci_addr, uint8_t irq_line, uint8_t amount); +bool pci_setup_rp1(); +bool pci_setup_msi_rp1(uint8_t irq_line, bool edge_triggered); + typedef struct { uint32_t addr_offset; uint8_t irq_num; diff --git a/kernel/process/syscall.c b/kernel/process/syscall.c index 540f3e6a..20428fba 100644 --- a/kernel/process/syscall.c +++ b/kernel/process/syscall.c @@ -39,8 +39,7 @@ void sync_el0_handler_c(){ uint64_t spsr; asm volatile ("mrs %0, spsr_el1" : "=r"(spsr)); - uint64_t currentEL; - asm volatile ("mov %0, x18" : "=r"(currentEL)); + uint64_t currentEL = (spsr >> 2) & 3; uint64_t sp_el; asm volatile ("mov %0, x11" : "=r"(sp_el)); @@ -50,7 +49,6 @@ void sync_el0_handler_c(){ uint64_t ec = (esr >> 26) & 0x3F; uint64_t iss = esr & 0xFFFFFF; - uint64_t result = 0; if (ec == 0x15) { diff --git a/kernel/process/syscall_as.S b/kernel/process/syscall_as.S index e133a3b8..34fd59b2 100644 --- a/kernel/process/syscall_as.S +++ b/kernel/process/syscall_as.S @@ -2,13 +2,6 @@ //TODO: Rethink the registers used to be sequential both here and in context_switch and exception_vectors_as sync_el0_handler_as: - msr daifset, #2//Disable interrupts - mov x15, x0 - mov x14, x1 - mov x9, x2 - mov x16, x3 - mov x13, x29 - mov x12, x30 mrs x10, spsr_el1 lsr x18, x10, #2 and x18, x18, #0b11 @@ -26,5 +19,12 @@ sync_el0_handler_as: 2: mrs x11, sp_el0 3: + msr daifset, #2//Disable interrupts + mov x15, x0 + mov x14, x1 + mov x9, x2 + mov x16, x3 + mov x13, x29 + mov x12, x30 b sync_el0_handler_c eret \ No newline at end of file diff --git a/kernel/sysregs.h b/kernel/sysregs.h new file mode 100644 index 00000000..d6b0712c --- /dev/null +++ b/kernel/sysregs.h @@ -0,0 +1,52 @@ +#ifndef SYSREGS_H +#define SYSREGS_H + +// *************************************** +// SCTLR_EL1, System Control Register (EL1), Page 2654 of AArch64-Reference-Manual. +// *************************************** + +#define SCTLR_RESERVED (3 << 28) | (3 << 22) | (1 << 20) | (1 << 11) +#define SCTLR_EE_LITTLE_ENDIAN (0 << 25) +#define SCTLR_EOE_LITTLE_ENDIAN (0 << 24) +#define SCTLR_I_CACHE_DISABLED (0 << 12) +#define SCTLR_D_CACHE_DISABLED (0 << 2) +#define SCTLR_I_CACHE_ENABLED (1 << 12) +#define SCTLR_D_CACHE_ENABLED (1 << 2) +#define SCTLR_MMU_DISABLED (0 << 0) +#define SCTLR_MMU_ENABLED (1 << 0) + +#define SCTLR_VALUE_MMU_DISABLED (SCTLR_RESERVED | SCTLR_EE_LITTLE_ENDIAN | SCTLR_I_CACHE_ENABLED | SCTLR_D_CACHE_ENABLED | SCTLR_MMU_DISABLED) + +// *************************************** +// HCR_EL2, Hypervisor Configuration Register (EL2), Page 2487 of AArch64-Reference-Manual. +// *************************************** + +#define HCR_RW (1 << 31) +#define HCR_VALUE HCR_RW + +// *************************************** +// SCR_EL3, Secure Configuration Register (EL3), Page 2648 of AArch64-Reference-Manual. +// *************************************** + +#define SCR_RESERVED (3 << 4) +#define SCR_RW (1 << 10) +#define SCR_NS (1 << 0) +#define SCR_VALUE (SCR_RESERVED | SCR_RW | SCR_NS) + +// *************************************** +// SPSR_EL3, Saved Program Status Register (EL3) Page 389 of AArch64-Reference-Manual. +// *************************************** + +#define SPSR_MASK_ALL (7 << 6) +#define SPSR_EL1h (5 << 0) +#define SPSR3_VALUE (SPSR_MASK_ALL | SPSR_EL1h) + +// *************************************** +// CNTHCTL_EL2, Counter-timer Hypervisor Control Register (EL2) Page 9569 of AArch64-Reference-Manual. +// *************************************** + +#define TRAP_PHYS_TIMER_DISABLED (1 << 0) +#define TRAV_VIRT_TIMER_DISABLED (1 << 1) //Disable trapping of timer calls on hypervisor level +#define CNTHCTL_VALUE (TRAP_PHYS_TIMER_DISABLED | TRAV_VIRT_TIMER_DISABLED) + +#endif \ No newline at end of file diff --git a/kernel/theme/RedactedOS.h b/kernel/theme/RedactedOS.h index 86f77718..1da14ffb 100644 --- a/kernel/theme/RedactedOS.h +++ b/kernel/theme/RedactedOS.h @@ -30,6 +30,6 @@ #define PANIC_TEXT "FATAL ERROR" -#define BG_COLOR 0x222233 +#define BG_COLOR 0xFF222233 #define default_pwd "hi" \ No newline at end of file diff --git a/kernel/virtio/virtio_pci.c b/kernel/virtio/virtio_pci.c index a7a11ddb..59a1138e 100644 --- a/kernel/virtio/virtio_pci.c +++ b/kernel/virtio/virtio_pci.c @@ -3,6 +3,7 @@ #include "memory/memory_access.h" #include "memory/page_allocator.h" #include "virtio_pci.h" +#include "async.h" #define VIRTIO_STATUS_RESET 0x0 #define VIRTIO_STATUS_ACKNOWLEDGE 0x1 @@ -95,7 +96,7 @@ bool virtio_init_device(virtio_device *dev) { struct virtio_pci_common_cfg* cfg = dev->common_cfg; cfg->device_status = 0; - while (cfg->device_status != 0);//TODO: OPT + if (!wait((uint32_t*)&cfg->device_status, 0, false, 2000)) return false; cfg->device_status |= VIRTIO_STATUS_ACKNOWLEDGE; cfg->device_status |= VIRTIO_STATUS_DRIVER; @@ -123,9 +124,9 @@ bool virtio_init_device(virtio_device *dev) { uint32_t queue_index = 0; uint32_t size; while ((size = select_queue(dev,queue_index))){ - uint64_t base = (uintptr_t)allocate_in_page(dev->memory_page, 16 * size, ALIGN_64B, true, true); - uint64_t avail = (uintptr_t)allocate_in_page(dev->memory_page, 4 + (2 * size), ALIGN_64B, true, true); - uint64_t used = (uintptr_t)allocate_in_page(dev->memory_page, sizeof(uint16_t) * (2 + size), ALIGN_64B, true, true); + uint64_t base = (uintptr_t)allocate_in_page(dev->memory_page, 16 * size, ALIGN_4KB, true, true); + uint64_t avail = (uintptr_t)allocate_in_page(dev->memory_page, 4 + (2 * size), ALIGN_4KB, true, true); + uint64_t used = (uintptr_t)allocate_in_page(dev->memory_page, sizeof(uint16_t) * (2 + size), ALIGN_4KB, true, true); kprintfv("[VIRTIO QUEUE %i] Device base %x",queue_index,base); kprintfv("[VIRTIO QUEUE %i] Device avail %x",queue_index,avail); diff --git a/run_raspi b/run_raspi index 3b6c756e..aa0b17eb 100755 --- a/run_raspi +++ b/run_raspi @@ -1,4 +1,4 @@ -#/!bin/sh +#!/bin/sh echo "Running raspi emulator" @@ -9,10 +9,13 @@ fi OS_TYPE="$(uname)" -if [[ "$OS_TYPE" == "Darwin" ]]; then +DISPLAY_MODE="default" + +if [ "$OS_TYPE" = "Darwin" ]; then NETARG="vmnet-bridged,id=net0,ifname=en0" PRIVILEGE="sudo" -elif [[ "$OS_TYPE" == "Linux" ]]; then + DISPLAY_MODE="sdl" +elif [ "$OS_TYPE" = "Linux" ]; then NETARG="user,id=net0" PRIVILEGE="" else @@ -23,7 +26,7 @@ fi $PRIVILEGE qemu-system-aarch64 \ -M raspi4b \ -kernel kernel.img \ --display sdl \ +-display $DISPLAY_MODE \ -device sd-card,drive=sd -drive id=sd,format=raw,file=disk.img,if=none \ -netdev $NETARG \ -serial mon:stdio \ diff --git a/run_virt b/run_virt index 25663d9f..8399322d 100755 --- a/run_virt +++ b/run_virt @@ -1,4 +1,4 @@ -#/!bin/sh +#!/bin/sh echo "Running virt emulator" @@ -17,10 +17,14 @@ fi OS_TYPE="$(uname)" -if [[ "$OS_TYPE" == "Darwin" ]]; then +DISPLAY_MODE="default" +SELECTED_GPU="virtio-gpu-pci" + +if [ "$OS_TYPE" = "Darwin" ]; then NETARG="vmnet-bridged,id=net0,ifname=en0" PRIVILEGE="sudo" -elif [[ "$OS_TYPE" == "Linux" ]]; then + DISPLAY_MODE="sdl" +elif [ "$OS_TYPE" = "Linux" ]; then NETARG="user,id=net0" PRIVILEGE="" else @@ -33,8 +37,8 @@ $PRIVILEGE qemu-system-aarch64 \ -cpu cortex-a72 \ -m 512M \ -kernel kernel.elf \ - -device virtio-gpu-pci \ - -display sdl \ + -device $SELECTED_GPU \ + -display $DISPLAY_MODE \ -netdev $NETARG \ -device virtio-net-pci,netdev=net0 \ -serial mon:stdio \ diff --git a/shared/Makefile b/shared/Makefile index fb7390db..4c9fe9cd 100644 --- a/shared/Makefile +++ b/shared/Makefile @@ -1,21 +1,20 @@ -ARCH= aarch64-none-elf -CC = $(ARCH)-gcc -AR = $(ARCH)-ar -OBJCOPY = $(ARCH)-objcopy +#shared +CFLAGS := $(CFLAGS_BASE) -I. -I../kernel -Wno-unused-parameter -CFLAGS = -g -O0 -std=c17 -nostdlib -nolibc -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wall -Wextra -mcpu=cortex-a72 -I. -I../kernel -Wno-unused-parameter +CLEAN_OBJS := $(shell find . -name '*.o') +C_SRC := $(shell find . -name '*.c') +CPP_SRC := $(shell find . -name '*.cpp') +ASM_SRC := $(shell find . -name '*.S') +OBJ := $(C_SRC:.c=.o) $(ASM_SRC:.S=.o) $(CPP_SRC:.cpp=.o) -C_SRC = $(shell find . -name '*.c') -CPP_SRC = $(shell find . -name '*.cpp') -ASM_SRC = $(shell find . -name '*.S') -OBJ = $(C_SRC:.c=.o) $(ASM_SRC:.S=.o) $(CPP_SRC:.cpp=.o) +TARGET := libshared.a -TARGET = libshared.a +.PHONY: all clean all: $(TARGET) $(TARGET): $(OBJ) - $(AR) rcs $(TARGET) $(OBJ) + $(AR) rcs $@ $^ %.o: %.S $(CC) $(CFLAGS) -c $< -o $@ @@ -27,4 +26,4 @@ $(TARGET): $(OBJ) $(CC) $(CFLAGS) -fno-rtti -c $< -o $@ clean: - rm -f $(shell find . -name '*.o') $(TARGET) \ No newline at end of file + rm -f $(CLEAN_OBJS) $(TARGET) diff --git a/shared/data_struct/chunked_list.c b/shared/data_struct/chunked_list.c new file mode 100644 index 00000000..376feca5 --- /dev/null +++ b/shared/data_struct/chunked_list.c @@ -0,0 +1,174 @@ +#include "chunked_list.h" +#include "types.h" + +cchunked_list_t* cchunked_list_create(uint64_t chunkSize){ + uintptr_t raw = malloc(sizeof(cchunked_node_t) + chunkSize * sizeof(void*)); + if (!raw) return NULL; + + cchunked_list_t* list = (cchunked_list_t*)malloc(sizeof(cchunked_list_t)); + if (!list) { + free((void*)raw, sizeof(cchunked_node_t) + chunkSize * sizeof(void*)); + return NULL; + } + + list->chunkSize = chunkSize; + list->length = 0; + list->head = (cchunked_node_t*)raw; + list->head->count = 0; + list->head->next = NULL; + list->tail = list->head; + return list; +} + +void cchunked_list_destroy(cchunked_list_t* list){ + if (!list) return; + cchunked_node_t* node = list->head; + while (node) { + cchunked_node_t* next = node->next; + free(node, sizeof(cchunked_node_t) + list->chunkSize * sizeof(void*)); + node = next; + } + free(list, sizeof(cchunked_list_t)); +} + +cchunked_list_t* cchunked_list_clone(const cchunked_list_t* list){ + if (!list) return NULL; + cchunked_list_t* clone = cchunked_list_create(list->chunkSize); + if (!clone) return NULL; + + for (cchunked_node_t* it = list->head; it; it = it->next) { + for (uint64_t i = 0; i < it->count; i++) + cchunked_list_push_back(clone, it->data[i]); + } + return clone; +} + +void cchunked_list_push_back(cchunked_list_t* list, void* data){ + if (!list) return; + + if (!list->tail) { + uintptr_t m = malloc(sizeof(cchunked_node_t) + list->chunkSize * sizeof(void*)); + if (!m) return; + cchunked_node_t* node = (cchunked_node_t*)m; + node->count = 0; + node->next = NULL; + list->head = list->tail = node; + } + + if (list->tail->count == list->chunkSize) { + uintptr_t m = malloc(sizeof(cchunked_node_t) + list->chunkSize * sizeof(void*)); + if (!m) return; + cchunked_node_t* node = (cchunked_node_t*)m; + node->count = 0; + node->next = NULL; + list->tail->next = node; + list->tail = node; + } + + list->tail->data[list->tail->count++] = data; + list->length++; +} + +cchunked_node_t* cchunked_list_insert_after(cchunked_list_t* list, cchunked_node_t* node, void* data){ + if (!list) return NULL; + if (!node) { + cchunked_list_push_back(list, data); + return list->tail; + } + + if (node->count < list->chunkSize) { + node->data[node->count++] = data; + list->length++; + return node; + } + + uintptr_t m = malloc(sizeof(cchunked_node_t) + list->chunkSize * sizeof(void*)); + if (!m) return NULL; + cchunked_node_t* new_node = (cchunked_node_t*)m; + new_node->count = 1; + new_node->next = node->next; + new_node->data[0] = data; + + node->next = new_node; + if (list->tail == node) list->tail = new_node; + list->length++; + return new_node; +} + +void* cchunked_list_pop_front(cchunked_list_t* list){ + if (!list || !list->head || list->length == 0) return NULL; + + void* data = list->head->data[0]; + if (list->head->count > 1) { + for (uint64_t i = 1; i < list->head->count; ++i) + list->head->data[i-1] = list->head->data[i]; + list->head->count--; + } else { + cchunked_node_t* old = list->head; + list->head = old->next; + if (!list->head) list->tail = NULL; + free(old, sizeof(cchunked_node_t) + list->chunkSize * sizeof(void*)); + } + + list->length--; + return data; +} + +void* cchunked_list_remove_node(cchunked_list_t* list, cchunked_node_t* node){ + if (!list || !node || !list->head) return NULL; + + if (node == list->head) + return cchunked_list_pop_front(list); + + cchunked_node_t* prev = list->head; + while (prev->next && prev->next != node) prev = prev->next; + if (prev->next != node) return NULL; + + void* data = node->data[0]; + for (uint64_t i = 1; i < node->count; ++i) + node->data[i - 1] = node->data[i]; + node->count--; + list->length--; + + if (node->count == 0) { + prev->next = node->next; + if (list->tail == node) list->tail = prev; + free(node, sizeof(cchunked_node_t) + list->chunkSize * sizeof(void*)); + } + + return data; +} + +void cchunked_list_update(cchunked_list_t* list, cchunked_node_t* node, void* new_data){ + (void)list; + if (node && node->count) + node->data[0] = new_data; +} + +void cchunked_list_update_at(cchunked_list_t* list, cchunked_node_t* node, uint64_t offset, void* new_data){ + if (!list || !node || offset >= node->count) + return; + node->data[offset] = new_data; +} + +uint64_t cchunked_list_length(const cchunked_list_t* list){ + return list ? list->length : 0; +} + +uint64_t cchunked_list_size_bytes(const cchunked_list_t* list){ + if (!list) return 0; + uint64_t nodes = 0; + for (cchunked_node_t* it = list->head; it; it = it->next) nodes++; + return nodes * (sizeof(cchunked_node_t) + list->chunkSize * sizeof(void*)); +} + +void cchunked_list_for_each(const cchunked_list_t* list, void (*func)(void*)){ + if (!list || !func) return; + for (cchunked_node_t* it = list->head; it; it = it->next) + for (uint64_t i = 0; i < it->count; ++i) + func(it->data[i]); +} + +int cchunked_list_is_empty(const cchunked_list_t* list){ + return (!list || list->length == 0) ? 1 : 0; +} diff --git a/shared/data_struct/chunked_list.h b/shared/data_struct/chunked_list.h new file mode 100644 index 00000000..3d341c96 --- /dev/null +++ b/shared/data_struct/chunked_list.h @@ -0,0 +1,40 @@ +#pragma once +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct cchunked_node { + uint64_t count; + struct cchunked_node* next; + void* data[]; +} cchunked_node_t; + +typedef struct cchunked_list { + uint64_t chunkSize; + uint64_t length; + cchunked_node_t* head; + cchunked_node_t* tail; +} cchunked_list_t; + +uintptr_t malloc(uint64_t size); +void free(void* ptr, uint64_t size); + +cchunked_list_t* cchunked_list_create(uint64_t chunkSize); +void cchunked_list_destroy(cchunked_list_t* list); +cchunked_list_t* cchunked_list_clone(const cchunked_list_t* list); +void cchunked_list_push_back(cchunked_list_t* list, void* data); +void* cchunked_list_pop_front(cchunked_list_t* list); +cchunked_node_t* cchunked_list_insert_after(cchunked_list_t* list, cchunked_node_t* node, void* data); +void* cchunked_list_remove_node(cchunked_list_t* list, cchunked_node_t* node); +void cchunked_list_update(cchunked_list_t* list, cchunked_node_t* node, void* new_data); +void cchunked_list_update_at(cchunked_list_t* list, cchunked_node_t* node, uint64_t offset, void* new_data); +uint64_t cchunked_list_length(const cchunked_list_t* list); +uint64_t cchunked_list_size_bytes(const cchunked_list_t* list); +void cchunked_list_for_each(const cchunked_list_t* list, void (*func)(void*)); +int cchunked_list_is_empty(const cchunked_list_t* list); + +#ifdef __cplusplus +} +#endif diff --git a/shared/data_struct/chunked_list.hpp b/shared/data_struct/chunked_list.hpp new file mode 100644 index 00000000..df5f04c1 --- /dev/null +++ b/shared/data_struct/chunked_list.hpp @@ -0,0 +1,181 @@ +#pragma once +#include "types.h" +extern "C" { +#include "chunked_list.h" +} + +template +class ChunkedList { +public: + struct Node { + uint64_t count; + Node* next; + T data[]; + }; + + explicit ChunkedList(uint64_t cs) + : head(nullptr), tail(nullptr), length_(0), chunkSize(cs) {} + + ~ChunkedList() { + while (head) { + Node* next = head->next; + ::free(head, sizeof(Node) + chunkSize * sizeof(T)); + head = next; + } + } + + ChunkedList(const ChunkedList& other) + : head(nullptr), tail(nullptr), length_(0), chunkSize(other.chunkSize) { + for (Node* c = other.head; c; c = c->next) { + for (uint64_t i = 0; i < c->count; ++i) { + push_back(c->data[i]); + } + } + } + + ChunkedList& operator=(const ChunkedList& other) { + if (this != &other) { + clear(); + chunkSize = other.chunkSize; + for (Node* c = other.head; c; c = c->next) { + for (uint64_t i = 0; i < c->count; ++i) { + push_back(c->data[i]); + } + } + } + return *this; + } + + void push_back(const T& value) { + if (!tail) allocFirst(); + if (tail->count == chunkSize) allocChunk(); + tail->data[tail->count++] = value; + ++length_; + } + + T pop_front() { + if (!head) return T(); + T val = head->data[0]; + if (head->count > 1) { + for (uint64_t i = 1; i < head->count; ++i) + head->data[i - 1] = head->data[i]; + --head->count; + } else { + Node* old = head; + head = head->next; + ::free(old, sizeof(Node) + chunkSize * sizeof(T)); + if (!head) tail = nullptr; + } + --length_; + return val; + } + + Node* insert_after(Node* node, const T& value) { + if (!node) { + push_back(value); + return tail; + } + if (node->count < chunkSize) { + node->data[node->count++] = value; + ++length_; + return node; + } + Node* n = allocNode(value); + n->next = node->next; + node->next = n; + if (tail == node) tail = n; + ++length_; + return n; + } + + T remove_node(Node* node) { + if (!node || !head) return T(); + if (node == head) { + T val = head->data[0]; + uint64_t removed = head->count; + Node* nxt = head->next; + ::free(head, sizeof(Node) + chunkSize * sizeof(T)); + head = nxt; + if (!head) tail = nullptr; + length_ -= removed; + return val; + } + Node* prev = head; + while (prev->next && prev->next != node) prev = prev->next; + if (prev->next != node) return T(); + T val = node->data[0]; + uint64_t removed = node->count; + prev->next = node->next; + if (tail == node) tail = prev; + ::free(node, sizeof(Node) + chunkSize * sizeof(T)); + length_ -= removed; + return val; + } + + void update(Node* node, const T& value) { + if (node && node->count) node->data[0] = value; + } + + void update_at(Node* node, uint64_t offset, const T& value) { + if (node && offset < node->count) node->data[offset] = value; + } + + uint64_t size() const noexcept { + return length_; + } + + uint64_t size_bytes() const noexcept { + uint64_t nodes = 0; + for (Node* it = head; it; it = it->next) ++nodes; + return nodes * (sizeof(Node) + chunkSize * sizeof(T)); + } + + bool empty() const noexcept { + return length_ == 0; + } + + template + void for_each(Func f) const { + for (Node* it = head; it; it = it->next) { + for (uint64_t i = 0; i < it->count; ++i) { + f(it->data[i]); + } + } + } + +private: + Node* head; + Node* tail; + uint64_t length_; + uint64_t chunkSize; + + Node* allocNode(const T& value) { + uintptr_t raw = ::malloc(sizeof(Node) + chunkSize * sizeof(T)); + Node* n = reinterpret_cast(raw); + n->count = 1; + n->next = nullptr; + n->data[0] = value; + return n; + } + + void allocFirst() { + uintptr_t raw = ::malloc(sizeof(Node) + chunkSize * sizeof(T)); + head = tail = reinterpret_cast(raw); + head->count = 0; + head->next = nullptr; + } + + void allocChunk() { + uintptr_t raw = ::malloc(sizeof(Node) + chunkSize * sizeof(T)); + Node* n = reinterpret_cast(raw); + n->count = 0; + n->next = nullptr; + tail->next = n; + tail = n; + } + + void clear() { + while (head) pop_front(); + } +}; + diff --git a/shared/data_struct/doubly_linked_list.c b/shared/data_struct/doubly_linked_list.c new file mode 100644 index 00000000..d3707a85 --- /dev/null +++ b/shared/data_struct/doubly_linked_list.c @@ -0,0 +1,181 @@ +#include "doubly_linked_list.h" + +cdouble_linked_list_t* cdouble_linked_list_create(void) { + uintptr_t raw = malloc((uint64_t)sizeof(cdouble_linked_list_t)); + if (!raw) return NULL; + cdouble_linked_list_t* list = (cdouble_linked_list_t*)raw; + list->head = list->tail = NULL; + list->length = 0; + return list; +} + +void cdouble_linked_list_destroy(cdouble_linked_list_t* list) { + if (!list) return; + cdouble_linked_list_node_t* node = list->head; + for (uint64_t i = 0; i < list->length; ++i) { + cdouble_linked_list_node_t* next = node->next; + free(node, sizeof(cdouble_linked_list_node_t)); + node = next; + } + free(list, sizeof(cdouble_linked_list_t)); +} + +cdouble_linked_list_t* cdouble_linked_list_clone(const cdouble_linked_list_t* list) { + if (!list) return NULL; + cdouble_linked_list_t* clone = cdouble_linked_list_create(); + if (!clone) return NULL; + cdouble_linked_list_node_t* it = list->head; + for (uint64_t i = 0; i < list->length; ++i) { + uintptr_t raw = malloc(sizeof(cdouble_linked_list_node_t)); + if (raw) { + cdouble_linked_list_node_t* node = (cdouble_linked_list_node_t*)raw; + node->data = it->data; + if (clone->length == 0) { + node->next = node->prev = node; + clone->head = clone->tail = node; + } else { + node->prev = clone->tail; + node->next = clone->head; + clone->tail->next = node; + clone->head->prev = node; + clone->tail = node; + } + ++clone->length; + } + it = it->next; + } + return clone; +} + +void cdouble_linked_list_push_front(cdouble_linked_list_t* list, void* data) { + if (!list) return; + uintptr_t raw = malloc(sizeof(cdouble_linked_list_node_t)); + if (!raw) return; + cdouble_linked_list_node_t* node = (cdouble_linked_list_node_t*)raw; + node->data = data; + if (list->length == 0) { + node->next = node->prev = node; + list->head = list->tail = node; + } else { + node->next = list->head; + node->prev = list->tail; + list->head->prev = node; + list->tail->next = node; + list->head = node; + } + ++list->length; +} + +void cdouble_linked_list_push_back(cdouble_linked_list_t* list, void* data) { + if (!list) return; + uintptr_t raw = malloc(sizeof(cdouble_linked_list_node_t)); + if (!raw) return; + cdouble_linked_list_node_t* node = (cdouble_linked_list_node_t*)raw; + node->data = data; + if (list->length == 0) { + node->next = node->prev = node; + list->head = list->tail = node; + } else { + node->prev = list->tail; + node->next = list->head; + list->tail->next = node; + list->head->prev = node; + list->tail = node; + } + ++list->length; +} + +void* cdouble_linked_list_pop_front(cdouble_linked_list_t* list) { + if (!list || list->length == 0) return NULL; + cdouble_linked_list_node_t* node = list->head; + void* data = node->data; + if (list->length == 1) { + list->head = list->tail = NULL; + } else { + list->head = node->next; + list->head->prev = list->tail; + list->tail->next = list->head; + } + --list->length; + free(node, sizeof(cdouble_linked_list_node_t)); + return data; +} + +void* cdouble_linked_list_pop_back(cdouble_linked_list_t* list) { + if (!list || list->length == 0) return NULL; + cdouble_linked_list_node_t* node = list->tail; + void* data = node->data; + if (list->length == 1) { + list->head = list->tail = NULL; + } else { + list->tail = node->prev; + list->tail->next = list->head; + list->head->prev = list->tail; + } + --list->length; + free(node, sizeof(cdouble_linked_list_node_t)); + return data; +} + +cdouble_linked_list_node_t* cdouble_linked_list_insert_after(cdouble_linked_list_t* list, cdouble_linked_list_node_t* node, void* data) { + if (!list) return NULL; + if (!node) { + cdouble_linked_list_push_front(list, data); + return list->head; + } + uintptr_t raw = malloc(sizeof(cdouble_linked_list_node_t)); + if (!raw) return NULL; + cdouble_linked_list_node_t* new_node = (cdouble_linked_list_node_t*)raw; + new_node->data = data; + new_node->next = node->next; + new_node->prev = node; + node->next->prev = new_node; + node->next = new_node; + if (list->tail == node) list->tail = new_node; + ++list->length; + return new_node; +} + +cdouble_linked_list_node_t* cdouble_linked_list_insert_before(cdouble_linked_list_t* list, cdouble_linked_list_node_t* node, void* data) { + if (!list) return NULL; + if (!node) { + cdouble_linked_list_push_back(list, data); + return list->tail; + } + return cdouble_linked_list_insert_after(list, node->prev, data); +} + +void* cdouble_linked_list_remove(cdouble_linked_list_t* list, cdouble_linked_list_node_t* node) { + if (!list || !node || list->length == 0) return NULL; + if (node == list->head) return cdouble_linked_list_pop_front(list); + if (node == list->tail) return cdouble_linked_list_pop_back(list); + node->prev->next = node->next; + node->next->prev = node->prev; + void* data = node->data; + --list->length; + free(node, sizeof(cdouble_linked_list_node_t)); + return data; +} + +void cdouble_linked_list_update(cdouble_linked_list_t* list, cdouble_linked_list_node_t* node, void* new_data) { + (void)list; + if (node) node->data = new_data; +} + +uint64_t cdouble_linked_list_length(const cdouble_linked_list_t* list) { + return list ? list->length : 0; +} + +uint64_t cdouble_linked_list_size_bytes(const cdouble_linked_list_t* list) { + return list ? list->length * sizeof(cdouble_linked_list_node_t) : 0; +} + +cdouble_linked_list_node_t* cdouble_linked_list_find(cdouble_linked_list_t* list, void* key, int (*cmp)(void*, void*)) { + if (!list || !cmp || list->length == 0) return NULL; + cdouble_linked_list_node_t* it = list->head; + for (uint64_t i = 0; i < list->length; ++i) { + if (cmp(it->data, key) == 0) return it; + it = it->next; + } + return NULL; +} diff --git a/shared/data_struct/doubly_linked_list.h b/shared/data_struct/doubly_linked_list.h new file mode 100644 index 00000000..aee049f5 --- /dev/null +++ b/shared/data_struct/doubly_linked_list.h @@ -0,0 +1,40 @@ +#pragma once +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct cdouble_linked_list_node { + void* data; + struct cdouble_linked_list_node* next; + struct cdouble_linked_list_node* prev; +} cdouble_linked_list_node_t; + +typedef struct cdouble_linked_list { + cdouble_linked_list_node_t* head; + cdouble_linked_list_node_t* tail; + uint64_t length; +} cdouble_linked_list_t; + +extern uintptr_t malloc(uint64_t size); +extern void free(void* ptr, uint64_t size); + +cdouble_linked_list_t* cdouble_linked_list_create(void); +void cdouble_linked_list_destroy(cdouble_linked_list_t* list); +cdouble_linked_list_t* cdouble_linked_list_clone(const cdouble_linked_list_t* list); +void cdouble_linked_list_push_front(cdouble_linked_list_t* list, void* data); +void cdouble_linked_list_push_back(cdouble_linked_list_t* list, void* data); +void* cdouble_linked_list_pop_front(cdouble_linked_list_t* list); +void* cdouble_linked_list_pop_back(cdouble_linked_list_t* list); +cdouble_linked_list_node_t* cdouble_linked_list_insert_after(cdouble_linked_list_t* list, cdouble_linked_list_node_t* node, void* data); +cdouble_linked_list_node_t* cdouble_linked_list_insert_before(cdouble_linked_list_t* list, cdouble_linked_list_node_t* node, void* data); +void* cdouble_linked_list_remove(cdouble_linked_list_t* list, cdouble_linked_list_node_t* node); +void cdouble_linked_list_update(cdouble_linked_list_t* list, cdouble_linked_list_node_t* node, void* new_data); +uint64_t cdouble_linked_list_length(const cdouble_linked_list_t* list); +uint64_t cdouble_linked_list_size_bytes(const cdouble_linked_list_t* list); +cdouble_linked_list_node_t* cdouble_linked_list_find(cdouble_linked_list_t* list, void* key, int (*cmp)(void*, void*)); + +#ifdef __cplusplus +} +#endif diff --git a/shared/data_struct/doubly_linked_list.hpp b/shared/data_struct/doubly_linked_list.hpp new file mode 100644 index 00000000..2438e01d --- /dev/null +++ b/shared/data_struct/doubly_linked_list.hpp @@ -0,0 +1,207 @@ +#pragma once +#include "types.h" + +extern "C" { +#include "doubly_linked_list.h" +} + +template +class LinkedList { +private: + struct Node { + T data; + Node* next; + Node* prev; + }; + + Node* head; + Node* tail; + uint64_t length; + + Node* alloc_node(const T& value) { + uintptr_t raw = malloc(sizeof(Node)); + if (raw == 0) return nullptr; + Node* n = reinterpret_cast(raw); + n->data = value; + n->next = n->prev = nullptr; + return n; + } + + void free_node(Node* n) { + if (!n) return; + free(n, sizeof(Node)); + } + + static void swap(LinkedList& a, LinkedList& b) noexcept { + std::swap(a.head, b.head); + std::swap(a.tail, b.tail); + std::swap(a.length, b.length); + } + +public: + LinkedList() : head(nullptr), tail(nullptr), length(0) {} + + LinkedList(const LinkedList& other) : head(nullptr), tail(nullptr), length(0) { + if (other.head) { + Node* it = other.head; + do { + push_back(it->data); + it = it->next; + } while (it != other.head); + } + } + + ~LinkedList() { + while (!empty()) pop_front(); + } + + LinkedList& operator=(const LinkedList& other) { + if (this != &other) { + LinkedList tmp(other); + swap(*this, tmp); + } + return *this; + } + + void push_front(const T& value) { + Node* n = alloc_node(value); + if (!n) return; + if (!head) { + head = tail = n; + n->next = n->prev = n; + } else { + n->next = head; + n->prev = tail; + head->prev = n; + tail->next = n; + head = n; + } + ++length; + } + + void push_back(const T& value) { + Node* n = alloc_node(value); + if (!n) return; + if (!tail) { + head = tail = n; + n->next = n->prev = n; + } else { + n->prev = tail; + n->next = head; + tail->next = n; + head->prev = n; + tail = n; + } + ++length; + } + + T pop_front() { + if (!head) return T(); + Node* n = head; + T val = n->data; + if (head == tail) { + head = tail = nullptr; + } else { + head = head->next; + head->prev = tail; + tail->next = head; + } + --length; + free_node(n); + return val; + } + + T pop_back() { + if (!tail) return T(); + Node* n = tail; + T val = n->data; + if (head == tail) { + head = tail = nullptr; + } else { + tail = tail->prev; + tail->next = head; + head->prev = tail; + } + --length; + free_node(n); + return val; + } + + Node* insert_after(Node* node, const T& value) { + if (!node) { + push_front(value); + return head; + } + Node* n = alloc_node(value); + if (!n) return nullptr; + n->next = node->next; + n->prev = node; + node->next->prev = n; + node->next = n; + if (tail == node) tail = n; + ++length; + return n; + } + + Node* insert_before(Node* node, const T& value) { + if (!node) { + push_back(value); + return tail; + } + return insert_after(node->prev, value); + } + + T remove(Node* node) { + if (!node) return T(); + if (node == head) return pop_front(); + if (node == tail) return pop_back(); + node->prev->next = node->next; + node->next->prev = node->prev; + T val = node->data; + --length; + free_node(node); + return val; + } + + void update(Node* node, const T& value) { + if (node) node->data = value; + } + + uint64_t size() const { + return length; + } + + bool empty() const { + return length == 0; + } + + Node* begin() const { + return head; + } + + Node* end() const { + return nullptr; + } + + template + Node* find(Predicate pred) const { + if (!head) return nullptr; + Node* it = head; + do { + if (pred(it->data)) return it; + it = it->next; + } while (it != head); + return nullptr; + } + + template + void for_each(Func func) const { + if (!head) return; + Node* it = head; + do { + func(it->data); + it = it->next; + } while (it != head); + } +}; + diff --git a/shared/data_struct/linked_list.c b/shared/data_struct/linked_list.c new file mode 100644 index 00000000..0ffdd600 --- /dev/null +++ b/shared/data_struct/linked_list.c @@ -0,0 +1,129 @@ +#include "linked_list.h" + +clinkedlist_t *clinkedlist_create(void){ + uintptr_t mem = malloc(sizeof(clinkedlist_t)); + if((void *)mem == NULL) return NULL; + clinkedlist_t *list = (clinkedlist_t *)mem; + list->head = NULL; + list->tail = NULL; + list->length = 0; + return list; +} + +void clinkedlist_destroy(clinkedlist_t *list){ + if(list == NULL) return; + clinkedlist_node_t *node = list->head; + while(node){ + clinkedlist_node_t *next = node->next; + free(node, sizeof(clinkedlist_node_t)); + node = next; + } + free(list, sizeof(clinkedlist_t)); +} + +clinkedlist_t *clinkedlist_clone(const clinkedlist_t *list){ + if(list == NULL) return NULL; + clinkedlist_t *clone = clinkedlist_create(); + if(clone == NULL) return NULL; + clinkedlist_node_t *it = list->head; + while(it){ + if(clone->tail){ + clinkedlist_node_t *new_node = (clinkedlist_node_t *)malloc(sizeof(clinkedlist_node_t)); + new_node->data = it->data; + new_node->next = NULL; + clone->tail->next = new_node; + clone->tail = new_node; + clone->length++; + } else { + clinkedlist_push_front(clone, it->data); + } + it = it->next; + } + return clone; +} + +void clinkedlist_push_front(clinkedlist_t *list, void *data){ + if(list == NULL) return; + clinkedlist_node_t *node = (clinkedlist_node_t *)malloc(sizeof(clinkedlist_node_t)); + node->data = data; + node->next = list->head; + list->head = node; + if(list->tail == NULL) list->tail = node; + list->length++; +} + +void *clinkedlist_pop_front(clinkedlist_t *list){ + if(list == NULL || list->head == NULL) return NULL; + clinkedlist_node_t *node = list->head; + void *data = node->data; + list->head = node->next; + if (list->head == NULL) list->tail = NULL; + list->length--; + free(node, sizeof(clinkedlist_node_t)); + return data; +} + +clinkedlist_node_t *clinkedlist_insert_after(clinkedlist_t *list, clinkedlist_node_t *node, void *data){ + if(list == NULL) return NULL; + if(node == NULL){ + clinkedlist_push_front(list, data); + return list->head; + } + clinkedlist_node_t *new_node = (clinkedlist_node_t *)malloc(sizeof(clinkedlist_node_t)); + new_node->data = data; + new_node->next = node->next; + node->next = new_node; + if(list->tail == node) list->tail = new_node; + list->length++; + return new_node; +} + +void *clinkedlist_remove(clinkedlist_t *list, clinkedlist_node_t *node){ + if(list == NULL || node == NULL || list->head == NULL) return NULL; + if(node == list->head){ + return clinkedlist_pop_front(list); + } + clinkedlist_node_t *prev = list->head; + while(prev->next && prev->next != node){ + prev = prev->next; + } + if(prev->next != node) return NULL; + prev->next = node->next; + if(node == list->tail) list->tail = prev; + void *data = node->data; + list->length--; + free(node, sizeof(clinkedlist_node_t)); + return data; +} + +void clinkedlist_update(clinkedlist_t *list, clinkedlist_node_t *node, void *new_data){ + (void)list; + if(node) node->data = new_data; +} + +uint64_t clinkedlist_length(const clinkedlist_t *list){ + return list ? list->length : 0; +} + +uint64_t clinkedlist_size_bytes(const clinkedlist_t *list){ + return list ? list->length * sizeof(clinkedlist_node_t) : 0; +} + +clinkedlist_node_t *clinkedlist_find(clinkedlist_t *list, void *key, int (*cmp)(void *, void *)){ + if(list == NULL || cmp == NULL) return NULL; + clinkedlist_node_t *it = list->head; + while(it){ + if(cmp(it->data, key) == 0) return it; + it = it->next; + } + return NULL; +} + +void clinkedlist_for_each(const clinkedlist_t *list, void (*func)(void *)){ + if(list == NULL || func == NULL) return; + clinkedlist_node_t *it = list->head; + while(it){ + func(it->data); + it = it->next; + } +} diff --git a/shared/data_struct/linked_list.h b/shared/data_struct/linked_list.h new file mode 100644 index 00000000..4e27a8eb --- /dev/null +++ b/shared/data_struct/linked_list.h @@ -0,0 +1,37 @@ +#pragma once +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct clinkedlist_node { + void *data; + struct clinkedlist_node *next; +} clinkedlist_node_t; + +typedef struct clinkedlist { + clinkedlist_node_t *head; + clinkedlist_node_t *tail; + uint64_t length; +} clinkedlist_t; + +extern uintptr_t malloc(uint64_t size); +extern void free(void *ptr, uint64_t size); + +clinkedlist_t *clinkedlist_create(void); +void clinkedlist_destroy(clinkedlist_t *list); +clinkedlist_t *clinkedlist_clone(const clinkedlist_t *list); +void clinkedlist_push_front(clinkedlist_t *list, void *data); +void *clinkedlist_pop_front(clinkedlist_t *list); +clinkedlist_node_t *clinkedlist_insert_after(clinkedlist_t *list, clinkedlist_node_t *node, void *data); +void *clinkedlist_remove(clinkedlist_t *list, clinkedlist_node_t *node); +void clinkedlist_update(clinkedlist_t *list, clinkedlist_node_t *node, void *new_data); +uint64_t clinkedlist_length(const clinkedlist_t *list); +uint64_t clinkedlist_size_bytes(const clinkedlist_t *list); +clinkedlist_node_t *clinkedlist_find(clinkedlist_t *list, void *key, int (*cmp)(void *, void *)); +void clinkedlist_for_each(const clinkedlist_t *list, void (*func)(void *)); + +#ifdef __cplusplus +} +#endif diff --git a/shared/data_struct/linked_list.hpp b/shared/data_struct/linked_list.hpp new file mode 100644 index 00000000..b4781fb1 --- /dev/null +++ b/shared/data_struct/linked_list.hpp @@ -0,0 +1,139 @@ +#pragma once +#include "types.h" + +extern "C" { +#include "linked_list.h" +} + +template +class LinkedList { +private: + struct Node { + T data; + Node* next; + }; + + Node* head = nullptr; + Node* tail = nullptr; + uint64_t length = 0; + + Node* alloc_node(const T& value) { + uintptr_t mem = malloc(sizeof(Node)); + Node* n = reinterpret_cast(mem); + n->data = value; + n->next = nullptr; + return n; + } + + void free_node(Node* n) { + free(n, sizeof(Node)); + } + +public: + LinkedList() = default; + + LinkedList(const LinkedList& other) { + for (Node* it = other.head; it; it = it->next) { + push_front(it->data); + } + LinkedList tmp; + while (!empty()) tmp.push_front(pop_front()); + *this = tmp; + } + + ~LinkedList() { + while (!empty()) pop_front(); + } + + LinkedList& operator=(const LinkedList& other) { + if (this != &other) { + while (!empty()) pop_front(); + for (Node* it = other.head; it; it = it->next) { + push_front(it->data); + } + LinkedList tmp; + while (!empty()) tmp.push_front(pop_front()); + head = tmp.head; + tail = tmp.tail; + length = tmp.length; + tmp.head = tmp.tail = nullptr; + tmp.length = 0; + } + return *this; + } + + void push_front(const T& value) { + Node* n = alloc_node(value); + n->next = head; + head = n; + if (!tail) tail = n; + ++length; + } + + T pop_front() { + if (!head) return T(); + Node* n = head; + head = head->next; + if (!head) tail = nullptr; + T val = n->data; + free_node(n); + --length; + return val; + } + + Node* insert_after(Node* node, const T& value) { + if (!node) { + push_front(value); + return head; + } + Node* n = alloc_node(value); + n->next = node->next; + node->next = n; + if (tail == node) tail = n; + ++length; + return n; + } + + T remove(Node* node) { + if (!node) return T(); + if (node == head) return pop_front(); + Node* prev = head; + while (prev && prev->next != node) prev = prev->next; + if (!prev) return T(); + prev->next = node->next; + if (node == tail) tail = prev; + T val = node->data; + free_node(node); + --length; + return val; + } + + void update(Node* node, const T& value) { + if (node) node->data = value; + } + + uint64_t size() const { + return length; + } + + bool empty() const { + return length == 0; + } + + Node* begin() const { + return head; + } + + Node* end() const { + return nullptr; + } + + template + Node* find(Predicate pred) const { + for (Node* it = head; it; it = it->next) { + if (pred(it->data)) return it; + } + return nullptr; + } +}; + diff --git a/shared/data_struct/queue.c b/shared/data_struct/queue.c new file mode 100644 index 00000000..957ea22d --- /dev/null +++ b/shared/data_struct/queue.c @@ -0,0 +1,69 @@ +#include "queue.h" +#include "std/memfunctions.h" + +void cqueue_init(CQueue* q, uint64_t max_capacity, uint64_t elem_size) { + q->buffer = NULL; + q->capacity = max_capacity; + q->max_capacity = max_capacity; + q->elem_size = elem_size; + q->head = q->tail = q->length = 0; + if (max_capacity > 0) { + uintptr_t b = malloc(max_capacity * elem_size); + if (b) q->buffer = (void*)b; + } +} + +int32_t cqueue_enqueue(CQueue* q, const void* item) { + if (!q) return 0; + if (q->max_capacity > 0) { + if (q->length == q->capacity) return 0; + } else { + if (q->length == q->capacity) { + uint64_t nc = q->capacity > 0 ? q->capacity * 2 : 4; + uintptr_t nb = malloc(nc * q->elem_size); + if (!nb) return 0; + void* newb = (void*)nb; + for (uint64_t i = 0; i < q->length; ++i) { + uint64_t idx = (q->tail + i) % q->capacity; + memcpy((uint8_t*)newb + i * q->elem_size, + (uint8_t*)q->buffer + idx * q->elem_size, + q->elem_size); + } + if (q->buffer) free(q->buffer, q->capacity * q->elem_size); + q->buffer = newb; + q->capacity = nc; + q->head = q->length; + q->tail = 0; + } + } + memcpy((uint8_t*)q->buffer + q->head * q->elem_size, item, q->elem_size); + q->head = (q->head + 1) % q->capacity; + q->length++; + return 1; +} + +int32_t cqueue_dequeue(CQueue* q, void* out) { + if (!q || q->length == 0) return 0; + memcpy(out, (uint8_t*)q->buffer + q->tail * q->elem_size, q->elem_size); + q->tail = (q->tail + 1) % q->capacity; + q->length--; + return 1; +} + +int32_t cqueue_is_empty(const CQueue* q) { + return (!q || q->length == 0) ? 1 : 0; +} + +uint64_t cqueue_size(const CQueue* q) { + return q ? q->length : 0; +} + +void cqueue_clear(CQueue* q) { + if (!q) return; + q->head = q->tail = q->length = 0; +} + +void cqueue_destroy(CQueue* q) { + if (!q) return; + if (q->buffer) free(q->buffer, q->capacity * q->elem_size); +} diff --git a/shared/data_struct/queue.h b/shared/data_struct/queue.h new file mode 100644 index 00000000..531d3089 --- /dev/null +++ b/shared/data_struct/queue.h @@ -0,0 +1,31 @@ +#pragma once +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct CQueue { + void* buffer; + uint64_t capacity; // current queue size + uint64_t max_capacity; // 0 = infinite + uint64_t elem_size; + uint64_t head; + uint64_t tail; + uint64_t length; +} CQueue; + +extern uintptr_t malloc(uint64_t); +extern void free(void*, uint64_t); + +void cqueue_init(CQueue* q, uint64_t max_capacity, uint64_t elem_size); +int32_t cqueue_enqueue(CQueue* q, const void* item); +int32_t cqueue_dequeue(CQueue* q, void* out); +int32_t cqueue_is_empty(const CQueue* q); +uint64_t cqueue_size(const CQueue* q); +void cqueue_clear(CQueue* q); +void cqueue_destroy(CQueue* q); + +#ifdef __cplusplus +} +#endif diff --git a/shared/data_struct/queue.hpp b/shared/data_struct/queue.hpp new file mode 100644 index 00000000..fe02fb9c --- /dev/null +++ b/shared/data_struct/queue.hpp @@ -0,0 +1,87 @@ +#pragma once +#include "types.h" +#include "std/string.h" +#include "std/memfunctions.h" +#include "queue.h" + +template +class Queue { +public: + explicit Queue(uint64_t capacity = 0) { + max_capacity = capacity; + this->capacity = capacity; + if (capacity > 0) { + uintptr_t mem = malloc(capacity * sizeof(T)); + if (mem) { + buffer = reinterpret_cast(mem); + } + } + } + + ~Queue() { + if (buffer) { + free(buffer, capacity * sizeof(T)); + } + } + + bool enqueue(const T& value) { + if (max_capacity > 0 && length == capacity) return false; + if (max_capacity == 0 && length == capacity) grow_if_needed(); + if (!buffer) return false; + + buffer[head] = value; + head = (head + 1) % capacity; + ++length; + return true; + } + + bool dequeue(T& out) { + if (length == 0 || !buffer) return false; + out = buffer[tail]; + tail = (tail + 1) % capacity; + --length; + return true; + } + + bool is_empty() const { + return length == 0; + } + + uint64_t size() const { + return length; + } + + void clear() { + head = tail = length = 0; + } + +private: + T* buffer = nullptr; + uint64_t capacity = 0; + uint64_t max_capacity = 0; // 0 infinite + uint64_t head = 0; + uint64_t tail = 0; + uint64_t length = 0; + + void grow_if_needed() { + uint64_t new_cap = (capacity > 0) ? capacity * 2 : 4; + uintptr_t new_mem = malloc(new_cap * sizeof(T)); + if (!new_mem) return; + + T* new_buf = reinterpret_cast(new_mem); + for (uint64_t i = 0; i < length; ++i) { + uint64_t idx = (tail + i) % capacity; + new_buf[i] = buffer[idx]; + } + + if (buffer) { + free(buffer, capacity * sizeof(T)); + } + + buffer = new_buf; + capacity = new_cap; + tail = 0; + head = length; + } +}; + diff --git a/shared/data_struct/ring_buffer.c b/shared/data_struct/ring_buffer.c new file mode 100644 index 00000000..67429799 --- /dev/null +++ b/shared/data_struct/ring_buffer.c @@ -0,0 +1,57 @@ +#include "ring_buffer.h" +#include "std/memfunctions.h" + +void cring_init(CRingBuffer* rb, void* storage, uint64_t capacity, uint64_t elem_size) { + rb->buffer = storage; + rb->capacity = capacity; + rb->element_size = elem_size; + rb->head = rb->tail = 0; + rb->full = 0; +} + +uint64_t cring_capacity(const CRingBuffer* rb) { + return rb->capacity; +} + +int32_t cring_push(CRingBuffer* rb, const void* item) { + if (rb->full) return 0; + + uint8_t* base = (uint8_t*)rb->buffer; + void* dest = base + (rb->head * rb->element_size); + + for (uint64_t i = 0; i < rb->element_size; ++i) { + ((uint8_t*)dest)[i] = ((const uint8_t*)item)[i]; + } + + rb->head = (rb->head + 1) % rb->capacity; + rb->full = (rb->head == rb->tail); + return 1; +} + +int32_t cring_pop(CRingBuffer* rb, void* out) { + if (!rb->full && (rb->head == rb->tail)) return 0; + + uint8_t* base = (uint8_t*)rb->buffer; + void* src = base + (rb->tail * rb->element_size); + + for (uint64_t i = 0; i < rb->element_size; ++i) { + ((uint8_t*)out)[i] = ((uint8_t*)src)[i]; + } + + rb->tail = (rb->tail + 1) % rb->capacity; + rb->full = 0; + return 1; +} + +int32_t cring_is_empty(const CRingBuffer* rb) { + return (!rb->full && (rb->head == rb->tail)); +} + +int32_t cring_is_full(const CRingBuffer* rb) { + return rb->full; +} + +void cring_clear(CRingBuffer* rb) { + rb->head = rb->tail = 0; + rb->full = 0; +} diff --git a/shared/data_struct/ring_buffer.h b/shared/data_struct/ring_buffer.h new file mode 100644 index 00000000..958b9da5 --- /dev/null +++ b/shared/data_struct/ring_buffer.h @@ -0,0 +1,27 @@ +#pragma once +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct CRingBuffer { + void* buffer; + uint64_t capacity; + uint64_t element_size; + uint64_t head; + uint64_t tail; + int32_t full; +} CRingBuffer; + +void cring_init(CRingBuffer* rb, void* storage, uint64_t capacity, uint64_t elem_size); +int32_t cring_push(CRingBuffer* rb, const void* item); +int32_t cring_pop(CRingBuffer* rb, void* out); +int32_t cring_is_empty(const CRingBuffer* rb); +int32_t cring_is_full(const CRingBuffer* rb); +void cring_clear(CRingBuffer* rb); +uint64_t cring_capacity(const CRingBuffer* rb); + +#ifdef __cplusplus +} +#endif diff --git a/shared/data_struct/ring_buffer.hpp b/shared/data_struct/ring_buffer.hpp new file mode 100644 index 00000000..c798f23f --- /dev/null +++ b/shared/data_struct/ring_buffer.hpp @@ -0,0 +1,66 @@ +#pragma once +#include "types.h" + +template +class RingBuffer { +private: + T data[Capacity]; + uint64_t head = 0; + uint64_t tail = 0; + int32_t full = 0; + +public: + RingBuffer() : head(0), tail(0), full(0) {} + + int32_t push(const T& item) { + if (full) return 0; + data[head] = item; + head = (head + 1) % Capacity; + full = (head == tail); + return 1; + } + + int32_t pop(T& out) { + if (is_empty()) return 0; + out = data[tail]; + tail = (tail + 1) % Capacity; + full = 0; + return 1; + } + + int32_t is_empty() const { + return (!full && head == tail); + } + + int32_t is_full() const { + return full; + } + + void clear() { + head = tail = 0; + full = 0; + } + + uint64_t size() const { + if (full) return Capacity; + if (head >= tail) return head - tail; + return Capacity + head - tail; + } + + static constexpr uint64_t capacity() { + return Capacity; + } + + const T& peek() const { + return data[tail]; + } + + const T& at(uint32_t index) const { + return data[(tail + index) % Capacity]; + } + + T& at(uint32_t index) { + return data[(tail + index) % Capacity]; + } +}; + diff --git a/shared/input_keycodes.h b/shared/input_keycodes.h index 7804ef94..14576eb5 100644 --- a/shared/input_keycodes.h +++ b/shared/input_keycodes.h @@ -9,6 +9,7 @@ extern "C" { #define KEY_ARROW_RIGHT 0x4F #define KEY_BACKSPACE 0x2A #define KEY_ENTER 0x28 +#define KEY_KEYPAD_ENTER 0x58 #define KEY_ESC 0x29 #define KEY_MOD_CMD 0x8 diff --git a/shared/net/dhcp.c b/shared/net/dhcp.c index 9e098070..9c6661cb 100644 --- a/shared/net/dhcp.c +++ b/shared/net/dhcp.c @@ -16,7 +16,7 @@ void create_dhcp_packet(uintptr_t p, dhcp_request *payload){ .htype = 1,//Ethernet .hlen = 6,//Mac length .hops = 0, - .xid = rng_next32(&global_rng),//Transaction ID: RANDOM + .xid = rng_next32(&global_rng),//Transaction ID .secs = 0, .flags = __builtin_bswap16(0x8000),//Broadcast .ciaddr = 0, diff --git a/shared/std/memfunctions.c b/shared/std/memfunctions.c index 1faa8314..fef21cb1 100644 --- a/shared/std/memfunctions.c +++ b/shared/std/memfunctions.c @@ -1,27 +1,42 @@ #include "memfunctions.h" -int memcmp(const void *s1, const void *s2, unsigned long n) { +int memcmp(const void *s1, const void *s2, unsigned long count) { const unsigned char *a = s1; const unsigned char *b = s2; - for (unsigned long i = 0; i < n; i++) { + for (unsigned long i = 0; i < count; i++) { if (a[i] != b[i]) return a[i] - b[i]; } return 0; } -void *memset(void *dest, int val, unsigned long count) { - unsigned char *ptr = dest; - while (count--) { - *ptr++ = (unsigned char)val; +void* memset(void* dest, uint32_t val, size_t count) { + uint64_t *d64 = (uint64_t *)dest; + uint64_t pattern = ((uint64_t)val << 32) | val; + + uint64_t blocks = count / 32; + for (uint64_t i = 0; i < blocks; i++) { + d64[0] = pattern; + d64[1] = pattern; + d64[2] = pattern; + d64[3] = pattern; + d64 += 4; } + + uint64_t remaining = (count % 32) / 8; + for (uint64_t i = 0; i < remaining; i++) d64[i] = pattern; + + uint8_t *d8 = (uint8_t *)(d64 + remaining); + uint8_t byte_val = val & 0xFF; + for (uint64_t i = 0; i < count % 8; i++) d8[i] = byte_val; + return dest; } -void *memcpy(void *dest, const void *src, uint64_t n) { +void* memcpy(void *dest, const void *src, uint64_t count) { uint64_t *d64 = (uint64_t *)dest; const uint64_t *s64 = (const uint64_t *)src; - uint64_t blocks = n / 32; + uint64_t blocks = count / 32; for (uint64_t i = 0; i < blocks; i++) { d64[0] = s64[0]; d64[1] = s64[1]; @@ -31,14 +46,12 @@ void *memcpy(void *dest, const void *src, uint64_t n) { s64 += 4; } - uint64_t remaining = (n % 32) / 8; - for (uint64_t i = 0; i < remaining; i++) { - d64[i] = s64[i]; - } + uint64_t remaining = (count % 32) / 8; + for (uint64_t i = 0; i < remaining; i++) d64[i] = s64[i]; uint8_t *d8 = (uint8_t *)(d64 + remaining); const uint8_t *s8 = (const uint8_t *)(s64 + remaining); - for (uint64_t i = 0; i < n % 8; i++) d8[i] = s8[i]; + for (uint64_t i = 0; i < count % 8; i++) d8[i] = s8[i]; return dest; } \ No newline at end of file diff --git a/shared/std/memfunctions.h b/shared/std/memfunctions.h index dfafaeeb..f8bb15b7 100644 --- a/shared/std/memfunctions.h +++ b/shared/std/memfunctions.h @@ -4,9 +4,9 @@ extern "C" { #include "types.h" -int memcmp(const void *s1, const void *s2, unsigned long n); -void *memset(void *dest, int val, unsigned long count); -void *memcpy(void *dest, const void *src, uint64_t n); +int memcmp(const void *s1, const void *s2, unsigned long count); +void* memset(void* dest, uint32_t val, size_t count); +void* memcpy(void *dest, const void *src, uint64_t count); #ifdef __cplusplus } diff --git a/shared/std/string.c b/shared/std/string.c index b0ee1623..f67fbe0a 100644 --- a/shared/std/string.c +++ b/shared/std/string.c @@ -3,21 +3,26 @@ #include "memory/memory_access.h" #include "std/memfunctions.h" -static uint32_t compute_length( char *s, uint32_t max_length) { +static uint32_t compute_length(char *s, uint32_t max_length){ + if (s == NULL) return 0; + uint32_t len = 0; - while ((max_length == 0 || len < max_length) && s[len] != '\0') { - len++; - } + while ((max_length == 0 || len < max_length) && s[len] != '\0') len++; + return len; } -string string_l( char *literal) { +string string_l(char *literal){ + if (literal == NULL) return (string){ .data = NULL, .length = 0, .mem_length = 0}; + uint32_t len = compute_length(literal, 0); - char *buf = (char*)malloc(len+1); - for (uint32_t i = 0; i < len; i++) - buf[i] = literal[i]; - buf[len] = 0; - return (string){ .data = buf, .length = len, .mem_length = len+1 }; + char *buf = (char*)malloc(len + 1); + if (!buf) return (string){ .data = NULL, .length = 0, .mem_length = 0 }; + + for (uint32_t i = 0; i < len; i++) buf[i] = literal[i]; + + buf[len] = '\0'; + return (string){ .data = buf, .length = len, .mem_length = len + 1 }; } string string_repeat(char symbol, uint32_t amount){ @@ -27,33 +32,42 @@ string string_repeat(char symbol, uint32_t amount){ return (string){ .data = buf, .length = amount, .mem_length = amount+1 }; } -string string_tail( char *array, uint32_t max_length){ +string string_tail(char *array, uint32_t max_length){ + + if (array == NULL) return (string){ .data = NULL, .length = 0, .mem_length = 0 }; + uint32_t len = compute_length(array, 0); - int offset = len-max_length; - if (offset < 0) - offset = 0; + int offset = (int)len - (int)max_length; + if (offset < 0) offset = 0; + uint32_t adjusted_len = len - offset; char *buf = (char*)malloc(adjusted_len + 1); - for (uint32_t i = offset; i < len; i++) - buf[i-offset] = array[i]; - buf[len-offset] = 0; - return (string){ .data = buf, .length = adjusted_len }; + if (!buf) return (string){ .data = NULL, .length = 0, .mem_length = 0 }; + + for (uint32_t i = 0; i < adjusted_len; i++) buf[i] = array[offset + i]; + + buf[adjusted_len] = '\0'; + return (string){.data = buf, .length = adjusted_len, .mem_length = adjusted_len + 1 }; } -string string_ca_max( char *array, uint32_t max_length) { +string string_ca_max(char *array, uint32_t max_length){ + if (array == NULL) return (string){.data = NULL, .length = 0, .mem_length= 0 }; + uint32_t len = compute_length(array, max_length); char *buf = (char*)malloc(len + 1); - for (uint32_t i = 0; i < len; i++) - buf[i] = array[i]; - buf[len] = 0; - return (string){ .data = buf, .length = len }; + if(!buf) return (string){ .data = NULL, .length = 0, .mem_length=0 }; + + for (uint32_t i = 0; i < len; i++) buf[i] = array[i]; + + buf[len] = '\0'; + return (string){ .data = buf, .length = len, .mem_length = len+1}; } string string_c( char c){ char *buf = (char*)malloc(2); buf[0] = c; buf[1] = 0; - return (string){ .data = buf, .length = 1, .mem_length = 2 }; + return (string){.data = buf, .length = 1, .mem_length = 2}; } uint32_t parse_hex(uint64_t value, char* buf){ @@ -68,6 +82,7 @@ uint32_t parse_hex(uint64_t value, char* buf){ started = true; buf[len++] = curr_char; } + if (i == 0) break; } @@ -75,7 +90,7 @@ uint32_t parse_hex(uint64_t value, char* buf){ return len; } -string string_from_hex(uint64_t value) { +string string_from_hex(uint64_t value){ char *buf = (char*)malloc(18); uint32_t len = parse_hex(value, buf); return (string){ .data = buf, .length = len, .mem_length = 18 }; @@ -86,12 +101,13 @@ uint32_t parse_bin(uint64_t value, char* buf){ buf[len++] = '0'; buf[len++] = 'b'; bool started = false; - for (uint32_t i = 63;; i --) { + for (uint32_t i = 63;; i --){ char bit = (value >> i) & 1 ? '1' : '0'; - if (started || bit != '0' || i == 0) { + if (started || bit != '0' || i == 0){ started = true; buf[len++] = bit; } + if (i == 0) break; } @@ -99,45 +115,51 @@ uint32_t parse_bin(uint64_t value, char* buf){ return len; } -string string_from_bin(uint64_t value) { +string string_from_bin(uint64_t value){ char *buf = (char*)malloc(66); uint32_t len = parse_bin(value, buf); return (string){ .data = buf, .length = len, .mem_length = 66 }; } -bool string_equals(string a, string b) { +bool string_equals(string a, string b){ return strcmp(a.data,b.data, false) == 0; } -string string_format( char *fmt, ...) { +string string_format(char *fmt, ...){ + if (fmt == NULL) return (string){ .data = NULL, .length = 0, .mem_length = 0}; + va_list args; va_start(args, fmt); - string_format_va(fmt, args); + string result = string_format_va(fmt, args); va_end(args); + return result; } -string string_format_va( char *fmt, va_list args){ +string string_format_va(char *fmt, va_list args){ char *buf = (char*)malloc(256); uint32_t len = 0; uint32_t arg_index = 0; - - for (uint32_t i = 0; fmt[i] && len < 255; i++) { - if (fmt[i] == '%' && fmt[i+1]) { + for (uint32_t i = 0; fmt[i] && len < 255; i++){ + if (fmt[i] == '%' && fmt[i+1]){ i++; - if (fmt[i] == 'x') { + if (fmt[i] == 'x'){ uint64_t val = va_arg(args, uint64_t); len += parse_hex(val,(char*)(buf + len)); + } else if (fmt[i] == 'b') { uint64_t val = va_arg(args, uint64_t); string bin = string_from_bin(val); - for (uint32_t j = 0; j < bin.length && len < 255; j++) buf[len++] = bin.data[j]; + for(uint32_t j = 0; j < bin.length && len < 255; j++) buf[len++] = bin.data[j]; free(bin.data,bin.mem_length); + } else if (fmt[i] == 'c') { uint64_t val = va_arg(args, uint64_t); buf[len++] = (char)val; + } else if (fmt[i] == 's') { char *str = ( char *)va_arg(args, uintptr_t); for (uint32_t j = 0; str[j] && len < 255; j++) buf[len++] = str[j]; + } else if (fmt[i] == 'i') { uint64_t val = va_arg(args, long int); char temp[21]; @@ -149,38 +171,36 @@ string string_format_va( char *fmt, va_list args){ buf[len++] = '-'; val = (uint64_t)(-(int)val); } - + do { temp[temp_len++] = '0' + (val % 10); val /= 10; } while (val && temp_len < 20); - for (int j = temp_len - 1; j >= 0 && len < 255; j--) { + for (int j = temp_len - 1; j >= 0 && len < 255; j--){ buf[len++] = temp[j]; } - }else if (fmt[i] == 'f' || fmt[i] == 'd') { + } else if (fmt[i] == 'f' || fmt[i] == 'd') { double val = va_arg(args, double); - if (val < 0) { + if (val < 0){ buf[len++] = '-'; val = -val; } - uint64_t whole = (uint64_t)val; double frac = val - (double)whole; char temp[21]; uint32_t temp_len = 0; do { - temp[temp_len++] = '0' + (whole % 10); + temp[temp_len++] = '0' +(whole % 10); whole /= 10; - } while (whole && temp_len < 20); + } while(whole && temp_len < 20); - for (int j = temp_len - 1; j >= 0 && len < 255; j--) { + for (int j = temp_len - 1; j >= 0 && len < 255; j--){ buf[len++] = temp[j]; } - if (len < 255) buf[len++] = '.'; - + for (int d = 0; d < 6 && len < 255; d++) { frac *= 10; int digit = (int)frac; @@ -196,7 +216,7 @@ string string_format_va( char *fmt, va_list args){ } } - buf[len] = 0; + buf[len]=0; return (string){ .data = buf, .length = len, .mem_length = 256 }; } @@ -205,31 +225,33 @@ char tolower(char c){ return c; } -int strcmp(char *a, char *b, bool case_insensitive) { - while (*a && *b) { +int strcmp(char *a, char *b, bool case_insensitive){ + if (a == NULL && b == NULL)return 0; //i guess + if (a == NULL) return -1; + if (b == NULL) return 1; + + while (*a && *b){ char ca = *a; char cb = *b; - - if (case_insensitive) { + if (case_insensitive){ ca = tolower((unsigned char)ca); cb = tolower((unsigned char)cb); } - - if (ca != cb) return ca - cb; - + if (ca != cb) return ca - cb; a++; b++; } - if (case_insensitive) return tolower(*a) - tolower(*b); - return *a - *b; + if (case_insensitive) return tolower((unsigned char)*a) - tolower((unsigned char)*b); + + return (unsigned char)*a - (unsigned char)*b; } -int strstart(char *a, char *b, bool case_insensitive) { +int strstart(char *a, char *b, bool case_insensitive){ int index = 0; - while (*a && *b) { + while (*a && *b){ char ca = *a; char cb = *b; - if (case_insensitive) { + if (case_insensitive){ ca = tolower(ca); cb = tolower(cb); } @@ -240,8 +262,8 @@ int strstart(char *a, char *b, bool case_insensitive) { return 0; } -int strindex( char *a, char *b) { - for (int i = 0; a[i]; i++) { +int strindex( char *a, char *b){ + for (int i = 0; a[i]; i++){ int j = 0; while (b[j] && a[i + j] == b[j]) j++; if (!b[j]) return i; @@ -249,14 +271,14 @@ int strindex( char *a, char *b) { return -1; } -int strend(char *a, char *b, bool case_insensitive) { - while (*a && *b) { +int strend(char *a, char *b, bool case_insensitive){ + while (*a && *b){ char ca = case_insensitive ? tolower((unsigned char)*a) : *a; char cb = case_insensitive ? tolower((unsigned char)*b) : *b; - if (ca == cb) { + if (ca == cb){ char *pa = a, *pb = b; - while (1) { + while (1){ char cpa = case_insensitive ? tolower((unsigned char)*pa) : *pa; char cpb = case_insensitive ? tolower((unsigned char)*pb) : *pb; @@ -271,10 +293,10 @@ int strend(char *a, char *b, bool case_insensitive) { return 1; } -bool strcont( char *a, char *b) { - while (*a) { +bool strcont( char *a, char *b){ + while (*a){ char *p = a, *q = b; - while (*p && *q && *p == *q) { + while (*p && *q && *p == *q){ p++; q++; } if (*q == 0) return 1; @@ -283,7 +305,7 @@ bool strcont( char *a, char *b) { return 0; } -bool utf16tochar( uint16_t* str_in, char* out_str, size_t max_len) { +bool utf16tochar(uint16_t* str_in, char* out_str, size_t max_len){ size_t out_i = 0; for (int i = 0; i < max_len && str_in[i]; i++){ uint16_t wc = str_in[i]; @@ -293,9 +315,9 @@ bool utf16tochar( uint16_t* str_in, char* out_str, size_t max_len) { return true; } -uint64_t parse_hex_u64(char* str, size_t size) { +uint64_t parse_hex_u64(char* str, size_t size){ uint64_t result = 0; - for (uint32_t i = 0; i < size; i++) { + for (uint32_t i = 0; i < size; i++){ char c = str[i]; uint8_t digit = 0; if (c >= '0' && c <= '9') digit = c - '0'; @@ -305,4 +327,4 @@ uint64_t parse_hex_u64(char* str, size_t size) { result = (result << 4) | digit; } return result; -} \ No newline at end of file +} diff --git a/shared/types.h b/shared/types.h index 0b6dc865..a787599d 100644 --- a/shared/types.h +++ b/shared/types.h @@ -19,6 +19,7 @@ typedef unsigned char uint8_t; #define UINT64_MAX 0xFFFFFFFFFFFFFFFFULL #define UINT16_MAX 0xFFFF +#define UINT32_MAX 0xFFFFFFFF typedef int int32_t; typedef long int64_t; diff --git a/shared/ui/draw/draw.c b/shared/ui/draw/draw.c index eb0680b2..e19a301c 100644 --- a/shared/ui/draw/draw.c +++ b/shared/ui/draw/draw.c @@ -1,6 +1,7 @@ #include "draw.h" #include "graph/font8x8_bridge.h" #include "kstring.h" +#include "std/memfunctions.h" #define line_height char_size + 2 @@ -61,9 +62,7 @@ void mark_dirty(uint32_t x, uint32_t y, uint32_t w, uint32_t h) { } void fb_clear(uint32_t* fb, uint32_t color) { - for (uint32_t i = 0; i < max_width * max_height; i++) { - fb[i] = color; - } + memset(fb, color, stride * max_height); full_redraw = true; } diff --git a/user/Makefile b/user/Makefile index fb6b8328..a9799437 100644 --- a/user/Makefile +++ b/user/Makefile @@ -1,25 +1,24 @@ -ARCH= aarch64-none-elf -CC = $(ARCH)-gcc -LD = $(ARCH)-ld -OBJCOPY = $(ARCH)-objcopy +#user +CFLAGS := $(CFLAGS_BASE) -I. -I../shared -Wno-unused-parameter +LDFLAGS := -T $(shell ls *.ld) -CFLAGS = -g -O0 -std=c17 -nostdlib -ffreestanding -Wall -Wextra -mcpu=cortex-a72 -I. -I../shared -Wno-unused-parameter -LDFLAGS = -T $(shell ls *.ld) +CLEAN_OBJS := $(shell find . -name '*.o') +C_SRC := $(shell find . -name '*.c') +CPP_SRC := $(shell find . -name '*.cpp') +OBJ := $(C_SRC:.c=.o) $(CPP_SRC:.cpp=.o) -C_SRC = $(shell find . -name '*.c') -CPP_SRC = $(shell find . -name '*.cpp') -OBJ = $(C_SRC:.c=.o) $(CPP_SRC:.cpp=.o) +NAME := $(notdir $(CURDIR)) +ELF := $(NAME).elf +TARGET := $(NAME).bin +LOCATION := ../fs/redos/user/ -NAME = $(shell basename "$$PWD") -TARGET = $(NAME).bin -ELF = $(NAME).elf -LOCATION = ../fs/redos/user/ +.PHONY: all clean -all: $(TARGET) +all: $(LOCATION)$(TARGET) -$(TARGET): $(OBJ) +$(LOCATION)$(TARGET): $(OBJ) $(LD) $(LDFLAGS) -o $(LOCATION)$(ELF) $(OBJ) ../shared/libshared.a - $(OBJCOPY) -O binary $(LOCATION)$(ELF) $(LOCATION)$(TARGET) + $(OBJCOPY) -O binary $(LOCATION)$(ELF) $@ %.o: %.S $(CC) $(CFLAGS) -c $< -o $@ @@ -28,7 +27,7 @@ $(TARGET): $(OBJ) $(CC) $(CFLAGS) -c $< -o $@ %.o: %.cpp - $(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -fno-rtti -c $< -o $@ clean: - rm -f $(shell find . -name '*.o') $(TARGET) \ No newline at end of file + rm -f $(CLEAN_OBJS) $(TARGET) diff --git a/user/default_process.c b/user/default_process.c index 4d9d644e..345af5f9 100644 --- a/user/default_process.c +++ b/user/default_process.c @@ -15,10 +15,10 @@ void proc_func() { if (kp.keys[0] == KEY_ESC) halt(); } - clear_screen(0xFFFFFF); - draw_primitive_rect(&rect, 0x222233); + clear_screen(0xFFFFFFFF); + draw_primitive_rect(&rect, 0xFF222233); string s = string_l("Print screen test"); - draw_primitive_string(&s,&rect.point,2, 0xFFFFFF); + draw_primitive_string(&s,&rect.point,2, 0xFFFFFFFF); free(s.data,s.mem_length); gpu_flush_data(); }