* Question about Guix on Novena - mainly U-Boot
@ 2020-12-04 18:49 Danny Milosavljevic
2020-12-04 19:15 ` Danny Milosavljevic
2020-12-05 0:33 ` Denis 'GNUtoo' Carikli
0 siblings, 2 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2020-12-04 18:49 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]
Hi,
I'm still in the process of setting up the Novena as a GNU Mes for ARM build
machine.
Guix system on Novena from sd card finally works.
Now I want to make it boot it from SATA instead.
So I did the following:
(1) Used cp -a to copy over everything from the sd card / to the sata drive
partition 2 (ext4 fs).
(2) Fixed up /etc/config.scm to say to install u-boot into target "/dev/sda".
(3) mounted /dev, /dev/pts, /sys, /proc and then chroot /mnt guix system
reconfigure /etc/config.scm
(4) Used novena-eeprom to enable booting from SATA according to
https://novena-guide.readthedocs.io/en/latest/tasks.html
(5) Power off
(6) Take sd card out
(7) Power on
(8) u-boot prompt on Novena serial line never appears
If I instead try to boot Guix from the SATA drive via the u-boot that's on the
microsd card, that fails too, probably because of the patch
https://lists.denx.de/pipermail/u-boot/2008-December/044716.html
That attempt was like this:
(1) Copy the hard drive's /boot/extlinux/extlinux.conf to the microsd's
/boot/extlinux/extlinux.conf, overwriting the latter
(2) Reboot into u-boot-from-the-sd-card
(3) Wait for autoboot in u-boot to commence
(4) It fails to read the initrd (or anything else) from SATA, eventually
failovers to sd card boot because there's still an old guix generation for it
So instead I did this:
(1) Stop autoboot
(2) Execute: sata init
(3) Execute: part list sata 0 -bootable devplist
(4) Execute: run sata_boot
Then it indeed boots Guix from sata starting from the u-boot from microsd.
But I cannot keep it like this because if there's a power outage and restore,
the build server won't come back up correctly.
Help?
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about Guix on Novena - mainly U-Boot
2020-12-04 18:49 Question about Guix on Novena - mainly U-Boot Danny Milosavljevic
@ 2020-12-04 19:15 ` Danny Milosavljevic
2020-12-05 0:33 ` Denis 'GNUtoo' Carikli
1 sibling, 0 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2020-12-04 19:15 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]
For reference, the config.scm I used was:
(use-modules (gnu) (gnu bootloader u-boot))
(use-service-modules networking ssh desktop)
(use-package-modules bootloaders screen ssh linux)
;;; Note: Maybe better: linux-libre-arm-generic
;;; Note: Novena upstream uses Kernel 3.19
(operating-system
(host-name "novena")
(timezone "Europe/Vienna")
(locale "en_US.utf8")
(kernel-arguments '("console=ttymxc1,115200"))
(initrd-modules (cons* "sdhci-esdhc-imx" "ahci_imx" "sd_mod" "i2c-dev" %base-initrd-modules))
(bootloader (bootloader-configuration
(bootloader u-boot-novena-bootloader)
(target "/dev/sda")))
(file-systems (cons (file-system
(device (file-system-label "novena-root"))
(mount-point "/")
(type "ext4"))
%base-file-systems))
(packages (append (list screen openssh) %base-packages))
(services (append (list (service dhcp-client-service-type)
(service openssh-service-type)
(service elogind-service-type))
%base-services)))
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Question about Guix on Novena - mainly U-Boot
@ 2020-12-05 0:08 Stefan
0 siblings, 0 replies; 4+ messages in thread
From: Stefan @ 2020-12-05 0:08 UTC (permalink / raw)
To: Danny Milosavljevic, guix-devel
Hi Danny!
You may want to try to set "CONFIG_PREBOOT=\"usb start; sata init; part list sata 0 -bootable devplist\"". I do something similar to execute "dhcp" to enable booting via tftp.
Maybe take a look at my recent patch¹ as well, which aims to ease such configuration changes.
Bye
Stefan
¹ https://lists.gnu.org/archive/html/guix-patches/2020-12/msg00145.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about Guix on Novena - mainly U-Boot
2020-12-04 18:49 Question about Guix on Novena - mainly U-Boot Danny Milosavljevic
2020-12-04 19:15 ` Danny Milosavljevic
@ 2020-12-05 0:33 ` Denis 'GNUtoo' Carikli
1 sibling, 0 replies; 4+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-12-05 0:33 UTC (permalink / raw)
To: Danny Milosavljevic; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 2746 bytes --]
On Fri, 4 Dec 2020 19:49:37 +0100
Danny Milosavljevic <dannym@scratchpost.org> wrote:>
> Now I want to make it boot it from SATA instead.
The question is what "boot from SATA" means here, it could mean
different things:
- Have u-boot on the microSD card and load the rootfs from the SATA
HDD/SSD.
- Make the bootrom load u-boot from the SATA HDD/SSD.
Luckily the I.MX6 SOC is capable of loading u-boot from a SATA HDD/SSD
but it needs to be configured for that.
However it looks like the novena-eeprom utility only somehow does the
former:
https://github.com/xobs/novena-eeprom/blob/master/novena-eeprom.h
In addition I'm unsure if upstream u-boot can parse the sataroot flag
as I didn't find it but I only looked very rapidely and not on the
latest source code.
To configure the I.MX6 SOC to boot from a SATA HDD/SSD you'll have to
dig in the I.MX6Q reference manual and the schematics of the novena to
see how it is configured.
- You have fuses that select a boot mode
- One of the boot mode selected by the fuses configuration enables GPIO
overrides (this is what we want here).
So with the reference manual and the schematics depending on the
fuses configurations, you could be able to understand the boot order of
the SOC (which peripherals it tries to load u-boot from and in which
order).
And if it's set in GPIO override mode and that the GPIOs are routed to
some switch or jumpers, you can probably manage to change the way it
boots and make sure it tries to load u-boot from the SATA HDD/SSD.
The u-boot source code also may have documentation about that. Some
boards (like the TBS2910) have some documentation on how they are
configured to boot. Since I didn't find the novena in doc/boards, you
might still have some luck if there is some more generic documentation
about booting devices with I.MX6Q.
If the Novena can't boot from SATA as-is, you could try to see if there
isn't a way through the configuration headers to configure the bootrom
to try to boot on SATA somehow. That configuration header (DCD) will
probably need to be on a peripheral that the bootrom tries to boot on.
Booting of I2C eeproms is possible on I.MX6 but again you'll have to
check the documentation to see if it satisfies all requirements
(including if the eeprom is wired to the proper I2C controller
and/or pads to be able to be read from the bootrom).
If not in the worst case you will probably need some minimal code on a
peripheral the bootrom tries to load code from.
There is probably some resources for the Novena (Forums, IRC channels
etc) that already have all theses answers but in any case understanding
a bit of the context here could help parse the answers.
Denis.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-05 12:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-04 18:49 Question about Guix on Novena - mainly U-Boot Danny Milosavljevic
2020-12-04 19:15 ` Danny Milosavljevic
2020-12-05 0:33 ` Denis 'GNUtoo' Carikli
-- strict thread matches above, loose matches on Subject: below --
2020-12-05 0:08 Stefan
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).