9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Daniel Morandini <danielmorandini@me.com>
To: 9front@9front.org
Subject: Re: [9front] PXE booting Rpi
Date: Mon, 12 Apr 2021 18:48:02 +0200	[thread overview]
Message-ID: <45BD661C-F92C-4005-A71D-68E9CEB99DD6@me.com> (raw)
In-Reply-To: <633FF4EC79DF3B38CDE5E179107968A5@felloff.net>

> nonono. you have to save the R2 register on entry and get it to
> main. see the diff later.
> 
> nononono. KADDR() translates a physical address to the KZERO window
> of the kernel. like physical address 0 becomes (KZERO+0)... this
> for accessing memory (reading the DTB/ATAGS).
Sorry for these stupid questions, the code really is self explanatory

> i already said that bootargs.c in bcm/ is shared also by the bcm64
> kernel, where we pass the dtb pointer to it. but it is not used in
> the 32 bit bcm kernel. that is why there is a conditional. a pa
> of 0 means the address is not valid. its like a NULL check.

> theres also a special case that ATAGS are trashed on kernel-to-kernel
> reboot. so even on bcm64, pa can be 0 when the information has been
> converted to CONFADDR text block.
All clear now.

>> Just to learn something from a master, how are you debugging this?
>> I’m collecting data and dumping it as soon as print is ready!
> 
> thats pretty much how you do it.
> 
> anyway, heres how i checked what R2 is on entry. basically,
> move R2 to R10 (which is reserved by c code for the mach
> pointer so c code wont trash it). and then before calling
> main() put it in R0 (first arument).
This is so cool cinap, thank you for sharing! *.*

With patch attached and a `bootargsinit(arg0)` instead of 0 that’s
it, issue solved without `device_tree=` option! The fw loads a dtree
and we correctly load it from the proper address!

Cheers,
dan

  reply	other threads:[~2021-04-12 16:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 14:05 Daniel Morandini
2021-03-10 17:20 ` cinap_lenrek
2021-03-12 10:36   ` Daniel Morandini
2021-03-25 10:55     ` Daniel Morandini
2021-03-25 18:49       ` Noam Preil
2021-03-25 21:49         ` Noam Preil
2021-04-07  8:39         ` Daniel Morandini
2021-04-08 14:21           ` cinap_lenrek
2021-04-08 15:45             ` Daniel Morandini
2021-04-08 16:12               ` cinap_lenrek
2021-04-11 12:11                 ` cinap_lenrek
2021-04-12  9:04                   ` Daniel Morandini
2021-04-12 10:14                     ` cinap_lenrek
2021-04-12 16:48                       ` Daniel Morandini [this message]
2021-04-15 21:15                         ` cinap_lenrek
2021-04-19  7:53                           ` Daniel Morandini
2021-04-19 16:20                             ` Daniel Morandini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45BD661C-F92C-4005-A71D-68E9CEB99DD6@me.com \
    --to=danielmorandini@me.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).