diff --git a/README.md b/README.md index 9f9922825c17b7ccf56549a3fd9b77b3fab38ec7..e6603418af4f3aeaf22d582089d38c870c409b56 100644 --- a/README.md +++ b/README.md @@ -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." diff --git a/scalp_safe_petalinux/.petalinux/metadata b/scalp_safe_petalinux/.petalinux/metadata index 7d06983b8164440df45c75d90cde1a6ea9f9f0ea..b6b8f719f8d36f34565506d383d27bd7e5f494e9 100644 --- a/scalp_safe_petalinux/.petalinux/metadata +++ b/scalp_safe_petalinux/.petalinux/metadata @@ -1,6 +1,6 @@ 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 diff --git a/scalp_safe_petalinux/project-spec/configs/u-boot-xlnx/platform-auto.h b/scalp_safe_petalinux/project-spec/configs/u-boot-xlnx/platform-auto.h index 1bfbbcdbac2de6e6821e9fa8ae08051e1638771f..16b4f360eeb5412701432ac13900bb56aa53411f 100644 --- a/scalp_safe_petalinux/project-spec/configs/u-boot-xlnx/platform-auto.h +++ b/scalp_safe_petalinux/project-spec/configs/u-boot-xlnx/platform-auto.h @@ -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 diff --git a/scalp_safe_petalinux/project-spec/hw-description/scalp_safe_firmware.bit b/scalp_safe_petalinux/project-spec/hw-description/scalp_safe_firmware.bit index 4444a48227db9b3859ffcc9bd10049f7397636c9..23eb74d76dece145f45538952c942a7f8de9eec0 100644 Binary files a/scalp_safe_petalinux/project-spec/hw-description/scalp_safe_firmware.bit and b/scalp_safe_petalinux/project-spec/hw-description/scalp_safe_firmware.bit differ diff --git a/scalp_safe_petalinux/project-spec/hw-description/system.xsa b/scalp_safe_petalinux/project-spec/hw-description/system.xsa index e71dc988b5fee1b0925040854a4c5caf0deda31b..5d18795d6fe6b33532d6e4287580d2f70772f40f 100644 Binary files a/scalp_safe_petalinux/project-spec/hw-description/system.xsa and b/scalp_safe_petalinux/project-spec/hw-description/system.xsa differ diff --git a/scalp_safe_petalinux/project-spec/meta-user/recipes-apps/sja1105-conf/files/sja1105-conf b/scalp_safe_petalinux/project-spec/meta-user/recipes-apps/sja1105-conf/files/sja1105-conf index 249a825c635cf6b60d2d15659dfb82c087783e1e..f40064bef7e6d9792e61981ea03e281e57089d5e 100644 --- a/scalp_safe_petalinux/project-spec/meta-user/recipes-apps/sja1105-conf/files/sja1105-conf +++ b/scalp_safe_petalinux/project-spec/meta-user/recipes-apps/sja1105-conf/files/sja1105-conf @@ -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." diff --git a/scalp_safe_petalinux/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi b/scalp_safe_petalinux/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi index b48d920ba9ce388314b55752df3e0192097b5b8e..8b0c8da89fda3b67e80b1643cff54a68ae3f8542 100644 --- a/scalp_safe_petalinux/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi +++ b/scalp_safe_petalinux/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi @@ -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; }; diff --git a/scalp_safe_petalinux/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h b/scalp_safe_petalinux/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h index b6250ec44a4f38c5ea00e31125a9f72f819ad65b..6aa354b9520d0ea9c70d43c542d16b44e930222a 100644 --- a/scalp_safe_petalinux/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h +++ b/scalp_safe_petalinux/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h @@ -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"