libflash questions mostly relating to P9 bringup
Joel Stanley
joel at jms.id.au
Tue Oct 11 17:55:58 AEDT 2016
On Sat, Sep 24, 2016 at 11:41 AM, Xo Wang <xow at google.com> wrote:
> Hi folks,
>
> I'm under the impression for P9 bringup we're sticking with BMC-side
> MMIO to set up host PNOR access (as in what the host is booting from
> over LPC). I see—and agree—that we're not gonna have MTD working by
> the time we need to boot early machines:
> https://github.com/openbmc/openbmc/issues/553
We have mtd support written and in testing. I plan to land it this week.
I would like us to be able to disable /dev/mem access soon. pflash is
one area where we almost have the bits in place, so I think we should
push to go straight to the correct solution.
>
> What does libflash-based PNOR control look like? I mean the hacky way
> we're gonna use for the next month. This is how I *think* it works.
>
> booting the host:
> 1) the SMC SPI flash master auto-detects (?) how to read like the FMC
> 2) Swiss Army aspeed.c do_x_setup() enables LPC/AHB bridge to the SPI
> flash window
> Is that it? Doesn't involve MTD or pflash at all and it just works?
Yes, I think so.
>
> updating PNOR from BMC:
> 1) org.openbmc.control.Flash's update method calls op-flasher
> 2) org.openbmc.control.Flasher invokes libflash erase and program
> 3) libflash arch_flash_arm_io.h (?) and friends
> a. know how to talk to the flash controller (BMC_DIRECT)
> b. map AHB, GPIO, and SMC window from /dev/mem
> c. know the size of the host PNOR? (it looks hardcoded)
I suspect it uses the ffs header to determine the pnor size, but I do
not know that code well.
>
> updating PNOR from host:
> 1) whatever calls pflash on host
> 2) host libflash powerpc_io.c and friends poke BMC registers over LPC
> a. write whatever LPC stuff that turns on iLPC2AHB, then use that to
> set GPIO and SMC window to LPC for host access
> b. powerpc_io.c also overwrites the LPC/AHB bridge mapping (previous
> set by BMC kernel) with its own desired config
Hacky. Not really supported.
>
> Can somebody review that I got all this right? I saw some conflicting
> information in https://github.com/openbmc/linux/issues/51
>
> Other questions:
> - what's the plan for "booting the host" and "updating PNOR from BMC?"
We plan to expose the contents with an in-memory copy of the firmware.
> - is it worth extending the current libflash to read BMC & PNOR size,
> window, etc from device tree?
> - what does arch_flash_powerpc.c do? It looks like a whole other
> access method with a host-side MTD device.
>
> thanks
> xo
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc
More information about the openbmc
mailing list