Commit 63d0282e authored by Jens Korinth's avatar Jens Korinth

Require sudo password only once at start

* generate_boot_image.sh requires root rights at many different points
* in it possible that the sudo timeout hits in between, leading to
  aborted execution if the user fails to re-enter the password
* fixed that, asking once, re-using the password
* also fixed and improved several other things:
* fixed zedboard and zc706 devicetrees (needed patching to activate IRQs)
* same with PyNQ, but different approach: have fixed devicetree in pynq
* fixed U-Boot output log redirection
parent d28e1a32
#!/bin/bash
BOARD=${1:-zedboard}
VERSION=${2:-2016.4}
SDCARD=${3:-}
IMGSIZE=${4:-4096}
IMGSIZE=${3:-8192}
SDCARD=${4:-}
DIR="$BOARD/$VERSION"
LOGDIR="$DIR/logs"
CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabihf-}
......@@ -10,6 +10,7 @@ ROOTFS_IMG="$PWD/rootfs.img"
PYNQ_VERSION="pynq_z1_image_2017_02_10"
PYNQ_IMAGE="$PWD/pynq/$PYNQ_VERSION.zip"
PYNQ_IMAGE_URL="https://s3-us-west-2.amazonaws.com/digilent/Products/PYNQ/$PYNQ_VERSION.zip"
UDEV_RULES="$TAPASCO_HOME/platform/zynq/module/99-tapasco.rules"
OUTPUT_IMAGE="$DIR/${BOARD}_${VERSION}.img"
### LOGFILES ###################################################################
FETCH_LINUX_LOG="$PWD/$LOGDIR/fetch-linux.log"
......@@ -35,12 +36,16 @@ given, repartition the device as a bootable SD card (WARNING: all data will
be lost).
BOARD one of zc706, zedboard
VERSION Vivado Design Suite version, e.g., 2016.4
DISK SIZE Size of the image in MiB (optional, default: 8192)
DEVICE SD card device, e.g., /dev/sdb (optional)
DISK SIZE Size of the image in MiB (optional, default: 4096)
EOF
exit 1
}
dusudo () {
[[ -z $1 ]] || echo $SUDOPW | sudo --stdin "$@"
}
error_exit () {
echo ${1:-"unknown error"} >&2 && exit 1
}
......@@ -133,32 +138,42 @@ fetch_pynq_image () {
}
extract_pynq_bl () {
IMG=${PYNQ_VERSION}.img
if [[ ! -f $PWD/pynq/BOOT.BIN ]]; then
pushd $PWD/pynq &&
mkdir -p img || return $(error_ret "$LINENO: could not create img dir")
sudo mount -oloop,offset=1M $IMG img ||
dusudo mount -oloop,offset=1M $IMG img ||
return $(error_ret "$LINENO: could not mount $IMAGE")
sudo cp img/BOOT.BIN $VERSION/BOOT.BIN ||
dusudo cp img/BOOT.BIN $VERSION/BOOT.BIN ||
return $(error_ret "$LINENO: could not copy img/BOOT.BIN")
sudo chown $USER $VERSION/BOOT.BIN ||
dusudo chown $USER $VERSION/BOOT.BIN ||
return $(error_ret "$LINENO: could not chown $USER $VERSION/BOOT.BIN")
sudo cp img/devicetree.dtb $VERSION/devicetree.dtb ||
dusudo cp img/devicetree.dtb $VERSION/devicetree.dtb ||
return $(error_ret "$LINENO: could cp img/devicetree.dtb")
sudo chown $USER $VERSION/devicetree.dtb ||
dusudo chown $USER $VERSION/devicetree.dtb ||
return $(error_ret "$LINENO: could not chown $USER $VERSION/devicetree.dtb")
sudo cp img/uEnv.txt ../uenv/uEnv-pynq.txt ||
dusudo cp img/uEnv.txt ../uenv/uEnv-pynq.txt ||
return $(error_ret "$LINENO: could not cp img/uEnv.txt")
sudo chown $USER ../uenv/uEnv-pynq.txt ||
dusudo chown $USER ../uenv/uEnv-pynq.txt ||
return $(error_ret "$LINENO: could not chown $USER uenv/uEnv-pynq.txt")
sudo umount img ||
dusudo umount img ||
return $(error_ret "$LINENO: could not umount img")
rmdir img ||
return $(error_ret "$LINENO: could not remove img")
else
echo "$DIR/BOOT.BIN already exists, skipping."
fi
if [[ ! -f $DIR/devicetree.dtb ]]; then
$DIR/linux-xlnx/scripts/dtc/dtc -I dts -O dtb -o $DIR/devicetree.dtb $PWD/pynq/devicetree.dts ||
return $(error_ret "$LINENO: could not build devicetree")
else
echo "$DIR/devicetree.dtb already exists, skipping."
fi
echo "BOOT.BIN and devicetree.dtb are ready in $DIR."
}
extract_pynq_rootfs () {
IMG=${PYNQ_VERSION}.img
if [[ ! -f $ROOTFS_IMG ]]; then
IMG=$PWD/pynq/${PYNQ_VERSION}.img
START=$(fdisk -l $IMG | awk 'END { print $2 }')
......@@ -327,13 +342,19 @@ build_devtree () {
case $BOARD in
"zedboard")
cp $DIR/linux-xlnx/arch/arm/boot/dts/zynq-7000.dtsi $DIR/ &&
cat $PWD/misc/zynq-7000.dtsi.patch | patch $DIR/zynq-7000.dtsi &&
cp $DIR/linux-xlnx/arch/arm/boot/dts/skeleton.dtsi $DIR/ &&
cat $DIR/linux-xlnx/arch/arm/boot/dts/zynq-zed.dts | sed 's/#include/\/include\//' > $DIR/devicetree.dts
echo >> $DIR/devicetree.dts
echo "/include/ \"$PWD/misc/tapasco.dtsi\"" >> $DIR/devicetree.dts
;;
"zc706")
cp $DIR/linux-xlnx/arch/arm/boot/dts/zynq-7000.dtsi $DIR/ &&
cat $PWD/misc/zynq-7000.dtsi.patch | patch $DIR/zynq-7000.dtsi &&
cp $DIR/linux-xlnx/arch/arm/boot/dts/skeleton.dtsi $DIR/ &&
cat $DIR/linux-xlnx/arch/arm/boot/dts/zynq-zed.dts | sed 's/#include/\/include\//' > $DIR/devicetree.dts
echo >> $DIR/devicetree.dts
echo "/include/ \"$PWD/misc/tapasco.dtsi\"" >> $DIR/devicetree.dts
;;
esac
$DIR/linux-xlnx/scripts/dtc/dtc -I dts -O dtb -o $DIR/devicetree.dtb $DIR/devicetree.dts ||
......@@ -343,7 +364,7 @@ build_devtree () {
build_output_image () {
# size of image (in MiB)
IMGSIZE=${1:-4096}
IMGSIZE=${1:-8192}
# default root size: MAX - 358 MiB (converted to 512B sectors)
ROOTSZ=${2:-$((($IMGSIZE - 358) * 1024 * 1024 / 512))}
if [[ ! -f $OUTPUT_IMAGE ]]; then
......@@ -351,49 +372,55 @@ build_output_image () {
echo "Creating empty disk image ..."
dd if=/dev/zero of=$OUTPUT_IMAGE bs=1M count=$IMGSIZE conv=sparse ||
return $(error_ret "$LINENO: could not init $OUTPUT_IMAGE")
echo "Mounting image to /dev/loop0 ..."
sudo losetup -D
LOOPDEV=$(sudo losetup -f --show $OUTPUT_IMAGE) ||
# remove all loopback devices
dusudo losetup -D
echo "Mounting image to loopback device ..."
LOOPDEV=$(dusudo losetup -f --show $OUTPUT_IMAGE) ||
return $(error_ret "$LINENO: could losetup $OUTPUT_IMAGE")
echo "Partitioning image in $LOOPDEV ..."
sudo sfdisk $LOOPDEV << EOF
cat > $DIR/sfdisk.script << EOF
2048 204800 c, *
206848 $ROOTSZ 83 -
EOF
dusudo sh -c "cat $DIR/sfdisk.script | sfdisk $LOOPDEV"
if [[ $? -ne 0 ]]; then
sudo losetup -d $LOOPDEV
dusudo losetup -d $LOOPDEV
return $(error_ret "$LINENO: could not partition $OUTPUT_IMAGE")
fi
echo "Unmounting image in $LOOPDEV ..."
sudo losetup -d $LOOPDEV
dusudo losetup -d $LOOPDEV
echo "Mounting partitions in $OUTPUT_IMAGE ..."
sudo kpartx -a $OUTPUT_IMAGE ||
dusudo kpartx -a $OUTPUT_IMAGE ||
return $(error_ret "$LINENO: could not kpartx -a $OUTPUT_IMAGE")
LD=`basename $LOOPDEV`
LD1=${LD}p1
LD2=${LD}p2
echo "Making BOOT partition in /dev/mapper/$LD1 ..."
if ! sudo mkfs.vfat -F 32 -n BOOT /dev/mapper/$LD1; then
sudo kpartx -d $OUTPUT_IMAGE
return $(error_ret "$LINENO: could make BOOT partition")
dusudo mkfs.vfat -F 32 -n BOOT /dev/mapper/$LD1
if [[ $? -ne 0 ]]; then
dusudo kpartx -d $OUTPUT_IMAGE
return $(error_ret "$LINENO: could not make BOOT partition")
fi
echo "Making Ext4 partition in /dev/mapper/$LD2 ..."
if ! sudo mkfs.ext4 -F -L root /dev/mapper/$LD2; then
sudo kpartx -d $OUTPUT_IMAGE
dusudo mkfs.ext4 -F -L root /dev/mapper/$LD2
if [[ $? -ne 0 ]]; then
dusudo kpartx -d $OUTPUT_IMAGE
return $(error_ret "$LINENO: could not make ROOT partition")
fi
echo "Copying files to BOOT ..."
if ! copy_files_to_boot /dev/mapper/$LD1; then
sudo kpartx -d $OUTPUT_IMAGE
copy_files_to_boot /dev/mapper/$LD1
if [[ $? -ne 0 ]]; then
dusudo kpartx -d $OUTPUT_IMAGE
return "$LINENO: copying files to boot failed"
fi
echo "Copying files to root ..."
if ! copy_files_to_root /dev/mapper/$LD2; then
sudo kpartx -d $OUTPUT_IMAGE
copy_files_to_root /dev/mapper/$LD2
if [[ $? -ne 0 ]]; then
dusudo kpartx -d $OUTPUT_IMAGE
return "$LINENO: copying files to rootfs failed"
fi
echo "Unmounting partitions ..."
sudo kpartx -d $OUTPUT_IMAGE &&
dusudo kpartx -d $OUTPUT_IMAGE &&
echo "Done, $OUTPUT_IMAGE is ready!"
else
echo "$OUTPUT_IMAGE already exists, skipping."
......@@ -402,7 +429,7 @@ EOF
prepare_sd () {
echo "dd'ing $OUTPUT_IMAGE to $SDCARD, this will take a while ..."
sudo dd if=$OUTPUT_IMAGE of=$SDCARD bs=10M ||
dusudo dd if=$OUTPUT_IMAGE of=$SDCARD bs=10M ||
return $(error_ret "$LINENO: could not dd $OUTPUT_IMAGE to $SDCARD")
echo "$SDCARD ready."
}
......@@ -412,18 +439,18 @@ copy_files_to_boot () {
TO="$DIR/`basename $DEV`"
echo "Preparing BOOT partition $TO ..."
mkdir -p $TO || return $(error_ret "$LINENO: could not create $TO")
sudo mount $DEV $TO || return $(error_ret "$LINENO: could not mount $DEV -> $TO")
dusudo mount $DEV $TO || return $(error_ret "$LINENO: could not mount $DEV -> $TO")
echo "Copying $DIR/BOOT.BIN to $TO ..."
sudo cp $DIR/BOOT.BIN $TO || echo >&2 "$LINENO: WARNING: could not copy BOOT.BIN"
dusudo cp $DIR/BOOT.BIN $TO || echo >&2 "$LINENO: WARNING: could not copy BOOT.BIN"
echo "Copying $DIR/linux-xlnx/arch/arm/boot/uImage to $TO ..."
sudo cp $DIR/linux-xlnx/arch/arm/boot/uImage $TO ||
dusudo cp $DIR/linux-xlnx/arch/arm/boot/uImage $TO ||
echo >&2 "$LINENO: WARNING: could not copy uImage"
echo "Copying $DIR/devicetree.dtb to $TO ..."
sudo cp $DIR/devicetree.dtb $TO || echo >&2 "$LINENO: WARNING: could copy devicetree"
dusudo cp $DIR/devicetree.dtb $TO || echo >&2 "$LINENO: WARNING: could copy devicetree"
echo "Copying uenv/uEnv-$BOARD.txt to $TO/uEnv.txt ..."
sudo cp uenv/uEnv-$BOARD.txt $TO/uEnv.txt ||
dusudo cp uenv/uEnv-$BOARD.txt $TO/uEnv.txt ||
echo >&2 "$LINENO: WARNING: could not copy uEnv.txt"
sudo umount $TO
dusudo umount $TO
rmdir $TO 2> /dev/null &&
echo "Boot partition ready."
}
......@@ -432,28 +459,43 @@ copy_files_to_root () {
DEV=${1:-${SDCARD}2}
TO="$DIR/`basename $DEV`"
echo "dd'ing rootfs onto second partition $TO, this will take a while ..."
sudo dd if=$ROOTFS_IMG of=$DEV bs=10M ||
dusudo dd if=$ROOTFS_IMG of=$DEV bs=10M ||
return $(error_ret "$LINENO: could not copy $ROOTFS_IMG to $DEV")
dusudo resize2fs $DEV ||
return $(error_ret "$LINENO: could not resize $DEV")
mkdir -p $TO || return $(error_ret "$LINENO: could not create $TO")
sudo mount -onoacl $DEV $TO ||
dusudo mount -onoacl $DEV $TO ||
return $(error_ret "$LINENO: could not mount $DEV -> $TO")
echo "Setting hostname to $BOARD ... "
sudo sh -c "echo $BOARD > $TO/etc/hostname" ||
dusudo sh -c "echo $BOARD > $TO/etc/hostname" ||
echo >&2 "$LINENO: WARNING: could not set hostname"
echo "Updating /etc/hosts ..."
dusudo sed -i "s/pynq/$BOARD/g" $TO/etc/hosts ||
echo >&2 "$LINENO: WARNING: could not update /etc/hosts"
echo "Setting env vars ... "
dusudo sh -c "echo export LINUX_HOME=/linux-xlnx >> $TO/home/xilinx/.bashrc" ||
echo >&2 "$LINENO: WARNING: could not set env var LINUX_HOME"
dusudo sh -c "echo export TAPASCO_HOME=~/tapasco >> $TO/home/xilinx/.bashrc" ||
echo >&2 "$LINENO: WARNING: could not set env var TAPASCO_HOME"
dusudo sh -c "echo export PATH=\\\$PATH:\\\$TAPASCO_HOME/bin >> $TO/home/xilinx/.bashrc" ||
echo >&2 "$LINENO: WARNING: could not set env PATH."
echo "Replacing rc.local ... "
sudo sh -c "cp --no-preserve=ownership $PWD/misc/rc.local $TO/etc/rc.local" ||
dusudo sh -c "cp --no-preserve=ownership $PWD/misc/rc.local $TO/etc/rc.local" ||
echo >&2 "$LINENO: WARNING: could not copy rc.local"
if [[ $IMGSIZE -gt 4096 ]]; then
echo "Copying linux tree to /linux-xlnx ..."
sudo sh -c "cp -r --no-preserve=ownership $DIR/linux-xlnx $TO/linux-xlnx" ||
dusudo sh -c "cp -r --no-preserve=ownership,timestamps $DIR/linux-xlnx $TO/linux-xlnx" ||
echo >&2 "$LINENO: WARNING: could not copy linux-xlnx"
else
echo >&2 "$LINENO: WARNING: image size $IMGSIZE < 4096 MiB, not enough space to copy linux tree"
fi
echo "Copying udev rules ..."
dusudo sh -c "cat $UDEV_RULES | sed 's/OWNER\"tapasco\"/OWNER=\"xilinx\"/g' | sed 's/GROUP=\"tapasco\"/GROUP=\"xilinx\"/g' | sed 's/tapasco:tapasco/xilinx:xilinx/g' > $TO/etc/udev/rules.d/99-tapasco.rules" ||
echo >&2 "$LINENO: WARNING: could not write udev rules"
echo "Removing Jupyter stuff from home ..."
sudo sh -c "find $TO/home/xilinx/* -maxdepth 0 | xargs rm -rf" ||
dusudo sh -c "find $TO/home/xilinx/* -maxdepth 0 | xargs rm -rf" ||
echo >&2 "$LINENO: WARNING: could not delete Jupyter stuff"
sudo umount $TO
dusudo umount $TO
rmdir $TO 2> /dev/null &&
echo "RootFS partition ready."
}
......@@ -471,6 +513,8 @@ check_hsi
check_vivado
check_image_tools
check_sdcard
read -p "Enter sudo password: " -s SUDOPW
[[ -n $SUDOPW ]] || error_exit "dusudo password may not be empty"
mkdir -p $LOGDIR 2> /dev/null
mkdir -p `dirname $PYNQ_IMAGE` 2> /dev/null
echo "And so it begins ..."
......@@ -505,7 +549,7 @@ else
fi
build_uimage &> $BUILD_UIMAGE_LOG &
BUILD_UIMAGE_OK=$!
if [[ $BOARD != "pynq" ]]; then build_ssbl; fi &
if [[ $BOARD != "pynq" ]]; then build_ssbl &> $BUILD_SSBL_LOG; fi &
BUILD_SSBL_OK=$!
wait $BUILD_UIMAGE_OK || error_exit "Building uImage failed, check log: $BUILD_UIMAGE_LOG"
wait $BUILD_SSBL_OK || error_exit "Building U-Boot SSBL failed, check log: $BUILD_SSBL_LOG"
......@@ -526,7 +570,8 @@ if [[ $BOARD != "pynq" ]]; then
wait $BUILD_DEVICETREE_OK || error_exit "Building devicetree failed, check log: $BUILD_DEVICETREE_LOG"
else
echo "Extract FSBL and devicetree from $PYNQ_IMAGE (output in $EXTRACT_BL_LOG) ..."
extract_pynq_bl &> EXTRACT_BL_LOG
extract_pynq_bl &> $EXTRACT_BL_LOG &
wait || error_exit "Extraction of FSBL and devicetree from $PYNQ_IMAGE failed, check log: $EXTRACT_BL_LOG"
if [[ ! -f $DIR/BOOT.BIN ]]; then
echo "Extracting FSBL failed, check log: $EXTRACT_BL_LOG"
exit 1
......@@ -543,12 +588,15 @@ extract_pynq_rootfs &> $EXTRACT_RFS_LOG
################################################################################
echo "Building image in $OUTPUT_IMAGE (output in $BUILD_OUTPUT_IMAGE_LOG) ..."
build_output_image $IMGSIZE &> $BUILD_OUTPUT_IMAGE_LOG
[[ $? -eq 0 ]] || error_exit "Building output image failed, check log: $BUILD_OUTPUT_IMAGE_LOG"
if [[ $? -ne 0 ]]; then
# rm -f $OUTPUT_IMAGE &> /dev/null
error_exit "Building output image failed, check log: $BUILD_OUTPUT_IMAGE_LOG"
fi
echo "SD card image ready: $OUTPUT_IMAGE"
################################################################################
if [[ -n $SDCARD ]]; then
echo "Preparing $SDCARD, this may take a while (output in $PREPARE_SD_LOG) ..."
prepare_sd &> $PREPARE_DS_LOG
prepare_sd &> $PREPARE_SD_LOG
[[ $? -eq 0 ]] || error_exit "Preparing SD card failed, check log: $PREPARE_SD_LOG"
sync &&
echo "SD card $SDCARD successfully prepared, ready to boot!"
......
/ {
tapasco {
compatible = "tapasco";
interrupt-parent = <0x3>;
interrupts = <0x0 0x1d 0x4 0x0 0x1e 0x4 0x0 0x1f 0x4 0x0 0x20 0x4>;
};
};
99,110d98
< gpio0: gpio@e000a000 {
< compatible = "xlnx,zynq-gpio-1.0";
< #gpio-cells = <2>;
< clocks = <&clkc 42>;
< gpio-controller;
< interrupt-controller;
< #interrupt-cells = <2>;
< interrupt-parent = <&intc>;
< interrupts = <0 20 4>;
< reg = <0xe000a000 0x1000>;
< };
<
/dts-v1/;
/ {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "xlnx,zynq-7000";
chosen {
bootargs = "console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=1 uio_pdrv_genirq.of_id=\"generic-uio\"";
linux,stdout-path = "/amba@0/serial@E0001000";
};
aliases {
ethernet0 = "/amba/ethernet@e000b000";
serial0 = "/amba/serial@e0000000";
spi0 = "/amba/spi@e000d000";
};
memory {
device_type = "memory";
reg = <0x0 0x20000000>;
};
cpus {
#address-cells = <0x1>;
#size-cells = <0x0>;
cpu@0 {
compatible = "arm,cortex-a9";
device_type = "cpu";
reg = <0x0>;
clocks = <0x1 0x3>;
clock-latency = <0x3e8>;
cpu0-supply = <0x2>;
operating-points = <0x9eb10 0xf4240 0x4f588 0xf4240>;
};
cpu@1 {
compatible = "arm,cortex-a9";
device_type = "cpu";
reg = <0x1>;
clocks = <0x1 0x3>;
};
};
pmu {
compatible = "arm,cortex-a9-pmu";
interrupts = <0x0 0x5 0x4 0x0 0x6 0x4>;
interrupt-parent = <0x3>;
reg = <0xf8891000 0x1000 0xf8893000 0x1000>;
};
fixedregulator@0 {
compatible = "regulator-fixed";
regulator-name = "VCCPINT";
regulator-min-microvolt = <0xf4240>;
regulator-max-microvolt = <0xf4240>;
regulator-boot-on;
regulator-always-on;
linux,phandle = <0x2>;
phandle = <0x2>;
};
amba {
compatible = "simple-bus";
#address-cells = <0x1>;
#size-cells = <0x1>;
interrupt-parent = <0x3>;
ranges;
adc@f8007100 {
compatible = "xlnx,zynq-xadc-1.00.a";
reg = <0xf8007100 0x20>;
interrupts = <0x0 0x7 0x4>;
interrupt-parent = <0x3>;
clocks = <0x1 0xc>;
};
can@e0008000 {
compatible = "xlnx,zynq-can-1.0";
status = "disabled";
clocks = <0x1 0x13 0x1 0x24>;
clock-names = "can_clk", "pclk";
reg = <0xe0008000 0x1000>;
interrupts = <0x0 0x1c 0x4>;
interrupt-parent = <0x3>;
tx-fifo-depth = <0x40>;
rx-fifo-depth = <0x40>;
};
can@e0009000 {
compatible = "xlnx,zynq-can-1.0";
status = "disabled";
clocks = <0x1 0x14 0x1 0x25>;
clock-names = "can_clk", "pclk";
reg = <0xe0009000 0x1000>;
interrupts = <0x0 0x33 0x4>;
interrupt-parent = <0x3>;
tx-fifo-depth = <0x40>;
rx-fifo-depth = <0x40>;
};
i2c@e0004000 {
compatible = "cdns,i2c-r1p10";
status = "disabled";
clocks = <0x1 0x26>;
interrupt-parent = <0x3>;
interrupts = <0x0 0x19 0x4>;
reg = <0xe0004000 0x1000>;
#address-cells = <0x1>;
#size-cells = <0x0>;
};
i2c@e0005000 {
compatible = "cdns,i2c-r1p10";
status = "disabled";
clocks = <0x1 0x27>;
interrupt-parent = <0x3>;
interrupts = <0x0 0x30 0x4>;
reg = <0xe0005000 0x1000>;
#address-cells = <0x1>;
#size-cells = <0x0>;
};
interrupt-controller@f8f01000 {
compatible = "arm,cortex-a9-gic";
#interrupt-cells = <0x3>;
interrupt-controller;
reg = <0xf8f01000 0x1000 0xf8f00100 0x100>;
num_cpus = <0x2>;
num_interrupts = <0x60>;
linux,phandle = <0x3>;
phandle = <0x3>;
};
cache-controller@f8f02000 {
compatible = "arm,pl310-cache";
reg = <0xf8f02000 0x1000>;
interrupts = <0x0 0x2 0x4>;
arm,data-latency = <0x3 0x2 0x2>;
arm,tag-latency = <0x2 0x2 0x2>;
cache-unified;
cache-level = <0x2>;
};
memory-controller@f8006000 {
compatible = "xlnx,zynq-ddrc-a05";
reg = <0xf8006000 0x1000>;
};
ocmc@f800c000 {
compatible = "xlnx,zynq-ocmc-1.0";
interrupt-parent = <0x3>;
interrupts = <0x0 0x3 0x4>;
reg = <0xf800c000 0x1000>;
};
serial@e0000000 {
compatible = "xlnx,xuartps", "cdns,uart-r1p8";
status = "okay";
clocks = <0x1 0x17 0x1 0x28>;
clock-names = "uart_clk", "pclk";
reg = <0xe0000000 0x1000>;
interrupts = <0x0 0x1b 0x4>;
device_type = "serial";
port-number = <0x0>;
};
serial@e0001000 {
compatible = "xlnx,xuartps", "cdns,uart-r1p8";
status = "disabled";
clocks = <0x1 0x18 0x1 0x29>;
clock-names = "uart_clk", "pclk";
reg = <0xe0001000 0x1000>;
interrupts = <0x0 0x32 0x4>;
};
spi@e0006000 {
compatible = "xlnx,zynq-spi-r1p6";
reg = <0xe0006000 0x1000>;
status = "disabled";
interrupt-parent = <0x3>;
interrupts = <0x0 0x1a 0x4>;
clocks = <0x1 0x19 0x1 0x22>;
clock-names = "ref_clk", "pclk";
#address-cells = <0x1>;
#size-cells = <0x0>;
};
spi@e0007000 {
compatible = "xlnx,zynq-spi-r1p6";
reg = <0xe0007000 0x1000>;
status = "disabled";
interrupt-parent = <0x3>;
interrupts = <0x0 0x31 0x4>;
clocks = <0x1 0x1a 0x1 0x23>;
clock-names = "ref_clk", "pclk";
#address-cells = <0x1>;
#size-cells = <0x0>;
};
spi@e000d000 {
clock-names = "ref_clk", "pclk";
clocks = <0x1 0xa 0x1 0x2b>;
compatible = "xlnx,zynq-qspi-1.0";
status = "okay";
interrupt-parent = <0x3>;
interrupts = <0x0 0x13 0x4>;
reg = <0xe000d000 0x1000>;
#address-cells = <0x1>;
#size-cells = <0x0>;
is-dual = <0x0>;
num-cs = <0x1>;
};
memory-controller@e000e000 {
#address-cells = <0x1>;
#size-cells = <0x1>;
status = "disabled";
clock-names = "memclk", "aclk";
clocks = <0x1 0xb 0x1 0x2c>;
compatible = "arm,pl353-smc-r2p1";
interrupt-parent = <0x3>;
interrupts = <0x0 0x12 0x4>;
ranges;
reg = <0xe000e000 0x1000>;
flash@e1000000 {
status = "disabled";
compatible = "arm,pl353-nand-r2p1";
reg = <0xe1000000 0x1000000>;
#address-cells = <0x1>;
#size-cells = <0x1>;
};
flash@e2000000 {
status = "disabled";
compatible = "cfi-flash";
reg = <0xe2000000 0x2000000>;
#address-cells = <0x1>;
#size-cells = <0x1>;
};
};
ethernet@e000b000 {
compatible = "cdns,zynq-gem", "cdns,gem";
reg = <0xe000b000 0x1000>;
status = "okay";
interrupts = <0x0 0x16 0x4>;
clocks = <0x1 0x1e 0x1 0x1e 0x1 0xd>;
clock-names = "pclk", "hclk", "tx_clk";
#address-cells = <0x1>;
#size-cells = <0x0>;
enet-reset = <0x4 0x9 0x0>;
local-mac-address = [00 0a 35 00 00 00];
phy-mode = "rgmii-id";
xlnx,ptp-enet-clock = <0x6750918>;
};
ethernet@e000c000 {
compatible = "cdns,zynq-gem", "cdns,gem";
reg = <0xe000c000 0x1000>;
status = "disabled";
interrupts = <0x0 0x2d 0x4>;
clocks = <0x1 0x1f 0x1 0x1f 0x1 0xe>;
clock-names = "pclk", "hclk", "tx_clk";
#address-cells = <0x1>;
#size-cells = <0x0>;
};
sdhci@e0100000 {
compatible = "arasan,sdhci-8.9a";
status = "okay";
clock-names = "clk_xin", "clk_ahb";
clocks = <0x1 0x15 0x1 0x20>;
interrupt-parent = <0x3>;
interrupts = <0x0 0x18 0x4>;
reg = <0xe0100000 0x1000>;
broken-adma2;
xlnx,has-cd = <0x1>;
xlnx,has-power = <0x0>;
xlnx,has-wp = <0x0>;
};
sdhci@e0101000 {
compatible = "arasan,sdhci-8.9a";
status = "disabled";
clock-names = "clk_xin", "clk_ahb";
clocks = <0x1 0x16 0x1 0x21>;
interrupt-parent = <0x3>;
interrupts = <0x0 0x2f 0x4>;
reg = <0xe0101000 0x1000>;
broken-adma2;
};
slcr@f8000000 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "xlnx,zynq-slcr", "syscon", "simple-mfd";
reg = <0xf8000000 0x1000>;
ranges;
linux,phandle = <0x5>;
phandle = <0x5>;
clkc@100 {
#clock-cells = <0x1>;
compatible = "xlnx,ps7-clkc";
fclk-enable = <0xf>;
clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x", "cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x", "dci", "lqspi", "smc", "pcap", "gem0", "gem1", "fclk0", "fclk1", "fclk2", "fclk3", "can0", "can1", "sdio0", "sdio1", "uart0", "uart1", "spi0", "spi1", "dma", "usb0_aper", "usb1_aper", "gem0_aper", "gem1_aper", "sdio0_aper", "sdio1_aper", "spi0_aper", "spi1_aper", "can0_aper", "can1_aper", "i2c0_aper", "i2c1_aper", "uart0_aper", "uart1_aper", "gpio_aper", "lqspi_aper", "smc_aper", "swdt", "dbg_trc", "dbg_apb";
reg = <0x100 0x100>;
ps-clk-frequency = <0x2faf080>;
linux,phandle = <0x1>;
phandle = <0x1>;
};
rstc@200 {
compatible = "xlnx,zynq-reset";
reg = <0x200 0x48>;
#reset-cells = <0x1>;
syscon = <0x5>;
};
pinctrl@700 {
compatible = "xlnx,pinctrl-zynq";