IMPORTANT always use an external power source that can supply at least 10W!
I had MMC (SD card) detection issues in u-boot when I ran my Cubieboard2 off just the micro-USB port.
use u-boot config Cubieboard2_defconfig
I don't have a suitable power connector for this board, so I've switched to my A10 board for now.
wget "ftp://ftp.denx.de/pub/u-boot/u-boot-2017.01.tar.bz2"
(about 12MB in size)wget "ftp://ftp.denx.de/pub/u-boot/u-boot-2017.01.tar.bz2.sig"
gpg --verify --keyring ./uboot-keyring.gpg ./u-boot-2017.01.tar.bz2.sig
tar xf u-boot-2017.01.tar.bz2
cd u-boot-2017.01
make CROSS_COMPILE=arm-none-eabi- A10-OLinuXino-Lime_defconfig
ls ./configs/
build-essential
, arm-none-eabi
toolchain, bc
, device-tree-compiler
make CROSS_COMPILE=arm-none-eabi- -j4
screen /dev/ttyUSB0 115200
sunxi-fel uboot ./u-boot-sunxi-with-spl.bin
OEM u-boot image for the Cubieboard2 is here but it's really old (2014.01-rc1-09154-gfb357b4)
fun u-boot commands:
gpio set PH2
- turn on LED1gpio clear PH2
- turn off LED1prerequisites:
uucp
group
sudo usermod --append --groups uucp $(whoami)
dmesg | grep -i "tty"
sudo ${EDITOR} /etc/udev/rules.d/80-usbserial.rules
SUBSYSTEM=="usb", KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660"
ttyUSB
is whatever was found with dmesg
previouslyscreen
, minicom
, etc)sudo
screen /dev/ttyUSB0 115200
sunxi-fel
git clone https://github.com/linux-sunxi/sunxi-tools
build-essential
cd sunxi-tools
make
uucp
group
sudo usermod --append --groups uucp $(whoami)
lsusb
Bus 042 Device 021: ID 1f3a:efe8
sudo ${EDITOR} /etc/udev/rules.d/81-sunxi.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="efe8", GROUP="uucp", MODE="0660"
sunxi-fel version
AWUSBFEX soc=00165100(A20) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 00000000
steps:
sunxi-fel uboot ./u-boot-sunxi-with-spl.bin
sunxi-fel -v uboot u-boot-sunxi-with-spl.bin
write 0x42000000 uImage
write 0x43100000 boot.scr
layout (from sunxi wiki):
0x00000
, size 0x02000
: MBR
0x02000
, size 0x08000
: SPL
0x06000
(see this commit)0x0A000
, size 0x7E000
: u-boot
0x88000
, size 0x20000
: environment (for u-boot?)0xA8000
, size 0x20000
: u-boot falcon mode boot parameters0xC8000
, size 0x38000
: u-boot falcon mode kernel0x100000
: storage partitionsformatting steps:
sudo dd if=/dev/zero of=${SDCARD} bs=1M count=4
sudo parted ${SDCARD}
mklabel msdos
mkpart primary fat32 1M 100%
1M
value comes from the layout table abovequit
sudo mkfs --type vfat -F 32 ${SDCARDp1}
sudo dd if=./u-boot-sunxi-with-spl.bin of=${SDCARD} bs=1K seek=8
sync
sudo fsck -t vfat -M -N ${SDCARDp1}
linux stuff:
uImage
(kernel with a u-boot wrapper)
mkimage -A arm -O linux -T kernel -C none -a 0x42000000 -e 0x42000000 -n "name" -d kernel.bin uImage
boot.scr
(boot script in binary format)
mkimage -C none -A arm -T script -d ./boot.cmd ./boot.scr
sys
API, of courseKey to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), y (purecode), p (processor specific)
Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text.startup.mai PROGBITS 40000000 010000 000088 00 AX 0 0 4 [ 2] .rodata.main.str1 PROGBITS 40000088 010088 000008 01 AMS 0 0 4 [ 3] .debug_info PROGBITS 00000000 010090 00033c 00 0 0 1 [ 4] .debug_abbrev PROGBITS 00000000 0103cc 0001d5 00 0 0 1 [ 5] .debug_loc PROGBITS 00000000 0105a1 000081 00 0 0 1 [ 6] .debug_aranges PROGBITS 00000000 010622 000030 00 0 0 1 [ 7] .debug_ranges PROGBITS 00000000 010652 000048 00 0 0 1 [ 8] .debug_line PROGBITS 00000000 01069a 000083 00 0 0 1 [ 9] .debug_str PROGBITS 00000000 01071d 00026a 01 MS 0 0 1 [10] .comment PROGBITS 00000000 010987 00001a 01 MS 0 0 1 [11] .ARM.attributes ARM_ATTRIBUTES 00000000 0109a1 00003b 00 0 0 1 [12] .debug_frame PROGBITS 00000000 0109dc 000044 00 0 0 4 [13] .symtab SYMTAB 00000000 010a20 000130 10 14 18 4 [14] .strtab STRTAB 00000000 010b50 000013 00 0 0 1 [15] .shstrtab STRTAB 00000000 010b63 0000c1 00 0 0 1
Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text.startup.mai PROGBITS 40000000 010000 000088 00 AX 0 0 4 [ 2] .rodata.main.str1 PROGBITS 40000088 010088 000008 01 AMS 0 0 4 [ 3] .comment PROGBITS 00000000 010090 00001a 01 MS 0 0 1 [ 4] .ARM.attributes ARM_ATTRIBUTES 00000000 0100aa 00003b 00 0 0 1 [ 5] .shstrtab STRTAB 00000000 0100e5 00004b 00 0 0 1
sys
functions mark a program as not universalARM machines that might have vsync interrupt support:
./hw/display/xlnx_dp.c:1159: xlnx_dpdma_trigger_vsync_irq(s->dpdma);
xilinx-zynq-a9
./hw/display/omap_dss.c:119: s->rfbi.vsync = 0;
and ./hw/display/blizzard.c:218: s->vsync = 1;
n800
n810
./hw/display/pxa2xx_lcd.c:904: qemu_irq_raise(s->vsync_cb);
connex
borzoi
tosa
mainstone
terrier
akita
z2
spitz
verdex
PXA270 looks to be the best supported
might as well cherry-pick useful API calls from existing OSs/kernels
from the MS-DOS API Wikipedia article and Barry ???
From PPSSPP source code
os_Status file_read_async(u32 id, size buffer_size, void (*handler)(os_Status status, void *buffer, size buffer_size))
void handler(os_Status status, void *buffer, size buffer_size)
buffer
to buffer allocated in file_read_async()
os_Status
returned from file_read_async()
is for reporting issues with the queueos_Status
as param of handler()
is for reporting issue with the operationos_Status file_read_async(u32 id, size buffer_size, volatile u32 *out_ticket)
ticket
is an ID unique to each operation requestedos_Status file_read_wait(u32 ticket, void **out_buffer, size *out_buffer_size)
out_buffer
to buffer allocated in file_read_async()
notes:
buffer
should be allocated, written only once