BIOS design using PETITBOOT to support SPI booting

User avatar
rooted
Posts: 6550
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 55 times
Been thanked: 15 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by rooted » Fri Nov 09, 2018 10:42 am

When you clone the kernel with git.

Code: Select all

git clone somekernel
It downloads the source to the directory you are currently in, usually /home/username into a subdirectory generally called linux.

If your username is odroid, it will be /home/odroid/linux and you want the patches to be in /home/odroid/

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Fri Nov 09, 2018 10:50 am

@rooted thank you that seems clear enough...

also i think that i am making things complex that should be simple..sozz about that..
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

User avatar
rooted
Posts: 6550
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 55 times
Been thanked: 15 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by rooted » Fri Nov 09, 2018 11:50 am

No worries, most of us know you're a hardware guy.

When it comes to resistors, capacitors, schematics and such I know next to nothing.

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Sat Nov 10, 2018 3:13 pm

ok so i i built the kernel i think that went ok it finished with no errors

the next steps i had trouble with though modifying to boot arg`s and the emmc args

Code: Select all

i think this is wehere i went wrong maybe i never  included this line in the boot arg`s section as it had an "#" in front of it  meaning it was tellinhg me something  that was a new line added to the  boot arg`s section any way  here it is below i think i should have included it..
i will edit  my  emmc  card later and see if it makes any difference..

Code: Select all

# or lzma format is available -->  load mmc 1:0 ${initrd_addr} uInitrd.igz
i rebooted it to find it came to a blank black screen so somewhere there something i did went wrong....maybe i need to start over i dunno very tired 4 now just had a huge dinner and now am tired might kick back with a bit of zeppelin for an hour or so while my belly settles down..lol.lol

although i would rather fix it rather then start over but maybe petitboot never built properly i dunno..

ok EDIT i added that line to the boot emmc arg`s and now it boots to the desktop but have no Ethernet working it just keeps searching ...any way i may just start over...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Sun Nov 11, 2018 8:32 am

phaseshifter wrote:ok so i i built the kernel i think that went ok it finished with no errors

the next steps i had trouble with though modifying to boot arg`s and the emmc args

i rebooted it to find it came to a blank black screen so somewhere there something i did went wrong....maybe i need to start over i dunno very tired 4 now just had a huge dinner and now am tired might kick back with a bit of zeppelin for an hour or so while my belly settles down..lol.lol

although i would rather fix it rather then start over but maybe petitboot never built properly i dunno..

ok EDIT i added that line to the boot emmc arg`s and now it boots to the desktop but have no Ethernet working it just keeps searching ...any way i may just start over...
Hi phaseshiter,
Glad to hear you keep doing even though you encountered many failures caused by a lack of my descriptions,
and Thank you.

So now do you have petitboot menu after booting, or do you mean you get Debian desktop display?
If you have Debian Desktop, it went wrong.
And it seems you have Debian desktop display because you said "no ethernet working". (It can be in case of normal booting, not with petitboot.)

You should have Petitboot Main Menu as following on your HDMI display.
petitboot_1_mainmenu.png
petitboot_1_mainmenu.png (6.96 KiB) Viewed 2797 times
Let's check the mandatory setting to enter petitboot main menu.

1. Build uInitrd.igz and Copy it into vfat filesystem of your eMMC card. ( under /media/boot/uInitrd.gz )
2. Build Image/rk3399-odroidn1-linux.dtb and Replace them with the new Image in vfat filesystem of your eMMC card. ( under /media/boot/Image and /media/boot/rk3399-odroidn1-linux.dtb )
3. Modify boot.ini in vfat filesystem of your eMMC card.
(1) Add console=tty0 in bootrootfs.

Code: Select all

# old one -> setenv bootrootfs "swiotlb=1 console=ttyFIQ0,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw disable_vu7=${disable_vu7}"
setenv bootrootfs "swiotlb=1 console=ttyFIQ0,115200n8 console=tty0 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw disable_vu7=${disable_vu7}"
(2) Modify initrd name

Code: Select all

# old one -> load mmc ${bootdev} ${initrd_addr} uInitrd
load mmc ${bootdev} ${initrd_addr} uInitrd.igz
So, the whole boot.ini can be as following.

Code: Select all

ODROIDN1-UBOOT-CONFIG

# U-Boot configuration
setenv kernel_addr "0x02000000"
setenv fdt_addr "0x01f00000"
setenv initrd_addr "0x04000000"

# Enable/Disable ODROID-VU7 Touchsreen
setenv disable_vu7 "false" # false

# Kernel cmdline rootfs and misc
setenv bootrootfs "swiotlb=1 console=ttyFIQ0,115200n8 console=tty0 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw disable_vu7=${disable_vu7}"

# Load kernel, uInitrd and dtb
load mmc ${bootdev} ${kernel_addr} Image
load mmc ${bootdev} ${initrd_addr} uInitrd.igz
load mmc ${bootdev} ${fdt_addr} rk3399-odroidn1-linux.dtb

# Set the kernel bootargs
setenv bootargs "${bootrootfs}"

# Boot the board
booti ${kernel_addr} ${initrd_addr} ${fdt_addr}
Then, please reboot.
Now you will have petitboot main menu display.

Could you check it again?

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Sun Nov 11, 2018 7:32 pm

ok thank you joy i will do it tonight ..and see how i go

i knew something went wrong but exactly what i don't

however i`ll do it 4 the team tonight..peace out 4 now...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Sun Nov 11, 2018 8:52 pm

ok i have this in this directory ..

Code: Select all

root@odroid:/home/odroid/linux/linux/arch/arm64# ls                             
Kconfig        Kconfig.platforms  boot     configs#  include  kvm  mm   xen     
Kconfig.debug  Makefile           configs  crypto    kernel   lib  net          
your copy code as per instruction is this..

Code: Select all

$ cp arch/arm64/boot/Image /media/boot/Image
$ cp arch/arm64/boot/dts/rockchip/rk3399-odroidn1-linux.dtb /media/boot/rk3399-odroidn1-linux.dtb
i dont se any .igz file anywhere and your said code does not specify copy of an .igz file so
i will implement and see if i get a win on this one ..not shure what will happen..
Pss still getting desktop with no eth but eth port lights are functioning..phase...

ok so i went back to the petitboot build stages and got stuck at step "6" with this step..

Code: Select all

cat << EOF > initramfs/usr/share/udhcpc/default.script
#!/bin/sh

/usr/share/udhcpc/simple.script "\$@"
/usr/sbin/pb-udhcpc "\$@"
EOF

$ chmod 755 initramfs/usr/share/udhcpc/default.script
i have entered it but dont know how to exit the "cat" script writer..i used

Code: Select all

ctrl+c
but i made some mistakes and have done it a few times ..not shure what i have done

now i have this issue at step "10"

Code: Select all

root@odroid:/home/odroid/ramdisk_petitboot# strip initramfs/usr/sbin/*          
strip:initramfs/usr/sbin/pb-exec: File format not recognized                    
strip:initramfs/usr/sbin/pb-plugin: File format not recognized                  
strip:initramfs/usr/sbin/pb-sos: File format not recognized                     
strip:initramfs/usr/sbin/pb-udhcpc: File format not recognized  
i think i will start over i am going to flash a chip and start with it but i wont write over this chip incase it is fixable..i await your answer`s..thank phase peace out...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by mad_ady » Sun Nov 11, 2018 11:38 pm

For step 6, the cat command should have exited when it reached the "EOF" string. This technique is called "here-documents" (https://en.m.wikipedia.org/wiki/Here_document), but it requires that the "EOF" (which stands for end of file, but could be any string) is the only thing on that row. So if copy/pasting make sure that line doesn't have any leading/trailing spaces.

For the 10 step - check if the files that issue the error are not symlinks. An error to the strip command should not be critical. In the worst case you end up with a bigger file.

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Mon Nov 12, 2018 12:34 am

ok so i used the auto install bl elkleate and now i am having trouble building the kerner error her...

Code: Select all

root@odroid:/home/odroid/linux# make Image dtbs -j5
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  WRAP    arch/arm64/include/generated/asm/bug.h
  WRAP    arch/arm64/include/generated/asm/bugs.h
  UPD     include/generated/uapi/linux/version.h
  UPD     include/config/kernel.release
  WRAP    arch/arm64/include/generated/asm/clkdev.h
  WRAP    arch/arm64/include/generated/asm/checksum.h
  WRAP    arch/arm64/include/generated/asm/cputime.h
  WRAP    arch/arm64/include/generated/asm/current.h
  WRAP    arch/arm64/include/generated/asm/delay.h
  WRAP    arch/arm64/include/generated/asm/div64.h
  WRAP    arch/arm64/include/generated/asm/dma.h
  WRAP    arch/arm64/include/generated/asm/emergency-restart.h
  WRAP    arch/arm64/include/generated/asm/errno.h
  WRAP    arch/arm64/include/generated/asm/ftrace.h
  WRAP    arch/arm64/include/generated/asm/hw_irq.h
  HOSTCC  scripts/basic/bin2c
  WRAP    arch/arm64/include/generated/asm/dma-contiguous.h
  WRAP    arch/arm64/include/generated/asm/ioctls.h
  WRAP    arch/arm64/include/generated/asm/ipcbuf.h
  WRAP    arch/arm64/include/generated/asm/irq_regs.h
  WRAP    arch/arm64/include/generated/asm/early_ioremap.h
  WRAP    arch/arm64/include/generated/asm/kdebug.h
  WRAP    arch/arm64/include/generated/asm/kvm_para.h
  WRAP    arch/arm64/include/generated/asm/ioctl.h
  WRAP    arch/arm64/include/generated/asm/kmap_types.h
  WRAP    arch/arm64/include/generated/asm/local64.h
  WRAP    arch/arm64/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm64/include/generated/asm/local.h
  WRAP    arch/arm64/include/generated/asm/msgbuf.h
  WRAP    arch/arm64/include/generated/asm/msi.h
  WRAP    arch/arm64/include/generated/asm/mutex.h
  WRAP    arch/arm64/include/generated/asm/pci.h
  WRAP    arch/arm64/include/generated/asm/mcs_spinlock.h
  WRAP    arch/arm64/include/generated/asm/poll.h
  WRAP    arch/arm64/include/generated/asm/mman.h
  WRAP    arch/arm64/include/generated/asm/pci-bridge.h
  WRAP    arch/arm64/include/generated/asm/resource.h
  WRAP    arch/arm64/include/generated/asm/preempt.h
  WRAP    arch/arm64/include/generated/asm/sembuf.h
  WRAP    arch/arm64/include/generated/asm/serial.h
  WRAP    arch/arm64/include/generated/asm/shmbuf.h
  WRAP    arch/arm64/include/generated/asm/simd.h
  WRAP    arch/arm64/include/generated/asm/sizes.h
  WRAP    arch/arm64/include/generated/asm/socket.h
  WRAP    arch/arm64/include/generated/asm/sockios.h
  WRAP    arch/arm64/include/generated/asm/rwsem.h
  WRAP    arch/arm64/include/generated/asm/switch_to.h
  WRAP    arch/arm64/include/generated/asm/termbits.h
  WRAP    arch/arm64/include/generated/asm/termios.h
  WRAP    arch/arm64/include/generated/asm/segment.h
  WRAP    arch/arm64/include/generated/asm/trace_clock.h
  WRAP    arch/arm64/include/generated/asm/unaligned.h
  WRAP    arch/arm64/include/generated/asm/user.h
  WRAP    arch/arm64/include/generated/asm/swab.h
  WRAP    arch/arm64/include/generated/asm/topology.h
  WRAP    arch/arm64/include/generated/asm/types.h
  WRAP    arch/arm64/include/generated/asm/vga.h
  WRAP    arch/arm64/include/generated/asm/xor.h
  CHK     include/generated/utsrelease.h
  WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/recordmcount
  CC      scripts/mod/empty.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/devicetable-offsets.s
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/sortextable
  MKELF   scripts/mod/elfconfig.h
  CHK     scripts/mod/devicetable-offsets.h
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/sumversion.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/extract-cert
scripts/extract-cert.c:21:25: fatal error: openssl/bio.h: No such file or directory
 #include <openssl/bio.h>
                         ^
compilation terminated.
scripts/Makefile.host:91: recipe for target 'scripts/extract-cert' failed
make[1]: *** [scripts/extract-cert] Error 1
make[1]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/mod/modpost
  HOSTLD  scripts/dtc/dtc
Makefile:574: recipe for target 'scripts' failed
make: *** [scripts] Error 2
root@odroid:/home/odroid/linux#
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Mon Nov 12, 2018 12:36 am

i`m now wondering if the auto install by ellate was not still made properly dunno..


did i not download the kernel files correctly via wget..etc..should i strip the linux dir and start over..??
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

back2future
Posts: 230
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english
Has thanked: 9 times
Been thanked: 1 time
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by back2future » Mon Nov 12, 2018 5:45 am

[ results on a C2 (arm64/aarch64) on Hardkernel's original products bench:

Code: Select all

ssh odroid at maze.odroid.com -p 2230
cd /tmp/petitboot

for elatll@'s modified all-in-one-script: make-uInitrd.sh
### re-boot is not necessary nor enabled
### "make -j 2"
### <CTRL>+c for exiting script

Code: Select all

watch -n 1 "sensors" && sudo ./make-uInitrd.sh
work-in-progress edit: currently Wed Nov 14, 2018 4:51 am
C2 verified

26910 blocks
Image Name: uInitrd.igz
Created: Tue Nov 13 21:55:08 2018
Image Type: AArch64 Linux RAMDisk Image (lzma compressed)
Data Size: 3807036 Bytes = 3717.81 kB = 3.63 MB
Load Address: 00000000
Entry Point: 00000000
Everything is OK.

dir initramfs
5.6 MiB /usr
5.1 MiB /lib
1.8 MiB /bin
892.0 KiB /sbin
12.0 KiB /var
12.0 KiB /etc
8.0 KiB /run
4.0 KiB /tmp
4.0 KiB /sys
4.0 KiB /proc
4.0 KiB /newroot
4.0 KiB init

Thx@all ]
Last edited by back2future on Wed Nov 14, 2018 7:40 am, edited 4 times in total.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Mon Nov 12, 2018 9:38 am

phaseshifter wrote:i`m now wondering if the auto install by ellate was not still made properly dunno..
I've tested the auto script with very initial card from the N1 Debian image without any update.
And to make sure, it's only for making uInitrd.igz.
phaseshifter wrote: did i not download the kernel files correctly via wget..etc..should i strip the linux dir and start over..??
You don't need to do strip or else for files in linux directory.
Just you need two files ...

Code: Select all

/home/odroid/linux/arch/arm64/boot/Image
/home/odroid/linux/arch/arm64/boot/dts/rockchip/rk3399-odroidn1-linux.dtb

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Mon Nov 12, 2018 9:41 am

phaseshifter wrote:ok so i used the auto install bl elkleate and now i am having trouble building the kerner error her...

Code: Select all

root@odroid:/home/odroid/linux# make Image dtbs -j5
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  WRAP    arch/arm64/include/generated/asm/bug.h
  WRAP    arch/arm64/include/generated/asm/bugs.h
  UPD     include/generated/uapi/linux/version.h
  UPD     include/config/kernel.release
  WRAP    arch/arm64/include/generated/asm/clkdev.h
  WRAP    arch/arm64/include/generated/asm/checksum.h
  WRAP    arch/arm64/include/generated/asm/cputime.h
  WRAP    arch/arm64/include/generated/asm/current.h
  WRAP    arch/arm64/include/generated/asm/delay.h
  WRAP    arch/arm64/include/generated/asm/div64.h
  WRAP    arch/arm64/include/generated/asm/dma.h
  WRAP    arch/arm64/include/generated/asm/emergency-restart.h
  WRAP    arch/arm64/include/generated/asm/errno.h
  WRAP    arch/arm64/include/generated/asm/ftrace.h
  WRAP    arch/arm64/include/generated/asm/hw_irq.h
  HOSTCC  scripts/basic/bin2c
  WRAP    arch/arm64/include/generated/asm/dma-contiguous.h
  WRAP    arch/arm64/include/generated/asm/ioctls.h
  WRAP    arch/arm64/include/generated/asm/ipcbuf.h
  WRAP    arch/arm64/include/generated/asm/irq_regs.h
  WRAP    arch/arm64/include/generated/asm/early_ioremap.h
  WRAP    arch/arm64/include/generated/asm/kdebug.h
  WRAP    arch/arm64/include/generated/asm/kvm_para.h
  WRAP    arch/arm64/include/generated/asm/ioctl.h
  WRAP    arch/arm64/include/generated/asm/kmap_types.h
  WRAP    arch/arm64/include/generated/asm/local64.h
  WRAP    arch/arm64/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm64/include/generated/asm/local.h
  WRAP    arch/arm64/include/generated/asm/msgbuf.h
  WRAP    arch/arm64/include/generated/asm/msi.h
  WRAP    arch/arm64/include/generated/asm/mutex.h
  WRAP    arch/arm64/include/generated/asm/pci.h
  WRAP    arch/arm64/include/generated/asm/mcs_spinlock.h
  WRAP    arch/arm64/include/generated/asm/poll.h
  WRAP    arch/arm64/include/generated/asm/mman.h
  WRAP    arch/arm64/include/generated/asm/pci-bridge.h
  WRAP    arch/arm64/include/generated/asm/resource.h
  WRAP    arch/arm64/include/generated/asm/preempt.h
  WRAP    arch/arm64/include/generated/asm/sembuf.h
  WRAP    arch/arm64/include/generated/asm/serial.h
  WRAP    arch/arm64/include/generated/asm/shmbuf.h
  WRAP    arch/arm64/include/generated/asm/simd.h
  WRAP    arch/arm64/include/generated/asm/sizes.h
  WRAP    arch/arm64/include/generated/asm/socket.h
  WRAP    arch/arm64/include/generated/asm/sockios.h
  WRAP    arch/arm64/include/generated/asm/rwsem.h
  WRAP    arch/arm64/include/generated/asm/switch_to.h
  WRAP    arch/arm64/include/generated/asm/termbits.h
  WRAP    arch/arm64/include/generated/asm/termios.h
  WRAP    arch/arm64/include/generated/asm/segment.h
  WRAP    arch/arm64/include/generated/asm/trace_clock.h
  WRAP    arch/arm64/include/generated/asm/unaligned.h
  WRAP    arch/arm64/include/generated/asm/user.h
  WRAP    arch/arm64/include/generated/asm/swab.h
  WRAP    arch/arm64/include/generated/asm/topology.h
  WRAP    arch/arm64/include/generated/asm/types.h
  WRAP    arch/arm64/include/generated/asm/vga.h
  WRAP    arch/arm64/include/generated/asm/xor.h
  CHK     include/generated/utsrelease.h
  WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/recordmcount
  CC      scripts/mod/empty.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/devicetable-offsets.s
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/sortextable
  MKELF   scripts/mod/elfconfig.h
  CHK     scripts/mod/devicetable-offsets.h
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/sumversion.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/extract-cert
scripts/extract-cert.c:21:25: fatal error: openssl/bio.h: No such file or directory
 #include <openssl/bio.h>
                         ^
compilation terminated.
scripts/Makefile.host:91: recipe for target 'scripts/extract-cert' failed
make[1]: *** [scripts/extract-cert] Error 1
make[1]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/mod/modpost
  HOSTLD  scripts/dtc/dtc
Makefile:574: recipe for target 'scripts' failed
make: *** [scripts] Error 2
root@odroid:/home/odroid/linux#
@phaseshifter,
Could try to install libssl-dev?

Code: Select all

$ sudo apt-get install libssl-dev
It will fix the issue.

Then, please try kernel build again.
Last edited by joy on Mon Nov 12, 2018 9:56 am, edited 1 time in total.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Mon Nov 12, 2018 9:44 am

back2future wrote:[ results on a C2 (arm64/aarch64) on Hardkernel's original products bench:

Code: Select all

ssh odroid@maze.odroid.com -p 2230
cd /tmp/petitboot

for elatllat's all-in-one-script: make-uInitrd.sh
### reboot is not necessary nor enabled
### make -j 2
### <CTRL>+c for exiting script

Code: Select all

watch -n 1 "sensors" && sudo ./make-uInitrd.sh
work-in-progress edit: currently Mon Nov 12, 2018 5:47 am
./make-uInitrd.sh: line 256: warning: here-document at line 166 delimited by end-of-file (wanted `EOF')
./make-uInitrd.sh: line 257: syntax error: unexpected end of file

Thx@all ]
Hi back2future,
I've not tried the auto script on ODROID-C2.
Please let me check it on C2 this week.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Mon Nov 12, 2018 9:54 am

I've realized instructions are too complicated to be descried in this forum page... too long descriptions.... too many steps....
and also there is a lack of my descriptions.
I will make a wiki page.
It's very difficult to find which stage my mates are at.

Regardless of it, please keep going and asking anything if you have any trouble.

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Mon Nov 12, 2018 1:16 pm

i had issues with step 3 helper binary's some cp commands failed

and step 5 udev rules some cp commands failed

also i had to make an "m4" dir i cannot exactly remember where that was but around those steps some where it was in the early stages

im up to building the kernel now..i`ll add more if needed..phase..
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

back2future
Posts: 230
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english
Has thanked: 9 times
Been thanked: 1 time
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by back2future » Tue Nov 13, 2018 6:03 am

Could systemd compilation be reduced in size (requires ~640MB including 35MB source from git)?

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Tue Nov 13, 2018 8:07 am

back2future wrote:Could systemd compilation be reduced in size (requires ~640MB including 35MB source from git)?
Well I haven't tried it. Well... It seems it's not too helpful.
Instead, removing unused features from systemd is effective.... and also eliminating binaries and libraries.

For example, security and network features can be a big part.
But before that, we need to arrange the actual scenario and mandatory features for ODROID product. :)
(about 11MB -> 4MB)

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Tue Nov 13, 2018 8:29 am

phaseshifter wrote:i had issues with step 3 helper binary's some cp commands failed

and step 5 udev rules some cp commands failed

also i had to make an "m4" dir i cannot exactly remember where that was but around those steps some where it was in the early stages

im up to building the kernel now..i`ll add more if needed..phase..
Thank you for your report, phaseshifter.
I will check them and update instructions once I'm done a wiki page.

back2future
Posts: 230
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english
Has thanked: 9 times
Been thanked: 1 time
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by back2future » Tue Nov 13, 2018 12:58 pm

joy wrote:
back2future wrote:Could systemd compilation be reduced in size (requires ~640MB including 35MB source from git)?
Well I haven't tried it. Well... It seems it's not too helpful.
Instead, removing unused features from systemd is effective.... and also eliminating binaries and libraries.

For example, security and network features can be a big part.
But before that, we need to arrange the actual scenario and mandatory features for ODROID product. :)
(about 11MB -> 4MB)
Ok. Your description helps a lot with understanding whole compiling process and troubles or difficulties.
How long does systemd or all uInitrd compiling last on N1? (C2 for systemd with 2 cores is about 1h20minutes).
So far we here try to get the compiling process done. No big optimization efforts so far.

[ and still like AMI bios also ]

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Tue Nov 13, 2018 1:57 pm

back2future wrote:
joy wrote:
back2future wrote:Could systemd compilation be reduced in size (requires ~640MB including 35MB source from git)?
Well I haven't tried it. Well... It seems it's not too helpful.
Instead, removing unused features from systemd is effective.... and also eliminating binaries and libraries.

For example, security and network features can be a big part.
But before that, we need to arrange the actual scenario and mandatory features for ODROID product. :)
(about 11MB -> 4MB)
Ok. Your description helps a lot with understanding whole compiling process and troubles or difficulties.
How long does systemd or all uInitrd compiling last on N1? (C2 for systemd with 2 cores is about 1h20minutes).
So far we here try to get the compiling process done. No big optimization efforts so far.

[ and still like AMI bios also ]
Similar. Over 1 hour on N1.

Anyway, when I saw your previous reply in this thread, "Right! C2 must be one of good test benches for petitboot.", I thought. :)
So I'm also planning to arrange instructions for C2,
because I haven't ran full instructions on C2 including uInitrd yet and also have to adjust kernel defconfig
and I'm not sure N1's auto script works on C2.

I hope you can keep this process and share your status and any fault.
I will also join later once I'm done to figure out the know issues I described above.

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by mad_ady » Tue Nov 13, 2018 3:32 pm

I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.

User avatar
tobetter
Posts: 3694
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 28 times
Been thanked: 117 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by tobetter » Tue Nov 13, 2018 3:46 pm

mad_ady wrote:I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.
I guess SYSV and UDEV would be fair enough, not sure, but current build seems to be happening in the Ubuntu native environment to copy from it in order to build the ramdisk. Someday, later, it's worth to try SYSV when Petitboot is fine with the current build.

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by mad_ady » Tue Nov 13, 2018 4:18 pm

Ok, fair enough :)

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Wed Nov 14, 2018 7:21 am

mad_ady wrote:I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.
Thank you for the input, mad_ady.

Actually, I don't have much knowledge of systemd and sysv, so I didn't consider sysv.
Just it's an easy way to build initrd on native boards.
And for petitboot, the followings are needed.

Code: Select all

systemd-udevd &
udevadm hwdb --update
udevadm trigger
As I expected based on comments you and other mates @back2future, @tobetter mentioned, systemd must be too heavy.
And you mean sysv can substitute for systemd and it's better and lighter way, right?

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Wed Nov 14, 2018 7:26 am

back2future wrote:[ results on a C2 (arm64/aarch64) on Hardkernel's original products bench:

Code: Select all

ssh odroid at maze.odroid.com -p 2230
cd /tmp/petitboot

for elatll@'s modified all-in-one-script: make-uInitrd.sh
### re-boot is not necessary nor enabled
### "make -j 2"
### <CTRL>+c for exiting script

Code: Select all

watch -n 1 "sensors" && sudo ./make-uInitrd.sh
work-in-progress edit: currently Mon Nov 12, 2018 x:xx am
C2

26910 blocks
Image Name: uInitrd.igz
Created: Tue Nov 13 21:55:08 2018
Image Type: AArch64 Linux RAMDisk Image (lzma compressed)
Data Size: 3807036 Bytes = 3717.81 kB = 3.63 MB
Load Address: 00000000
Entry Point: 00000000
Everything is OK.

dir initramfs
5.6 MiB /usr
5.1 MiB /lib
1.8 MiB /bin
892.0 KiB /sbin
12.0 KiB /var
12.0 KiB /etc
8.0 KiB /run
4.0 KiB /tmp
4.0 KiB /sys
4.0 KiB /proc
4.0 KiB /newroot
4.0 KiB init

Thx@all ]
Yeah~ The auto script works on C2. :)
Thank you for confirming it and sharing the status here, @back2future.

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Wed Nov 14, 2018 3:03 pm

well i have it up and running now i am not exactly shure what i did but i`m using the auto config script..

i do remember copying the .igz file from the prebullt petitboot into media boot and the other two files that the kernel build made..
modding the boot ini file as per what i thought it should be i can post that if you want me to...

so i did this ...after copying the two files from the initial make

Code: Select all

make modules  
make install
sudo cp .config /boot/config-`cat include/config/kernel.release`
sudo update-initramfs -c -k `cat include/config/kernel.release`
and here is my boot.ini file contents

Code: Select all

ODROIDN1-UBOOT-CONFIG

# U-Boot configuration
setenv kernel_addr "0x02000000"
setenv fdt_addr "0x01f00000"
setenv initrd_addr "0x04000000"

# Enable/Disable ODROID-VU7 Touchsreen
setenv disable_vu7 "false" # false

# Kernel cmdline rootfs and misc
setenv bootrootfs "swiotlb=1 console=ttyFIQ0,115200n8 console=tty0 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw"

# Load kernel, uInitrd and dtb
load mmc ${bootdev} ${kernel_addr} Image
load mmc ${bootdev} ${initrd_addr} uInitrd.igz
load mmc ${bootdev} ${fdt_addr} rk3399-odroidn1-linux.dtb

# Set the kernel bootargs
setenv bootargs "${bootrootfs}"

# Boot the board
booti ${kernel_addr} ${initrd_addr} ${fdt_addr}

.but it seems that the petitboot screen wont save any changes i make to it..dunno if i did something else wrong..???

when i high light the ok button and hit enter nothing happens,,in the sub menu's...
Last edited by phaseshifter on Thu Nov 15, 2018 11:33 am, edited 2 times in total.
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by mad_ady » Wed Nov 14, 2018 4:57 pm

joy wrote:
mad_ady wrote:I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.
Thank you for the input, mad_ady.

Actually, I don't have much knowledge of systemd and sysv, so I didn't consider sysv.
Just it's an easy way to build initrd on native boards.
And for petitboot, the followings are needed.

Code: Select all

systemd-udevd &
udevadm hwdb --update
udevadm trigger
As I expected based on comments you and other mates @back2future, @tobetter mentioned, systemd must be too heavy.
And you mean sysv can substitute for systemd and it's better and lighter way, right?
Well, sysv is the "legacy" way of starting linux systems, in use from the 1990s, ported from unix. It provides runlevels, /etc/rc*.d and /etc/init.d which are parsed by the init process. It should be easy to set up and consists of init and a bunch of startup scripts which are run serially instead of in parallel like systemd does. The number prefix of the script imposes the order it's executed in.
udev predates systemd, so it works with sysv, but is a different package and needs to be compiled in.
Returning to sysv you lose more advanced features like:
* builtin networking (you'd have to add ifupdown instead of systemd-networkd)
* ntp synchronization
* builtin resolver (you'd need resolvconf)
and probably others.

Denuvian is a debian distro that kept sysv - you could have a look there as well. Busybox-based systems (like openwrt) still use sysv.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Thu Nov 15, 2018 9:32 am

Hi phaseshifter,
You now have petitboot menu on your screen! :)
phaseshifter wrote: .but it seems that the petitboot screen wont save any changes i make to it..dunno if i did something else wrong..???
when i high light the ok button and hit enter nothing happens,,in the sub menu's...
Did you specify for the 2nd kernel through "n" menu, and have "User Item 1"?
Which storage is connected on your N1 except eMMC? ex) USB? SD card?
It's described in Step 4.
[ Step 4. Add a boot option and Jump to 2nd kernel ]

Code: Select all

Enter 'n'. then specify parameters and enter "OK".
For example, I made one vfat and one ext4 for rootfs on my USB stick
and copy another customized Kernel Image (ex:android) and uInitrd in vfat
and make a new rootfs in USB ext4. (in my case, I wrote a ubuntu minimal rootfs for test.)
so I got the display as following.
I specified the parameters.
Device : sda1
Kernel : Image
Initrd : uInitrd
Boot arguments : swiotlb=1 console=ttyFIQ0,115200n8 console=tty0 root=/dev/sda2 rootwait rw
Now I have "User Item 1" at the 1st line of Main Menu and you can jump to 2nd kernel and rootfs via the menu.
About the setting save...
It's normal now.
When you do reboot, all setting goes to default one.
So we need kboot.conf that petitboot utility provides.
But the conf file is fixed one in uInitrd
so for flexibility, we have to make a new scheme to scan all connected storages and update available lists on petitboot menu automatically.
I will share the scheme. It's on my todo list.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Thu Nov 15, 2018 10:04 am

mad_ady wrote:
joy wrote:
mad_ady wrote:I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.
Thank you for the input, mad_ady.

Actually, I don't have much knowledge of systemd and sysv, so I didn't consider sysv.
Just it's an easy way to build initrd on native boards.
And for petitboot, the followings are needed.

Code: Select all

systemd-udevd &
udevadm hwdb --update
udevadm trigger
As I expected based on comments you and other mates @back2future, @tobetter mentioned, systemd must be too heavy.
And you mean sysv can substitute for systemd and it's better and lighter way, right?
Well, sysv is the "legacy" way of starting linux systems, in use from the 1990s, ported from unix. It provides runlevels, /etc/rc*.d and /etc/init.d which are parsed by the init process. It should be easy to set up and consists of init and a bunch of startup scripts which are run serially instead of in parallel like systemd does. The number prefix of the script imposes the order it's executed in.
udev predates systemd, so it works with sysv, but is a different package and needs to be compiled in.
Returning to sysv you lose more advanced features like:
* builtin networking (you'd have to add ifupdown instead of systemd-networkd)
* ntp synchronization
* builtin resolver (you'd need resolvconf)
and probably others.

Denuvian is a debian distro that kept sysv - you could have a look there as well. Busybox-based systems (like openwrt) still use sysv.
Thank you for the detailed explanation, mad_ady.
I haven't totally understood because of a lack of my knowledge
but sysv must be an easier way to setup uInitrd and run startup scripts.
Even though we need additional processes to add the missing features like netowrk and resolve, but it must be worthy to try sysv.
I must investigate and study it more, then we can ask advises to adjust the whole design and discuss the better way with you.

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Thu Nov 15, 2018 12:13 pm

ok if i may add something...

there is no fan support whilst petitboot is up on the screen..i have the tall blue heatsink on my N-1 so if i`m into the petitboot for some time it matters not..
but a normal user using whichever board may find the fan not spinning up quite an issue..

point 2
you may want to add ""consoleblank=0" to the boot args ..
i have multiple machines hooked to my screen and just switch between them via the t.v remote

however the petitboot goes blank after some time and i cannot always bring it up/back on the screen..having to reboot it ..is an issue 4 me...

this my not be an issue for some but others may beg to differ...phase...

EDIT: also i might add that having the uart kit plugged in causes an issue for some reason so disconnect it from the usb end on whatever your using to putt`y into it etc..etc..i found that you just end up with a blank screen if you leave it connected

furthermore...i have used red and orange emmc chips and both work..!!
have not tried it with a blue one as yet prolly later on..phase..

just to add since i have no idea how to put a ubuntu image that will work with the N-1..i am going to flash a copy of fordee`s lightweight linux and see if i can get that to boot up...phase..
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Fri Nov 16, 2018 11:06 pm

i thought i would share this is what i have done

got an image from pi and the petiyboot see`s all four partitions ..
i have the light image on sd card and the emmc with the boot system to run p-b

however the p-b program really lacks a lot of features 4 me..maybe it`s just my poor know how

any way i entered in the deatils and i get so far as now it seems p-b cannot read/find the ".dtb" file.. maybe it`s a boot args issue..i dunno..

having a break for a while with some r and r...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

back2future
Posts: 230
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english
Has thanked: 9 times
Been thanked: 1 time
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by back2future » Sat Nov 17, 2018 1:13 am


joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Tue Nov 20, 2018 3:40 pm

phaseshifter wrote: point 2
you may want to add ""consoleblank=0" to the boot args ..
i have multiple machines hooked to my screen and just switch between them via the t.v remote

however the petitboot goes blank after some time and i cannot always bring it up/back on the screen..having to reboot it ..is an issue 4 me...

this my not be an issue for some but others may beg to differ...phase...
Hi, phaseshifter.
Sorry for late response.
I haven't tried "consoleblank=0",
but, I guess that frame buffer console is set to run initial programs (petitboot) through serial console,
so if you use the option, it can affect the display operation.
phaseshifter wrote: just to add since i have no idea how to put a ubuntu image that will work with the N-1..i am going to flash a copy of fordee`s lightweight linux and see if i can get that to boot up...phase..
In my case, I dump the rootfs image from another ubuntu image card
and rewrite it into a pre-configured ext4 filesystem of USB stick.
It may not be a smart way. hahaha~

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Tue Nov 20, 2018 3:46 pm

phaseshifter wrote:i thought i would share this is what i have done

got an image from pi and the petiyboot see`s all four partitions ..
i have the light image on sd card and the emmc with the boot system to run p-b

however the p-b program really lacks a lot of features 4 me..maybe it`s just my poor know how

any way i entered in the deatils and i get so far as now it seems p-b cannot read/find the ".dtb" file.. maybe it`s a boot args issue..i dunno..

having a break for a while with some r and r...
I appreciate your effort and helpful inputs,
and I feel sorry for my buggy instructions.
I almost done a wiki page based on your feedbacks.

And I have an update related to DTB option of 2nd kernel that is one of our known issues.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Tue Nov 20, 2018 3:53 pm

back2future wrote:[ Different coreboot approach. Maybe inspiring
https://doc.coreboot.org/lib/payloads/fit.html
https://github.com/yabits/uefi ]
Thank you for the information, back2future.

Last and this week, I was not available to look into yabits coreboot carefully. :(

And I've checked the FIT image structure, there is no resources on kernel 4.4.y.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Tue Nov 20, 2018 4:04 pm

I have an update related to DTB option of 2nd kernel that is one of our known issues.
It was unavailable to load 2nd dtb.

Now I've figured out how to load new dtb option for 2nd kernel loading with /chosen part in dtb.
The problem is some parts related to power, regulators and cores should be adjusted for 2nd kernel.
So still stuck during kernel booting (especially, in steps to vdd-log regulator) with a new dtb.
But I got some forward steps.

I think it's not mandatory option to adjust power components when we jump to 2nd stage.
How about your opinions, guys?

Just for your information. I attached a base.dtb.
Don't waste your time to analyze it, mates.
I will update this contents and test sequence once I'm done 2nd booting with new dtb file.

Code: Select all

	chosen {
		bootargs = "swiotlb=1 console=ttyFIQ0,115200n8 root=/dev/sda2 rootwait rw";
		linux,initrd-start = <0x0 0xf59f3000>;
		linux,initrd-end = <0x0 0xf5f1e87d>;
	};
Attachments
base.dtb.zip
(16.67 KiB) Downloaded 13 times

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by mad_ady » Tue Nov 20, 2018 5:53 pm

I don't think there's a problem with having a cut down dtb for the secondary kernel, as long as there's an easy way of stripping the dtb either at runtime (but I doubt uboot can do it for the second kernel) or manually

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Thu Nov 22, 2018 3:27 pm

mad_ady wrote:I don't think there's a problem with having a cut down dtb for the secondary kernel, as long as there's an easy way of stripping the dtb either at runtime (but I doubt uboot can do it for the second kernel) or manually
Yes, right.
I did various scenario tests by adjusting DTB and got this conclusion.
- core components like power and cpu init should be included by default because 2nd kernel loading sequence is same as sw reboot or "run bootcmd" from uboot.
- optional components can be adjusted. For example, I've tried to modify big/little core's opp tables for 2nd kernel dtb. or remove/add some of multimedia blocks....

Yesterday, I fixed the DTB issue so now I can load a different configured DTB for 2nd kernel.

Code: Select all

2. Issue 2 - 2nd DTB load 
I want to load different dts options flexibly but, it seems dtb option of petitboot and kexec doesn't work as I expected.
2nd DTB must have the following information.
- chosen
- memory region information

Code: Select all

	memory {
		reg = <0x0 0x200000 0x0 0xf7e00000>;
		device_type = "memory";
	};

	chosen {

	};
One more thing I have to check is hw components of 2nd kernel are initialized regardless of 1st kernel status.
Some components of 2nd kernel can be added or deleted compared with 1st kernel.
I don't think it would assure that all drivers initialize its hw components independently only on kernel stage.
In some cases, uboot does the role or init codes are contained on extraneous drivers.

back2future
Posts: 230
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english
Has thanked: 9 times
Been thanked: 1 time
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by back2future » Fri Nov 23, 2018 1:04 pm

joy wrote:
back2future wrote:[ Different coreboot approach. Maybe inspiring
https://doc.coreboot.org/lib/payloads/fit.html
https://github.com/yabits/uefi ]
Thank you for the information, back2future.

Last and this week, I was not available to look into yabits coreboot carefully. :(

And I've checked the FIT image structure, there is no resources on kernel 4.4.y.
Ok, so petitboot is more versatile, if one knows, how to handle it.
The name Hardkernel always was and is appealing to me :)
Thanks for your review.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Mon Nov 26, 2018 8:29 am

back2future wrote:
joy wrote:
back2future wrote:[ Different coreboot approach. Maybe inspiring
https://doc.coreboot.org/lib/payloads/fit.html
https://github.com/yabits/uefi ]
Thank you for the information, back2future.

Last and this week, I was not available to look into yabits coreboot carefully. :(

And I've checked the FIT image structure, there is no resources on kernel 4.4.y.
Ok, so petitboot is more versatile, if one knows, how to handle it.
The name Hardkernel always was and is appealing to me :)
Thanks for your review.
Hi back2future,
I think the coreboot must be a good approach,
but we chose petitboot as our 1st bios with spi flash several month ago,
and the supported features of petitboot look compatible with odroid to handle several storage from spi flash.
A matter of some concerns is the know issues as I shared on the 1st post.
But it looks the remaining issues can be solved soon.

Code: Select all

Issue 1 - Very long jump time to 2nd booting : I found a patch to reduce purgatory loading time.
Issue 2 - 2nd DTB load : fixed with dtb modification.
Issue 3 - Auto list-up of available candidates from all connected storages : this functionality is already implemented on petitboot.
Issue 4 - Size limitation with small sized SPI NAND/NOR Flash : it's up to supported functionality list of ODROID model.
So once we will complete a basic scenario first,
then will look into the solution you suggested and we must get better idea from it. :)
So if you have any good suggestion, please share with us here in forum.

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Wed Nov 28, 2018 7:16 pm

wiki guide step 2 kernel build typo eroor

Code: Select all

$ patch -p1 < 0001_n1_add_kexec.diff.zip
$ patch -p1 < 0002_n1_support_petitboot.diff.zip

should be

Code: Select all

$ patch -p1 < 0001_n1_add_kexec.diff
$ patch -p1 < 0002_n1_support_petitboot.diff
note also if you run auto config build you need to install this before you build the kernel...

Code: Select all

sudo apt-get install libssl-dev
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by mad_ady » Thu Nov 29, 2018 4:21 pm

Sorry for joining this party late. I'm trying now to enable petitboot on N1 with kernel 4.4.114 (based on Hardkernel's branch with small tweaks), but on Ubuntu 18.04 instead of Debian. This means gcc 7.3 instead of 6.x. The kernel built relatively fine (had to correct somewhere), but systemd build fails with:

Code: Select all

  CC       src/basic/libbasic_la-terminal-util.lo                   
  CC       src/basic/libbasic_la-login-util.lo
In file included from ../src/basic/errno-list.c:31:0:                                  
./src/basic/errno-from-name.h:143:1: error: conflicting types for 'lookup_errno'
 lookup_errno (register const char *str, register size_t len)
 ^~~~~~~~~~~~                                               
../src/basic/errno-list.c:27:33: note: previous declaration of 'lookup_errno' was here
 static const struct errno_name* lookup_errno(register const char *str,
                                 ^~~~~~~~~~~~                                          
Makefile:13870: recipe for target 'src/basic/libbasic_la-errno-list.lo' failed
make[2]: *** [src/basic/libbasic_la-errno-list.lo] Error 1 
make[2]: *** Waiting for unfinished jobs....                
In file included from ../src/basic/af-list.c:31:0:            
./src/basic/af-from-name.h:140:1: error: conflicting types for 'lookup_af'
 lookup_af (register const char *str, register size_t len)
 ^~~~~~~~~                                 
../src/basic/af-list.c:28:30: note: previous declaration of 'lookup_af' was here
 static const struct af_name* lookup_af(register const char *str, register unsigned int len);
                              ^~~~~~~~~                   
Makefile:13877: recipe for target 'src/basic/libbasic_la-af-list.lo' failed
make[2]: *** [src/basic/libbasic_la-af-list.lo] Error 1     
In file included from ../src/basic/arphrd-list.c:31:0:        
./src/basic/arphrd-from-name.h:125:1: error: conflicting types for 'lookup_arphrd'
 lookup_arphrd (register const char *str, register size_t len)        
 ^~~~~~~~~~~~~                                                        
../src/basic/arphrd-list.c:28:34: note: previous declaration of 'lookup_arphrd' was here
 static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
                                  ^~~~~~~~~~~~~
Makefile:13884: recipe for target 'src/basic/libbasic_la-arphrd-list.lo' failed

I'll try to look into it later.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Thu Nov 29, 2018 6:12 pm

mad_ady wrote:Sorry for joining this party late. I'm trying now to enable petitboot on N1 with kernel 4.4.114 (based on Hardkernel's branch with small tweaks), but on Ubuntu 18.04 instead of Debian. This means gcc 7.3 instead of 6.x. The kernel built relatively fine (had to correct somewhere), but systemd build fails with:

Code: Select all

  CC       src/basic/libbasic_la-terminal-util.lo                   
  CC       src/basic/libbasic_la-login-util.lo
In file included from ../src/basic/errno-list.c:31:0:                                  
./src/basic/errno-from-name.h:143:1: error: conflicting types for 'lookup_errno'
 lookup_errno (register const char *str, register size_t len)
 ^~~~~~~~~~~~                                               
../src/basic/errno-list.c:27:33: note: previous declaration of 'lookup_errno' was here
 static const struct errno_name* lookup_errno(register const char *str,
                                 ^~~~~~~~~~~~                                          
Makefile:13870: recipe for target 'src/basic/libbasic_la-errno-list.lo' failed
make[2]: *** [src/basic/libbasic_la-errno-list.lo] Error 1 
make[2]: *** Waiting for unfinished jobs....                
In file included from ../src/basic/af-list.c:31:0:            
./src/basic/af-from-name.h:140:1: error: conflicting types for 'lookup_af'
 lookup_af (register const char *str, register size_t len)
 ^~~~~~~~~                                 
../src/basic/af-list.c:28:30: note: previous declaration of 'lookup_af' was here
 static const struct af_name* lookup_af(register const char *str, register unsigned int len);
                              ^~~~~~~~~                   
Makefile:13877: recipe for target 'src/basic/libbasic_la-af-list.lo' failed
make[2]: *** [src/basic/libbasic_la-af-list.lo] Error 1     
In file included from ../src/basic/arphrd-list.c:31:0:        
./src/basic/arphrd-from-name.h:125:1: error: conflicting types for 'lookup_arphrd'
 lookup_arphrd (register const char *str, register size_t len)        
 ^~~~~~~~~~~~~                                                        
../src/basic/arphrd-list.c:28:34: note: previous declaration of 'lookup_arphrd' was here
 static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
                                  ^~~~~~~~~~~~~
Makefile:13884: recipe for target 'src/basic/libbasic_la-arphrd-list.lo' failed

I'll try to look into it later.
Hi mad_ady,
The issue is related to gperf version,
https://github.com/systemd/systemd/issues/5039
and all "unsigned int" should be changed to "size_t".
The systemd that I used for petitboot is very old version, :(
( git clone git://anongit.freedesktop.org/systemd/systemd )
so I'm adjusting systemd build part since last week.
And trying petitboot and uInitrd image generation on ODROID-C2, the same issue occurs.

not yet completed, but you can refer to this flow.
https://github.com/JeonghwaCho/odroid_p ... _c2.sh#L38

Code: Select all

apt-get install meson

git clone https://github.com/systemd/systemd.git -b v239
cd systemd
mkdir build
cd build
meson --prefix=/usr -Dblkid=true -Dseccomp=false -Dlibcurl=false -Dpam=false -Dkmod=false -Dgcrypt=false -Delfutils=false -Dbacklight=false -Dlogind=false
ninja
( the build option will be changed... still under testing...)

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by mad_ady » Thu Nov 29, 2018 7:53 pm

Thanks, I'll try it.

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by mad_ady » Thu Nov 29, 2018 10:22 pm

After sorting out my missing kernel headers I hit other errors now (still in systemd):

Code: Select all

atic@sta/sd-path_sd-path.c.o' -c ../src/libsystemd/sd-path/sd-path.c      
In file included from ../src/basic/macro.h:5:0,                                                                                                                                                                
                 from ../src/basic/alloc-util.h:9,                                                                                                                                                             
                 from ../src/libsystemd/sd-path/sd-path.c:7:                                                                                                                                                   
/usr/local/include/linux/stddef.h:10:2: error: expected identifier before numeric constant                                                                                                                     
  false = 0,       
@joy: have you tried to compile it with gcc 7.3? (Ubuntu 18.04). Because debian had 6.x.
I'll see next week.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Fri Nov 30, 2018 8:18 am

mad_ady wrote: @joy: have you tried to compile it with gcc 7.3? (Ubuntu 18.04). Because debian had 6.x.
Actually Yes.
not with N1 debian, but with another system.
Ubuntu 18.04.1 and gcc version 7.3.0.
What's the difference between our environment?.......packages?.....
I will also try to reproduce it with a bare ubuntu version next week.

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Fri Nov 30, 2018 8:21 am

phaseshifter wrote:wiki guide step 2 kernel build typo eroor

Code: Select all

$ patch -p1 < 0001_n1_add_kexec.diff.zip
$ patch -p1 < 0002_n1_support_petitboot.diff.zip

should be

Code: Select all

$ patch -p1 < 0001_n1_add_kexec.diff
$ patch -p1 < 0002_n1_support_petitboot.diff
note also if you run auto config build you need to install this before you build the kernel...

Code: Select all

sudo apt-get install libssl-dev
Thank you, phaseshifter! updated!

joy
Posts: 843
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by joy » Fri Nov 30, 2018 8:29 am

I have some updates.
once updates done, I will update wiki page and share the link here next week.
1. kexec-tools version update to 2.0.18
2. run kexec default option on petitboot : add "--no-checks" to skip memory integrity checks of 2nd kernel for fast reboot

phaseshifter
Posts: 3431
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,
N-1,,N-2,...other odroid acc`s as well
Has thanked: 34 times
Been thanked: 37 times
Contact:

Re: BIOS design using PETITBOOT to support SPI booting

Unread post by phaseshifter » Fri Nov 30, 2018 10:53 am

quick question...

will the auto config-script be updated with all the new modd`s that have been done @ joy

also i`ve been running trough the whole process and i run into problems i guess that is because your still making changes.. i`ll run through the complete install to find any more typo`s if any ...??
in the meantime i`ll sit back and wait till you do your updated "wiki" guide...
thank`s phase...


EDIT ::::4-2 of the manual install not the kernel build.... to do the below you must be in this directorty../home/odroid/ramdisk_petitboot...hence i dont think the issuing of the copy command is in the correct directory for it to be copied..

i`m not shure weather this problem is//has been fixed/updated.etc...etc....but..here in manuall install

E.G../home/odroid/ramdisk_petitboot...in the below commands what directory is the copy command being issued....because it only referes to a file copy it does not state what directory that it is in when being processed /commanded..
E.G ...

Code: Select all

cd /home/odroid/ramdisk_petitboot
now from here it will copy the file correctly...but you must be in this directory..i dont know what directory it is in at it`s present stage...

Code: Select all

4-2. Copy uInitrd.igz and modify boot.ini

$ cp uInitrd.igz /media/boot/uInitrd.igz
should be

Code: Select all

$ cp uInitrd.igz /media/boot/
then removing uIntrd manually

Code: Select all

rm -rf /media/boot/uIntrd

thenn i had petitboot on my screen after doing this...
Last edited by phaseshifter on Fri Nov 30, 2018 12:23 pm, edited 1 time in total.
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest