diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-25 15:06:08 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-26 07:17:57 +0200 |
commit | eb36d1198cdf9dc1e2f776ef6e1e38755f6d13c5 (patch) | |
tree | 14177ad7a58c06a3c537d1e55dae7bc369a1a4b9 /bsps/arm/beagle/simscripts | |
parent | bsps: Remove unmaintained times files (diff) | |
download | rtems-eb36d1198cdf9dc1e2f776ef6e1e38755f6d13c5.tar.bz2 |
bsps: Move documentation, etc. files to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'bsps/arm/beagle/simscripts')
-rw-r--r-- | bsps/arm/beagle/simscripts/bbxm.cfg | 174 | ||||
-rw-r--r-- | bsps/arm/beagle/simscripts/gdbinit.bbxm | 16 | ||||
-rw-r--r-- | bsps/arm/beagle/simscripts/qemu-beagleboard.in | 63 | ||||
-rw-r--r-- | bsps/arm/beagle/simscripts/sdcard.sh | 84 |
4 files changed, 337 insertions, 0 deletions
diff --git a/bsps/arm/beagle/simscripts/bbxm.cfg b/bsps/arm/beagle/simscripts/bbxm.cfg new file mode 100644 index 0000000000..a5fe36cd01 --- /dev/null +++ b/bsps/arm/beagle/simscripts/bbxm.cfg @@ -0,0 +1,174 @@ +# Start with: openocd -f interface/ftdi/flyswatter.cfg -f bbxm.cfg -c 'reset init' +# or with: openocd -f interface/ftdi/flyswatter2.cfg -f bbxm.cfg -c 'reset init' +source [find board/ti_beagleboard_xm.cfg] + +# +# Use the MLO file from uboot to initialise the board. +# +proc beagleboard_xm_mlo { file } { + global _CHIPNAME + adapter_khz 10 + catch { mww phys 0x48307250 0x00000004 } + reset init + icepick_c_wreset $_CHIPNAME.jrc + halt + dm37x.cpu arm core_state arm + puts "Beagleboard xM MLO: $file" + load_image $file 0x402005f8 bin + resume 0x40200800 + sleep 500 + halt +} + +proc beagleboard_xm_init {} { + global _CHIPNAME + adapter_khz 10 + catch { mww phys 0x48307250 0x00000004 } + reset init + icepick_c_wreset $_CHIPNAME.jrc + halt + dm37x.cpu arm core_state arm + + mwh 0x6e00007c 0x000000ff ;# omap-gpmc + mwh 0x6e00007c 0x00000090 ;# omap-gpmc + mwh 0x6e000080 0x00000000 ;# omap-gpmc + mwh 0x6e00007c 0x00000000 ;# omap-gpmc + mwh 0x6e000080 0x00000000 ;# omap-gpmc + mwh 0x6e000080 0x00000000 ;# omap-gpmc + mwh 0x6e000080 0x00000000 ;# omap-gpmc + mwh 0x6e000080 0x00000000 ;# omap-gpmc + mwh 0x6e000080 0x00000000 ;# omap-gpmc + mwh 0x6e00007c 0x00000030 ;# omap-gpmc + mww 0x48004c00 0x00000020 ;# omap3_cm + mww 0x48004c10 0x00000020 ;# omap3_cm + mww 0x48314048 0x0000aaaa ;# omap3_mpu_wdt + mww 0x48314048 0x00005555 ;# omap3_mpu_wdt + mww 0x6c000048 0xffffffff ;# omap3_sms + mww 0x48004c40 0x00000013 ;# omap3_cm + mww 0x48004c10 0x00000025 ;# omap3_cm + mww 0x48004c00 0x00000021 ;# omap3_cm + mww 0x48306d40 0x00000003 ;# omap3_prm + mww 0x48307270 0x00000083 ;# omap3_prm + mww 0x48307270 0x00000080 ;# omap3_prm + mww 0x48004904 0x00000015 ;# omap3_cm + mww 0x48004d00 0x00110016 ;# omap3_cm + mww 0x48005140 0x10020a50 ;# omap3_cm + mww 0x48004d40 0x08000040 ;# omap3_cm + mww 0x48004d40 0x09900040 ;# omap3_cm + mww 0x48004d40 0x09900c40 ;# omap3_cm + mww 0x48004d40 0x09900c00 ;# omap3_cm + mww 0x48004a40 0x00001305 ;# omap3_cm + mww 0x48004a40 0x00001125 ;# omap3_cm + mww 0x48004a40 0x00001109 ;# omap3_cm + mww 0x48004a40 0x0000110a ;# omap3_cm + mww 0x48004b40 0x00000005 ;# omap3_cm + mww 0x48004c40 0x00000015 ;# omap3_cm + mww 0x48004d00 0x00110006 ;# omap3_cm + mww 0x48004d00 0x00110007 ;# omap3_cm + mww 0x48004d00 0x00110007 ;# omap3_cm + mww 0x48005140 0x03020a50 ;# omap3_cm + mww 0x48004f40 0x00000004 ;# omap3_cm + mww 0x48004e40 0x00000409 ;# omap3_cm + mww 0x48004e40 0x00001009 ;# omap3_cm + mww 0x48004d48 0x00000009 ;# omap3_cm + mww 0x48004d44 0x02436000 ;# omap3_cm + mww 0x48004d44 0x0243600c ;# omap3_cm + mww 0x48004a40 0x0000110a ;# omap3_cm + mww 0x48004d00 0x00170007 ;# omap3_cm + mww 0x48004d04 0x00000011 ;# omap3_cm + mww 0x48004d50 0x00000001 ;# omap3_cm + mww 0x48004d4c 0x00007800 ;# omap3_cm + mww 0x48004d4c 0x0000780c ;# omap3_cm + mww 0x48004d00 0x00170037 ;# omap3_cm + mww 0x48004d04 0x00000017 ;# omap3_cm + mww 0x48004004 0x00000011 ;# omap3_cm + mww 0x48004044 0x00000001 ;# omap3_cm + mww 0x48004040 0x00081400 ;# omap3_cm + mww 0x48004040 0x00081400 ;# omap3_cm + mww 0x48004004 0x00000017 ;# omap3_cm + mww 0x48004944 0x00000001 ;# omap3_cm + mww 0x48004940 0x000a5800 ;# omap3_cm + mww 0x48004940 0x000a580c ;# omap3_cm + mww 0x48004904 0x00000017 ;# omap3_cm + mww 0x48005040 0x000000ff ;# omap3_cm + mww 0x48004c40 0x00000015 ;# omap3_cm + mww 0x48005040 0x000000ff ;# omap3_cm + mww 0x48005010 0x00000008 ;# omap3_cm + mww 0x48005000 0x00000008 ;# omap3_cm + mww 0x48004a00 0x00002000 ;# omap3_cm + mww 0x48004a10 0x00002042 ;# omap3_cm + mww 0x48005000 0x00000808 ;# omap3_cm + mww 0x48005010 0x00000808 ;# omap3_cm + mww 0x48004a00 0x0003a000 ;# omap3_cm + mww 0x48004a10 0x0003a042 ;# omap3_cm + mww 0x48004c10 0x00000025 ;# omap3_cm + mww 0x48004000 0x00000001 ;# omap3_cm + mww 0x48004a00 0x03fffe29 ;# omap3_cm + mww 0x48004a10 0x3ffffffb ;# omap3_cm + mww 0x48004a14 0x0000001f ;# omap3_cm + mww 0x48004c00 0x000000e9 ;# omap3_cm + mww 0x48004c10 0x0000003f ;# omap3_cm + mww 0x48004e00 0x00000005 ;# omap3_cm + mww 0x48004e10 0x00000001 ;# omap3_cm + mww 0x48004f00 0x00000001 ;# omap3_cm + mww 0x48004f10 0x00000001 ;# omap3_cm + mww 0x48005000 0x0003ffff ;# omap3_cm + mww 0x48005010 0x0003ffff ;# omap3_cm + mww 0x48005410 0x00000001 ;# omap3_cm + mww 0x48005400 0x00000003 ;# omap3_cm + mww 0x48004a18 0x00000004 ;# omap3_cm + mww 0x48004a08 0x00000004 ;# omap3_cm + mww 0x6e000060 0x00001800 ;# omap-gpmc + mww 0x6e000064 0x00141400 ;# omap-gpmc + mww 0x6e000068 0x00141400 ;# omap-gpmc + mww 0x6e00006c 0x0f010f01 ;# omap-gpmc + mww 0x6e000070 0x010c1414 ;# omap-gpmc + mww 0x6e000074 0x1f0f0a80 ;# omap-gpmc + mww 0x6e000078 0x00000870 ;# omap-gpmc + mwb 0x6e00007c 0x000000ff ;# omap-gpmc + mwb 0x6e00007c 0x00000070 ;# omap-gpmc + mwb 0x6e00007c 0x00000090 ;# omap-gpmc + mwb 0x6e000080 0x00000000 ;# omap-gpmc + mww 0x6d000010 0x00000002 ;# omap.sdrc + mww 0x6d000010 0x00000000 ;# omap.sdrc + mww 0x6d000044 0x00000100 ;# omap.sdrc + mww 0x6d000070 0x04000081 ;# omap.sdrc + mww 0x6d000060 0x0000000a ;# omap.sdrc + mww 0x6d000080 0x04590099 ;# omap.sdrc + mww 0x6d00009c 0xc29dc4c6 ;# omap.sdrc + mww 0x6d0000a0 0x00022322 ;# omap.sdrc + mww 0x6d0000a4 0x0004e201 ;# omap.sdrc + mww 0x6d0000a8 0x00000000 ;# omap.sdrc + mww 0x6d0000a8 0x00000001 ;# omap.sdrc + mww 0x6d0000a8 0x00000002 ;# omap.sdrc + mww 0x6d0000a8 0x00000002 ;# omap.sdrc + mww 0x6d000084 0x00000032 ;# omap.sdrc + mww 0x6d000040 0x00000004 ;# omap.sdrc + mww 0x6d0000b0 0x04590099 ;# omap.sdrc + mww 0x6d0000c4 0xc29dc4c6 ;# omap.sdrc + mww 0x6d0000c8 0x00022322 ;# omap.sdrc + mww 0x6d0000d4 0x0004e201 ;# omap.sdrc + mww 0x6d0000d8 0x00000000 ;# omap.sdrc + mww 0x6d0000d8 0x00000001 ;# omap.sdrc + mww 0x6d0000d8 0x00000002 ;# omap.sdrc + mww 0x6d0000d8 0x00000002 ;# omap.sdrc + mww 0x6d0000b4 0x00000032 ;# omap.sdrc + mww 0x6d0000b0 0x00000000 ;# omap.sdrc + mww 0x6e00001c 0x00000000 ;# omap-gpmc + mww 0x6e000040 0x00000000 ;# omap-gpmc + mww 0x6e000050 0x00000000 ;# omap-gpmc + mww 0x6e000078 0x00000000 ;# omap-gpmc + mww 0x6e000078 0x00000000 ;# omap-gpmc + mww 0x6e000060 0x00001800 ;# omap-gpmc + mww 0x6e000064 0x00141400 ;# omap-gpmc + mww 0x6e000068 0x00141400 ;# omap-gpmc + mww 0x6e00006c 0x0f010f01 ;# omap-gpmc + mww 0x6e000070 0x010c1414 ;# omap-gpmc + mww 0x6e000074 0x1f0f0a80 ;# omap-gpmc + mww 0x6e000078 0x00000870 ;# omap-gpmc + mww 0x48004a00 0x437ffe00 ;# omap3_cm + mww 0x48004a10 0x637ffed2 ;# omap3_cm + puts "Beagleboard xM initialised" +} + +init diff --git a/bsps/arm/beagle/simscripts/gdbinit.bbxm b/bsps/arm/beagle/simscripts/gdbinit.bbxm new file mode 100644 index 0000000000..32ae9dd9ad --- /dev/null +++ b/bsps/arm/beagle/simscripts/gdbinit.bbxm @@ -0,0 +1,16 @@ +target remote localhost:3333 +mon reset halt +mon beagleboard_xm_init +load + +b _ARMV4_Exception_undef_default +b _ARMV4_Exception_swi_default +b _ARMV4_Exception_pref_abort_default +b _ARMV4_Exception_data_abort_default +b _ARMV4_Exception_reserved_default +b _ARMV4_Exception_irq_default +b _ARMV4_Exception_fiq_default + +b rtems_fatal +b rtems_fatal_error_occurred +b _exit diff --git a/bsps/arm/beagle/simscripts/qemu-beagleboard.in b/bsps/arm/beagle/simscripts/qemu-beagleboard.in new file mode 100644 index 0000000000..47c3bf489d --- /dev/null +++ b/bsps/arm/beagle/simscripts/qemu-beagleboard.in @@ -0,0 +1,63 @@ +# +# ARM/BeagleBoard Qemu Support +# + +bspUsesGDBSimulator="no" +# bspGeneratesGDBCommands="yes" +# bspSupportsGDBServerMode="yes" +runBSP=NOT_OVERRIDDEN +if [ ! -r ${runBSP} ] ; then + runBSP=qemu-system-arm +fi +bspNeedsDos2Unix="yes" +bspGeneratesDeviceTree="yes" +bspInputDevice=qemu-gumstix.cmds +bspTreeFile=qemu-gumstix.cmds +bspRedirectInput=yes + +runARGS() +{ +# qemu-system-arm -M connex -m 289 -nographic -monitor null -pflash connex-flash.img <cmds >log + + UBOOT=${HOME}/qemu/u-boot-connex-400-r1604.bin + FLASH=connex-flash.img + ( dd of=${FLASH} bs=128k count=128 if=/dev/zero ; + dd of=${FLASH} bs=128k conv=notrunc if=${UBOOT} ; + dd of=${FLASH} bs=1k conv=notrunc seek=4096 if=${1} ) >/dev/null 2>&1 + + if [ ${coverage} = yes ] ; then + rm -f trace ${1}.tra + COVERAGE_ARG="-trace ${1}.tra" + fi + + echo "-M connex -m 289 -nographic -monitor null \ + -pflash ${FLASH} ${COVERAGE_ARG}" +} + +checkBSPFaults() +{ + return 0 +} + +bspLimit() +{ + testname=$1 + case ${testname} in + *stackchk*)limit=5 ;; + *fatal*) limit=1 ;; + *minimum*) limit=1 ;; + *psxtime*) limit=180 ;; + *) limit=60 ;; + esac + echo ${limit} +} + +### Generate the commands we boot with +bspGenerateDeviceTree() +{ +cat >qemu-gumstix.cmds <<EOF + +bootelf 0x400000 + +EOF +} diff --git a/bsps/arm/beagle/simscripts/sdcard.sh b/bsps/arm/beagle/simscripts/sdcard.sh new file mode 100644 index 0000000000..83e3807cc7 --- /dev/null +++ b/bsps/arm/beagle/simscripts/sdcard.sh @@ -0,0 +1,84 @@ +# 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 + +if [ $# -ne 2 ] +then echo "Usage: $0 <RTEMS prefix> <RTEMS executable>" + 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 + +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-rtems4.12-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 ; bootm 0x80800000" >$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 + +# 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 + +# cleanup +rm -rf $TMPDIR + +echo "Result is in $IMG." |