Youness Alaoui has posted comments on this change. ( https://review.coreboot.org/19849 )
Change subject: console/flashsconsole: Add spi flash console for debugging
......................................................................
Patch Set 2:
(13 comments)
tx_flush support added here : https://review.coreboot.org/19865
I'm working now on adding fmap support.
https://review.coreboot.org/#/c/19849/2//COMMIT_MSG
Commit Message:
PS2, Line 7: Adding
> Add
Done
PS2, Line 23: skylake
> Intel Skylake
Done
PS2, Line 26: fmap
> FMAP
Done
https://review.coreboot.org/#/c/19849/2/src/console/Kconfig
File src/console/Kconfig:
PS2, Line 242: region
> It's called "file" in CBFS (and I think "section" is more common for FMAP).
Ah yes, 'file' for CBFS, The API cbfs_locate_file_in_region() and the 'region_device' struct confused me in thinking it's called a 'region'. For FMAP, I used the 'area' naming because of the fmap_locate_area() API.
Line 258: region in the CBFS.
> Why define two mechanisms? The FMAP seems like a more appropriate place to
Two mechanisms because I don't really know much about how FMAP works, so I originally did it for CBFS (it was called cbfsconsole and renamed the APIs just yesterday). Aaron Durbin suggested FMAP is more appropriate, so I made it fmap-compatible (but not yet implemented), but there's no reason to throw about the cbfs-related code. Also, I think newbies (like me) will find it easier to do a 'cbfstool extract' than having to define a custom fmap, set it in the config, then use dd with specific offsets to copy out the console file from the rom. So.. using CBFS is just more convenient, and that's what I would use (and possibly other newbies), but Aaron (and possibly more advanced coreboot devs) would prefer to use FMAP.
Line 260: if CONSOLE_SPI_FLASH
> Just use depends on instead of this block.
Great idea. I copied this from the CONSOLE_CBMEM which uses an 'if'.
https://review.coreboot.org/#/c/19849/2/src/drivers/spi/Makefile.inc
File src/drivers/spi/Makefile.inc:
Line 22: | tr '\000' '\377' > $@
> Can't this go on a single line? Or at least the full dd piece?
Yes, the bs= was the long $(shell printf) line, which is why it was originally split. Once I moved it out into a variable, it became easier to fit in a single line.
https://review.coreboot.org/#/c/19849/2/src/drivers/spi/flashconsole.c
File src/drivers/spi/flashconsole.c:
Line 41: if (cbfs_boot_locate(&file, "console", NULL) == 0) {
> nit: probably looks better with
Will do, but I personally prefer it the way I did it.
And no lines go over 80 chars, so it's your gerrit I suppose.
Line 55: boot_device_init();
> Ya. I think we have almost every call that would touch the boot device in t
Yes, I know, but there's no guarantee that the prepare_program_locate API is calling it. Also, there's no guarantee the prepare_program_locate will be called/remain there (especially if we add FMAP support), so I preferred to keep the boot_device_init() call right next to the boot_device_rw() call in case of refactor. It's a no-op and it's safer, so let's keep it (also noticed it being redundantly called in existing parts of the code).
Line 60: * the end of a previous log write.
> You're banking on the fact that console output can never have legitimate 0x
That's a good point, and yes, I am assuming the console is for plaintext only, and any binary is printed using the hexdump APIs. Is that not the case? If not, then I can do it the way you suggested.
Line 121: for (i = 0; i < LINE_BUFFER_SIZE - 1; i++) {
> Why not just store the current index in a global as well, rather than searc
No idea. will do. thx
Line 129: if (len >= LINE_BUFFER_SIZE - 1 ||
> Why not tie this to tx_flush instead?
I copied the spiconsole.c as a base and it didn't have tx_flush, so I didn't think of it. I think adding tx_flush support in a separate commit would be better.
https://review.coreboot.org/#/c/19849/2/src/include/console/flash.h
File src/include/console/flash.h:
Line 25: #define __CONSOLE_FLASH_ENABLE__ IS_ENABLED(CONFIG_CONSOLE_SPI_FLASH)
> All the consoles that are actually used then...
Yeah, all the other consoles I saw used it this way, it's usually also used with (&& ENV_RAMSTAGE), stuff like that. And I used it a lot when the flashconsole was not working in romstage, then the expression got simplified to this.
--
To view, visit https://review.coreboot.org/19849
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I74a297b94f6881d8c27cbe5168f161d8331c3df3
Gerrit-PatchSet: 2
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Youness Alaoui <snifikino(a)gmail.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Youness Alaoui <snifikino(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-HasComments: Yes
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/19849
to look at the new patch set (#3).
Change subject: console/flashsconsole: Add spi flash console for debugging
......................................................................
console/flashsconsole: Add spi flash console for debugging
If CONSOLE_SPI_FLASH config is enabled, we can write the cbmem
messages to the 'console' region in CBFS which allows
us to grab the log when we read the flash.
This is useful when you don't have usb debugging, and
UART lines are hard to find. Since a failure to boot would
require a hardware flasher anyways, we can get the log
at the same time.
This feature should only be used when no alternative is
found and only when we can't boot the system, because
excessive writes to the flash is not recommended.
This has been tested on purism/librem13 v2 and librem 15 v3 which
run Intel Skylake hardware. It has not been tested on other archs
or with a driver other than the fast_spi.
The Kconfig help mentions support for writing to an FMAP area
but this isn't supported yet.
Change-Id: I74a297b94f6881d8c27cbe5168f161d8331c3df3
Signed-off-by: Youness Alaoui <youness.alaoui(a)puri.sm>
---
M src/console/Kconfig
M src/console/console.c
M src/drivers/spi/Makefile.inc
A src/drivers/spi/flashconsole.c
A src/include/console/flash.h
5 files changed, 245 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/19849/3
--
To view, visit https://review.coreboot.org/19849
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I74a297b94f6881d8c27cbe5168f161d8331c3df3
Gerrit-PatchSet: 3
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Youness Alaoui <snifikino(a)gmail.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/19861 )
Change subject: util/abuild: Start junit testcase block on kconfig failure
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://review.coreboot.org/19861
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I5f9083c346ac7b6502f854b7e1f1054e81954d76
Gerrit-PatchSet: 3
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-HasComments: No
Martin Roth has posted comments on this change. ( https://review.coreboot.org/19723 )
Change subject: soc/amd/stoneyridge: Add CPU files
......................................................................
Patch Set 3:
(6 comments)
https://review.coreboot.org/#/c/19723/3/src/northbridge/amd/pi/Kconfig
File src/northbridge/amd/pi/Kconfig:
Line 19: default y if SOC_AMD_PI
> Why are enabling northbridge/amd/pi under these circumstances? What's the l
Agreed - If we're moving things to SOC, why would we still need pieces in src/northbridge? Isn't the whole point of the SOC that it's all self-contained?
https://review.coreboot.org/#/c/19723/3/src/soc/amd/common/Kconfig
File src/soc/amd/common/Kconfig:
Line 13
As mentioned in the previous commit:
You might want to avoid the issues that are being seen currently in soc/intel/common and not have this Kconfig file here. The issue is that chips in soc/amd/[ab].* will be able to override defaults set in this file, but Kconfig files that get sourced later (soc/amd/[d-z].*) will NOT be able to override these defaults.
Because we're automatically sourcing soc/*/*/Kconfig, the order here can't be changed easily except by not having a Kconfig file in src/amd/common.
My recommendation would be to move this Kconfig (or this section of the Kconfig) to soc/amd/common/pi and source src/amd/common/*/Kconfig from the top level Kconfig at an appropriate point.
https://review.coreboot.org/#/c/19723/3/src/soc/amd/common/Makefile.inc
File src/soc/amd/common/Makefile.inc:
Line 13
I'd also recommend we avoid having files in soc/amd/common, and move them all into subdirectories for the the same reason. If we have files here, people are going to want a Kconfig here, and as previously mentioned, that creates problems.
https://review.coreboot.org/#/c/19723/3/src/soc/amd/common/cache_as_ram.inc
File src/soc/amd/common/cache_as_ram.inc:
PS3, Line 149:
change these tabs to spaces?
https://review.coreboot.org/#/c/19723/3/src/vendorcode/amd/Kconfig
File src/vendorcode/amd/Kconfig:
PS3, Line 4: 7
Updating Sage's copyright?
https://review.coreboot.org/#/c/19723/3/src/vendorcode/amd/pi/Kconfig
File src/vendorcode/amd/pi/Kconfig:
Line 29: if CPU_AMD_PI_00630F01 || CPU_AMD_PI_00730F01 || CPU_AMD_PI_00670F00_FP4 || CPU_AMD_PI_00670F00_FT4 || CPU_AMD_PI_00660F01 || SOC_AMD_STONEYRIDGE_FP4 || SOC_AMD_STONEYRIDGE_FT4
Wrap the line?
if CPU_AMD_PI_00630F01 || CPU_AMD_PI_00730F01 || \
CPU_AMD_PI_00670F00_FP4 || CPU_AMD_PI_00670F00_FT4 || \
CPU_AMD_PI_00660F01 || SOC_AMD_STONEYRIDGE_FP4 || \
SOC_AMD_STONEYRIDGE_FT4
--
To view, visit https://review.coreboot.org/19723
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8b6b1991372c2c6a02709777a73615a86e78ac26
Gerrit-PatchSet: 3
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Marc Jones <marc(a)marcjonesconsulting.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Marc Jones <marc(a)marcjonesconsulting.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-HasComments: Yes
Martin Roth has posted comments on this change. ( https://review.coreboot.org/19722 )
Change subject: soc: Add AMD StoneyRidge southbridge code
......................................................................
Patch Set 3:
(8 comments)
https://review.coreboot.org/#/c/19722/3/src/soc/amd/common/Kconfig
File src/soc/amd/common/Kconfig:
Line 5
You might want to avoid the issues that are being seen currently in soc/intel/common and not have this Kconfig file here. The issue is that chips in soc/amd/[ab].* will be able to override defaults set in this file, but Kconfig files that get sourced later (soc/amd/[d-z].*) will NOT be able to override these defaults.
Because we're automatically sourcing soc/*/*/Kconfig, the order here can't be changed easily except by not having a Kconfig file in src/amd/common.
I'd recommend not having any files in this directory, but if we do, you could help things by adding a comment here:
# Caution: Do NOT add any default values to this file.
# Default values here cannot be overridden by Kconfig files
# that are sourced later in the soc/amd directory.
My recommendation would be to move this Kconfig file to soc/amd/common/util or soc/amd/common/devices and source src/amd/common/*/Kconfig from the top level Kconfig at an appropriate point.
https://review.coreboot.org/#/c/19722/3/src/soc/amd/common/amd_pci_util.h
File src/soc/amd/common/amd_pci_util.h:
PS3, Line 16: AMD_PCI_UTIL_H
Update to SOC_AMD_PCI_UTIL_H?
https://review.coreboot.org/#/c/19722/3/src/soc/amd/stoneyridge/chip.c
File src/soc/amd/stoneyridge/chip.c:
Line 60:
extra line
https://review.coreboot.org/#/c/19722/3/src/soc/amd/stoneyridge/include/soc…
File src/soc/amd/stoneyridge/include/soc/hudson.h:
PS3, Line 17: STONEYRIDGE_H
Should the name of the file be updated?
https://review.coreboot.org/#/c/19722/3/src/soc/amd/stoneyridge/include/soc…
File src/soc/amd/stoneyridge/include/soc/pci_devs.h:
PS3, Line 74: #if IS_ENABLED(CONFIG_SOUTHBRIDGE_AMD_PI_BOLTON)
: #define IDE_DEV 0x14
: #define IDE_FUNC 1
: #define IDE_DEVID 0x780C
: #define IDE_DEVFN PCI_DEVFN(IDE_DEV,IDE_FUNC)
: #endif
remove?
PS3, Line 106: #if IS_ENABLED(CONFIG_SOUTHBRIDGE_AMD_PI_BOLTON)
: #define SB_PCIE_DEV 0x15
: #define SB_PCIE_PORT1_FUNC 0
: #define SB_PCIE_PORT2_FUNC 1
: #define SB_PCIE_PORT3_FUNC 2
: #define SB_PCIE_PORT4_FUNC 3
: #define SB_PCIE_PORT1_DEVID 0x7820
: #define SB_PCIE_PORT2_DEVID 0x7821
: #define SB_PCIE_PORT3_DEVID 0x7822
: #define SB_PCIE_PORT4_DEVID 0x7823
: #define SB_PCIE_PORT1_DEVFN PCI_DEVFN(SB_PCIE_DEV,SB_PCIE_PORT1_FUNC)
: #define SB_PCIE_PORT2_DEVFN PCI_DEVFN(SB_PCIE_DEV,SB_PCIE_PORT2_FUNC)
: #define SB_PCIE_PORT3_DEVFN PCI_DEVFN(SB_PCIE_DEV,SB_PCIE_PORT3_FUNC)
: #define SB_PCIE_PORT4_DEVFN PCI_DEVFN(SB_PCIE_DEV,SB_PCIE_PORT4_FUNC)
: #endif
remove?
https://review.coreboot.org/#/c/19722/3/src/soc/amd/stoneyridge/include/soc…
File src/soc/amd/stoneyridge/include/soc/smi.h:
PS3, Line 8: _SOUTHBRIDGE_AMD_PI_STONEYRIDGE_SMI_H
_SOC_AMD_PI_STONEYRIDGE_SMI_H
And could we be consistent about the naming on these? Some have no leading or trailing underscores, some have one, some have both.
https://review.coreboot.org/#/c/19722/3/src/soc/amd/stoneyridge/smbus.c
File src/soc/amd/stoneyridge/smbus.c:
PS3, Line 16: #ifndef _STONEYRIDGE_SMBUS_C_
: #define _STONEYRIDGE_SMBUS_C_
Let's not add another place where we're including a c file. These shouldn't be needed.
--
To view, visit https://review.coreboot.org/19722
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib88a868e654ad127be70ecc506f6b90b784f8d1b
Gerrit-PatchSet: 3
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Marc Jones <marc(a)marcjonesconsulting.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Marc Jones <marc(a)marcjonesconsulting.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-HasComments: Yes