Skip to content
Snippets Groups Projects
Commit 883e06d4 authored by joachim.schmidt's avatar joachim.schmidt
Browse files

Version 0.4 of the firmware PetaLinux scalp_safe_petalinux with UBI/UBIFS support.

parent f4b70af3
No related branches found
No related tags found
No related merge requests found
......@@ -82,10 +82,10 @@ and File -> Export -> Export Hardware -> include bitstream
$ cd <SCALP_PROJECT_FOLDER>
$ git clone https://gitedu.hesge.ch/soma/scalp_petalinux.git
$ cd scalp_petalinux
$ git checkout SCALP-SAFE-v0.3
$ git checkout SCALP-SAFE-v0.4
```
**Use version 0.3 only for the GIT scalp_petalinux repository and not for the GIT scalp_firmware repository. The version difference is not an error.**
**Use version 0.4 only for the GIT scalp_petalinux repository and not for the GIT scalp_firmware repository. The version difference is not an error.**
### Create new Petalinux project from a BSP
......@@ -273,8 +273,6 @@ $ find . -name ubifs.o
The image content can be produced by using the **mkenvimage** command.
```
Do not use this command :
$ echo -e "custom_board_name=\"Zynq Scalp Board\"\ncustom_board_version=\"RevB 2008\"\ncustom_board_vendor=\"Hepia CoRES - LSN\"" > images/linux/uenv-vol.env
$ /tools/u-boot-tools/mkenvimage -s 0x100000 -o images/linux/uenv-vol.env.bin images/linux/uenv-vol.env
```
......@@ -294,10 +292,13 @@ Extract the root file system to the previously created directory.
```
$ cd images/linux
$ mkdir rootfs-vol
$ tar -xzvpf rootfs.tar.gz -C rootfs-vol
$ cd rootfs-vol/
$ cat ../rootfs.cpio | cpio -idvm --no-absolute-filenames
$ cd ..
$ sudo chown -R root:root rootfs-vol/
```
**Do not go to the rootfs folder** and create the other folders associated with the different UBI volumes.
Create the other folders associated with the different UBI volumes.
**For information purposes only**
......@@ -311,9 +312,11 @@ $ tar -xzvpf rootfs.tar.gz -C rootfs-vol
**The last PEB are reserved for the UBI/UBIFS file system.**
```
$ mkdir uenv-vol datafs-vol
$ mkdir datafs-vol
```
Copy Linux kernel FIT image into datafs-vol.
```
$ cp image.ub datafs-vol/
```
......@@ -334,42 +337,12 @@ Then, rootfs-vol, datafs-vol and uenv-vol UBI/UBIFS volumes must be created resp
```
$ sudo mkfs.ubifs -r ./rootfs-vol -m 1 -e 65408 -c 260 -o rootfs-vol.ubifs
$ sudo chown -R ${USER}:${USER} rootfs-vol/
$ sudo mkfs.ubifs -r ./datafs-vol -m 1 -e 65408 -c 130 -o datafs-vol.ubifs
$ sudo mkfs.ubifs -r ./uenv-vol -m 1 -e 65408 -c 32 -o uenv-vol.ubifs
```
Next, a configuration file must be created to define the UBI layout volume.
```
$ echo \
"[uenv-volume]
mode=ubi
image=uenv-vol.ubifs
vol_id=0
vol_size=2048KiB
vol_type=static
vol_name=uenv-vol
[datafs-volume]
mode=ubi
image=datafs-vol.ubifs
vol_id=1
vol_size=8320KiB
vol_type=static
vol_name=datafs-vol
[rootfs-volume]
mode=ubi
image=rootfs-vol.ubifs
vol_id=2
vol_size=16640KiB
vol_type=dynamic
vol_name=rootfs-vol
vol_flags=autoresize
" \
> ubi-image.ini
```
```
$ echo \
"[uenv-volume]
......@@ -800,7 +773,7 @@ ScalpZynq> md.b 0x10000000 10
```
```
ScalpZynq> env import -b 0x10000004 0xffffc
ScalpZynq> env import -c 0x10000000 0x100000
```
```
......@@ -1129,7 +1102,7 @@ sja1105_ports_vlan_conf()
exit 1
fi
bridge vlan add dev swp2_bottom vid 2 pvid untagged
bridge vlan add dev swp2_bottom vid 1 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp2_bottom interface in untagged VLAN mode."
......@@ -1137,7 +1110,7 @@ sja1105_ports_vlan_conf()
exit 1
fi
bridge vlan add dev swp3_top vid 3 pvid untagged
bridge vlan add dev swp3_top vid 1 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp3_top interface in untagged VLAN mode."
......@@ -1145,7 +1118,7 @@ sja1105_ports_vlan_conf()
exit 1
fi
bridge vlan add dev swp4_west vid 4 pvid untagged
bridge vlan add dev swp4_west vid 1 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp4_west interface in untagged VLAN mode."
......
PETALINUX_VER=2020.2
VALIDATE_HW_CHKSUM=1
HARDWARE_PATH=/home/jo/Documents/Projets/Hepia/scalp_project/scalp_firmware/designs/vivado/scalp_safe_firmware/2020.2/lin64/scalp_safe_firmware/scalp_safe_firmware.xsa
HARDWARE_CHECKSUM=e4c86ebb7157c318baafe6ea2691035e
HARDWARE_CHECKSUM=c0e54849f94ffc5aaa53e1cad4e1235f
YOCTO_SDK=5ff8fc5f85d1566b314bb73eaa378212
RFSCONFIG_CHKSUM=098862acb0a15bbc6a0d0999eb493baa
......@@ -35,7 +35,7 @@
#define CONFIG_MII
#define CONFIG_NET_MULTI
#define CONFIG_NETCONSOLE 1
#define CONFIG_SERVERIP 192.168.1.153
#define CONFIG_SERVERIP 10.136.135.67
#define CONFIG_IPADDR 192.168.0.10
#define CONFIG_GATEWAYIP 192.168.0.1
#define CONFIG_NETMASK 255.255.255.0
......
No preview for this file type
No preview for this file type
......@@ -113,7 +113,7 @@ sja1105_ports_vlan_conf()
exit 1
fi
bridge vlan add dev swp2_bottom vid 2 pvid untagged
bridge vlan add dev swp2_bottom vid 1 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp2_bottom interface in untagged VLAN mode."
......@@ -121,7 +121,7 @@ sja1105_ports_vlan_conf()
exit 1
fi
bridge vlan add dev swp3_top vid 3 pvid untagged
bridge vlan add dev swp3_top vid 1 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp3_top interface in untagged VLAN mode."
......@@ -129,7 +129,7 @@ sja1105_ports_vlan_conf()
exit 1
fi
bridge vlan add dev swp4_west vid 4 pvid untagged
bridge vlan add dev swp4_west vid 1 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp4_west interface in untagged VLAN mode."
......
......@@ -165,7 +165,7 @@
//sja1105,role-phy;
fixed-link {
speed = <10>;
speed = <1000>;
full-duplex;
};
};
......@@ -177,7 +177,7 @@
//sja1105,role-phy;
fixed-link {
speed = <10>;
speed = <1000>;
full-duplex;
};
};
......@@ -201,7 +201,7 @@
//sja1105,role-phy;
fixed-link {
speed = <10>;
speed = <1000>;
full-duplex;
};
};
......@@ -213,7 +213,7 @@
//sja1105,role-mac;
fixed-link {
speed = <10>;
speed = <1000>;
full-duplex;
};
};
......@@ -246,7 +246,7 @@
//local-mac-address = [00 0a 35 00 00 00];
fixed-link {
speed = <10>;
speed = <1000>;
full-duplex;
};
......
......@@ -15,9 +15,9 @@
"UBI_UENV_VOL_NAME=uenv-vol\0" \
"UBI_DATAFS_VOL_NAME=datafs-vol\0" \
"UBI_ROOTFS_VOL_NAME=rootfs-vol\0" \
"UBI_VOL_LOAD_ADDR=0x2000000\0" \
"KERNEL_FIT_IMAGE_NAME=image.ub\0" \
"spi_init=sf probe 0 0 0\0" \
"mount_ubi_rootfs_vol=run spi_init && ubi part ${UBI_PART_NAME} && ubifsmount ${UBI_PART_ID}:${UBI_ROOTFS_VOL_NAME}\0" \
"mount_ubi_datafs_vol=run spi_init && ubi part ${UBI_PART_NAME} && ubifsmount ${UBI_PART_ID}:${UBI_DATAFS_VOL_NAME}\0" \
"macmemaddr=0x1000000\0" \
"readmac=i2c dev 0; i2c read 0x53 0xfa.1 6 ${macmemaddr}\0" \
"buildmac=\n" \
......@@ -38,10 +38,10 @@
"sep=\".\"\n" \
"done &&\n" \
"setenv ipaddr $e &&\n" \
"setenv bootargs \"ip=${ipaddr}:::::eth0\"\0" \
"setenv bootargs \"${mtdparts} ubi.mtd=1 root=${UBI_PART_ID}:${UBI_ROOTFS_VOL_NAME} rootfstype=ubifs rw earlyprintk cpuidle.off=1 crashkernel=256M ip=${ipaddr}:::::eth0\"\0" \
"setup_eth=run readmac buildmac buildip\0" \
"boot_from_qspi=run setup_eth && run load_scalp_fitimage && iminfo ${SCALP_FITIMAGE_LOAD_OFFSET} && bootm ${SCALP_FITIMAGE_LOAD_OFFSET}\0" \
"custom_autoboot=echo Scalp board autoboot && run boot_from_qspi\0" \
"boot_from_qspi=ubi part ${UBI_PART_NAME} && ubifsmount ${UBI_PART_ID}:${UBI_DATAFS_VOL_NAME} && ubifsload ${UBI_VOL_LOAD_ADDR} /${KERNEL_FIT_IMAGE_NAME} && ubifsumount && ubi detach && iminfo ${UBI_VOL_LOAD_ADDR} && bootm ${UBI_VOL_LOAD_ADDR}\0" \
"custom_autoboot=echo Scalp board autoboot && run spi_init && run setup_eth && run boot_from_qspi\0" \
"baudrate=115200\0" \
"bootargs=ip=${ipaddr}:::::eth0\0" \
"bootdelay=2\0" \
......@@ -53,5 +53,8 @@
"ethact=eth0\0" \
"ethprime=eth0\0" \
#define MTDIDS_DEFAULT "nor0=nor_flash"
#define IPADDR_DEFAULT "10.197.100.100"
#define ETHADDR_DEFAULT "02:00:00:c5:64:64"
#define MTDIDS_DEFAULT "nor0=nor_flash"
#define MTDPARTS_DEFAULT "mtdparts=nor_flash:5m(boot)ro,-(ubi)"
#define BOOTARGS_DEFAULT "${mtdparts} ubi.mtd=1 root=ubi0:rootfs-vol rootfstype=ubifs rw earlyprintk cpuidle.off=1 crashkernel=256M ip=${ipaddr}:::::eth0"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment