├── Makefile ├── README.md ├── bb.py ├── bin └── dtc ├── bin2header.py ├── bitfile └── zybo │ ├── Makefile │ ├── base.xdc │ ├── system_wrapper.v │ ├── zybo_synth.tcl │ ├── zybobsd.bin │ └── zybobsd.bit ├── boot.bif ├── bootdef.h ├── canoncpio.c ├── clearreg.c ├── data ├── conf_static_ip ├── data │ └── unused ├── default.prop ├── dev │ └── unused ├── fpgajtag ├── init ├── init.goldfish.rc ├── init.rc ├── init.trace.rc ├── init.usb.rc ├── init.xilinxzynqplatform.rc ├── lib │ ├── firmware │ │ └── ath6k │ │ │ └── AR6003 │ │ │ └── hw2.1.1 │ │ │ ├── athwlan.bin │ │ │ ├── bdata.SD31.bin │ │ │ ├── bdata.SD32.bin │ │ │ ├── bdata.WB31.bin │ │ │ ├── bdata.bin │ │ │ ├── data.patch.bin │ │ │ ├── endpointping.bin │ │ │ ├── fw-2.bin │ │ │ ├── fw-3.bin │ │ │ └── otp.bin │ └── modules ├── proc │ └── unused ├── sbin │ ├── adbd │ └── ueventd ├── sys │ └── unused ├── system │ └── unused ├── ueventd.rc ├── ueventd.xilinxzynqplatform.rc └── zynqmodules.sh ├── dts ├── skeleton.dtsi ├── zynq-7000.dtsi ├── zynq-parallella.dts ├── zynq-zc702.dts ├── zynq-zc706.dts ├── zynq-zedboard.dts └── zynq-zybo.dts ├── dumpbootbin.c ├── elfdef.h ├── imagefiles ├── filesystems.md5sum ├── portalmem.ko ├── timelimit ├── webserver ├── zImage ├── zynq-miniitx100-portal.dts ├── zynq-zc702-portal.dts ├── zynq-zc706-portal.dts ├── zynq-zedboard-portal.dts ├── zynq-zybo-portal.dts ├── zynq_miniitx100_fsbl.elf ├── zynq_zc702_fsbl.elf ├── zynq_zc706_fsbl.elf ├── zynq_zedboard_fsbl.elf ├── zynq_zybo_fsbl.elf └── zynqportal.ko ├── init.debug.patch ├── reserved_for_interrupts.S ├── test ├── Makefile ├── convert.lds ├── data │ ├── ._bootgen │ ├── bootbase.bin │ ├── vivado │ │ ├── ._base_demo.elf │ │ ├── ._boot.bif │ │ ├── ._fsbl.elf │ │ ├── ._system_wrapper.bit │ │ ├── Makefile │ │ ├── base_demo.elf │ │ ├── boot.bif │ │ ├── fsbl.elf │ │ └── system_wrapper.bit │ ├── zyboapp.elf │ └── zybofsbl.elf └── testout.bif ├── ubuntu └── ubuntu-16.04-fixes.diff ├── update_bootbin_mac.py ├── xbootgen.c ├── xx.setup_i2c_hdmio └── zynq_linux_boot.lds /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | BUILD_OS := $(shell uname) 3 | 4 | CONNECTALDIR ?= ../connectal 5 | BRANCH?=connectal-xilinx-v2016.1 6 | ifeq ($(BRANCH),old) 7 | LINUX_KERNEL_BRANCH=connectal-2014.04 8 | DEFCONFIG=xilinx_zynq_portal_atheros_sdio_defconfig 9 | KERNELID=3.9.0-00055-g6f85fcc 10 | DTS_FILENAME=imagefiles/zynq-$(BOARD)-portal.dts 11 | endif 12 | ifeq ($(BRANCH),connectal-xilinx-v2014.4-trd) 13 | LINUX_KERNEL_BRANCH=connectal-xilinx-v2014.4-trd 14 | DEFCONFIG=xilinx_zynq_portal_defconfig 15 | KERNELID=3.17.0-00013-g1a80225 16 | DTS_FILENAME=dts/zynq-$(BOARD).dts 17 | endif 18 | ifeq ($(BRANCH),connectal-xilinx-v2016.1) 19 | LINUX_KERNEL_BRANCH=connectal-xilinx-v2016.1 20 | DEFCONFIG=xilinx_zynq_portal_defconfig 21 | KERNELID=4.4.0-00018-g637e5c4 22 | OS?=ubuntu 23 | DTS_FILENAME=linux-xlnx/arch/arm/boot/dts/zynq-connectal-$(BOARD)-$(OS).dts 24 | endif 25 | INITRD_SIZE=512 26 | 27 | ifeq ($(BUILD_OS), Darwin) 28 | MD5PROG = md5 29 | DTC=./bin/dtc 30 | MACHEADERS = HOSTCFLAGS="-I../mac_linux_headers" 31 | else 32 | MD5PROG = md5sum 33 | DTC=./bin/dtc 34 | endif 35 | MKFS=/sbin/mkfs 36 | 37 | #BOOTBIN_NDK_OBJDUMP?=arm-none-linux-gnueabi-objdump 38 | BOOTBIN_NDK_OBJDUMP?=$(shell ndk-which objdump) 39 | PREFIX?=$(BOOTBIN_NDK_OBJDUMP:%-objdump=%-) 40 | 41 | KERNEL_CROSS?=arm-linux-gnueabi- 42 | 43 | DELETE_TEMP_FILES?=1 44 | 45 | targetnames = bootbin sdcard all 46 | 47 | all: 48 | @echo "Please type one of the following:" 49 | @echo " make sdcard-zynq.zip" 50 | @echo " make bootbin.zedboard" 51 | @echo " make sdcard.zedboard" 52 | @echo " make all.zedboard" 53 | @echo " make bootbin.zc702" 54 | @echo " make sdcard.zc702" 55 | @echo " make all.zc702" 56 | @echo " make bootbin.zc706" 57 | @echo " make sdcard.zc706" 58 | @echo " make all.zc706" 59 | @echo " make bootbin.miniitx100" 60 | @echo " make sdcard.miniitx100" 61 | @echo " make all.miniitx100" 62 | @echo " make bootbin.zybo" 63 | @echo " make sdcard.zybo" 64 | @echo " make all.zybo" 65 | @echo " make zImage" 66 | @echo " make zynqdrivers" 67 | 68 | ################################################################################################# 69 | # zedboard 70 | zedboardtargets = $(addsuffix .zedboard, $(targetnames)) 71 | zedboardtargets: $(zedboardtargets) 72 | $(zedboardtargets): 73 | $(MAKE) BOARD=zedboard real.$(basename $@) 74 | 75 | RUNPARAMTEMP=$(subst :, ,$(RUNPARAM):5555) 76 | RUNIP=$(wordlist 1,1,$(RUNPARAMTEMP)) 77 | RUNPORT=$(wordlist 2,2,$(RUNPARAMTEMP)) 78 | 79 | update-adb: 80 | adb connect $(RUNPARAM) 81 | adb -s $(RUNIP):$(RUNPORT) push boot.bin /mnt/sdcard 82 | adb -s $(RUNIP):$(RUNPORT) reboot 83 | #$(CONNECTALDIR)/scripts/cadb $(RUNPARAM) push boot.bin /mnt/sdcard 84 | #$(CONNECTALDIR)/scripts/cadb $(RUNPARAM) reboot 85 | 86 | ################################################################################################# 87 | # zc702 88 | zc702targets = $(addsuffix .zc702, $(targetnames)) 89 | zc702targets: $(zc702targets) 90 | $(zc702targets): 91 | $(MAKE) BOARD=zc702 real.$(basename $@) 92 | ################################################################################################# 93 | # zc706 94 | zc706targets = $(addsuffix .zc706, $(targetnames)) 95 | zc706targets: $(zc706targets) 96 | $(zc706targets): 97 | $(MAKE) BOARD=zc706 real.$(basename $@) 98 | ################################################################################################# 99 | # miniitx100 100 | miniitx100targets = $(addsuffix .miniitx100, $(targetnames)) 101 | miniitx100targets: $(miniitx100targets) 102 | $(miniitx100targets): 103 | $(MAKE) BOARD=miniitx100 real.$(basename $@) 104 | ################################################################################################# 105 | # zybo 106 | zybo-BITFILE := bitfile/zybo/zybobsd.bit 107 | zybotargets = $(addsuffix .zybo, $(targetnames)) 108 | zybotargets: $(zybotargets) 109 | $(zybotargets): 110 | $(MAKE) BOARD=zybo real.$(basename $@) 111 | ################################################################################################# 112 | 113 | ifdef DAFFODIL 114 | MACBYTE=98 115 | else 116 | MACBYTE?=0x$(shell echo $(USER)$(BOARD) | $(MD5PROG) | cut -c 1-2) 117 | endif 118 | 119 | real.all: real.bootbin real.sdcard 120 | 121 | clean: 122 | ## '"make realclean" to remove downloaded files 123 | rm -fr sdcard-* boot.bin *.tmp *.elf *.gz *.hex *.o foo.map xbootgen canoncpio 124 | 125 | realclean: clean 126 | rm -fr filesystems/* 127 | 128 | real.bootbin: zcomposite.elf imagefiles/zynq_$(BOARD)_fsbl.elf xbootgen 129 | if [ -f boot.bin ]; then mv -v boot.bin boot.bin.bak; fi 130 | ./xbootgen imagefiles/zynq_$(BOARD)_fsbl.elf $($(BOARD)-BITFILE) zcomposite.elf 131 | ./update_bootbin_mac.py boot.bin $(MACBYTE) 132 | ifeq ($(DELETE_TEMP_FILES),1) 133 | rm -f zcomposite.elf 134 | endif 135 | 136 | # daffodil's zedboard uses this macaddress: 00:e0:0c:00:98:03 137 | 138 | # if [ -f $(DTC) ]; then echo $(DTC); else make $(DTC); fi 139 | INVOKE_DTC = $(DTC) -I dts -O dtb -o tmp.dtb $(DTS_FILENAME) 140 | tmp.dtb: $(DTS_FILENAME) 141 | $(INVOKE_DTC) || $(MAKE) $(DTC); $(INVOKE_DTC) 142 | 143 | zcomposite.elf: ramdisk tmp.dtb 144 | echo "******** PRINT GCC CONFIGURE OPTIONS *******" 145 | $(PREFIX)gcc -v 2>&1 146 | $(PREFIX)objcopy -I binary -B arm -O elf32-littlearm imagefiles/zImage z.tmp 147 | $(PREFIX)objcopy -I binary -B arm -O elf32-littlearm ramdisk.image.gz r.tmp 148 | $(PREFIX)objcopy -I binary -B arm -O elf32-littlearm tmp.dtb d.tmp 149 | $(PREFIX)gcc -Wall -Werror -c -DBOARD_$(BOARD) -fno-unwind-tables clearreg.c 150 | $(PREFIX)ld -e 0x1008000 -z max-page-size=0x8000 -o zcomposite.elf --script zynq_linux_boot.lds r.tmp d.tmp clearreg.o z.tmp 151 | ifeq ($(DELETE_TEMP_FILES),1) 152 | rm -f z.tmp r.tmp d.tmp clearreg.o c1.tmp clearreg.o ramdisk.image.gz tmp.dtb 153 | endif 154 | 155 | canoncpio: canoncpio.c 156 | gcc -o canoncpio canoncpio.c 157 | 158 | ramdisk: canoncpio 159 | chmod 644 data/*.rc data/*.prop 160 | cd data; (find . -name unused -o -print | sort | cpio -H newc -o >../ramdisk.image.temp1) 161 | ./canoncpio < ramdisk.image.temp1 | gzip -9 -n >ramdisk.image.temp 162 | cat ramdisk.image.temp /dev/zero | dd of=ramdisk.image.gz count=$(INITRD_SIZE) ibs=1024 163 | ifeq ($(DELETE_TEMP_FILES),1) 164 | rm -f ramdisk.image.temp ramdisk.image.temp1 165 | endif 166 | 167 | xbootgen: xbootgen.c Makefile reserved_for_interrupts.h 168 | gcc -g -o xbootgen xbootgen.c 169 | ifeq ($(DELETE_TEMP_FILES),1) 170 | rm -f reserved_for_interrupts.h 171 | endif 172 | 173 | dumpbootbin: dumpbootbin.c Makefile 174 | gcc -g -o dumpbootbin dumpbootbin.c 175 | 176 | reserved_for_interrupts.h: reserved_for_interrupts.S 177 | $(PREFIX)gcc -Wall -Werror -c reserved_for_interrupts.S 178 | $(PREFIX)ld -Ttext 0 -e 0 -o i.tmp reserved_for_interrupts.o 179 | $(PREFIX)objcopy -O binary -I elf32-little i.tmp reserved_for_interrupts.tmp 180 | ./bin2header.py reserved_for_interrupts.tmp >reserved_for_interrupts.h 181 | ifeq ($(DELETE_TEMP_FILES),1) 182 | rm -f i.tmp reserved_for_interrupts.o reserved_for_interrupts.tmp 183 | endif 184 | 185 | zynqdrivers: zImage zynqdrivers.real 186 | 187 | zynqdrivers.real: 188 | [ -d connectal ] || git clone git://github.com/cambridgehackers/connectal 189 | (set -e; cd connectal; git pull origin master; \ 190 | DEFCONFIG=$(DEFCONFIG) $(MAKE) zynqdrivers-clean; \ 191 | DEFCONFIG=$(DEFCONFIG) $(MAKE) zynqdrivers ) 192 | cp connectal/drivers/zynqportal/zynqportal.ko imagefiles 193 | cp connectal/drivers/portalmem/portalmem.ko imagefiles 194 | 195 | zImage: bin/dtc 196 | cp linux-xlnx/arch/arm/boot/zImage imagefiles/zImage 197 | 198 | real.sdcard: sdcard-$(BOARD)/system.img sdcard-$(BOARD)/userdata.img sdcard-$(BOARD)/boot.bin 199 | cp -v imagefiles/zynqportal.ko imagefiles/portalmem.ko imagefiles/timelimit imagefiles/webserver sdcard-$(BOARD)/ 200 | [ -e sdcard-$(BOARD)/$(KERNELID) ] || mkdir sdcard-$(BOARD)/$(KERNELID) 201 | echo "Files for $(BOARD) SD Card are in $(PWD)/sdcard-$(BOARD)" 202 | 203 | .PHONY: real.sdcard real.bootbin real.all real.zImage 204 | 205 | sdcard-$(BOARD)/boot.bin: 206 | mkdir -p sdcard-$(BOARD) 207 | rm -f boot.bin 208 | $(MAKE) BOARD=$(BOARD) real.bootbin 209 | mv boot.bin sdcard-$(BOARD)/boot.bin 210 | 211 | filesystems/system-130710.img.bz2: 212 | mkdir -p filesystems 213 | wget 'https://github.com/cambridgehackers/zynq-boot-filesystems/blob/system-130710/system-130710.img.bz2?raw=true' -O filesystems/system-130710.img.bz2 214 | 215 | filesystems/userdata.img.bz2: 216 | mkdir -p filesystems 217 | wget 'https://github.com/cambridgehackers/zynq-boot-filesystems/blob/userdata/userdata.img.bz2?raw=true' -O filesystems/userdata.img.bz2 218 | 219 | sdcard-$(BOARD)/system.img: filesystems/system-130710.img.bz2 220 | mkdir -p sdcard-$(BOARD) 221 | bzcat filesystems/system-130710.img.bz2 > sdcard-$(BOARD)/system.img 222 | (cd sdcard-$(BOARD); $(MD5PROG) -c ../imagefiles/filesystems.md5sum) 223 | 224 | ifeq ($(shell uname), Darwin) 225 | sdcard-$(BOARD)/userdata.img: filesystems/userdata.img.bz2 226 | mkdir -p sdcard-$(BOARD) 227 | bzcat filesystems/userdata.img.bz2 > sdcard-$(BOARD)/userdata.img 228 | else 229 | sdcard-$(BOARD)/userdata.img: 230 | mkdir -p sdcard-$(BOARD) 231 | # make a 100MB empty filesystem 232 | dd if=/dev/zero bs=1k count=102400 of=sdcard-$(BOARD)/userdata.img 233 | $(MKFS) -F -t ext4 sdcard-$(BOARD)/userdata.img 234 | endif 235 | 236 | sdcard-zynq.zip: 237 | $(MAKE) all.zedboard 238 | mv sdcard-zedboard sdcard-zynq 239 | zip sdcard-zynq.zip sdcard-zynq/*.img sdcard-zynq/timelimit sdcard-zynq/webserver 240 | mv sdcard-zynq sdcard-zedboard 241 | 242 | bootbin.zip: 243 | echo MACBYTE=$(MACBYTE) 244 | $(MAKE) all.zedboard 245 | rm -f boot.bin 246 | $(MAKE) MACBYTE=$(MACBYTE) bootbin.$(BOARD) 247 | mkdir bootbin-$(BOARD) 248 | mv -v boot.bin bootbin-$(BOARD) 249 | cp -v sdcard-zedboard/*.ko bootbin-$(BOARD) 250 | mkdir bootbin-$(BOARD)/$(KERNELID) 251 | zip bootbin-$(BOARD)-00e00c00$(MACBYTE)03.zip bootbin-$(BOARD)/* 252 | rm -fr bootbin-$(BOARD) 253 | 254 | update-zynq-boot-filesystems: 255 | rm -f *.zip 256 | $(MAKE) sdcard-zynq.zip 257 | for b in zedboard zc702 zc706; do $(MAKE) BOARD=$$b bootbin.zip; done 258 | (cd ../zynq-boot-filesystems; git checkout --orphan v$(VERSION)) 259 | cp *.zip ../zynq-boot-filesystems 260 | (cd ../zynq-boot-filesystems; git add *.zip; git commit -m "version $(VERSION)") 261 | 262 | .PHONY: bin/dtc 263 | 264 | 265 | 266 | bin/dtc: 267 | if [ -d linux-xlnx ]; then true; else git clone git://github.com/cambridgehackers/linux-xlnx.git; \ 268 | (cd linux-xlnx; git checkout origin/$(LINUX_KERNEL_BRANCH) -b $(LINUX_KERNEL_BRANCH)) fi 269 | (set -e; cd linux-xlnx; \ 270 | git fetch; \ 271 | git checkout $(LINUX_KERNEL_BRANCH); \ 272 | echo git rebase origin/$(LINUX_KERNEL_BRANCH); \ 273 | $(MAKE) ARCH=arm CROSS_COMPILE=$(KERNEL_CROSS) $(MACHEADERS) $(DEFCONFIG); \ 274 | $(MAKE) ARCH=arm CROSS_COMPILE=$(KERNEL_CROSS) $(MACHEADERS) zImage; \ 275 | $(MAKE) ARCH=arm CROSS_COMPILE=$(KERNEL_CROSS) $(MACHEADERS) modules; \ 276 | $(MAKE) ARCH=arm CROSS_COMPILE=$(KERNEL_CROSS) $(MACHEADERS) M=scripts/dtc; \ 277 | cp -fv scripts/dtc/dtc ../bin/dtc) 278 | 279 | zImage-clean: 280 | if [ -d linux-xlnx ]; then true; else git clone git://github.com/cambridgehackers/linux-xlnx.git; fi 281 | (cd linux-xlnx; \ 282 | $(MAKE) ARCH=arm CROSS_COMPILE=$(KERNEL_CROSS) $(MACHEADERS) clean) 283 | 284 | webserver: 285 | if [ -d webui ]; then true; else git clone git://github.com/cambridgehackers/webui.git; fi 286 | cd webui; ndk-build 287 | cp webui/libs/armeabi/webserver imagefiles/webserver 288 | 289 | parallella-boot: ramdisk tmp.dtb 290 | # create ouput area 291 | mkdir -p parallella-images 292 | # device tree 293 | cp dtp.tmp parallella-images/dtb 294 | # kernel 295 | $(PREFIX)gcc -c -DBOARD_$(BOARD) -fno-unwind-tables clearreg.c 296 | $(PREFIX)ld -e 0x1008000 -O binary -z max-page-size=0x8000 -o zcomposite.elf --script zynq_linux_boot.lds clearreg.o z.tmp 297 | $(PREFIX)objcopy -O binary -B arm -o pImage c.tmp zImage 298 | 299 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | zynq-boot 2 | ========= 3 | 4 | The boot.bin file is board specific and contains the MAC address for 5 | the ethernet, so you need a unique one for each type of board you use 6 | on a network. If you only have one board, you can use prebuilt images 7 | from the versioned branch of zynq-boot-filesystems: 8 | 9 | * https://github.com/cambridgehackers/zynq-boot-filesystems/tree/v15.08.1 10 | 11 | From that link, download: 12 | 13 | * https://github.com/cambridgehackers/zynq-boot-filesystems/blob/v15.08.1/sdcard-zynq.zip 14 | 15 | also download a bootbin*.zip for your board: 16 | 17 | * zedboard: https://github.com/cambridgehackers/zynq-boot-filesystems/blob/v15.08.1/bootbin-zedboard-00e00c009603.zip 18 | * zc702: https://github.com/cambridgehackers/zynq-boot-filesystems/blob/v15.08.1/bootbin-zc702-00e00c005603.zip 19 | * zc706: https://github.com/cambridgehackers/zynq-boot-filesystems/blob/v15.08.1/bootbin-zc706-00e00c004f03.zip 20 | 21 | My SD card is labeled "ZYNQ" and under Ubuntu mounts as 22 | /media/jamey/ZYNQ. On OS X it mounts as /Volumes/ZYNQ. Update the 23 | following with the path to your SD card: 24 | 25 | unzip sdcard-zynq.zip 26 | cp sdcard-zynq/* /media/jamey/ZYNQ 27 | unzip bootbin*.zip 28 | cp bootbin*03/* /media/jamey/ZYNQ 29 | 30 | Now eject your SD card, plug it into the Zynq board, and turn it on. 31 | 32 | Creating boot.bin 33 | ================= 34 | 35 | Scripts to create a boot.bin file for linux on Xilinx Zync 36 | 37 | The boot.bin file contains 4 components: 38 | 39 | 1) First Stage Boot Loader (fsbl). 40 | 41 | This file does limited initialization of the ARM processor and also 42 | initializes the DRAM controller, giving access to RAM. Note that the 43 | attached DRAM is different between zedboard/zc702. This is a binary 44 | file imported from a Xilinx tool release. If you wish to build a new 45 | one for some reason, directions are at: 46 | 47 | * http://www.wiki.xilinx.com/Build+FSBL 48 | 49 | (you need to use the Xilinx IDE to create a project and then use their 50 | Codesourcery gcc toolchain to compile). 51 | 52 | 2) zImage. 53 | 54 | This is the linux kernel, compiled from: 55 | 56 | * github.com:cambridgehackers/linux-xlnx.git 57 | 58 | 3) ramdisk. 59 | 60 | This is created from the files in the 'data/' directory of this git 61 | repo. 62 | 63 | 4) devicetree.dtb. 64 | 65 | This is the devicetree specification of peripherial addresses, to 66 | avoid wiring them down in the source code of the device driver. 67 | (Needed since most peripherials are not discoverable through runtime 68 | probing). Note that the peripherials are different between the 69 | zedboard and the zc702 board. 70 | 71 | The boot.bin is board-specific, because the first stage boot loader 72 | (fsbl) and the devicetree are both board-specific. 73 | 74 | Building Zynq-Boot 75 | ================ 76 | 77 | To see all possible make targets, please just type: 78 | 79 | make 80 | 81 | To build a everything for a zedboard: 82 | 83 | make all.zedboard 84 | 85 | To build just a boot.bin for a zedboard: 86 | 87 | make bootbin.zedboard 88 | 89 | To build a everything for a zc702: 90 | 91 | make all.zc702 92 | 93 | To build a everything for a zc706: 94 | 95 | make all.zc706 96 | 97 | Compiling the linux kernel on Linux: 98 | ==================================== 99 | 100 | If you would like to use a different kernel, you can make it from source. 101 | 102 | # step 1: get the linux kernel source 103 | git clone git@github.com:cambridgehackers/linux-xlnx.git 104 | 105 | # step 2: 106 | cd linux-xlnx/ 107 | 108 | # step 3: check out the xbsv-2014.04 branch 109 | git checkout remotes/origin/xbsv-2014.04 -b xbsv-2014.04 110 | 111 | # step 4: configure the kernel. We use CodeSourcery 2009q1. The NDK toolchain does not work for this. 112 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- xilinx_zynq_portal_defconfig 113 | 114 | # step 5: make the kernel 115 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- 116 | 117 | # step 6: copy the new kernel into zynq-boot 118 | cp arch/arm/boot/zImage ../zynq-boot/imagefiles/zImage 119 | 120 | Compiling the xbsv device drivers on linux: 121 | 122 | Compiling the linux kernel on Mac: 123 | ================================== 124 | 125 | 1) clone linux-xlnx.git 126 | 127 | 2) clone cambridgehackers/mac_linux_headers.git 128 | 129 | 3) use mac_linux_headers/compile.sh for running 'make' on linux-xlnx 130 | 131 | (this will create a usable dts executable for creating boot.bin from this repo) 132 | 133 | Updating the device tree 134 | ======================== 135 | 136 | The devicetree compiler source code is part of the Linux kernel source 137 | code. Here is how to build the devicetree compiler without building 138 | the entire kernel: 139 | 140 | git clone https://github.com/cambridgehackers/linux-xlnx.git 141 | cd linux-xlnx/ 142 | git checkout origin/xbsv-2014.04 -b xbsv-2014.04 143 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- xilinx_zynq_portal_defconfig 144 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- M=scripts/dtc 145 | 146 | Even though the build complains about a missing arm-none-linux-gnueabi-gcc, 147 | it still builds the executable scripts/dtc/dtc correctly. 148 | 149 | Support for Mini-ITX 150 | ====================== 151 | Support has been added for the Avnet 7Z100 Mini-ITX development kit: 152 | 153 | http://www.zedboard.org/product/mini-itx 154 | 155 | Changing Ethernet MAC address 156 | ============================= 157 | The ethernet MAC address is derived from your $(USER) name. 158 | To make boot.bin files for multiple devices that are attached to the network at the same time: 159 | 160 | make bootbin.zedboard USER=uniquetringforboard 161 | 162 | Webserver 163 | ========= 164 | 165 | The webserver in zynq-boot/imagefiles/webserver is from the webui 166 | repo. It provides a websocket server so that a browser can communicate 167 | with the zedboard to download and run applications. 168 | 169 | https://github.com/cambridgehackers/webui/blob/master/src/zedboard-server.c 170 | 171 | You can build it using ndk-build: 172 | 173 | git clone git://github.com/cambridgehackers/webui 174 | cd webui 175 | ndk-build 176 | 177 | There is a target to build it in zynq-boot: 178 | cd zynq-boot; make webserver 179 | 180 | 181 | Adding new boards 182 | ================= 183 | 184 | To add a new board: 185 | 186 | 1) Add the boardname to Makefile 187 | 188 | 2) add zynq--portal.dts zynq__fsbl.elf to imagefiles/ 189 | 190 | 3) make sure that bootargs in the dts file is updated to reflect the boot ramdisk and /dev/fpgaXXX devices 191 | 192 | To debug the /init process (and see the commands it is executing 193 | ================================================================ 194 | 1) touch data/init.debug (create the empty file init.debug in the zynq-boot/data directory) 195 | 2) make bootbin.xxx (where xxx is your target machine, e.g., zedboard) 196 | This creates a file /init.debug on the target device. When the Android system/core/init/init.c command runs, if this file exists stdio devices are not closed. 197 | 198 | Sources of xxxx_fsbl.elf files 199 | ============================== 200 | 201 | Currently: 202 | 203 | zynq_zedboard_fsbl.elf: 204 | 205 | * http://www.digilentinc.com/Data/Products/ZEDBOARD/ZedBoard_OOB_Design.zip 206 | 207 | * filename: ZedBoard_OOB_Design/boot_image/zynq_fsbl.elf 208 | 209 | zynq_miniitx100_fsbl.elf: 210 | 211 | * http://www.zedboard.org/support/design/2056/17 212 | 213 | * Login/Download "Zynq Mini-ITX 7Z100 Out-of-Box Linux v2013.4" 214 | 215 | * filename: ZMITX_7100_OOB_Linux_VIV2013_4/Xil/sdk_workspace/zmitx_fsbl/Debug/zmitx_fsbl.elf 216 | 217 | Future sources (update as needed): 218 | 219 | * http://www.wiki.xilinx.com/Zynq+2014.2+Release 220 | * zynq_zc706_fsbl.elf: zc70x/zc706/fsbl.elf 221 | * zynq_zc702_fsbl.elf: zc70x/zc702/fsbl.elf 222 | * zynq_zedboard_fsbl.elf: zed/fsbl.elf 223 | 224 | -------------------------------------------------------------------------------- /bb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2013 Quanta Research Cambridge, Inc. 4 | 5 | # Permission is hereby granted, free of charge, to any person 6 | # obtaining a copy of this software and associated documentation 7 | # files (the "Software"), to deal in the Software without 8 | # restriction, including without limitation the rights to use, copy, 9 | # modify, merge, publish, distribute, sublicense, and/or sell copies 10 | # of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | # SOFTWARE. 24 | 25 | import os 26 | import subprocess 27 | import sys 28 | from subprocess import call 29 | import argparse 30 | 31 | sys.path.append('../connectal/scripts') 32 | 33 | from adb import adb_commands 34 | from adb import common 35 | 36 | if os.environ.has_key('RUNPARAM'): 37 | ipaddr = os.environ['RUNPARAM'] 38 | else: 39 | ipaddr = None 40 | if ipaddr.find(':') == -1: 41 | ipaddr = ipaddr + ':5555' 42 | 43 | def rmfile(fname): 44 | try: 45 | os.remove(fname) 46 | except OSError as e: 47 | pass 48 | 49 | argparser = argparse.ArgumentParser("Run Connectal apps on Android Zynq boards.") 50 | argparser.add_argument('--ko', action='store_true') 51 | 52 | if __name__ == '__main__': 53 | 54 | options = argparser.parse_args() 55 | 56 | # delete files to force rebuilds 57 | rmfile('zImage') 58 | rmfile('boot.bin') 59 | 60 | # rebuild zImage and boot.bin 61 | call(['make', 'zImage']) 62 | call(['make', 'bootbin.zedboard']) 63 | 64 | # connect to the board 65 | device_serial = ipaddr 66 | print 'connecting to %s' % device_serial 67 | connected = False 68 | while not connected: 69 | try: 70 | connection = adb_commands.AdbCommands.ConnectDevice(serial=device_serial) 71 | connected = True 72 | except socket.error: 73 | pass 74 | 75 | print 'Reconnecting' 76 | connected = False 77 | while not connected: 78 | try: 79 | connection = adb_commands.AdbCommands.ConnectDevice(serial=device_serial) 80 | connected = True 81 | except socket.error: 82 | pass 83 | 84 | print 'Sending files to the zedboard' 85 | if options.ko: 86 | connection.Push('linux-xlnx/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko', '/mnt/sdcard/ath6kl_sdio.ko') 87 | else: 88 | connection.Push('boot.bin', '/mnt/sdcard/boot.bin') 89 | connection.Reboot() 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /bin/dtc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/bin/dtc -------------------------------------------------------------------------------- /bin2header.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright (c) 2014 Quanta Research Cambridge, Inc. 3 | # 4 | # Permission is hereby granted, free of charge, to any person 5 | # obtaining a copy of this software and associated documentation 6 | # files (the "Software"), to deal in the Software without 7 | # restriction, including without limitation the rights to use, copy, 8 | # modify, merge, publish, distribute, sublicense, and/or sell copies 9 | # of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be 13 | # included in all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | # SOFTWARE. 23 | 24 | from __future__ import print_function 25 | import sys, array 26 | 27 | if __name__=='__main__': 28 | if len(sys.argv) != 2: 29 | print('bin2header ') 30 | sys.exit(1) 31 | filename = sys.argv[1] 32 | if filename == '-': 33 | infile = sys.stdin 34 | else: 35 | infile = open(filename) 36 | indata = infile.read() 37 | count = 0 38 | outstr = " " 39 | for item in indata: 40 | outstr += " 0x%02x," % ord(item) 41 | count += 1 42 | if count == 8: 43 | print(outstr) 44 | outstr = " " 45 | count = 0; 46 | print(outstr) 47 | -------------------------------------------------------------------------------- /bitfile/zybo/Makefile: -------------------------------------------------------------------------------- 1 | 2 | #-notrace 3 | all: 4 | rm -rf build 5 | mkdir build 6 | cd build; vivado -mode batch -source ../zybo_synth.tcl 7 | -------------------------------------------------------------------------------- /bitfile/zybo/base.xdc: -------------------------------------------------------------------------------- 1 | set_property PACKAGE_PIN R18 [get_ports {btns_4bits_tri_i[0]}] 2 | set_property PACKAGE_PIN P16 [get_ports {btns_4bits_tri_i[1]}] 3 | set_property PACKAGE_PIN V16 [get_ports {btns_4bits_tri_i[2]}] 4 | set_property PACKAGE_PIN Y16 [get_ports {btns_4bits_tri_i[3]}] 5 | set_property IOSTANDARD LVCMOS33 [get_ports {btns_4bits_tri_i[*]}] 6 | 7 | set_property PACKAGE_PIN M14 [get_ports {leds_4bits_tri_o[0]}] 8 | set_property PACKAGE_PIN M15 [get_ports {leds_4bits_tri_o[1]}] 9 | set_property PACKAGE_PIN G14 [get_ports {leds_4bits_tri_o[2]}] 10 | set_property PACKAGE_PIN D18 [get_ports {leds_4bits_tri_o[3]}] 11 | set_property IOSTANDARD LVCMOS33 [get_ports {leds_4bits_tri_o[*]}] 12 | 13 | set_property PACKAGE_PIN G15 [get_ports {sws_4bits_tri_i[0]}] 14 | set_property PACKAGE_PIN P15 [get_ports {sws_4bits_tri_i[1]}] 15 | set_property PACKAGE_PIN W13 [get_ports {sws_4bits_tri_i[2]}] 16 | set_property PACKAGE_PIN T16 [get_ports {sws_4bits_tri_i[3]}] 17 | set_property IOSTANDARD LVCMOS33 [get_ports {sws_4bits_tri_i[*]}] 18 | 19 | set_property PACKAGE_PIN N18 [get_ports iic_0_scl_io] 20 | set_property IOSTANDARD LVCMOS33 [get_ports iic_0_scl_io] 21 | set_property PACKAGE_PIN N17 [get_ports iic_0_sda_io] 22 | set_property IOSTANDARD LVCMOS33 [get_ports iic_0_sda_io] 23 | 24 | set_property PACKAGE_PIN M19 [get_ports {RED_O[0]}] 25 | set_property PACKAGE_PIN L20 [get_ports {RED_O[1]}] 26 | set_property PACKAGE_PIN J20 [get_ports {RED_O[2]}] 27 | set_property PACKAGE_PIN G20 [get_ports {RED_O[3]}] 28 | set_property PACKAGE_PIN F19 [get_ports {RED_O[4]}] 29 | set_property IOSTANDARD LVCMOS33 [get_ports {RED_O[*]}] 30 | set_property SLEW FAST [get_ports {RED_O[*]}] 31 | 32 | set_property PACKAGE_PIN H18 [get_ports {GREEN_O[0]}] 33 | set_property PACKAGE_PIN N20 [get_ports {GREEN_O[1]}] 34 | set_property PACKAGE_PIN L19 [get_ports {GREEN_O[2]}] 35 | set_property PACKAGE_PIN J19 [get_ports {GREEN_O[3]}] 36 | set_property PACKAGE_PIN H20 [get_ports {GREEN_O[4]}] 37 | set_property PACKAGE_PIN F20 [get_ports {GREEN_O[5]}] 38 | set_property IOSTANDARD LVCMOS33 [get_ports {GREEN_O[*]}] 39 | set_property SLEW FAST [get_ports {GREEN_O[*]}] 40 | 41 | set_property PACKAGE_PIN P20 [get_ports {BLUE_O[0]}] 42 | set_property PACKAGE_PIN M20 [get_ports {BLUE_O[1]}] 43 | set_property PACKAGE_PIN K19 [get_ports {BLUE_O[2]}] 44 | set_property PACKAGE_PIN J18 [get_ports {BLUE_O[3]}] 45 | set_property PACKAGE_PIN G19 [get_ports {BLUE_O[4]}] 46 | set_property IOSTANDARD LVCMOS33 [get_ports {BLUE_O[*]}] 47 | set_property SLEW FAST [get_ports {BLUE_O[*]}] 48 | 49 | set_property PACKAGE_PIN R19 [get_ports VSYNC_O] 50 | set_property PACKAGE_PIN P19 [get_ports HSYNC_O] 51 | set_property IOSTANDARD LVCMOS33 [get_ports VSYNC_O] 52 | set_property IOSTANDARD LVCMOS33 [get_ports HSYNC_O] 53 | set_property SLEW FAST [get_ports VSYNC_O] 54 | set_property SLEW FAST [get_ports HSYNC_O] 55 | 56 | set_property PACKAGE_PIN H16 [get_ports HDMI_CLK_P] 57 | set_property PACKAGE_PIN D19 [get_ports HDMI_D0_P] 58 | set_property PACKAGE_PIN C20 [get_ports HDMI_D1_P] 59 | set_property PACKAGE_PIN B19 [get_ports HDMI_D2_P] 60 | set_property IOSTANDARD TMDS_33 [get_ports HDMI_CLK_*] 61 | set_property IOSTANDARD TMDS_33 [get_ports HDMI_D*] 62 | 63 | set_property PACKAGE_PIN F17 [get_ports {HDMI_OEN[0]}] 64 | set_property IOSTANDARD LVCMOS33 [get_ports {HDMI_OEN[0]}] 65 | 66 | set_property PACKAGE_PIN K18 [get_ports {AC_BCLK[0]}] 67 | set_property PACKAGE_PIN T19 [get_ports AC_MCLK] 68 | set_property PACKAGE_PIN P18 [get_ports {AC_MUTE_N[0]}] 69 | set_property PACKAGE_PIN L17 [get_ports {AC_PBLRC[0]}] 70 | set_property PACKAGE_PIN M18 [get_ports {AC_RECLRC[0]}] 71 | set_property PACKAGE_PIN M17 [get_ports {AC_SDATA_O[0]}] 72 | set_property PACKAGE_PIN K17 [get_ports AC_SDATA_I] 73 | set_property IOSTANDARD LVCMOS33 [get_ports AC*] 74 | 75 | #This constraint ensures the MMCM located in the clock region connected to the ZYBO's HDMI port 76 | #is used for the axi_dispctrl core driving the HDMI port 77 | set_property LOC MMCME2_ADV_X0Y0 [get_cells system_i/axi_dispctrl_0/inst/DONT_USE_BUFR_DIV5.Inst_mmcme2_drp/mmcm_adv_inst] 78 | 79 | #False path constraints for crossing clock domains in the Audio and Display cores. 80 | #Synchronization between the clock domains is handled properly in logic. 81 | #TODO: The following constraints should be changed to identify the proper pins 82 | # of the cores by their hierarchical pin names. Currently the global clock names are 83 | # used. Ultimately, it would be nice to have the cores automatically generate them. 84 | #adi_i2s constaints: 85 | set_false_path -from [get_clocks clk_fpga_0] -to [get_clocks clk_fpga_2] 86 | set_false_path -from [get_clocks clk_fpga_2] -to [get_clocks clk_fpga_0] 87 | 88 | #axi_dispctrl constraints: 89 | #Note these constraints require that REFCLK be driven by the axi_lite clock (clk_fpga_0) 90 | set_false_path -from [get_clocks clk_fpga_0] -to [get_clocks axi_dispctrl_1_PXL_CLK_O] 91 | set_false_path -from [get_clocks axi_dispctrl_1_PXL_CLK_O] -to [get_clocks clk_fpga_0] 92 | 93 | create_generated_clock -name vga_pxlclk -source [get_pins {system_i/processing_system7_0/inst/PS7_i/FCLKCLK[0]}] -multiply_by 1 [get_pins system_i/axi_dispctrl_0/inst/DONT_USE_BUFR_DIV5.BUFG_inst/O] 94 | set_false_path -from [get_clocks vga_pxlclk] -to [get_clocks clk_fpga_0] 95 | set_false_path -from [get_clocks clk_fpga_0] -to [get_clocks vga_pxlclk] 96 | -------------------------------------------------------------------------------- /bitfile/zybo/system_wrapper.v: -------------------------------------------------------------------------------- 1 | `timescale 1 ps / 1 ps 2 | 3 | module system_wrapper ( 4 | AC_BCLK, AC_MCLK, AC_MUTE_N, AC_PBLRC, AC_RECLRC, AC_SDATA_O, 5 | DDR_addr, DDR_ba, DDR_cas_n, DDR_ck_n, DDR_ck_p, DDR_cke, DDR_cs_n, DDR_dm, 6 | DDR_dq, DDR_dqs_n, DDR_dqs_p, DDR_odt, DDR_ras_n, DDR_reset_n, DDR_we_n, 7 | FIXED_IO_ddr_vrn, FIXED_IO_ddr_vrp, FIXED_IO_mio, FIXED_IO_ps_clk, FIXED_IO_ps_porb, FIXED_IO_ps_srstb, 8 | iic_0_scl_io, iic_0_sda_io); 9 | output [0:0]AC_BCLK; output AC_MCLK; output [0:0]AC_MUTE_N; 10 | output [0:0]AC_PBLRC; output [0:0]AC_RECLRC; output [0:0]AC_SDATA_O; 11 | inout [14:0]DDR_addr; inout [2:0]DDR_ba; inout DDR_cas_n; inout DDR_ck_n; 12 | inout DDR_ck_p; inout DDR_cke; inout DDR_cs_n; inout [3:0]DDR_dm; 13 | inout [31:0]DDR_dq; inout [3:0]DDR_dqs_n; inout [3:0]DDR_dqs_p; inout DDR_odt; 14 | inout DDR_ras_n; inout DDR_reset_n; inout DDR_we_n; 15 | inout FIXED_IO_ddr_vrn; inout FIXED_IO_ddr_vrp; inout [53:0]FIXED_IO_mio; 16 | inout FIXED_IO_ps_clk; inout FIXED_IO_ps_porb; inout FIXED_IO_ps_srstb; 17 | inout iic_0_scl_io; inout iic_0_sda_io; 18 | 19 | wire IIC_0_scl_i; wire IIC_0_scl_io; wire IIC_0_scl_o; wire IIC_0_scl_t; 20 | wire IIC_0_sda_i; wire IIC_0_sda_io; wire IIC_0_sda_o; wire IIC_0_sda_t; 21 | 22 | IOBUF iic_0_scl_iobuf (.I(IIC_0_scl_o), .IO(iic_0_scl_io), .O(IIC_0_scl_i), .T(IIC_0_scl_t)); 23 | IOBUF iic_0_sda_iobuf (.I(IIC_0_sda_o), .IO(iic_0_sda_io), .O(IIC_0_sda_i), .T(IIC_0_sda_t)); 24 | 25 | ps7_0 processing_system7_0 26 | (.DDR_Addr(DDR_addr), .DDR_BankAddr(DDR_ba), 27 | .DDR_CAS_n(DDR_cas_n), .DDR_CKE(DDR_cke), 28 | .DDR_CS_n(DDR_cs_n), .DDR_Clk(DDR_ck_p), .DDR_Clk_n(DDR_ck_n), 29 | .DDR_DM(DDR_dm), .DDR_DQ(DDR_dq), .DDR_DQS(DDR_dqs_p), .DDR_DQS_n(DDR_dqs_n), 30 | .DDR_DRSTB(DDR_reset_n), .DDR_ODT(DDR_odt), .DDR_RAS_n(DDR_ras_n), .DDR_VRN(FIXED_IO_ddr_vrn), 31 | .DDR_VRP(FIXED_IO_ddr_vrp), .DDR_WEB(DDR_we_n), 32 | .I2C0_SCL_I(IIC_0_scl_i), .I2C0_SCL_O(IIC_0_scl_o), 33 | .I2C0_SCL_T(IIC_0_scl_t), .I2C0_SDA_I(IIC_0_sda_i), 34 | .I2C0_SDA_O(IIC_0_sda_o), .I2C0_SDA_T(IIC_0_sda_t), 35 | .MIO(FIXED_IO_mio), 36 | .PS_CLK(FIXED_IO_ps_clk), .PS_PORB(FIXED_IO_ps_porb), .PS_SRSTB(FIXED_IO_ps_srstb) 37 | ); 38 | endmodule 39 | -------------------------------------------------------------------------------- /bitfile/zybo/zybo_synth.tcl: -------------------------------------------------------------------------------- 1 | 2 | create_project zybo . -part xc7z010clg400-1 3 | set_property target_language Verilog [current_project] 4 | #set_param project.compositeFile.enableAutoGeneration 0 5 | 6 | create_ip -name processing_system7 -vendor xilinx.com -library ip -module_name ps7_0 7 | set_property -dict [list CONFIG.PCW_PRESET_BANK1_VOLTAGE {LVCMOS 1.8V}] [get_ips ps7_0] 8 | set_property -dict [list CONFIG.PCW_USE_M_AXI_GP1 {1} CONFIG.PCW_USE_S_AXI_HP0 {1} CONFIG.PCW_USE_S_AXI_HP1 {1} CONFIG.PCW_USE_S_AXI_HP2 {1} CONFIG.PCW_USE_S_AXI_HP3 {1}] [get_ips ps7_0] 9 | set_property -dict [list CONFIG.PCW_USE_FABRIC_INTERRUPT {1} CONFIG.PCW_IRQ_F2P_INTR {1} CONFIG.PCW_ENET0_PERIPHERAL_ENABLE {1} CONFIG.PCW_ENET0_ENET0_IO {MIO 16 .. 27} CONFIG.PCW_SD0_PERIPHERAL_ENABLE {1} CONFIG.PCW_UART0_PERIPHERAL_ENABLE {0} CONFIG.PCW_UART0_UART0_IO {MIO 50 .. 51} CONFIG.PCW_UART1_PERIPHERAL_ENABLE {1} CONFIG.PCW_USB0_PERIPHERAL_ENABLE {1} CONFIG.PCW_I2C0_PERIPHERAL_ENABLE {1}] [get_ips ps7_0] 10 | set_property -dict [list CONFIG.PCW_UIPARAM_DDR_ADV_ENABLE {0} CONFIG.PCW_UIPARAM_DDR_PARTNO {MT41J128M16 HA-125}] [get_ips ps7_0] 11 | # report_property [get_ips ps7_0] 12 | ##set_property -dict [list CONFIG.preset {Default}] [get_ips ps7_0] 13 | generate_target {instantiation_template} [get_files zybo.srcs/sources_1/ip/ps7_0/ps7_0.xci] 14 | generate_target all [get_files zybo.srcs/sources_1/ip/ps7_0/ps7_0.xci] 15 | 16 | generate_target {Synthesis} [get_files zybo.srcs/sources_1/ip/ps7_0/ps7_0.xci] 17 | synth_ip [get_ips ps7_0] 18 | 19 | read_verilog ../system_wrapper.v 20 | 21 | set_param synth.vivado.isSynthRun true 22 | synth_design -top system_wrapper -part xc7z010clg400-1 23 | write_checkpoint system_wrapper.dcp 24 | 25 | add_files -quiet system_wrapper.dcp 26 | read_xdc -ref ps7_0 -cells inst zybo.srcs/sources_1/ip/ps7_0/ps7_0.xdc 27 | read_xdc ../base.xdc 28 | link_design -top system_wrapper -part xc7z010clg400-1 29 | opt_design 30 | place_design 31 | write_checkpoint -force system_wrapper_placed.dcp 32 | report_io -file system_wrapper_io_placed.rpt 33 | report_clock_utilization -file system_wrapper_clock_utilization_placed.rpt 34 | report_utilization -file system_wrapper_utilization_placed.rpt -pb system_wrapper_utilization_placed.pb 35 | report_control_sets -verbose -file system_wrapper_control_sets_placed.rpt 36 | 37 | route_design 38 | write_checkpoint -force system_wrapper_routed.dcp 39 | report_drc -file system_wrapper_drc_routed.rpt -pb system_wrapper_drc_routed.pb 40 | report_timing_summary -warn_on_violation -file system_wrapper_timing_summary_routed.rpt -pb system_wrapper_timing_summary_routed.pb 41 | report_power -file system_wrapper_power_routed.rpt -pb system_wrapper_power_summary_routed.pb 42 | write_bitstream -bin_file -force ../zybobsd.bit 43 | -------------------------------------------------------------------------------- /bitfile/zybo/zybobsd.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/bitfile/zybo/zybobsd.bin -------------------------------------------------------------------------------- /bitfile/zybo/zybobsd.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/bitfile/zybo/zybobsd.bit -------------------------------------------------------------------------------- /boot.bif: -------------------------------------------------------------------------------- 1 | 2 | the_ROM_image: 3 | { 4 | [bootloader]zynq_fsbl.elf 5 | zcomposite.elf 6 | } 7 | -------------------------------------------------------------------------------- /bootdef.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Quanta Research Cambridge, Inc. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a 4 | * copy of this software and associated documentation files (the "Software"), 5 | * to deal in the Software without restriction, including without limitation 6 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | * and/or sell copies of the Software, and to permit persons to whom the 8 | * Software is furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included 11 | * in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 14 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | * DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | /************ boot.bin header structures ****************/ 23 | 24 | #define IMAGE_PHDR_OFFSET 0x09C /* Start of partition headers */ 25 | 26 | /* Attribute word defines */ 27 | #define ATTRIBUTE_PS_IMAGE_MASK 0x10 /**< Code partition */ 28 | #define ATTRIBUTE_PL_IMAGE_MASK 0x20 /**< Bit stream partition */ 29 | typedef struct { 30 | uint32_t Version; 31 | uint32_t ImageCount; 32 | uint32_t PartitionOffset; 33 | uint32_t ImageOffset; 34 | uint32_t unknown; 35 | } ImageHeaderTable; 36 | typedef struct { 37 | uint32_t ImageWordLen; 38 | uint32_t DataWordLen; 39 | uint32_t PartitionWordLen; 40 | uint32_t LoadAddr; 41 | uint32_t ExecAddr; 42 | uint32_t PartitionStart; 43 | uint32_t PartitionAttr; 44 | uint32_t SectionCount; 45 | uint32_t Pads[7]; 46 | uint32_t CheckSum; 47 | } BootPartitionHeader; 48 | typedef struct { 49 | uint32_t next; 50 | uint32_t partition; 51 | uint32_t count; 52 | uint32_t name_length; 53 | } ImageHeader; 54 | 55 | #define ROM_HEADER 0xaa995566, 0x584c4e58, 0, 0x1010000 56 | //#define BOOTGEN_VERSION 0x1010000 57 | #define BOOTGEN_VERSION 0x1020000 58 | -------------------------------------------------------------------------------- /canoncpio.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright (c) 2014 Quanta Research Cambridge, Inc 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included 12 | * in all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | * DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | typedef struct { 32 | uint8_t c_magic[6]; 33 | uint8_t c_ino[8]; 34 | uint8_t c_mode[8]; 35 | uint8_t c_uid[8]; 36 | uint8_t c_gid[8]; 37 | uint8_t c_nlink[8]; 38 | uint8_t c_mtime[8]; 39 | uint8_t c_filesize[8]; 40 | uint8_t c_maj[8]; 41 | uint8_t c_min[8]; 42 | uint8_t c_rmaj[8]; 43 | uint8_t c_rmin[8]; 44 | uint8_t c_namesize[8]; 45 | uint8_t c_chksum[8]; 46 | } Cpio_header; 47 | 48 | #define MAX_FILENAME 1000 49 | #define MAX_FILECOUNT 500 50 | #define MAX_SEGMENT 1000 51 | #define ALIGN32(A) (((A) + 3) & ~3L) 52 | 53 | static uint32_t ino_map[MAX_FILECOUNT]; 54 | static int ino_map_index = 0; 55 | static uint8_t canon_time[8] = "5361C6C0"; // 2014 May 1 56 | 57 | static uint32_t get_int32(uint8_t *data) 58 | { 59 | uint8_t temp[9]; 60 | memcpy(temp, data, 8); 61 | temp[8] = 0; 62 | return strtol(temp, NULL, 16); 63 | } 64 | 65 | int main(int argc, const char **argv) 66 | { 67 | Cpio_header header; 68 | uint32_t ino, nlen, newi; 69 | uint8_t data[MAX_SEGMENT], temp[MAX_FILENAME]; 70 | int fd = 0; //open("xx.old", O_RDONLY); 71 | int verbose = 0; 72 | if (argc > 1 && strcmp(argv[1], "--verbose") == 0) 73 | verbose = 1; 74 | 75 | do { 76 | read(fd, &header, sizeof(header)); 77 | memcpy(temp, header.c_magic, sizeof(header.c_magic)); 78 | temp[sizeof(header.c_magic)] = 0; 79 | if (strcmp(temp, "070701")) { 80 | fprintf(stderr, "Invalid magic number in cpio archive %s\n", temp); 81 | exit(-1); 82 | } 83 | ino = get_int32(header.c_ino); 84 | nlen = get_int32(header.c_namesize); 85 | /* read filename */ 86 | read(fd, temp, nlen); 87 | temp[nlen] = 0; 88 | /* remap inode numbers into 1..MAX range */ 89 | for (newi = 0; newi < MAX_FILECOUNT; newi++) { 90 | if (newi == ino_map_index) 91 | ino_map[ino_map_index++] = ino; 92 | if (ino_map[newi] == ino) 93 | break; 94 | } 95 | int len = ALIGN32(sizeof(header) + nlen) 96 | + ALIGN32(get_int32(header.c_filesize)) - sizeof(header) - nlen; 97 | if (verbose) 98 | fprintf(stderr, "name %s\t\t\t %x new %x mtime %x\n", temp, ino, newi+1, get_int32(header.c_mtime)); 99 | sprintf(data, "%08X", newi+1); 100 | if (ino) 101 | memcpy(header.c_ino, data, sizeof(header.c_ino)); 102 | /* Set file modification time to a constant */ 103 | memcpy(header.c_mtime, canon_time, sizeof(header.c_mtime)); 104 | write(1, &header, sizeof(header)); 105 | write(1, temp, nlen); 106 | /* read remainder of file */ 107 | if (!strcmp(temp, "TRAILER!!!")) 108 | len = 9999999; /* HACK */ 109 | /* read alignment filler and data bytes */ 110 | while (len > 0) { 111 | int plen = len; 112 | if (plen > sizeof(data)) 113 | plen = sizeof(data); 114 | int rc = read(fd, data, plen); 115 | if (rc == 0) 116 | break; 117 | write(1, data, rc); 118 | len -= rc; 119 | } 120 | } while (strcmp(temp, "TRAILER!!!")); 121 | return 0; 122 | } 123 | -------------------------------------------------------------------------------- /clearreg.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Quanta Research Cambridge, Inc 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a 4 | * copy of this software and associated documentation files (the "Software"), 5 | * to deal in the Software without restriction, including without limitation 6 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | * and/or sell copies of the Software, and to permit persons to whom the 8 | * Software is furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included 11 | * in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 14 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | * DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include 23 | #define XILINX_EP107 3378 24 | /* This code initializes the parts of the ARM processor that were previously 25 | * initialized by u-boot (git://git.xilinx.com/u-boot-xlnx.git) 26 | * in arch/arm/cpu/armv7/zynq/cpu.c:lowlevel_init(). 27 | * 28 | * FSBL has already initialized UART and stack 29 | */ 30 | #define SLCR_LOCK_MAGIC 0x767B 31 | #define SLCR_UNLOCK_MAGIC 0xDF0D 32 | 33 | #define XPSS_SYS_CTRL_BASEADDR 0xF8000000 34 | #define XPSS_DEV_CFG_APB_BASEADDR 0xF8007000 35 | #define XPSS_SCU_BASEADDR 0xF8F00000 36 | 37 | #define STDOUT_BASEADDRESS 0xE0001000 38 | #define XUARTPS_SR_OFFSET 0x2C /**< Channel Status [14:0] */ 39 | #define XUARTPS_SR_TXFULL 0x00000010 /**< TX FIFO full */ 40 | #define XUARTPS_FIFO_OFFSET 0x30 /**< FIFO [7:0] */ 41 | 42 | // SLCR 43 | #define XSLCR_MIO_PIN_00_OFFSET 0x700 /* MIO PIN0 control register */ 44 | #define XSLCR_MIO_L0_SHIFT 1 45 | #define XSLCR_MIO_L1_SHIFT 2 46 | #define XSLCR_MIO_L2_SHIFT 3 47 | #define XSLCR_MIO_L3_SHIFT 5 48 | #define XSLCR_MIO_LMASK 0xFE 49 | #define XSLCR_MIO_PIN_XX_TRI_ENABLE 1 50 | #define XSLCR_MIO_PIN_GPIO_ENABLE (0x00 << XSLCR_MIO_L3_SHIFT) 51 | #define XSLCR_MIO_PIN_SDIO_ENABLE (0x04 << XSLCR_MIO_L3_SHIFT) 52 | 53 | #define PINOFF(PIN) (XPSS_SYS_CTRL_BASEADDR + XSLCR_MIO_PIN_00_OFFSET + (PIN) * 4) 54 | // #define EMIO_SDIO1 55 | 56 | 57 | static void Xil_Out32(uint32_t OutAddress, uint32_t Value); 58 | static uint32_t Xil_In32(uint32_t Addr); 59 | static void debug_puts(const char *ptr); 60 | static const struct { 61 | uint32_t pinaddr; 62 | uint32_t enable; 63 | } sdio1_pindef[] = { 64 | #ifdef BOARD_zedboard 65 | {PINOFF(10), XSLCR_MIO_PIN_SDIO_ENABLE}, 66 | {PINOFF(11), XSLCR_MIO_PIN_SDIO_ENABLE}, 67 | {PINOFF(12), XSLCR_MIO_PIN_SDIO_ENABLE}, 68 | {PINOFF(13), XSLCR_MIO_PIN_SDIO_ENABLE}, 69 | {PINOFF(14), XSLCR_MIO_PIN_SDIO_ENABLE}, 70 | {PINOFF(15), XSLCR_MIO_PIN_SDIO_ENABLE}, 71 | #endif 72 | {0,0}}; 73 | 74 | void _binary_imagefiles_zImage_start(int, int, int); 75 | void clearreg(void) 76 | { 77 | uint32_t pinaddr, ind = 0; 78 | debug_puts("Start clearreg\n\r"); 79 | Xil_Out32(XPSS_SYS_CTRL_BASEADDR + 0x8, SLCR_UNLOCK_MAGIC); //slcr_unlock 80 | /* remap DDR to zero, FILTERSTART */ 81 | Xil_Out32(XPSS_SCU_BASEADDR + 0x40, 0); //filter_start 82 | /* Device config APB, unlock the PCAP */ 83 | Xil_Out32(XPSS_DEV_CFG_APB_BASEADDR + 0x34, 0x757BDF0D); //unlock 84 | Xil_Out32(XPSS_DEV_CFG_APB_BASEADDR + 0x28, 0xFFFFFFFF); //rom_shadow 85 | /* OCM_CFG, Mask out the ROM, map ram into upper addresses */ 86 | Xil_Out32(XPSS_SYS_CTRL_BASEADDR + 0x910, 0x1F); //ocm_cfg 87 | /* FPGA_RST_CTRL, clear resets on AXI fabric ports */ 88 | Xil_Out32(XPSS_SYS_CTRL_BASEADDR + 0x240, 0); //fpga_rst_ctrl 89 | /* TZ_DDR_RAM, Set DDR trust zone non-secure */ 90 | Xil_Out32(XPSS_SYS_CTRL_BASEADDR + 0x430, 0xFFFFFFFF); //trust_zone 91 | /* Set urgent bits with register */ 92 | Xil_Out32(XPSS_SYS_CTRL_BASEADDR + 0x61c, 0); //ddr_urgent_sel 93 | /* Urgent write, ports S2/S3 */ 94 | Xil_Out32(XPSS_SYS_CTRL_BASEADDR + 0x600, 0xC); //ddr_urgent 95 | while ((pinaddr = sdio1_pindef[ind].pinaddr)) { 96 | #ifndef EMIO_SDIO1 97 | /* release pin set tri-state */ 98 | Xil_Out32(pinaddr, (Xil_In32(pinaddr) & ~XSLCR_MIO_LMASK) | XSLCR_MIO_PIN_XX_TRI_ENABLE); 99 | /* assign pin to this peripheral */ 100 | Xil_Out32(pinaddr, sdio1_pindef[ind].enable); 101 | #endif 102 | ind++; 103 | } 104 | 105 | #if defined(BOARD_zc706) 106 | { 107 | uint32_t pll_status_check_tries=0; 108 | /* 800MHz Clock support */ 109 | debug_puts("Start 800MHz Clock\n\r"); 110 | /* ARM_PLL_CFG update (LOCKCNT=0xFA, PLL_CD=0x2, PLL_RES=0x4)*/ 111 | Xil_Out32(0xF8000110, 0x000FA240); 112 | /* Update FB_DIV=0x30 (48)*/ 113 | Xil_Out32(0xF8000100, (Xil_In32(0xF8000100) & ~(0x0007F000)) | 0x00030000); 114 | /* Set Bypass PLL */ 115 | Xil_Out32(0xF8000100, (Xil_In32(0xF8000100) & ~(0x00000010)) | 0x00000010); 116 | /* Assert Reset */ 117 | Xil_Out32(0xF8000100, (Xil_In32(0xF8000100) & ~(0x00000001)) | 0x00000001); 118 | /* Deassert Reset */ 119 | Xil_Out32(0xF8000100, (Xil_In32(0xF8000100) & ~(0x00000001)) | 0x00000000); 120 | 121 | /* Check PLL Status */ 122 | 123 | while ( !(Xil_In32(0xF800010C) & (0x00000001)) ) { 124 | pll_status_check_tries++; 125 | if( pll_status_check_tries > 0x0000FFFF ) { 126 | debug_puts("PLL timeout\n\r"); 127 | break; 128 | } 129 | } 130 | 131 | /* Remove Bypass PLL */ 132 | Xil_Out32(0xF8000100, (Xil_In32(0xF8000100) & ~(0x00000010)) | 0x00000000); 133 | debug_puts("Finish 800MHz Clock\n\r"); 134 | } 135 | #endif 136 | 137 | Xil_Out32(XPSS_SYS_CTRL_BASEADDR + 0x4, SLCR_LOCK_MAGIC); //slcr_lock 138 | debug_puts("Jump to linux\n\r"); 139 | _binary_imagefiles_zImage_start(0, XILINX_EP107, 0x1000000 /* address of devicetree data */); 140 | } 141 | static void Xil_Out32(uint32_t OutAddress, uint32_t Value) 142 | { 143 | *(volatile uint32_t *) OutAddress = Value; 144 | } 145 | static uint32_t Xil_In32(uint32_t Addr) 146 | { 147 | return *(volatile uint32_t *) Addr; 148 | } 149 | static void debug_puts(const char *ptr) 150 | { 151 | while (*ptr) { 152 | while((Xil_In32(STDOUT_BASEADDRESS + XUARTPS_SR_OFFSET) & XUARTPS_SR_TXFULL)); 153 | Xil_Out32(STDOUT_BASEADDRESS + XUARTPS_FIFO_OFFSET, *ptr++); 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /data/conf_static_ip: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | ifconfig eth0 172.17.2.50 3 | ifconfig eth0 netmask 255.0.0.0 4 | -------------------------------------------------------------------------------- /data/data/unused: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/data/unused -------------------------------------------------------------------------------- /data/default.prop: -------------------------------------------------------------------------------- 1 | # 2 | # ADDITIONAL_DEFAULT_PROPERTIES 3 | # 4 | ro.secure=1 5 | ro.allow.mock.location=0 6 | ro.debuggable=1 7 | persist.sys.usb.config=adb 8 | -------------------------------------------------------------------------------- /data/dev/unused: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/dev/unused -------------------------------------------------------------------------------- /data/fpgajtag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/fpgajtag -------------------------------------------------------------------------------- /data/init: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/init -------------------------------------------------------------------------------- /data/init.goldfish.rc: -------------------------------------------------------------------------------- 1 | on early-init 2 | export EXTERNAL_STORAGE /mnt/sdcard 3 | mkdir /mnt/sdcard 0000 system system 4 | # for backwards compatibility 5 | symlink /mnt/sdcard /sdcard 6 | 7 | on boot 8 | setprop ARGH ARGH 9 | setprop net.eth0.gw 10.0.2.2 10 | setprop net.eth0.dns1 10.0.2.3 11 | setprop net.gprs.local-ip 10.0.2.15 12 | setprop ro.radio.use-ppp no 13 | setprop ro.build.product generic 14 | setprop ro.product.device generic 15 | 16 | # fake some battery state 17 | setprop status.battery.state Slow 18 | setprop status.battery.level 5 19 | setprop status.battery.level_raw 50 20 | setprop status.battery.level_scale 9 21 | 22 | # disable some daemons the emulator doesn't want 23 | stop dund 24 | stop akmd 25 | 26 | # start essential services 27 | start qemud 28 | start goldfish-logcat 29 | start goldfish-setup 30 | 31 | setprop ro.setupwizard.mode EMULATOR 32 | 33 | # enable Google-specific location features, 34 | # like NetworkLocationProvider and LocationCollector 35 | setprop ro.com.google.locationfeatures 1 36 | 37 | # For the emulator, which bypasses Setup Wizard, you can specify 38 | # account info for the device via these two properties. Google 39 | # Login Service will insert these accounts into the database when 40 | # it is created (ie, after a data wipe). 41 | # 42 | # setprop ro.config.hosted_account username@hosteddomain.org:password 43 | # setprop ro.config.google_account username@gmail.com:password 44 | # 45 | # You MUST have a Google account on the device, and you MAY 46 | # additionally have a hosted account. No other configuration is 47 | # supported, and arbitrary breakage may result if you specify 48 | # something else. 49 | 50 | service goldfish-setup /system/etc/init.goldfish.sh 51 | user root 52 | group root 53 | oneshot 54 | 55 | # The qemu-props program is used to set various system 56 | # properties on boot. It must be run early during the boot 57 | # process to avoid race conditions with other daemons that 58 | # might read them (e.g. surface flinger), so define it in 59 | # class 'core' 60 | # 61 | service qemu-props /system/bin/qemu-props 62 | class core 63 | user root 64 | group root 65 | oneshot 66 | 67 | service qemud /system/bin/qemud 68 | socket qemud stream 666 69 | oneshot 70 | 71 | # -Q is a special logcat option that forces the 72 | # program to check wether it runs on the emulator 73 | # if it does, it redirects its output to the device 74 | # named by the androidboot.console kernel option 75 | # if not, is simply exits immediately 76 | 77 | service goldfish-logcat /system/bin/logcat -Q 78 | oneshot 79 | -------------------------------------------------------------------------------- /data/init.rc: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 The Android Open Source Project 2 | # 3 | # IMPORTANT: Do not create world writable files or directories. 4 | # This is a common source of Android security bugs. 5 | # 6 | 7 | import /init.${ro.hardware}.rc 8 | import /init.usb.rc 9 | import /init.trace.rc 10 | 11 | on early-init 12 | # Set init and its forked children's oom_adj. 13 | write /proc/1/oom_adj -16 14 | 15 | loglevel 3 16 | 17 | mkdir /devtmpfs 0775 root system 18 | mount devtmpfs none /devtmpfs 19 | write /devtmpfs/console "mounting devtmpfs" 20 | 21 | start ueventd 22 | 23 | # create mountpoints 24 | mkdir /mnt 0775 root system 25 | 26 | on init 27 | 28 | sysclktz 0 29 | 30 | loglevel 3 31 | 32 | # setup the global environment 33 | export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin 34 | export LD_LIBRARY_PATH /vendor/lib:/system/lib 35 | export ANDROID_BOOTLOGO 1 36 | export ANDROID_ROOT /system 37 | export ANDROID_ASSETS /system/app 38 | export ANDROID_DATA /data 39 | export ASEC_MOUNTPOINT /mnt/asec 40 | export LOOP_MOUNTPOINT /mnt/obb 41 | export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar 42 | 43 | # Backward compatibility 44 | symlink /system/etc /etc 45 | symlink /sys/kernel/debug /d 46 | 47 | # Right now vendor lives on the same filesystem as system, 48 | # but someday that may change. 49 | symlink /system/vendor /vendor 50 | 51 | # Create cgroup mount point for cpu accounting 52 | mkdir /acct 53 | mount cgroup none /acct cpuacct 54 | mkdir /acct/uid 55 | 56 | mkdir /system 57 | mkdir /data 0771 system system 58 | mkdir /cache 0770 system cache 59 | mkdir /config 0500 root root 60 | 61 | # Directory for putting things only root should see. 62 | mkdir /mnt/secure 0700 root root 63 | 64 | # Directory for staging bindmounts 65 | mkdir /mnt/secure/staging 0700 root root 66 | 67 | # Directory-target for where the secure container 68 | # imagefile directory will be bind-mounted 69 | mkdir /mnt/secure/asec 0700 root root 70 | 71 | # Secure container public mount points. 72 | mkdir /mnt/asec 0700 root system 73 | mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000 74 | 75 | # Filesystem image public mount points. 76 | mkdir /mnt/obb 0700 root system 77 | mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000 78 | 79 | write /proc/sys/kernel/panic_on_oops 1 80 | write /proc/sys/kernel/hung_task_timeout_secs 0 81 | write /proc/cpu/alignment 4 82 | write /proc/sys/kernel/sched_latency_ns 10000000 83 | write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 84 | write /proc/sys/kernel/sched_compat_yield 1 85 | write /proc/sys/kernel/sched_child_runs_first 0 86 | write /proc/sys/kernel/randomize_va_space 2 87 | write /proc/sys/kernel/kptr_restrict 2 88 | write /proc/sys/kernel/dmesg_restrict 1 89 | write /proc/sys/vm/mmap_min_addr 32768 90 | write /proc/sys/kernel/sched_rt_runtime_us 950000 91 | write /proc/sys/kernel/sched_rt_period_us 1000000 92 | 93 | # Create cgroup mount points for process groups 94 | mkdir /dev/cpuctl 95 | mount cgroup none /dev/cpuctl cpu 96 | chown system system /dev/cpuctl 97 | chown system system /dev/cpuctl/tasks 98 | chmod 0660 /dev/cpuctl/tasks 99 | write /dev/cpuctl/cpu.shares 1024 100 | write /dev/cpuctl/cpu.rt_runtime_us 950000 101 | write /dev/cpuctl/cpu.rt_period_us 1000000 102 | 103 | mkdir /dev/cpuctl/apps 104 | chown system system /dev/cpuctl/apps/tasks 105 | chmod 0666 /dev/cpuctl/apps/tasks 106 | write /dev/cpuctl/apps/cpu.shares 1024 107 | write /dev/cpuctl/apps/cpu.rt_runtime_us 800000 108 | write /dev/cpuctl/apps/cpu.rt_period_us 1000000 109 | 110 | mkdir /dev/cpuctl/apps/bg_non_interactive 111 | chown system system /dev/cpuctl/apps/bg_non_interactive/tasks 112 | chmod 0666 /dev/cpuctl/apps/bg_non_interactive/tasks 113 | # 5.0 % 114 | write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52 115 | write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000 116 | write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000 117 | 118 | # Allow everybody to read the xt_qtaguid resource tracking misc dev. 119 | # This is needed by any process that uses socket tagging. 120 | chmod 0644 /dev/xt_qtaguid 121 | 122 | on fs 123 | # mount mtd partitions 124 | # Mount /system rw first to give the filesystem a chance to save a checkpoint 125 | #mount yaffs2 mtd@system /system 126 | #mount yaffs2 mtd@system /system ro remount 127 | #mount yaffs2 mtd@userdata /data nosuid nodev 128 | #mount yaffs2 mtd@cache /cache nosuid nodev 129 | 130 | on post-fs 131 | # once everything is setup, no need to modify / 132 | mount rootfs rootfs / ro remount 133 | 134 | # We chown/chmod /cache again so because mount is run as root + defaults 135 | chown system cache /cache 136 | chmod 0770 /cache 137 | 138 | # This may have been created by the recovery system with odd permissions 139 | chown system cache /cache/recovery 140 | chmod 0770 /cache/recovery 141 | 142 | #change permissions on vmallocinfo so we can grab it from bugreports 143 | chown root log /proc/vmallocinfo 144 | chmod 0440 /proc/vmallocinfo 145 | 146 | #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks 147 | chown root system /proc/kmsg 148 | chmod 0440 /proc/kmsg 149 | chown root system /proc/sysrq-trigger 150 | chmod 0220 /proc/sysrq-trigger 151 | 152 | # create the lost+found directories, so as to enforce our permissions 153 | mkdir /cache/lost+found 0770 root root 154 | 155 | on post-fs-data 156 | # We chown/chmod /data again so because mount is run as root + defaults 157 | chown system system /data 158 | chmod 0771 /data 159 | 160 | # Create dump dir and collect dumps. 161 | # Do this before we mount cache so eventually we can use cache for 162 | # storing dumps on platforms which do not have a dedicated dump partition. 163 | mkdir /data/dontpanic 0750 root log 164 | 165 | # Collect apanic data, free resources and re-arm trigger 166 | copy /proc/apanic_console /data/dontpanic/apanic_console 167 | chown root log /data/dontpanic/apanic_console 168 | chmod 0640 /data/dontpanic/apanic_console 169 | 170 | copy /proc/apanic_threads /data/dontpanic/apanic_threads 171 | chown root log /data/dontpanic/apanic_threads 172 | chmod 0640 /data/dontpanic/apanic_threads 173 | 174 | write /proc/apanic_console 1 175 | 176 | # create basic filesystem structure 177 | mkdir /data/misc 01771 system misc 178 | mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth 179 | mkdir /data/misc/bluetooth 0770 system system 180 | mkdir /data/misc/keystore 0700 keystore keystore 181 | mkdir /data/misc/keychain 0771 system system 182 | mkdir /data/misc/vpn 0770 system vpn 183 | mkdir /data/misc/systemkeys 0700 system system 184 | # give system access to wpa_supplicant.conf for backup and restore 185 | mkdir /data/misc/wifi 0770 wifi wifi 186 | chmod 0660 /data/misc/wifi/wpa_supplicant.conf 187 | mkdir /data/local 0751 root root 188 | 189 | # For security reasons, /data/local/tmp should always be empty. 190 | # Do not place files or directories in /data/local/tmp 191 | mkdir /data/local/tmp 0771 shell shell 192 | mkdir /data/data 0771 system system 193 | mkdir /data/app-private 0771 system system 194 | mkdir /data/app-asec 0700 root root 195 | mkdir /data/app 0771 system system 196 | mkdir /data/property 0700 root root 197 | mkdir /data/ssh 0750 root shell 198 | mkdir /data/ssh/empty 0700 root root 199 | 200 | # create dalvik-cache, so as to enforce our permissions 201 | mkdir /data/dalvik-cache 0771 system system 202 | 203 | # create resource-cache and double-check the perms 204 | mkdir /data/resource-cache 0771 system system 205 | chown system system /data/resource-cache 206 | chmod 0771 /data/resource-cache 207 | 208 | # create the lost+found directories, so as to enforce our permissions 209 | mkdir /data/lost+found 0770 root root 210 | 211 | # create directory for DRM plug-ins - give drm the read/write access to 212 | # the following directory. 213 | mkdir /data/drm 0770 drm drm 214 | 215 | # If there is no fs-post-data action in the init..rc file, you 216 | # must uncomment this line, otherwise encrypted filesystems 217 | # won't work. 218 | # Set indication (checked by vold) that we have finished this action 219 | #setprop vold.post_fs_data_done 1 220 | 221 | on boot 222 | # basic network init 223 | ifup lo 224 | hostname localhost 225 | domainname localdomain 226 | 227 | # set RLIMIT_NICE to allow priorities from 19 to -20 228 | setrlimit 13 40 40 229 | 230 | # Memory management. Basic kernel parameters, and allow the high 231 | # level system server to be able to adjust the kernel OOM driver 232 | # parameters to match how it is managing things. 233 | write /proc/sys/vm/overcommit_memory 1 234 | write /proc/sys/vm/min_free_order_shift 4 235 | chown root system /sys/module/lowmemorykiller/parameters/adj 236 | chmod 0664 /sys/module/lowmemorykiller/parameters/adj 237 | chown root system /sys/module/lowmemorykiller/parameters/minfree 238 | chmod 0664 /sys/module/lowmemorykiller/parameters/minfree 239 | 240 | # Tweak background writeout 241 | write /proc/sys/vm/dirty_expire_centisecs 200 242 | write /proc/sys/vm/dirty_background_ratio 5 243 | 244 | # Permissions for System Server and daemons. 245 | chown radio system /sys/android_power/state 246 | chown radio system /sys/android_power/request_state 247 | chown radio system /sys/android_power/acquire_full_wake_lock 248 | chown radio system /sys/android_power/acquire_partial_wake_lock 249 | chown radio system /sys/android_power/release_wake_lock 250 | chown system system /sys/power/state 251 | chown system system /sys/power/wakeup_count 252 | chown radio system /sys/power/wake_lock 253 | chown radio system /sys/power/wake_unlock 254 | chmod 0660 /sys/power/state 255 | chmod 0660 /sys/power/wake_lock 256 | chmod 0660 /sys/power/wake_unlock 257 | 258 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate 259 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate 260 | chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 261 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 262 | chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 263 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 264 | chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 265 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 266 | chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 267 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 268 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boost 269 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost 270 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse 271 | chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost 272 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost 273 | 274 | # Assume SMP uses shared cpufreq policy for all CPUs 275 | chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 276 | chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 277 | 278 | chown system system /sys/class/timed_output/vibrator/enable 279 | chown system system /sys/class/leds/keyboard-backlight/brightness 280 | chown system system /sys/class/leds/lcd-backlight/brightness 281 | chown system system /sys/class/leds/button-backlight/brightness 282 | chown system system /sys/class/leds/jogball-backlight/brightness 283 | chown system system /sys/class/leds/red/brightness 284 | chown system system /sys/class/leds/green/brightness 285 | chown system system /sys/class/leds/blue/brightness 286 | chown system system /sys/class/leds/red/device/grpfreq 287 | chown system system /sys/class/leds/red/device/grppwm 288 | chown system system /sys/class/leds/red/device/blink 289 | chown system system /sys/class/leds/red/brightness 290 | chown system system /sys/class/leds/green/brightness 291 | chown system system /sys/class/leds/blue/brightness 292 | chown system system /sys/class/leds/red/device/grpfreq 293 | chown system system /sys/class/leds/red/device/grppwm 294 | chown system system /sys/class/leds/red/device/blink 295 | chown system system /sys/class/timed_output/vibrator/enable 296 | chown system system /sys/module/sco/parameters/disable_esco 297 | chown system system /sys/kernel/ipv4/tcp_wmem_min 298 | chown system system /sys/kernel/ipv4/tcp_wmem_def 299 | chown system system /sys/kernel/ipv4/tcp_wmem_max 300 | chown system system /sys/kernel/ipv4/tcp_rmem_min 301 | chown system system /sys/kernel/ipv4/tcp_rmem_def 302 | chown system system /sys/kernel/ipv4/tcp_rmem_max 303 | chown root radio /proc/cmdline 304 | 305 | # Define TCP buffer sizes for various networks 306 | # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax, 307 | setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208 308 | setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576 309 | setprop net.tcp.buffersize.lte 524288,1048576,2097152,262144,524288,1048576 310 | setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208 311 | setprop net.tcp.buffersize.hspa 4094,87380,262144,4096,16384,262144 312 | setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040 313 | setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680 314 | 315 | # Set this property so surfaceflinger is not started by system_init 316 | setprop system_init.startsurfaceflinger 0 317 | 318 | class_start core 319 | class_start main 320 | 321 | on nonencrypted 322 | class_start late_start 323 | 324 | on charger 325 | class_start charger 326 | 327 | on property:vold.decrypt=trigger_reset_main 328 | class_reset main 329 | 330 | on property:vold.decrypt=trigger_load_persist_props 331 | load_persist_props 332 | 333 | on property:vold.decrypt=trigger_post_fs_data 334 | trigger post-fs-data 335 | 336 | on property:vold.decrypt=trigger_restart_min_framework 337 | class_start main 338 | 339 | on property:vold.decrypt=trigger_restart_framework 340 | class_start main 341 | class_start late_start 342 | 343 | on property:vold.decrypt=trigger_shutdown_framework 344 | class_reset late_start 345 | class_reset main 346 | 347 | ## Daemon processes to be run by init. 348 | ## 349 | service ueventd /sbin/ueventd 350 | class core 351 | critical 352 | 353 | service console /system/bin/sh 354 | class core 355 | console 356 | disabled 357 | user shell 358 | group log 359 | 360 | on property:ro.debuggable=1 361 | start console 362 | 363 | # adbd is controlled via property triggers in init..usb.rc 364 | service adbd /sbin/adbd 365 | class core 366 | disabled 367 | 368 | # adbd on at boot in emulator 369 | on property:ro.kernel.qemu=1 370 | start adbd 371 | 372 | service servicemanager /system/bin/servicemanager 373 | class core 374 | user system 375 | group system 376 | #critical 377 | #onrestart restart zygote 378 | #onrestart restart media 379 | #onrestart restart surfaceflinger 380 | #onrestart restart drm 381 | 382 | service vold /system/bin/vold 383 | class core 384 | socket vold stream 0660 root mount 385 | ioprio be 2 386 | 387 | service netd /system/bin/netd 388 | class main 389 | socket netd stream 0660 root system 390 | socket dnsproxyd stream 0660 root inet 391 | socket mdns stream 0660 root system 392 | 393 | service debuggerd /system/bin/debuggerd 394 | class main 395 | 396 | service ril-daemon /system/bin/rild 397 | class main 398 | socket rild stream 660 root radio 399 | socket rild-debug stream 660 radio system 400 | user root 401 | group radio cache inet misc audio sdcard_r sdcard_rw log 402 | 403 | service surfaceflinger /system/bin/surfaceflinger 404 | class main 405 | user system 406 | group graphics 407 | disabled 408 | onrestart restart zygote 409 | 410 | service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server 411 | class main 412 | socket zygote stream 660 root system 413 | disabled 414 | onrestart write /sys/android_power/request_state wake 415 | onrestart write /sys/power/state on 416 | onrestart restart media 417 | onrestart restart netd 418 | 419 | service drm /system/bin/drmserver 420 | class main 421 | user drm 422 | group drm system inet drmrpc sdcard_r 423 | 424 | service media /system/bin/mediaserver 425 | class main 426 | user media 427 | group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc 428 | ioprio rt 4 429 | 430 | service bootanim /system/bin/bootanimation 431 | class main 432 | user graphics 433 | group graphics 434 | disabled 435 | oneshot 436 | 437 | service dbus /system/bin/dbus-daemon --system --nofork 438 | class main 439 | socket dbus stream 660 bluetooth bluetooth 440 | user bluetooth 441 | group bluetooth net_bt_admin 442 | 443 | service bluetoothd /system/bin/bluetoothd -n 444 | class main 445 | socket bluetooth stream 660 bluetooth bluetooth 446 | socket dbus_bluetooth stream 660 bluetooth bluetooth 447 | # init.rc does not yet support applying capabilities, so run as root and 448 | # let bluetoothd drop uid to bluetooth with the right linux capabilities 449 | group bluetooth net_bt_admin misc 450 | disabled 451 | 452 | service installd /system/bin/installd 453 | class main 454 | socket installd stream 600 system system 455 | 456 | service flash_recovery /system/etc/install-recovery.sh 457 | class main 458 | oneshot 459 | 460 | service racoon /system/bin/racoon 461 | class main 462 | socket racoon stream 600 system system 463 | # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port. 464 | group vpn net_admin inet 465 | disabled 466 | oneshot 467 | 468 | service mtpd /system/bin/mtpd 469 | class main 470 | socket mtpd stream 600 system system 471 | user vpn 472 | group vpn net_admin inet net_raw 473 | disabled 474 | oneshot 475 | 476 | service keystore /system/bin/keystore /data/misc/keystore 477 | class main 478 | user keystore 479 | group keystore drmrpc 480 | socket keystore stream 666 481 | 482 | service dumpstate /system/bin/dumpstate -s 483 | class main 484 | socket dumpstate stream 0660 shell log 485 | disabled 486 | oneshot 487 | 488 | service sshd /system/bin/start-ssh 489 | class main 490 | disabled 491 | 492 | service mdnsd /system/bin/mdnsd 493 | class main 494 | user mdnsr 495 | group inet net_raw 496 | socket mdnsd stream 0660 mdnsr inet 497 | disabled 498 | oneshot 499 | -------------------------------------------------------------------------------- /data/init.trace.rc: -------------------------------------------------------------------------------- 1 | ## Permissions to allow system-wide tracing to the kernel trace buffer. 2 | ## 3 | on boot 4 | 5 | # Allow writing to the kernel trace log. 6 | chmod 0222 /sys/kernel/debug/tracing/trace_marker 7 | 8 | # Allow the shell group to enable (some) kernel tracing. 9 | chown root shell /sys/kernel/debug/tracing/trace_clock 10 | chown root shell /sys/kernel/debug/tracing/buffer_size_kb 11 | chown root shell /sys/kernel/debug/tracing/options/overwrite 12 | chown root shell /sys/kernel/debug/tracing/events/sched/sched_switch/enable 13 | chown root shell /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable 14 | chown root shell /sys/kernel/debug/tracing/events/power/cpu_frequency/enable 15 | chown root shell /sys/kernel/debug/tracing/events/power/cpu_idle/enable 16 | chown root shell /sys/kernel/debug/tracing/events/cpufreq_interactive/enable 17 | chown root shell /sys/kernel/debug/tracing/tracing_on 18 | 19 | chmod 0664 /sys/kernel/debug/tracing/trace_clock 20 | chmod 0664 /sys/kernel/debug/tracing/buffer_size_kb 21 | chmod 0664 /sys/kernel/debug/tracing/options/overwrite 22 | chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_switch/enable 23 | chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable 24 | chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_frequency/enable 25 | chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_idle/enable 26 | chmod 0664 /sys/kernel/debug/tracing/events/cpufreq_interactive/enable 27 | chmod 0664 /sys/kernel/debug/tracing/tracing_on 28 | 29 | # Allow only the shell group to read and truncate the kernel trace. 30 | chown root shell /sys/kernel/debug/tracing/trace 31 | chmod 0660 /sys/kernel/debug/tracing/trace 32 | -------------------------------------------------------------------------------- /data/init.usb.rc: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 The Android Open Source Project 2 | # 3 | # USB configuration common for all android devices 4 | # 5 | 6 | on post-fs-data 7 | chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file 8 | chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file 9 | chown system system /sys/class/android_usb/android0/f_rndis/ethaddr 10 | chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr 11 | 12 | # Used to disable USB when switching states 13 | on property:sys.usb.config=none 14 | stop adbd 15 | write /sys/class/android_usb/android0/enable 0 16 | write /sys/class/android_usb/android0/bDeviceClass 0 17 | setprop sys.usb.state ${sys.usb.config} 18 | 19 | # adb only USB configuration 20 | # This should only be used during device bringup 21 | # and as a fallback if the USB manager fails to set a standard configuration 22 | on property:sys.usb.config=adb 23 | write /sys/class/android_usb/android0/enable 0 24 | write /sys/class/android_usb/android0/idVendor 18d1 25 | write /sys/class/android_usb/android0/idProduct D002 26 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 27 | write /sys/class/android_usb/android0/enable 1 28 | start adbd 29 | setprop sys.usb.state ${sys.usb.config} 30 | 31 | # USB accessory configuration 32 | on property:sys.usb.config=accessory 33 | write /sys/class/android_usb/android0/enable 0 34 | write /sys/class/android_usb/android0/idVendor 18d1 35 | write /sys/class/android_usb/android0/idProduct 2d00 36 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 37 | write /sys/class/android_usb/android0/enable 1 38 | setprop sys.usb.state ${sys.usb.config} 39 | 40 | # USB accessory configuration, with adb 41 | on property:sys.usb.config=accessory,adb 42 | write /sys/class/android_usb/android0/enable 0 43 | write /sys/class/android_usb/android0/idVendor 18d1 44 | write /sys/class/android_usb/android0/idProduct 2d01 45 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 46 | write /sys/class/android_usb/android0/enable 1 47 | start adbd 48 | setprop sys.usb.state ${sys.usb.config} 49 | 50 | # audio accessory configuration 51 | on property:sys.usb.config=audio_source 52 | write /sys/class/android_usb/android0/enable 0 53 | write /sys/class/android_usb/android0/idVendor 18d1 54 | write /sys/class/android_usb/android0/idProduct 2d02 55 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 56 | write /sys/class/android_usb/android0/enable 1 57 | setprop sys.usb.state ${sys.usb.config} 58 | 59 | # audio accessory configuration, with adb 60 | on property:sys.usb.config=audio_source,adb 61 | write /sys/class/android_usb/android0/enable 0 62 | write /sys/class/android_usb/android0/idVendor 18d1 63 | write /sys/class/android_usb/android0/idProduct 2d03 64 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 65 | write /sys/class/android_usb/android0/enable 1 66 | start adbd 67 | setprop sys.usb.state ${sys.usb.config} 68 | 69 | # USB and audio accessory configuration 70 | on property:sys.usb.config=accessory,audio_source 71 | write /sys/class/android_usb/android0/enable 0 72 | write /sys/class/android_usb/android0/idVendor 18d1 73 | write /sys/class/android_usb/android0/idProduct 2d04 74 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 75 | write /sys/class/android_usb/android0/enable 1 76 | setprop sys.usb.state ${sys.usb.config} 77 | 78 | # USB and audio accessory configuration, with adb 79 | on property:sys.usb.config=accessory,audio_source,adb 80 | write /sys/class/android_usb/android0/enable 0 81 | write /sys/class/android_usb/android0/idVendor 18d1 82 | write /sys/class/android_usb/android0/idProduct 2d05 83 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 84 | write /sys/class/android_usb/android0/enable 1 85 | start adbd 86 | setprop sys.usb.state ${sys.usb.config} 87 | 88 | # Used to set USB configuration at boot and to switch the configuration 89 | # when changing the default configuration 90 | on property:persist.sys.usb.config=* 91 | setprop sys.usb.config ${persist.sys.usb.config} 92 | -------------------------------------------------------------------------------- /data/init.xilinxzynqplatform.rc: -------------------------------------------------------------------------------- 1 | on early-init 2 | export EXTERNAL_STORAGE /mnt/sdcard 3 | mkdir /mnt/sdcard 0000 system system 4 | # for backwards compatibility 5 | 6 | write /devtmpfs/console "waiting for /dev/console" 7 | wait /dev/console 20 8 | write /devtmpfs/console "waiting for /dev/block" 9 | wait /dev/block 20 10 | write /devtmpfs/console "waiting for /dev/block/mmcblk0p1" 11 | wait /dev/block/mmcblk0p1 12 | write /devtmpfs/console "waiting for /devtmpfs/mmcblk0p1" 13 | wait /devtmpfs/mmcblk0p1 20 14 | mount vfat /devtmpfs/mmcblk0p1 /mnt/sdcard rw wait 15 | write /devtmpfs/console "waiting for system.img" 16 | wait /mnt/sdcard/system.img 20 17 | mount ext4 loop@/mnt/sdcard/system.img /system rw wait 18 | mount ext4 loop@/mnt/sdcard/userdata.img /data rw nosuid nodev wait 19 | chown 0 /fpgajtag 20 | #doesn't exist chgrp 0 /fpgajtag 21 | chmod 4755 /fpgajtag 22 | mkdir /mnt/sdcard/tmp 0000 system system 23 | mount tmpfs tmpfs /mnt/sdcard/tmp 24 | mkdir /mnt/sdcard1 0000 system system 25 | mount debugfs debugfs /sys/kernel/debug 26 | class_start zynq 27 | 28 | service webserver /mnt/sdcard/webserver 29 | class zynq 30 | user root 31 | group root 32 | setenv PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin 33 | 34 | service zynqmodules /zynqmodules.sh 35 | oneshot 36 | class zynq 37 | user root 38 | group root 39 | setenv PATH /sbin:/system/bin:/system/sbin:/system/xbin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/athwlan.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/athwlan.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/bdata.SD31.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/bdata.SD31.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/bdata.SD32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/bdata.SD32.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/bdata.WB31.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/bdata.WB31.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/bdata.bin: -------------------------------------------------------------------------------- 1 | bdata.SD31.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/data.patch.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/data.patch.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/endpointping.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/endpointping.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/fw-2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/fw-2.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/fw-3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/fw-3.bin -------------------------------------------------------------------------------- /data/lib/firmware/ath6k/AR6003/hw2.1.1/otp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/lib/firmware/ath6k/AR6003/hw2.1.1/otp.bin -------------------------------------------------------------------------------- /data/lib/modules: -------------------------------------------------------------------------------- 1 | ../mnt/sdcard -------------------------------------------------------------------------------- /data/proc/unused: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/proc/unused -------------------------------------------------------------------------------- /data/sbin/adbd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/sbin/adbd -------------------------------------------------------------------------------- /data/sbin/ueventd: -------------------------------------------------------------------------------- 1 | ../init -------------------------------------------------------------------------------- /data/sys/unused: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/sys/unused -------------------------------------------------------------------------------- /data/system/unused: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/data/system/unused -------------------------------------------------------------------------------- /data/ueventd.rc: -------------------------------------------------------------------------------- 1 | /dev/null 0666 root root 2 | /dev/zero 0666 root root 3 | /dev/full 0666 root root 4 | /dev/ptmx 0666 root root 5 | /dev/tty 0666 root root 6 | /dev/random 0666 root root 7 | /dev/urandom 0666 root root 8 | /dev/ashmem 0666 root root 9 | /dev/binder 0666 root root 10 | 11 | # Anyone can read the logs, but if they're not in the "logs" 12 | # group, then they'll only see log entries for their UID. 13 | /dev/log/* 0666 root log 14 | 15 | # the msm hw3d client device node is world writable/readable. 16 | /dev/msm_hw3dc 0666 root root 17 | 18 | # gpu driver for adreno200 is globally accessible 19 | /dev/kgsl 0666 root root 20 | 21 | # these should not be world writable 22 | /dev/diag 0660 radio radio 23 | /dev/diag_arm9 0660 radio radio 24 | /dev/android_adb 0660 adb adb 25 | /dev/android_adb_enable 0660 adb adb 26 | /dev/ttyMSM0 0600 bluetooth bluetooth 27 | /dev/uinput 0660 system bluetooth 28 | /dev/alarm 0664 system radio 29 | /dev/tty0 0660 root system 30 | /dev/graphics/* 0660 root graphics 31 | /dev/msm_hw3dm 0660 system graphics 32 | /dev/input/* 0660 root input 33 | /dev/eac 0660 root audio 34 | /dev/cam 0660 root camera 35 | /dev/pmem 0660 system graphics 36 | /dev/pmem_adsp* 0660 system audio 37 | /dev/pmem_camera* 0660 system camera 38 | /dev/oncrpc/* 0660 root system 39 | /dev/adsp/* 0660 system audio 40 | /dev/snd/* 0660 system audio 41 | /dev/mt9t013 0660 system system 42 | /dev/msm_camera/* 0660 system system 43 | /dev/akm8976_daemon 0640 compass system 44 | /dev/akm8976_aot 0640 compass system 45 | /dev/akm8973_daemon 0640 compass system 46 | /dev/akm8973_aot 0640 compass system 47 | /dev/bma150 0640 compass system 48 | /dev/cm3602 0640 compass system 49 | /dev/akm8976_pffd 0640 compass system 50 | /dev/lightsensor 0640 system system 51 | /dev/msm_pcm_out* 0660 system audio 52 | /dev/msm_pcm_in* 0660 system audio 53 | /dev/msm_pcm_ctl* 0660 system audio 54 | /dev/msm_snd* 0660 system audio 55 | /dev/msm_mp3* 0660 system audio 56 | /dev/audience_a1026* 0660 system audio 57 | /dev/tpa2018d1* 0660 system audio 58 | /dev/msm_audpre 0660 system audio 59 | /dev/msm_audio_ctl 0660 system audio 60 | /dev/htc-acoustic 0660 system audio 61 | /dev/vdec 0660 system audio 62 | /dev/q6venc 0660 system audio 63 | /dev/snd/dsp 0660 system audio 64 | /dev/snd/dsp1 0660 system audio 65 | /dev/snd/mixer 0660 system audio 66 | /dev/smd0 0640 radio radio 67 | /dev/qmi 0640 radio radio 68 | /dev/qmi0 0640 radio radio 69 | /dev/qmi1 0640 radio radio 70 | /dev/qmi2 0640 radio radio 71 | /dev/bus/usb/* 0660 root usb 72 | /dev/mtp_usb 0660 root mtp 73 | /dev/usb_accessory 0660 root usb 74 | /dev/tun 0660 system vpn 75 | 76 | # CDMA radio interface MUX 77 | /dev/ts0710mux* 0640 radio radio 78 | /dev/ppp 0660 radio vpn 79 | 80 | # sysfs properties 81 | /sys/devices/virtual/input/input* enable 0660 root input 82 | /sys/devices/virtual/input/input* poll_delay 0660 root input 83 | /sys/devices/virtual/usb_composite/* enable 0664 root system 84 | -------------------------------------------------------------------------------- /data/ueventd.xilinxzynqplatform.rc: -------------------------------------------------------------------------------- 1 | # These settings are specific to running under the Android emulator 2 | /dev/qemu_trace 0666 system system 3 | /dev/qemu_pipe 0666 system system 4 | /dev/ttyS* 0666 system system 5 | /proc 0666 system system 6 | /dev/connectal 0666 system system 7 | /dev/portal* 0666 system system 8 | /dev/i2c-0 0666 system system 9 | /dev/i2c-1 0666 system system 10 | -------------------------------------------------------------------------------- /data/zynqmodules.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | set -x 3 | set -e 4 | echo running "/zynqmodules.sh" 5 | insmod /mnt/sdcard/portalmem.ko 6 | insmod /mnt/sdcard/zynqportal.ko 7 | -------------------------------------------------------------------------------- /dts/skeleton.dtsi: -------------------------------------------------------------------------------- 1 | /* 2 | * Skeleton device tree; the bare minimum needed to boot; just include and 3 | * add a compatible value. The bootloader will typically populate the memory 4 | * node. 5 | */ 6 | 7 | / { 8 | #address-cells = <1>; 9 | #size-cells = <1>; 10 | chosen { }; 11 | aliases { }; 12 | memory { device_type = "memory"; reg = <0 0>; }; 13 | }; 14 | -------------------------------------------------------------------------------- /dts/zynq-7000.dtsi: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 - 2014 Xilinx 3 | * 4 | * This software is licensed under the terms of the GNU General Public 5 | * License version 2, as published by the Free Software Foundation, and 6 | * may be copied, distributed, and modified under those terms. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | */ 13 | /include/ "skeleton.dtsi" 14 | 15 | / { 16 | compatible = "xlnx,zynq-7000"; 17 | 18 | cpus { 19 | #address-cells = <1>; 20 | #size-cells = <0>; 21 | 22 | cpu@0 { 23 | compatible = "arm,cortex-a9"; 24 | device_type = "cpu"; 25 | reg = <0>; 26 | clocks = <&clkc 3>; 27 | clock-latency = <1000>; 28 | cpu0-supply = <®ulator_vccpint>; 29 | operating-points = < 30 | /* kHz uV */ 31 | 666667 1000000 32 | 333334 1000000 33 | >; 34 | }; 35 | 36 | cpu@1 { 37 | compatible = "arm,cortex-a9"; 38 | device_type = "cpu"; 39 | reg = <1>; 40 | clocks = <&clkc 3>; 41 | }; 42 | }; 43 | 44 | pmu { 45 | compatible = "arm,cortex-a9-pmu"; 46 | interrupts = <0 5 4>, <0 6 4>; 47 | interrupt-parent = <&intc>; 48 | reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >; 49 | }; 50 | 51 | regulator_vccpint: fixedregulator@0 { 52 | compatible = "regulator-fixed"; 53 | regulator-name = "VCCPINT"; 54 | regulator-min-microvolt = <1000000>; 55 | regulator-max-microvolt = <1000000>; 56 | regulator-boot-on; 57 | regulator-always-on; 58 | }; 59 | 60 | amba: amba { 61 | compatible = "simple-bus"; 62 | #address-cells = <1>; 63 | #size-cells = <1>; 64 | interrupt-parent = <&intc>; 65 | ranges; 66 | 67 | adc: adc@f8007100 { 68 | compatible = "xlnx,zynq-xadc-1.00.a"; 69 | reg = <0xf8007100 0x20>; 70 | interrupts = <0 7 4>; 71 | interrupt-parent = <&intc>; 72 | clocks = <&clkc 12>; 73 | }; 74 | 75 | can0: can@e0008000 { 76 | compatible = "xlnx,zynq-can-1.0"; 77 | status = "disabled"; 78 | clocks = <&clkc 19>, <&clkc 36>; 79 | clock-names = "can_clk", "pclk"; 80 | reg = <0xe0008000 0x1000>; 81 | interrupts = <0 28 4>; 82 | interrupt-parent = <&intc>; 83 | tx-fifo-depth = <0x40>; 84 | rx-fifo-depth = <0x40>; 85 | }; 86 | 87 | can1: can@e0009000 { 88 | compatible = "xlnx,zynq-can-1.0"; 89 | status = "disabled"; 90 | clocks = <&clkc 20>, <&clkc 37>; 91 | clock-names = "can_clk", "pclk"; 92 | reg = <0xe0009000 0x1000>; 93 | interrupts = <0 51 4>; 94 | interrupt-parent = <&intc>; 95 | tx-fifo-depth = <0x40>; 96 | rx-fifo-depth = <0x40>; 97 | }; 98 | 99 | gpio0: gpio@e000a000 { 100 | compatible = "xlnx,zynq-gpio-1.0"; 101 | #gpio-cells = <2>; 102 | clocks = <&clkc 42>; 103 | gpio-controller; 104 | interrupt-parent = <&intc>; 105 | interrupts = <0 20 4>; 106 | reg = <0xe000a000 0x1000>; 107 | }; 108 | 109 | i2c0: i2c@e0004000 { 110 | compatible = "cdns,i2c-r1p10"; 111 | status = "disabled"; 112 | clocks = <&clkc 38>; 113 | interrupt-parent = <&intc>; 114 | interrupts = <0 25 4>; 115 | reg = <0xe0004000 0x1000>; 116 | #address-cells = <1>; 117 | #size-cells = <0>; 118 | }; 119 | 120 | i2c1: i2c@e0005000 { 121 | compatible = "cdns,i2c-r1p10"; 122 | status = "disabled"; 123 | clocks = <&clkc 39>; 124 | interrupt-parent = <&intc>; 125 | interrupts = <0 48 4>; 126 | reg = <0xe0005000 0x1000>; 127 | #address-cells = <1>; 128 | #size-cells = <0>; 129 | }; 130 | 131 | intc: interrupt-controller@f8f01000 { 132 | compatible = "arm,cortex-a9-gic"; 133 | #interrupt-cells = <3>; 134 | interrupt-controller; 135 | reg = <0xF8F01000 0x1000>, 136 | <0xF8F00100 0x100>; 137 | }; 138 | 139 | L2: cache-controller@f8f02000 { 140 | compatible = "arm,pl310-cache"; 141 | reg = <0xF8F02000 0x1000>; 142 | arm,data-latency = <3 2 2>; 143 | arm,tag-latency = <2 2 2>; 144 | cache-unified; 145 | cache-level = <2>; 146 | }; 147 | 148 | mc0: memory-controller@f8006000 { 149 | compatible = "xlnx,zynq-ddrc-1.0"; 150 | reg = <0xf8006000 0x1000>; 151 | xlnx,has-ecc = <0x0>; 152 | }; 153 | 154 | ocmc: ocmc@f800c000 { 155 | compatible = "xlnx,zynq-ocmc-1.0"; 156 | interrupt-parent = <&intc>; 157 | interrupts = <0 3 4>; 158 | reg = <0xf800c000 0x1000>; 159 | }; 160 | 161 | uart0: serial@e0000000 { 162 | compatible = "xlnx,xuartps", "cdns,uart-r1p8"; 163 | status = "disabled"; 164 | clocks = <&clkc 23>, <&clkc 40>; 165 | clock-names = "uart_clk", "pclk"; 166 | reg = <0xE0000000 0x1000>; 167 | interrupts = <0 27 4>; 168 | }; 169 | 170 | uart1: serial@e0001000 { 171 | compatible = "xlnx,xuartps", "cdns,uart-r1p8"; 172 | status = "disabled"; 173 | clocks = <&clkc 24>, <&clkc 41>; 174 | clock-names = "uart_clk", "pclk"; 175 | reg = <0xE0001000 0x1000>; 176 | interrupts = <0 50 4>; 177 | }; 178 | 179 | spi0: spi@e0006000 { 180 | compatible = "xlnx,zynq-spi-r1p6"; 181 | reg = <0xe0006000 0x1000>; 182 | status = "disabled"; 183 | interrupt-parent = <&intc>; 184 | interrupts = <0 26 4>; 185 | clocks = <&clkc 25>, <&clkc 34>; 186 | clock-names = "ref_clk", "pclk"; 187 | #address-cells = <1>; 188 | #size-cells = <0>; 189 | }; 190 | 191 | spi1: spi@e0007000 { 192 | compatible = "xlnx,zynq-spi-r1p6"; 193 | reg = <0xe0007000 0x1000>; 194 | status = "disabled"; 195 | interrupt-parent = <&intc>; 196 | interrupts = <0 49 4>; 197 | clocks = <&clkc 26>, <&clkc 35>; 198 | clock-names = "ref_clk", "pclk"; 199 | #address-cells = <1>; 200 | #size-cells = <0>; 201 | }; 202 | 203 | qspi: spi@e000d000 { 204 | clock-names = "ref_clk", "pclk"; 205 | clocks = <&clkc 10>, <&clkc 43>; 206 | compatible = "xlnx,zynq-qspi-1.0"; 207 | status = "disabled"; 208 | interrupt-parent = <&intc>; 209 | interrupts = <0 19 4>; 210 | reg = <0xe000d000 0x1000>; 211 | #address-cells = <1>; 212 | #size-cells = <0>; 213 | }; 214 | 215 | smcc: memory-controller@e000e000 { 216 | #address-cells = <1>; 217 | #size-cells = <1>; 218 | status = "disabled"; 219 | clock-names = "memclk", "aclk"; 220 | clocks = <&clkc 11>, <&clkc 44>; 221 | compatible = "arm,pl353-smc-r2p1"; 222 | interrupt-parent = <&intc>; 223 | interrupts = <0 18 4>; 224 | ranges ; 225 | reg = <0xe000e000 0x1000>; 226 | nand0: flash@e1000000 { 227 | status = "disabled"; 228 | compatible = "arm,pl353-nand-r2p1"; 229 | reg = <0xe1000000 0x1000000>; 230 | #address-cells = <0x1>; 231 | #size-cells = <0x1>; 232 | }; 233 | nor0: flash@e2000000 { 234 | status = "disabled"; 235 | compatible = "cfi-flash"; 236 | reg = <0xe2000000 0x1000>; 237 | #address-cells = <1>; 238 | #size-cells = <1>; 239 | }; 240 | }; 241 | 242 | gem0: ethernet@e000b000 { 243 | compatible = "xlnx,ps7-ethernet-1.00.a"; 244 | reg = <0xe000b000 0x1000>; 245 | status = "disabled"; 246 | interrupts = <0 22 4>; 247 | clocks = <&clkc 13>, <&clkc 30>; 248 | clock-names = "ref_clk", "aper_clk"; 249 | local-mac-address-marker-string = "THE NEXT FIELD IS THE LOCAL MAC ADDRESS FOR UPDATE"; 250 | local-mac-address = [ 00 E0 0C 00 73 03 ]; 251 | xlnx,has-mdio = <0x1>; 252 | #address-cells = <1>; 253 | #size-cells = <0>; 254 | }; 255 | 256 | gem1: ethernet@e000c000 { 257 | compatible = "xlnx,ps7-ethernet-1.00.a"; 258 | reg = <0xe000c000 0x1000>; 259 | status = "disabled"; 260 | interrupts = <0 45 4>; 261 | clocks = <&clkc 14>, <&clkc 31>; 262 | clock-names = "ref_clk", "aper_clk"; 263 | local-mac-address = [00 0a 35 00 00 00]; 264 | xlnx,has-mdio = <0x1>; 265 | #address-cells = <1>; 266 | #size-cells = <0>; 267 | }; 268 | 269 | sdhci0: sdhci@e0100000 { 270 | compatible = "arasan,sdhci-8.9a"; 271 | status = "disabled"; 272 | clock-names = "clk_xin", "clk_ahb"; 273 | clocks = <&clkc 21>, <&clkc 32>; 274 | interrupt-parent = <&intc>; 275 | interrupts = <0 24 4>; 276 | reg = <0xe0100000 0x1000>; 277 | }; 278 | 279 | sdhci1: sdhci@e0101000 { 280 | compatible = "arasan,sdhci-8.9a"; 281 | status = "disabled"; 282 | clock-names = "clk_xin", "clk_ahb"; 283 | clocks = <&clkc 22>, <&clkc 33>; 284 | interrupt-parent = <&intc>; 285 | interrupts = <0 47 4>; 286 | reg = <0xe0101000 0x1000>; 287 | clock-frequency = <10000000>; 288 | }; 289 | 290 | slcr: slcr@f8000000 { 291 | #address-cells = <1>; 292 | #size-cells = <1>; 293 | compatible = "xlnx,zynq-slcr", "syscon"; 294 | reg = <0xF8000000 0x1000>; 295 | ranges; 296 | clkc: clkc@100 { 297 | #clock-cells = <1>; 298 | compatible = "xlnx,ps7-clkc"; 299 | ps-clk-frequency = <33333333>; 300 | fclk-enable = <0xf>; 301 | clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x", 302 | "cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x", 303 | "dci", "lqspi", "smc", "pcap", "gem0", "gem1", 304 | "fclk0", "fclk1", "fclk2", "fclk3", "can0", "can1", 305 | "sdio0", "sdio1", "uart0", "uart1", "spi0", "spi1", 306 | "dma", "usb0_aper", "usb1_aper", "gem0_aper", 307 | "gem1_aper", "sdio0_aper", "sdio1_aper", 308 | "spi0_aper", "spi1_aper", "can0_aper", "can1_aper", 309 | "i2c0_aper", "i2c1_aper", "uart0_aper", "uart1_aper", 310 | "gpio_aper", "lqspi_aper", "smc_aper", "swdt", 311 | "dbg_trc", "dbg_apb"; 312 | reg = <0x100 0x100>; 313 | }; 314 | }; 315 | 316 | dmac_s: dmac@f8003000 { 317 | compatible = "arm,pl330", "arm,primecell"; 318 | reg = <0xf8003000 0x1000>; 319 | interrupt-parent = <&intc>; 320 | interrupt-names = "abort", "dma0", "dma1", "dma2", "dma3", 321 | "dma4", "dma5", "dma6", "dma7"; 322 | interrupts = <0 13 4>, 323 | <0 14 4>, <0 15 4>, 324 | <0 16 4>, <0 17 4>, 325 | <0 40 4>, <0 41 4>, 326 | <0 42 4>, <0 43 4>; 327 | #dma-cells = <1>; 328 | #dma-channels = <8>; 329 | #dma-requests = <4>; 330 | clocks = <&clkc 27>; 331 | clock-names = "apb_pclk"; 332 | }; 333 | 334 | devcfg: devcfg@f8007000 { 335 | clock-names = "ref_clk", "fclk0", "fclk1", "fclk2", "fclk3"; 336 | clocks = <&clkc 12>, <&clkc 15>, <&clkc 16>, <&clkc 17>, <&clkc 18>; 337 | compatible = "xlnx,zynq-devcfg-1.0"; 338 | interrupt-parent = <&intc>; 339 | interrupts = <0 8 4>; 340 | reg = <0xf8007000 0x100>; 341 | }; 342 | 343 | global_timer: timer@f8f00200 { 344 | compatible = "arm,cortex-a9-global-timer"; 345 | reg = <0xf8f00200 0x20>; 346 | interrupts = <1 11 0x301>; 347 | interrupt-parent = <&intc>; 348 | clocks = <&clkc 4>; 349 | }; 350 | 351 | ttc0: timer@f8001000 { 352 | interrupt-parent = <&intc>; 353 | interrupts = <0 10 4>, <0 11 4>, <0 12 4>; 354 | compatible = "cdns,ttc"; 355 | clocks = <&clkc 6>; 356 | reg = <0xF8001000 0x1000>; 357 | }; 358 | 359 | ttc1: timer@f8002000 { 360 | interrupt-parent = <&intc>; 361 | interrupts = <0 37 4>, <0 38 4>, <0 39 4>; 362 | compatible = "cdns,ttc"; 363 | clocks = <&clkc 6>; 364 | reg = <0xF8002000 0x1000>; 365 | }; 366 | 367 | scutimer: timer@f8f00600 { 368 | interrupt-parent = <&intc>; 369 | interrupts = <1 13 0x301>; 370 | compatible = "arm,cortex-a9-twd-timer"; 371 | reg = <0xf8f00600 0x20>; 372 | clocks = <&clkc 4>; 373 | }; 374 | 375 | watchdog0: watchdog@f8005000 { 376 | clocks = <&clkc 45>; 377 | compatible = "xlnx,zynq-wdt-r1p2"; 378 | device_type = "watchdog"; 379 | interrupt-parent = <&intc>; 380 | interrupts = <0 9 1>; 381 | reg = <0xf8005000 0x1000>; 382 | reset = <0>; 383 | timeout-sec = <10>; 384 | }; 385 | 386 | usb0: usb@e0002000 { 387 | clocks = <&clkc 28>; 388 | compatible = "xlnx,ps7-usb-1.00.a", "xlnx,zynq-usb-1.00.a"; 389 | status = "disabled"; 390 | interrupt-parent = <&intc>; 391 | interrupts = <0 21 4>; 392 | reg = <0xe0002000 0x1000>; 393 | }; 394 | 395 | usb1: usb@e0003000 { 396 | clocks = <&clkc 29>; 397 | compatible = "xlnx,ps7-usb-1.00.a", "xlnx,zynq-usb-1.00.a"; 398 | status = "disabled"; 399 | interrupt-parent = <&intc>; 400 | interrupts = <0 44 4>; 401 | reg = <0xe0003000 0x1000>; 402 | }; 403 | /* assigned interrupt number corresponds to actual SPI - 32 */ 404 | connectal@0x6e400000 { 405 | compatible = "linux,portal-0.01.a"; 406 | interrupts = <0 29 4>; 407 | interrupt-parent = <&intc>; 408 | reg = <0x6e400000 0x10000>; 409 | device-name = "connectal"; 410 | clocks = <&clkc 15>, <&clkc 16>, <&clkc 17>, <&clkc 18>; 411 | clock-names = "fclk0", "fclk1", "fclk2", "fclk3"; 412 | }; 413 | }; 414 | }; 415 | -------------------------------------------------------------------------------- /dts/zynq-parallella.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 SUSE LINUX Products GmbH 3 | * 4 | * Derived from zynq-zed.dts: 5 | * 6 | * Copyright (C) 2011 Xilinx 7 | * Copyright (C) 2012 National Instruments Corp. 8 | * Copyright (C) 2013 Xilinx 9 | * 10 | * This software is licensed under the terms of the GNU General Public 11 | * License version 2, as published by the Free Software Foundation, and 12 | * may be copied, distributed, and modified under those terms. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | */ 19 | /dts-v1/; 20 | /include/ "zynq-7000.dtsi" 21 | 22 | / { 23 | model = "Adapteva Parallella Board"; 24 | compatible = "adapteva,parallella", "xlnx,zynq-7000"; 25 | 26 | memory { 27 | device_type = "memory"; 28 | reg = <0 0x40000000>; 29 | }; 30 | 31 | chosen { 32 | bootargs = "console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait"; 33 | linux,stdout-path = "/amba/serial@e0001000"; 34 | }; 35 | }; 36 | 37 | &gem0 { 38 | status = "okay"; 39 | phy-mode = "rgmii-id"; 40 | phy-handle = <ðernet_phy>; 41 | #address-cells = <1>; 42 | #size-cells = <0>; 43 | 44 | ethernet_phy: ethernet-phy@0 { 45 | /* Marvell 88E1318 */ 46 | compatible = "ethernet-phy-id0141.0e90", 47 | "ethernet-phy-ieee802.3-c22"; 48 | reg = <0>; 49 | marvell,reg-init = <0x3 0x10 0xff00 0x1e>, 50 | <0x3 0x11 0xfff0 0xa>; 51 | }; 52 | }; 53 | 54 | &i2c0 { 55 | status = "okay"; 56 | }; 57 | 58 | &sdhci1 { 59 | status = "okay"; 60 | }; 61 | 62 | &uart1 { 63 | status = "okay"; 64 | }; 65 | -------------------------------------------------------------------------------- /dts/zynq-zc702.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 - 2014 Xilinx 3 | * Copyright (C) 2012 National Instruments Corp. 4 | * 5 | * This software is licensed under the terms of the GNU General Public 6 | * License version 2, as published by the Free Software Foundation, and 7 | * may be copied, distributed, and modified under those terms. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | */ 14 | /dts-v1/; 15 | /include/ "zynq-7000.dtsi" 16 | 17 | / { 18 | model = "Zynq ZC702 Development Board"; 19 | compatible = "xlnx,zynq-zc702", "xlnx,zynq-7000"; 20 | 21 | aliases { 22 | ethernet0 = &gem0; 23 | i2c0 = &i2c0; 24 | serial0 = &uart1; 25 | spi0 = &qspi; 26 | }; 27 | 28 | memory { 29 | device_type = "memory"; 30 | reg = <0x0 0x40000000>; 31 | }; 32 | 33 | chosen { 34 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 35 | linux,stdout-path = "/amba/serial@e0001000"; 36 | }; 37 | }; 38 | 39 | &qspi { 40 | status = "okay"; 41 | is-dual = <0>; 42 | num-cs = <1>; 43 | flash@0 { 44 | compatible = "n25q128a11"; 45 | reg = <0x0>; 46 | spi-tx-bus-width = <1>; 47 | spi-rx-bus-width = <4>; 48 | spi-max-frequency = <50000000>; 49 | #address-cells = <1>; 50 | #size-cells = <1>; 51 | partition@qspi-fsbl-uboot { 52 | label = "qspi-fsbl-uboot"; 53 | reg = <0x0 0x100000>; 54 | }; 55 | partition@qspi-linux { 56 | label = "qspi-linux"; 57 | reg = <0x100000 0x500000>; 58 | }; 59 | partition@qspi-device-tree { 60 | label = "qspi-device-tree"; 61 | reg = <0x600000 0x20000>; 62 | }; 63 | partition@qspi-rootfs { 64 | label = "qspi-rootfs"; 65 | reg = <0x620000 0x5E0000>; 66 | }; 67 | partition@qspi-bitstream { 68 | label = "qspi-bitstream"; 69 | reg = <0xC00000 0x400000>; 70 | }; 71 | }; 72 | }; 73 | 74 | &usb0 { 75 | status = "okay"; 76 | dr_mode = "host"; 77 | phy_type = "ulpi"; 78 | usb-reset = <&gpio0 7 0>; 79 | }; 80 | 81 | &gem0 { 82 | status = "okay"; 83 | phy-mode = "rgmii-id"; 84 | phy-handle = <&phy0>; 85 | 86 | phy0: phy@7 { 87 | reg = <7>; 88 | }; 89 | }; 90 | 91 | &i2c0 { 92 | status = "okay"; 93 | clock-frequency = <400000>; 94 | }; 95 | 96 | &sdhci0 { 97 | status = "okay"; 98 | }; 99 | 100 | &uart1 { 101 | status = "okay"; 102 | }; 103 | -------------------------------------------------------------------------------- /dts/zynq-zc706.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 - 2014 Xilinx 3 | * Copyright (C) 2012 National Instruments Corp. 4 | * 5 | * This software is licensed under the terms of the GNU General Public 6 | * License version 2, as published by the Free Software Foundation, and 7 | * may be copied, distributed, and modified under those terms. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | */ 14 | /dts-v1/; 15 | /include/ "zynq-7000.dtsi" 16 | 17 | / { 18 | model = "Zynq ZC706 Development Board"; 19 | compatible = "xlnx,zynq-zc706", "xlnx,zynq-7000"; 20 | 21 | aliases { 22 | ethernet0 = &gem0; 23 | i2c0 = &i2c0; 24 | serial0 = &uart1; 25 | spi0 = &qspi; 26 | }; 27 | 28 | memory { 29 | device_type = "memory"; 30 | reg = <0x0 0x40000000>; 31 | }; 32 | 33 | chosen { 34 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 35 | linux,stdout-path = "/amba/serial@e0001000"; 36 | }; 37 | }; 38 | 39 | &qspi { 40 | status = "okay"; 41 | is-dual = <1>; 42 | num-cs = <1>; 43 | flash@0 { 44 | compatible = "n25q128a11"; 45 | reg = <0x0>; 46 | spi-tx-bus-width = <1>; 47 | spi-rx-bus-width = <4>; 48 | spi-max-frequency = <50000000>; 49 | #address-cells = <1>; 50 | #size-cells = <1>; 51 | partition@qspi-fsbl-uboot { 52 | label = "qspi-fsbl-uboot"; 53 | reg = <0x0 0x100000>; 54 | }; 55 | partition@qspi-linux { 56 | label = "qspi-linux"; 57 | reg = <0x100000 0x500000>; 58 | }; 59 | partition@qspi-device-tree { 60 | label = "qspi-device-tree"; 61 | reg = <0x600000 0x20000>; 62 | }; 63 | partition@qspi-rootfs { 64 | label = "qspi-rootfs"; 65 | reg = <0x620000 0x5E0000>; 66 | }; 67 | partition@qspi-bitstream { 68 | label = "qspi-bitstream"; 69 | reg = <0xC00000 0x400000>; 70 | }; 71 | }; 72 | }; 73 | 74 | &usb0 { 75 | status = "okay"; 76 | dr_mode = "host"; 77 | phy_type = "ulpi"; 78 | usb-reset = <&gpio0 7 0>; 79 | }; 80 | 81 | &gem0 { 82 | status = "okay"; 83 | phy-mode = "rgmii-id"; 84 | phy-handle = <&phy0>; 85 | 86 | phy0: phy@7 { 87 | reg = <7>; 88 | }; 89 | }; 90 | 91 | &i2c0 { 92 | status = "okay"; 93 | clock-frequency = <400000>; 94 | }; 95 | 96 | &sdhci0 { 97 | status = "okay"; 98 | }; 99 | 100 | &uart1 { 101 | status = "okay"; 102 | }; 103 | -------------------------------------------------------------------------------- /dts/zynq-zedboard.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 - 2014 Xilinx 3 | * Copyright (C) 2012 National Instruments Corp. 4 | * 5 | * This software is licensed under the terms of the GNU General Public 6 | * License version 2, as published by the Free Software Foundation, and 7 | * may be copied, distributed, and modified under those terms. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | */ 14 | /dts-v1/; 15 | /include/ "zynq-7000.dtsi" 16 | 17 | / { 18 | model = "Zynq Zed Development Board"; 19 | compatible = "xlnx,zynq-zed", "xlnx,zynq-7000"; 20 | 21 | aliases { 22 | ethernet0 = &gem0; 23 | serial0 = &uart1; 24 | spi0 = &qspi; 25 | }; 26 | 27 | memory { 28 | device_type = "memory"; 29 | reg = <0x0 0x20000000>; 30 | }; 31 | 32 | chosen { 33 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 34 | linux,stdout-path = "/amba/serial@e0001000"; 35 | }; 36 | }; 37 | 38 | &qspi { 39 | status = "okay"; 40 | is-dual = <0>; 41 | num-cs = <1>; 42 | flash@0 { 43 | compatible = "n25q128a11"; 44 | reg = <0x0>; 45 | spi-tx-bus-width = <1>; 46 | spi-rx-bus-width = <4>; 47 | spi-max-frequency = <50000000>; 48 | #address-cells = <1>; 49 | #size-cells = <1>; 50 | partition@qspi-fsbl-uboot { 51 | label = "qspi-fsbl-uboot"; 52 | reg = <0x0 0x100000>; 53 | }; 54 | partition@qspi-linux { 55 | label = "qspi-linux"; 56 | reg = <0x100000 0x500000>; 57 | }; 58 | partition@qspi-device-tree { 59 | label = "qspi-device-tree"; 60 | reg = <0x600000 0x20000>; 61 | }; 62 | partition@qspi-rootfs { 63 | label = "qspi-rootfs"; 64 | reg = <0x620000 0x5E0000>; 65 | }; 66 | partition@qspi-bitstream { 67 | label = "qspi-bitstream"; 68 | reg = <0xC00000 0x400000>; 69 | }; 70 | }; 71 | }; 72 | 73 | &usb0 { 74 | status = "okay"; 75 | dr_mode = "host"; 76 | phy_type = "ulpi"; 77 | }; 78 | 79 | &gem0 { 80 | status = "okay"; 81 | phy-mode = "rgmii-id"; 82 | phy-handle = <&phy0>; 83 | 84 | phy0: phy@0 { 85 | reg = <0>; 86 | }; 87 | }; 88 | 89 | &sdhci0 { 90 | status = "okay"; 91 | }; 92 | 93 | &sdhci1 { 94 | status = "okay"; 95 | }; 96 | 97 | &uart1 { 98 | status = "okay"; 99 | }; 100 | -------------------------------------------------------------------------------- /dts/zynq-zybo.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 - 2014 Xilinx 3 | * Copyright (C) 2012 National Instruments Corp. 4 | * 5 | * This software is licensed under the terms of the GNU General Public 6 | * License version 2, as published by the Free Software Foundation, and 7 | * may be copied, distributed, and modified under those terms. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | */ 14 | /dts-v1/; 15 | /include/ "zynq-7000.dtsi" 16 | 17 | / { 18 | model = "Zynq Zed Development Board"; 19 | compatible = "xlnx,zynq-zed", "xlnx,zynq-7000"; 20 | 21 | aliases { 22 | ethernet0 = &gem0; 23 | serial0 = &uart1; 24 | spi0 = &qspi; 25 | }; 26 | 27 | memory { 28 | device_type = "memory"; 29 | reg = <0x0 0x20000000>; 30 | }; 31 | 32 | chosen { 33 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 34 | linux,stdout-path = "/amba/serial@e0001000"; 35 | }; 36 | }; 37 | 38 | &clkc { 39 | ps-clk-frequency = <50000000>; 40 | }; 41 | 42 | &qspi { 43 | status = "okay"; 44 | is-dual = <0>; 45 | num-cs = <1>; 46 | flash@0 { 47 | compatible = "n25q128a11"; 48 | reg = <0x0>; 49 | spi-tx-bus-width = <1>; 50 | spi-rx-bus-width = <4>; 51 | spi-max-frequency = <50000000>; 52 | #address-cells = <1>; 53 | #size-cells = <1>; 54 | partition@qspi-fsbl-uboot { 55 | label = "qspi-fsbl-uboot"; 56 | reg = <0x0 0x100000>; 57 | }; 58 | partition@qspi-linux { 59 | label = "qspi-linux"; 60 | reg = <0x100000 0x500000>; 61 | }; 62 | partition@qspi-device-tree { 63 | label = "qspi-device-tree"; 64 | reg = <0x600000 0x20000>; 65 | }; 66 | partition@qspi-rootfs { 67 | label = "qspi-rootfs"; 68 | reg = <0x620000 0x5E0000>; 69 | }; 70 | partition@qspi-bitstream { 71 | label = "qspi-bitstream"; 72 | reg = <0xC00000 0x400000>; 73 | }; 74 | }; 75 | }; 76 | 77 | &usb0 { 78 | status = "okay"; 79 | dr_mode = "host"; 80 | phy_type = "ulpi"; 81 | }; 82 | 83 | &gem0 { 84 | status = "okay"; 85 | phy-mode = "rgmii-id"; 86 | phy-handle = <&phy0>; 87 | 88 | phy0: phy@0 { 89 | reg = <0>; 90 | }; 91 | }; 92 | 93 | &sdhci0 { 94 | status = "okay"; 95 | }; 96 | 97 | &uart1 { 98 | status = "okay"; 99 | }; 100 | -------------------------------------------------------------------------------- /dumpbootbin.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Quanta Research Cambridge, Inc. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a 4 | * copy of this software and associated documentation files (the "Software"), 5 | * to deal in the Software without restriction, including without limitation 6 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | * and/or sell copies of the Software, and to permit persons to whom the 8 | * Software is furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included 11 | * in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 14 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | * DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "bootdef.h" 27 | 28 | #define DUMP_SIZE 64 29 | static int fd, end_of_file = 0; 30 | static unsigned char buffer[DUMP_SIZE]; 31 | 32 | static void memdump(unsigned char *p, int len, char *title) 33 | { 34 | int i; 35 | 36 | i = 0; 37 | while (len > 0) { 38 | if (!(i & 0xf)) { 39 | if (i > 0) 40 | printf("\n"); 41 | printf("%s: ",title); 42 | } 43 | printf("%02x ", *p++); 44 | i++; 45 | len--; 46 | } 47 | printf("\n"); 48 | } 49 | 50 | int main(int argc, char *argv[]) 51 | { 52 | BootPartitionHeader part_data[20], *ppart = part_data; 53 | int verbose = 1; 54 | int file_counter = 0, dumpfd = -1; 55 | 56 | if (argc != 2 || (fd = open (argv[1], O_RDONLY)) < 0) { 57 | printf ("xbootbin \n"); 58 | exit(-1); 59 | } 60 | lseek(fd, IMAGE_PHDR_OFFSET, SEEK_SET); 61 | uint32_t part_offset; 62 | read(fd, &part_offset, sizeof(part_offset)); 63 | lseek(fd, part_offset, SEEK_SET); 64 | while (!end_of_file) { 65 | read(fd, ppart, sizeof(*ppart)); 66 | if (ppart->CheckSum == 0xffffffff) 67 | break; 68 | ppart++; 69 | } 70 | int pindex = 0; 71 | while (&part_data[pindex] != ppart) { 72 | printf(" ImageWordLen: %8d; ", part_data[pindex].ImageWordLen << 2); 73 | printf("DataWordLen: %8d; ", part_data[pindex].DataWordLen << 2); 74 | printf("PartitionWordLen: %8d\n", part_data[pindex].PartitionWordLen << 2); 75 | printf(" ImageWordLen: %8x; ", part_data[pindex].ImageWordLen << 2); 76 | printf("DataWordLen: %8x; ", part_data[pindex].DataWordLen << 2); 77 | printf("PartitionWordLen: %8x\n", part_data[pindex].PartitionWordLen << 2); 78 | printf(" LoadAddr: %8x; ", part_data[pindex].LoadAddr); 79 | printf("ExecAddr: %8x; ", part_data[pindex].ExecAddr); 80 | printf("PartitionStart: %8x\n", part_data[pindex].PartitionStart << 2); 81 | printf(" PartitionAttr: %3x; ", part_data[pindex].PartitionAttr); 82 | printf("SectionCount: %7x\n", part_data[pindex].SectionCount); 83 | lseek(fd, part_data[pindex].PartitionStart << 2, SEEK_SET); 84 | int len = part_data[pindex].DataWordLen << 2; 85 | int first = 1; 86 | if (verbose) { 87 | char filename[100]; 88 | sprintf(filename, "xxdump%d.dump", file_counter++); 89 | dumpfd = creat(filename, 0666); 90 | printf("dumpfile: %s\n", filename); 91 | } 92 | while (len > 0) { 93 | int rlen = len; 94 | if (rlen > sizeof(buffer)) 95 | rlen = sizeof(buffer); 96 | rlen = read(fd, buffer, rlen); 97 | if (first) 98 | memdump(buffer, rlen, "DATA"); 99 | first = 0; 100 | len -= rlen; 101 | if (verbose) 102 | write(dumpfd, buffer, rlen); 103 | } 104 | if (verbose) 105 | close(dumpfd); 106 | pindex++; 107 | } 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /elfdef.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 Quanta Research Cambridge, Inc. 2 | 3 | // Permission is hereby granted, free of charge, to any person 4 | // obtaining a copy of this software and associated documentation 5 | // files (the "Software"), to deal in the Software without 6 | // restriction, including without limitation the rights to use, copy, 7 | // modify, merge, publish, distribute, sublicense, and/or sell copies 8 | // of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | 11 | // The above copyright notice and this permission notice shall be 12 | // included in all copies or substantial portions of the Software. 13 | 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 18 | // BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 | // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | typedef uint32_t Elf32_Addr; 24 | typedef uint16_t Elf32_Half; 25 | typedef uint32_t Elf32_Off; 26 | typedef int32_t Elf32_Sword; 27 | typedef uint32_t Elf32_Word; 28 | 29 | typedef uint64_t Elf64_Addr; 30 | typedef uint16_t Elf64_Half; 31 | typedef uint64_t Elf64_Off; 32 | typedef int32_t Elf64_Sword; 33 | typedef uint32_t Elf64_Word; 34 | typedef int64_t Elf64_Sxword; 35 | typedef uint64_t Elf64_Xword; 36 | 37 | /************ elf header structures ****************/ 38 | typedef struct { 39 | unsigned char e_ident[16]; 40 | #define ELFCLASS32 1 41 | #define ELFCLASS64 2 42 | Elf32_Half e_type; 43 | #define ET_EXEC 2 44 | Elf32_Half e_machine; 45 | Elf32_Word e_version; 46 | Elf32_Addr e_entry; 47 | Elf32_Off e_phoff; 48 | Elf32_Off e_shoff; 49 | Elf32_Word e_flags; 50 | Elf32_Half e_ehsize; 51 | Elf32_Half e_phentsize; 52 | Elf32_Half e_phnum; 53 | Elf32_Half e_shentsize; 54 | Elf32_Half e_shnum; 55 | Elf32_Half e_shstrndx; 56 | } elf_header32; 57 | typedef struct { 58 | unsigned char e_ident[16]; 59 | Elf64_Half e_type; 60 | Elf64_Half e_machine; 61 | Elf64_Word e_version; 62 | Elf64_Addr e_entry; 63 | Elf64_Off e_phoff; 64 | Elf64_Off e_shoff; 65 | Elf64_Word e_flags; 66 | Elf64_Half e_ehsize; 67 | Elf64_Half e_phentsize; 68 | Elf64_Half e_phnum; 69 | Elf64_Half e_shentsize; 70 | Elf64_Half e_shnum; 71 | Elf64_Half e_shstrndx; 72 | } elf_header64; 73 | 74 | typedef struct { 75 | Elf32_Word sh_name; 76 | Elf32_Word sh_type; 77 | Elf32_Word sh_flags; 78 | #define SHF_STRINGS 0x20 79 | Elf32_Addr sh_addr; 80 | Elf32_Off sh_offset; 81 | Elf32_Word sh_size; 82 | Elf32_Word sh_link; 83 | Elf32_Word sh_info; 84 | Elf32_Word sh_addralign; 85 | Elf32_Word sh_entsize; 86 | } Elf32_Shdr; 87 | 88 | typedef struct { 89 | Elf64_Word sh_name; 90 | Elf64_Word sh_type; 91 | Elf64_Xword sh_flags; 92 | Elf64_Addr sh_addr; 93 | Elf64_Off sh_offset; 94 | Elf64_Xword sh_size; 95 | Elf64_Word sh_link; 96 | Elf64_Word sh_info; 97 | Elf64_Xword sh_addralign; 98 | Elf64_Xword sh_entsize; 99 | } Elf64_Shdr; 100 | 101 | typedef union { 102 | elf_header32 h32; 103 | elf_header64 h64; 104 | } ELF_HEADER; 105 | 106 | typedef union { 107 | Elf32_Shdr s32[1]; 108 | Elf64_Shdr s64[1]; 109 | } ELF_SECTION; 110 | 111 | enum{PT_NULL, PT_LOAD, PT_DYNAMIC, PT_INTERP, PT_NOTE, PT_SHLIB, PT_PHDR}; 112 | 113 | typedef struct { 114 | Elf32_Word p_type; 115 | Elf32_Off p_offset; 116 | Elf32_Addr p_vaddr; 117 | Elf32_Addr p_paddr; 118 | Elf32_Word p_filesz; 119 | Elf32_Word p_memsz; 120 | Elf32_Word p_flags; 121 | Elf32_Word p_align; 122 | } Elf32_Phdr; 123 | 124 | typedef struct { 125 | Elf64_Word p_type; 126 | Elf64_Word p_flags; 127 | Elf64_Off p_offset; 128 | Elf64_Addr p_vaddr; 129 | Elf64_Addr p_paddr; 130 | Elf64_Xword p_filesz; 131 | Elf64_Xword p_memsz; 132 | Elf64_Xword p_align; 133 | } Elf64_Phdr; 134 | 135 | typedef union { 136 | Elf32_Phdr p32[1]; 137 | Elf64_Phdr p64[1]; 138 | } ELF_PROGRAM; 139 | 140 | #define ELF_MAGIC 0x7f, 'E', 'L', 'F' 141 | -------------------------------------------------------------------------------- /imagefiles/filesystems.md5sum: -------------------------------------------------------------------------------- 1 | 00205b921514efabd3355b5cf571b82f system.img 2 | -------------------------------------------------------------------------------- /imagefiles/portalmem.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/portalmem.ko -------------------------------------------------------------------------------- /imagefiles/timelimit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/timelimit -------------------------------------------------------------------------------- /imagefiles/webserver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/webserver -------------------------------------------------------------------------------- /imagefiles/zImage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/zImage -------------------------------------------------------------------------------- /imagefiles/zynq-miniitx100-portal.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = <1>; 5 | #size-cells = <1>; 6 | model = "Xilinx Zynq"; 7 | compatible = "xlnx,zynq-7000"; 8 | zynqbootboard = "miniitx100"; 9 | 10 | memory@0 { 11 | device_type = "memory"; 12 | reg = <0x00000000 0x40000000>; 13 | } ; 14 | chosen { 15 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 16 | linux,stdout-path = "/amba@0/uart@e0001000"; 17 | }; 18 | 19 | pmu { 20 | compatible = "arm,cortex-a9-pmu"; 21 | interrupts = < 0 5 4 0 6 4 >; 22 | interrupt-parent = <&gic>; 23 | reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >; 24 | } ; 25 | 26 | amba@0 { 27 | compatible = "xlnx,ps7-axi-interconnect-1.00.a", "simple-bus"; 28 | #address-cells = <1>; 29 | #size-cells = <1>; 30 | ranges ; 31 | 32 | gic: intc@f8f01000 { 33 | interrupt-controller ; 34 | compatible = "xlnx,ps7-scugic-1.00.a", "arm,cortex-a9-gic", "arm,gic"; 35 | #interrupt-cells = < 3 >; 36 | reg = < 0xf8f01000 0x1000 0xf8f00100 0x100 >; 37 | linux,phandle = < 0x1 >; 38 | phandle = < 0x1 >; 39 | } ; 40 | 41 | pl310@f8f02000 { 42 | compatible = "xlnx,ps7-pl310-1.00.a", "arm,pl310-cache"; 43 | cache-unified ; 44 | cache-level = < 2 >; 45 | reg = < 0xf8f02000 0x1000 >; 46 | interrupts = < 0 2 4 >; 47 | interrupt-parent = <&gic>; 48 | arm,data-latency = < 3 2 2 >; 49 | arm,tag-latency = < 2 2 2 >; 50 | } ; 51 | 52 | ps7_ddrc_0: ps7-ddrc@f8006000 { 53 | compatible = "xlnx,ps7-ddrc-1.00.a", "xlnx,ps7-ddrc"; 54 | reg = < 0xf8006000 0x1000 >; 55 | xlnx,has-ecc = <0x0>; 56 | } ; 57 | 58 | ps7_ram_0: ps7-ram@0 { 59 | compatible = "xlnx,ps7-ram-1.00.a", "xlnx,ps7-ocm"; 60 | reg = < 0xfffc0000 0x40000 >; 61 | } ; 62 | 63 | uart@e0001000 { 64 | compatible = "xlnx,ps7-uart-1.00.a", "xlnx,xuartps"; 65 | reg = < 0xe0001000 0x1000 >; 66 | interrupts = < 0 50 4 >; 67 | interrupt-parent = <&gic>; 68 | current-speed = <115200>; 69 | device_type = "serial"; 70 | port-number = <0>; 71 | xlnx,has-modem = <0x0>; 72 | xlnx,uart-clk-freq-hz = <0x2faf080>; 73 | } ; 74 | 75 | slcr: slcr@f8000000 { 76 | compatible = "xlnx,ps7-slcr-1.00.a", "xlnx,zynq-slcr"; 77 | reg = < 0xf8000000 0x1000 >; 78 | clocks { 79 | #address-cells = <1>; 80 | #size-cells = <0>; 81 | armpll: armpll { 82 | #clock-cells = <0>; 83 | clock-output-names = "armpll"; 84 | clocks = <&ps_clk>; 85 | compatible = "xlnx,zynq-pll"; 86 | lockbit = <0>; 87 | reg = < 0x100 0x110 0x10c >; 88 | } ; 89 | ddrpll: ddrpll { 90 | #clock-cells = <0>; 91 | clock-output-names = "ddrpll"; 92 | clocks = <&ps_clk>; 93 | compatible = "xlnx,zynq-pll"; 94 | lockbit = <1>; 95 | reg = < 0x104 0x114 0x10c >; 96 | } ; 97 | iopll: iopll { 98 | #clock-cells = <0>; 99 | clock-output-names = "iopll"; 100 | clocks = <&ps_clk>; 101 | compatible = "xlnx,zynq-pll"; 102 | lockbit = <2>; 103 | reg = < 0x108 0x118 0x10c >; 104 | } ; 105 | ps_clk: ps_clk { 106 | #clock-cells = <0>; 107 | clock-frequency = <33333333>; 108 | clock-output-names = "ps_clk"; 109 | compatible = "fixed-clock"; 110 | } ; 111 | } ; 112 | } ; 113 | 114 | timer@f8001000 { 115 | compatible = "xlnx,ps7-ttc-1.00.a"; 116 | reg = < 0xf8001000 0x1000 >; 117 | interrupts = < 0 10 4 0 11 4 0 12 4 >; 118 | interrupt-parent = <&gic>; 119 | } ; 120 | 121 | timer@f8f00600 { 122 | compatible = "xlnx,ps7-scutimer-1.00.a", "arm,cortex-a9-twd-timer"; 123 | reg = < 0xf8f00600 0x20 >; 124 | interrupts = < 1 13 769 >; 125 | interrupt-parent = <&gic>; 126 | } ; 127 | 128 | swdt@f8005000 { 129 | device_type = "watchdog"; 130 | compatible = "xlnx,ps7-wdt-1.00.a"; 131 | reg = < 0xf8005000 0x1000 >; 132 | xlnx,wdt-clk-freq-hz = <0x69f6bcb>; 133 | interrupts = < 0 9 1 >; 134 | interrupt-parent = <&gic>; 135 | reset = <0>; 136 | timeout = <10>; 137 | } ; 138 | 139 | scuwdt@f8f00620 { 140 | device_type = "watchdog"; 141 | compatible = "xlnx,ps7-scuwdt-1.00.a"; 142 | reg = < 0xf8f00620 0xe0 >; 143 | interrupt-parent = <&gic>; 144 | interrupts = < 1 14 769 >; 145 | } ; 146 | 147 | eth@e000b000 { 148 | compatible = "xlnx,ps7-ethernet-1.00.a"; 149 | reg = < 0xe000b000 0x1000 >; 150 | interrupts = < 0 22 1 >; 151 | interrupt-parent = <&gic>; 152 | phy-handle = <&phy0>; 153 | phy-mode = "rgmii-id"; 154 | xlnx,ptp-enet-clock = <111111115>; 155 | xlnx,enet-slcr-1000mbps-div0 = <0x8>; 156 | xlnx,enet-slcr-1000mbps-div1 = <0x1>; 157 | xlnx,enet-slcr-100mbps-div0 = <0x8>; 158 | xlnx,enet-slcr-100mbps-div1 = <0x5>; 159 | xlnx,enet-slcr-10mbps-div0 = <0x8>; 160 | xlnx,enet-slcr-10mbps-div1 = <0x32>; 161 | xlnx,enet-clk-freq-hz = <0x7735940>; 162 | xlnx,enet-reset = "MIO 47"; 163 | xlnx,eth-mode = <0x1>; 164 | xlnx,has-mdio = <0x1>; 165 | local-mac-address-marker-string = "THE NEXT FIELD IS THE LOCAL MAC ADDRESS FOR UPDATE"; 166 | local-mac-address = [ 00 E0 0C 00 73 03 ]; 167 | mdio { 168 | #address-cells = <1>; 169 | #size-cells = <0>; 170 | phy0: phy@0 { 171 | compatible = "marvell,88e1518"; 172 | device_type = "ethernet-phy"; 173 | marvell,reg-init=<3 16 0xff00 0x1e 3 17 0xfff0 0x0a>; 174 | reg = <0>; 175 | } ; 176 | } ; 177 | } ; 178 | 179 | i2c0: i2c@e0004000 { 180 | compatible = "xlnx,ps7-i2c-1.00.a"; 181 | reg = < 0xe0004000 0x1000 >; 182 | interrupts = < 0 25 4 >; 183 | interrupt-parent = <&gic>; 184 | bus-id = <0>; 185 | input-clk = <111111114>; 186 | i2c-clk = <400000>; 187 | xlnx,has-interrupt = <0x0>; 188 | xlnx,i2c-clk-freq-hz = <0x69f6bcb>; 189 | xlnx,i2c-reset = "MIO 46"; 190 | } ; 191 | 192 | sdhci@e0100000 { 193 | compatible = "xlnx,ps7-sdio-1.00.a", "generic-sdhci"; 194 | reg = < 0xe0100000 0x1000 >; 195 | xlnx,has-cd = <0x1>; 196 | interrupts = < 0 24 4 >; 197 | interrupt-parent = <&gic>; 198 | clock-frequency = <50000000>; 199 | xlnx,has-power = <0x0>; 200 | xlnx,has-wp = <0x0>; 201 | xlnx,sdio-clk-freq-hz = <0x2faf080>; 202 | } ; 203 | 204 | usb@e0002000 { 205 | compatible = "xlnx,ps7-usb-1.00.a"; 206 | reg = < 0xe0002000 0x1000 >; 207 | interrupts = < 0 21 4 >; 208 | interrupt-parent = <&gic>; 209 | dr_mode = "host"; 210 | phy_type = "ulpi"; 211 | xlnx,usb-reset = "MIO 7"; 212 | } ; 213 | 214 | gpio@e000a000 { 215 | compatible = "xlnx,ps7-gpio-1.00.a"; 216 | reg = < 0xe000a000 0x1000 >; 217 | interrupts = < 0 20 4 >; 218 | interrupt-parent = <&gic>; 219 | #gpio-cells = <2>; 220 | emio-gpio-width = <3>; 221 | gpio-controller ; 222 | gpio-mask-high = <0x0>; 223 | gpio-mask-low = <0x5600>; 224 | } ; 225 | 226 | qspi0: spi@e000d000 { 227 | compatible = "xlnx,ps7-qspi-1.00.a"; 228 | reg = < 0xe000d000 0x1000 >; 229 | interrupts = < 0 19 4 >; 230 | interrupt-parent = <&gic>; 231 | speed-hz = <190476196>; 232 | bus-num = <0>; 233 | num-chip-select = <1>; 234 | is-dual = <0>; 235 | xlnx,fb-clk = <0x1>; 236 | xlnx,qspi-clk-freq-hz = <0xb5a6fa4>; 237 | xlnx,qspi-mode = <0x1>; 238 | } ; 239 | 240 | devcfg@f8007000 { 241 | compatible = "xlnx,ps7-dev-cfg-1.00.a"; 242 | reg = < 0xf8007000 0x1000 >; 243 | interrupts = < 0 8 4 >; 244 | interrupt-parent = <&gic>; 245 | } ; 246 | xadc@f8007100 { 247 | compatible = "xlnx,ps7-xadc-1.00.a"; 248 | reg = < 0xf8007100 0x20 >; 249 | interrupts = < 0 7 4 >; 250 | interrupt-parent = <&gic>; 251 | } ; 252 | ps7_dma_s: ps7-dma@f8003000 { 253 | #dma-cells = <1>; 254 | #dma-channels = <8>; 255 | #dma-requests = <4>; 256 | arm,primecell-periphid = <0x41330>; 257 | compatible = "xlnx,ps7-dma-1.00.a", "arm,primecell", "arm,pl330"; 258 | interrupt-parent = <&gic>; 259 | interrupts = < 0 13 4 0 14 4 0 15 4 0 16 4 0 17 4 0 40 4 0 41 4 0 42 4 0 43 4 >; 260 | reg = < 0xf8003000 0x1000 >; 261 | } ; 262 | /* assigned interrupt number corresponds to actual SPI - 32 */ 263 | connectal@0x6e400000 { 264 | compatible = "linux,portal-0.01.a"; 265 | interrupts = <0 29 4>; 266 | interrupt-parent = <&gic>; 267 | reg = <0x6e400000 0x10000>; 268 | device-name = "connectal"; 269 | }; 270 | 271 | axi_gpio_0: gpio@41200000 { 272 | #gpio-cells = <2>; 273 | compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a"; 274 | gpio-controller ; 275 | interrupt-parent = <&gic>; 276 | interrupts = < 0 59 4 >; 277 | reg = < 0x41200000 0x10000 >; 278 | xlnx,all-inputs = <0x0>; 279 | xlnx,all-inputs-2 = <0x1>; 280 | xlnx,all-outputs = <0x1>; 281 | xlnx,all-outputs-2 = <0x0>; 282 | xlnx,component-name = "design_1_axi_gpio_1_2"; 283 | xlnx,dout-default = <0x0>; 284 | xlnx,dout-default-2 = <0x0>; 285 | xlnx,edk-iptype = "PERIPHERAL"; 286 | xlnx,family = "zynq"; 287 | xlnx,gpio-board-interface = "Custom"; 288 | xlnx,gpio-width = <0x20>; 289 | xlnx,gpio2-board-interface = "Custom"; 290 | xlnx,gpio2-width = <0x3>; 291 | xlnx,interrupt-present = <0x1>; 292 | xlnx,is-dual = <0x1>; 293 | xlnx,tri-default = <0xffffffff>; 294 | xlnx,tri-default-2 = <0xffffffff>; 295 | xlnx,use-board-flow = "false"; 296 | } ; 297 | 298 | ps7_afi_0: ps7-afi@f8008000 { 299 | compatible = "xlnx,ps7-afi-1.00.a"; 300 | reg = < 0xf8008000 0x1000 >; 301 | } ; 302 | ps7_afi_1: ps7-afi@f8009000 { 303 | compatible = "xlnx,ps7-afi-1.00.a"; 304 | reg = < 0xf8009000 0x1000 >; 305 | } ; 306 | ps7_afi_2: ps7-afi@f800a000 { 307 | compatible = "xlnx,ps7-afi-1.00.a"; 308 | reg = < 0xf800a000 0x1000 >; 309 | } ; 310 | ps7_afi_3: ps7-afi@f800b000 { 311 | compatible = "xlnx,ps7-afi-1.00.a"; 312 | reg = < 0xf800b000 0x1000 >; 313 | } ; 314 | ps7_iop_bus_config_0: ps7-iop-bus-config@e0200000 { 315 | compatible = "xlnx,ps7-iop-bus-config-1.00.a"; 316 | reg = < 0xe0200000 0x1000 >; 317 | } ; 318 | ps7_pjtag_0: ps7-pjtag@0 { 319 | compatible = "xlnx,ps7-pjtag-1.00.a"; 320 | } ; 321 | ps7_qspi_linear_0: ps7-qspi-linear@fc000000 { 322 | compatible = "xlnx,ps7-qspi-linear-1.00.a"; 323 | reg = < 0xfc000000 0x2000000 >; 324 | } ; 325 | led-brightness@412000000 { 326 | compatible = "avnet,led-brightness"; 327 | reg = <0x41200000 0x20>; 328 | }; 329 | } ; 330 | cpus { 331 | #address-cells = <1>; 332 | #cpus = <0x2>; 333 | #size-cells = <0>; 334 | ps7_cortexa9_0: cpu@0 { 335 | compatible = "xlnx,ps7-cortexa9-5.2"; 336 | d-cache-line-size = <0x20>; 337 | d-cache-size = <0x8000>; 338 | device_type = "cpu"; 339 | i-cache-line-size = <0x20>; 340 | i-cache-size = <0x8000>; 341 | model = "ps7_cortexa9,5.2"; 342 | reg = <0>; 343 | xlnx,cpu-1x-clk-freq-hz = <0x69f6bcb>; 344 | xlnx,cpu-clk-freq-hz = <0x27bc86bf>; 345 | } ; 346 | ps7_cortexa9_1: cpu@1 { 347 | compatible = "xlnx,ps7-cortexa9-5.2"; 348 | d-cache-line-size = <0x20>; 349 | d-cache-size = <0x8000>; 350 | device_type = "cpu"; 351 | i-cache-line-size = <0x20>; 352 | i-cache-size = <0x8000>; 353 | model = "ps7_cortexa9,5.2"; 354 | reg = <1>; 355 | xlnx,cpu-1x-clk-freq-hz = <0x69f6bcb>; 356 | xlnx,cpu-clk-freq-hz = <0x27bc86bf>; 357 | } ; 358 | } ; 359 | } ; 360 | -------------------------------------------------------------------------------- /imagefiles/zynq-zc702-portal.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | model = "Xilinx Zynq ZC702"; 5 | compatible = "xlnx,zynq-7000"; 6 | zynqbootboard = "zc702"; 7 | #address-cells = <0x1>; 8 | #size-cells = <0x1>; 9 | interrupt-parent = <0x1>; 10 | 11 | memory { 12 | device_type = "memory"; 13 | reg = <0x00000000 0x40000000>; 14 | }; 15 | chosen { 16 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 17 | linux,stdout-path = "/amba@0/uart@E0001000"; 18 | }; 19 | 20 | soc { 21 | compatible = "xlnx,zynq"; 22 | clock-frequency = <33333333>; 23 | }; 24 | 25 | pmu { 26 | compatible = "arm,cortex-a9-pmu"; 27 | interrupts = <0 5 4>, <0 6 4>; 28 | interrupt-parent = <&gic>; 29 | }; 30 | 31 | amba@0 { 32 | compatible = "simple-bus"; 33 | #address-cells = <0x1>; 34 | #size-cells = <0x1>; 35 | ranges; 36 | 37 | gic: intc@f8f01000 { 38 | interrupt-controller; 39 | compatible = "arm,cortex-a9-gic"; 40 | #interrupt-cells = <3>; 41 | reg = <0xf8f01000 0x1000>, < 0xf8f00100 0x100>; 42 | /*linux,phandle = <0x1>; 43 | phandle = <0x1>; */ 44 | }; 45 | 46 | pl310@f8f02000 { 47 | compatible = "arm,pl310-cache"; 48 | cache-unified; 49 | cache-level = <2>; 50 | reg = <0xf8f02000 0x1000>; 51 | interrupts = <0 34 4>; 52 | arm,data-latency = <3 2 2>; 53 | arm,tag-latency = <2 2 2>; 54 | }; 55 | 56 | ps7_ddrc_0: ps7-ddrc@f8006000 { 57 | compatible = "xlnx,ps7-ddrc-1.00.a", "xlnx,ps7-ddrc"; 58 | reg = <0xf8006000 0x1000>; 59 | xlnx,has-ecc = <0x0>; 60 | } ; 61 | 62 | ps7_ocm_0: ps7-ocm@0xfffc0000 { 63 | compatible = "xlnx,ps7-ocm"; 64 | reg = <0xfffc0000 0x40000>; /* 256k */ 65 | }; 66 | 67 | uart@e0001000 { 68 | compatible = "xlnx,ps7-uart-1.00.a", "xlnx,xuartps"; 69 | reg = <0xe0001000 0x1000>; 70 | interrupts = <0 50 4>; 71 | interrupt-parent = <&gic>; 72 | clock = <50000000>; 73 | }; 74 | 75 | slcr: slcr@f8000000 { 76 | compatible = "xlnx,zynq-slcr"; 77 | reg = <0xF8000000 0x1000>; 78 | clocks { 79 | #address-cells = <1>; 80 | #size-cells = <0>; 81 | armpll: armpll { 82 | #clock-cells = <0>; 83 | clock-output-names = "armpll"; 84 | clocks = <&ps_clk>; 85 | compatible = "xlnx,zynq-pll"; 86 | lockbit = <0>; 87 | reg = < 0x100 0x110 0x10c >; 88 | } ; 89 | ddrpll: ddrpll { 90 | #clock-cells = <0>; 91 | clock-output-names = "ddrpll"; 92 | clocks = <&ps_clk>; 93 | compatible = "xlnx,zynq-pll"; 94 | lockbit = <1>; 95 | reg = < 0x104 0x114 0x10c >; 96 | } ; 97 | iopll: iopll { 98 | #clock-cells = <0>; 99 | clock-output-names = "iopll"; 100 | clocks = <&ps_clk>; 101 | compatible = "xlnx,zynq-pll"; 102 | lockbit = <2>; 103 | reg = < 0x108 0x118 0x10c >; 104 | } ; 105 | ps_clk: ps_clk { 106 | #clock-cells = <0>; 107 | clock-frequency = <33333333>; 108 | clock-output-names = "ps_clk"; 109 | compatible = "fixed-clock"; 110 | } ; 111 | } ; 112 | }; 113 | 114 | timer@0xf8001000 { 115 | compatible = "xlnx,ps7-ttc-1.00.a", "cdns,ttc"; 116 | reg = <0xf8001000 0x1000>; 117 | interrupts = <0 10 4>, <0 11 4>, <0 12 4>; 118 | interrupt-parent = <&gic>; 119 | clock-frequency-timer0 = <111111111>; 120 | clock-frequency-timer1 = <111111111>; 121 | clock-frequency-timer2 = <111111111>; 122 | }; 123 | 124 | timer@f8f00600 { 125 | compatible = "arm,cortex-a9-twd-timer"; 126 | reg = <0xf8f00600 0x20>; 127 | interrupts = <1 13 0x301>; 128 | interrupt-parent = <&gic>; 129 | }; 130 | 131 | swdt@f8005000 { 132 | device_type = "watchdog"; 133 | compatible = "xlnx,ps7-wdt-1.00.a"; 134 | reg = <0xf8005000 0x100>; 135 | clock-frequency = <111111111>; 136 | interrupts = <0 9 4>; 137 | interrupt-parent = <&gic>; 138 | reset = <0>; 139 | timeout = <10>; 140 | }; 141 | 142 | scuwdt@f8f00620 { 143 | device_type = "watchdog"; 144 | compatible = "arm,mpcore_wdt"; 145 | reg = <0xf8f00620 0x20>; 146 | clock-frequency = <333333333>; 147 | reset = <1>; 148 | }; 149 | 150 | eth@e000b000 { 151 | compatible = "xlnx,ps7-ethernet-1.00.a"; 152 | reg = <0xe000b000 0x1000>; 153 | interrupts = <0 22 4>; 154 | interrupt-parent = <&gic>; 155 | phy-handle = <&phy0>; 156 | phy-mode = "rgmii-id"; 157 | xlnx,ptp-enet-clock = <111111111>; 158 | xlnx,slcr-div0-1000Mbps = <8>; 159 | xlnx,slcr-div0-100Mbps = <8>; 160 | xlnx,slcr-div0-10Mbps = <8>; 161 | xlnx,slcr-div1-1000Mbps = <1>; 162 | xlnx,slcr-div1-100Mbps = <5>; 163 | xlnx,slcr-div1-10Mbps = <50>; 164 | #address-cells = <0x1>; 165 | #size-cells = <0x0>; 166 | local-mac-address-marker-string = "THE NEXT FIELD IS THE LOCAL MAC ADDRESS FOR UPDATE"; 167 | local-mac-address = [ 00 E0 0C 00 73 03 ]; 168 | mdio { 169 | #address-cells = <1>; 170 | #size-cells = <0>; 171 | phy0: phy@7 { 172 | compatible = "marvell,88e1116r"; 173 | device_type = "ethernet-phy"; 174 | reg = <7>; 175 | }; 176 | }; 177 | }; 178 | 179 | i2c0: i2c@e0004000 { 180 | compatible = "xlnx,ps7-i2c-1.00.a"; 181 | reg = <0xE0004000 0x1000>; 182 | interrupts = <0 25 4>; 183 | interrupt-parent = <&gic>; 184 | bus-id = <0>; 185 | input-clk = <111111111>; 186 | i2c-clk = <100000>; 187 | 188 | #address-cells = <1>; 189 | #size-cells = <0>; 190 | }; 191 | 192 | i2c1: i2c@e0005000 { 193 | compatible = "xlnx,ps7-i2c-1.00.a"; 194 | reg = <0xE0005000 0x1000>; 195 | interrupts = <0 48 4>; 196 | interrupt-parent = <&gic>; 197 | bus-id = <1>; 198 | input-clk = <133000000>; 199 | i2c-clk = <400000>; 200 | 201 | #address-cells = <1>; 202 | #size-cells = <0>; 203 | }; 204 | 205 | sdhci@e0100000 { 206 | compatible = "xlnx,ps7-sdhci-1.00.a"; 207 | reg = <0xe0100000 0x1000>; 208 | xlnx,has-cd = <0x1>; 209 | interrupts = <0 24 4>; 210 | interrupt-parent = <&gic>; 211 | clock-frequency = <33333000>; 212 | }; 213 | 214 | usb@e0002000 { 215 | compatible = "xlnx,ps7-usb-1.00.a"; 216 | reg = <0xe0002000 0x1000>; 217 | interrupts = <0 21 4>; 218 | interrupt-parent = <&gic>; 219 | dr_mode = "host"; 220 | phy_type = "ulpi"; 221 | }; 222 | 223 | gpio@e000a000 { 224 | compatible = "xlnx,ps7-gpio-1.00.a"; 225 | reg = <0xe000a000 0x1000>; 226 | interrupts = <0 20 4>; 227 | interrupt-parent = <&gic>; 228 | }; 229 | 230 | qspi0: spi@e000d000 { 231 | compatible = "xlnx,ps7-qspi-1.00.a"; 232 | reg = <0xE000D000 0x1000>; 233 | interrupts = <0 19 4>; 234 | interrupt-parent = <&gic>; 235 | speed-hz = <200000000>; 236 | bus-num = <1>; 237 | num-chip-select = <1>; 238 | #address-cells = <1>; 239 | #size-cells = <0>; 240 | is-dual = <0>; 241 | flash@0 { 242 | compatible = "n25q128"; 243 | reg = <0x0>; 244 | spi-max-frequency = <50000000>; 245 | #address-cells = <1>; 246 | #size-cells = <1>; 247 | partition@qspi-fsbl { 248 | label = "qspi-fsbl"; 249 | reg = <0x0 0x80000>; 250 | }; 251 | partition@qspi-u-boot { 252 | label = "qspi-u-boot"; 253 | reg = <0x80000 0x80000>; 254 | }; 255 | partition@qspi-linux { 256 | label = "qspi-linux"; 257 | reg = <0x100000 0x500000>; 258 | }; 259 | partition@qspi-device-tree { 260 | label = "qspi-device-tree"; 261 | reg = <0x600000 0x20000>; 262 | }; 263 | partition@qspi-user { 264 | label = "qspi-user"; 265 | reg = <0x620000 0xE0000>; 266 | }; 267 | partition@qspi-scratch { 268 | label = "qspi-scratch"; 269 | reg = <0x700000 0x100000>; 270 | }; 271 | partition@qspi-rootfs { 272 | label = "qspi-rootfs"; 273 | reg = <0x800000 0x800000>; 274 | }; 275 | }; 276 | }; 277 | 278 | devcfg@f8007000 { 279 | compatible = "xlnx,ps7-dev-cfg-1.00.a"; 280 | reg = <0xf8007000 0x100>; 281 | interrupts = <0 8 4>; 282 | interrupt-parent = <&gic>; 283 | }; 284 | xadc@f8007100 { 285 | compatible = "xlnx,ps7-xadc-1.00.a"; 286 | reg = <0xf8007100 0x20>; 287 | interrupts = <0 7 4>; 288 | interrupt-parent = <&gic>; 289 | }; 290 | ps7_dma_s: ps7-dma@f8003000 { 291 | #dma-cells = <1>; 292 | #dma-channels = <8>; 293 | #dma-requests = <4>; 294 | arm,primecell-periphid = <0x41330>; 295 | compatible = "xlnx,ps7-dma-1.00.a", "arm,primecell", "arm,pl330"; 296 | }; 297 | /* assigned interrupt number corresponds to actual SPI - 32 */ 298 | connectal@0x6e400000 { 299 | compatible = "linux,portal-0.01.a"; 300 | interrupts = <0 29 4>; 301 | interrupt-parent = <&gic>; 302 | reg = <0x6e400000 0x10000>; 303 | device-name = "connectal"; 304 | }; 305 | }; 306 | }; 307 | -------------------------------------------------------------------------------- /imagefiles/zynq-zc706-portal.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | model = "Xilinx Zynq ZC706"; 5 | compatible = "xlnx,zynq-7000"; 6 | zynqbootboard = "zc706"; 7 | #address-cells = <0x1>; 8 | #size-cells = <0x1>; 9 | interrupt-parent = <0x1>; 10 | 11 | memory { 12 | device_type = "memory"; 13 | reg = <0x00000000 0x40000000>; 14 | }; 15 | chosen { 16 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 17 | linux,stdout-path = "/amba@0/uart@E0001000"; 18 | }; 19 | 20 | soc { 21 | compatible = "xlnx,zynq"; 22 | clock-frequency = <33333333>; 23 | }; 24 | 25 | pmu { 26 | compatible = "arm,cortex-a9-pmu"; 27 | interrupts = <0 5 4>, <0 6 4>; 28 | interrupt-parent = <&gic>; 29 | }; 30 | 31 | amba@0 { 32 | compatible = "simple-bus"; 33 | #address-cells = <0x1>; 34 | #size-cells = <0x1>; 35 | ranges; 36 | 37 | gic: intc@f8f01000 { 38 | interrupt-controller; 39 | compatible = "arm,cortex-a9-gic"; 40 | #interrupt-cells = <3>; 41 | reg = <0xf8f01000 0x1000>, < 0xf8f00100 0x100>; 42 | /*linux,phandle = <0x1>; 43 | phandle = <0x1>; */ 44 | }; 45 | 46 | pl310@f8f02000 { 47 | compatible = "arm,pl310-cache"; 48 | cache-unified; 49 | cache-level = <2>; 50 | reg = <0xf8f02000 0x1000>; 51 | interrupts = <0 34 4>; 52 | arm,data-latency = <3 2 2>; 53 | arm,tag-latency = <2 2 2>; 54 | }; 55 | 56 | ps7_ddrc_0: ps7-ddrc@f8006000 { 57 | compatible = "xlnx,ps7-ddrc-1.00.a", "xlnx,ps7-ddrc"; 58 | reg = <0xf8006000 0x1000>; 59 | xlnx,has-ecc = <0x0>; 60 | } ; 61 | 62 | ps7_ocm_0: ps7-ocm@0xfffc0000 { 63 | compatible = "xlnx,ps7-ocm"; 64 | reg = <0xfffc0000 0x40000>; /* 256k */ 65 | }; 66 | 67 | uart@e0001000 { 68 | compatible = "xlnx,ps7-uart-1.00.a", "xlnx,xuartps"; 69 | reg = <0xe0001000 0x1000>; 70 | interrupts = <0 50 4>; 71 | interrupt-parent = <&gic>; 72 | clock = <50000000>; 73 | }; 74 | 75 | slcr: slcr@f8000000 { 76 | compatible = "xlnx,zynq-slcr"; 77 | reg = <0xF8000000 0x1000>; 78 | clocks { 79 | #address-cells = <1>; 80 | #size-cells = <0>; 81 | armpll: armpll { 82 | #clock-cells = <0>; 83 | clock-output-names = "armpll"; 84 | clocks = <&ps_clk>; 85 | compatible = "xlnx,zynq-pll"; 86 | lockbit = <0>; 87 | reg = < 0x100 0x110 0x10c >; 88 | } ; 89 | ddrpll: ddrpll { 90 | #clock-cells = <0>; 91 | clock-output-names = "ddrpll"; 92 | clocks = <&ps_clk>; 93 | compatible = "xlnx,zynq-pll"; 94 | lockbit = <1>; 95 | reg = < 0x104 0x114 0x10c >; 96 | } ; 97 | iopll: iopll { 98 | #clock-cells = <0>; 99 | clock-output-names = "iopll"; 100 | clocks = <&ps_clk>; 101 | compatible = "xlnx,zynq-pll"; 102 | lockbit = <2>; 103 | reg = < 0x108 0x118 0x10c >; 104 | } ; 105 | ps_clk: ps_clk { 106 | #clock-cells = <0>; 107 | clock-frequency = <33333333>; 108 | clock-output-names = "ps_clk"; 109 | compatible = "fixed-clock"; 110 | } ; 111 | } ; 112 | }; 113 | 114 | timer@0xf8001000 { 115 | compatible = "xlnx,ps7-ttc-1.00.a", "cdns,ttc"; 116 | reg = <0xf8001000 0x1000>; 117 | interrupts = <0 10 4>, <0 11 4>, <0 12 4>; 118 | interrupt-parent = <&gic>; 119 | clock-frequency-timer0 = <111111111>; 120 | clock-frequency-timer1 = <111111111>; 121 | clock-frequency-timer2 = <111111111>; 122 | }; 123 | 124 | timer@f8f00600 { 125 | compatible = "arm,cortex-a9-twd-timer"; 126 | reg = <0xf8f00600 0x20>; 127 | interrupts = <1 13 0x301>; 128 | interrupt-parent = <&gic>; 129 | }; 130 | 131 | swdt@f8005000 { 132 | device_type = "watchdog"; 133 | compatible = "xlnx,ps7-wdt-1.00.a"; 134 | reg = <0xf8005000 0x100>; 135 | clock-frequency = <111111111>; 136 | interrupts = <0 9 4>; 137 | interrupt-parent = <&gic>; 138 | reset = <0>; 139 | timeout = <10>; 140 | }; 141 | 142 | scuwdt@f8f00620 { 143 | device_type = "watchdog"; 144 | compatible = "arm,mpcore_wdt"; 145 | reg = <0xf8f00620 0x20>; 146 | clock-frequency = <333333333>; 147 | reset = <1>; 148 | }; 149 | 150 | eth@e000b000 { 151 | compatible = "xlnx,ps7-ethernet-1.00.a"; 152 | reg = <0xe000b000 0x1000>; 153 | interrupts = <0 22 4>; 154 | interrupt-parent = <&gic>; 155 | phy-handle = <&phy0>; 156 | phy-mode = "rgmii-id"; 157 | xlnx,ptp-enet-clock = <111111111>; 158 | xlnx,slcr-div0-1000Mbps = <8>; 159 | xlnx,slcr-div0-100Mbps = <8>; 160 | xlnx,slcr-div0-10Mbps = <8>; 161 | xlnx,slcr-div1-1000Mbps = <1>; 162 | xlnx,slcr-div1-100Mbps = <5>; 163 | xlnx,slcr-div1-10Mbps = <50>; 164 | #address-cells = <0x1>; 165 | #size-cells = <0x0>; 166 | local-mac-address-marker-string = "THE NEXT FIELD IS THE LOCAL MAC ADDRESS FOR UPDATE"; 167 | local-mac-address = [ 00 E0 0C 00 73 03 ]; 168 | mdio { 169 | #address-cells = <1>; 170 | #size-cells = <0>; 171 | phy0: phy@7 { 172 | compatible = "marvell,88e1116r"; 173 | device_type = "ethernet-phy"; 174 | reg = <7>; 175 | }; 176 | }; 177 | }; 178 | 179 | i2c0: i2c@e0004000 { 180 | compatible = "xlnx,ps7-i2c-1.00.a"; 181 | reg = <0xE0004000 0x1000>; 182 | interrupts = <0 25 4>; 183 | interrupt-parent = <&gic>; 184 | bus-id = <0>; 185 | input-clk = <111111111>; 186 | i2c-clk = <100000>; 187 | 188 | #address-cells = <1>; 189 | #size-cells = <0>; 190 | }; 191 | 192 | i2c1: i2c@e0005000 { 193 | compatible = "xlnx,ps7-i2c-1.00.a"; 194 | reg = <0xE0005000 0x1000>; 195 | interrupts = <0 48 4>; 196 | interrupt-parent = <&gic>; 197 | bus-id = <1>; 198 | input-clk = <133000000>; 199 | i2c-clk = <400000>; 200 | 201 | #address-cells = <1>; 202 | #size-cells = <0>; 203 | }; 204 | 205 | sdhci@e0100000 { 206 | compatible = "xlnx,ps7-sdhci-1.00.a"; 207 | reg = <0xe0100000 0x1000>; 208 | xlnx,has-cd = <0x1>; 209 | interrupts = <0 24 4>; 210 | interrupt-parent = <&gic>; 211 | clock-frequency = <33333000>; 212 | }; 213 | 214 | usb@e0002000 { 215 | compatible = "xlnx,ps7-usb-1.00.a"; 216 | reg = <0xe0002000 0x1000>; 217 | interrupts = <0 21 4>; 218 | interrupt-parent = <&gic>; 219 | dr_mode = "host"; 220 | phy_type = "ulpi"; 221 | }; 222 | 223 | gpio@e000a000 { 224 | compatible = "xlnx,ps7-gpio-1.00.a"; 225 | reg = <0xe000a000 0x1000>; 226 | interrupts = <0 20 4>; 227 | interrupt-parent = <&gic>; 228 | }; 229 | 230 | qspi0: spi@e000d000 { 231 | compatible = "xlnx,ps7-qspi-1.00.a"; 232 | reg = <0xE000D000 0x1000>; 233 | interrupts = <0 19 4>; 234 | interrupt-parent = <&gic>; 235 | speed-hz = <200000000>; 236 | bus-num = <1>; 237 | num-chip-select = <1>; 238 | #address-cells = <1>; 239 | #size-cells = <0>; 240 | is-dual = <0>; 241 | flash@0 { 242 | compatible = "n25q128"; 243 | reg = <0x0>; 244 | spi-max-frequency = <50000000>; 245 | #address-cells = <1>; 246 | #size-cells = <1>; 247 | partition@qspi-fsbl { 248 | label = "qspi-fsbl"; 249 | reg = <0x0 0x80000>; 250 | }; 251 | partition@qspi-u-boot { 252 | label = "qspi-u-boot"; 253 | reg = <0x80000 0x80000>; 254 | }; 255 | partition@qspi-linux { 256 | label = "qspi-linux"; 257 | reg = <0x100000 0x500000>; 258 | }; 259 | partition@qspi-device-tree { 260 | label = "qspi-device-tree"; 261 | reg = <0x600000 0x20000>; 262 | }; 263 | partition@qspi-user { 264 | label = "qspi-user"; 265 | reg = <0x620000 0xE0000>; 266 | }; 267 | partition@qspi-scratch { 268 | label = "qspi-scratch"; 269 | reg = <0x700000 0x100000>; 270 | }; 271 | partition@qspi-rootfs { 272 | label = "qspi-rootfs"; 273 | reg = <0x800000 0x800000>; 274 | }; 275 | }; 276 | }; 277 | 278 | devcfg@f8007000 { 279 | compatible = "xlnx,ps7-dev-cfg-1.00.a"; 280 | reg = <0xf8007000 0x100>; 281 | interrupts = <0 8 4>; 282 | interrupt-parent = <&gic>; 283 | }; 284 | xadc@f8007100 { 285 | compatible = "xlnx,ps7-xadc-1.00.a"; 286 | reg = <0xf8007100 0x20>; 287 | interrupts = <0 7 4>; 288 | interrupt-parent = <&gic>; 289 | }; 290 | ps7_dma_s: ps7-dma@f8003000 { 291 | #dma-cells = <1>; 292 | #dma-channels = <8>; 293 | #dma-requests = <4>; 294 | arm,primecell-periphid = <0x41330>; 295 | compatible = "xlnx,ps7-dma-1.00.a", "arm,primecell", "arm,pl330"; 296 | }; 297 | /* assigned interrupt number corresponds to actual SPI - 32 */ 298 | connectal@0x6e400000 { 299 | compatible = "linux,portal-0.01.a"; 300 | interrupts = <0 29 4>; 301 | interrupt-parent = <&gic>; 302 | reg = <0x6e400000 0x10000>; 303 | device-name = "connectal"; 304 | }; 305 | }; 306 | }; 307 | -------------------------------------------------------------------------------- /imagefiles/zynq-zedboard-portal.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | model = "Xilinx Zynq Zedboard"; 5 | compatible = "xlnx,zynq-7000"; 6 | zynqbootboard = "zedboard"; 7 | #address-cells = <0x1>; 8 | #size-cells = <0x1>; 9 | interrupt-parent = <0x1>; 10 | 11 | memory { 12 | device_type = "memory"; 13 | reg = <0x00000000 0x20000000>; 14 | }; 15 | chosen { 16 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 17 | linux,stdout-path = "/amba@0/uart@E0001000"; 18 | }; 19 | 20 | soc { 21 | compatible = "xlnx,zynq"; 22 | clock-frequency = <33333333>; 23 | }; 24 | 25 | pmu { 26 | compatible = "arm,cortex-a9-pmu"; 27 | interrupts = <0 5 4>, <0 6 4>; 28 | interrupt-parent = <&gic>; 29 | }; 30 | 31 | amba@0 { 32 | compatible = "simple-bus"; 33 | #address-cells = <0x1>; 34 | #size-cells = <0x1>; 35 | ranges; 36 | 37 | gic: intc@f8f01000 { 38 | interrupt-controller; 39 | compatible = "arm,cortex-a9-gic"; 40 | #interrupt-cells = <3>; 41 | reg = <0xf8f01000 0x1000>, < 0xf8f00100 0x100>; 42 | /*linux,phandle = <0x1>; 43 | phandle = <0x1>; */ 44 | }; 45 | 46 | pl310@f8f02000 { 47 | compatible = "arm,pl310-cache"; 48 | cache-unified; 49 | cache-level = <2>; 50 | reg = <0xf8f02000 0x1000>; 51 | interrupts = <0 34 4>; 52 | arm,data-latency = <3 2 2>; 53 | arm,tag-latency = <2 2 2>; 54 | }; 55 | 56 | ps7_ddrc_0: ps7-ddrc@f8006000 { 57 | compatible = "xlnx,ps7-ddrc-1.00.a", "xlnx,ps7-ddrc"; 58 | reg = <0xf8006000 0x1000>; 59 | xlnx,has-ecc = <0x0>; 60 | } ; 61 | 62 | ps7_ocm_0: ps7-ocm@0xfffc0000 { 63 | compatible = "xlnx,ps7-ocm"; 64 | reg = <0xfffc0000 0x40000>; /* 256k */ 65 | }; 66 | 67 | uart@e0001000 { 68 | compatible = "xlnx,ps7-uart-1.00.a", "xlnx,xuartps"; 69 | reg = <0xe0001000 0x1000>; 70 | interrupts = <0 50 4>; 71 | interrupt-parent = <&gic>; 72 | clock = <50000000>; 73 | }; 74 | 75 | slcr: slcr@f8000000 { 76 | compatible = "xlnx,zynq-slcr"; 77 | reg = <0xF8000000 0x1000>; 78 | clocks { 79 | #address-cells = <1>; 80 | #size-cells = <0>; 81 | armpll: armpll { 82 | #clock-cells = <0>; 83 | clock-output-names = "armpll"; 84 | clocks = <&ps_clk>; 85 | compatible = "xlnx,zynq-pll"; 86 | lockbit = <0>; 87 | reg = < 0x100 0x110 0x10c >; 88 | } ; 89 | ddrpll: ddrpll { 90 | #clock-cells = <0>; 91 | clock-output-names = "ddrpll"; 92 | clocks = <&ps_clk>; 93 | compatible = "xlnx,zynq-pll"; 94 | lockbit = <1>; 95 | reg = < 0x104 0x114 0x10c >; 96 | } ; 97 | iopll: iopll { 98 | #clock-cells = <0>; 99 | clock-output-names = "iopll"; 100 | clocks = <&ps_clk>; 101 | compatible = "xlnx,zynq-pll"; 102 | lockbit = <2>; 103 | reg = < 0x108 0x118 0x10c >; 104 | } ; 105 | ps_clk: ps_clk { 106 | #clock-cells = <0>; 107 | clock-frequency = <33333333>; 108 | clock-output-names = "ps_clk"; 109 | compatible = "fixed-clock"; 110 | } ; 111 | } ; 112 | }; 113 | 114 | timer@0xf8001000 { 115 | compatible = "xlnx,ps7-ttc-1.00.a", "cdns,ttc"; 116 | reg = <0xf8001000 0x1000>; 117 | interrupts = <0 10 4>, <0 11 4>, <0 12 4>; 118 | interrupt-parent = <&gic>; 119 | clock-frequency-timer0 = <111111111>; 120 | clock-frequency-timer1 = <111111111>; 121 | clock-frequency-timer2 = <111111111>; 122 | }; 123 | 124 | timer@f8f00600 { 125 | compatible = "arm,cortex-a9-twd-timer"; 126 | reg = <0xf8f00600 0x20>; 127 | interrupts = <1 13 0x301>; 128 | interrupt-parent = <&gic>; 129 | }; 130 | 131 | swdt@f8005000 { 132 | device_type = "watchdog"; 133 | compatible = "xlnx,ps7-wdt-1.00.a"; 134 | reg = <0xf8005000 0x100>; 135 | clock-frequency = <111111111>; 136 | interrupts = <0 9 4>; 137 | interrupt-parent = <&gic>; 138 | reset = <0>; 139 | timeout = <10>; 140 | }; 141 | 142 | scuwdt@f8f00620 { 143 | device_type = "watchdog"; 144 | compatible = "arm,mpcore_wdt"; 145 | reg = <0xf8f00620 0x20>; 146 | clock-frequency = <333333333>; 147 | reset = <1>; 148 | }; 149 | 150 | eth@e000b000 { 151 | compatible = "xlnx,ps7-ethernet-1.00.a"; 152 | reg = <0xe000b000 0x1000>; 153 | interrupts = <0 22 4>; 154 | interrupt-parent = <&gic>; 155 | phy-handle = <&phy0>; 156 | phy-mode = "rgmii-id"; 157 | xlnx,ptp-enet-clock = <111111111>; 158 | xlnx,slcr-div0-1000Mbps = <8>; 159 | xlnx,slcr-div0-100Mbps = <8>; 160 | xlnx,slcr-div0-10Mbps = <8>; 161 | xlnx,slcr-div1-1000Mbps = <1>; 162 | xlnx,slcr-div1-100Mbps = <5>; 163 | xlnx,slcr-div1-10Mbps = <50>; 164 | #address-cells = <0x1>; 165 | ksize-cells = <0x0>; 166 | local-mac-address-marker-string = "THE NEXT FIELD IS THE LOCAL MAC ADDRESS FOR UPDATE"; 167 | local-mac-address = [ 00 E0 0C 00 73 03 ]; 168 | mdio { 169 | #address-cells = <1>; 170 | #size-cells = <0>; 171 | phy0: phy@0 { 172 | compatible = "marvell,88e1510"; 173 | device_type = "ethernet-phy"; 174 | marvell,reg-init = <0x03 0x10 0xFF00 0x1E 0x03 0x11 0xFFF0 0x0A>; 175 | reg = <0>; 176 | }; 177 | }; 178 | }; 179 | 180 | i2c0: i2c@e0004000 { 181 | compatible = "xlnx,ps7-i2c-1.00.a"; 182 | reg = <0xE0004000 0x1000>; 183 | interrupts = <0 25 4>; 184 | interrupt-parent = <&gic>; 185 | bus-id = <0>; 186 | input-clk = <133000000>; 187 | i2c-clk = <100000>; 188 | 189 | #address-cells = <1>; 190 | #size-cells = <0>; 191 | }; 192 | 193 | i2c1: i2c@e0005000 { 194 | compatible = "xlnx,ps7-i2c-1.00.a"; 195 | reg = <0xE0005000 0x1000>; 196 | interrupts = <0 48 4>; 197 | interrupt-parent = <&gic>; 198 | bus-id = <1>; 199 | input-clk = <133000000>; 200 | i2c-clk = <100000>; 201 | 202 | #address-cells = <1>; 203 | #size-cells = <0>; 204 | }; 205 | 206 | sdhci@e0100000 { 207 | compatible = "xlnx,ps7-sdhci-1.00.a"; 208 | reg = <0xe0100000 0x1000>; 209 | xlnx,has-cd = <0x1>; 210 | interrupts = <0 24 4>; 211 | interrupt-parent = <&gic>; 212 | clock-frequency = <33333000>; 213 | }; 214 | 215 | usb@e0002000 { 216 | compatible = "xlnx,ps7-usb-1.00.a"; 217 | reg = <0xe0002000 0x1000>; 218 | interrupts = <0 21 4>; 219 | interrupt-parent = <&gic>; 220 | dr_mode = "host"; 221 | phy_type = "ulpi"; 222 | }; 223 | 224 | gpio@e000a000 { 225 | compatible = "xlnx,ps7-gpio-1.00.a"; 226 | reg = <0xe000a000 0x1000>; 227 | interrupts = <0 20 4>; 228 | interrupt-parent = <&gic>; 229 | }; 230 | 231 | qspi0: spi@e000d000 { 232 | compatible = "xlnx,ps7-qspi-1.00.a"; 233 | reg = <0xE000D000 0x1000>; 234 | interrupts = <0 19 4>; 235 | interrupt-parent = <&gic>; 236 | speed-hz = <200000000>; 237 | bus-num = <1>; 238 | num-chip-select = <1>; 239 | #address-cells = <1>; 240 | #size-cells = <0>; 241 | is-dual = <0>; 242 | flash@0 { 243 | compatible = "n25q128"; 244 | reg = <0x0>; 245 | spi-max-frequency = <50000000>; 246 | #address-cells = <1>; 247 | #size-cells = <1>; 248 | partition@qspi-fsbl { 249 | label = "qspi-fsbl"; 250 | reg = <0x0 0x80000>; 251 | }; 252 | partition@qspi-u-boot { 253 | label = "qspi-u-boot"; 254 | reg = <0x80000 0x80000>; 255 | }; 256 | partition@qspi-linux { 257 | label = "qspi-linux"; 258 | reg = <0x100000 0x500000>; 259 | }; 260 | partition@qspi-device-tree { 261 | label = "qspi-device-tree"; 262 | reg = <0x600000 0x20000>; 263 | }; 264 | partition@qspi-user { 265 | label = "qspi-user"; 266 | reg = <0x620000 0xE0000>; 267 | }; 268 | partition@qspi-scratch { 269 | label = "qspi-scratch"; 270 | reg = <0x700000 0x100000>; 271 | }; 272 | partition@qspi-rootfs { 273 | label = "qspi-rootfs"; 274 | reg = <0x800000 0x800000>; 275 | }; 276 | }; 277 | }; 278 | 279 | devcfg@f8007000 { 280 | compatible = "xlnx,ps7-dev-cfg-1.00.a"; 281 | reg = <0xf8007000 0x100>; 282 | interrupts = <0 8 4>; 283 | interrupt-parent = <&gic>; 284 | }; 285 | xadc@f8007100 { 286 | compatible = "xlnx,ps7-xadc-1.00.a"; 287 | reg = <0xf8007100 0x20>; 288 | interrupts = <0 7 4>; 289 | interrupt-parent = <&gic>; 290 | }; 291 | ps7_dma_s: ps7-dma@f8003000 { 292 | #dma-cells = <1>; 293 | #dma-channels = <8>; 294 | #dma-requests = <4>; 295 | arm,primecell-periphid = <0x41330>; 296 | compatible = "xlnx,ps7-dma-1.00.a", "arm,primecell", "arm,pl330"; 297 | }; 298 | /* assigned interrupt number corresponds to actual SPI - 32 */ 299 | connectal@0x6e400000 { 300 | compatible = "linux,portal-0.01.a"; 301 | interrupts = <0 29 4>; 302 | interrupt-parent = <&gic>; 303 | reg = <0x6e400000 0x10000>; 304 | device-name = "connectal"; 305 | }; 306 | connectalsdhci@e0101000 { 307 | compatible = "connectalsdhci"; 308 | reg = <0xe0101000 0x1000>; 309 | xlnx,has-cd = <0x1>; 310 | interrupts = <0 47 4>; 311 | interrupt-parent = <&gic>; 312 | clock-frequency = <16666666>; 313 | high-speed-enable = <0x0>; 314 | }; 315 | connectalspi: connectalspi@e0006000 { 316 | compatible = "connectalspi"; 317 | reg = <0xE0006000 0x1000>; 318 | interrupts = <0 26 0>; 319 | interrupt-parent = <&gic>; 320 | speed-hz = <25000000>; 321 | bus-num = <2>; 322 | num-chip-select = <4>; 323 | spidev@0 { 324 | compatible = "spidev"; 325 | reg = <0x0>; 326 | spi-max-frequency = <25000000>; 327 | #address-cells = <1>; 328 | #size-cells = <1>; 329 | }; 330 | }; 331 | }; 332 | }; 333 | -------------------------------------------------------------------------------- /imagefiles/zynq-zybo-portal.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | model = "Xilinx Zynq Zybo"; 5 | compatible = "xlnx,zynq-7000"; 6 | zynqbootboard = "zybo"; 7 | #address-cells = <0x1>; 8 | #size-cells = <0x1>; 9 | interrupt-parent = <0x1>; 10 | 11 | memory { 12 | device_type = "memory"; 13 | reg = <0x00000000 0x20000000>; 14 | }; 15 | chosen { 16 | bootargs = "console=ttyPS0,115200 initrd=0x00800000,512K noinitrd init=/init root=/dev/ram rw ip=:::::eth0:dhcp earlyprintk"; 17 | linux,stdout-path = "/amba@0/uart@E0001000"; 18 | }; 19 | 20 | soc { 21 | compatible = "xlnx,zynq"; 22 | clock-frequency = <50000000>; 23 | }; 24 | 25 | pmu { 26 | compatible = "arm,cortex-a9-pmu"; 27 | interrupts = <0 5 4>, <0 6 4>; 28 | interrupt-parent = <&gic>; 29 | }; 30 | 31 | amba@0 { 32 | compatible = "simple-bus"; 33 | #address-cells = <0x1>; 34 | #size-cells = <0x1>; 35 | ranges; 36 | 37 | gic: intc@f8f01000 { 38 | interrupt-controller; 39 | compatible = "arm,cortex-a9-gic"; 40 | #interrupt-cells = <3>; 41 | reg = <0xf8f01000 0x1000>, < 0xf8f00100 0x100>; 42 | /*linux,phandle = <0x1>; 43 | phandle = <0x1>; */ 44 | }; 45 | 46 | pl310@f8f02000 { 47 | compatible = "arm,pl310-cache"; 48 | cache-unified; 49 | cache-level = <2>; 50 | reg = <0xf8f02000 0x1000>; 51 | interrupts = <0 34 4>; 52 | arm,data-latency = <3 2 2>; 53 | arm,tag-latency = <2 2 2>; 54 | }; 55 | 56 | ps7_ddrc_0: ps7-ddrc@f8006000 { 57 | compatible = "xlnx,ps7-ddrc-1.00.a", "xlnx,ps7-ddrc"; 58 | reg = <0xf8006000 0x1000>; 59 | xlnx,has-ecc = <0x0>; 60 | } ; 61 | 62 | ps7_ocm_0: ps7-ocm@0xfffc0000 { 63 | compatible = "xlnx,ps7-ocm"; 64 | reg = <0xfffc0000 0x40000>; /* 256k */ 65 | }; 66 | 67 | uart@e0001000 { 68 | compatible = "xlnx,ps7-uart-1.00.a", "xlnx,xuartps"; 69 | reg = <0xe0001000 0x1000>; 70 | interrupts = <0 50 4>; 71 | interrupt-parent = <&gic>; 72 | #clock = <50000000>; 73 | }; 74 | 75 | slcr: slcr@f8000000 { 76 | compatible = "xlnx,zynq-slcr"; 77 | reg = <0xF8000000 0x1000>; 78 | clocks { 79 | #address-cells = <1>; 80 | #size-cells = <0>; 81 | armpll: armpll { 82 | #clock-cells = <0>; 83 | clock-output-names = "armpll"; 84 | clocks = <&ps_clk>; 85 | compatible = "xlnx,zynq-pll"; 86 | lockbit = <0>; 87 | reg = < 0x100 0x110 0x10c >; 88 | } ; 89 | ddrpll: ddrpll { 90 | #clock-cells = <0>; 91 | clock-output-names = "ddrpll"; 92 | clocks = <&ps_clk>; 93 | compatible = "xlnx,zynq-pll"; 94 | lockbit = <1>; 95 | reg = < 0x104 0x114 0x10c >; 96 | } ; 97 | iopll: iopll { 98 | #clock-cells = <0>; 99 | clock-output-names = "iopll"; 100 | clocks = <&ps_clk>; 101 | compatible = "xlnx,zynq-pll"; 102 | lockbit = <2>; 103 | reg = < 0x108 0x118 0x10c >; 104 | } ; 105 | ps_clk: ps_clk { 106 | #clock-cells = <0>; 107 | clock-frequency = <50000000>; 108 | clock-output-names = "ps_clk"; 109 | compatible = "fixed-clock"; 110 | } ; 111 | } ; 112 | }; 113 | 114 | timer@0xf8001000 { 115 | compatible = "xlnx,ps7-ttc-1.00.a", "cdns,ttc"; 116 | reg = <0xf8001000 0x1000>; 117 | interrupts = <0 10 4>, <0 11 4>, <0 12 4>; 118 | interrupt-parent = <&gic>; 119 | clock-frequency-timer0 = <111111111>; 120 | clock-frequency-timer1 = <111111111>; 121 | clock-frequency-timer2 = <111111111>; 122 | }; 123 | 124 | timer@f8f00600 { 125 | compatible = "arm,cortex-a9-twd-timer"; 126 | reg = <0xf8f00600 0x20>; 127 | interrupts = <1 13 0x301>; 128 | interrupt-parent = <&gic>; 129 | }; 130 | 131 | swdt@f8005000 { 132 | device_type = "watchdog"; 133 | compatible = "xlnx,ps7-wdt-1.00.a"; 134 | reg = <0xf8005000 0x100>; 135 | clock-frequency = <111111111>; 136 | interrupts = <0 9 4>; 137 | interrupt-parent = <&gic>; 138 | reset = <0>; 139 | timeout = <10>; 140 | }; 141 | 142 | scuwdt@f8f00620 { 143 | device_type = "watchdog"; 144 | compatible = "arm,mpcore_wdt"; 145 | reg = <0xf8f00620 0x20>; 146 | clock-frequency = <50000000>; 147 | reset = <1>; 148 | }; 149 | 150 | eth@e000b000 { 151 | compatible = "xlnx,ps7-ethernet-1.00.a"; 152 | reg = <0xe000b000 0x1000>; 153 | interrupts = <0 22 4>; 154 | interrupt-parent = <&gic>; 155 | phy-handle = <&phy0>; 156 | phy-mode = "rgmii-id"; 157 | xlnx,ptp-enet-clock = <111111111>; 158 | xlnx,slcr-div0-1000Mbps = <8>; 159 | xlnx,slcr-div0-100Mbps = <8>; 160 | xlnx,slcr-div0-10Mbps = <8>; 161 | xlnx,slcr-div1-1000Mbps = <1>; 162 | xlnx,slcr-div1-100Mbps = <5>; 163 | xlnx,slcr-div1-10Mbps = <50>; 164 | #address-cells = <0x1>; 165 | #size-cells = <0x0>; 166 | local-mac-address-marker-string = "THE NEXT FIELD IS THE LOCAL MAC ADDRESS FOR UPDATE"; 167 | local-mac-address = [ 00 E0 0C 00 73 03 ]; 168 | mdio { 169 | #address-cells = <1>; 170 | #size-cells = <0>; 171 | phy0: phy@0 { 172 | compatible = "marvell,88e1510"; 173 | device_type = "ethernet-phy"; 174 | marvell,reg-init = <0x03 0x10 0xFF00 0x1E 0x03 0x11 0xFFF0 0x0A>; 175 | reg = <0>; 176 | }; 177 | }; 178 | }; 179 | 180 | i2c0: i2c@e0004000 { 181 | compatible = "xlnx,ps7-i2c-1.00.a"; 182 | reg = <0xE0004000 0x1000>; 183 | interrupts = <0 25 4>; 184 | interrupt-parent = <&gic>; 185 | bus-id = <0>; 186 | input-clk = <133000000>; 187 | i2c-clk = <400000>; 188 | 189 | #address-cells = <1>; 190 | #size-cells = <0>; 191 | }; 192 | 193 | i2c1: i2c@e0005000 { 194 | compatible = "xlnx,ps7-i2c-1.00.a"; 195 | reg = <0xE0005000 0x1000>; 196 | interrupts = <0 48 4>; 197 | interrupt-parent = <&gic>; 198 | bus-id = <1>; 199 | input-clk = <133000000>; 200 | i2c-clk = <400000>; 201 | 202 | #address-cells = <1>; 203 | #size-cells = <0>; 204 | }; 205 | 206 | sdhci@e0100000 { 207 | compatible = "xlnx,ps7-sdhci-1.00.a"; 208 | reg = <0xe0100000 0x1000>; 209 | xlnx,has-cd = <0x1>; 210 | interrupts = <0 24 4>; 211 | interrupt-parent = <&gic>; 212 | clock-frequency = <50000000>; 213 | }; 214 | 215 | usb@e0002000 { 216 | compatible = "xlnx,ps7-usb-1.00.a"; 217 | reg = <0xe0002000 0x1000>; 218 | interrupts = <0 21 4>; 219 | interrupt-parent = <&gic>; 220 | dr_mode = "host"; 221 | phy_type = "ulpi"; 222 | }; 223 | 224 | gpio@e000a000 { 225 | compatible = "xlnx,ps7-gpio-1.00.a"; 226 | reg = <0xe000a000 0x1000>; 227 | interrupts = <0 20 4>; 228 | interrupt-parent = <&gic>; 229 | }; 230 | 231 | qspi0: spi@e000d000 { 232 | compatible = "xlnx,ps7-qspi-1.00.a"; 233 | reg = <0xE000D000 0x1000>; 234 | interrupts = <0 19 4>; 235 | interrupt-parent = <&gic>; 236 | speed-hz = <200000000>; 237 | bus-num = <1>; 238 | num-chip-select = <1>; 239 | #address-cells = <1>; 240 | #size-cells = <0>; 241 | is-dual = <0>; 242 | flash@0 { 243 | compatible = "n25q128"; 244 | reg = <0x0>; 245 | spi-max-frequency = <50000000>; 246 | #address-cells = <1>; 247 | #size-cells = <1>; 248 | partition@qspi-fsbl { 249 | label = "qspi-fsbl"; 250 | reg = <0x0 0x80000>; 251 | }; 252 | partition@qspi-u-boot { 253 | label = "qspi-u-boot"; 254 | reg = <0x80000 0x80000>; 255 | }; 256 | partition@qspi-linux { 257 | label = "qspi-linux"; 258 | reg = <0x100000 0x500000>; 259 | }; 260 | partition@qspi-device-tree { 261 | label = "qspi-device-tree"; 262 | reg = <0x600000 0x20000>; 263 | }; 264 | partition@qspi-user { 265 | label = "qspi-user"; 266 | reg = <0x620000 0xE0000>; 267 | }; 268 | partition@qspi-scratch { 269 | label = "qspi-scratch"; 270 | reg = <0x700000 0x100000>; 271 | }; 272 | partition@qspi-rootfs { 273 | label = "qspi-rootfs"; 274 | reg = <0x800000 0x800000>; 275 | }; 276 | }; 277 | }; 278 | 279 | devcfg@f8007000 { 280 | compatible = "xlnx,ps7-dev-cfg-1.00.a"; 281 | reg = <0xf8007000 0x100>; 282 | interrupts = <0 8 4>; 283 | interrupt-parent = <&gic>; 284 | }; 285 | xadc@f8007100 { 286 | compatible = "xlnx,ps7-xadc-1.00.a"; 287 | reg = <0xf8007100 0x20>; 288 | interrupts = <0 7 4>; 289 | interrupt-parent = <&gic>; 290 | }; 291 | ps7_dma_s: ps7-dma@f8003000 { 292 | #dma-cells = <1>; 293 | #dma-channels = <8>; 294 | #dma-requests = <4>; 295 | arm,primecell-periphid = <0x41330>; 296 | compatible = "xlnx,ps7-dma-1.00.a", "arm,primecell", "arm,pl330"; 297 | }; 298 | /* assigned interrupt number corresponds to actual SPI - 32 */ 299 | connectal@0x6e400000 { 300 | compatible = "linux,portal-0.01.a"; 301 | interrupts = <0 29 4>; 302 | interrupt-parent = <&gic>; 303 | reg = <0x6e400000 0x10000>; 304 | device-name = "connectal"; 305 | }; 306 | }; 307 | }; 308 | -------------------------------------------------------------------------------- /imagefiles/zynq_miniitx100_fsbl.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/zynq_miniitx100_fsbl.elf -------------------------------------------------------------------------------- /imagefiles/zynq_zc702_fsbl.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/zynq_zc702_fsbl.elf -------------------------------------------------------------------------------- /imagefiles/zynq_zc706_fsbl.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/zynq_zc706_fsbl.elf -------------------------------------------------------------------------------- /imagefiles/zynq_zedboard_fsbl.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/zynq_zedboard_fsbl.elf -------------------------------------------------------------------------------- /imagefiles/zynq_zybo_fsbl.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/zynq_zybo_fsbl.elf -------------------------------------------------------------------------------- /imagefiles/zynqportal.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/imagefiles/zynqportal.ko -------------------------------------------------------------------------------- /init.debug.patch: -------------------------------------------------------------------------------- 1 | diff --git a/init/init.c b/init/init.c 2 | old mode 100755 3 | new mode 100644 4 | index 4f57144..e9fabc8 5 | --- a/init/init.c 6 | +++ b/init/init.c 7 | @@ -859,6 +859,7 @@ int main(int argc, char **argv) 8 | int signal_fd_init = 0; 9 | int keychord_fd_init = 0; 10 | bool is_charger = false; 11 | + int debugfd; 12 | 13 | if (!strcmp(basename(argv[0]), "ueventd")) 14 | return ueventd_main(argc, argv); 15 | @@ -890,7 +891,10 @@ int main(int argc, char **argv) 16 | * Now that tmpfs is mounted on /dev, we can actually 17 | * talk to the outside world. 18 | */ 19 | - open_devnull_stdio(); 20 | + if ((debugfd = open("/init.debug", O_RDONLY)) != -1) 21 | + close(debugfd); 22 | + else 23 | + open_devnull_stdio(); 24 | klog_init(); 25 | property_init(); 26 | 27 | -------------------------------------------------------------------------------- /reserved_for_interrupts.S: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Quanta Research Cambridge, Inc 2 | * Original author John Ankcorn 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included 12 | * in all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | * DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | .arm 24 | .data 25 | 1: 26 | b 1b 27 | 1: 28 | b 1b 29 | 1: 30 | b 1b 31 | 1: 32 | b 1b 33 | 1: 34 | b 1b 35 | 1: 36 | b 1b 37 | 1: 38 | b 1b 39 | 1: 40 | b 1b 41 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | 2 | BOOTGEN=/scratch/Xilinx/SDK/2014.4/bin/bootgen 3 | NDK_OBJDUMP=arm-none-linux-gnueabi-objdump 4 | NDK_GCC=arm-none-linux-gnueabi-gcc 5 | PREFIX=$(NDK_OBJDUMP:%-objdump=%-) 6 | 7 | INT_FILES = xxdump0.elf xxdump1.elf xxdump2.elf xxdump3.elf 8 | xxdump0.LOAD = 0 9 | xxdump0.RUN = 0 10 | xxdump1.LOAD = 0 11 | xxdump1.RUN = 0 12 | xxdump2.LOAD = 0x118000 13 | xxdump2.RUN = 0x100000 14 | xxdump3.LOAD = 0x100000 15 | xxdump3.RUN = 0 16 | 17 | SOURCEFILE ?= data/bootbase.bin 18 | 19 | %.elf: %.dump 20 | $(PREFIX)objcopy -I binary -B arm -O elf32-littlearm $< --rename-section .data=.text tmpobj.o 21 | $(PREFIX)ld -e $($(patsubst %.dump,%.RUN, $<)) \ 22 | -z max-page-size=0x8000 \ 23 | --defsym=LOAD_ADDRESS=$($(patsubst %.dump,%.LOAD, $<)) \ 24 | --script convert.lds -o $@ tmpobj.o 25 | rm -f tmpobj.o 26 | 27 | %.dump: tmpdumped 28 | @#echo 29 | 30 | all: prep bootbase 31 | 32 | prep: 33 | rm -f xxdump*.elf xxdump*.dump tmpdumped 34 | 35 | bootbase: $(INT_FILES) 36 | #../../system-tools/elfdump/elfdump xxdump0.elf >xx0.dump 37 | rm -f testout.bin 38 | cp xxdump0.elf tmpfsbl.elf 39 | mv xxdump1.dump xxdump1.bin 40 | $(BOOTGEN) -o testout.bin -image testout.bif 41 | rm -f tmpfsbl.elf tmpdumped 42 | 43 | tmpdumped: $(SOURCEFILE) 44 | ../dumpbootbin $(SOURCEFILE) >xx.log 45 | touch tmpdumped 46 | 47 | .PRECIOUS: $(INT_FILES:.elf=.dump) 48 | -------------------------------------------------------------------------------- /test/convert.lds: -------------------------------------------------------------------------------- 1 | 2 | SECTIONS 3 | { 4 | .text (LOAD_ADDRESS): { 5 | start = .; 6 | *(.text); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/data/._bootgen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/._bootgen -------------------------------------------------------------------------------- /test/data/bootbase.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/bootbase.bin -------------------------------------------------------------------------------- /test/data/vivado/._base_demo.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/vivado/._base_demo.elf -------------------------------------------------------------------------------- /test/data/vivado/._boot.bif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/vivado/._boot.bif -------------------------------------------------------------------------------- /test/data/vivado/._fsbl.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/vivado/._fsbl.elf -------------------------------------------------------------------------------- /test/data/vivado/._system_wrapper.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/vivado/._system_wrapper.bit -------------------------------------------------------------------------------- /test/data/vivado/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | /scratch/Xilinx/SDK/2014.4/bin/bootgen -o foo.bin -w on -image boot.bif 4 | -------------------------------------------------------------------------------- /test/data/vivado/base_demo.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/vivado/base_demo.elf -------------------------------------------------------------------------------- /test/data/vivado/boot.bif: -------------------------------------------------------------------------------- 1 | the_ROM_image: 2 | { 3 | [bootloader]fsbl.elf 4 | ../../../bitfile/zybo/zybobsd.bit 5 | ../zyboapp.elf 6 | } 7 | -------------------------------------------------------------------------------- /test/data/vivado/fsbl.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/vivado/fsbl.elf -------------------------------------------------------------------------------- /test/data/vivado/system_wrapper.bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/vivado/system_wrapper.bit -------------------------------------------------------------------------------- /test/data/zyboapp.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/zyboapp.elf -------------------------------------------------------------------------------- /test/data/zybofsbl.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cambridgehackers/zynq-boot/c55e9389f577a2713ccea76ffc0bae5848e0db92/test/data/zybofsbl.elf -------------------------------------------------------------------------------- /test/testout.bif: -------------------------------------------------------------------------------- 1 | the_ROM_image: 2 | { 3 | [bootloader]xxdump0.elf 4 | xxdump1.bin 5 | xxdump2.elf 6 | xxdump3.elf 7 | } 8 | -------------------------------------------------------------------------------- /ubuntu/ubuntu-16.04-fixes.diff: -------------------------------------------------------------------------------- 1 | diff -urN bar/etc/apt/sources.list foo/etc/apt/sources.list 2 | --- bar/etc/apt/sources.list 2016-04-20 18:24:52.020826754 -0400 3 | +++ foo/etc/apt/sources.list 2016-05-24 08:35:36.639920203 -0400 4 | @@ -1,3 +1,57 @@ 5 | -deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe multiverse 6 | -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe multiverse 7 | -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse 8 | +## Note, this file is written by cloud-init on first boot of an instance 9 | +## modifications made here will not survive a re-bundle. 10 | +## if you wish to make changes you can: 11 | +## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg 12 | +## or do the same in user-data 13 | +## b.) add sources in /etc/apt/sources.list.d 14 | +## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl 15 | + 16 | +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to 17 | +# newer versions of the distribution. 18 | +deb http://ports.ubuntu.com/ubuntu-ports xenial main restricted 19 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial main restricted 20 | + 21 | +## Major bug fix updates produced after the final release of the 22 | +## distribution. 23 | +deb http://ports.ubuntu.com/ubuntu-ports xenial-updates main restricted 24 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-updates main restricted 25 | + 26 | +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 27 | +## team. Also, please note that software in universe WILL NOT receive any 28 | +## review or updates from the Ubuntu security team. 29 | +deb http://ports.ubuntu.com/ubuntu-ports xenial universe 30 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial universe 31 | +deb http://ports.ubuntu.com/ubuntu-ports xenial-updates universe 32 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-updates universe 33 | + 34 | +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 35 | +## team, and may not be under a free licence. Please satisfy yourself as to 36 | +## your rights to use the software. Also, please note that software in 37 | +## multiverse WILL NOT receive any review or updates from the Ubuntu 38 | +## security team. 39 | +deb http://ports.ubuntu.com/ubuntu-ports xenial multiverse 40 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial multiverse 41 | +deb http://ports.ubuntu.com/ubuntu-ports xenial-updates multiverse 42 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-updates multiverse 43 | + 44 | +## N.B. software from this repository may not have been tested as 45 | +## extensively as that contained in the main release, although it includes 46 | +## newer versions of some applications which may provide useful features. 47 | +## Also, please note that software in backports WILL NOT receive any review 48 | +## or updates from the Ubuntu security team. 49 | +deb http://ports.ubuntu.com/ubuntu-ports xenial-backports main restricted universe multiverse 50 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-backports main restricted universe multiverse 51 | + 52 | +deb http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted 53 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security main restricted 54 | +deb http://ports.ubuntu.com/ubuntu-ports xenial-security universe 55 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security universe 56 | +deb http://ports.ubuntu.com/ubuntu-ports xenial-security multiverse 57 | +deb-src http://ports.ubuntu.com/ubuntu-ports xenial-security multiverse 58 | + 59 | +## Uncomment the following two lines to add software from Canonical's 60 | +## 'partner' repository. 61 | +## This software is not part of Ubuntu, but is offered by Canonical and the 62 | +## respective vendors as a service to Ubuntu users. 63 | +# deb http://archive.canonical.com/ubuntu xenial partner 64 | +# deb-src http://archive.canonical.com/ubuntu xenial partner 65 | diff -urN bar/etc/fstab foo/etc/fstab 66 | --- bar/etc/fstab 2016-04-20 18:23:46.753137627 -0400 67 | +++ foo/etc/fstab 2016-05-24 08:32:03.082644566 -0400 68 | @@ -1,2 +1,2 @@ 69 | LABEL=cloudimg-rootfs / ext4 defaults 0 0 70 | -LABEL=system-boot /boot/firmware vfat defaults 0 1 71 | +LABEL=system-boot /boot/firmware vfat defaults 0 0 72 | diff -urN bar/etc/network/interfaces.d/50-cloud-init.cfg foo/etc/network/interfaces.d/50-cloud-init.cfg 73 | --- bar/etc/network/interfaces.d/50-cloud-init.cfg 1969-12-31 19:00:00.000000000 -0500 74 | +++ foo/etc/network/interfaces.d/50-cloud-init.cfg 2016-05-24 08:32:48.582708128 -0400 75 | @@ -0,0 +1,2 @@ 76 | +auto lo 77 | +iface lo inet loopback 78 | diff -urN bar/etc/network/interfaces.d/60-eth0.cfg foo/etc/network/interfaces.d/60-eth0.cfg 79 | --- bar/etc/network/interfaces.d/60-eth0.cfg 1969-12-31 19:00:00.000000000 -0500 80 | +++ foo/etc/network/interfaces.d/60-eth0.cfg 2016-05-23 16:13:49.530536419 -0400 81 | @@ -0,0 +1,2 @@ 82 | +auto eth0 83 | +iface eth0 inet dhcp 84 | diff -urN bar/etc/ssh/sshd_config foo/etc/ssh/sshd_config 85 | --- bar/etc/ssh/sshd_config 2016-04-20 18:23:35.921861577 -0400 86 | +++ foo/etc/ssh/sshd_config 2016-05-24 08:35:30.669920681 -0400 87 | @@ -49,7 +49,7 @@ 88 | ChallengeResponseAuthentication no 89 | 90 | # Change to no to disable tunnelled clear text passwords 91 | -PasswordAuthentication no 92 | +PasswordAuthentication yes 93 | 94 | # Kerberos options 95 | #KerberosAuthentication no 96 | @@ -85,4 +85,4 @@ 97 | # If you just want the PAM account and session checks to run without 98 | # PAM authentication, then enable this but set PasswordAuthentication 99 | # and ChallengeResponseAuthentication to 'no'. 100 | -UsePAM yes 101 | +UsePAM yes 102 | \ No newline at end of file 103 | diff -urN bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.alias foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.alias 104 | --- bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.alias 1969-12-31 19:00:00.000000000 -0500 105 | +++ foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.alias 2016-02-11 11:41:35.339934665 -0500 106 | @@ -0,0 +1 @@ 107 | +# Aliases extracted from modules themselves. 108 | Binary files bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.alias.bin and foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.alias.bin differ 109 | Binary files bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.builtin.bin and foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.builtin.bin differ 110 | Binary files bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.dep.bin and foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.dep.bin differ 111 | diff -urN bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.devname foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.devname 112 | --- bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.devname 1969-12-31 19:00:00.000000000 -0500 113 | +++ foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.devname 2016-02-11 11:41:35.339934665 -0500 114 | @@ -0,0 +1 @@ 115 | +# Device nodes to trigger on-demand module loading. 116 | diff -urN bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.softdep foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.softdep 117 | --- bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.softdep 1969-12-31 19:00:00.000000000 -0500 118 | +++ foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.softdep 2016-02-11 11:41:35.339934665 -0500 119 | @@ -0,0 +1 @@ 120 | +# Soft dependencies extracted from modules themselves. 121 | diff -urN bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.symbols foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.symbols 122 | --- bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.symbols 1969-12-31 19:00:00.000000000 -0500 123 | +++ foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.symbols 2016-02-11 11:41:35.339934665 -0500 124 | @@ -0,0 +1 @@ 125 | +# Aliases for symbols, used by symbol_request(). 126 | Binary files bar/lib/modules/3.17.0-00016-g186a77c-dirty/modules.symbols.bin and foo/lib/modules/3.17.0-00016-g186a77c-dirty/modules.symbols.bin differ 127 | diff -urN bar/lib/modules-load.d/open-iscsi.conf foo/lib/modules-load.d/open-iscsi.conf 128 | --- bar/lib/modules-load.d/open-iscsi.conf 2016-04-15 13:30:47.000000000 -0400 129 | +++ foo/lib/modules-load.d/open-iscsi.conf 1969-12-31 19:00:00.000000000 -0500 130 | @@ -1,2 +0,0 @@ 131 | -iscsi_tcp 132 | -ib_iser 133 | diff -urN bar/lib/systemd/system/local-fs.target foo/lib/systemd/system/local-fs.target 134 | --- bar/lib/systemd/system/local-fs.target 2016-04-12 07:31:22.000000000 -0400 135 | +++ foo/lib/systemd/system/local-fs.target 2016-05-24 08:21:24.618249132 -0400 136 | @@ -11,5 +11,5 @@ 137 | DefaultDependencies=no 138 | Conflicts=shutdown.target 139 | After=local-fs-pre.target 140 | -OnFailure=emergency.target 141 | -OnFailureJobMode=replace-irreversibly 142 | +#OnFailure=emergency.target 143 | +#OnFailureJobMode=replace-irreversibly 144 | -------------------------------------------------------------------------------- /update_bootbin_mac.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | ## Copyright (c) 2014 Quanta Research Cambridge, Inc. 3 | 4 | ## Permission is hereby granted, free of charge, to any person 5 | ## obtaining a copy of this software and associated documentation 6 | ## files (the "Software"), to deal in the Software without 7 | ## restriction, including without limitation the rights to use, copy, 8 | ## modify, merge, publish, distribute, sublicense, and/or sell copies 9 | ## of the Software, and to permit persons to whom the Software is 10 | ## furnished to do so, subject to the following conditions: 11 | 12 | ## The above copyright notice and this permission notice shall be 13 | ## included in all copies or substantial portions of the Software. 14 | 15 | ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | ## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | ## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | ## NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | ## BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | ## ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | ## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | ## SOFTWARE. 23 | 24 | import os, sys 25 | import argparse 26 | 27 | target_string = 'THE NEXT FIELD IS THE LOCAL MAC ADDRESS FOR UPDATE' 28 | dtb_header = [0, 0, 0, 0, 0, 3, 0, 0, 0, 6, 0, 0] # last two bytes vary with machine 0x6c 29 | if len(sys.argv) != 3: 30 | print 'update_bootbin_mac: Usage: update_bootbin_mac.py ' 31 | sys.exit(1) 32 | inbuf = open(sys.argv[1], 'r+b').read() 33 | ind = inbuf.find(target_string) 34 | if ind < 0: 35 | print 'update_bootbin_mac: string not found', target_string 36 | sys.exit(1) 37 | #print 'JJ', ind, len(inbuf) 38 | ind = ind + len(target_string) 39 | if ind + len(dtb_header) + 7 > len(inbuf): 40 | print 'update_bootbin_mac: file too short' 41 | sys.exit(1) 42 | indorig = ind 43 | for cbyte in dtb_header: 44 | if ord(inbuf[ind]) != cbyte: 45 | print 'update_bootbin_mac: byte not found', indorig, len(inbuf) 46 | print 'update_bootbin_mac: actual', [p.encode('hex') for p in inbuf[indorig:indorig+len(dtb_header)]] 47 | print 'update_bootbin_mac: expected', dtb_header 48 | sys.exit(1) 49 | ind = ind + 1 50 | ind = ind + 2 # last two bytes in dtb header vary with machine 51 | print 'current', [p.encode('hex') for p in inbuf[ind: ind + 6]] 52 | inbuf = inbuf[:ind+4] + chr(int(sys.argv[2], 0)) + inbuf[ind+5:] 53 | print 'updated', [p.encode('hex') for p in inbuf[ind: ind + 6]] 54 | open(sys.argv[1], 'w+b').write(inbuf) 55 | sys.exit(0) 56 | -------------------------------------------------------------------------------- /xbootgen.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2013, John Ankcorn 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a 4 | * copy of this software and associated documentation files (the "Software"), 5 | * to deal in the Software without restriction, including without limitation 6 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | * and/or sell copies of the Software, and to permit persons to whom the 8 | * Software is furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included 11 | * in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 14 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | * DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | //#ifdef __APPLE__ 34 | //#include 35 | //#else 36 | //#include 37 | //#endif 38 | #include "elfdef.h" 39 | #include "bootdef.h" 40 | 41 | #define BUFFER_SIZE 1024 42 | #define MAX_FILENAME 1000 43 | #define INPUT_FILE_MAX 10 44 | 45 | static int fdoutfile; 46 | static uint8_t *input_data[INPUT_FILE_MAX]; 47 | static ImageHeader imagehead[INPUT_FILE_MAX]; 48 | static int image_offset[INPUT_FILE_MAX]; 49 | static uint8_t buffer[BUFFER_SIZE]; 50 | static BootPartitionHeader partinit[10]; 51 | static struct { 52 | uint8_t *datap; 53 | uint32_t len; 54 | } partition_data[10]; 55 | 56 | /* From TRM, Chapter 6: Boot and Configuration */ 57 | static ImageHeaderTable imagetab = {0x1010000}; 58 | static uint32_t boot_rom_header[32] = {ROM_HEADER}; 59 | static uint8_t elfmagic[] = {ELF_MAGIC}; 60 | static uint8_t reserved_for_interrupts[] = { 61 | #include "reserved_for_interrupts.h" 62 | }; 63 | static uint8_t bitfile_header[] = { 64 | 0, 9, 0xf, 0xf0, 0xf, 0xf0, 0xf, 0xf0, 0xf, 0xf0, 0, 0, 1, 'a'}; 65 | 66 | static void fill_file(uint8_t fillbyte, int filllen) 67 | { 68 | while(filllen-- > 0) 69 | write(fdoutfile, &fillbyte, sizeof(fillbyte)); 70 | } 71 | static void align_file(uint8_t fillbyte, int alignsize) 72 | { 73 | int filllen = alignsize - (lseek(fdoutfile, 0, SEEK_CUR) & (alignsize - 1)); 74 | if (filllen != alignsize) 75 | fill_file(fillbyte, filllen); 76 | } 77 | 78 | static void addPartition(int ptype, uint8_t *data, uint32_t datalen, uint32_t addr, uint32_t enaddr, uint32_t startsect) 79 | { 80 | partition_data[imagetab.ImageCount].datap = data; 81 | partition_data[imagetab.ImageCount].len = datalen; 82 | partinit[imagetab.ImageCount].ImageWordLen = datalen/4; 83 | partinit[imagetab.ImageCount].DataWordLen = datalen/4; 84 | partinit[imagetab.ImageCount].PartitionWordLen = datalen/4; 85 | partinit[imagetab.ImageCount].LoadAddr = addr; 86 | partinit[imagetab.ImageCount].ExecAddr = enaddr; 87 | partinit[imagetab.ImageCount].PartitionAttr = ptype; 88 | partinit[imagetab.ImageCount].SectionCount = 0; 89 | partinit[imagetab.ImageCount].Pads[1] = startsect * sizeof(partinit[0])/4; 90 | partinit[startsect].SectionCount++; 91 | imagetab.ImageCount++; 92 | } 93 | 94 | int main(int argc, char *argv[]) 95 | { 96 | int i, index, j, entry; 97 | 98 | if ((fdoutfile = creat ("boot.bin", 0666)) < 0) { 99 | printf ("xbootgen \n"); 100 | exit(-1); 101 | } 102 | write(fdoutfile, reserved_for_interrupts, sizeof(reserved_for_interrupts)); 103 | int rom_header_offset = lseek(fdoutfile, 0, SEEK_CUR); 104 | write(fdoutfile, boot_rom_header, sizeof(boot_rom_header)); 105 | /* fill register initialiation area */ 106 | for(i = 0; i < 256; i++) { 107 | struct { 108 | uint32_t address; 109 | uint32_t value; 110 | } reginit = {0xffffffff, 0}; 111 | write(fdoutfile, ®init, sizeof(reginit)); 112 | } 113 | align_file(0xff, 0x40); 114 | int imagetab_offset = lseek(fdoutfile, 0, SEEK_CUR); 115 | write(fdoutfile, &imagetab, sizeof(imagetab)); 116 | align_file(0xff, 0x40); 117 | imagetab.ImageOffset = lseek(fdoutfile, 0, SEEK_CUR)/4; 118 | 119 | /* Gather info about each file; build image header table */ 120 | for (index = 0; index < argc - 1; index++) { 121 | const char *filename = argv[index+1]; 122 | union { 123 | char c[200]; 124 | uint32_t i[50]; 125 | } nametemp; 126 | struct stat st; 127 | int fdinput; 128 | int startsect = imagetab.ImageCount; 129 | if ((fdinput = open (filename, O_RDONLY)) < 0) { 130 | printf ("xbootgen \n"); 131 | exit(-1); 132 | } 133 | stat(filename, &st); 134 | input_data[index] = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fdinput, 0); 135 | ELF_HEADER *elfh = (ELF_HEADER *)input_data[index]; 136 | ELF_PROGRAM *progh = (ELF_PROGRAM *)&input_data[index][elfh->h32.e_phoff]; 137 | uint32_t enaddr = elfh->h32.e_entry; 138 | imagehead[index].next = 0; 139 | imagehead[index].partition = index * sizeof(partinit[0])/4; 140 | imagehead[index].count = 0; 141 | imagehead[index].name_length = 1; /* value of actual partition count */ 142 | if (memcmp(input_data[index], elfmagic, sizeof(elfmagic)) || elfh->h32.e_ident[6] != 1 143 | || elfh->h32.e_type != ET_EXEC || elfh->h32.e_ident[4] != 1) { 144 | int i; 145 | if (!memcmp(bitfile_header, input_data[index], sizeof(bitfile_header))) { 146 | /* skip bitfile header to get binfile contents */ 147 | uint8_t *inputtemp = input_data[index]; 148 | input_data[index] += sizeof(bitfile_header) - 1; 149 | while(*input_data[index]++ < 'e') { 150 | int len = *input_data[index]++; 151 | len = (len << 8) | *input_data[index]++; 152 | input_data[index] += len; 153 | } 154 | if (*--input_data[index] == 'e') 155 | input_data[index] += 1 + sizeof(uint32_t); /* skip over 'e' and length */ 156 | st.st_size -= input_data[index] - inputtemp; 157 | } 158 | uint8_t *p = malloc(st.st_size+4); 159 | uint8_t append_data[] = {0x20, 0, 0, 0}; 160 | memcpy(p, input_data[index], st.st_size); 161 | memcpy(&p[st.st_size], append_data, sizeof(append_data)); 162 | st.st_size += sizeof(append_data); 163 | for (i = 0; i < st.st_size; ) { 164 | uint8_t tmp = p[i]; 165 | p[i] = p[i+3]; 166 | p[i+3] = tmp; 167 | tmp = p[i+1]; 168 | p[i+1] = p[i+2]; 169 | p[i+2] = tmp; 170 | i += sizeof(uint32_t); 171 | } 172 | addPartition(ATTRIBUTE_PL_IMAGE_MASK, p, st.st_size, 0, 0, startsect); 173 | } 174 | else { 175 | for (entry = 0; entry < elfh->h32.e_phnum; ++entry) { 176 | uint32_t datalen = progh->p32[entry].p_filesz; 177 | if (datalen) { 178 | /* As we find partitions, add them to the partition header table */ 179 | addPartition(ATTRIBUTE_PS_IMAGE_MASK, &input_data[index][progh->p32[entry].p_offset], 180 | datalen, progh->p32[entry].p_paddr, enaddr, startsect); 181 | enaddr = 0; 182 | } 183 | } 184 | } 185 | /* Build image table entry for each input file */ 186 | image_offset[index] = lseek(fdoutfile, 0, SEEK_CUR); 187 | write(fdoutfile, &imagehead[index], sizeof(imagehead[0])); 188 | memset(&nametemp, 0, sizeof(nametemp)); 189 | char basetemp[MAX_FILENAME]; 190 | strcpy(basetemp, filename); 191 | strcpy(nametemp.c, basename(basetemp)); 192 | int len = ((strlen(nametemp.c) + 16)/16) * 4; 193 | for (j = 0; j < len; j++) { 194 | nametemp.i[j] = ntohl(nametemp.i[j]); 195 | write(fdoutfile, &nametemp.i[j], sizeof(nametemp.i[0])); 196 | } 197 | align_file(0xff, 0x40); 198 | } 199 | align_file(0xff, 0x400); 200 | fill_file(0xff, 0x80); 201 | int partinit_offset = lseek(fdoutfile, 0, SEEK_CUR); 202 | write(fdoutfile, &partinit, sizeof(partinit[0]) * (imagetab.ImageCount+1)); 203 | align_file(0xff, 0x400); 204 | fill_file(0xff, 0x700); 205 | 206 | /* Now copy data from each elf file into target file */ 207 | for (index = 0; index < imagetab.ImageCount; index++) { 208 | align_file(0xff, 0x40); 209 | partinit[index].PartitionStart = lseek(fdoutfile, 0, SEEK_CUR)/4; 210 | write(fdoutfile, partition_data[index].datap, partition_data[index].len); 211 | } 212 | 213 | /* fixup header tables */ 214 | imagetab.PartitionOffset = partinit_offset/4; 215 | boot_rom_header[4] = partinit[0].PartitionStart * 4; 216 | boot_rom_header[5] = partition_data[0].len; 217 | boot_rom_header[8] = partition_data[0].len; 218 | boot_rom_header[9] = 1; 219 | boot_rom_header[30] = imagetab_offset; 220 | boot_rom_header[31] = partinit_offset; 221 | for (index = 0; index < 10; index++) 222 | boot_rom_header[10] += boot_rom_header[index]; 223 | boot_rom_header[10] = ~boot_rom_header[10]; 224 | /* last partition entry is all '0' */ 225 | for (i = 0; i <= imagetab.ImageCount; i++) { 226 | if (i != imagetab.ImageCount) 227 | partinit[i].Pads[1] += imagetab.ImageOffset; 228 | uint32_t checksum = 0, *pdata = (uint32_t *)&partinit[i]; 229 | for (j = 0; j < 15; j++) 230 | checksum += *pdata++; 231 | partinit[i].CheckSum = ~checksum; 232 | } 233 | 234 | /* rewrite header tables */ 235 | for (index = 0; index < argc - 1; index++) { 236 | if (index < argc - 1 - 1) 237 | imagehead[index].next = image_offset[index+1]/4; 238 | imagehead[index].partition += partinit_offset/4; 239 | lseek(fdoutfile, image_offset[index], SEEK_SET); 240 | write(fdoutfile, &imagehead[index], sizeof(imagehead[0])); 241 | } 242 | lseek(fdoutfile, imagetab_offset, SEEK_SET); 243 | imagetab.Version = BOOTGEN_VERSION; 244 | write(fdoutfile, &imagetab, sizeof(imagetab)); 245 | lseek(fdoutfile, rom_header_offset, SEEK_SET); 246 | write(fdoutfile, boot_rom_header, sizeof(boot_rom_header)); 247 | lseek(fdoutfile, partinit_offset, SEEK_SET); 248 | write(fdoutfile, &partinit, sizeof(partinit[0]) * (imagetab.ImageCount+1)); 249 | close(fdoutfile); 250 | return 0; 251 | } 252 | -------------------------------------------------------------------------------- /xx.setup_i2c_hdmio: -------------------------------------------------------------------------------- 1 | # 2 | #set -y mux for hdmi 3 | ./i2cset -y 0 0x74 2 4 | #set -y hdmi data 5 | ./i2cset -y 0 0x39 0x41 0x10 6 | ./i2cset -y 0 0x39 0xD6 0xC0 7 | ./i2cset -y 0 0x39 0x15 0x01 8 | ./i2cset -y 0 0x39 0x16 0x38 9 | ./i2cset -y 0 0x39 0x18 0xAB 10 | ./i2cset -y 0 0x39 0x19 0x37 11 | ./i2cset -y 0 0x39 0x1A 0x08 12 | ./i2cset -y 0 0x39 0x1B 0x00 13 | ./i2cset -y 0 0x39 0x1C 0x00 14 | ./i2cset -y 0 0x39 0x1D 0x00 15 | ./i2cset -y 0 0x39 0x1E 0x1A 16 | ./i2cset -y 0 0x39 0x1F 0x86 17 | ./i2cset -y 0 0x39 0x20 0x1A 18 | ./i2cset -y 0 0x39 0x21 0x49 19 | ./i2cset -y 0 0x39 0x22 0x08 20 | ./i2cset -y 0 0x39 0x23 0x00 21 | ./i2cset -y 0 0x39 0x24 0x1D 22 | ./i2cset -y 0 0x39 0x25 0x3F 23 | ./i2cset -y 0 0x39 0x26 0x04 24 | ./i2cset -y 0 0x39 0x27 0x22 25 | ./i2cset -y 0 0x39 0x28 0x00 26 | ./i2cset -y 0 0x39 0x29 0x00 27 | ./i2cset -y 0 0x39 0x2A 0x08 28 | ./i2cset -y 0 0x39 0x2B 0x00 29 | ./i2cset -y 0 0x39 0x2C 0x0E 30 | ./i2cset -y 0 0x39 0x2D 0x2D 31 | ./i2cset -y 0 0x39 0x2E 0x19 32 | ./i2cset -y 0 0x39 0x2F 0x14 33 | ./i2cset -y 0 0x39 0x48 0x08 34 | ./i2cset -y 0 0x39 0x55 0x00 35 | ./i2cset -y 0 0x39 0x56 0x28 36 | ./i2cset -y 0 0x39 0x98 0x03 37 | ./i2cset -y 0 0x39 0x9A 0xE0 38 | ./i2cset -y 0 0x39 0x9C 0x30 39 | ./i2cset -y 0 0x39 0x9D 0x61 40 | ./i2cset -y 0 0x39 0xA2 0xA4 41 | ./i2cset -y 0 0x39 0xA3 0xA4 42 | ./i2cset -y 0 0x39 0xAF 0x04 43 | ./i2cset -y 0 0x39 0xE0 0xD0 44 | ./i2cset -y 0 0x39 0xF9 0x00 45 | -------------------------------------------------------------------------------- /zynq_linux_boot.lds: -------------------------------------------------------------------------------- 1 | 2 | SECTIONS 3 | { 4 | .textr (0x800000): { 5 | r.tmp(.data); 6 | } 7 | .textd (0x1000000): { 8 | d.tmp(.data); 9 | . = . + 0x1000; 10 | } 11 | .textz (0x1008000): { 12 | start: 13 | clearreg.o(.text); 14 | clearreg.o(.rodata); 15 | _start_linux: 16 | z.tmp(.data); 17 | } 18 | } 19 | --------------------------------------------------------------------------------