From 98f2ae34498c3c4c6dc8a8d08a13b1cab2d4df73 Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Sat, 14 Sep 2024 11:24:43 +0200 Subject: [PATCH] bsps/arm/beagle: Remove README.md and old script The information from the README.md have been merged into the documentation. The necessary tools for the sdcard.sh are quite tricky to build. All necessary information to create an SD image are in the documentation already. So the script isn't necessary any more. Update #5088 --- bsps/arm/beagle/README.md | 174 --------------------------- bsps/arm/beagle/simscripts/sdcard.sh | 86 ------------- 2 files changed, 260 deletions(-) delete mode 100644 bsps/arm/beagle/README.md delete mode 100644 bsps/arm/beagle/simscripts/sdcard.sh diff --git a/bsps/arm/beagle/README.md b/bsps/arm/beagle/README.md deleted file mode 100644 index 1b4a09159d..0000000000 --- a/bsps/arm/beagle/README.md +++ /dev/null @@ -1,174 +0,0 @@ -Beagleboard -=========== - -BSP for beagleboard xm, beaglebone (original aka white), and beaglebone black. - -original beagleboard isn't tested. - - -CONFIGURING ------------ -bsp-specific build options in the environment at build time: - -CONSOLE_POLLED=1 use polled i/o for console, required to run testsuite -CONSOLE_BAUD=... override default console baud rate - -BSPs recognized are: -beagleboardorig original beagleboard -beagleboardxm beagleboard xm -beaglebonewhite original beaglebone -beagleboneblack beaglebone black - -Currently the only distinction in the BSP are between the beagleboards and -the beaglebones, but the 4 names are specified in case hardware-specific -distinctions are made in the future, so this can be done without changing the -usage. - - -BUILDING --------- -To build BSPs for the beaglebone white and beagleboard xm, starting from -a directory in which you have this source tree in rtems-src: - -$ mkdir b-beagle -$ cd b-beagle -$ ../rtems-src/configure --target=arm-rtems4.11 --enable-rtemsbsp="beaglebonewhite beagleboardxm" -$ make all - -This should give you .exes somewhere. - -Then you need 'mkimage' to transform a .exe file to a u-boot image -file. first make a flat binary: - -$ arm-rtems4.11-objcopy $exe -O binary $exe.bin -$ gzip -9 $exe.bin -$ mkimage -A arm -O rtems -T kernel -a 0x80000000 -e 0x80000000 -n RTEMS -d $exe.bin.gz rtems-app.img - -All beagles have memory starting at 0x80000000 so the load & run syntax is the same. - -BOOTING -------- -Then, boot the beaglebone with u-boot on an SD card and load rtems-app.img -from u-boot. Interrupt the u-boot boot to get a prompt. - -Set up a tftp server and a network connection for netbooting. And to -copy rtems-app.img to the tftp dir. Otherwise copy the .img to the FAT -partition on the SD card and make uboot load & run that. - - -BEAGLEBONES ------------ -(tested on both beaglebones) - -Beaglebone original (white) or beaglebone black netbooting: - -uboot# setenv ipaddr 192.168.12.20 -uboot# setenv serverip 192.168.12.10 -uboot# echo starting from TFTP -uboot# tftp 0x80800000 rtems-app.img -uboot# dcache off ; icache off -uboot# bootm 0x80800000 - -Beaglebone original (white) or beaglebone black from a FAT partition: - -uboot# fatload mmc :1 0x80800000 ticker.img -uboot# dcache off ; icache off -uboot# bootm 0x80800000 - - -BEAGLEBOARD ------------ -(tested on xm) - -For the beagleboard the necessary commands are a bit different because -of the ethernet over usb: - -uboot# setenv serverip 192.168.12.10 -uboot# setenv ipaddr 192.168.12.62 -uboot# setenv usbnet_devaddr e8:03:9a:24:f9:10 -uboot# setenv usbethaddr e8:03:9a:24:f9:11 -uboot# usb start -uboot# echo starting from TFTP -uboot# tftp 0x80800000 rtems-app.img -uboot# dcache off ; icache off -uboot# bootm 0x80800000 - - -SD CARD -------- -There is a script here that automatically writes an SD card for any of -the beagle targets. - -Let's write one for the Beaglebone Black. Assuming your source tree is -at $HOME/development/rtems/rtems-src and your bsp is built and linked -with examples and installed at $HOME/development/rtems/4.11. - -```shell - % cd $HOME/development/rtems/rtems-src/c/src/lib/libbsp/arm/beagle/simscripts - % sh sdcard.sh $HOME/development/rtems/4.11 $HOME/development/rtems/b-beagle/arm-rtems4.11/c/beagleboneblack/testsuites/samples/hello/hello.exe -``` - -The script should give you a whole bunch of output, ending in: - - Result is in bone_hello.exe-sdcard.img. - -There you go. dd that to an SD card and boot! - -The script needs to know whether it's for a Beagleboard xM or one of the -Beaglebones. This is to know which uboot to use. It will detect this -from the path the executable is in (in the above example, it contains -'beagleboneblack'), so you have to specify the full path. - - -Good luck & enjoy! - -Ben Gras -beng@shrike-systems.com - - -JTAG ----- -To run RTEMS from scratch (without any other bootcode) on the beagles, -you can comfortably load the executables over JTAG using gdb. This is -necessarily target-specific however. - -1. BBXM - - - For access to JTAG using openocd, see simscripts/bbxm.cfg. - - openocd then offers access to gdb using simscripts/gdbinit.bbxm. - - start openocd using bbxm.cfg - - copy your .exe to a new dir and that gdbinit file as .gdbinit in the same dir - - go there and start gdb: - $ arm-rtems4.11-gdb hello.exe - - gdb will invoke the BBXM hardware initialization in the bbxm.cfg - and load the ELF over JTAG. type 'c' (for continue) to run it. - - breakpoints, C statement and single-instruction stepping work. - -2. beaglebone white - -This has been tested with openocd and works but not in as much detail as for -the BBXM yet (i.e. loading an executable from scratch). - - -Testing -------- -To build and run the tests for this BSP, use the RTEMS tester. -The necessary software can be built with the RTEMS source builder. - -To build the BSP for testing: - - set CONSOLE_POLLED=1 in the configure environment, some tests - assume console i/o is polled - - add --enable-tests to the configure line - -1. Qemu - -Linaro Qemu can emulate the beagleboard xm and so run all regression -tests in software. Build the bbxm.bset from the RTEMS source builder and -you will get qemu linaro that can run them. There is a beagleboardxm_qemu -bsp in the RTEMS tester to invoke it with every test. - -2. bbxm hardware - -This requires JTAG, see README.JTAG. Use the beagleboardxm bsp in the -RTEMS tester. It starts gdb to connect to openocd to reset the target -and load the RTEMS executable for each test iteration. diff --git a/bsps/arm/beagle/simscripts/sdcard.sh b/bsps/arm/beagle/simscripts/sdcard.sh deleted file mode 100644 index 13371efa0e..0000000000 --- a/bsps/arm/beagle/simscripts/sdcard.sh +++ /dev/null @@ -1,86 +0,0 @@ -# we store all generated files here. -TMPDIR=tmp_sdcard_dir.$$ - -FATIMG=$TMPDIR/bbxm_boot_fat.img -SIZE=65536 -OFFSET=2048 -FATSIZE=`expr $SIZE - $OFFSET` -UENV=uEnv.txt - -rm -rf $TMPDIR -mkdir -p $TMPDIR -trap 'rm -rf $TMPDIR' EXIT - -if [ $# -ne 3 ] -then echo "Usage: $0 " - exit 1 -fi - -PREFIX=$1 - -if [ ! -d "$PREFIX" ] -then echo "This script needs the RTEMS tools bindir as the first argument." - exit 1 -fi - -executable=$2 - -case "$2" in - *beagleboard*) - ubootcfg=omap3_beagle - imgtype=bb - ;; - *beaglebone*) - ubootcfg=am335x_evm - imgtype=bone - ;; - *) - echo "Can't guess which uboot to use - please specify full path to executable." - exit 1 - ;; -esac - -dtb="$3" - -app=rtems-app.img - -if [ ! -f "$executable" ] -then echo "Expecting RTEMS executable as arg; $executable not found." - exit 1 -fi - -set -e - -IMG=${imgtype}_`basename $2`-sdcard.img - -# Make an empty image -dd if=/dev/zero of=$IMG bs=512 seek=`expr $SIZE - 1` count=1 -dd if=/dev/zero of=$FATIMG bs=512 seek=`expr $FATSIZE - 1` count=1 - -# Make an ms-dos FS on it -$PREFIX/bin/newfs_msdos -r 1 -m 0xf8 -c 4 -F16 -h 64 -u 32 -S 512 -s $FATSIZE -o 0 ./$FATIMG - -# Prepare the executable. -base=`basename $executable` -$PREFIX/bin/arm-rtems5-objcopy $executable -O binary $TMPDIR/$base.bin -gzip -9 $TMPDIR/$base.bin -$PREFIX/bin/mkimage -A arm -O rtems -T kernel -a 0x80000000 -e 0x80000000 -n RTEMS -d $TMPDIR/$base.bin.gz $TMPDIR/$app -echo "setenv bootdelay 5 -uenvcmd=run boot -boot=fatload mmc 0 0x80800000 $app ; fatload mmc 0 0x88000000 $(basename "$dtb") ; bootm 0x80800000 - 0x88000000" >$TMPDIR/$UENV - -# Copy the uboot and app image onto the FAT image -$PREFIX/bin/mcopy -bsp -i $FATIMG $PREFIX/uboot/$ubootcfg/MLO ::MLO -$PREFIX/bin/mcopy -bsp -i $FATIMG $PREFIX/uboot/$ubootcfg/u-boot.img ::u-boot.img -$PREFIX/bin/mcopy -bsp -i $FATIMG $TMPDIR/$app ::$app -$PREFIX/bin/mcopy -bsp -i $FATIMG $TMPDIR/$UENV ::$UENV -# Copy DTB -$PREFIX/bin/mcopy -bsp -i $FATIMG "$dtb" ::"$(basename "$dtb")" - -# Just a single FAT partition (type C) that uses all of the image -$PREFIX/bin/partition -m $IMG $OFFSET c:${FATSIZE}\* - -# Put the FAT image into the SD image -dd if=$FATIMG of=$IMG seek=$OFFSET - -echo "Result is in $IMG."