LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 02-15-2019, 10:56 AM   #1
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 790

Rep: Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596
Updating U-Boot for Orange Pi H3


Moved discussion from this thread

Quote:
Originally Posted by SCerovec View Post
do i smell a Mac user here?
Not really sure what you mean there. You're proposing having the U-Boot files on a FAT partition. It's also what's documented here.

[snip]

Quote:
What does the Build your own latest kernel documentation say?
(there is a saying: "If the documentation is right the software has to be obsolete." )
Not heard that one. I like it!

Quote:
Maybe an big fat warning about "We're here to get You rolling only!" is in order?
And a link of where to start hacking on...
One person's rolling in to what it is they need that will take them where they want to go, is already another person's end state. The documentation states what it covers, and for anything else, discussions such as this ensue.

Quote:
Someone might get the impression ("supported devices") that Slackware is endorsing heavy loads for the vanilla install?
Slackware is a multi purpose OS, and the ARM port has always sought to be in line with that goal - which it is. It's not aimed at being used for embedded purposes or anything like that.

Quote:
we seem to have come to following boot edits:
1. offline (FAT is a benefit there)
2. off boot (save env has to work)
3. online (from the running system)
the more we make to work - the merrier, and less likely some ex_soviet_state hacker comes and rubs our noses about a single conf line we might have missed?
Yes it's probably a config option, looking at this:
https://patchwork.ozlabs.org/patch/214468/

However, the issue seems pretty clear now. With the new SD card images, writing U-Boot to the image is overwriting the FAT partition, as I can see by mounting the SD card.

Code:
root@kitt:~# mount /dev/sdd1 /mnt/floppy/
NTFS signature is missing.
Failed to mount '/dev/sdd1': Invalid argument
The device '/dev/sdd1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
I uploaded the new U-Boot stuff here

I need to spend some more time hacking on that to get it working, but it's probably almost there.
 
Old 02-15-2019, 11:33 AM   #2
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,495
Blog Entries: 2

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
so, in effect, the env was threading on the partition?

And the save to file didn't work yet?
 
Old 02-15-2019, 12:33 PM   #3
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 790

Original Poster
Rep: Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596
Quote:
Originally Posted by SCerovec View Post
so, in effect, the env was threading on the partition?

And the save to file didn't work yet?
The 'dd' of u-boot to the image is screwing up the FAT partition table; so the new script needs a bit of work.

I'm guessing that once that's fixed, saveenv will work.
 
Old 02-15-2019, 01:52 PM   #4
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,495
Blog Entries: 2

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by drmozes View Post
The 'dd' of u-boot to the image is screwing up the FAT partition table; so the new script needs a bit of work.

I'm guessing that once that's fixed, saveenv will work.
can't you just dd it and then partition and format afterward?

AFAIK the partitioning data and the dd overlap only in the "master boot record" and that is a simple thing or re-dd if needed?
 
Old 02-17-2019, 05:05 AM   #5
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 790

Original Poster
Rep: Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596
Making progress!

I've made an image with a FAT partition, and the latest u-boot.
It seems that if there's MMC (not SD card) even if there are no partitions, U-Boot restricts itself to looking on that device rather than the SD card.

So, I have put the SD card image on to the MMC and it works fine.

The next step is to figure out either why it doesn't check the SD card (it finds it using the u-boot mmc commands, and can load a file from the file system - so it all works), or to figure out how to hard code the device number of the SD card; although that's far from ideal either.

I'll probably upload this stuff next week.

Code:
U-Boot SPL 2019.04-rc1-dirty (Feb 16 2019 - 16:15:14 +0000)
DRAM: 2048 MiB
Trying to boot from MMC2


U-Boot 2019.04-rc1-dirty (Feb 16 2019 - 16:15:14 +0000) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi Plus 2E
DRAM:  2 GiB
MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
Loading Environment from FAT... OK
In:    serial
Out:   serial
Err:   serial
Net:   phy interface7
eth0: ethernet@1c30000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
USB4:   USB EHCI 1.00
USB5:   USB OHCI 1.0
USB6:   USB EHCI 1.00
USB7:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 2 USB Device(s) found
scanning bus 3 for devices... 1 USB Device(s) found
scanning bus 4 for devices... 1 USB Device(s) found
scanning bus 5 for devices... 1 USB Device(s) found
scanning bus 6 for devices... 1 USB Device(s) found
scanning bus 7 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0
=>
=> saveenv
Saving Environment to FAT... OK
 
Old 02-17-2019, 05:14 PM   #6
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,495
Blog Entries: 2

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
My MMC you mean MTD? (in the sense of board soldered on flash storage)

Only otheer option would be actual MMC card vs SD card?

If so, isn't the env code responsible for preference?

Or, eventually is there in the u-boot a hard coded order of preference?
 
Old 02-18-2019, 07:21 AM   #7
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 790

Original Poster
Rep: Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596
Quote:
Originally Posted by SCerovec View Post
My MMC you mean MTD? (in the sense of board soldered on flash storage)

Only otheer option would be actual MMC card vs SD card?

If so, isn't the env code responsible for preference?

Or, eventually is there in the u-boot a hard coded order of preference?
eMMC is embedded MMC, and MMC are for removables such as an SD Card.

I think I've cracked it now. It's hard coded to look at device 1 (eMMC), so I've patched it to be 0.
I'm not yet sure if device 1 becomes 0 if there's no SD card though, but it'll suffice for the need I'm addressing.
 
1 members found this post helpful.
Old 02-18-2019, 12:24 PM   #8
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,495
Blog Entries: 2

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Maybe note upstream (to make it configurable)?
 
Old 02-19-2019, 12:16 PM   #9
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 790

Original Poster
Rep: Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596
Quote:
Originally Posted by SCerovec View Post
Maybe note upstream (to make it configurable)?
It was just me misunderstanding what was going on.

It's sorted now! I've uploaded v2019.04-rc2 and have tested it with my Orange Pi Plus 2E. I've now got HDMI console working and am using X11.

I tried adding those U-Boot configurations you'd asked for, but they needed some more work.
The new SD card images have a single FAT partition - having more than 1 partition is a pain, and is likely to get broken if people faff around with the partition table anyway.
The only thing I'd like to get working is to be able to dump this SD card image to the eMMC, and have the possibility to live without the SD card (you'd still need it to boot the latest U-Boot, but once you'd installed the OS you could overwrite U-Boot on the eMMC).
To make it work, I had to configure U-Boot to look for its environment on 0:0 which means it doesn't work if there's no SD card.
The other option is to switch it back to saving the environment on to the MMC (meaning not writing it to a FAT file system: I believe the previous version of U-Boot wrote it to the eMMC directly), which should allow us to do that. I'm not in the mood for more U-Boot work now though!

Last edited by drmozes; 02-19-2019 at 12:25 PM.
 
Old 02-19-2019, 02:57 PM   #10
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,495
Blog Entries: 2

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Good work! Glad you've pushed it thru!

OTOH, ideally the u-boot would be aware what it booted from and store the environment to that media:
if eMMC is present -> eMMC
if booted from SD -> SD
if setup booted from SD -> to eMMC if present otherwise to SD if that makes any sense?
if setup booted from USB -> to eMMC, or SD card or USB in that order of preference

kind of (or the like)
 
Old 02-27-2019, 04:34 AM   #11
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 790

Original Poster
Rep: Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596Reputation: 596
Quote:
Originally Posted by SCerovec View Post
Good work! Glad you've pushed it thru!

OTOH, ideally the u-boot would be aware what it booted from and store the environment to that media:
if eMMC is present -> eMMC
if booted from SD -> SD
if setup booted from SD -> to eMMC if present otherwise to SD if that makes any sense?
if setup booted from USB -> to eMMC, or SD card or USB in that order of preference

kind of (or the like)
Sounds like a feature request for U-Boot!
I doubt U-Boot is able to know where it was originally loaded _from_ unless the ROM code passes that info to the SPL and into U-Boot proper.

Last edited by drmozes; 02-27-2019 at 04:36 AM.
 
Old 02-27-2019, 02:29 PM   #12
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,495
Blog Entries: 2

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
So far only the system can discern that - and act upon the fact

right?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Where are the kernel boot options kept for Slackware ARM on the Orange Pi? cupcake123 Slackware - ARM 4 01-19-2018 08:41 PM
Counter-strike,[color=orange]H L F - L I F E [/color],Counter-strike: Source. Dennisgoop Linux - Games 2 08-10-2004 03:03 AM
XFree86 display = ugly orange lines on dell 1100 eipo Linux - Laptop and Netbook 1 02-20-2004 09:46 PM
A Clockwork Orange dogn00dles General 9 02-28-2003 12:30 AM
Smoothwall orange nic Michael F Linux - Security 0 03-12-2002 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 11:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration