x86: Add support for samus
Subsystems (10)
cover x86: Add support for samus
This series adds support for samus, the Chromebook Pixel 2015. Since it is only the second board added that does not use an FSP, there is quite a bit of refactoring involved to avoid code duplication.
Samus uses roughly the same binary blobs as link, except now there is one more called the reference code binary. The only available binary for this is a coreboot 'rmodule' extracted from flash. This is a simplified ELF format so it fairly easy to load and use.
It is also possible to boot U-Boot from coreboot on samus. This works well but for a delay for non-existent IDE on start-up. The standard build does not work with binaries taken from flash, so it isn't easy to replicate this - you'll just have to take my word for it. I am working on getting that figured out - coreboot recently gained upstream support for loading U-Boot as a payload, so it should be possible to get this working nicely before long.
In any case much of the code comes from coreboot - individual files are credited with their source.
Perhaps the main value of this series is the improved non-FSP support and additions for broadwell, which samus uses. It should make it easier to add support for future non-FSP platforms.
Simon Glass (69):
dm: timer: Correct timer init ordering after relocation
arm: Add a 64-bit division routine to the private library
dhry: Correct dhrystone calculation for fast machines
syscon: Avoid returning a device on failure
video: Allow simple-panel to be used without regulators
cpu: Add support for microcode version and CPU ID
gpio: Add a function to obtain a GPIO vector value
gpio: Use const where possible
pci: Add functions to update PCI configuration registers
pci: Correct a few comments and nits
input: i8042: Make sure the keyboard is enabled
malloc_simple: Add a little more debugging
x86: Allow use of serial soon after relocation
x86: cpu: Make the vendor table const
x86: cpu: Add functions to return the family and stepping
x86: Move cache-as-RAM code into a common location
x86: Move microcode code to a common location
x86: Create a common header for Intel register access
x86: Add the root-complex block to common intel registers
x86: Move common LPC code to its own place
x86: Add some more common MSR indexes
x86: Move common CPU code to its own place
x86: Rename PORT_RESET to IO_PORT_RESET
x86: Move Intel Management Engine code to a common place
x86: ivybridge: Drop sandybridge_early_init()
x86: Move common PCH code into a common place
x86: link: Add required GPIO properties
x86: dts: link: Move SPD info into the memory controller
x86: dts: link: Add board ID GPIOs
x86: gpio: Correct GPIO setup ordering
x86: Add common SDRAM-init code
x86: ivybridge: Convert to use the common SDRAM code
x86: dts: Drop memory SPD compatible string
x86: Add a script to aid code conversion from coreboot
x86: Correct duplicate POST values
x86: Add macros to clear and set I/O bits
x86: Allow I/O functions to use pointers
x86: Move common MRC Kconfig options to the common file
x86: Tidy up mp_init to reduce duplication
x86: Record the CPU details when starting each core
x86: ivybridge: Show microcode version for each code
x86: Add comments to the SIPI vector
x86: Update microcode for secondary CPUs
x86: link: Add pin configuration to the device tree
x86: Add an ICH6 pin configuration driver
x86: gpio: Allow the pinctrl driver to set up the pin config
x86: Drop all the old pin configuration code
x86: Add support for running Intel reference code
x86: dts: Update the pinctrl binding a little
x86: Add basic support for broadwell
x86: broadwell: Add a few microcode files
x86: broadwell: Add a PCH driver
x86: broadwell: Add a pinctrl driver
x86: broadwell: Add a SATA driver
x86: broadwell: Add a northbridge driver
x86: broadwell: Add an LPC driver
x86: broadwell: Add reference code support
x86: broadwell: Add power-control support
x86: broadwell: Add support for SDRAM setup
x86: broadwell: Add a GPIO driver
x86: broadwell: Add support for high-speed I/O lane with ME
x86: Support a chained-boot development flow
x86: broadwell: Add video support
x86: Add a default address for reference code
x86: Use white on black for the console on chromebooks
x86: Update README for new developments
x86: Add a function to set the IOAPIC ID
x86: Fix a header nit in x86-chromebook.h
x86: Add support for the samus chromebook
Makefile | 14 +-
arch/arm/lib/Makefile | 3 +-
arch/arm/lib/_uldivmod.S | 245 ++++
arch/x86/Kconfig | 51 +
arch/x86/cpu/Makefile | 2 +
arch/x86/cpu/broadwell/Kconfig | 30 +
arch/x86/cpu/broadwell/Makefile | 17 +
arch/x86/cpu/broadwell/cpu.c | 761 +++++++++++
arch/x86/cpu/broadwell/iobp.c | 144 +++
arch/x86/cpu/broadwell/lpc.c | 77 ++
arch/x86/cpu/broadwell/me.c | 57 +
arch/x86/cpu/broadwell/northbridge.c | 59 +
arch/x86/cpu/broadwell/pch.c | 540 ++++++++
arch/x86/cpu/broadwell/pinctrl_broadwell.c | 278 ++++
arch/x86/cpu/broadwell/power_state.c | 89 ++
arch/x86/cpu/broadwell/refcode.c | 108 ++
arch/x86/cpu/broadwell/sata.c | 269 ++++
arch/x86/cpu/broadwell/sdram.c | 307 +++++
arch/x86/cpu/cpu.c | 17 +-
arch/x86/cpu/intel_common/Makefile | 16 +
arch/x86/cpu/{ivybridge => intel_common}/car.S | 4 +-
arch/x86/cpu/intel_common/cpu_common.c | 111 ++
arch/x86/cpu/intel_common/lpc_common.c | 102 ++
.../cpu/{ivybridge => intel_common}/me_status.c | 20 +-
.../{ivybridge => intel_common}/microcode_intel.c | 6 +-
arch/x86/cpu/intel_common/pch_common.c | 25 +
.../{ivybridge => intel_common}/report_platform.c | 2 +-
arch/x86/cpu/intel_common/sdram_common.c | 271 ++++
arch/x86/cpu/ioapic.c | 16 +
arch/x86/cpu/ivybridge/Kconfig | 27 +-
arch/x86/cpu/ivybridge/Makefile | 4 -
arch/x86/cpu/ivybridge/bd82x6x.c | 17 +-
arch/x86/cpu/ivybridge/cpu.c | 86 +-
arch/x86/cpu/ivybridge/early_me.c | 31 +-
arch/x86/cpu/ivybridge/gma.c | 1 +
arch/x86/cpu/ivybridge/lpc.c | 77 +-
arch/x86/cpu/ivybridge/model_206ax.c | 8 +-
arch/x86/cpu/ivybridge/northbridge.c | 5 +-
arch/x86/cpu/ivybridge/sata.c | 47 +-
arch/x86/cpu/ivybridge/sdram.c | 400 ++----
arch/x86/cpu/mp_init.c | 90 +-
arch/x86/cpu/sipi_vector.S | 1 +
arch/x86/cpu/start.S | 79 ++
arch/x86/dts/Makefile | 1 +
arch/x86/dts/chromebook_link.dts | 379 ++++--
arch/x86/dts/chromebook_samus.dts | 628 +++++++++
arch/x86/dts/microcode/m7240651_0000001c.dtsi | 1328 ++++++++++++++++++++
arch/x86/dts/microcode/mc0306d4_00000018.dtsi | 944 ++++++++++++++
arch/x86/include/asm/arch-broadwell/cpu.h | 48 +
arch/x86/include/asm/arch-broadwell/gpio.h | 91 ++
arch/x86/include/asm/arch-broadwell/iomap.h | 53 +
arch/x86/include/asm/arch-broadwell/lpc.h | 32 +
arch/x86/include/asm/arch-broadwell/me.h | 200 +++
arch/x86/include/asm/arch-broadwell/pch.h | 153 +++
arch/x86/include/asm/arch-broadwell/pei_data.h | 177 +++
arch/x86/include/asm/arch-broadwell/pm.h | 129 ++
arch/x86/include/asm/arch-broadwell/rcb.h | 58 +
arch/x86/include/asm/arch-broadwell/spi.h | 87 ++
arch/x86/include/asm/arch-ivybridge/me.h | 333 +----
arch/x86/include/asm/arch-ivybridge/model_206ax.h | 17 -
arch/x86/include/asm/arch-ivybridge/pch.h | 62 -
arch/x86/include/asm/arch-ivybridge/sandybridge.h | 7 -
arch/x86/include/asm/cpu.h | 27 +
arch/x86/include/asm/cpu_common.h | 35 +
arch/x86/include/asm/global_data.h | 24 +
arch/x86/include/asm/gpio.h | 138 +-
arch/x86/include/asm/intel_regs.h | 28 +
arch/x86/include/asm/io.h | 34 +-
arch/x86/include/asm/ioapic.h | 2 +
arch/x86/include/asm/lpc_common.h | 59 +
arch/x86/include/asm/me_common.h | 372 ++++++
.../include/asm/{arch-ivybridge => }/microcode.h | 12 +
arch/x86/include/asm/msr-index.h | 41 +-
arch/x86/include/asm/pch_common.h | 56 +
arch/x86/include/asm/post.h | 4 +-
arch/x86/include/asm/processor.h | 2 +-
arch/x86/include/asm/report_platform.h | 19 +
arch/x86/include/asm/sdram_common.h | 56 +
arch/x86/include/asm/sipi.h | 1 +
arch/x86/lib/Makefile | 1 +
arch/x86/lib/fsp/fsp_car.S | 2 +
arch/x86/lib/pinctrl_ich6.c | 216 ++++
board/coreboot/coreboot/coreboot.c | 5 -
board/efi/efi-x86/efi.c | 5 -
board/google/Kconfig | 13 +
board/google/chromebook_link/link.c | 138 --
board/google/chromebook_samus/Kconfig | 40 +
board/google/chromebook_samus/MAINTAINERS | 6 +
board/google/chromebook_samus/Makefile | 7 +
board/google/chromebook_samus/samus.c | 18 +
board/google/chromebox_panther/panther.c | 4 -
board/intel/bayleybay/bayleybay.c | 5 -
board/intel/cougarcanyon2/cougarcanyon2.c | 6 +-
board/intel/crownbay/crownbay.c | 5 -
board/intel/galileo/galileo.c | 5 -
board/intel/minnowmax/minnowmax.c | 8 -
cmd/cpu.c | 7 +
common/board_f.c | 7 +
common/board_r.c | 4 +-
common/malloc_simple.c | 7 +-
configs/bayleybay_defconfig | 2 +
configs/chromebook_samus_defconfig | 51 +
configs/cougarcanyon2_defconfig | 2 +
configs/crownbay_defconfig | 2 +
configs/galileo_defconfig | 2 +
configs/minnowmax_defconfig | 6 +-
doc/README.x86 | 106 +-
.../gpio/intel,x86-broadwell-pinctrl.txt | 208 +++
.../gpio/intel,x86-pinctrl.txt | 22 +-
drivers/core/syscon-uclass.c | 1 +
drivers/gpio/Kconfig | 9 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-uclass.c | 26 +-
drivers/gpio/intel_broadwell_gpio.c | 198 +++
drivers/gpio/intel_ich6_gpio.c | 191 +--
drivers/input/i8042.c | 6 +
drivers/pci/pci-uclass.c | 58 +-
drivers/serial/serial-uclass.c | 1 +
drivers/video/Kconfig | 14 +-
drivers/video/Makefile | 2 +
drivers/video/broadwell_igd.c | 797 ++++++++++++
drivers/video/i915_reg.h | 362 ++++++
drivers/video/simple_panel.c | 18 +-
include/asm-generic/gpio.h | 20 +-
include/configs/chromebook_samus.h | 29 +
include/configs/x86-chromebook.h | 8 +-
include/cpu.h | 5 +
include/dt-bindings/gpio/x86-gpio.h | 12 +
include/fdtdec.h | 2 -
include/pci.h | 29 +-
lib/dhry/cmd_dhry.c | 8 +-
lib/fdtdec.c | 2 -
scripts/coreboot.sed | 17 +
133 files changed, 11158 insertions(+), 1719 deletions(-)
create mode 100644 arch/arm/lib/_uldivmod.S
create mode 100644 arch/x86/cpu/broadwell/Kconfig
create mode 100644 arch/x86/cpu/broadwell/Makefile
create mode 100644 arch/x86/cpu/broadwell/cpu.c
create mode 100644 arch/x86/cpu/broadwell/iobp.c
create mode 100644 arch/x86/cpu/broadwell/lpc.c
create mode 100644 arch/x86/cpu/broadwell/me.c
create mode 100644 arch/x86/cpu/broadwell/northbridge.c
create mode 100644 arch/x86/cpu/broadwell/pch.c
create mode 100644 arch/x86/cpu/broadwell/pinctrl_broadwell.c
create mode 100644 arch/x86/cpu/broadwell/power_state.c
create mode 100644 arch/x86/cpu/broadwell/refcode.c
create mode 100644 arch/x86/cpu/broadwell/sata.c
create mode 100644 arch/x86/cpu/broadwell/sdram.c
create mode 100644 arch/x86/cpu/intel_common/Makefile
rename arch/x86/cpu/{ivybridge => intel_common}/car.S (98%)
create mode 100644 arch/x86/cpu/intel_common/cpu_common.c
create mode 100644 arch/x86/cpu/intel_common/lpc_common.c
rename arch/x86/cpu/{ivybridge => intel_common}/me_status.c (93%)
rename arch/x86/cpu/{ivybridge => intel_common}/microcode_intel.c (98%)
create mode 100644 arch/x86/cpu/intel_common/pch_common.c
rename arch/x86/cpu/{ivybridge => intel_common}/report_platform.c (98%)
create mode 100644 arch/x86/cpu/intel_common/sdram_common.c
create mode 100644 arch/x86/dts/chromebook_samus.dts
create mode 100644 arch/x86/dts/microcode/m7240651_0000001c.dtsi
create mode 100644 arch/x86/dts/microcode/mc0306d4_00000018.dtsi
create mode 100644 arch/x86/include/asm/arch-broadwell/cpu.h
create mode 100644 arch/x86/include/asm/arch-broadwell/gpio.h
create mode 100644 arch/x86/include/asm/arch-broadwell/iomap.h
create mode 100644 arch/x86/include/asm/arch-broadwell/lpc.h
create mode 100644 arch/x86/include/asm/arch-broadwell/me.h
create mode 100644 arch/x86/include/asm/arch-broadwell/pch.h
create mode 100644 arch/x86/include/asm/arch-broadwell/pei_data.h
create mode 100644 arch/x86/include/asm/arch-broadwell/pm.h
create mode 100644 arch/x86/include/asm/arch-broadwell/rcb.h
create mode 100644 arch/x86/include/asm/arch-broadwell/spi.h
create mode 100644 arch/x86/include/asm/cpu_common.h
create mode 100644 arch/x86/include/asm/intel_regs.h
create mode 100644 arch/x86/include/asm/lpc_common.h
create mode 100644 arch/x86/include/asm/me_common.h
rename arch/x86/include/asm/{arch-ivybridge => }/microcode.h (63%)
create mode 100644 arch/x86/include/asm/pch_common.h
create mode 100644 arch/x86/include/asm/report_platform.h
create mode 100644 arch/x86/include/asm/sdram_common.h
create mode 100644 arch/x86/lib/pinctrl_ich6.c
create mode 100644 board/google/chromebook_samus/Kconfig
create mode 100644 board/google/chromebook_samus/MAINTAINERS
create mode 100644 board/google/chromebook_samus/Makefile
create mode 100644 board/google/chromebook_samus/samus.c
create mode 100644 configs/chromebook_samus_defconfig
create mode 100644 doc/device-tree-bindings/gpio/intel,x86-broadwell-pinctrl.txt
create mode 100644 drivers/gpio/intel_broadwell_gpio.c
create mode 100644 drivers/video/broadwell_igd.c
create mode 100644 drivers/video/i915_reg.h
create mode 100644 include/configs/chromebook_samus.h
create mode 100644 scripts/coreboot.sedSignature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 1/69 dm: timer: Correct timer init ordering after relocation
Commit 1057e6c broke use of the timer with driver model. If the timer is used before relocation, then it becomes broken after relocation. This prevents some x86 boards from booting. Fix it.
---
common/board_r.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
common/board_r.c +3 -1
@@ -318,11 +318,13 @@ static int initr_dm(void)/* Save the pre-reloc driver model and start a new one */ gd->dm_root_f = gd->dm_root; gd->dm_root =NULL ; +#ifdef CONFIG_TIMER + gd->timer =NULL ; +#endif ret =dm_init_and_scan (false);if (ret)return ret;#ifdef CONFIG_TIMER_EARLY - gd->timer =NULL ; ret =dm_timer_init ();if (ret)return ret;
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 1/69 dm: timer: Correct timer init ordering after relocation
Hi Simon,
Quoted 3 lines · Simon Glass
Commit 1057e6c broke use of the timer with driver model. If the timer is used before relocation, then it becomes broken after relocation. This prevents some x86 boards from booting. Fix it.
Isn't the broken due to gd not initialized to zero?
Quoted 19 lines
Fixes 1057e6c (timer: Set up the real timer after driver model is available)Signed-off-by Simon Glass <[email protected]>---
common/board_r.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)common/board_r.c +2
-0@@ -318,11 +318,13 @@ static int initr_dm(void)/* Save the pre-reloc driver model and start a new one */ gd->dm_root_f = gd->dm_root; gd->dm_root =NULL ; +#ifdef CONFIG_TIMER + gd->timer =NULL ;
common/board_r.c static int initr_dm(void)
Quoted 10 lines
common/board_r.c +1
-2+#endif ret =dm_init_and_scan (false);if (ret)return ret;#ifdef CONFIG_TIMER_EARLY - gd->timer =NULL ; ret =dm_timer_init ();if (ret)return ret; --
Regards,
Bin
PATCH 1/69 dm: timer: Correct timer init ordering after relocation
Hi Bin,
Quoted 8 lines · Bin Meng
Hi Simon,
Quoted 3 lines · Simon Glass
Commit 1057e6c broke use of the timer with driver model. If the timer is used before relocation, then it becomes broken after relocation. This prevents some x86 boards from booting. Fix it.
Isn't the broken due to gd not initialized to zero?
No, gd is not set to 0. It is jtus that the timer must be recreated after relocation. By setting gd->timer to NULL we ensure this.
Quoted 25 lines
Quoted 25 lines
Fixes 1057e6c (timer: Set up the real timer after driver model is available)Signed-off-by Simon Glass <[email protected]>---
common/board_r.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)common/board_r.c +3
-0@@ -318,11 +318,13 @@ static int initr_dm(void)/* Save the pre-reloc driver model and start a new one */ gd->dm_root_f = gd->dm_root; gd->dm_root =NULL ; +#ifdef CONFIG_TIMER + gd->timer =NULL ; +#endif ret =dm_init_and_scan (false);if (ret)return ret;#ifdef CONFIG_TIMER_EARLY
Quoted 8 lines
common/board_r.c static int initr_dm(void)
Quoted 5 lines
common/board_r.c +0
-2- gd->timer =NULL ; ret =dm_timer_init ();if (ret)return ret; --Regards,
Bin
Regards,
Simon
PATCH 2/69 arm: Add a 64-bit division routine to the private library
In reply to Simon GlassThis is missing, with causes lldiv() to fail on boards with use the private libgcc. Add the missing routine.
Code is available for using the CLZ instruction but it is not enabled at present.
---
arch/arm/lib/Makefile | 3 +- arch/arm/lib/_uldivmod.S | 245 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 arch/arm/lib/_uldivmod.S
arch/arm/lib/Makefile +2 -1
@@ -6,7 +6,8 @@ # lib-$(CONFIG_USE_PRIVATE_LIBGCC) += _ashldi3.o _ashrdi3.o _divsi3.o \ - _lshrdi3.o _modsi3.o _udivsi3.o _umodsi3.o div0.o + _lshrdi3.o _modsi3.o _udivsi3.o _umodsi3.o div0.o \ + _uldivmod.o ifdef CONFIG_CPU_V7M obj-y += vectors_m.o crt0.o
arch/arm/lib/_uldivmod.S new file +245 -0
245 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 2/69 arm: Add a 64-bit division routine to the private library
Quoted 5 lines · Simon Glass
This is missing, with causes
lldiv()to fail on boards with use the private libgcc. Add the missing routine.Code is available for using the CLZ instruction but it is not enabled at present.
Mention the rev of coreboot we pull this file in from please, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160308/4de1ca7e/attachment.sig>
PATCH 3/69 dhry: Correct dhrystone calculation for fast machines
In reply to Simon GlassAt present samus reports about 5600 DMIPS. With the default iteration count this is OK, but if 10 million runs are performed it overflows. Fix it.
---
lib/dhry/cmd_dhry.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
lib/dhry/cmd_dhry.c +5 -3
@@ -6,11 +6,13 @@#include <common.h> #include <command.h> +#include <div64.h> #include "dhry.h" static int do_dhry (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -ulong start, duration, dhry_per_sec, vax_mips; +ulong start, duration, vax_mips; +u64 dhry_per_sec;int iterations =1000000 ;if (argc >1 )
@@ -19,10 +21,10 @@ static int do_dhry(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) start =get_timer (0 );dhry (iterations); duration =get_timer (start); - dhry_per_sec = iterations *1000 / duration; + dhry_per_sec =lldiv (iterations *1000ULL , duration); vax_mips = dhry_per_sec /1757 ;printf ("%d iterations in %lu ms: %lu/s, %lu DMIPS\n" , iterations, - duration, dhry_per_sec, vax_mips); + duration, (ulong )dhry_per_sec, vax_mips);return 0 ; }
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 4/69 syscon: Avoid returning a device on failure
In reply to Simon GlassIf the device cannot be probed, syscon_get_by_driver_data() will still return a useful value in its devp parameter. Ensure that it returns NULL instead.
---
drivers/core/syscon-uclass.c | 1 + 1 file changed, 1 insertion(+)
drivers/core/syscon-uclass.c +1 -0
@@ -38,6 +38,7 @@ int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp)struct uclass *uc;int ret; + *devp =NULL ; ret =uclass_get (UCLASS_SYSCON , &uc);if (ret)return ret;
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 4/69 syscon: Avoid returning a device on failure
Hi Simon,
Quoted 3 lines · Simon Glass
If the device cannot be probed,
syscon_get_by_driver_data()will still return a useful value in its devp parameter. Ensure that it returns NULL instead.
Shouldn't this be the caller's bug, that caller must check the return value?
Quoted 12 lines
Signed-off-by Simon Glass <[email protected]>---
drivers/core/syscon-uclass.c | 1 + 1 file changed, 1 insertion(+)drivers/core/syscon-uclass.c +0
-0
drivers/core/syscon-uclass.c int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp)
Quoted 8 lines
drivers/core/syscon-uclass.c +1
-1@@ -38,6 +38,7 @@ int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp)struct uclass *uc;int ret; + *devp =NULL ; ret =uclass_get (UCLASS_SYSCON , &uc);if (ret)return ret; --
Regards,
Bin
PATCH 4/69 syscon: Avoid returning a device on failure
Hi Bin,
Quoted 8 lines · Bin Meng
Hi Simon,
Quoted 3 lines · Simon Glass
If the device cannot be probed,
syscon_get_by_driver_data()will still return a useful value in its devp parameter. Ensure that it returns NULL instead.Shouldn't this be the caller's bug, that caller must check the return value?
Yes but it is confusing to return a valid device and also return an error. I'm trying to make the function cleaner.
Quoted 16 lines
Quoted 16 lines
Signed-off-by Simon Glass <[email protected]>---
drivers/core/syscon-uclass.c | 1 + 1 file changed, 1 insertion(+)drivers/core/syscon-uclass.c +0
-0@@ -38,6 +38,7 @@ int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp)struct uclass *uc;int ret;
Quoted 8 lines
drivers/core/syscon-uclass.c int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp)
Quoted 5 lines
drivers/core/syscon-uclass.c +1
-1+ *devp =NULL ; ret =uclass_get (UCLASS_SYSCON , &uc);if (ret)return ret; --Regards,
Bin
Regards,
Simon
PATCH 5/69 video: Allow simple-panel to be used without regulators
In reply to Simon GlassAt present simple-panel requires regulator support and will not build without it. But some panels do not have a power supply, or at least not one that can be controlled. Update the implementation to cope with this.
---
drivers/video/simple_panel.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/video/simple_panel.c +10 -8
@@ -38,13 +38,15 @@ static int simple_panel_ofdata_to_platdata(struct udevice *dev)struct simple_panel_priv *priv =dev_get_priv (dev);int ret; - ret =uclass_get_device_by_phandle (UCLASS_REGULATOR , dev, -"power-supply" , &priv->reg); -if (ret) { -debug ("%s: Warning: cnnot get power supply: ret=%d\n" , - __func__, ret); -if (ret != -ENOENT ) -return ret; +if (IS_ENABLED (CONFIG_DM_REGULATOR )) { + ret =uclass_get_device_by_phandle (UCLASS_REGULATOR , dev, +"power-supply" , &priv->reg); +if (ret) { +debug ("%s: Warning: cnnot get power supply: ret=%d\n" , + __func__, ret); +if (ret != -ENOENT ) +return ret; + } } ret =uclass_get_device_by_phandle (UCLASS_PANEL_BACKLIGHT , dev,"backlight" , &priv->backlight);
@@ -69,7 +71,7 @@ static int simple_panel_probe(struct udevice *dev)struct simple_panel_priv *priv =dev_get_priv (dev);int ret; -if (priv->reg) { +if (IS_ENABLED (CONFIG_DM_REGULATOR ) && priv->reg) {debug ("%s: Enable regulator '%s'\n" , __func__, priv->reg->name); ret =regulator_set_enable (priv->reg, true);if (ret)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 5/69 video: Allow simple-panel to be used without regulators
Hi Simon,
Quoted 5 lines · On Sun, 6 Mar 2016 19:27:48 -0700 Simon Glass sjg at chromium.org wrote:
At present simple-panel requires regulator support and will not build without it. But some panels do not have a power supply, or at least not one that can be controlled. Update the implementation to cope with this.
Signed-off-by Simon Glass <[email protected]>
--
Anatolij
PATCH 5/69 video: Allow simple-panel to be used without regulators
Quoted 5 lines · Anatolij Gustschin
Hi Simon,
On Sun, 6 Mar 2016 19:27:48 -0700
Simon Glass sjg at chromium.org wrote:
Quoted 7 lines
Quoted 5 lines
At present simple-panel requires regulator support and will not build without it. But some panels do not have a power supply, or at least not one that can be controlled. Update the implementation to cope with this.
Signed-off-by Simon Glass <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 6/69 cpu: Add support for microcode version and CPU ID
In reply to Simon GlassSome CPUs use microcode and each core can have a different version of microcode loaded. Also some CPUs support the concept of an integer ID used for identification purposes. Add support for these in the CPU uclass.
---
cmd/cpu.c | 7 +++++++ include/cpu.h | 5 +++++ 2 files changed, 12 insertions(+)
cmd/cpu.c +7 -0
@@ -14,6 +14,7 @@static const char *cpu_feature_name[CPU_FEAT_COUNT ] = {"L1 cache" ,"MMU" , +"Microcode" , };static int print_cpu_list (bool detail)
@@ -58,6 +59,12 @@ static int print_cpu_list(bool detail) } }printf ("\n" ); +if (info.features & (1 <<CPU_FEAT_UCODE )) { +printf ("\tMicrocode version %#x\n" , + plat->ucode_version); + } +if (info.features & (1 <<CPU_FEAT_DEVICE_ID )) +printf ("\tDevice ID %#lx\n" , plat->device_id); }return 0 ;
include/cpu.h +5 -0
@@ -15,15 +15,20 @@* device. * * @cpu_id: Platform-specific way of identifying the CPU. +* @ucode_version: Microcode version, if CPU_FEAT_UCODE is set */ struct cpu_platdata {int cpu_id; +int ucode_version; +ulong device_id; };/* CPU features - mostly just a placeholder for now */ enum {CPU_FEAT_L1_CACHE =0 ,/* Supports level 1 cache */ CPU_FEAT_MMU =1 ,/* Supports virtual memory */ +CPU_FEAT_UCODE =2 ,/* Requires/uses microcode */ +CPU_FEAT_DEVICE_ID =3 ,/* Provides a device ID */ CPU_FEAT_COUNT , };
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 6/69 cpu: Add support for microcode version and CPU ID
Quoted 11 lines · Simon Glass
Some CPUs use microcode and each core can have a different version of microcode loaded. Also some CPUs support the concept of an integer ID used for identification purposes. Add support for these in the CPU uclass.
Signed-off-by Simon Glass <[email protected]>---
cmd/cpu.c | 7 +++++++ include/cpu.h | 5 +++++ 2 files changed, 12 insertions(+)
PATCH 6/69 cpu: Add support for microcode version and CPU ID
Quoted 8 lines · Bin Meng
Quoted 7 lines · Simon Glass
Some CPUs use microcode and each core can have a different version of microcode loaded. Also some CPUs support the concept of an integer ID used for identification purposes. Add support for these in the CPU uclass.
Signed-off-by Simon Glass <[email protected]>---
Quoted 6 lines
Quoted 4 lines
cmd/cpu.c | 7 +++++++ include/cpu.h | 5 +++++ 2 files changed, 12 insertions(+)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 7/69 gpio: Add a function to obtain a GPIO vector value
In reply to Simon GlassWe can use GPIOs as binary digits for reading 'strapping' values. Each GPIO is assigned a single bit and can be set high or low on the circuit board. We already have a legacy function for reading these values. Add one that supports driver model.
---
drivers/gpio/gpio-uclass.c | 18 ++++++++++++++++++ include/asm-generic/gpio.h | 12 ++++++++++++ 2 files changed, 30 insertions(+)
drivers/gpio/gpio-uclass.c +18 -0
@@ -577,6 +577,24 @@ int gpio_get_values_as_int(const int *gpio_list)return vector; } +int dm_gpio_get_values_as_int (struct gpio_desc *desc_list,int count) +{ +unsigned bitmask =1 ; +unsigned vector =0 ; +int ret, i; + +for (i =0 ; i < count; i++) { + ret =dm_gpio_get_value (&desc_list[i]); +if (ret <0 ) +return ret; +else if (ret) + vector |= bitmask; + bitmask <<=1 ; + } + +return vector; +} + static int _gpio_request_by_name_nodev(const void *blob, int node, const char *list_name, int index, struct gpio_desc *desc, int flags,
include/asm-generic/gpio.h +12 -0
@@ -360,6 +360,18 @@ int gpio_lookup_name(const char *name, struct udevice **devp,int gpio_get_values_as_int (const int *gpio_list);/** +* dm_gpio_get_values_as_int() - Turn the values of a list of GPIOs into an int +* +* This puts the value of the first GPIO into bit 0, the second into bit 1, +* etc. then returns the resulting integer. +* +* @desc_list: List of GPIOs to collect +* @count: Number of GPIOs +* @return resulting integer value, or -ve on error +*/ +int dm_gpio_get_values_as_int (struct gpio_desc *desc_list,int count); + +/** * gpio_claim_vector() - claim a number of GPIOs for input * * @gpio_num_array: array of gpios to claim, terminated by -1
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 7/69 gpio: Add a function to obtain a GPIO vector value
Quoted 5 lines · Simon Glass
We can use GPIOs as binary digits for reading 'strapping' values. Each GPIO is assigned a single bit and can be set high or low on the circuit board. We already have a legacy function for reading these values. Add one that supports driver model.
Quoted 7 lines
Signed-off-by Simon Glass <[email protected]>---
drivers/gpio/gpio-uclass.c | 18 ++++++++++++++++++ include/asm-generic/gpio.h | 12 ++++++++++++ 2 files changed, 30 insertions(+)
PATCH 7/69 gpio: Add a function to obtain a GPIO vector value
Quoted 9 lines · Bin Meng
Quoted 8 lines · Simon Glass
We can use GPIOs as binary digits for reading 'strapping' values. Each GPIO is assigned a single bit and can be set high or low on the circuit board. We already have a legacy function for reading these values. Add one that supports driver model.
Signed-off-by Simon Glass <[email protected]>---
Quoted 6 lines
Quoted 4 lines
drivers/gpio/gpio-uclass.c | 18 ++++++++++++++++++ include/asm-generic/gpio.h | 12 ++++++++++++ 2 files changed, 30 insertions(+)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 8/69 gpio: Use const where possible
In reply to Simon GlassSome functions do not change the struct gpio_desc parameter. Update these to use const so this is clear.
---
drivers/gpio/gpio-uclass.c | 10 +++++----- include/asm-generic/gpio.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/gpio/gpio-uclass.c +5 -5
@@ -257,7 +257,7 @@ int gpio_free(unsigned gpio)return _dm_gpio_free (desc.dev, desc.offset); } -static int check_reserved (struct gpio_desc *desc,const char *func) +static int check_reserved (const struct gpio_desc *desc,const char *func) {struct gpio_dev_priv *uc_priv;
@@ -324,7 +324,7 @@ int gpio_direction_output(unsigned gpio, int value) desc.offset, value); } -int dm_gpio_get_value (struct gpio_desc *desc) +int dm_gpio_get_value (const struct gpio_desc *desc) {int value;int ret;
@@ -338,7 +338,7 @@ int dm_gpio_get_value(struct gpio_desc *desc)return desc->flags &GPIOD_ACTIVE_LOW ? !value : value; } -int dm_gpio_set_value (struct gpio_desc *desc,int value) +int dm_gpio_set_value (const struct gpio_desc *desc,int value) {int ret;
@@ -577,7 +577,7 @@ int gpio_get_values_as_int(const int *gpio_list)return vector; } -int dm_gpio_get_values_as_int (struct gpio_desc *desc_list,int count) +int dm_gpio_get_values_as_int (const struct gpio_desc *desc_list,int count) {unsigned bitmask =1 ;unsigned vector =0 ;
@@ -766,7 +766,7 @@ static int gpio_renumber(struct udevice *removed_dev)return 0 ; } -int gpio_get_number (struct gpio_desc *desc) +int gpio_get_number (const struct gpio_desc *desc) {struct udevice *dev = desc->dev;struct gpio_dev_priv *uc_priv;
include/asm-generic/gpio.h +5 -5
@@ -133,7 +133,7 @@ struct gpio_desc {* previously returned by gpio_request_by_name() * @return true if valid, false if not */ -static inline bool dm_gpio_is_valid (struct gpio_desc *desc) +static inline bool dm_gpio_is_valid (const struct gpio_desc *desc) {return desc->dev !=NULL ; }
@@ -369,7 +369,7 @@ int gpio_get_values_as_int(const int *gpio_list);* @count: Number of GPIOs * @return resulting integer value, or -ve on error */ -int dm_gpio_get_values_as_int (struct gpio_desc *desc_list,int count); +int dm_gpio_get_values_as_int (const struct gpio_desc *desc_list,int count);/** * gpio_claim_vector() - claim a number of GPIOs for input
@@ -536,9 +536,9 @@ int gpio_free_list_nodev(struct gpio_desc *desc, int count);* previously returned by gpio_request_by_name() * @return GPIO value (0 for inactive, 1 for active) or -ve on error */ -int dm_gpio_get_value (struct gpio_desc *desc); +int dm_gpio_get_value (const struct gpio_desc *desc); -int dm_gpio_set_value (struct gpio_desc *desc,int value); +int dm_gpio_set_value (const struct gpio_desc *desc,int value);/** * dm_gpio_set_dir() - Set the direction for a GPIO
@@ -577,6 +577,6 @@ int dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags);* previously returned by gpio_request_by_name() * @return GPIO number, or -ve if not found */ -int gpio_get_number (struct gpio_desc *desc); +int gpio_get_number (const struct gpio_desc *desc);#endif /* _ASM_GENERIC_GPIO_H_ */
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 8/69 gpio: Use const where possible
Quoted 10 lines · Simon Glass
Some functions do not change the struct
gpio_descparameter. Update these to use const so this is clear.Signed-off-by Simon Glass <[email protected]>---
drivers/gpio/gpio-uclass.c | 10 +++++----- include/asm-generic/gpio.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-)
PATCH 8/69 gpio: Use const where possible
Quoted 7 lines · Bin Meng
Quoted 6 lines · Simon Glass
Some functions do not change the struct
gpio_descparameter. Update these to use const so this is clear.Signed-off-by Simon Glass <[email protected]>---
Quoted 6 lines
Quoted 4 lines
drivers/gpio/gpio-uclass.c | 10 +++++----- include/asm-generic/gpio.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 9/69 pci: Add functions to update PCI configuration registers
In reply to Simon GlassIt is common to read a config register value, clear and set some bits, then write back the updated value. Add functions to do this in one step, for convenience.
---
drivers/pci/pci-uclass.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ include/pci.h | 23 +++++++++++++++++++ 2 files changed, 80 insertions(+)
drivers/pci/pci-uclass.c +57 -0
@@ -252,6 +252,21 @@ int pci_bus_write_config(struct udevice *bus, pci_dev_t bdf, int offset,return ops->write_config (bus, bdf, offset, value, size); } +int pci_bus_clrset_config32 (struct udevice *bus,pci_dev_t bdf,int offset, +u32 clr,u32 set) +{ +ulong val; +int ret; + + ret =pci_bus_read_config (bus, bdf, offset, &val,PCI_SIZE_32 ); +if (ret) +return ret; + val &= ~clr; + val |= set; + +return pci_bus_write_config (bus, bdf, offset, val,PCI_SIZE_32 ); +} +int pci_write_config (pci_dev_t bdf,int offset,unsigned long value,enum pci_size_t size) {
@@ -420,6 +435,48 @@ int dm_pci_read_config32(struct udevice *dev, int offset, u32 *valuep)return 0 ; } +int dm_pci_clrset_config8 (struct udevice *dev,int offset,u32 clr,u32 set) +{ +u8 val; +int ret; + + ret =dm_pci_read_config8 (dev, offset, &val); +if (ret) +return ret; + val &= ~clr; + val |= set; + +return dm_pci_write_config8 (dev, offset, val); +} + +int dm_pci_clrset_config16 (struct udevice *dev,int offset,u32 clr,u32 set) +{ +u16 val; +int ret; + + ret =dm_pci_read_config16 (dev, offset, &val); +if (ret) +return ret; + val &= ~clr; + val |= set; + +return dm_pci_write_config16 (dev, offset, val); +} + +int dm_pci_clrset_config32 (struct udevice *dev,int offset,u32 clr,u32 set) +{ +u32 val; +int ret; + + ret =dm_pci_read_config32 (dev, offset, &val); +if (ret) +return ret; + val &= ~clr; + val |= set; + +return dm_pci_write_config32 (dev, offset, val); +} +static void set_vga_bridge_bits (struct udevice *dev) {struct udevice *parent = dev->parent;
include/pci.h +23 -0
@@ -1027,6 +1027,21 @@ int pci_bus_write_config(struct udevice *bus, pci_dev_t bdf, int offset, unsigned long value, enum pci_size_t size);/** +* pci_bus_clrset_config32() - Update a configuration value for a device +* +* The register at @offset is updated to (oldvalue & ~clr) | set. +* +* @bus: Bus to access +* @bdf: PCI device address: bus, device and function -see PCI_BDF() +* @offset: Register offset to update +* @clr: Bits to clear +* @set: Bits to set +* @return 0 if OK, -ve on error +*/ +int pci_bus_clrset_config32 (struct udevice *bus,pci_dev_t bdf,int offset, +u32 clr,u32 set); + +/** * Driver model PCI config access functions. Use these in preference to others * when you have a valid device */
@@ -1044,6 +1059,14 @@ int dm_pci_write_config8(struct udevice *dev, int offset, u8 value);int dm_pci_write_config16 (struct udevice *dev,int offset,u16 value);int dm_pci_write_config32 (struct udevice *dev,int offset,u32 value); +/** +* These permit convenient read/modify/write on PCI configuration. The +* register is updated to (oldvalue & ~clr) | set. +*/ +int dm_pci_clrset_config8 (struct udevice *dev,int offset,u32 clr,u32 set); +int dm_pci_clrset_config16 (struct udevice *dev,int offset,u32 clr,u32 set); +int dm_pci_clrset_config32 (struct udevice *dev,int offset,u32 clr,u32 set); +/* * The following functions provide access to the above without needing the * size parameter. We are trying to encourage the use of the 8/16/32-style
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 9/69 pci: Add functions to update PCI configuration registers
Quoted 11 lines · Simon Glass
It is common to read a config register value, clear and set some bits, then write back the updated value. Add functions to do this in one step, for convenience.
Signed-off-by Simon Glass <[email protected]>---
drivers/pci/pci-uclass.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ include/pci.h | 23 +++++++++++++++++++ 2 files changed, 80 insertions(+)
PATCH 9/69 pci: Add functions to update PCI configuration registers
Quoted 8 lines · Bin Meng
Quoted 7 lines · Simon Glass
It is common to read a config register value, clear and set some bits, then write back the updated value. Add functions to do this in one step, for convenience.
Signed-off-by Simon Glass <[email protected]>---
Quoted 6 lines
Quoted 4 lines
drivers/pci/pci-uclass.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ include/pci.h | 23 +++++++++++++++++++ 2 files changed, 80 insertions(+)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 10/69 pci: Correct a few comments and nits
In reply to Simon GlassTwo comments are missing a parameter and there is an extra blank line. Also two of the region access macros are misnamed. Correct these problems.
---
drivers/pci/pci-uclass.c | 1 - include/pci.h | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/pci/pci-uclass.c +0 -1
@@ -291,7 +291,6 @@ int dm_pci_write_config(struct udevice *dev, int offset, unsigned long value, size); } -int pci_write_config32 (pci_dev_t bdf,int offset,u32 value) {return pci_write_config (bdf, offset, value,PCI_SIZE_32 );
include/pci.h +4 -2
@@ -1007,6 +1007,7 @@ int dm_pci_hose_probe_bus(struct udevice *bus);* * @bus: Bus to read from * @bdf: PCI device address: bus, device and function -see PCI_BDF() +* @offset: Register offset to read * @valuep: Place to put the returned value * @size: Access size * @return 0 if OK, -ve on error
@@ -1019,6 +1020,7 @@ int pci_bus_read_config(struct udevice *bus, pci_dev_t bdf, int offset,* * @bus: Bus to write from * @bdf: PCI device address: bus, device and function -see PCI_BDF() +* @offset: Register offset to write * @value: Value to write * @size: Access size * @return 0 if OK, -ve on error
@@ -1260,9 +1262,9 @@ void *dm_pci_map_bar(struct udevice *dev, int bar, int flags);#define dm_pci_mem_to_virt (dev, addr, len, map_flags) \ dm_pci_bus_to_virt((dev), (addr), PCI_REGION_MEM, (len), (map_flags))#define dm_pci_virt_to_io (dev, addr) \ - dm_dm_pci_virt_to_bus((dev), (addr), PCI_REGION_IO) + dm_pci_virt_to_bus((dev), (addr), PCI_REGION_IO)#define dm_pci_io_to_virt (dev, addr, len, map_flags) \ - dm_dm_pci_bus_to_virt((dev), (addr), PCI_REGION_IO, (len), (map_flags)) + dm_pci_bus_to_virt((dev), (addr), PCI_REGION_IO, (len), (map_flags))/** * dm_pci_find_device() - find a device by vendor/device ID
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 10/69 pci: Correct a few comments and nits
Quoted 10 lines · Simon Glass
Two comments are missing a parameter and there is an extra blank line. Also two of the region access macros are misnamed. Correct these problems.
Signed-off-by Simon Glass <[email protected]>---
drivers/pci/pci-uclass.c | 1 - include/pci.h | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-)
PATCH 10/69 pci: Correct a few comments and nits
Quoted 7 lines · Bin Meng
Quoted 6 lines · Simon Glass
Two comments are missing a parameter and there is an extra blank line. Also two of the region access macros are misnamed. Correct these problems.
Signed-off-by Simon Glass <[email protected]>---
Quoted 6 lines
Quoted 4 lines
drivers/pci/pci-uclass.c | 1 - include/pci.h | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 11/69 input: i8042: Make sure the keyboard is enabled
In reply to Simon GlassAdd one more step into the init sequence. This fixes the keyboard on samus, which otherwise does not work.
---
drivers/input/i8042.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/input/i8042.c +6 -0
@@ -128,6 +128,12 @@ static int kbd_reset(int quirk)if (kbd_cmd_read (CMD_SELF_TEST ) !=KBC_TEST_OK ) goto err; +if (kbd_write (I8042_DATA_REG ,0xf4 ) || +kbd_read (I8042_DATA_REG ) !=KBD_ACK ) { +debug ("Keyboard enable failed ACK\n" ); + goto err; + } +/* keyboard reset */ if (kbd_write(I8042_DATA_REG, CMD_RESET_KBD) || kbd_read(I8042_DATA_REG) != KBD_ACK ||
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 11/69 input: i8042: Make sure the keyboard is enabled
Hi Simon,
Quoted 14 lines · Simon Glass
Add one more step into the init sequence. This fixes the keyboard on samus, which otherwise does not work.
Signed-off-by Simon Glass <[email protected]>---
drivers/input/i8042.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/input/i8042.c +0
-0
drivers/input/i8042.c static int kbd_reset(int quirk) · line 131
Quoted 4 lines
drivers/input/i8042.c +1
-0@@ -128,6 +128,12 @@ static int kbd_reset(int quirk)if (kbd_cmd_read (CMD_SELF_TEST ) !=KBC_TEST_OK ) goto err; + if (kbd_write(I8042_DATA_REG, 0xf4) ||
We should use macro for 0xf4. 0xf4 is a command to drain output buffer, but the debug printf says "enable failed"? It's not a keyboard enable command. And I suspect this command should be put after sending CMD_RESET_KBD, which is a more natural sequence. Can you try that?
drivers/input/i8042.c static int kbd_reset(int quirk)
Quoted 9 lines
drivers/input/i8042.c +5
-1+ kbd_read(I8042_DATA_REG) != KBD_ACK) { +debug ("Keyboard enable failed ACK\n" ); + goto err; + } +/* keyboard reset */ if (kbd_write(I8042_DATA_REG, CMD_RESET_KBD) || kbd_read(I8042_DATA_REG) != KBD_ACK || --
Regards,
Bin
PATCH 12/69 malloc_simple: Add a little more debugging
In reply to Simon GlassOutput the pointer returned by each call to malloc(). This can be useful when debugging memory problems.
---
common/malloc_simple.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
common/malloc_simple.c +5 -2
@@ -19,12 +19,15 @@ void *malloc_simple(size_t bytes)void *ptr; new_ptr = gd->malloc_ptr + bytes; -debug ("%s: size=%zx, ptr=%lx, limit=%lx\n" , __func__, bytes, new_ptr, +debug ("%s: size=%zx, ptr=%lx, limit=%lx: " , __func__, bytes, new_ptr, gd->malloc_limit); -if (new_ptr > gd->malloc_limit) +if (new_ptr > gd->malloc_limit) { +debug ("space exhausted\n" );return NULL ; + } ptr =map_sysmem (gd->malloc_base + gd->malloc_ptr, bytes); gd->malloc_ptr =ALIGN (new_ptr,sizeof (new_ptr)); +debug ("%lx\n" , (ulong )ptr);return ptr; }
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 12/69 malloc_simple: Add a little more debugging
Quoted 9 lines · Simon Glass
Output the pointer returned by each call to
malloc(). This can be useful when debugging memory problems.Signed-off-by Simon Glass <[email protected]>---
common/malloc_simple.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
PATCH 12/69 malloc_simple: Add a little more debugging
Quoted 4 lines · Bin Meng
Quoted 3 lines · Simon Glass
Output the pointer returned by each call to
malloc(). This can be useful when debugging memory problems.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Simon Glass <[email protected]>---
common/malloc_simple.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 13/69 x86: Allow use of serial soon after relocation
In reply to Simon GlassAt present on x86 machines with use cache-as-RAM, the memory goes away just before board_init_r() is called. This means that serial drivers are no-longer unavailable, until initr_dm() it called, etc.
Any attempt to use printf() within this period will cause a hang.
To fix this, mark the serial devices as 'unavailable' when it is no-longer available. Bring it back when serial_initialize() is called. This means that the debug UART will be used instead for this period.
---
common/board_f.c | 7 +++++++ drivers/serial/serial-uclass.c | 1 + 2 files changed, 8 insertions(+)
common/board_f.c +7 -0
@@ -1096,6 +1096,13 @@ void board_init_f_r(void)hang ();/* +* The pre-relocation drivers may be using memory that has now gone +* away. Mark serial as unavailable - this will fall back to the debug +* UART if available. +*/ + gd->flags &= ~GD_FLG_SERIAL_READY ; + +/* * U-Boot has been copied into SDRAM, the BSS has been cleared etc. * Transfer execution from Flash to RAM by calculating the address * of the in-RAM copy of board_init_r() and calling it
drivers/serial/serial-uclass.c +1 -0
@@ -116,6 +116,7 @@ int serial_init(void)void serial_initialize (void ) {serial_find_console_or_panic (); + gd->flags |=GD_FLG_SERIAL_READY ; }static void _serial_putc (struct udevice *dev,char ch)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 13/69 x86: Allow use of serial soon after relocation
Hi Simon,
Quoted 22 lines · Simon Glass
At present on x86 machines with use cache-as-RAM, the memory goes away just before
board_init_r()is called. This means that serial drivers are no-longer unavailable, untilinitr_dm()it called, etc.Any attempt to use
printf()within this period will cause a hang.To fix this, mark the serial devices as 'unavailable' when it is no-longer available. Bring it back when
serial_initialize()is called. This means that the debug UART will be used instead for this period.Signed-off-by Simon Glass <[email protected]>---
common/board_f.c | 7 +++++++ drivers/serial/serial-uclass.c | 1 + 2 files changed, 8 insertions(+)common/board_f.c +0
-0
common/board_f.c void board_init_f_r(void) · line 1104
Quoted 9 lines
common/board_f.c +6
-0@@ -1096,6 +1096,13 @@ void board_init_f_r(void)hang ();/* +* The pre-relocation drivers may be using memory that has now gone +* away. Mark serial as unavailable - this will fall back to the debug +* UART if available. +*/ + gd->flags &= ~GD_FLG_SERIAL_READY ; +
What about other architectures (non-X86 and non-ARC)?
drivers/serial/serial-uclass.c int serial_init(void) · line 119
Quoted 13 lines
common/board_f.c +1
-0+/* * U-Boot has been copied into SDRAM, the BSS has been cleared etc. * Transfer execution from Flash to RAM by calculating the address * of the in-RAM copy of board_init_r() and calling it drivers/serial/serial-uclass.c +1
-0@@ -116,6 +116,7 @@ int serial_init(void)void serial_initialize (void ) {serial_find_console_or_panic (); + gd->flags |=GD_FLG_SERIAL_READY ;
I think we can simply replace this to:
void serial_initialize(void)
{
serial_init();
}Regards,
Bin
PATCH 13/69 x86: Allow use of serial soon after relocation
Hi Bin,
Quoted 27 lines · Bin Meng
Hi Simon,
Quoted 24 lines · Simon Glass
At present on x86 machines with use cache-as-RAM, the memory goes away just before
board_init_r()is called. This means that serial drivers are no-longer unavailable, untilinitr_dm()it called, etc.Any attempt to use
printf()within this period will cause a hang.To fix this, mark the serial devices as 'unavailable' when it is no-longer available. Bring it back when
serial_initialize()is called. This means that the debug UART will be used instead for this period.Signed-off-by Simon Glass <[email protected]>---
common/board_f.c | 7 +++++++ drivers/serial/serial-uclass.c | 1 + 2 files changed, 8 insertions(+)common/board_f.c +0
-0@@ -1096,6 +1096,13 @@ void board_init_f_r(void)hang ();
Quoted 9 lines
common/board_f.c void board_init_f_r(void) · line 1104
Quoted 7 lines
common/board_f.c +6
-0/* +* The pre-relocation drivers may be using memory that has now gone +* away. Mark serial as unavailable - this will fall back to the debug +* UART if available. +*/ + gd->flags &= ~GD_FLG_SERIAL_READY ; +What about other architectures (non-X86 and non-ARC)?
This problem hasn't happened on any ARM chip I am aware of. I am pretty sure it is x86-specific.
Quoted 17 lines
Quoted 10 lines
common/board_f.c +1
-0+/* * U-Boot has been copied into SDRAM, the BSS has been cleared etc. * Transfer execution from Flash to RAM by calculating the address * of the in-RAM copy of board_init_r() and calling it drivers/serial/serial-uclass.c +0
-0drivers/serial/serial-uclass.c int serial_init(void) · line 119
Quoted 4 lines
drivers/serial/serial-uclass.c +1
-0@@ -116,6 +116,7 @@ int serial_init(void)void serial_initialize (void ) {serial_find_console_or_panic (); + gd->flags |=GD_FLG_SERIAL_READY ;I think we can simply replace this to:
Quoted 4 lines
void
serial_initialize(void){ serial_init(); }
OK.
Regards,
Simon
PATCH 14/69 x86: cpu: Make the vendor table const
In reply to Simon GlassThis does not need to be modified at run-time, so make it const.
---
arch/x86/cpu/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/cpu/cpu.c +1 -1
@@ -71,7 +71,7 @@ struct cpuinfo_x86 {* List of cpu vendor strings along with their normalized * id values. */ -static struct { +static const struct {int vendor;const char *name; } x86_vendors[] = {
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 14/69 x86: cpu: Make the vendor table const
Quoted 8 lines · Simon Glass
This does not need to be modified at run-time, so make it const.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 14/69 x86: cpu: Make the vendor table const
Quoted 11 lines · Bin Meng
Quoted 8 lines · Simon Glass
This does not need to be modified at run-time, so make it const.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 15/69 x86: cpu: Add functions to return the family and stepping
In reply to Simon GlassThese two identifiers can be useful for drivers which need to adjust their behaviour depending on the CPU family or stepping (revision).
---
arch/x86/cpu/cpu.c | 10 ++++++++++ arch/x86/include/asm/cpu.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+)
arch/x86/cpu/cpu.c +10 -0
@@ -333,6 +333,16 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) c->x86_model += ((tfms >>16 ) &0xF ) <<4 ; } +u32 cpu_get_family_model (void ) +{ +return gd->arch.x86_device &0x0fff0ff0 ; +} + +u32 cpu_get_stepping (void ) +{ +return gd->arch.x86_device &0xf ; +} +int x86_cpu_init_f (void ) {const u32 em_rst = ~X86_CR0_EM ;
arch/x86/include/asm/cpu.h +14 -0
@@ -260,4 +260,18 @@ void cpu_call32(ulong code_seg32, ulong target, ulong table);*/ int cpu_jump_to_64bit (ulong setup_base,ulong target); +/** +* cpu_get_family_model() - Get the family and model for the CPU +* +* @return the CPU ID masked with 0x0fff0ff0 +*/ +u32 cpu_get_family_model (void ); + +/** +* cpu_get_stepping() - Get the stepping value for the CPU +* +* @return the CPU ID masked with 0xf +*/ +u32 cpu_get_stepping (void ); +#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 15/69 x86: cpu: Add functions to return the family and stepping
Hi Simon,
Quoted 15 lines · Simon Glass
These two identifiers can be useful for drivers which need to adjust their behaviour depending on the CPU family or stepping (revision).
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/cpu.c | 10 ++++++++++ arch/x86/include/asm/cpu.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+)arch/x86/cpu/cpu.c +0
-0
arch/x86/cpu/cpu.c static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) · line 338
Quoted 6 lines
arch/x86/cpu/cpu.c +3
-0@@ -333,6 +333,16 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) c->x86_model += ((tfms >>16 ) &0xF ) <<4 ; } +u32 cpu_get_family_model (void ) +{ +return gd->arch.x86_device &0x0fff0ff0 ;
The decrypted family and model are stored in gd->arch.x86 and gd->arch.x86_model. Returning raw data would still need the caller to parse it. Why not just return these directly?
arch/x86/cpu/cpu.c static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) · line 343
Quoted 5 lines
arch/x86/cpu/cpu.c +5
-0+} + +u32 cpu_get_stepping (void ) +{ +return gd->arch.x86_device &0xf ;
This is gd->arch.x86_mask.
Quoted 19 lines
arch/x86/cpu/cpu.c +2
-0+} +int x86_cpu_init_f (void ) {const u32 em_rst = ~X86_CR0_EM ;arch/x86/include/asm/cpu.h +6
-0@@ -260,4 +260,18 @@ void cpu_call32(ulong code_seg32, ulong target, ulong table);*/ int cpu_jump_to_64bit (ulong setup_base,ulong target); +/** +* cpu_get_family_model() - Get the family and model for the CPU +* +* @return the CPU ID masked with 0x0fff0ff0 +*/ +u32 cpu_get_family_model (void );
arch/x86/include/asm/cpu.h void cpu_call32(ulong code_seg32, ulong target, ulong table);
Quoted 10 lines
arch/x86/include/asm/cpu.h +8
-1+ +/** +* cpu_get_stepping() - Get the stepping value for the CPU +* +* @return the CPU ID masked with 0xf +*/ +u32 cpu_get_stepping (void ); +#endif --
Regards,
Bin
PATCH 15/69 x86: cpu: Add functions to return the family and stepping
Hi Bin,
Quoted 21 lines · Bin Meng
Hi Simon,
Quoted 18 lines · Simon Glass
These two identifiers can be useful for drivers which need to adjust their behaviour depending on the CPU family or stepping (revision).
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/cpu.c | 10 ++++++++++ arch/x86/include/asm/cpu.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+)arch/x86/cpu/cpu.c +0
-0@@ -333,6 +333,16 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) c->x86_model += ((tfms >>16 ) &0xF ) <<4 ; }
Quoted 7 lines
arch/x86/cpu/cpu.c static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) · line 338
Quoted 3 lines
arch/x86/cpu/cpu.c +3
-0+u32 cpu_get_family_model (void ) +{ +return gd->arch.x86_device &0x0fff0ff0 ;The decrypted family and model are stored in
gd->arch.x86andgd->arch.x86_model. Returning raw data would still need the caller to parse it. Why not just return these directly?
I want to compare them in one shot to BROADWELL_FAMILY_ULT, etc.
What exactly are you suggesting?
Quoted 8 lines
arch/x86/cpu/cpu.c static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) · line 343
Quoted 6 lines
arch/x86/cpu/cpu.c +5
-0+} + +u32 cpu_get_stepping (void ) +{ +return gd->arch.x86_device &0xf ;This is
gd->arch.x86_mask.
OK. That's a funny name for stepping.
Quoted 33 lines
Quoted 20 lines
arch/x86/cpu/cpu.c +2
-0+} +int x86_cpu_init_f (void ) {const u32 em_rst = ~X86_CR0_EM ;arch/x86/include/asm/cpu.h +6
-0@@ -260,4 +260,18 @@ void cpu_call32(ulong code_seg32, ulong target, ulong table);*/ int cpu_jump_to_64bit (ulong setup_base,ulong target); +/** +* cpu_get_family_model() - Get the family and model for the CPU +* +* @return the CPU ID masked with 0x0fff0ff0 +*/ +u32 cpu_get_family_model (void );arch/x86/include/asm/cpu.h void cpu_call32(ulong code_seg32, ulong target, ulong table);
Quoted 10 lines
arch/x86/include/asm/cpu.h +8
-1+ +/** +* cpu_get_stepping() - Get the stepping value for the CPU +* +* @return the CPU ID masked with 0xf +*/ +u32 cpu_get_stepping (void ); +#endif --Regards,
Bin
PATCH 15/69 x86: cpu: Add functions to return the family and stepping
Hi Simon,
Quoted 32 lines · Simon Glass
Hi Bin,
Quoted 21 lines · Bin Meng
Hi Simon,
Quoted 18 lines · Simon Glass
These two identifiers can be useful for drivers which need to adjust their behaviour depending on the CPU family or stepping (revision).
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/cpu.c | 10 ++++++++++ arch/x86/include/asm/cpu.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+)arch/x86/cpu/cpu.c +0
-0@@ -333,6 +333,16 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) c->x86_model += ((tfms >>16 ) &0xF ) <<4 ; }Quoted 7 lines
arch/x86/cpu/cpu.c static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) · line 338
Quoted 3 lines
arch/x86/cpu/cpu.c +3
-0+u32 cpu_get_family_model (void ) +{ +return gd->arch.x86_device &0x0fff0ff0 ;The decrypted family and model are stored in
gd->arch.x86andgd->arch.x86_model. Returning raw data would still need the caller to parse it. Why not just return these directly?
Quoted 4 lines
I want to compare them in one shot to
BROADWELL_FAMILY_ULT, etc.What exactly are you suggesting?
I guess we can also break BROADWELL_FAMILY_ULT down to values and have them compared to gd->arch.x86 and gd->arch.x86_model. But I suppose you have your logic already working, so this is fine.
Quoted 10 lines
Quoted 8 lines
arch/x86/cpu/cpu.c static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms) · line 343
Quoted 6 lines
arch/x86/cpu/cpu.c +5
-0+} + +u32 cpu_get_stepping (void ) +{ +return gd->arch.x86_device &0xf ;This is
gd->arch.x86_mask.OK. That's a funny name for stepping.
Yep, we can rename this to stepping in the future.
[snip]
Regards,
Bin
PATCH 16/69 x86: Move cache-as-RAM code into a common location
In reply to Simon GlassThis cache-as-RAM (CAR) code is common to several Intel chips. Create a new intel_common directory and move it in there.
---
arch/x86/cpu/Makefile | 1 +
arch/x86/cpu/intel_common/Makefile | 7 +++++++
arch/x86/cpu/{ivybridge => intel_common}/car.S | 0
arch/x86/cpu/ivybridge/Makefile | 1 -
4 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 arch/x86/cpu/intel_common/Makefile
rename arch/x86/cpu/{ivybridge => intel_common}/car.S (100%)arch/x86/cpu/Makefile +1 -0
@@ -18,6 +18,7 @@ AFLAGS_call32.o := -fpic -fshort-wchar extra-y += call32.o +obj-y += intel_common/ obj-$(CONFIG_INTEL_BAYTRAIL) += baytrail/ obj-$(CONFIG_SYS_COREBOOT) += coreboot/ obj-$(CONFIG_EFI_APP) += efi/
arch/x86/cpu/intel_common/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (c) 2016 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-$(CONFIG_HAVE_MRC) += car.o
arch/x86/cpu/intel_common/car.S renamed from arch/x86/cpu/ivybridge/car.S +0 -0
arch/x86/cpu/ivybridge/Makefile +0 -1
@@ -7,7 +7,6 @@ ifdef CONFIG_HAVE_FSP obj-y += fsp_configs.o ivybridge.o else -obj-y += car.o obj-y += cpu.o obj-y += early_me.o obj-y += gma.o
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 16/69 x86: Move cache-as-RAM code into a common location
Quoted 6 lines · Simon Glass
This cache-as-RAM (CAR) code is common to several Intel chips. Create a new
intel_commondirectory and move it in there.Signed-off-by Simon Glass <[email protected]>---
Quoted 8 lines
arch/x86/cpu/Makefile | 1 +
arch/x86/cpu/intel_common/Makefile | 7 +++++++
arch/x86/cpu/{ivybridge => intel_common}/car.S | 0
arch/x86/cpu/ivybridge/Makefile | 1 -
4 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 arch/x86/cpu/intel_common/Makefile
rename arch/x86/cpu/{ivybridge => intel_common}/car.S (100%)PATCH 17/69 x86: Move microcode code to a common location
In reply to Simon GlassThis code is used on several Intel CPUs. Move it into a common location.
---
arch/x86/cpu/intel_common/Makefile | 3 +++
arch/x86/cpu/intel_common/car.S | 2 +-
arch/x86/cpu/{ivybridge => intel_common}/microcode_intel.c | 4 +++-
arch/x86/cpu/ivybridge/Makefile | 1 -
arch/x86/cpu/ivybridge/cpu.c | 2 +-
arch/x86/include/asm/{arch-ivybridge => }/microcode.h | 0
6 files changed, 8 insertions(+), 4 deletions(-)
rename arch/x86/cpu/{ivybridge => intel_common}/microcode_intel.c (98%)
rename arch/x86/include/asm/{arch-ivybridge => }/microcode.h (100%)arch/x86/cpu/intel_common/Makefile +3 -0
@@ -5,3 +5,6 @@ # obj-$(CONFIG_HAVE_MRC) += car.o +ifndef CONFIG_TARGET_EFI +obj-y += microcode_intel.o +endif
arch/x86/cpu/intel_common/car.S +1 -1
@@ -12,12 +12,12 @@ */ #include <common.h> +#include <asm/microcode.h> #include <asm/msr-index.h> #include <asm/mtrr.h> #include <asm/post.h> #include <asm/processor.h> #include <asm/processor-flags.h> -#include <asm/arch/microcode.h> #define MTRR_PHYS_BASE_MSR(reg) (0x200 + 2 * (reg)) #define MTRR_PHYS_MASK_MSR(reg) (0x200 + 2 * (reg) + 1)
arch/x86/cpu/intel_common/microcode_intel.c renamed from arch/x86/cpu/ivybridge/microcode_intel.c +3 -1
@@ -12,10 +12,12 @@#include <fdtdec.h> #include <libfdt.h> #include <asm/cpu.h> +#include <asm/microcode.h> #include <asm/msr.h> #include <asm/msr-index.h> #include <asm/processor.h> -#include <asm/arch/microcode.h> + +DECLARE_GLOBAL_DATA_PTR ;/** * struct microcode_update - standard microcode header from Intel
arch/x86/cpu/ivybridge/Makefile +0 -1
@@ -13,7 +13,6 @@ obj-y += gma.o obj-y += lpc.o obj-y += me_status.o obj-y += model_206ax.o -obj-y += microcode_intel.o obj-y += northbridge.o obj-y += report_platform.o obj-y += sata.o
arch/x86/cpu/ivybridge/cpu.c +1 -1
@@ -19,13 +19,13 @@#include <asm/cpu.h> #include <asm/io.h> #include <asm/lapic.h> +#include <asm/microcode.h> #include <asm/msr.h> #include <asm/mtrr.h> #include <asm/pci.h> #include <asm/post.h> #include <asm/processor.h> #include <asm/arch/model_206ax.h> -#include <asm/arch/microcode.h> #include <asm/arch/pch.h> #include <asm/arch/sandybridge.h>
arch/x86/include/asm/microcode.h renamed from arch/x86/include/asm/arch-ivybridge/microcode.h +0 -0
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 17/69 x86: Move microcode code to a common location
Hi Simon,
Quoted 8 lines · Simon Glass
This code is used on several Intel CPUs. Move it into a common location.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/Makefile | 3 +++ arch/x86/cpu/intel_common/car.S | 2 +- arch/x86/cpu/{ivybridge => intel_common}/microcode_intel.c | 4 +++-
I would rename this to just "microcode.c" since the directory already indicates "intel_common".
Quoted 92 lines
arch/x86/cpu/ivybridge/Makefile | 1 - arch/x86/cpu/ivybridge/cpu.c | 2 +- arch/x86/include/asm/{arch-ivybridge => }/microcode.h | 0 6 files changed, 8 insertions(+), 4 deletions(-) rename arch/x86/cpu/{ivybridge => intel_common}/microcode_intel.c (98%) rename arch/x86/include/asm/{arch-ivybridge => }/microcode.h (100%)arch/x86/cpu/intel_common/Makefile +3
-0@@ -5,3 +5,6 @@ # obj-$(CONFIG_HAVE_MRC) += car.o +ifndef CONFIG_TARGET_EFI +obj-y += microcode_intel.o +endifarch/x86/cpu/intel_common/car.S +1
-1@@ -12,12 +12,12 @@ */ #include <common.h> +#include <asm/microcode.h> #include <asm/msr-index.h> #include <asm/mtrr.h> #include <asm/post.h> #include <asm/processor.h> #include <asm/processor-flags.h> -#include <asm/arch/microcode.h> #define MTRR_PHYS_BASE_MSR(reg) (0x200 + 2 * (reg)) #define MTRR_PHYS_MASK_MSR(reg) (0x200 + 2 * (reg) + 1)arch/x86/cpu/intel_common/microcode_intel.c renamed from arch/x86/cpu/ivybridge/microcode_intel.c +3
-1@@ -12,10 +12,12 @@#include <fdtdec.h> #include <libfdt.h> #include <asm/cpu.h> +#include <asm/microcode.h> #include <asm/msr.h> #include <asm/msr-index.h> #include <asm/processor.h> -#include <asm/arch/microcode.h> + +DECLARE_GLOBAL_DATA_PTR ;/** * struct microcode_update - standard microcode header from Intel arch/x86/cpu/ivybridge/Makefile +0
-1@@ -13,7 +13,6 @@ obj-y += gma.o obj-y += lpc.o obj-y += me_status.o obj-y += model_206ax.o -obj-y += microcode_intel.o obj-y += northbridge.o obj-y += report_platform.o obj-y += sata.oarch/x86/cpu/ivybridge/cpu.c +1
-1@@ -19,13 +19,13 @@#include <asm/cpu.h> #include <asm/io.h> #include <asm/lapic.h> +#include <asm/microcode.h> #include <asm/msr.h> #include <asm/mtrr.h> #include <asm/pci.h> #include <asm/post.h> #include <asm/processor.h> #include <asm/arch/model_206ax.h> -#include <asm/arch/microcode.h> #include <asm/arch/pch.h> #include <asm/arch/sandybridge.h> arch/x86/include/asm/microcode.h renamed from arch/x86/include/asm/arch-ivybridge/microcode.h +0
-0
arch/x86/include/asm/microcode.h
Quoted 1 line
arch/x86/include/asm/microcode.h renamed from arch/x86/include/asm/arch-ivybridge/microcode.h +0
-1--
Other than that,
Regards,
Bin
PATCH 18/69 x86: Create a common header for Intel register access
In reply to Simon GlassThere are several blocks of registers that are accessed from all over the code on Intel CPUs. These don't currently have their own driver and it is not clear whether having a driver makes sense.
An example is the Memory Controller Hub (MCH). We map it to a known location on some Intel chips (mostly those without FSP - Firmware Support Package).
Add a new header file for these registers, and move MCH into it.
---
arch/x86/cpu/ivybridge/cpu.c | 1 + arch/x86/cpu/ivybridge/gma.c | 1 + arch/x86/cpu/ivybridge/northbridge.c | 5 +++-- arch/x86/cpu/ivybridge/sdram.c | 3 ++- arch/x86/include/asm/arch-ivybridge/sandybridge.h | 3 --- arch/x86/include/asm/intel_regs.h | 15 +++++++++++++++ 6 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 arch/x86/include/asm/intel_regs.h
arch/x86/cpu/ivybridge/cpu.c +1 -0
@@ -17,6 +17,7 @@#include <fdtdec.h> #include <pch.h> #include <asm/cpu.h> +#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/lapic.h> #include <asm/microcode.h>
arch/x86/cpu/ivybridge/gma.c +1 -0
@@ -12,6 +12,7 @@#include <errno.h> #include <fdtdec.h> #include <pci_rom.h> +#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/mtrr.h> #include <asm/pci.h>
arch/x86/cpu/ivybridge/northbridge.c +3 -2
@@ -12,6 +12,7 @@#include <asm/msr.h> #include <asm/acpi.h> #include <asm/cpu.h> +#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/pci.h> #include <asm/processor.h>
@@ -167,8 +168,8 @@ static void sandybridge_setup_northbridge_bars(struct udevice *dev)debug ("Setting up static registers\n" );dm_pci_write_config32 (dev,EPBAR ,DEFAULT_EPBAR |1 );dm_pci_write_config32 (dev,EPBAR +4 , (0LL +DEFAULT_EPBAR ) >>32 ); -dm_pci_write_config32 (dev,MCHBAR ,DEFAULT_MCHBAR |1 ); -dm_pci_write_config32 (dev,MCHBAR +4 , (0LL +DEFAULT_MCHBAR ) >>32 ); +dm_pci_write_config32 (dev,MCHBAR ,MCH_BASE_ADDRESS |1 ); +dm_pci_write_config32 (dev,MCHBAR +4 , (0LL +MCH_BASE_ADDRESS ) >>32 );/* 64MB - busses 0-63 */ dm_pci_write_config32 (dev,PCIEXBAR ,DEFAULT_PCIEXBAR |5 ); dm_pci_write_config32(dev, PCIEXBAR + 4,
arch/x86/cpu/ivybridge/sdram.c +2 -1
@@ -23,6 +23,7 @@#include <asm/processor.h> #include <asm/gpio.h> #include <asm/global_data.h> +#include <asm/intel_regs.h> #include <asm/mrccache.h> #include <asm/mtrr.h> #include <asm/pci.h>
@@ -682,7 +683,7 @@ int dram_init(void) {struct pei_data pei_data__aligned(8) = { .pei_version =PEI_VERSION , - .mchbar =DEFAULT_MCHBAR , + .mchbar =MCH_BASE_ADDRESS , .dmibar =DEFAULT_DMIBAR , .epbar =DEFAULT_EPBAR , .pciexbar =CONFIG_PCIE_ECAM_BASE ,
arch/x86/include/asm/arch-ivybridge/sandybridge.h +0 -3
@@ -38,7 +38,6 @@#define IED_SIZE 0x400000/* Northbridge BARs */ -#define DEFAULT_MCHBAR 0xfed10000/* 16 KB */ #define DEFAULT_DMIBAR 0xfed18000/* 4 KB */ #define DEFAULT_EPBAR 0xfed19000/* 4 KB */ #define DEFAULT_RCBABASE 0xfed1c000
@@ -97,8 +96,6 @@/* * MCHBAR */ -#define MCHBAR_REG (reg) (DEFAULT_MCHBAR + (reg)) -#define SSKPD 0x5d14/* 16bit (scratchpad) */ #define BIOS_RESET_CPL 0x5da8/* 8bit */
arch/x86/include/asm/intel_regs.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#ifndef __asm_intel_regs_h +#define __asm_intel_regs_h + +/* Access the memory-controller hub */ +#define MCH_BASE_ADDRESS 0xfed10000 +#define MCH_BASE_SIZE 0x8000 +#define MCHBAR_REG (reg) (MCH_BASE_ADDRESS + (reg)) + +#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 18/69 x86: Create a common header for Intel register access
Hi Simon,
Quoted 116 lines · Simon Glass
There are several blocks of registers that are accessed from all over the code on Intel CPUs. These don't currently have their own driver and it is not clear whether having a driver makes sense.
An example is the Memory Controller Hub (MCH). We map it to a known location on some Intel chips (mostly those without FSP - Firmware Support Package).
Add a new header file for these registers, and move MCH into it.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/ivybridge/cpu.c | 1 + arch/x86/cpu/ivybridge/gma.c | 1 + arch/x86/cpu/ivybridge/northbridge.c | 5 +++-- arch/x86/cpu/ivybridge/sdram.c | 3 ++- arch/x86/include/asm/arch-ivybridge/sandybridge.h | 3 --- arch/x86/include/asm/intel_regs.h | 15 +++++++++++++++ 6 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 arch/x86/include/asm/intel_regs.harch/x86/cpu/ivybridge/cpu.c +1
-0@@ -17,6 +17,7 @@#include <fdtdec.h> #include <pch.h> #include <asm/cpu.h> +#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/lapic.h> #include <asm/microcode.h> arch/x86/cpu/ivybridge/gma.c +1
-0@@ -12,6 +12,7 @@#include <errno.h> #include <fdtdec.h> #include <pci_rom.h> +#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/mtrr.h> #include <asm/pci.h> arch/x86/cpu/ivybridge/northbridge.c +3
-2@@ -12,6 +12,7 @@#include <asm/msr.h> #include <asm/acpi.h> #include <asm/cpu.h> +#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/pci.h> #include <asm/processor.h> @@ -167,8 +168,8 @@ static void sandybridge_setup_northbridge_bars(struct udevice *dev)debug ("Setting up static registers\n" );dm_pci_write_config32 (dev,EPBAR ,DEFAULT_EPBAR |1 );dm_pci_write_config32 (dev,EPBAR +4 , (0LL +DEFAULT_EPBAR ) >>32 ); -dm_pci_write_config32 (dev,MCHBAR ,DEFAULT_MCHBAR |1 ); -dm_pci_write_config32 (dev,MCHBAR +4 , (0LL +DEFAULT_MCHBAR ) >>32 ); +dm_pci_write_config32 (dev,MCHBAR ,MCH_BASE_ADDRESS |1 ); +dm_pci_write_config32 (dev,MCHBAR +4 , (0LL +MCH_BASE_ADDRESS ) >>32 );/* 64MB - busses 0-63 */ dm_pci_write_config32 (dev,PCIEXBAR ,DEFAULT_PCIEXBAR |5 ); dm_pci_write_config32(dev, PCIEXBAR + 4,arch/x86/cpu/ivybridge/sdram.c +2
-1@@ -23,6 +23,7 @@#include <asm/processor.h> #include <asm/gpio.h> #include <asm/global_data.h> +#include <asm/intel_regs.h> #include <asm/mrccache.h> #include <asm/mtrr.h> #include <asm/pci.h> @@ -682,7 +683,7 @@ int dram_init(void) {struct pei_data pei_data__aligned(8) = { .pei_version =PEI_VERSION , - .mchbar =DEFAULT_MCHBAR , + .mchbar =MCH_BASE_ADDRESS , .dmibar =DEFAULT_DMIBAR , .epbar =DEFAULT_EPBAR , .pciexbar =CONFIG_PCIE_ECAM_BASE ,arch/x86/include/asm/arch-ivybridge/sandybridge.h +0
-3@@ -38,7 +38,6 @@#define IED_SIZE 0x400000/* Northbridge BARs */ -#define DEFAULT_MCHBAR 0xfed10000/* 16 KB */ #define DEFAULT_DMIBAR 0xfed18000/* 4 KB */ #define DEFAULT_EPBAR 0xfed19000/* 4 KB */ #define DEFAULT_RCBABASE 0xfed1c000@@ -97,8 +96,6 @@/* * MCHBAR */ -#define MCHBAR_REG (reg) (DEFAULT_MCHBAR + (reg)) -#define SSKPD 0x5d14/* 16bit (scratchpad) */ #define BIOS_RESET_CPL 0x5da8/* 8bit */ arch/x86/include/asm/intel_regs.h new file +0
-0
arch/x86/include/asm/intel_regs.h line 4
Quoted 4 lines
arch/x86/include/asm/intel_regs.h new file +4
-0@@ -0,0 +1,15 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
arch/x86/include/asm/intel_regs.h line 8
Quoted 4 lines
arch/x86/include/asm/intel_regs.h new file +4
-0+*/ + +#ifndef __asm_intel_regs_h +#define __asm_intel_regs_h
nits: all capital letters
arch/x86/include/asm/intel_regs.h
Quoted 8 lines
arch/x86/include/asm/intel_regs.h new file +7
-1+ +/* Access the memory-controller hub */ +#define MCH_BASE_ADDRESS 0xfed10000 +#define MCH_BASE_SIZE 0x8000 +#define MCHBAR_REG (reg) (MCH_BASE_ADDRESS + (reg)) + +#endif --
Regards,
Bin
PATCH 19/69 x86: Add the root-complex block to common intel registers
In reply to Simon GlassThis is similar to MCH in that it is used in various drivers. Add it to the common header.
---
arch/x86/cpu/ivybridge/bd82x6x.c | 1 + arch/x86/cpu/ivybridge/lpc.c | 6 ++++-- arch/x86/include/asm/arch-ivybridge/pch.h | 5 ----- arch/x86/include/asm/intel_regs.h | 4 ++++ 4 files changed, 9 insertions(+), 7 deletions(-)
arch/x86/cpu/ivybridge/bd82x6x.c +1 -0
@@ -11,6 +11,7 @@#include <pch.h> #include <syscon.h> #include <asm/cpu.h> +#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/lapic.h> #include <asm/pci.h>
arch/x86/cpu/ivybridge/lpc.c +4 -2
@@ -13,6 +13,7 @@#include <rtc.h> #include <pci.h> #include <asm/acpi.h> +#include <asm/intel_regs.h> #include <asm/interrupt.h> #include <asm/io.h> #include <asm/ioapic.h>
@@ -420,7 +421,7 @@ static void enable_spi_prefetch(struct udevice *pch)static void enable_port80_on_lpc (struct udevice *pch) {/* Enable port 80 POST on LPC */ -dm_pci_write_config32 (pch,PCH_RCBA_BASE ,DEFAULT_RCBA |1 ); +dm_pci_write_config32 (pch,PCH_RCBA_BASE ,RCB_BASE_ADDRESS |1 );clrbits_le32 (RCB_REG (GCS ),4 ); }
@@ -552,7 +553,8 @@ static int bd82x6x_lpc_early_init(struct udevice *dev) {/* Setting up Southbridge. In the northbridge code. */ debug ("Setting up static southbridge registers\n" ); -dm_pci_write_config32 (dev->parent,PCH_RCBA_BASE ,DEFAULT_RCBA |1 ); +dm_pci_write_config32 (dev->parent,PCH_RCBA_BASE , +RCB_BASE_ADDRESS |1 );dm_pci_write_config32 (dev->parent,PMBASE ,DEFAULT_PMBASE |1 );/* Enable ACPI BAR */
arch/x86/include/asm/arch-ivybridge/pch.h +0 -5
@@ -211,11 +211,6 @@#define SMBUS_TIMEOUT (10 * 1000 * 100) - -/* Root Complex Register Block */ -#define DEFAULT_RCBA 0xfed1c000 -#define RCB_REG (reg) (DEFAULT_RCBA + (reg)) -#define PCH_RCBA_BASE 0xf0#define VCH 0x0000/* 32bit */
arch/x86/include/asm/intel_regs.h +4 -0
@@ -12,4 +12,8 @@#define MCH_BASE_SIZE 0x8000#define MCHBAR_REG (reg) (MCH_BASE_ADDRESS + (reg)) +/* Access the Root Complex Register Block */ +#define RCB_BASE_ADDRESS 0xfed1c000 +#define RCB_REG (reg) (RCB_BASE_ADDRESS + (reg)) +#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 19/69 x86: Add the root-complex block to common intel registers
Quoted 12 lines · Simon Glass
This is similar to MCH in that it is used in various drivers. Add it to the common header.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/ivybridge/bd82x6x.c | 1 + arch/x86/cpu/ivybridge/lpc.c | 6 ++++-- arch/x86/include/asm/arch-ivybridge/pch.h | 5 ----- arch/x86/include/asm/intel_regs.h | 4 ++++ 4 files changed, 9 insertions(+), 7 deletions(-)
PATCH 20/69 x86: Move common LPC code to its own place
In reply to Simon GlassSome of the LPC code is common to several Intel LPC devices. Move it into a common location.
---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/lpc_common.c | 102 ++++++++++++++++++++++++++++++ arch/x86/cpu/ivybridge/bd82x6x.c | 16 +---- arch/x86/cpu/ivybridge/lpc.c | 73 ++------------------- arch/x86/include/asm/arch-ivybridge/pch.h | 2 - arch/x86/include/asm/lpc_common.h | 59 +++++++++++++++++ 6 files changed, 168 insertions(+), 85 deletions(-) create mode 100644 arch/x86/cpu/intel_common/lpc_common.c create mode 100644 arch/x86/include/asm/lpc_common.h
arch/x86/cpu/intel_common/Makefile +1 -0
@@ -5,6 +5,7 @@ # obj-$(CONFIG_HAVE_MRC) += car.o +obj-y += lpc_common.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.o endif
arch/x86/cpu/intel_common/lpc_common.c new file +102 -0
102 lines not on this page · raw message
arch/x86/cpu/ivybridge/bd82x6x.c +2 -14
@@ -14,6 +14,7 @@#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/lapic.h> +#include <asm/lpc_common.h> #include <asm/pci.h> #include <asm/arch/bd82x6x.h> #include <asm/arch/model_206ax.h>
@@ -188,20 +189,7 @@ static int bd82x6x_pch_get_spi_base(struct udevice *dev, ulong *sbasep)static int bd82x6x_set_spi_protect (struct udevice *dev,bool protect) { -uint8_t bios_cntl; - -/* Adjust the BIOS write protect and SMM BIOS Write Protect Disable */ -dm_pci_read_config8 (dev,BIOS_CTRL , &bios_cntl); -if (protect) { - bios_cntl &= ~BIOS_CTRL_BIOSWE ; - bios_cntl |=BIT (5 ); - }else { - bios_cntl |=BIOS_CTRL_BIOSWE ; - bios_cntl &= ~BIT (5 ); - } -dm_pci_write_config8 (dev,BIOS_CTRL , bios_cntl); - -return 0 ; +return lpc_set_spi_protect (dev,BIOS_CTRL , protect); }static int bd82x6x_get_gpio_base (struct udevice *dev,u32 *gbasep)
arch/x86/cpu/ivybridge/lpc.c +4 -69
103 lines not on this page · raw message
arch/x86/include/asm/arch-ivybridge/pch.h +0 -2
@@ -211,8 +211,6 @@#define SMBUS_TIMEOUT (10 * 1000 * 100) -#define PCH_RCBA_BASE 0xf0 -#define VCH 0x0000/* 32bit */ #define VCAP1 0x0004/* 32bit */ #define VCAP2 0x0008/* 32bit */
arch/x86/include/asm/lpc_common.h new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 20/69 x86: Move common LPC code to its own place
Hi Simon,
Quoted 45 lines · Simon Glass
Some of the LPC code is common to several Intel LPC devices. Move it into a common location.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/lpc_common.c | 102 ++++++++++++++++++++++++++++++ arch/x86/cpu/ivybridge/bd82x6x.c | 16 +---- arch/x86/cpu/ivybridge/lpc.c | 73 ++------------------- arch/x86/include/asm/arch-ivybridge/pch.h | 2 - arch/x86/include/asm/lpc_common.h | 59 +++++++++++++++++ 6 files changed, 168 insertions(+), 85 deletions(-) create mode 100644 arch/x86/cpu/intel_common/lpc_common.c create mode 100644 arch/x86/include/asm/lpc_common.harch/x86/cpu/intel_common/Makefile +1
-0@@ -5,6 +5,7 @@ # obj-$(CONFIG_HAVE_MRC) += car.o +obj-y += lpc_common.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.o endifarch/x86/cpu/intel_common/lpc_common.c new file +11
-0@@ -0,0 +1,102 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <fdtdec.h> +#include <pch.h>
arch/x86/cpu/intel_common/lpc_common.c line 21
Quoted 10 lines
arch/x86/cpu/intel_common/lpc_common.c new file +10
-0+#include <pci.h> +#include <asm/intel_regs.h> +#include <asm/io.h> +#include <asm/lpc_common.h> + +DECLARE_GLOBAL_DATA_PTR ; + +/* +* Enable Prefetching and Caching. +*/
nits: single-line comment format
Quoted 246 lines
arch/x86/cpu/intel_common/lpc_common.c new file +81
-0+static void enable_spi_prefetch (struct udevice *pch) +{ +u8 reg8; + +dm_pci_read_config8 (pch,0xdc , ®8); + reg8 &= ~(3 <<2 ); + reg8 |= (2 <<2 );/* Prefetching and Caching Enabled */ +dm_pci_write_config8 (pch,0xdc , reg8); +} + +static void enable_port80_on_lpc (struct udevice *pch) +{ +/* Enable port 80 POST on LPC */ +dm_pci_write_config32 (pch,PCH_RCBA_BASE ,RCB_BASE_ADDRESS |1 ); +clrbits_le32 (RCB_REG (GCS ),4 ); +} + +/** +* lpc_early_init() - set up LPC serial ports and other early things +* +* @dev: LPC device +* @return 0 if OK, -ve on error +*/ +int lpc_common_early_init (struct udevice *dev) +{ +struct udevice *pch = dev->parent; +struct reg_info { +u32 base; +u32 size; + } values[4 ], *ptr; +int count; +int i; + + count =fdtdec_get_int_array_count (gd->fdt_blob, dev->of_offset, +"intel,gen-dec" , (u32 *)values, +sizeof (values) /sizeof (u32)); +if (count <0 ) +return -EINVAL ; + +/* Set COM1/COM2 decode range */ +dm_pci_write_config16 (pch,LPC_IO_DEC ,0x0010 ); + +/* Enable PS/2 Keyboard/Mouse, EC areas and COM1 */ +dm_pci_write_config16 (pch,LPC_EN ,KBC_LPC_EN |MC_LPC_EN | +GAMEL_LPC_EN |COMA_LPC_EN ); + +/* Write all registers but use 0 if we run out of data */ + count = count *sizeof (u32) /sizeof (values[0 ]); +for (i =0 , ptr = values; i <ARRAY_SIZE (values); i++, ptr++) { +u32 reg =0 ; + +if (i < count) + reg = ptr->base |PCI_COMMAND_IO | (ptr->size <<16 ); +dm_pci_write_config32 (pch,LPC_GENX_DEC (i), reg); + } + +enable_spi_prefetch (pch); + +/* This is already done in start.S, but let's do it in C */ +enable_port80_on_lpc (pch); + +return 0 ; +} + +int lpc_set_spi_protect (struct udevice *dev,int bios_ctrl,bool protect) +{ +uint8_t bios_cntl; + +/* Adjust the BIOS write protect and SMM BIOS Write Protect Disable */ +dm_pci_read_config8 (dev, bios_ctrl, &bios_cntl); +if (protect) { + bios_cntl &= ~BIOS_CTRL_BIOSWE ; + bios_cntl |=BIT (5 ); + }else { + bios_cntl |=BIOS_CTRL_BIOSWE ; + bios_cntl &= ~BIT (5 ); + } +dm_pci_write_config8 (dev, bios_ctrl, bios_cntl); + +return 0 ; +}arch/x86/cpu/ivybridge/bd82x6x.c +2
-14@@ -14,6 +14,7 @@#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/lapic.h> +#include <asm/lpc_common.h> #include <asm/pci.h> #include <asm/arch/bd82x6x.h> #include <asm/arch/model_206ax.h> @@ -188,20 +189,7 @@ static int bd82x6x_pch_get_spi_base(struct udevice *dev, ulong *sbasep)static int bd82x6x_set_spi_protect (struct udevice *dev,bool protect) { -uint8_t bios_cntl; - -/* Adjust the BIOS write protect and SMM BIOS Write Protect Disable */ -dm_pci_read_config8 (dev,BIOS_CTRL , &bios_cntl); -if (protect) { - bios_cntl &= ~BIOS_CTRL_BIOSWE ; - bios_cntl |=BIT (5 ); - }else { - bios_cntl |=BIOS_CTRL_BIOSWE ; - bios_cntl &= ~BIT (5 ); - } -dm_pci_write_config8 (dev,BIOS_CTRL , bios_cntl); - -return 0 ; +return lpc_set_spi_protect (dev,BIOS_CTRL , protect); }static int bd82x6x_get_gpio_base (struct udevice *dev,u32 *gbasep)arch/x86/cpu/ivybridge/lpc.c +4
-69@@ -17,6 +17,7 @@#include <asm/interrupt.h> #include <asm/io.h> #include <asm/ioapic.h> +#include <asm/lpc_common.h> #include <asm/pci.h> #include <asm/arch/pch.h> @@ -405,26 +406,6 @@ static void pch_fixups(struct udevice *pch)setbits_le32 (RCB_REG (0x21a8 ),0x3 ); } -/* -* Enable Prefetching and Caching. -*/ -static void enable_spi_prefetch (struct udevice *pch) -{ -u8 reg8; - -dm_pci_read_config8 (pch,0xdc , ®8); - reg8 &= ~(3 <<2 ); - reg8 |= (2 <<2 );/* Prefetching and Caching Enabled */ -dm_pci_write_config8 (pch,0xdc , reg8); -} - -static void enable_port80_on_lpc (struct udevice *pch) -{ -/* Enable port 80 POST on LPC */ -dm_pci_write_config32 (pch,PCH_RCBA_BASE ,RCB_BASE_ADDRESS |1 ); -clrbits_le32 (RCB_REG (GCS ),4 ); -} -static void set_spi_speed (void ) {u32 fdod;@@ -441,54 +422,6 @@ static void set_spi_speed(void)clrsetbits_8 (RCB_REG (SPI_FREQ_SWSEQ ),7 , fdod); } -/** -* lpc_early_init() - set up LPC serial ports and other early things -* -* @dev: LPC device -* @return 0 if OK, -ve on error -*/ -static int lpc_early_init (struct udevice *dev) -{ -struct reg_info { -u32 base; -u32 size; - } values[4 ], *ptr; -int count; -int i; - - count =fdtdec_get_int_array_count (gd->fdt_blob, dev->of_offset, -"intel,gen-dec" , (u32 *)values, -sizeof (values) /sizeof (u32)); -if (count <0 ) -return -EINVAL ; - -/* Set COM1/COM2 decode range */ -dm_pci_write_config16 (dev->parent,LPC_IO_DEC ,0x0010 ); - -/* Enable PS/2 Keyboard/Mouse, EC areas and COM1 */ -dm_pci_write_config16 (dev->parent,LPC_EN ,KBC_LPC_EN |MC_LPC_EN | -GAMEL_LPC_EN |COMA_LPC_EN ); - -/* Write all registers but use 0 if we run out of data */ - count = count *sizeof (u32) /sizeof (values[0 ]); -for (i =0 , ptr = values; i <ARRAY_SIZE (values); i++, ptr++) { -u32 reg =0 ; - -if (i < count) - reg = ptr->base |PCI_COMMAND_IO | (ptr->size <<16 ); -dm_pci_write_config32 (dev->parent,LPC_GENX_DEC (i), reg); - } - -enable_spi_prefetch (dev->parent); - -/* This is already done in start.S, but let's do it in C */ -enable_port80_on_lpc (dev->parent); - -set_spi_speed (); - -return 0 ; -} -static int lpc_init_extra (struct udevice *dev) {struct udevice *pch = dev->parent;@@ -551,6 +484,8 @@ static int lpc_init_extra(struct udevice *dev)static int bd82x6x_lpc_early_init (struct udevice *dev) { +set_spi_speed (); +/* Setting up Southbridge. In the northbridge code. */ debug ("Setting up static southbridge registers\n" ); dm_pci_write_config32(dev->parent, PCH_RCBA_BASE,@@ -575,7 +510,7 @@ static int bd82x6x_lpc_probe(struct udevice *dev)int ret;if (!(gd->flags &GD_FLG_RELOC )) { - ret =lpc_early_init (dev); + ret =lpc_common_early_init (dev);if (ret) {debug ("%s: lpc_early_init() failed\n" , __func__);return ret;arch/x86/include/asm/arch-ivybridge/pch.h +0
-2@@ -211,8 +211,6 @@#define SMBUS_TIMEOUT (10 * 1000 * 100) -#define PCH_RCBA_BASE 0xf0 -#define VCH 0x0000/* 32bit */ #define VCAP1 0x0004/* 32bit */ #define VCAP2 0x0008/* 32bit */ arch/x86/include/asm/lpc_common.h new file +0
-0
arch/x86/include/asm/lpc_common.h line 4
Quoted 4 lines
arch/x86/include/asm/lpc_common.h new file +4
-0@@ -0,0 +1,59 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
arch/x86/include/asm/lpc_common.h line 8
Quoted 4 lines
arch/x86/include/asm/lpc_common.h new file +4
-0+*/ + +#ifndef __asm_lpc_common_h +#define __asm_lpc_common_h
nits: all capital letters
Quoted 42 lines
arch/x86/include/asm/lpc_common.h new file +42
-0+ +#define PCH_RCBA_BASE 0xf0 + +#define RC 0x3400/* 32bit */ +#define GCS 0x3410/* 32bit */ + +#define PMBASE 0x40 +#define ACPI_CNTL 0x44 + +#define LPC_IO_DEC 0x80/* IO Decode Ranges Register */ +#define COMB_DEC_RANGE (1 << 4)/* 0x2f8-0x2ff (COM2) */ +#define COMA_DEC_RANGE (0 << 0)/* 0x3f8-0x3ff (COM1) */ +#define LPC_EN 0x82/* LPC IF Enables Register */ +#define CNF2_LPC_EN (1 << 13)/* 0x4e/0x4f */ +#define CNF1_LPC_EN (1 << 12)/* 0x2e/0x2f */ +#define MC_LPC_EN (1 << 11)/* 0x62/0x66 */ +#define KBC_LPC_EN (1 << 10)/* 0x60/0x64 */ +#define GAMEH_LPC_EN (1 << 9)/* 0x208/0x20f */ +#define GAMEL_LPC_EN (1 << 8)/* 0x200/0x207 */ +#define FDD_LPC_EN (1 << 3)/* LPC_IO_DEC[12] */ +#define LPT_LPC_EN (1 << 2)/* LPC_IO_DEC[9:8] */ +#define COMB_LPC_EN (1 << 1)/* LPC_IO_DEC[6:4] */ +#define COMA_LPC_EN (1 << 0)/* LPC_IO_DEC[3:2] */ +#define LPC_GEN1_DEC 0x84/* LPC IF Generic Decode Range 1 */ +#define LPC_GEN2_DEC 0x88/* LPC IF Generic Decode Range 2 */ +#define LPC_GEN3_DEC 0x8c/* LPC IF Generic Decode Range 3 */ +#define LPC_GEN4_DEC 0x90/* LPC IF Generic Decode Range 4 */ +#define LPC_GENX_DEC (x) (0x84 + 4 * (x)) +#define GEN_DEC_RANGE_256B 0xfc0000/* 256 Bytes */ +#define GEN_DEC_RANGE_128B 0x7c0000/* 128 Bytes */ +#define GEN_DEC_RANGE_64B 0x3c0000/* 64 Bytes */ +#define GEN_DEC_RANGE_32B 0x1c0000/* 32 Bytes */ +#define GEN_DEC_RANGE_16B 0x0c0000/* 16 Bytes */ +#define GEN_DEC_RANGE_8B 0x040000/* 8 Bytes */ +#define GEN_DEC_RANGE_4B 0x000000/* 4 Bytes */ +#define GEN_DEC_RANGE_EN (1 << 0)/* Range Enable */ + +/** +* lpc_common_early_init() - Set up common LPC init +* +* This sets up the legacy decode areas, GEN_DEC, SPI prefetch and Port80. It +* also puts the RCB in the correct place so that RCB_REG() works.
arch/x86/include/asm/lpc_common.h
Quoted 10 lines
arch/x86/include/asm/lpc_common.h new file +9
-1+* +* @dev: LPC device (a child of the PCH) +* @return 0 on success, -ve on error +*/ +int lpc_common_early_init (struct udevice *dev); + +int lpc_set_spi_protect (struct udevice *dev,int bios_ctrl,bool protect); + +#endif --
Regards,
Bin
PATCH 20/69 x86: Move common LPC code to its own place
Quoted 11 lines · Bin Meng
Hi Simon,
Quoted 8 lines · Simon Glass
Some of the LPC code is common to several Intel LPC devices. Move it into a common location.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/lpc_common.c | 102 ++++++++++++++++++++++++++++++
Forget to mention: can we just use "lpc.c" as the name as "_common" is already in the directory name?
Quoted 8 lines
Quoted 8 lines
arch/x86/cpu/ivybridge/bd82x6x.c | 16 +---- arch/x86/cpu/ivybridge/lpc.c | 73 ++------------------- arch/x86/include/asm/arch-ivybridge/pch.h | 2 - arch/x86/include/asm/lpc_common.h | 59 +++++++++++++++++ 6 files changed, 168 insertions(+), 85 deletions(-) create mode 100644 arch/x86/cpu/intel_common/lpc_common.c create mode 100644 arch/x86/include/asm/lpc_common.h
Regards,
Bin
PATCH 21/69 x86: Add some more common MSR indexes
In reply to Simon GlassMany of the model-specific indexes are common to several Intel CPUs. Add some more common ones, and remove them from the ivybridge-specific header file.
---
arch/x86/cpu/ivybridge/model_206ax.c | 5 +-- arch/x86/include/asm/arch-ivybridge/model_206ax.h | 17 ---------- arch/x86/include/asm/msr-index.h | 41 ++++++++++++++++++++++- 3 files changed, 43 insertions(+), 20 deletions(-)
arch/x86/cpu/ivybridge/model_206ax.c +3 -2
@@ -17,6 +17,7 @@#include <asm/cpu_x86.h> #include <asm/lapic.h> #include <asm/msr.h> +#include <asm/msr-index.h> #include <asm/mtrr.h> #include <asm/processor.h> #include <asm/speedstep.h>
@@ -363,7 +364,7 @@ static void set_max_ratio(void) msr =msr_read (MSR_PLATFORM_INFO ); perf_ctl.lo = msr.lo &0xff00 ; } -msr_write (IA32_PERF_CTL , perf_ctl); +msr_write (MSR_IA32_PERF_CTL , perf_ctl);debug ("model_x06ax: frequency set to %d\n" , ((perf_ctl.lo >>8 ) &0xff ) *SANDYBRIDGE_BCLK );
@@ -455,7 +456,7 @@ static int model_206ax_get_info(struct udevice *dev, struct cpu_info *info) {msr_t msr; - msr =msr_read (IA32_PERF_CTL ); + msr =msr_read (MSR_IA32_PERF_CTL ); info->cpu_freq = ((msr.lo >>8 ) &0xff ) *SANDYBRIDGE_BCLK *1000000 ; info->features =1 <<CPU_FEAT_L1_CACHE |1 <<CPU_FEAT_MMU ;
arch/x86/include/asm/arch-ivybridge/model_206ax.h +0 -17
@@ -15,13 +15,9 @@#define CPUID_VMX (1 << 5)#define CPUID_SMX (1 << 6)#define MSR_FEATURE_CONFIG 0x13c -#define MSR_FLEX_RATIO 0x194 -#define FLEX_RATIO_LOCK (1 << 20) -#define FLEX_RATIO_EN (1 << 16)#define IA32_PLATFORM_DCA_CAP 0x1f8#define IA32_MISC_ENABLE 0x1a0#define MSR_TEMPERATURE_TARGET 0x1a2 -#define IA32_PERF_CTL 0x199#define IA32_THERM_INTERRUPT 0x19b#define IA32_ENERGY_PERFORMANCE_BIAS 0x1b0#define ENERGY_POLICY_PERFORMANCE 0
@@ -31,12 +27,8 @@#define MSR_LT_LOCK_MEMORY 0x2e7#define IA32_MC0_STATUS 0x401 -#define MSR_PIC_MSG_CONTROL 0x2e -#define PLATFORM_INFO_SET_TDP (1 << 29) -#define MSR_MISC_PWR_MGMT 0x1aa#define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0) -#define MSR_TURBO_RATIO_LIMIT 0x1ad#define MSR_PKGC3_IRTL 0x60a#define MSR_PKGC6_IRTL 0x60b
@@ -50,13 +42,6 @@#define IRTL_33554432_NS (5 << 10)#define IRTL_RESPONSE_MASK (0x3ff) -/* long duration in low dword, short duration in high dword */ -#define PKG_POWER_LIMIT_MASK 0x7fff -#define PKG_POWER_LIMIT_EN (1 << 15) -#define PKG_POWER_LIMIT_CLAMP (1 << 16) -#define PKG_POWER_LIMIT_TIME_SHIFT 17 -#define PKG_POWER_LIMIT_TIME_MASK 0x7f -#define MSR_PP0_CURRENT_CONFIG 0x601#define PP0_CURRENT_LIMIT (112 << 3)/* 112 A */ #define MSR_PP1_CURRENT_CONFIG 0x602
@@ -65,11 +50,9 @@#define MSR_PKG_POWER_SKU 0x614#define IVB_CONFIG_TDP_MIN_CPUID 0x306a2 -#define MSR_CONFIG_TDP_NOMINAL 0x648#define MSR_CONFIG_TDP_LEVEL1 0x649#define MSR_CONFIG_TDP_LEVEL2 0x64a#define MSR_CONFIG_TDP_CONTROL 0x64b -#define MSR_TURBO_ACTIVATION_RATIO 0x64c/* P-state configuration */ #define PSS_MAX_ENTRIES 8
arch/x86/include/asm/msr-index.h +40 -1
74 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 21/69 x86: Add some more common MSR indexes
Quoted 4 lines · Simon Glass
Many of the model-specific indexes are common to several Intel CPUs. Add some more common ones, and remove them from the ivybridge-specific header file.
Quoted 8 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/ivybridge/model_206ax.c | 5 +-- arch/x86/include/asm/arch-ivybridge/model_206ax.h | 17 ---------- arch/x86/include/asm/msr-index.h | 41 ++++++++++++++++++++++- 3 files changed, 43 insertions(+), 20 deletions(-)
PATCH 21/69 x86: Add some more common MSR indexes
Quoted 8 lines · Bin Meng
Quoted 7 lines · Simon Glass
Many of the model-specific indexes are common to several Intel CPUs. Add some more common ones, and remove them from the ivybridge-specific header file.
Signed-off-by Simon Glass <[email protected]>---
Quoted 7 lines
Quoted 5 lines
arch/x86/cpu/ivybridge/model_206ax.c | 5 +-- arch/x86/include/asm/arch-ivybridge/model_206ax.h | 17 ---------- arch/x86/include/asm/msr-index.h | 41 ++++++++++++++++++++++- 3 files changed, 43 insertions(+), 20 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 22/69 x86: Move common CPU code to its own place
In reply to Simon GlassSome of the Intel CPU code is common to several Intel CPUs. Move it into a common location along with required declarations.
---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/cpu_common.c | 111 ++++++++++++++++++++++++++++++ arch/x86/cpu/ivybridge/cpu.c | 82 ++-------------------- arch/x86/include/asm/arch-ivybridge/pch.h | 2 - arch/x86/include/asm/cpu_common.h | 35 ++++++++++ arch/x86/include/asm/intel_regs.h | 9 +++ 6 files changed, 162 insertions(+), 78 deletions(-) create mode 100644 arch/x86/cpu/intel_common/cpu_common.c create mode 100644 arch/x86/include/asm/cpu_common.h
arch/x86/cpu/intel_common/Makefile +1 -0
@@ -5,6 +5,7 @@ # obj-$(CONFIG_HAVE_MRC) += car.o +obj-y += cpu_common.o obj-y += lpc_common.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.o
arch/x86/cpu/intel_common/cpu_common.c new file +111 -0
111 lines not on this page · raw message
arch/x86/cpu/ivybridge/cpu.c +6 -76
125 lines not on this page · raw message
arch/x86/include/asm/arch-ivybridge/pch.h +0 -2
@@ -332,8 +332,6 @@#define SPI_FREQ_SWSEQ 0x3893#define SPI_DESC_COMP0 0x38b0#define SPI_FREQ_WR_ERA 0x38b4 -#define SOFT_RESET_CTRL 0x38f4 -#define SOFT_RESET_DATA 0x38f8#define DIR_ROUTE (a, b, c, d) \ (((d) << DIR_IDR) | ((c) << DIR_ICR) | \
arch/x86/include/asm/cpu_common.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#ifndef __asm_cpu_common_h +#define __asm_cpu_common_h + +#define IA32_PERF_CTL 0x199 + +/** +* cpu_common_init() - Set up common CPU init +* +* This reports BIST failure, enables the LAPIC, updates microcode, enables +* the upper 128-bytes of CROM RAM, probes the northbridge, PCH, LPC and SATA. +* +* @return 0 if OK, -ve on error +*/ +int cpu_common_init (void ); + +/** +* cpu_set_flex_ratio_to_tdp_nominal() - Set up the maximum non-turbo rate +* +* If a change is needed, this function will do a soft reset so it takes +* effect. +* +* Some details are available here: +* http://forum.hwbot.org/showthread.php?t=76092 +* +* @return 0 if OK, -ve on error +*/ +int cpu_set_flex_ratio_to_tdp_nominal (void ); + +#endif
arch/x86/include/asm/intel_regs.h +9 -0
@@ -12,8 +12,17 @@#define MCH_BASE_SIZE 0x8000#define MCHBAR_REG (reg) (MCH_BASE_ADDRESS + (reg)) +#define MCHBAR_PEI_VERSION 0x5034 +#define MCH_PKG_POWER_LIMIT_LO 0x59a0 +#define MCH_PKG_POWER_LIMIT_HI 0x59a4 +#define MCH_DDR_POWER_LIMIT_LO 0x58e0 +#define MCH_DDR_POWER_LIMIT_HI 0x58e4 +/* Access the Root Complex Register Block */ #define RCB_BASE_ADDRESS 0xfed1c000#define RCB_REG (reg) (RCB_BASE_ADDRESS + (reg)) +#define SOFT_RESET_CTRL 0x38f4 +#define SOFT_RESET_DATA 0x38f8 +#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 22/69 x86: Move common CPU code to its own place
Hi Simon,
Quoted 21 lines · Simon Glass
Some of the Intel CPU code is common to several Intel CPUs. Move it into a common location along with required declarations.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/cpu_common.c | 111 ++++++++++++++++++++++++++++++ arch/x86/cpu/ivybridge/cpu.c | 82 ++-------------------- arch/x86/include/asm/arch-ivybridge/pch.h | 2 - arch/x86/include/asm/cpu_common.h | 35 ++++++++++ arch/x86/include/asm/intel_regs.h | 9 +++ 6 files changed, 162 insertions(+), 78 deletions(-) create mode 100644 arch/x86/cpu/intel_common/cpu_common.c create mode 100644 arch/x86/include/asm/cpu_common.harch/x86/cpu/intel_common/Makefile +0
-0
arch/x86/cpu/intel_common/Makefile line 8
Quoted 4 lines
arch/x86/cpu/intel_common/Makefile +1
-0@@ -5,6 +5,7 @@ # obj-$(CONFIG_HAVE_MRC) += car.o +obj-y += cpu_common.o
Remove _common in the name?
arch/x86/cpu/intel_common/cpu_common.c line 4
Quoted 13 lines
arch/x86/cpu/intel_common/Makefile +0
-0obj-y += lpc_common.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.oarch/x86/cpu/intel_common/cpu_common.c new file +4
-0@@ -0,0 +1,111 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
Quoted 261 lines
arch/x86/cpu/intel_common/cpu_common.c new file +107
-0+*/ + +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <asm/cpu_common.h> +#include <asm/intel_regs.h> +#include <asm/lapic.h> +#include <asm/lpc_common.h> +#include <asm/msr.h> +#include <asm/mtrr.h> +#include <asm/post.h> +#include <asm/microcode.h> + +DECLARE_GLOBAL_DATA_PTR ; + +static int report_bist_failure (void ) +{ +if (gd->arch.bist !=0 ) { +post_code (POST_BIST_FAILURE ); +printf ("BIST failed: %08x\n" , gd->arch.bist); +return -EFAULT ; + } + +return 0 ; +} + +int cpu_common_init (void ) +{ +struct udevice *dev, *lpc; +int ret; + +/* Halt if there was a built in self test failure */ + ret =report_bist_failure (); +if (ret) +return ret; + +enable_lapic (); + + ret =microcode_update_intel (); +if (ret && ret != -EEXIST ) +return ret; + +/* Enable upper 128bytes of CMOS */ +writel (1 <<2 ,RCB_REG (RC )); + +/* Early chipset init required before RAM init can work */ +uclass_first_device (UCLASS_NORTHBRIDGE , &dev); + + ret =uclass_first_device (UCLASS_LPC , &lpc); +if (ret) +return ret; +if (!lpc) +return -ENODEV ; + +/* Cause the SATA device to do its early init */ +uclass_first_device (UCLASS_DISK , &dev); + +return 0 ; +} + +int cpu_set_flex_ratio_to_tdp_nominal (void ) +{ +msr_t flex_ratio, msr; +u8 nominal_ratio; + +/* Check for Flex Ratio support */ + flex_ratio =msr_read (MSR_FLEX_RATIO ); +if (!(flex_ratio.lo &FLEX_RATIO_EN )) +return -EINVAL ; + +/* Check for >0 configurable TDPs */ + msr =msr_read (MSR_PLATFORM_INFO ); +if (((msr.hi >>1 ) &3 ) ==0 ) +return -EINVAL ; + +/* Use nominal TDP ratio for flex ratio */ + msr =msr_read (MSR_CONFIG_TDP_NOMINAL ); + nominal_ratio = msr.lo &0xff ; + +/* See if flex ratio is already set to nominal TDP ratio */ +if (((flex_ratio.lo >>8 ) &0xff ) == nominal_ratio) +return 0 ; + +/* Set flex ratio to nominal TDP ratio */ + flex_ratio.lo &= ~0xff00 ; + flex_ratio.lo |= nominal_ratio <<8 ; + flex_ratio.lo |=FLEX_RATIO_LOCK ; +msr_write (MSR_FLEX_RATIO , flex_ratio); + +/* Set flex ratio in soft reset data register bits 11:6 */ +clrsetbits_le32 (RCB_REG (SOFT_RESET_DATA ),0x3f <<6 , + (nominal_ratio &0x3f ) <<6 ); + +debug ("CPU: Soft reset to set up flex ratio\n" ); + +/* Set soft reset control to use register value */ +setbits_le32 (RCB_REG (SOFT_RESET_CTRL ),1 ); + +/* Issue warm reset, will be "CPU only" due to soft reset data */ +outb (0x0 ,PORT_RESET ); +outb (SYS_RST |RST_CPU ,PORT_RESET ); +cpu_hlt (); + +/* Not reached */ +return -EINVAL ; +}arch/x86/cpu/ivybridge/cpu.c +6
-76@@ -17,6 +17,7 @@#include <fdtdec.h> #include <pch.h> #include <asm/cpu.h> +#include <asm/cpu_common.h> #include <asm/intel_regs.h> #include <asm/io.h> #include <asm/lapic.h> @@ -34,51 +35,11 @@ DECLARE_GLOBAL_DATA_PTR;static int set_flex_ratio_to_tdp_nominal (void ) { -msr_t flex_ratio, msr; -u8 nominal_ratio; -/* Minimum CPU revision for configurable TDP support */ if (cpuid_eax (1 ) <IVB_CONFIG_TDP_MIN_CPUID )return -EINVAL ; -/* Check for Flex Ratio support */ - flex_ratio =msr_read (MSR_FLEX_RATIO ); -if (!(flex_ratio.lo &FLEX_RATIO_EN )) -return -EINVAL ; - -/* Check for >0 configurable TDPs */ - msr =msr_read (MSR_PLATFORM_INFO ); -if (((msr.hi >>1 ) &3 ) ==0 ) -return -EINVAL ; - -/* Use nominal TDP ratio for flex ratio */ - msr =msr_read (MSR_CONFIG_TDP_NOMINAL ); - nominal_ratio = msr.lo &0xff ; - -/* See if flex ratio is already set to nominal TDP ratio */ -if (((flex_ratio.lo >>8 ) &0xff ) == nominal_ratio) -return 0 ; - -/* Set flex ratio to nominal TDP ratio */ - flex_ratio.lo &= ~0xff00 ; - flex_ratio.lo |= nominal_ratio <<8 ; - flex_ratio.lo |=FLEX_RATIO_LOCK ; -msr_write (MSR_FLEX_RATIO , flex_ratio); - -/* Set flex ratio in soft reset data register bits 11:6 */ -clrsetbits_le32 (RCB_REG (SOFT_RESET_DATA ),0x3f <<6 , - (nominal_ratio &0x3f ) <<6 ); - -/* Set soft reset control to use register value */ -setbits_le32 (RCB_REG (SOFT_RESET_CTRL ),1 ); - -/* Issue warm reset, will be "CPU only" due to soft reset data */ -outb (0x0 ,PORT_RESET ); -outb (SYS_RST |RST_CPU ,PORT_RESET ); -cpu_hlt (); - -/* Not reached */ -return -EINVAL ; +return cpu_set_flex_ratio_to_tdp_nominal (); }int arch_cpu_init (void )@@ -163,17 +124,6 @@ static void enable_usb_bar(struct udevice *bus)pci_bus_write_config (bus, usb3,PCI_COMMAND , cmd,PCI_SIZE_32 ); } -static int report_bist_failure (void ) -{ -if (gd->arch.bist !=0 ) { -post_code (POST_BIST_FAILURE ); -printf ("BIST failed: %08x\n" , gd->arch.bist); -return -EFAULT ; - } - -return 0 ; -} -int print_cpuinfo (void ) {enum pei_boot_mode_t boot_mode =PEI_BOOT_NONE ;@@ -184,20 +134,6 @@ int print_cpuinfo(void)uint16_t pm1_sts;int ret; -/* Halt if there was a built in self test failure */ - ret =report_bist_failure (); -if (ret) -return ret; - -enable_lapic (); - - ret =microcode_update_intel (); -if (ret) -return ret; - -/* Enable upper 128bytes of CMOS */ -writel (1 <<2 ,RCB_REG (RC )); -/* TODO: cmos_post_init() */ if (readl (MCHBAR_REG (SSKPD )) ==0xCAFE ) {debug ("soft reset detected\n" );@@ -208,17 +144,9 @@ int print_cpuinfo(void)reset_cpu (0 ); } -/* Early chipset init required before RAM init can work */ -uclass_first_device (UCLASS_NORTHBRIDGE , &dev); - - ret =uclass_first_device (UCLASS_LPC , &lpc); + ret =cpu_common_init ();if (ret)return ret; -if (!dev) -return -ENODEV ; - -/* Cause the SATA device to do its early init */ -uclass_first_device (UCLASS_DISK , &dev);/* Check PM1_STS[15] to see if we are waking from Sx */ pm1_sts =inw (DEFAULT_PMBASE +PM1_STS );@@ -244,8 +172,10 @@ int print_cpuinfo(void)return -ENODEV ;/* Prepare USB controller early in S3 resume */ -if (boot_mode ==PEI_BOOT_RESUME ) +if (boot_mode ==PEI_BOOT_RESUME ) { +uclass_first_device (UCLASS_LPC , &lpc);enable_usb_bar (pci_get_controller (lpc->parent)); + } gd->arch.pei_boot_mode = boot_mode;arch/x86/include/asm/arch-ivybridge/pch.h +0
-2@@ -332,8 +332,6 @@#define SPI_FREQ_SWSEQ 0x3893#define SPI_DESC_COMP0 0x38b0#define SPI_FREQ_WR_ERA 0x38b4 -#define SOFT_RESET_CTRL 0x38f4 -#define SOFT_RESET_DATA 0x38f8#define DIR_ROUTE (a, b, c, d) \ (((d) << DIR_IDR) | ((c) << DIR_ICR) | \arch/x86/include/asm/cpu_common.h new file +0
-0
arch/x86/include/asm/cpu_common.h line 4
Quoted 4 lines
arch/x86/include/asm/cpu_common.h new file +4
-0@@ -0,0 +1,35 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
arch/x86/include/asm/cpu_common.h line 8
Quoted 4 lines
arch/x86/include/asm/cpu_common.h new file +4
-0+*/ + +#ifndef __asm_cpu_common_h +#define __asm_cpu_common_h
nits: all capital letters
Quoted 40 lines
arch/x86/include/asm/cpu_common.h new file +27
-0+ +#define IA32_PERF_CTL 0x199 + +/** +* cpu_common_init() - Set up common CPU init +* +* This reports BIST failure, enables the LAPIC, updates microcode, enables +* the upper 128-bytes of CROM RAM, probes the northbridge, PCH, LPC and SATA. +* +* @return 0 if OK, -ve on error +*/ +int cpu_common_init (void ); + +/** +* cpu_set_flex_ratio_to_tdp_nominal() - Set up the maximum non-turbo rate +* +* If a change is needed, this function will do a soft reset so it takes +* effect. +* +* Some details are available here: +* http://forum.hwbot.org/showthread.php?t=76092 +* +* @return 0 if OK, -ve on error +*/ +int cpu_set_flex_ratio_to_tdp_nominal (void ); + +#endif arch/x86/include/asm/intel_regs.h +5
-0@@ -12,8 +12,17 @@#define MCH_BASE_SIZE 0x8000#define MCHBAR_REG (reg) (MCH_BASE_ADDRESS + (reg)) +#define MCHBAR_PEI_VERSION 0x5034 +#define MCH_PKG_POWER_LIMIT_LO 0x59a0 +#define MCH_PKG_POWER_LIMIT_HI 0x59a4 +#define MCH_DDR_POWER_LIMIT_LO 0x58e0 +#define MCH_DDR_POWER_LIMIT_HI 0x58e4
arch/x86/include/asm/intel_regs.h
Quoted 10 lines
arch/x86/include/asm/intel_regs.h +4
-1+/* Access the Root Complex Register Block */ #define RCB_BASE_ADDRESS 0xfed1c000#define RCB_REG (reg) (RCB_BASE_ADDRESS + (reg)) +#define SOFT_RESET_CTRL 0x38f4 +#define SOFT_RESET_DATA 0x38f8 +#endif --
Other than these,
Regards,
Bin
PATCH 23/69 x86: Rename PORT_RESET to IO_PORT_RESET
In reply to Simon GlassThis same name is used in USB. Add a prefix to distinguish it.
---
arch/x86/cpu/cpu.c | 4 ++-- arch/x86/cpu/intel_common/cpu_common.c | 4 ++-- arch/x86/include/asm/processor.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
arch/x86/cpu/cpu.c +2 -2
@@ -469,14 +469,14 @@ void flush_cache(unsigned long dummy1, unsigned long dummy2)__weak void reset_cpu (ulong addr) {/* Do a hard reset through the chipset's reset control register */ -outb (SYS_RST |RST_CPU ,PORT_RESET ); +outb (SYS_RST |RST_CPU ,IO_PORT_RESET );for (;;)cpu_hlt (); }void x86_full_reset (void ) { -outb (FULL_RST |SYS_RST |RST_CPU ,PORT_RESET ); +outb (FULL_RST |SYS_RST |RST_CPU ,IO_PORT_RESET ); }int dcache_status (void )
arch/x86/cpu/intel_common/cpu_common.c +2 -2
@@ -102,8 +102,8 @@ int cpu_set_flex_ratio_to_tdp_nominal(void)setbits_le32 (RCB_REG (SOFT_RESET_CTRL ),1 );/* Issue warm reset, will be "CPU only" due to soft reset data */ -outb (0x0 ,PORT_RESET ); -outb (SYS_RST |RST_CPU ,PORT_RESET ); +outb (0x0 ,IO_PORT_RESET ); +outb (SYS_RST |RST_CPU ,IO_PORT_RESET );cpu_hlt ();/* Not reached */
arch/x86/include/asm/processor.h +1 -1
@@ -36,7 +36,7 @@* * The naming follows Intel's naming. */ -#define PORT_RESET 0xcf9 +#define IO_PORT_RESET 0xcf9enum {SYS_RST =1 <<1 ,/* 0 for soft reset, 1 for hard reset */
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 23/69 x86: Rename PORT_RESET to IO_PORT_RESET
Quoted 10 lines · Simon Glass
This same name is used in USB. Add a prefix to distinguish it.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/cpu.c | 4 ++-- arch/x86/cpu/intel_common/cpu_common.c | 4 ++-- arch/x86/include/asm/processor.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
PATCH 24/69 x86: Move Intel Management Engine code to a common place
In reply to Simon GlassSome of the Intel ME code is common to several Intel CPUs. Move it into a common location. Add a header file for report_platform.c also.
---
arch/x86/cpu/intel_common/Makefile | 2 +
.../cpu/{ivybridge => intel_common}/me_status.c | 20 +-
.../{ivybridge => intel_common}/report_platform.c | 2 +-
arch/x86/cpu/ivybridge/Makefile | 2 -
arch/x86/cpu/ivybridge/early_me.c | 31 +-
arch/x86/cpu/ivybridge/sdram.c | 3 +-
arch/x86/include/asm/arch-ivybridge/me.h | 333 +-----------------
arch/x86/include/asm/arch-ivybridge/sandybridge.h | 2 -
arch/x86/include/asm/me_common.h | 372 +++++++++++++++++++++
arch/x86/include/asm/report_platform.h | 19 ++
10 files changed, 417 insertions(+), 369 deletions(-)
rename arch/x86/cpu/{ivybridge => intel_common}/me_status.c (93%)
rename arch/x86/cpu/{ivybridge => intel_common}/report_platform.c (98%)
create mode 100644 arch/x86/include/asm/me_common.h
create mode 100644 arch/x86/include/asm/report_platform.harch/x86/cpu/intel_common/Makefile +2 -0
@@ -7,6 +7,8 @@ obj-$(CONFIG_HAVE_MRC) += car.o obj-y += cpu_common.o obj-y += lpc_common.o +obj-$(CONFIG_HAVE_MRC) += me_status.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.o endif +obj-$(CONFIG_HAVE_MRC) += report_platform.o
arch/x86/cpu/intel_common/me_status.c renamed from arch/x86/cpu/ivybridge/me_status.c +19 -1
@@ -128,7 +128,14 @@ static const char *const me_progress_policy_values[] = { [0x10] = "Required VSCC values for flash parts do not match", }; -void intel_me_status (struct me_hfs *hfs,struct me_gmes *gmes) + +/** +* _intel_me_status() - Check Intel Management Engine status +* +* struct hfs: Firmware status +* struct gmes: Management engine status +*/ +static void _intel_me_status (struct me_hfs *hfs,struct me_gmes *gmes) {/* Check Current States */ debug("ME: FW Partition Table : %s\n",
@@ -193,3 +200,14 @@ void intel_me_status(struct me_hfs *hfs, struct me_gmes *gmes) }debug ("\n" ); } + +void intel_me_status (struct udevice *me_dev) +{ +struct me_hfs hfs; +struct me_gmes gmes; + +pci_read_dword_ptr (me_dev, &hfs,PCI_ME_HFS ); +pci_read_dword_ptr (me_dev, &gmes,PCI_ME_GMES ); + +_intel_me_status (&hfs, &gmes); +}
arch/x86/cpu/intel_common/report_platform.c renamed from arch/x86/cpu/ivybridge/report_platform.c +1 -1
@@ -9,8 +9,8 @@#include <common.h> #include <asm/cpu.h> #include <asm/pci.h> +#include <asm/report_platform.h> #include <asm/arch/pch.h> -#include <asm/arch/sandybridge.h> static void report_cpu_info (void ) {
arch/x86/cpu/ivybridge/Makefile +0 -2
@@ -11,10 +11,8 @@ obj-y += cpu.o obj-y += early_me.o obj-y += gma.o obj-y += lpc.o -obj-y += me_status.o obj-y += model_206ax.o obj-y += northbridge.o -obj-y += report_platform.o obj-y += sata.o obj-y += sdram.o endif
arch/x86/cpu/ivybridge/early_me.c +1 -30
@@ -27,35 +27,6 @@ static const char *const me_ack_values[] = { [ME_HFS_ACK_CONTINUE] = "Continue to boot" }; -static inline void pci_read_dword_ptr (struct udevice *me_dev,void *ptr, -int offset) -{ -u32 dword; - -dm_pci_read_config32 (me_dev, offset, &dword); -memcpy (ptr, &dword,sizeof (dword)); -} - -static inline void pci_write_dword_ptr (struct udevice *me_dev,void *ptr, -int offset) -{ -u32 dword =0 ; - -memcpy (&dword, ptr,sizeof (dword)); -dm_pci_write_config32 (me_dev, offset, dword); -} - -void intel_early_me_status (struct udevice *me_dev) -{ -struct me_hfs hfs; -struct me_gmes gmes; - -pci_read_dword_ptr (me_dev, &hfs,PCI_ME_HFS ); -pci_read_dword_ptr (me_dev, &gmes,PCI_ME_GMES ); - -intel_me_status (&hfs, &gmes); -} -int intel_early_me_init (struct udevice *me_dev) {int count;
@@ -159,7 +130,7 @@ int intel_early_me_init_done(struct udevice *dev, struct udevice *me_dev,debug ("ME: Requested BIOS Action: %s\n" , me_ack_values[hfs.ack_data]);/* Check status after acknowledgement */ -intel_early_me_status (me_dev); +intel_me_status (me_dev);switch (hfs.ack_data) {case ME_HFS_ACK_CONTINUE :
arch/x86/cpu/ivybridge/sdram.c +2 -1
@@ -27,6 +27,7 @@#include <asm/mrccache.h> #include <asm/mtrr.h> #include <asm/pci.h> +#include <asm/report_platform.h> #include <asm/arch/me.h> #include <asm/arch/pei_data.h> #include <asm/arch/pch.h>
@@ -384,7 +385,7 @@ int sdram_initialise(struct udevice *dev, struct udevice *me_dev,if (BASE_REV_SNB == done)intel_early_me_init_done (dev, me_dev,ME_INIT_STATUS_SUCCESS );else -intel_early_me_status (me_dev); +intel_me_status (me_dev);post_system_agent_init (pei_data);report_memory_config ();
arch/x86/include/asm/arch-ivybridge/me.h +1 -332
355 lines not on this page · raw message
arch/x86/include/asm/arch-ivybridge/sandybridge.h +0 -2
@@ -113,8 +113,6 @@*/ int bridge_silicon_revision (struct udevice *dev); -void report_platform_info (struct udevice *dev); -void sandybridge_early_init (int chipset_type);#endif
arch/x86/include/asm/me_common.h new file +372 -0
372 lines not on this page · raw message
arch/x86/include/asm/report_platform.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#ifndef __arch_report_platform_h +#define __arch_report_platform_h + +/** +* report_platform_info() - Report platform information +* +* This reports information about the CPU and chipset. +* +* @dev: Northbridge device +*/ +void report_platform_info (struct udevice *dev); + +#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 24/69 x86: Move Intel Management Engine code to a common place
Hi Simon,
Quoted 60 lines · Simon Glass
Some of the Intel ME code is common to several Intel CPUs. Move it into a common location. Add a header file for
report_platform.calso.Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/Makefile | 2 + .../cpu/{ivybridge => intel_common}/me_status.c | 20 +- .../{ivybridge => intel_common}/report_platform.c | 2 +- arch/x86/cpu/ivybridge/Makefile | 2 - arch/x86/cpu/ivybridge/early_me.c | 31 +- arch/x86/cpu/ivybridge/sdram.c | 3 +- arch/x86/include/asm/arch-ivybridge/me.h | 333 +----------------- arch/x86/include/asm/arch-ivybridge/sandybridge.h | 2 - arch/x86/include/asm/me_common.h | 372 +++++++++++++++++++++ arch/x86/include/asm/report_platform.h | 19 ++ 10 files changed, 417 insertions(+), 369 deletions(-) rename arch/x86/cpu/{ivybridge => intel_common}/me_status.c (93%) rename arch/x86/cpu/{ivybridge => intel_common}/report_platform.c (98%) create mode 100644 arch/x86/include/asm/me_common.h create mode 100644 arch/x86/include/asm/report_platform.harch/x86/cpu/intel_common/Makefile +2
-0@@ -7,6 +7,8 @@ obj-$(CONFIG_HAVE_MRC) += car.o obj-y += cpu_common.o obj-y += lpc_common.o +obj-$(CONFIG_HAVE_MRC) += me_status.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.o endif +obj-$(CONFIG_HAVE_MRC) += report_platform.oarch/x86/cpu/intel_common/me_status.c renamed from arch/x86/cpu/ivybridge/me_status.c +8
-1@@ -128,7 +128,14 @@ static const char *const me_progress_policy_values[] = { [0x10] = "Required VSCC values for flash parts do not match", }; -void intel_me_status (struct me_hfs *hfs,struct me_gmes *gmes) + +/** +* _intel_me_status() - Check Intel Management Engine status +* +* struct hfs: Firmware status +* struct gmes: Management engine status +*/ +static void _intel_me_status (struct me_hfs *hfs,struct me_gmes *gmes) {/* Check Current States */ debug("ME: FW Partition Table : %s\n",@@ -193,3 +200,14 @@ void intel_me_status(struct me_hfs *hfs, struct me_gmes *gmes) }
arch/x86/cpu/intel_common/me_status.c void intel_me_status(struct me_hfs *hfs, struct me_gmes *gmes) · line 210
Quoted 10 lines
arch/x86/cpu/intel_common/me_status.c renamed from arch/x86/cpu/ivybridge/me_status.c +8
-0debug ("\n" ); } + +void intel_me_status (struct udevice *me_dev) +{ +struct me_hfs hfs; +struct me_gmes gmes; + +pci_read_dword_ptr (me_dev, &hfs,PCI_ME_HFS ); +pci_read_dword_ptr (me_dev, &gmes,PCI_ME_GMES );
The call to pci_read_dword_ptr() looks odd. Why not use the dm_pci_xx APIs directly?
Quoted 487 lines
arch/x86/cpu/intel_common/me_status.c renamed from arch/x86/cpu/ivybridge/me_status.c +3
-0+ +_intel_me_status (&hfs, &gmes); +}arch/x86/cpu/intel_common/report_platform.c renamed from arch/x86/cpu/ivybridge/report_platform.c +1
-1@@ -9,8 +9,8 @@#include <common.h> #include <asm/cpu.h> #include <asm/pci.h> +#include <asm/report_platform.h> #include <asm/arch/pch.h> -#include <asm/arch/sandybridge.h> static void report_cpu_info (void ) {arch/x86/cpu/ivybridge/Makefile +0
-2@@ -11,10 +11,8 @@ obj-y += cpu.o obj-y += early_me.o obj-y += gma.o obj-y += lpc.o -obj-y += me_status.o obj-y += model_206ax.o obj-y += northbridge.o -obj-y += report_platform.o obj-y += sata.o obj-y += sdram.o endifarch/x86/cpu/ivybridge/early_me.c +1
-30@@ -27,35 +27,6 @@ static const char *const me_ack_values[] = { [ME_HFS_ACK_CONTINUE] = "Continue to boot" }; -static inline void pci_read_dword_ptr (struct udevice *me_dev,void *ptr, -int offset) -{ -u32 dword; - -dm_pci_read_config32 (me_dev, offset, &dword); -memcpy (ptr, &dword,sizeof (dword)); -} - -static inline void pci_write_dword_ptr (struct udevice *me_dev,void *ptr, -int offset) -{ -u32 dword =0 ; - -memcpy (&dword, ptr,sizeof (dword)); -dm_pci_write_config32 (me_dev, offset, dword); -} - -void intel_early_me_status (struct udevice *me_dev) -{ -struct me_hfs hfs; -struct me_gmes gmes; - -pci_read_dword_ptr (me_dev, &hfs,PCI_ME_HFS ); -pci_read_dword_ptr (me_dev, &gmes,PCI_ME_GMES ); - -intel_me_status (&hfs, &gmes); -} -int intel_early_me_init (struct udevice *me_dev) {int count;@@ -159,7 +130,7 @@ int intel_early_me_init_done(struct udevice *dev, struct udevice *me_dev,debug ("ME: Requested BIOS Action: %s\n" , me_ack_values[hfs.ack_data]);/* Check status after acknowledgement */ -intel_early_me_status (me_dev); +intel_me_status (me_dev);switch (hfs.ack_data) {case ME_HFS_ACK_CONTINUE :arch/x86/cpu/ivybridge/sdram.c +2
-1@@ -27,6 +27,7 @@#include <asm/mrccache.h> #include <asm/mtrr.h> #include <asm/pci.h> +#include <asm/report_platform.h> #include <asm/arch/me.h> #include <asm/arch/pei_data.h> #include <asm/arch/pch.h> @@ -384,7 +385,7 @@ int sdram_initialise(struct udevice *dev, struct udevice *me_dev,if (BASE_REV_SNB == done)intel_early_me_init_done (dev, me_dev,ME_INIT_STATUS_SUCCESS );else -intel_early_me_status (me_dev); +intel_me_status (me_dev);post_system_agent_init (pei_data);report_memory_config ();arch/x86/include/asm/arch-ivybridge/me.h +1
-332@@ -9,225 +9,7 @@#ifndef _ASM_INTEL_ME_H#define _ASM_INTEL_ME_H -#include <linux/compiler.h> -#include <linux/types.h> - -#define ME_RETRY 100000/* 1 second */ -#define ME_DELAY 10/* 10 us */ - -/* -* Management Engine PCI registers -*/ - -#define PCI_CPU_MEBASE_L 0x70/* Set by MRC */ -#define PCI_CPU_MEBASE_H 0x74/* Set by MRC */ - -#define PCI_ME_HFS 0x40 -#define ME_HFS_CWS_RESET 0 -#define ME_HFS_CWS_INIT 1 -#define ME_HFS_CWS_REC 2 -#define ME_HFS_CWS_NORMAL 5 -#define ME_HFS_CWS_WAIT 6 -#define ME_HFS_CWS_TRANS 7 -#define ME_HFS_CWS_INVALID 8 -#define ME_HFS_STATE_PREBOOT 0 -#define ME_HFS_STATE_M0_UMA 1 -#define ME_HFS_STATE_M3 4 -#define ME_HFS_STATE_M0 5 -#define ME_HFS_STATE_BRINGUP 6 -#define ME_HFS_STATE_ERROR 7 -#define ME_HFS_ERROR_NONE 0 -#define ME_HFS_ERROR_UNCAT 1 -#define ME_HFS_ERROR_IMAGE 3 -#define ME_HFS_ERROR_DEBUG 4 -#define ME_HFS_MODE_NORMAL 0 -#define ME_HFS_MODE_DEBUG 2 -#define ME_HFS_MODE_DIS 3 -#define ME_HFS_MODE_OVER_JMPR 4 -#define ME_HFS_MODE_OVER_MEI 5 -#define ME_HFS_BIOS_DRAM_ACK 1 -#define ME_HFS_ACK_NO_DID 0 -#define ME_HFS_ACK_RESET 1 -#define ME_HFS_ACK_PWR_CYCLE 2 -#define ME_HFS_ACK_S3 3 -#define ME_HFS_ACK_S4 4 -#define ME_HFS_ACK_S5 5 -#define ME_HFS_ACK_GBL_RESET 6 -#define ME_HFS_ACK_CONTINUE 7 - -struct me_hfs { -u32 working_state:4 ; -u32 mfg_mode:1 ; -u32 fpt_bad:1 ; -u32 operation_state:3 ; -u32 fw_init_complete:1 ; -u32 ft_bup_ld_flr:1 ; -u32 update_in_progress:1 ; -u32 error_code:4 ; -u32 operation_mode:4 ; -u32 reserved:4 ; -u32 boot_options_present:1 ; -u32 ack_data:3 ; -u32 bios_msg_ack:4 ; -} __packed; - -#define PCI_ME_UMA 0x44 - -struct me_uma { -u32 size:6 ; -u32 reserved_1:10 ; -u32 valid:1 ; -u32 reserved_0:14 ; -u32 set_to_one:1 ; -} __packed; - -#define PCI_ME_H_GS 0x4c -#define ME_INIT_DONE 1 -#define ME_INIT_STATUS_SUCCESS 0 -#define ME_INIT_STATUS_NOMEM 1 -#define ME_INIT_STATUS_ERROR 2 - -struct me_did { -u32 uma_base:16 ; -u32 reserved:8 ; -u32 status:4 ; -u32 init_done:4 ; -} __packed; - -#define PCI_ME_GMES 0x48 -#define ME_GMES_PHASE_ROM 0 -#define ME_GMES_PHASE_BUP 1 -#define ME_GMES_PHASE_UKERNEL 2 -#define ME_GMES_PHASE_POLICY 3 -#define ME_GMES_PHASE_MODULE 4 -#define ME_GMES_PHASE_UNKNOWN 5 -#define ME_GMES_PHASE_HOST 6 - -struct me_gmes { -u32 bist_in_prog:1 ; -u32 icc_prog_sts:2 ; -u32 invoke_mebx:1 ; -u32 cpu_replaced_sts:1 ; -u32 mbp_rdy:1 ; -u32 mfs_failure:1 ; -u32 warm_rst_req_for_df:1 ; -u32 cpu_replaced_valid:1 ; -u32 reserved_1:2 ; -u32 fw_upd_ipu:1 ; -u32 reserved_2:4 ; -u32 current_state:8 ; -u32 current_pmevent:4 ; -u32 progress_code:4 ; -} __packed; - -#define PCI_ME_HERES 0xbc -#define PCI_ME_EXT_SHA1 0x00 -#define PCI_ME_EXT_SHA256 0x02 -#define PCI_ME_HER (x) (0xc0+(4*(x))) - -struct me_heres { -u32 extend_reg_algorithm:4 ; -u32 reserved:26 ; -u32 extend_feature_present:1 ; -u32 extend_reg_valid:1 ; -} __packed; - -/* -* Management Engine MEI registers -*/ - -#define MEI_H_CB_WW 0x00 -#define MEI_H_CSR 0x04 -#define MEI_ME_CB_RW 0x08 -#define MEI_ME_CSR_HA 0x0c - -struct mei_csr { -u32 interrupt_enable:1 ; -u32 interrupt_status:1 ; -u32 interrupt_generate:1 ; -u32 ready:1 ; -u32 reset:1 ; -u32 reserved:3 ; -u32 buffer_read_ptr:8 ; -u32 buffer_write_ptr:8 ; -u32 buffer_depth:8 ; -} __packed; - -#define MEI_ADDRESS_CORE 0x01 -#define MEI_ADDRESS_AMT 0x02 -#define MEI_ADDRESS_RESERVED 0x03 -#define MEI_ADDRESS_WDT 0x04 -#define MEI_ADDRESS_MKHI 0x07 -#define MEI_ADDRESS_ICC 0x08 -#define MEI_ADDRESS_THERMAL 0x09 - -#define MEI_HOST_ADDRESS 0 - -struct mei_header { -u32 client_address:8 ; -u32 host_address:8 ; -u32 length:9 ; -u32 reserved:6 ; -u32 is_complete:1 ; -} __packed; - -#define MKHI_GROUP_ID_CBM 0x00 -#define MKHI_GROUP_ID_FWCAPS 0x03 -#define MKHI_GROUP_ID_MDES 0x08 -#define MKHI_GROUP_ID_GEN 0xff - -#define MKHI_GLOBAL_RESET 0x0b - -#define MKHI_FWCAPS_GET_RULE 0x02 - -#define MKHI_MDES_ENABLE 0x09 - -#define MKHI_GET_FW_VERSION 0x02 -#define MKHI_END_OF_POST 0x0c -#define MKHI_FEATURE_OVERRIDE 0x14 - -struct mkhi_header { -u32 group_id:8 ; -u32 command:7 ; -u32 is_response:1 ; -u32 reserved:8 ; -u32 result:8 ; -} __packed; - -struct me_fw_version { -u16 code_minor; -u16 code_major; -u16 code_build_number; -u16 code_hot_fix; -u16 recovery_minor; -u16 recovery_major; -u16 recovery_build_number; -u16 recovery_hot_fix; -} __packed; - - -#define HECI_EOP_STATUS_SUCCESS 0x0 -#define HECI_EOP_PERFORM_GLOBAL_RESET 0x1 - -#define CBM_RR_GLOBAL_RESET 0x01 - -#define GLOBAL_RESET_BIOS_MRC 0x01 -#define GLOBAL_RESET_BIOS_POST 0x02 -#define GLOBAL_RESET_MEBX 0x03 - -struct me_global_reset { -u8 request_origin; -u8 reset_type; -} __packed; - -enum me_bios_path { -ME_NORMAL_BIOS_PATH , -ME_S3WAKE_BIOS_PATH , -ME_ERROR_BIOS_PATH , -ME_RECOVERY_BIOS_PATH , -ME_DISABLE_BIOS_PATH , -ME_FIRMWARE_UPDATE_BIOS_PATH , -}; +#include <asm/me_common.h> struct __packed mbp_fw_version_name { u32 major_version:16;@@ -244,46 +26,6 @@ struct __packed mbp_icc_profile {u32 register_lock_mask[3 ]; }; -struct __packed mefwcaps_sku { - u32 full_net:1; - u32 std_net:1; - u32 manageability:1; - u32 small_business:1; - u32 l3manageability:1; - u32 intel_at:1; - u32 intel_cls:1; - u32 reserved:3; - u32 intel_mpc:1; - u32 icc_over_clocking:1; - u32 pavp:1; - u32 reserved_1:4; - u32 ipv6:1; - u32 kvm:1; - u32 och:1; - u32 vlan:1; - u32 tls:1; - u32 reserved_4:1; - u32 wlan:1; - u32 reserved_5:8; -}; - -struct __packed tdt_state_flag { - u16 lock_state:1; - u16 authenticate_module:1; - u16 s3authentication:1; - u16 flash_wear_out:1; - u16 flash_variable_security:1; - u16 wwan3gpresent:1; - u16 wwan3goob:1; - u16 reserved:9; -}; - -struct __packed tdt_state_info { -u8 state; -u8 last_theft_trigger; -struct tdt_state_flag flags; -}; -struct __packed platform_type_rule_data { u32 platform_target_usage_type:4; u32 platform_target_market_type:2;@@ -299,16 +41,6 @@ struct __packed mbp_fw_caps {u8 available; }; -struct __packed mbp_rom_bist_data { -u16 device_id; -u16 fuse_test_flags; -u32 umchid[4 ]; -}; - -struct __packed mbp_platform_key { -u32 key[8 ]; -}; -struct __packed mbp_plat_type {struct platform_type_rule_data rule_data;u8 available;@@ -325,67 +57,4 @@ struct __packed me_bios_payload { u32 mfsintegrity; }; -struct __packed mbp_header { - u32 mbp_size:8; - u32 num_entries:8; - u32 rsvd:16; -}; - -struct __packed mbp_item_header { - u32 app_id:8; - u32 item_id:8; - u32 length:8; - u32 rsvd:8; -}; - -struct __packed me_fwcaps { -u32 id; -u8 length; -struct mefwcaps_sku caps_sku; -u8 reserved[3 ]; -}; - -/** -* intel_me_status() - Check Intel Management Engine status -* -* struct hfs: Firmware status -* struct gmes: Management engine status -*/ -void intel_me_status (struct me_hfs *hfs,struct me_gmes *gmes); - -/** -* intel_early_me_status() - Check early Management Engine Status -* -* @me_dev: Management engine PCI device -*/ -void intel_early_me_status (struct udevice *me_dev); - -/** -* intel_early_me_init() - Early Intel Management Engine init -* -* @me_dev: Management engine PCI device -* @return 0 if OK, -ve on error -*/ -int intel_early_me_init (struct udevice *me_dev); - -/** -* intel_early_me_uma_size() - Get UMA size from the Intel Management Engine -* -* @me_dev: Management engine PCI device -* @return UMA size if OK, -EINVAL on error -*/ -int intel_early_me_uma_size (struct udevice *me_dev); - -/** -* intel_early_me_init_done() - Complete Intel Management Engine init -* -* @dev: Northbridge device -* @me_dev: Management engine PCI device -* @status: Status result (ME_INIT_...) -* @return 0 to continue to boot, -EINVAL on unknown result data, -ETIMEDOUT -* if ME did not respond -*/ -int intel_early_me_init_done (struct udevice *dev,struct udevice *me_dev, -uint status); -#endif arch/x86/include/asm/arch-ivybridge/sandybridge.h +0
-2@@ -113,8 +113,6 @@*/ int bridge_silicon_revision (struct udevice *dev); -void report_platform_info (struct udevice *dev); -void sandybridge_early_init (int chipset_type);#endif arch/x86/include/asm/me_common.h new file +0
-0
arch/x86/include/asm/me_common.h line 10
Quoted 10 lines
arch/x86/include/asm/me_common.h new file +10
-0@@ -0,0 +1,372 @@ +/* +* From Coreboot src/southbridge/intel/bd82x6x/me.h +* +* Coreboot copies lots of code around. Here we are trying to keep the common +* code in a separate file to reduce code duplication and hopefully make it +* easier to add new platform. +* +* Copyright (C) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
arch/x86/include/asm/me_common.h line 14
Quoted 4 lines
arch/x86/include/asm/me_common.h new file +4
-0+*/ + +#ifndef __asm_me_common_h +#define __asm_me_common_h
nits: all capital letters
Quoted 364 lines
arch/x86/include/asm/me_common.h new file +358
-0+ +#include <linux/compiler.h> +#include <linux/types.h> + +#define MCHBAR_PEI_VERSION 0x5034 + +#define ME_RETRY 100000/* 1 second */ +#define ME_DELAY 10/* 10 us */ + +/* +* Management Engine PCI registers +*/ + +#define PCI_CPU_MEBASE_L 0x70/* Set by MRC */ +#define PCI_CPU_MEBASE_H 0x74/* Set by MRC */ + +#define PCI_ME_HFS 0x40 +#define ME_HFS_CWS_RESET 0 +#define ME_HFS_CWS_INIT 1 +#define ME_HFS_CWS_REC 2 +#define ME_HFS_CWS_NORMAL 5 +#define ME_HFS_CWS_WAIT 6 +#define ME_HFS_CWS_TRANS 7 +#define ME_HFS_CWS_INVALID 8 +#define ME_HFS_STATE_PREBOOT 0 +#define ME_HFS_STATE_M0_UMA 1 +#define ME_HFS_STATE_M3 4 +#define ME_HFS_STATE_M0 5 +#define ME_HFS_STATE_BRINGUP 6 +#define ME_HFS_STATE_ERROR 7 +#define ME_HFS_ERROR_NONE 0 +#define ME_HFS_ERROR_UNCAT 1 +#define ME_HFS_ERROR_IMAGE 3 +#define ME_HFS_ERROR_DEBUG 4 +#define ME_HFS_MODE_NORMAL 0 +#define ME_HFS_MODE_DEBUG 2 +#define ME_HFS_MODE_DIS 3 +#define ME_HFS_MODE_OVER_JMPR 4 +#define ME_HFS_MODE_OVER_MEI 5 +#define ME_HFS_BIOS_DRAM_ACK 1 +#define ME_HFS_ACK_NO_DID 0 +#define ME_HFS_ACK_RESET 1 +#define ME_HFS_ACK_PWR_CYCLE 2 +#define ME_HFS_ACK_S3 3 +#define ME_HFS_ACK_S4 4 +#define ME_HFS_ACK_S5 5 +#define ME_HFS_ACK_GBL_RESET 6 +#define ME_HFS_ACK_CONTINUE 7 + +struct me_hfs { +u32 working_state:4 ; +u32 mfg_mode:1 ; +u32 fpt_bad:1 ; +u32 operation_state:3 ; +u32 fw_init_complete:1 ; +u32 ft_bup_ld_flr:1 ; +u32 update_in_progress:1 ; +u32 error_code:4 ; +u32 operation_mode:4 ; +u32 reserved:4 ; +u32 boot_options_present:1 ; +u32 ack_data:3 ; +u32 bios_msg_ack:4 ; +} __packed; + +#define PCI_ME_UMA 0x44 + +struct me_uma { +u32 size:6 ; +u32 reserved_1:10 ; +u32 valid:1 ; +u32 reserved_0:14 ; +u32 set_to_one:1 ; +} __packed; + +#define PCI_ME_H_GS 0x4c +#define ME_INIT_DONE 1 +#define ME_INIT_STATUS_SUCCESS 0 +#define ME_INIT_STATUS_NOMEM 1 +#define ME_INIT_STATUS_ERROR 2 + +struct me_did { +u32 uma_base:16 ; +u32 reserved:7 ; +u32 rapid_start:1 ;/* Broadwell only */ +u32 status:4 ; +u32 init_done:4 ; +} __packed; + +#define PCI_ME_GMES 0x48 +#define ME_GMES_PHASE_ROM 0 +#define ME_GMES_PHASE_BUP 1 +#define ME_GMES_PHASE_UKERNEL 2 +#define ME_GMES_PHASE_POLICY 3 +#define ME_GMES_PHASE_MODULE 4 +#define ME_GMES_PHASE_UNKNOWN 5 +#define ME_GMES_PHASE_HOST 6 + +struct me_gmes { +u32 bist_in_prog:1 ; +u32 icc_prog_sts:2 ; +u32 invoke_mebx:1 ; +u32 cpu_replaced_sts:1 ; +u32 mbp_rdy:1 ; +u32 mfs_failure:1 ; +u32 warm_rst_req_for_df:1 ; +u32 cpu_replaced_valid:1 ; +u32 reserved_1:2 ; +u32 fw_upd_ipu:1 ; +u32 reserved_2:4 ; +u32 current_state:8 ; +u32 current_pmevent:4 ; +u32 progress_code:4 ; +} __packed; + +#define PCI_ME_HERES 0xbc +#define PCI_ME_EXT_SHA1 0x00 +#define PCI_ME_EXT_SHA256 0x02 +#define PCI_ME_HER (x) (0xc0+(4*(x))) + +struct me_heres { +u32 extend_reg_algorithm:4 ; +u32 reserved:26 ; +u32 extend_feature_present:1 ; +u32 extend_reg_valid:1 ; +} __packed; + +/* +* Management Engine MEI registers +*/ + +#define MEI_H_CB_WW 0x00 +#define MEI_H_CSR 0x04 +#define MEI_ME_CB_RW 0x08 +#define MEI_ME_CSR_HA 0x0c + +struct mei_csr { +u32 interrupt_enable:1 ; +u32 interrupt_status:1 ; +u32 interrupt_generate:1 ; +u32 ready:1 ; +u32 reset:1 ; +u32 reserved:3 ; +u32 buffer_read_ptr:8 ; +u32 buffer_write_ptr:8 ; +u32 buffer_depth:8 ; +} __packed; + +#define MEI_ADDRESS_CORE 0x01 +#define MEI_ADDRESS_AMT 0x02 +#define MEI_ADDRESS_RESERVED 0x03 +#define MEI_ADDRESS_WDT 0x04 +#define MEI_ADDRESS_MKHI 0x07 +#define MEI_ADDRESS_ICC 0x08 +#define MEI_ADDRESS_THERMAL 0x09 + +#define MEI_HOST_ADDRESS 0 + +struct mei_header { +u32 client_address:8 ; +u32 host_address:8 ; +u32 length:9 ; +u32 reserved:6 ; +u32 is_complete:1 ; +} __packed; + +#define MKHI_GROUP_ID_CBM 0x00 +#define MKHI_GROUP_ID_FWCAPS 0x03 +#define MKHI_GROUP_ID_MDES 0x08 +#define MKHI_GROUP_ID_GEN 0xff + +#define MKHI_GET_FW_VERSION 0x02 +#define MKHI_END_OF_POST 0x0c +#define MKHI_FEATURE_OVERRIDE 0x14 + +/* Ivybridge only: */ +#define MKHI_GLOBAL_RESET 0x0b +#define MKHI_FWCAPS_GET_RULE 0x02 +#define MKHI_MDES_ENABLE 0x09 + +/* Broadwell only: */ +#define MKHI_GLOBAL_RESET 0x0b +#define MKHI_FWCAPS_GET_RULE 0x02 +#define MKHI_GROUP_ID_HMRFPO 0x05 +#define MKHI_HMRFPO_LOCK 0x02 +#define MKHI_HMRFPO_LOCK_NOACK 0x05 +#define MKHI_MDES_ENABLE 0x09 +#define MKHI_END_OF_POST_NOACK 0x1a + +struct mkhi_header { +u32 group_id:8 ; +u32 command:7 ; +u32 is_response:1 ; +u32 reserved:8 ; +u32 result:8 ; +} __packed; + +struct me_fw_version { +u16 code_minor; +u16 code_major; +u16 code_build_number; +u16 code_hot_fix; +u16 recovery_minor; +u16 recovery_major; +u16 recovery_build_number; +u16 recovery_hot_fix; +} __packed; + + +#define HECI_EOP_STATUS_SUCCESS 0x0 +#define HECI_EOP_PERFORM_GLOBAL_RESET 0x1 + +#define CBM_RR_GLOBAL_RESET 0x01 + +#define GLOBAL_RESET_BIOS_MRC 0x01 +#define GLOBAL_RESET_BIOS_POST 0x02 +#define GLOBAL_RESET_MEBX 0x03 + +struct me_global_reset { +u8 request_origin; +u8 reset_type; +} __packed; + +enum me_bios_path { +ME_NORMAL_BIOS_PATH , +ME_S3WAKE_BIOS_PATH , +ME_ERROR_BIOS_PATH , +ME_RECOVERY_BIOS_PATH , +ME_DISABLE_BIOS_PATH , +ME_FIRMWARE_UPDATE_BIOS_PATH , +}; + +struct __packed mefwcaps_sku { + u32 full_net:1; + u32 std_net:1; + u32 manageability:1; + u32 small_business:1; + u32 l3manageability:1; + u32 intel_at:1; + u32 intel_cls:1; + u32 reserved:3; + u32 intel_mpc:1; + u32 icc_over_clocking:1; + u32 pavp:1; + u32 reserved_1:4; + u32 ipv6:1; + u32 kvm:1; + u32 och:1; + u32 vlan:1; + u32 tls:1; + u32 reserved_4:1; + u32 wlan:1; + u32 reserved_5:8; +}; + +struct __packed tdt_state_flag { + u16 lock_state:1; + u16 authenticate_module:1; + u16 s3authentication:1; + u16 flash_wear_out:1; + u16 flash_variable_security:1; + u16 wwan3gpresent:1; /* ivybridge only */ + u16 wwan3goob:1; /* ivybridge only */ + u16 reserved:9; +}; + +struct __packed tdt_state_info { +u8 state; +u8 last_theft_trigger; +struct tdt_state_flag flags; +}; + +struct __packed mbp_rom_bist_data { +u16 device_id; +u16 fuse_test_flags; +u32 umchid[4 ]; +}; + +struct __packed mbp_platform_key { +u32 key[8 ]; +}; + +struct __packed mbp_header { + u32 mbp_size:8; + u32 num_entries:8; + u32 rsvd:16; +}; + +struct __packed mbp_item_header { + u32 app_id:8; + u32 item_id:8; + u32 length:8; + u32 rsvd:8; +}; + +struct __packed me_fwcaps { +u32 id; +u8 length; +struct mefwcaps_sku caps_sku; +u8 reserved[3 ]; +}; + +/** +* intel_me_status() - Check Intel Management Engine status +* +* @me_dev: Management engine PCI device +*/ +void intel_me_status (struct udevice *me_dev); + +/** +* intel_early_me_init() - Early Intel Management Engine init +* +* @me_dev: Management engine PCI device +* @return 0 if OK, -ve on error +*/ +int intel_early_me_init (struct udevice *me_dev); + +/** +* intel_early_me_uma_size() - Get UMA size from the Intel Management Engine +* +* @me_dev: Management engine PCI device +* @return UMA size if OK, -EINVAL on error +*/ +int intel_early_me_uma_size (struct udevice *me_dev); + +/** +* intel_early_me_init_done() - Complete Intel Management Engine init +* +* @dev: Northbridge device +* @me_dev: Management engine PCI device +* @status: Status result (ME_INIT_...) +* @return 0 to continue to boot, -EINVAL on unknown result data, -ETIMEDOUT +* if ME did not respond +*/ +int intel_early_me_init_done (struct udevice *dev,struct udevice *me_dev, +uint status); + +int intel_me_hsio_version (struct udevice *dev,uint16_t *version, +uint16_t *checksum); + +static inline void pci_read_dword_ptr (struct udevice *me_dev,void *ptr, +int offset) +{ +u32 dword; + +dm_pci_read_config32 (me_dev, offset, &dword); +memcpy (ptr, &dword,sizeof (dword)); +} + +static inline void pci_write_dword_ptr (struct udevice *me_dev,void *ptr, +int offset) +{ +u32 dword =0 ; + +memcpy (&dword, ptr,sizeof (dword)); +dm_pci_write_config32 (me_dev, offset, dword); +} +#endif arch/x86/include/asm/report_platform.h new file +0
-0
arch/x86/include/asm/report_platform.h line 4
Quoted 4 lines
arch/x86/include/asm/report_platform.h new file +4
-0@@ -0,0 +1,19 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
arch/x86/include/asm/report_platform.h line 8
Quoted 4 lines
arch/x86/include/asm/report_platform.h new file +4
-0+*/ + +#ifndef __arch_report_platform_h +#define __arch_report_platform_h
nits: all capital letters
arch/x86/include/asm/report_platform.h
Quoted 12 lines
arch/x86/include/asm/report_platform.h new file +11
-1+ +/** +* report_platform_info() - Report platform information +* +* This reports information about the CPU and chipset. +* +* @dev: Northbridge device +*/ +void report_platform_info (struct udevice *dev); + +#endif --
Regards,
Bin
PATCH 24/69 x86: Move Intel Management Engine code to a common place
Hi Bin,
Quoted 68 lines · Bin Meng
Hi Simon,
Quoted 65 lines · Simon Glass
Some of the Intel ME code is common to several Intel CPUs. Move it into a common location. Add a header file for
report_platform.calso.Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/Makefile | 2 + .../cpu/{ivybridge => intel_common}/me_status.c | 20 +- .../{ivybridge => intel_common}/report_platform.c | 2 +- arch/x86/cpu/ivybridge/Makefile | 2 - arch/x86/cpu/ivybridge/early_me.c | 31 +- arch/x86/cpu/ivybridge/sdram.c | 3 +- arch/x86/include/asm/arch-ivybridge/me.h | 333 +----------------- arch/x86/include/asm/arch-ivybridge/sandybridge.h | 2 - arch/x86/include/asm/me_common.h | 372 +++++++++++++++++++++ arch/x86/include/asm/report_platform.h | 19 ++ 10 files changed, 417 insertions(+), 369 deletions(-) rename arch/x86/cpu/{ivybridge => intel_common}/me_status.c (93%) rename arch/x86/cpu/{ivybridge => intel_common}/report_platform.c (98%) create mode 100644 arch/x86/include/asm/me_common.h create mode 100644 arch/x86/include/asm/report_platform.harch/x86/cpu/intel_common/Makefile +2
-0@@ -7,6 +7,8 @@ obj-$(CONFIG_HAVE_MRC) += car.o obj-y += cpu_common.o obj-y += lpc_common.o +obj-$(CONFIG_HAVE_MRC) += me_status.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.o endif +obj-$(CONFIG_HAVE_MRC) += report_platform.oarch/x86/cpu/intel_common/me_status.c renamed from arch/x86/cpu/ivybridge/me_status.c +11
-1@@ -128,7 +128,14 @@ static const char *const me_progress_policy_values[] = { [0x10] = "Required VSCC values for flash parts do not match", }; -void intel_me_status (struct me_hfs *hfs,struct me_gmes *gmes) + +/** +* _intel_me_status() - Check Intel Management Engine status +* +* struct hfs: Firmware status +* struct gmes: Management engine status +*/ +static void _intel_me_status (struct me_hfs *hfs,struct me_gmes *gmes) {/* Check Current States */ debug("ME: FW Partition Table : %s\n",@@ -193,3 +200,14 @@ void intel_me_status(struct me_hfs *hfs, struct me_gmes *gmes) }debug ("\n" ); } + +void intel_me_status (struct udevice *me_dev) +{
Quoted 8 lines
arch/x86/cpu/intel_common/me_status.c void intel_me_status(struct me_hfs *hfs, struct me_gmes *gmes) · line 210
Quoted 5 lines
arch/x86/cpu/intel_common/me_status.c renamed from arch/x86/cpu/ivybridge/me_status.c +5
-0+struct me_hfs hfs; +struct me_gmes gmes; + +pci_read_dword_ptr (me_dev, &hfs,PCI_ME_HFS ); +pci_read_dword_ptr (me_dev, &gmes,PCI_ME_GMES );The call to
pci_read_dword_ptr()looks odd. Why not use thedm_pci_xxAPIs directly?
It's because these are structus - in fact we are writing to a bitfield here. It could perhaps use a union.
Regards,
Simon
PATCH 25/69 x86: ivybridge: Drop sandybridge_early_init()
In reply to Simon GlassThis function was removed in the previous clean-up. Drop it from the header file also.
---
arch/x86/include/asm/arch-ivybridge/sandybridge.h | 2 -- 1 file changed, 2 deletions(-)
arch/x86/include/asm/arch-ivybridge/sandybridge.h +0 -2
@@ -113,6 +113,4 @@*/ int bridge_silicon_revision (struct udevice *dev); -void sandybridge_early_init (int chipset_type); -#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 25/69 x86: ivybridge: Drop sandybridge_early_init()
Quoted 9 lines · Simon Glass
This function was removed in the previous clean-up. Drop it from the header file also.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/include/asm/arch-ivybridge/sandybridge.h | 2 -- 1 file changed, 2 deletions(-)
PATCH 26/69 x86: Move common PCH code into a common place
In reply to Simon GlassThe SATA indexed register write functions are common to several Intel PCHs. Move this into a common location.
---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/pch_common.c | 25 ++++++++++++++ arch/x86/cpu/ivybridge/cpu.c | 1 + arch/x86/cpu/ivybridge/sata.c | 47 +++++++++----------------- arch/x86/include/asm/arch-ivybridge/pch.h | 53 ----------------------------- arch/x86/include/asm/pch_common.h | 56 +++++++++++++++++++++++++++++++ board/intel/cougarcanyon2/cougarcanyon2.c | 1 + 7 files changed, 100 insertions(+), 84 deletions(-) create mode 100644 arch/x86/cpu/intel_common/pch_common.c create mode 100644 arch/x86/include/asm/pch_common.h
arch/x86/cpu/intel_common/Makefile +1 -0
@@ -11,4 +11,5 @@ obj-$(CONFIG_HAVE_MRC) += me_status.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.o endif +obj-y += pch_common.o obj-$(CONFIG_HAVE_MRC) += report_platform.o
arch/x86/cpu/intel_common/pch_common.c new file +25 -0
@@ -0,0 +1,25 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#include <common.h> +#include <dm.h> +#include <asm/pch_common.h> + +u32 pch_common_sir_read (struct udevice *dev,int idx) +{ +u32 data; + +dm_pci_write_config32 (dev,SATA_SIRI , idx); +dm_pci_read_config32 (dev,SATA_SIRD , &data); + +return data; +} + +void pch_common_sir_write (struct udevice *dev,int idx,u32 value) +{ +dm_pci_write_config32 (dev,SATA_SIRI , idx); +dm_pci_write_config32 (dev,SATA_SIRD , value); +}
arch/x86/cpu/ivybridge/cpu.c +1 -0
@@ -21,6 +21,7 @@#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/lapic.h> +#include <asm/lpc_common.h> #include <asm/microcode.h> #include <asm/msr.h> #include <asm/mtrr.h>
arch/x86/cpu/ivybridge/sata.c +16 -31
71 lines not on this page · raw message
arch/x86/include/asm/arch-ivybridge/pch.h +0 -53
77 lines not on this page · raw message
arch/x86/include/asm/pch_common.h new file +56 -0
56 lines not on this page · raw message
board/intel/cougarcanyon2/cougarcanyon2.c +1 -0
@@ -10,6 +10,7 @@#include <pci.h> #include <smsc_sio1007.h> #include <asm/ibmpc.h> +#include <asm/lpc_common.h> #include <asm/pci.h> #include <asm/arch/pch.h>
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 26/69 x86: Move common PCH code into a common place
Hi Simon,
Quoted 33 lines · Simon Glass
The SATA indexed register write functions are common to several Intel PCHs. Move this into a common location.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/pch_common.c | 25 ++++++++++++++ arch/x86/cpu/ivybridge/cpu.c | 1 + arch/x86/cpu/ivybridge/sata.c | 47 +++++++++----------------- arch/x86/include/asm/arch-ivybridge/pch.h | 53 ----------------------------- arch/x86/include/asm/pch_common.h | 56 +++++++++++++++++++++++++++++++ board/intel/cougarcanyon2/cougarcanyon2.c | 1 + 7 files changed, 100 insertions(+), 84 deletions(-) create mode 100644 arch/x86/cpu/intel_common/pch_common.c create mode 100644 arch/x86/include/asm/pch_common.harch/x86/cpu/intel_common/Makefile +1
-0@@ -11,4 +11,5 @@ obj-$(CONFIG_HAVE_MRC) += me_status.o ifndef CONFIG_TARGET_EFI obj-y += microcode_intel.o endif +obj-y += pch_common.o obj-$(CONFIG_HAVE_MRC) += report_platform.oarch/x86/cpu/intel_common/pch_common.c new file +0
-0
arch/x86/cpu/intel_common/pch_common.c line 4
Quoted 4 lines
arch/x86/cpu/intel_common/pch_common.c new file +4
-0@@ -0,0 +1,25 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
Quoted 261 lines
arch/x86/cpu/intel_common/pch_common.c new file +21
-0+*/ + +#include <common.h> +#include <dm.h> +#include <asm/pch_common.h> + +u32 pch_common_sir_read (struct udevice *dev,int idx) +{ +u32 data; + +dm_pci_write_config32 (dev,SATA_SIRI , idx); +dm_pci_read_config32 (dev,SATA_SIRD , &data); + +return data; +} + +void pch_common_sir_write (struct udevice *dev,int idx,u32 value) +{ +dm_pci_write_config32 (dev,SATA_SIRI , idx); +dm_pci_write_config32 (dev,SATA_SIRD , value); +}arch/x86/cpu/ivybridge/cpu.c +1
-0@@ -21,6 +21,7 @@#include <asm/intel_regs.h> #include <asm/io.h> #include <asm/lapic.h> +#include <asm/lpc_common.h> #include <asm/microcode.h> #include <asm/msr.h> #include <asm/mtrr.h> arch/x86/cpu/ivybridge/sata.c +16
-31@@ -9,28 +9,13 @@#include <dm.h> #include <fdtdec.h> #include <asm/io.h> +#include <asm/pch_common.h> #include <asm/pci.h> #include <asm/arch/pch.h> #include <asm/arch/bd82x6x.h> DECLARE_GLOBAL_DATA_PTR ; -static inline u32 sir_read (struct udevice *dev,int idx) -{ -u32 data; - -dm_pci_write_config32 (dev,SATA_SIRI , idx); -dm_pci_read_config32 (dev,SATA_SIRD , &data); - -return data; -} - -static inline void sir_write (struct udevice *dev,int idx,u32 value) -{ -dm_pci_write_config32 (dev,SATA_SIRI , idx); -dm_pci_write_config32 (dev,SATA_SIRD , value); -} -static void common_sata_init (struct udevice *dev,unsigned int port_map) {u32 reg32;@@ -177,27 +162,27 @@ static void bd82x6x_sata_init(struct udevice *dev, struct udevice *pch)pch_iobp_update (pch,SATA_IOBP_SP1G3IR ,0 , port_tx);/* Additional Programming Requirements */ -sir_write (dev,0x04 ,0x00001600 ); -sir_write (dev,0x28 ,0xa0000033 ); - reg32 =sir_read (dev,0x54 ); +pch_common_sir_write (dev,0x04 ,0x00001600 ); +pch_common_sir_write (dev,0x28 ,0xa0000033 ); + reg32 =pch_common_sir_read (dev,0x54 ); reg32 &=0xff000000 ; reg32 |=0x5555aa ; -sir_write (dev,0x54 , reg32); -sir_write (dev,0x64 ,0xcccc8484 ); - reg32 =sir_read (dev,0x68 ); +pch_common_sir_write (dev,0x54 , reg32); +pch_common_sir_write (dev,0x64 ,0xcccc8484 ); + reg32 =pch_common_sir_read (dev,0x68 ); reg32 &=0xffff0000 ; reg32 |=0xcccc ; -sir_write (dev,0x68 , reg32); - reg32 =sir_read (dev,0x78 ); +pch_common_sir_write (dev,0x68 , reg32); + reg32 =pch_common_sir_read (dev,0x78 ); reg32 &=0x0000ffff ; reg32 |=0x88880000 ; -sir_write (dev,0x78 , reg32); -sir_write (dev,0x84 ,0x001c7000 ); -sir_write (dev,0x88 ,0x88338822 ); -sir_write (dev,0xa0 ,0x001c7000 ); -sir_write (dev,0xc4 ,0x0c0c0c0c ); -sir_write (dev,0xc8 ,0x0c0c0c0c ); -sir_write (dev,0xd4 ,0x10000000 ); +pch_common_sir_write (dev,0x78 , reg32); +pch_common_sir_write (dev,0x84 ,0x001c7000 ); +pch_common_sir_write (dev,0x88 ,0x88338822 ); +pch_common_sir_write (dev,0xa0 ,0x001c7000 ); +pch_common_sir_write (dev,0xc4 ,0x0c0c0c0c ); +pch_common_sir_write (dev,0xc8 ,0x0c0c0c0c ); +pch_common_sir_write (dev,0xd4 ,0x10000000 );pch_iobp_update (pch,0xea004001 ,0x3fffffff ,0xc0000000 );pch_iobp_update (pch,0xea00408a ,0xfffffcff ,0x00000100 );arch/x86/include/asm/arch-ivybridge/pch.h +0
-53@@ -69,8 +69,6 @@#define RTC_POWER_FAILED (1 << 1)#define SLEEP_AFTER_POWER_FAIL (1 << 0) -#define PMBASE 0x40 -#define ACPI_CNTL 0x44#define BIOS_CNTL 0xDC#define GPIO_BASE 0x48/* LPC GPIO Base Address Register */ #define GPIO_CNTL 0x4C/* LPC GPIO Control Register */ @@ -99,60 +97,11 @@#define GPIO_CNTL 0x4C/* LPC GPIO Control Register */ #define GPIO_ROUT 0xb8 -#define LPC_IO_DEC 0x80/* IO Decode Ranges Register */ -#define COMB_DEC_RANGE (1 << 4)/* 0x2f8-0x2ff (COM2) */ -#define COMA_DEC_RANGE (0 << 0)/* 0x3f8-0x3ff (COM1) */ -#define LPC_EN 0x82/* LPC IF Enables Register */ -#define CNF2_LPC_EN (1 << 13)/* 0x4e/0x4f */ -#define CNF1_LPC_EN (1 << 12)/* 0x2e/0x2f */ -#define MC_LPC_EN (1 << 11)/* 0x62/0x66 */ -#define KBC_LPC_EN (1 << 10)/* 0x60/0x64 */ -#define GAMEH_LPC_EN (1 << 9)/* 0x208/0x20f */ -#define GAMEL_LPC_EN (1 << 8)/* 0x200/0x207 */ -#define FDD_LPC_EN (1 << 3)/* LPC_IO_DEC[12] */ -#define LPT_LPC_EN (1 << 2)/* LPC_IO_DEC[9:8] */ -#define COMB_LPC_EN (1 << 1)/* LPC_IO_DEC[6:4] */ -#define COMA_LPC_EN (1 << 0)/* LPC_IO_DEC[3:2] */ -#define LPC_GEN1_DEC 0x84/* LPC IF Generic Decode Range 1 */ -#define LPC_GEN2_DEC 0x88/* LPC IF Generic Decode Range 2 */ -#define LPC_GEN3_DEC 0x8c/* LPC IF Generic Decode Range 3 */ -#define LPC_GEN4_DEC 0x90/* LPC IF Generic Decode Range 4 */ -#define LPC_GENX_DEC (x) (0x84 + 4 * (x)) -#define GEN_DEC_RANGE_256B 0xfc0000/* 256 Bytes */ -#define GEN_DEC_RANGE_128B 0x7c0000/* 128 Bytes */ -#define GEN_DEC_RANGE_64B 0x3c0000/* 64 Bytes */ -#define GEN_DEC_RANGE_32B 0x1c0000/* 32 Bytes */ -#define GEN_DEC_RANGE_16B 0x0c0000/* 16 Bytes */ -#define GEN_DEC_RANGE_8B 0x040000/* 8 Bytes */ -#define GEN_DEC_RANGE_4B 0x000000/* 4 Bytes */ -#define GEN_DEC_RANGE_EN (1 << 0)/* Range Enable */ -/* PCI Configuration Space (D31:F1): IDE */ #define PCH_IDE_DEV PCI_BDF(0, 0x1f, 1)#define PCH_SATA_DEV PCI_BDF(0, 0x1f, 2)#define PCH_SATA2_DEV PCI_BDF(0, 0x1f, 5) -#define INTR_LN 0x3c -#define IDE_TIM_PRI 0x40/* IDE timings, primary */ -#define IDE_DECODE_ENABLE (1 << 15) -#define IDE_SITRE (1 << 14) -#define IDE_ISP_5_CLOCKS (0 << 12) -#define IDE_ISP_4_CLOCKS (1 << 12) -#define IDE_ISP_3_CLOCKS (2 << 12) -#define IDE_RCT_4_CLOCKS (0 << 8) -#define IDE_RCT_3_CLOCKS (1 << 8) -#define IDE_RCT_2_CLOCKS (2 << 8) -#define IDE_RCT_1_CLOCKS (3 << 8) -#define IDE_DTE1 (1 << 7) -#define IDE_PPE1 (1 << 6) -#define IDE_IE1 (1 << 5) -#define IDE_TIME1 (1 << 4) -#define IDE_DTE0 (1 << 3) -#define IDE_PPE0 (1 << 2) -#define IDE_IE0 (1 << 1) -#define IDE_TIME0 (1 << 0) -#define IDE_TIM_SEC 0x42/* IDE timings, secondary */ -#define IDE_SDMA_CNT 0x48/* Synchronous DMA control */ #define IDE_SSDE1 (1 << 3)#define IDE_SSDE0 (1 << 2)@@ -337,9 +286,7 @@ (((d) <<DIR_IDR ) | ((c) <<DIR_ICR ) | \ ((b) << DIR_IBR) | ((a) << DIR_IAR)) -#define RC 0x3400/* 32bit */ #define HPTC 0x3404/* 32bit */ -#define GCS 0x3410/* 32bit */ #define BUC 0x3414/* 32bit */ #define PCH_DISABLE_GBE (1 << 5)#define FD 0x3418/* 32bit */ arch/x86/include/asm/pch_common.h new file +56
-0@@ -0,0 +1,56 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#ifndef __asm_pch_common_h +#define __asm_pch_common_h + +/* Common Intel SATA registers */ +#define SATA_SIRI 0xa0/* SATA Indexed Register Index */ +#define SATA_SIRD 0xa4/* SATA Indexed Register Data */ +#define SATA_SP 0xd0/* Scratchpad */ + +#define INTR_LN 0x3c +#define IDE_TIM_PRI 0x40/* IDE timings, primary */ +#define IDE_DECODE_ENABLE (1 << 15) +#define IDE_SITRE (1 << 14) +#define IDE_ISP_5_CLOCKS (0 << 12) +#define IDE_ISP_4_CLOCKS (1 << 12) +#define IDE_ISP_3_CLOCKS (2 << 12) +#define IDE_RCT_4_CLOCKS (0 << 8) +#define IDE_RCT_3_CLOCKS (1 << 8) +#define IDE_RCT_2_CLOCKS (2 << 8) +#define IDE_RCT_1_CLOCKS (3 << 8) +#define IDE_DTE1 (1 << 7) +#define IDE_PPE1 (1 << 6) +#define IDE_IE1 (1 << 5) +#define IDE_TIME1 (1 << 4) +#define IDE_DTE0 (1 << 3) +#define IDE_PPE0 (1 << 2) +#define IDE_IE0 (1 << 1) +#define IDE_TIME0 (1 << 0) +#define IDE_TIM_SEC 0x42/* IDE timings, secondary */ + +#define SERIRQ_CNTL 0x64 + +/** +* pch_common_sir_read() - Read from a SATA indexed register +* +* @dev: SATA device +* @idx: Register index to read +* @return value read from register +*/ +u32 pch_common_sir_read (struct udevice *dev,int idx); + +/** +* pch_common_sir_write() - Write to a SATA indexed register +* +* @dev: SATA device +* @idx: Register index to write +* @value: Value to write +*/ +void pch_common_sir_write (struct udevice *dev,int idx,u32 value); + +#endif board/intel/cougarcanyon2/cougarcanyon2.c +0
-0
board/intel/cougarcanyon2/cougarcanyon2.c line 13
Quoted 4 lines
board/intel/cougarcanyon2/cougarcanyon2.c +1
-0@@ -10,6 +10,7 @@#include <pci.h> #include <smsc_sio1007.h> #include <asm/ibmpc.h> +#include <asm/lpc_common.h>
I think this changes should be included in patch 20 of this series.
board/intel/cougarcanyon2/cougarcanyon2.c line 16
Quoted 3 lines
board/intel/cougarcanyon2/cougarcanyon2.c +0
-0#include <asm/pci.h> #include <asm/arch/pch.h>
Regards,
Bin
PATCH 27/69 x86: link: Add required GPIO properties
In reply to Simon GlassIn order to use GPIO phandles we need to add some GPIO properties as specified by the GPIO bindings. Add these for link.
---
arch/x86/dts/chromebook_link.dts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/x86/dts/chromebook_link.dts +9 -3
@@ -249,23 +249,29 @@ }; }; - gpioa { + gpio_a: gpioa { compatible = "intel,ich6-gpio"; u-boot,dm-pre-reloc; + #gpio-cells = <2>; + gpio-controller; reg = <0 0x10>; bank-name = "A"; }; - gpiob { + gpio_b: gpiob { compatible = "intel,ich6-gpio"; u-boot,dm-pre-reloc; + #gpio-cells = <2>; + gpio-controller; reg = <0x30 0x10>; bank-name = "B"; }; - gpioc { + gpio_c: gpioc { compatible = "intel,ich6-gpio"; u-boot,dm-pre-reloc; + #gpio-cells = <2>; + gpio-controller; reg = <0x40 0x10>; bank-name = "C"; };
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 27/69 x86: link: Add required GPIO properties
Quoted 9 lines · Simon Glass
In order to use GPIO phandles we need to add some GPIO properties as specified by the GPIO bindings. Add these for link.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_link.dts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
PATCH 27/69 x86: link: Add required GPIO properties
Quoted 4 lines · Bin Meng
Quoted 3 lines · Simon Glass
In order to use GPIO phandles we need to add some GPIO properties as specified by the GPIO bindings. Add these for link.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_link.dts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 28/69 x86: dts: link: Move SPD info into the memory controller
In reply to Simon GlassThe SDRAM SPD (Serial Presence Detect) information should be contained with the SDRAM controller. This makes it easier for the controller to access it and removes the need for a separate compatible string.
As a first step, move the information.
---
arch/x86/dts/chromebook_link.dts | 221 +++++++++++++++++++-------------------- 1 file changed, 110 insertions(+), 111 deletions(-)
arch/x86/dts/chromebook_link.dts +110 -111
@@ -62,117 +62,6 @@ intel,duplicate-por; }; - spd { - compatible = "memory-spd"; - #address-cells = <1>; - #size-cells = <0>; - elpida_4Gb_1600_x16 { - reg = <0>; - data = [92 10 0b 03 04 19 02 02 - 03 52 01 08 0a 00 fe 00 - 69 78 69 3c 69 11 18 81 - 20 08 3c 3c 01 40 83 81 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 0f 11 42 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 02 fe 00 - 11 52 00 00 00 07 7f 37 - 45 42 4a 32 30 55 47 36 - 45 42 55 30 2d 47 4e 2d - 46 20 30 20 02 fe 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00]; - }; - samsung_4Gb_1600_1.35v_x16 { - reg = <1>; - data = [92 11 0b 03 04 19 02 02 - 03 11 01 08 0a 00 fe 00 - 69 78 69 3c 69 11 18 81 - f0 0a 3c 3c 01 40 83 01 - 00 80 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 0f 11 02 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 80 ce 01 - 00 00 00 00 00 00 6a 04 - 4d 34 37 31 42 35 36 37 - 34 42 48 30 2d 59 4b 30 - 20 20 00 00 80 ce 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00]; - }; - micron_4Gb_1600_1.35v_x16 { - reg = <2>; - data = [92 11 0b 03 04 19 02 02 - 03 11 01 08 0a 00 fe 00 - 69 78 69 3c 69 11 18 81 - 20 08 3c 3c 01 40 83 05 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 0f 01 02 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 80 2c 00 - 00 00 00 00 00 00 ad 75 - 34 4b 54 46 32 35 36 36 - 34 48 5a 2d 31 47 36 45 - 31 20 45 31 80 2c 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff]; - }; - }; - pci { compatible = "pci-x86"; #address-cells = <3>;
@@ -186,6 +75,116 @@ reg = <0x00000000 0 0 0 0>; compatible = "intel,bd82x6x-northbridge"; u-boot,dm-pre-reloc; + spd { + compatible = "memory-spd"; + #address-cells = <1>; + #size-cells = <0>; + elpida_4Gb_1600_x16 { + reg = <0>; + data = [92 10 0b 03 04 19 02 02 + 03 52 01 08 0a 00 fe 00 + 69 78 69 3c 69 11 18 81 + 20 08 3c 3c 01 40 83 81 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 0f 11 42 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 02 fe 00 + 11 52 00 00 00 07 7f 37 + 45 42 4a 32 30 55 47 36 + 45 42 55 30 2d 47 4e 2d + 46 20 30 20 02 fe 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00]; + }; + samsung_4Gb_1600_1.35v_x16 { + reg = <1>; + data = [92 11 0b 03 04 19 02 02 + 03 11 01 08 0a 00 fe 00 + 69 78 69 3c 69 11 18 81 + f0 0a 3c 3c 01 40 83 01 + 00 80 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 0f 11 02 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 80 ce 01 + 00 00 00 00 00 00 6a 04 + 4d 34 37 31 42 35 36 37 + 34 42 48 30 2d 59 4b 30 + 20 20 00 00 80 ce 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00]; + }; + micron_4Gb_1600_1.35v_x16 { + reg = <2>; + data = [92 11 0b 03 04 19 02 02 + 03 11 01 08 0a 00 fe 00 + 69 78 69 3c 69 11 18 81 + 20 08 3c 3c 01 40 83 05 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 0f 01 02 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 80 2c 00 + 00 00 00 00 00 00 ad 75 + 34 4b 54 46 32 35 36 36 + 34 48 5a 2d 31 47 36 45 + 31 20 45 31 80 2c 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff + ff ff ff ff ff ff ff ff]; + }; + }; }; gma at 2,0 {
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 28/69 x86: dts: link: Move SPD info into the memory controller
Quoted 4 lines · Simon Glass
The SDRAM SPD (Serial Presence Detect) information should be contained with the SDRAM controller. This makes it easier for the controller to access it and removes the need for a separate compatible string.
Quoted 8 lines
As a first step, move the information.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_link.dts | 221 +++++++++++++++++++-------------------- 1 file changed, 110 insertions(+), 111 deletions(-)
PATCH 28/69 x86: dts: link: Move SPD info into the memory controller
Quoted 7 lines · Bin Meng
Quoted 6 lines · Simon Glass
The SDRAM SPD (Serial Presence Detect) information should be contained with the SDRAM controller. This makes it easier for the controller to access it and removes the need for a separate compatible string.
As a first step, move the information.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_link.dts | 221 +++++++++++++++++++-------------------- 1 file changed, 110 insertions(+), 111 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 29/69 x86: dts: link: Add board ID GPIOs
In reply to Simon GlassAt present the board ID GPIOs are hard-coded. Move them to the device tree so that we can use general SDRAM init code.
---
arch/x86/dts/chromebook_link.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/dts/chromebook_link.dts +2 -0
@@ -74,6 +74,8 @@ northbridge at 0,0 { reg = <0x00000000 0 0 0 0>; compatible = "intel,bd82x6x-northbridge"; + board-id-gpios = <&gpio_b 9 0>, <&gpio_b 10 0>, + <&gpio_b 11 0>, <&gpio_a 10 0>; u-boot,dm-pre-reloc; spd { compatible = "memory-spd";
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 29/69 x86: dts: link: Add board ID GPIOs
Quoted 9 lines · Simon Glass
At present the board ID GPIOs are hard-coded. Move them to the device tree so that we can use general SDRAM init code.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_link.dts | 2 ++ 1 file changed, 2 insertions(+)
PATCH 29/69 x86: dts: link: Add board ID GPIOs
Quoted 4 lines · Bin Meng
Quoted 3 lines · Simon Glass
At present the board ID GPIOs are hard-coded. Move them to the device tree so that we can use general SDRAM init code.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_link.dts | 2 ++ 1 file changed, 2 insertions(+)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 30/69 x86: gpio: Correct GPIO setup ordering
In reply to Simon GlassThe Intel GPIO driver can set up the GPIO pin mapping when the first GPIO is probed. However, it assumes that the first GPIO to be probed is in the first GPIO bank. If this is not the case then the init will write to the wrong registers.
Fix this. Also add a note that this code is deprecated. We should move to using device tree instead.
---
arch/x86/include/asm/gpio.h | 5 +++++ drivers/gpio/intel_ich6_gpio.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-)
arch/x86/include/asm/gpio.h +5 -0
@@ -12,6 +12,7 @@struct ich6_bank_platdata {uint16_t base_addr;const char *bank_name; +int offset; };#define GPIO_MODE_NATIVE 0
@@ -146,6 +147,10 @@ struct pch_gpio_map { } set3; }; +/* +* Deprecated functions to set up the GPIO map. The device tree should be used +* instead. +*/ int gpio_ich6_pinctrl_init (void );void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio);void ich_gpio_set_gpio_map (const struct pch_gpio_map *map);
drivers/gpio/intel_ich6_gpio.c +3 -1
@@ -279,6 +279,7 @@ static int gpio_ich6_ofdata_to_platdata(struct udevice *dev)debug ("%s: Invalid register offset %d\n" , __func__, offset);return -EINVAL ; } + plat->offset = offset; plat->base_addr = gpiobase + offset; plat->bank_name =fdt_getprop (gd->fdt_blob, dev->of_offset,"bank-name" ,NULL );
@@ -293,7 +294,8 @@ static int ich6_gpio_probe(struct udevice *dev)struct ich6_bank_priv *bank =dev_get_priv (dev);if (gd->arch.gpio_map) { -setup_pch_gpios (plat->base_addr, gd->arch.gpio_map); +setup_pch_gpios (plat->base_addr - plat->offset, + gd->arch.gpio_map); gd->arch.gpio_map =NULL ; }
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 30/69 x86: gpio: Correct GPIO setup ordering
Quoted 8 lines · Simon Glass
The Intel GPIO driver can set up the GPIO pin mapping when the first GPIO is probed. However, it assumes that the first GPIO to be probed is in the first GPIO bank. If this is not the case then the init will write to the wrong registers.
Fix this. Also add a note that this code is deprecated. We should move to using device tree instead.
Quoted 7 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/include/asm/gpio.h | 5 +++++ drivers/gpio/intel_ich6_gpio.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-)
PATCH 30/69 x86: gpio: Correct GPIO setup ordering
Quoted 12 lines · Bin Meng
Quoted 11 lines · Simon Glass
The Intel GPIO driver can set up the GPIO pin mapping when the first GPIO is probed. However, it assumes that the first GPIO to be probed is in the first GPIO bank. If this is not the case then the init will write to the wrong registers.
Fix this. Also add a note that this code is deprecated. We should move to using device tree instead.
Signed-off-by Simon Glass <[email protected]>---
Quoted 6 lines
Quoted 4 lines
arch/x86/include/asm/gpio.h | 5 +++++ drivers/gpio/intel_ich6_gpio.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 31/69 x86: Add common SDRAM-init code
In reply to Simon GlassThe code to call the memory reference code is common to several Intel CPUs. Add common code for performing this init. Intel calls this 'Pre-EFI-Init' (PEI), where EFI stands for Extensible Firmware Interface.
---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/sdram_common.c | 271 +++++++++++++++++++++++++++++++ arch/x86/include/asm/sdram_common.h | 56 +++++++ 3 files changed, 328 insertions(+) create mode 100644 arch/x86/cpu/intel_common/sdram_common.c create mode 100644 arch/x86/include/asm/sdram_common.h
arch/x86/cpu/intel_common/Makefile +1 -0
@@ -13,3 +13,4 @@ obj-y += microcode_intel.o endif obj-y += pch_common.o obj-$(CONFIG_HAVE_MRC) += report_platform.o +obj-$(CONFIG_HAVE_MRC) += sdram_common.o
arch/x86/cpu/intel_common/sdram_common.c new file +271 -0
271 lines not on this page · raw message
arch/x86/include/asm/sdram_common.h new file +56 -0
56 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 31/69 x86: Add common SDRAM-init code
Hi Simon,
Quoted 4 lines · Simon Glass
The code to call the memory reference code is common to several Intel CPUs. Add common code for performing this init. Intel calls this 'Pre-EFI-Init' (PEI), where EFI stands for Extensible Firmware Interface.
I doubt SDRAM init code is really common. But I understand we are utilizing Intel's binary to initialize the SDRAM, and the binary interface can be stable and common across different chips. So maybe we should rename this to something like: mrc_common.c?
Quoted 25 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/Makefile | 1 + arch/x86/cpu/intel_common/sdram_common.c | 271 +++++++++++++++++++++++++++++++ arch/x86/include/asm/sdram_common.h | 56 +++++++ 3 files changed, 328 insertions(+) create mode 100644 arch/x86/cpu/intel_common/sdram_common.c create mode 100644 arch/x86/include/asm/sdram_common.harch/x86/cpu/intel_common/Makefile +1
-0@@ -13,3 +13,4 @@ obj-y += microcode_intel.o endif obj-y += pch_common.o obj-$(CONFIG_HAVE_MRC) += report_platform.o +obj-$(CONFIG_HAVE_MRC) += sdram_common.oarch/x86/cpu/intel_common/sdram_common.c new file +0
-0
arch/x86/cpu/intel_common/sdram_common.c line 4
Quoted 4 lines
arch/x86/cpu/intel_common/sdram_common.c new file +4
-0@@ -0,0 +1,271 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
Quoted 273 lines
arch/x86/cpu/intel_common/sdram_common.c new file +267
-0+*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/cpu.h> +#include <asm/gpio.h> +#include <asm/intel_regs.h> +#include <asm/pch_common.h> +#include <asm/post.h> +#include <asm/sdram_common.h> +#include <asm/arch/me.h> +#include <asm/report_platform.h> + +static const char *const ecc_decoder[] = { +"inactive" , +"active on IO" , +"disabled on IO" , +"active" +}; + +ulong sdram_common_board_get_usable_ram_top (ulong total_size) +{ +struct memory_info *info = &gd->arch.meminfo; +uintptr_t dest_addr =0 ; +struct memory_area *largest =NULL ; +int i; + +/* Find largest area of memory below 4GB */ + +for (i =0 ; i < info->num_areas; i++) { +struct memory_area *area = &info->area[i]; + +if (area->start >=1ULL <<32 ) +continue ; +if (!largest || area->size > largest->size) + largest = area; + } + +/* If no suitable area was found, return an error. */ +assert (largest); +if (!largest || largest->size < (2 <<20 )) +panic ("No available memory found for relocation" ); + + dest_addr = largest->start + largest->size; + +return (ulong )dest_addr; +} + +void sdram_common_dram_init_banksize (void ) +{ +struct memory_info *info = &gd->arch.meminfo; +int num_banks; +int i; + +for (i =0 , num_banks =0 ; i < info->num_areas; i++) { +struct memory_area *area = &info->area[i]; + +if (area->start >=1ULL <<32 ) +continue ; + gd->bd->bi_dram[num_banks].start = area->start; + gd->bd->bi_dram[num_banks].size = area->size; + num_banks++; + } +} + +int sdram_add_memory_area (struct memory_info *info,uint64_t start, +uint64_t end) +{ +struct memory_area *ptr; + +if (info->num_areas ==CONFIG_NR_DRAM_BANKS ) +return -ENOSPC ; + + ptr = &info->area[info->num_areas]; + ptr->start = start; + ptr->size = end - start; + info->total_memory += ptr->size; +if (ptr->start < (1ULL <<32 )) + info->total_32bit_memory += ptr->size; +debug ("%d: memory %llx size %llx, total now %llx / %llx\n" , + info->num_areas, ptr->start, ptr->size, + info->total_32bit_memory, info->total_memory); + info->num_areas++; + +return 0 ; +} + +/* +* Dump in the log memory controller configuration as read from the memory +* controller registers. +*/ +void report_memory_config (void ) +{ +u32 addr_decoder_common, addr_decode_ch[2 ]; +int i; + + addr_decoder_common =readl (MCHBAR_REG (0x5000 )); + addr_decode_ch[0 ] =readl (MCHBAR_REG (0x5004 )); + addr_decode_ch[1 ] =readl (MCHBAR_REG (0x5008 )); + +debug ("memcfg DDR3 clock %d MHz\n" , + (readl (MCHBAR_REG (0x5e04 )) *13333 *2 +50 ) /100 ); +debug ("memcfg channel assignment: A: %d, B % d, C % d\n" , + addr_decoder_common &3 , + (addr_decoder_common >>2 ) &3 , + (addr_decoder_common >>4 ) &3 ); + +for (i =0 ; i <ARRAY_SIZE (addr_decode_ch); i++) { +u32 ch_conf = addr_decode_ch[i]; +debug ("memcfg channel[%d] config (%8.8x):\n" , i, ch_conf); +debug (" ECC %s\n" , ecc_decoder[(ch_conf >>24 ) &3 ]); +debug (" enhanced interleave mode %s\n" , + ((ch_conf >>22 ) &1 ) ?"on" :"off" ); +debug (" rank interleave %s\n" , + ((ch_conf >>21 ) &1 ) ?"on" :"off" ); +debug (" DIMMA %d MB width x%d %s rank%s\n" , + ((ch_conf >>0 ) &0xff ) *256 , + ((ch_conf >>19 ) &1 ) ?16 :8 , + ((ch_conf >>17 ) &1 ) ?"dual" :"single" , + ((ch_conf >>16 ) &1 ) ?"" :", selected" ); +debug (" DIMMB %d MB width x%d %s rank%s\n" , + ((ch_conf >>8 ) &0xff ) *256 , + ((ch_conf >>20 ) &1 ) ?16 :8 , + ((ch_conf >>18 ) &1 ) ?"dual" :"single" , + ((ch_conf >>16 ) &1 ) ?", selected" :"" ); + } +} + +int sdram_locate_spd (struct udevice *dev,int size,const void **spd_datap) +{ +const void *blob = gd->fdt_blob; +int spd_index; +struct gpio_desc desc[4 ]; +int spd_node; +int node; +int ret; + + ret =gpio_request_list_by_name (dev,"board-id-gpios" , desc, +ARRAY_SIZE (desc),GPIOD_IS_IN ); +if (ret <0 ) { +debug ("%s: gpio ret=%d\n" , __func__, ret); +return ret; + } + spd_index =dm_gpio_get_values_as_int (desc, ret); +debug ("spd index %d\n" , spd_index); + + node =fdt_first_subnode (blob, dev->of_offset); +if (node <0 ) +return -EINVAL ; +for (spd_node =fdt_first_subnode (blob, node); + spd_node >0 ; + spd_node =fdt_next_subnode (blob, spd_node)) { +int len; + +if (fdtdec_get_int (blob, spd_node,"reg" ,-1 ) != spd_index) +continue ; + *spd_datap =fdt_getprop (blob, spd_node,"data" , &len); +if (len < size) { +printf ("Missing SPD data\n" ); +return -EINVAL ; + } + +debug ("Using SDRAM SPD data for '%s'\n" , +fdt_get_name (blob, spd_node,NULL )); +return 0 ; + } + +printf ("No SPD data found for index %d\n" , spd_index); +return -ENOENT ; +} + +asmlinkage void sdram_console_tx_byte(unsigned char byte) +{ +#ifdef DEBUG +putc (byte); +#endif +} + +/** +* Find the PEI executable in the ROM and execute it. +* +* @me_dev: Management Engine device +* @pei_data: configuration data for UEFI PEI reference code +*/ +static int sdram_initialise (struct udevice *dev,struct udevice *me_dev, +void *pei_data,bool use_asm_linkage) +{ +unsigned version; +const char *data; + +report_platform_info (dev); +debug ("Starting UEFI PEI System Agent\n" ); + +debug ("PEI data at %p:\n" , pei_data); + + data = (char *)CONFIG_X86_MRC_ADDR ; +if (data) { +int rv; +ulong start; + +debug ("Calling MRC at %p\n" , data); +post_code (POST_PRE_MRC ); + start =get_timer (0 ); +if (use_asm_linkage) { + asmlinkage int (*func)(void *); + + func = (asmlinkage int (*)(void *))data; + rv =func (pei_data); + }else { +int (*func)(void *); + + func = (int (*)(void *))data; + rv =func (pei_data); + } +post_code (POST_MRC ); +if (rv) { +switch (rv) { +case -1 : +printf ("PEI version mismatch.\n" ); +break ; +case -2 : +printf ("Invalid memory frequency.\n" ); +break ; +default : +printf ("MRC returned %x.\n" , rv); + } +printf ("Nonzero MRC return value.\n" ); +return -EFAULT ; + } +debug ("MRC execution time %lu ms\n" ,get_timer (start)); + }else { +printf ("UEFI PEI System Agent not found.\n" ); +return -ENOSYS ; + } + + version =readl (MCHBAR_REG (MCHBAR_PEI_VERSION )); +debug ("System Agent Version %d.%d.%d Build %d\n" , + version >>24 , (version >>16 ) &0xff , + (version >>8 ) &0xff , version &0xff ); + +#if CONFIG_USBDEBUG +/* mrc.bin reconfigures USB, so reinit it to have debug */ +early_usbdebug_init (); +#endif + +return 0 ; +} + +int sdram_common_init (struct udevice *dev,void *pei_data,bool use_asm_linkage) +{ +struct udevice *me_dev; +int ret; + + ret =syscon_get_by_driver_data (X86_SYSCON_ME , &me_dev); +if (ret) +return ret; + + ret =sdram_initialise (dev, me_dev, pei_data, use_asm_linkage); +if (ret) +return ret; +quick_ram_check (); +post_code (POST_DRAM ); +report_memory_config (); + +return 0 ; +}arch/x86/include/asm/sdram_common.h new file +0
-0
arch/x86/include/asm/sdram_common.h line 4
Quoted 4 lines
arch/x86/include/asm/sdram_common.h new file +4
-0@@ -0,0 +1,56 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
arch/x86/include/asm/sdram_common.h line 8
Quoted 4 lines
arch/x86/include/asm/sdram_common.h new file +4
-0+*/ + +#ifndef __asm_sdram_common_h +#define __asm_sdram_common_h
nits: all capital letters
Quoted 39 lines
arch/x86/include/asm/sdram_common.h new file +39
-0+ +#include <linux/linkage.h> + +/** +* sdram_common_init() - Set up SDRAM +* +* This calls the memory reference code (MRC) to set up SDRAM +* +* @dev: Northbridge device +* @pei_data: Platform-specific data required by the MRC +* @use_asm_linkage: true if the call to MRC requires asmlinkage, false if it +* uses normal U-Boot calling +* @return 0 if OK, -ve on error +*/ +int sdram_common_init (struct udevice *dev,void *pei_data, +bool use_asm_linkage); + +asmlinkage void sdram_console_tx_byte(unsigned char byte); + +int sdram_locate_spd (struct udevice *dev,int size,const void **spd_datap); + +void report_memory_config (void ); + +/** +* sdram_add_memory_area() - Add a new usable memory area to our list +* +* Note: @start and @end must not span the first 4GB boundary +* +* @info: Place to store memory info +* @start: Start of this memory area +* @end: End of this memory area + 1 +*/ +int sdram_add_memory_area (struct memory_info *info,uint64_t start, +uint64_t end); + +/* +* This function looks for the highest region of memory lower than 4GB which +* has enough space for U-Boot where U-Boot is aligned on a page boundary. +* It overrides the default implementation found elsewhere which simply
arch/x86/include/asm/sdram_common.h
Quoted 10 lines
arch/x86/include/asm/sdram_common.h new file +9
-1+* picks the end of ram, wherever that may be. The location of the stack, +* the relocation address, and how far U-Boot is moved by relocation are +* set in the global data structure. +*/ +ulong sdram_common_board_get_usable_ram_top (ulong total_size); + +void sdram_common_dram_init_banksize (void ); + +#endif --
Regards,
Bin
PATCH 32/69 x86: ivybridge: Convert to use the common SDRAM code
In reply to Simon GlassAdjust the existing implementation to use the new common SDRAM init code.
---
arch/x86/cpu/ivybridge/sdram.c | 394 +++++++++-------------------------------- 1 file changed, 83 insertions(+), 311 deletions(-)
arch/x86/cpu/ivybridge/sdram.c +83 -311
@@ -28,6 +28,7 @@#include <asm/mtrr.h> #include <asm/pci.h> #include <asm/report_platform.h> +#include <asm/sdram_common.h> #include <asm/arch/me.h> #include <asm/arch/pei_data.h> #include <asm/arch/pch.h>
@@ -40,57 +41,14 @@ DECLARE_GLOBAL_DATA_PTR;#define CMOS_OFFSET_MRC_SEED_S3 156#define CMOS_OFFSET_MRC_SEED_CHK 160 -/* -* This function looks for the highest region of memory lower than 4GB which -* has enough space for U-Boot where U-Boot is aligned on a page boundary. -* It overrides the default implementation found elsewhere which simply -* picks the end of ram, wherever that may be. The location of the stack, -* the relocation address, and how far U-Boot is moved by relocation are -* set in the global data structure. -*/ ulong board_get_usable_ram_top (ulong total_size) { -struct memory_info *info = &gd->arch.meminfo; -uintptr_t dest_addr =0 ; -struct memory_area *largest =NULL ; -int i; - -/* Find largest area of memory below 4GB */ - -for (i =0 ; i < info->num_areas; i++) { -struct memory_area *area = &info->area[i]; - -if (area->start >=1ULL <<32 ) -continue ; -if (!largest || area->size > largest->size) - largest = area; - } - -/* If no suitable area was found, return an error. */ -assert (largest); -if (!largest || largest->size < (2 <<20 )) -panic ("No available memory found for relocation" ); - - dest_addr = largest->start + largest->size; - -return (ulong )dest_addr; +return sdram_common_board_get_usable_ram_top (total_size); }void dram_init_banksize (void ) { -struct memory_info *info = &gd->arch.meminfo; -int num_banks; -int i; - -for (i =0 , num_banks =0 ; i < info->num_areas; i++) { -struct memory_area *area = &info->area[i]; - -if (area->start >=1ULL <<32 ) -continue ; - gd->bd->bi_dram[num_banks].start = area->start; - gd->bd->bi_dram[num_banks].size = area->size; - num_banks++; - } +sdram_common_dram_init_banksize (); }static int read_seed_from_cmos (struct pei_data *pei_data)
@@ -217,164 +175,10 @@ int misc_init_r(void)return 0 ; } -static const char *const ecc_decoder[] = { -"inactive" , -"active on IO" , -"disabled on IO" , -"active" -}; - -/* -* Dump in the log memory controller configuration as read from the memory -* controller registers. -*/ -static void report_memory_config (void ) +static void post_system_agent_init (struct udevice *dev,struct udevice *me_dev, +struct pei_data *pei_data) { -u32 addr_decoder_common, addr_decode_ch[2 ]; -int i; - - addr_decoder_common =readl (MCHBAR_REG (0x5000 )); - addr_decode_ch[0 ] =readl (MCHBAR_REG (0x5004 )); - addr_decode_ch[1 ] =readl (MCHBAR_REG (0x5008 )); - -debug ("memcfg DDR3 clock %d MHz\n" , - (readl (MCHBAR_REG (0x5e04 )) *13333 *2 +50 ) /100 ); -debug ("memcfg channel assignment: A: %d, B % d, C % d\n" , - addr_decoder_common &3 , - (addr_decoder_common >>2 ) &3 , - (addr_decoder_common >>4 ) &3 ); - -for (i =0 ; i <ARRAY_SIZE (addr_decode_ch); i++) { -u32 ch_conf = addr_decode_ch[i]; -debug ("memcfg channel[%d] config (%8.8x):\n" , i, ch_conf); -debug (" ECC %s\n" , ecc_decoder[(ch_conf >>24 ) &3 ]); -debug (" enhanced interleave mode %s\n" , - ((ch_conf >>22 ) &1 ) ?"on" :"off" ); -debug (" rank interleave %s\n" , - ((ch_conf >>21 ) &1 ) ?"on" :"off" ); -debug (" DIMMA %d MB width x%d %s rank%s\n" , - ((ch_conf >>0 ) &0xff ) *256 , - ((ch_conf >>19 ) &1 ) ?16 :8 , - ((ch_conf >>17 ) &1 ) ?"dual" :"single" , - ((ch_conf >>16 ) &1 ) ?"" :", selected" ); -debug (" DIMMB %d MB width x%d %s rank%s\n" , - ((ch_conf >>8 ) &0xff ) *256 , - ((ch_conf >>20 ) &1 ) ?16 :8 , - ((ch_conf >>18 ) &1 ) ?"dual" :"single" , - ((ch_conf >>16 ) &1 ) ?", selected" :"" ); - } -} - -static void post_system_agent_init (struct pei_data *pei_data) -{ -/* If PCIe init is skipped, set the PEG clock gating */ -if (!pei_data->pcie_init) -setbits_le32 (MCHBAR_REG (0x7010 ),1 ); -} - -static asmlinkage void console_tx_byte(unsigned char byte) -{ -#ifdef DEBUG -putc (byte); -#endif -} - -static int recovery_mode_enabled (void ) -{ -return false; -} - -/** -* Find the PEI executable in the ROM and execute it. -* -* @dev: Northbridge device -* @pei_data: configuration data for UEFI PEI reference code -*/ -int sdram_initialise (struct udevice *dev,struct udevice *me_dev, -struct pei_data *pei_data) -{ -unsigned version; -const char *data;uint16_t done; -int ret; - -report_platform_info (dev); - -/* Wait for ME to be ready */ - ret =intel_early_me_init (me_dev); -if (ret) -return ret; - ret =intel_early_me_uma_size (me_dev); -if (ret <0 ) -return ret; - -debug ("Starting UEFI PEI System Agent\n" ); - -/* -* Do not pass MRC data in for recovery mode boot, -* Always pass it in for S3 resume. -*/ -if (!recovery_mode_enabled () || - pei_data->boot_mode ==PEI_BOOT_RESUME ) { - ret =prepare_mrc_cache (pei_data); -if (ret) -debug ("prepare_mrc_cache failed: %d\n" , ret); - } - -/* If MRC data is not found we cannot continue S3 resume. */ -if (pei_data->boot_mode ==PEI_BOOT_RESUME && !pei_data->mrc_input) { -debug ("Giving up in sdram_initialize: No MRC data\n" ); -reset_cpu (0 ); - } - -/* Pass console handler in pei_data */ - pei_data->tx_byte = console_tx_byte; - -debug ("PEI data at %p, size %x:\n" , pei_data,sizeof (*pei_data)); - - data = (char *)CONFIG_X86_MRC_ADDR ; -if (data) { -int rv; -int (*func)(struct pei_data *); -ulong start; - -debug ("Calling MRC at %p\n" , data); -post_code (POST_PRE_MRC ); - start =get_timer (0 ); - func = (int (*)(struct pei_data *))data; - rv =func (pei_data); -post_code (POST_MRC ); -if (rv) { -switch (rv) { -case -1 : -printf ("PEI version mismatch.\n" ); -break ; -case -2 : -printf ("Invalid memory frequency.\n" ); -break ; -default : -printf ("MRC returned %x.\n" , rv); - } -printf ("Nonzero MRC return value.\n" ); -return -EFAULT ; - } -debug ("MRC execution time %lu ms\n" ,get_timer (start)); - }else { -printf ("UEFI PEI System Agent not found.\n" ); -return -ENOSYS ; - } - -#if CONFIG_USBDEBUG -/* mrc.bin reconfigures USB, so reinit it to have debug */ -early_usbdebug_init (); -#endif - - version =readl (MCHBAR_REG (0x5034 )); -debug ("System Agent Version %d.%d.%d Build %d\n" , - version >>24 , (version >>16 ) &0xff , - (version >>8 ) &0xff , version &0xff ); -debug ("MRC output data length %#x at %p\n" , pei_data->mrc_output_len, - pei_data->mrc_output);/* * Send ME init done for SandyBridge here. This is done inside the
@@ -387,23 +191,14 @@ int sdram_initialise(struct udevice *dev, struct udevice *me_dev,else intel_me_status (me_dev); -post_system_agent_init (pei_data); -report_memory_config (); - -/* S3 resume: don't save scrambler seed or MRC data */ -if (pei_data->boot_mode !=PEI_BOOT_RESUME ) { -/* -* This will be copied to SDRAM in reserve_arch(), then written -* to SPI flash in mrccache_save() -*/ - gd->arch.mrc_output = (char *)pei_data->mrc_output; - gd->arch.mrc_output_len = pei_data->mrc_output_len; - ret =write_seeds_to_cmos (pei_data); -if (ret) -debug ("Failed to write seeds to CMOS: %d\n" , ret); - } +/* If PCIe init is skipped, set the PEG clock gating */ +if (!pei_data->pcie_init) +setbits_le32 (MCHBAR_REG (0x7010 ),1 ); +} -return 0 ; +static int recovery_mode_enabled (void ) +{ +return false; }int reserve_arch (void )
@@ -411,87 +206,16 @@ int reserve_arch(void)return mrccache_reserve (); } -static int copy_spd (struct pei_data *peid) +static int copy_spd (struct udevice *dev,struct pei_data *peid) { -const int gpio_vector[] = {41 ,42 ,43 ,10 ,-1 }; -int spd_index; -const void *blob = gd->fdt_blob; -int node, spd_node; -int ret, i; - -for (i =0 ; ; i++) { -if (gpio_vector[i] ==-1 ) -break ; - ret =gpio_requestf (gpio_vector[i],"spd_id%d" , i); -if (ret) { -debug ("%s: Could not request gpio %d\n" , __func__, - gpio_vector[i]); -return ret; - } - } - spd_index =gpio_get_values_as_int (gpio_vector); -debug ("spd index %d\n" , spd_index); - node =fdtdec_next_compatible (blob,0 ,COMPAT_MEMORY_SPD ); -if (node <0 ) { -printf ("SPD data not found.\n" ); -return -ENOENT ; - } - -for (spd_node =fdt_first_subnode (blob, node); - spd_node >0 ; - spd_node =fdt_next_subnode (blob, spd_node)) { -const char *data; -int len; - -if (fdtdec_get_int (blob, spd_node,"reg" ,-1 ) != spd_index) -continue ; - data =fdt_getprop (blob, spd_node,"data" , &len); -if (len <sizeof (peid->spd_data[0 ])) { -printf ("Missing SPD data\n" ); -return -EINVAL ; - } - -debug ("Using SDRAM SPD data for '%s'\n" , -fdt_get_name (blob, spd_node,NULL )); -memcpy (peid->spd_data[0 ], data,sizeof (peid->spd_data[0 ])); -break ; - } - -if (spd_node <0 ) { -printf ("No SPD data found for index %d\n" , spd_index); -return -ENOENT ; - } +const void *data; +int ret; -return 0 ; -} + ret =sdram_locate_spd (dev,sizeof (peid->spd_data[0 ]), &data); +if (ret) +return ret; -/** -* add_memory_area() - Add a new usable memory area to our list -* -* Note: @start and @end must not span the first 4GB boundary -* -* @info: Place to store memory info -* @start: Start of this memory area -* @end: End of this memory area + 1 -*/ -static int add_memory_area (struct memory_info *info, -uint64_t start,uint64_t end) -{ -struct memory_area *ptr; - -if (info->num_areas ==CONFIG_NR_DRAM_BANKS ) -return -ENOSPC ; - - ptr = &info->area[info->num_areas]; - ptr->start = start; - ptr->size = end - start; - info->total_memory += ptr->size; -if (ptr->start < (1ULL <<32 )) - info->total_32bit_memory += ptr->size; -debug ("%d: memory %llx size %llx, total now %llx / %llx\n" , - info->num_areas, ptr->start, ptr->size, - info->total_32bit_memory, info->total_memory); - info->num_areas++; +memcpy (peid->spd_data[0 ], data,sizeof (peid->spd_data[0 ]));return 0 ; }
@@ -610,10 +334,10 @@ static int sdram_find(struct udevice *dev)debug ("Available memory below 4GB: %lluM\n" , tomk >>10 );/* Report the memory regions */ -add_memory_area (info,1 <<20 ,2 <<28 ); -add_memory_area (info, (2 <<28 ) + (2 <<20 ),4 <<28 ); -add_memory_area (info, (4 <<28 ) + (2 <<20 ), tseg_base); -add_memory_area (info,1ULL <<32 , touud); +sdram_add_memory_area (info,1 <<20 ,2 <<28 ); +sdram_add_memory_area (info, (2 <<28 ) + (2 <<20 ),4 <<28 ); +sdram_add_memory_area (info, (4 <<28 ) + (2 <<20 ), tseg_base); +sdram_add_memory_area (info,1ULL <<32 , touud);/* Add MTRRs for memory */ mtrr_add_request (MTRR_TYPE_WRBACK ,0 ,2ULL <<30 );
@@ -682,7 +406,7 @@ static void rcba_config(void)int dram_init (void ) { -struct pei_data pei_data__aligned(8) = { +struct pei_data _pei_data__aligned(8) = { .pei_version =PEI_VERSION , .mchbar =MCH_BASE_ADDRESS , .dmibar =DEFAULT_DMIBAR ,
@@ -735,6 +459,7 @@ int dram_init(void) { 0, 4, 0x0000 }, /* P13= Empty */ }, }; +struct pei_data *pei_data = &_pei_data;struct udevice *dev, *me_dev;int ret;
@@ -746,27 +471,74 @@ int dram_init(void) ret =syscon_get_by_driver_data (X86_SYSCON_ME , &me_dev);if (ret)return ret; -debug ("Boot mode %d\n" , gd->arch.pei_boot_mode); -debug ("mrc_input %p\n" , pei_data.mrc_input); - pei_data.boot_mode = gd->arch.pei_boot_mode; - ret =copy_spd (&pei_data); -if (!ret) - ret =sdram_initialise (dev, me_dev, &pei_data); + ret =copy_spd (dev, pei_data);if (ret)return ret; + pei_data->boot_mode = gd->arch.pei_boot_mode; +debug ("Boot mode %d\n" , gd->arch.pei_boot_mode); +debug ("mrc_input %p\n" , pei_data->mrc_input); -rcba_config (); -quick_ram_check (); +/* +* Do not pass MRC data in for recovery mode boot, +* Always pass it in for S3 resume. +*/ +if (!recovery_mode_enabled () || + pei_data->boot_mode ==PEI_BOOT_RESUME ) { + ret =prepare_mrc_cache (pei_data); +if (ret) +debug ("prepare_mrc_cache failed: %d\n" , ret); + } -writew (0xCAFE ,MCHBAR_REG (SSKPD )); +/* If MRC data is not found we cannot continue S3 resume. */ +if (pei_data->boot_mode ==PEI_BOOT_RESUME && !pei_data->mrc_input) { +debug ("Giving up in sdram_initialize: No MRC data\n" ); +reset_cpu (0 ); + } -post_code (POST_DRAM ); +/* Pass console handler in pei_data */ + pei_data->tx_byte = sdram_console_tx_byte; - ret =sdram_find (dev); +/* Wait for ME to be ready */ + ret =intel_early_me_init (me_dev);if (ret)return ret; + ret =intel_early_me_uma_size (me_dev); +if (ret <0 ) +return ret; + ret =sdram_common_init (dev, pei_data, false); +if (ret) +return ret; + + ret =sdram_find (dev); +if (ret) +return ret; gd->ram_size = gd->arch.meminfo.total_32bit_memory; +debug ("MRC output data length %#x at %p\n" , pei_data->mrc_output_len, + pei_data->mrc_output); + +post_system_agent_init (dev, me_dev, pei_data); +report_memory_config (); + +/* S3 resume: don't save scrambler seed or MRC data */ +if (pei_data->boot_mode !=PEI_BOOT_RESUME ) { +/* +* This will be copied to SDRAM in reserve_arch(), then written +* to SPI flash in mrccache_save() +*/ + gd->arch.mrc_output = (char *)pei_data->mrc_output; + gd->arch.mrc_output_len = pei_data->mrc_output_len; + ret =write_seeds_to_cmos (pei_data); +if (ret) +debug ("Failed to write seeds to CMOS: %d\n" , ret); + } + +writew (0xCAFE ,MCHBAR_REG (SSKPD )); +if (ret) +return ret; + +rcba_config (); +return 0 ; }
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 32/69 x86: ivybridge: Convert to use the common SDRAM code
Quoted 8 lines · Simon Glass
Adjust the existing implementation to use the new common SDRAM init code.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/ivybridge/sdram.c | 394 +++++++++-------------------------------- 1 file changed, 83 insertions(+), 311 deletions(-)
PATCH 33/69 x86: dts: Drop memory SPD compatible string
In reply to Simon GlassThis is not needed now that the memory controller driver has the SPD data in its own node.
---
arch/x86/dts/chromebook_link.dts | 1 - include/fdtdec.h | 1 - lib/fdtdec.c | 1 - 3 files changed, 3 deletions(-)
arch/x86/dts/chromebook_link.dts +0 -1
@@ -78,7 +78,6 @@ <&gpio_b 11 0>, <&gpio_a 10 0>; u-boot,dm-pre-reloc; spd { - compatible = "memory-spd"; #address-cells = <1>; #size-cells = <0>; elpida_4Gb_1600_x16 {
include/fdtdec.h +0 -1
@@ -152,7 +152,6 @@ enum fdt_compat_id {COMPAT_SAMSUNG_EXYNOS5_I2C ,/* Exynos5 High Speed I2C Controller */ COMPAT_SAMSUNG_EXYNOS_SYSMMU ,/* Exynos sysmmu */ COMPAT_INTEL_MICROCODE ,/* Intel microcode update */ -COMPAT_MEMORY_SPD ,/* Memory SPD information */ COMPAT_INTEL_PANTHERPOINT_AHCI ,/* Intel Pantherpoint AHCI */ COMPAT_INTEL_MODEL_206AX ,/* Intel Model 206AX CPU */ COMPAT_INTEL_GMA, /* Intel Graphics Media Accelerator */
lib/fdtdec.c +0 -1
@@ -57,7 +57,6 @@ static const char * const compat_names[COMPAT_COUNT] = {COMPAT (SAMSUNG_EXYNOS5_I2C ,"samsung,exynos5-hsi2c" ),COMPAT (SAMSUNG_EXYNOS_SYSMMU ,"samsung,sysmmu-v3.3" ),COMPAT (INTEL_MICROCODE ,"intel,microcode" ), -COMPAT (MEMORY_SPD ,"memory-spd" ),COMPAT (INTEL_PANTHERPOINT_AHCI ,"intel,pantherpoint-ahci" ),COMPAT (INTEL_MODEL_206AX ,"intel,model-206ax" ), COMPAT(INTEL_GMA, "intel,gma"),
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 33/69 x86: dts: Drop memory SPD compatible string
Quoted 11 lines · Simon Glass
This is not needed now that the memory controller driver has the SPD data in its own node.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_link.dts | 1 - include/fdtdec.h | 1 - lib/fdtdec.c | 1 - 3 files changed, 3 deletions(-)
PATCH 34/69 x86: Add a script to aid code conversion from coreboot
In reply to Simon GlassIt is useful to automate the process of converting code from coreboot a little. Add a sed script which performs some common transformations.
---
doc/README.x86 | 9 +++++++++ scripts/coreboot.sed | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 scripts/coreboot.sed
doc/README.x86 +9 -0
@@ -812,6 +812,15 @@ PCIe root port's configuration registers will cause system hang while it is held in reset. For more details, check how they are implemented by the Intel Galileo board support codes in board/intel/galileo/galileo.c. +coreboot: + +See scripts/coreboot.sed which can assist with porting coreboot code into +U-Boot drivers. It will not resolve all build errors, but will perform common +transformations. Remember to add attribution to coreboot for new files added +to U-Boot. This should go at the top of each file and list the coreboot +filename where the code originated. + + TODO List --------- - Audio
scripts/coreboot.sed new file +17 -0
@@ -0,0 +1,17 @@ +# +# Copyright (c) 2016 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# +# Script to convert coreboot code to something similar to what U-Boot uses +# sed -f coreboot.sed <coreboot_file.c> +# Remember to add attribution to coreboot for new files added to U-Boot. +s/REG_RES_WRITE32(\(.*\), \(.*\), \(.*\)),/writel(\3, base + \2);/ +s/REG_RES_POLL32(\(.*\), \(.*\), \(.*\), \(.*\), \(.*\)),/ret = poll32(base + \2, \3, \4, \5);/ +s/REG_RES_OR32(\(.*\), \(.*\), \(.*\)),/setbits_le32(base + \2, \3);/ +s/REG_RES_RMW32(\(.*\), \(.*\), \(.*\), \(.*\)),/clrsetbits_le32(base + \2, ~\3, \4);/ +/REG_SCRIPT_END/d +s/read32/readl/ +s/write32(\(.*\), \(.*\))/writel(\2, \1)/ +s/conf->/plat->/ +s/static const struct reg_script \(.*\)_script\[\] = {/static int \1(struct udevice *dev)/
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 34/69 x86: Add a script to aid code conversion from coreboot
Hi Simon,
Quoted 45 lines · Simon Glass
It is useful to automate the process of converting code from coreboot a little. Add a sed script which performs some common transformations.
Signed-off-by Simon Glass <[email protected]>---
doc/README.x86 | 9 +++++++++ scripts/coreboot.sed | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 scripts/coreboot.seddoc/README.x86 +9
-0@@ -812,6 +812,15 @@ PCIe root port's configuration registers will cause system hang while it is held in reset. For more details, check how they are implemented by the Intel Galileo board support codes in board/intel/galileo/galileo.c. +coreboot: + +See scripts/coreboot.sed which can assist with porting coreboot code into +U-Boot drivers. It will not resolve all build errors, but will perform common +transformations. Remember to add attribution to coreboot for new files added +to U-Boot. This should go at the top of each file and list the coreboot +filename where the code originated. + + TODO List --------- - Audioscripts/coreboot.sed new file +8
-0@@ -0,0 +1,17 @@ +# +# Copyright (c) 2016 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# +# Script to convert coreboot code to something similar to what U-Boot uses +# sed -f coreboot.sed <coreboot_file.c> +# Remember to add attribution to coreboot for new files added to U-Boot.
scripts/coreboot.sed
Quoted 10 lines
scripts/coreboot.sed new file +9
-1+s/REG_RES_WRITE32(\(.*\), \(.*\), \(.*\)),/writel(\3, base + \2);/ +s/REG_RES_POLL32(\(.*\), \(.*\), \(.*\), \(.*\), \(.*\)),/ret = poll32(base + \2, \3, \4, \5);/ +s/REG_RES_OR32(\(.*\), \(.*\), \(.*\)),/setbits_le32(base + \2, \3);/ +s/REG_RES_RMW32(\(.*\), \(.*\), \(.*\), \(.*\)),/clrsetbits_le32(base + \2, ~\3, \4);/ +/REG_SCRIPT_END/d +s/read32/readl/ +s/write32(\(.*\), \(.*\))/writel(\2, \1)/ +s/conf->/plat->/ +s/static const struct reg_script \(.*\)_script\[\] = {/static int \1(struct udevice *dev)/ --
I have not tested this, but it looks good, so
Regards,
Bin
PATCH 34/69 x86: Add a script to aid code conversion from coreboot
Quoted 61 lines · Bin Meng
Hi Simon,
Quoted 45 lines · Simon Glass
It is useful to automate the process of converting code from coreboot a little. Add a sed script which performs some common transformations.
Signed-off-by Simon Glass <[email protected]>---
doc/README.x86 | 9 +++++++++ scripts/coreboot.sed | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 scripts/coreboot.seddoc/README.x86 +9
-0@@ -812,6 +812,15 @@ PCIe root port's configuration registers will cause system hang while it is held in reset. For more details, check how they are implemented by the Intel Galileo board support codes in board/intel/galileo/galileo.c. +coreboot: + +See scripts/coreboot.sed which can assist with porting coreboot code into +U-Boot drivers. It will not resolve all build errors, but will perform common +transformations. Remember to add attribution to coreboot for new files added +to U-Boot. This should go at the top of each file and list the coreboot +filename where the code originated. + + TODO List --------- - Audioscripts/coreboot.sed new file +8
-0@@ -0,0 +1,17 @@ +# +# Copyright (c) 2016 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# +# Script to convert coreboot code to something similar to what U-Boot uses +# sed -f coreboot.sed <coreboot_file.c> +# Remember to add attribution to coreboot for new files added to U-Boot.scripts/coreboot.sed
Quoted 10 lines
scripts/coreboot.sed new file +9
-1+s/REG_RES_WRITE32(\(.*\), \(.*\), \(.*\)),/writel(\3, base + \2);/ +s/REG_RES_POLL32(\(.*\), \(.*\), \(.*\), \(.*\), \(.*\)),/ret = poll32(base + \2, \3, \4, \5);/ +s/REG_RES_OR32(\(.*\), \(.*\), \(.*\)),/setbits_le32(base + \2, \3);/ +s/REG_RES_RMW32(\(.*\), \(.*\), \(.*\), \(.*\)),/clrsetbits_le32(base + \2, ~\3, \4);/ +/REG_SCRIPT_END/d +s/read32/readl/ +s/write32(\(.*\), \(.*\))/writel(\2, \1)/ +s/conf->/plat->/ +s/static const struct reg_script \(.*\)_script\[\] = {/static int \1(struct udevice *dev)/ --I have not tested this, but it looks good, so
Quoted 2 lines
Acked-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 35/69 x86: Correct duplicate POST values
In reply to Simon GlassTwo power-on-self-test values are the same. Fix this.
---
arch/x86/include/asm/post.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/post.h +2 -2
@@ -29,8 +29,8 @@#define POST_CPU_INFO 0x2d#define POST_PRE_MRC 0x2e#define POST_MRC 0x2f -#define POST_DRAM 0x2f -#define POST_LAPIC 0x30 +#define POST_DRAM 0x30 +#define POST_LAPIC 0x31#define POST_RAM_FAILURE 0xea#define POST_BIST_FAILURE 0xeb
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 35/69 x86: Correct duplicate POST values
Quoted 8 lines · Simon Glass
Two power-on-self-test values are the same. Fix this.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/include/asm/post.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH 35/69 x86: Correct duplicate POST values
Quoted 11 lines · Bin Meng
Quoted 8 lines · Simon Glass
Two power-on-self-test values are the same. Fix this.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/include/asm/post.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 36/69 x86: Add macros to clear and set I/O bits
In reply to Simon GlassThe clrsetbits_...() macros are useful for working with memory mapped I/O. But they do not work with I/O space, as used on x86 machines.
Add some macros to provide similar features for I/O.
---
arch/x86/include/asm/io.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
arch/x86/include/asm/io.h +22 -0
@@ -254,6 +254,28 @@ __OUTS(b) __OUTS(w) __OUTS(l) +/* IO space accessors */ +#define clrio (type, addr, clear) \ + out##type(in##type(addr) & ~(clear), (addr)) + +#define setio (type, addr, set) \ + out##type(in##type(addr) | (set), (addr)) + +#define clrsetio (type, addr, clear, set) \ + out##type((in##type(addr) & ~(clear)) | (set), (addr)) + +#define clrio_le32 (addr, clear) clrio(l, addr, clear) +#define clrio_le16 (addr, clear) clrio(w, addr, clear) +#define clrio_8 (addr, clear) clrio(b, addr, clear) + +#define setio_le32 (addr, set) setio(l, addr, set) +#define setio_le16 (addr, set) setio(w, addr, set) +#define setio_8 (addr, set) setio(b, addr, set) + +#define clrsetio_le32 (addr, clear, set) clrsetio(l, addr, clear, set) +#define clrsetio_le16 (addr, clear, set) clrsetio(w, addr, clear, set) +#define clrsetio_8 (addr, clear, set) clrsetio(b, addr, clear, set) +static inline void sync (void ) { }
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 36/69 x86: Add macros to clear and set I/O bits
Hi Simon,
Quoted 30 lines · Simon Glass
The clrsetbits_...() macros are useful for working with memory mapped I/O. But they do not work with I/O space, as used on x86 machines.
Add some macros to provide similar features for I/O.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/include/asm/io.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)arch/x86/include/asm/io.h +11
-0@@ -254,6 +254,28 @@ __OUTS(b) __OUTS(w) __OUTS(l) +/* IO space accessors */ +#define clrio (type, addr, clear) \ + out##type(in##type(addr) & ~(clear), (addr)) + +#define setio (type, addr, set) \ + out##type(in##type(addr) | (set), (addr)) + +#define clrsetio (type, addr, clear, set) \ + out##type((in##type(addr) & ~(clear)) | (set), (addr)) + +#define clrio_le32 (addr, clear) clrio(l, addr, clear)
arch/x86/include/asm/io.h __OUTS(b) · line 277
Quoted 10 lines
arch/x86/include/asm/io.h +10
-0+#define clrio_le16 (addr, clear) clrio(w, addr, clear) +#define clrio_8 (addr, clear) clrio(b, addr, clear) + +#define setio_le32 (addr, set) setio(l, addr, set) +#define setio_le16 (addr, set) setio(w, addr, set) +#define setio_8 (addr, set) setio(b, addr, set) + +#define clrsetio_le32 (addr, clear, set) clrsetio(l, addr, clear, set) +#define clrsetio_le16 (addr, clear, set) clrsetio(w, addr, clear, set) +#define clrsetio_8 (addr, clear, set) clrsetio(b, addr, clear, set)
Why adding _leXX to these ops? x86 is always little-endian, and we won't bother creating a _beXX version.
arch/x86/include/asm/io.h __OUTS(b)
Quoted 5 lines
arch/x86/include/asm/io.h +1
-1+static inline void sync (void ) { } --
Regards,
Bin
PATCH 37/69 x86: Allow I/O functions to use pointers
In reply to Simon GlassIt is common with memory-mapped I/O to use the address of a structure member to access memory, as in:
struct some_regs {
u32 ctrl;
u32 data;
}
struct some_regs *regs = (struct some_regs *)BASE_ADDRESS;
writel(1, ®->ctrl);
writel(2, ®->data);This does not currently work with inl(), outl(), etc. Add a cast to permit this.
---
arch/x86/include/asm/io.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/x86/include/asm/io.h +10 -2
@@ -202,7 +202,7 @@ out:* Talk about misusing macros.. */ #define __OUT1 (s,x) \ -static inline void out##s(unsigned x value, unsigned short port) { +static inline void _out##s(unsigned x value, unsigned short port) {#define __OUT2 (s,s1,s2) \ __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
@@ -213,7 +213,7 @@ __OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \ __OUT1(s##_p,x) __OUT2(s,s1,"w") __FULL_SLOW_DOWN_IO : : "a" (value), "Nd" (port));}#define __IN1 (s) \ -static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v; +static inline RETURN_TYPE _in##s(unsigned short port) { RETURN_TYPE _v;#define __IN2 (s,s1,s2) \ __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
@@ -242,10 +242,18 @@ __IN(w,"") __IN(l,"")#undef RETURN_TYPE +#define inb (port) _inb((uintptr_t)(port)) +#define inw (port) _inw((uintptr_t)(port)) +#define inl (port) _inl((uintptr_t)(port)) + __OUT(b,"b",char) __OUT(w,"w",short) __OUT(l,,int) +#define outb (val, port) _outb(val, (uintptr_t)(port)) +#define outw (val, port) _outw(val, (uintptr_t)(port)) +#define outl (val, port) _outl(val, (uintptr_t)(port)) + __INS(b) __INS(w) __INS(l)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 37/69 x86: Allow I/O functions to use pointers
Quoted 13 lines · Simon Glass
It is common with memory-mapped I/O to use the address of a structure member to access memory, as in:
struct some_regs { u32 ctrl; u32 data; } struct some_regs *regs = (struct some_regs *)BASE_ADDRESS; writel(1, ®->ctrl); writel(2, ®->data);
Quoted 9 lines
This does not currently work with
inl(),outl(), etc. Add a cast to permit this.Signed-off-by Simon Glass <[email protected]>---
arch/x86/include/asm/io.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
PATCH 38/69 x86: Move common MRC Kconfig options to the common file
In reply to Simon GlassAt present the MRC options are private to ivybridge. Other Intel CPUs also use these settings. Move them to a common place.
---
arch/x86/Kconfig | 39 +++++++++++++++++++++++++++++++++++++++ arch/x86/cpu/ivybridge/Kconfig | 27 +-------------------------- 2 files changed, 40 insertions(+), 26 deletions(-)
arch/x86/Kconfig +39 -0
@@ -266,6 +266,45 @@ config ENABLE_MRC_CACHE to be used for speeding up boot time on future reboots and/or power cycles. +config HAVE_MRC + bool "Add a System Agent binary" + depends on !HAVE_FSP + help + Select this option to add a System Agent binary to + the resulting U-Boot image. MRC stands for Memory Reference Code. + It is a binary blob which U-Boot uses to set up SDRAM. + + Note: Without this binary U-Boot will not be able to set up its + SDRAM so will not boot. + +config CACHE_MRC_BIN + bool + depends on HAVE_MRC + default n + +config CACHE_MRC_SIZE_KB + int + depends on HAVE_MRC + default 512 + +config DCACHE_RAM_BASE + hex + depends on HAVE_MRC + +config DCACHE_RAM_SIZE + hex + depends on HAVE_MRC + default 0x40000 + +config DCACHE_RAM_MRC_VAR_SIZE + hex + depends on HAVE_MRC + help + This is the amount of CAR (Cache as RAM) reserved for use by the + memory reference code. This depends on the implementation of the + memory reference code and must be set correctly or the board will + not boot. + config SMP bool "Enable Symmetric Multiprocessing" default n
arch/x86/cpu/ivybridge/Kconfig +1 -26
@@ -7,43 +7,18 @@ config NORTHBRIDGE_INTEL_IVYBRIDGE bool - select CACHE_MRC_BIN + select CACHE_MRC_BIN if HAVE_MRC if NORTHBRIDGE_INTEL_IVYBRIDGE -config CACHE_MRC_BIN - bool - default n - -config CACHE_MRC_SIZE_KB - int - default 512 - config DCACHE_RAM_BASE - hex default 0xff7e0000 config DCACHE_RAM_SIZE - hex default 0x20000 -config HAVE_MRC - bool "Add a System Agent binary" - help - Select this option to add a System Agent binary to - the resulting U-Boot image. MRC stands for Memory Reference Code. - It is a binary blob which U-Boot uses to set up SDRAM. - - Note: Without this binary U-Boot will not be able to set up its - SDRAM so will not boot. - config DCACHE_RAM_MRC_VAR_SIZE - hex default 0x4000 - help - This is the amount of CAR (Cache as RAM) reserved for use by the - memory reference code. This should be set to 16KB (0x4000 hex) - so that MRC has enough space to run. config CPU_SPECIFIC_OPTIONS def_bool y
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 38/69 x86: Move common MRC Kconfig options to the common file
Hi Simon,
Quoted 15 lines · Simon Glass
At present the MRC options are private to ivybridge. Other Intel CPUs also use these settings. Move them to a common place.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/Kconfig | 39 +++++++++++++++++++++++++++++++++++++++ arch/x86/cpu/ivybridge/Kconfig | 27 +-------------------------- 2 files changed, 40 insertions(+), 26 deletions(-)arch/x86/Kconfig +0
-0
arch/x86/Kconfig config ENABLE_MRC_CACHE · line 271
Quoted 6 lines
arch/x86/Kconfig +3
-0@@ -266,6 +266,45 @@ config ENABLE_MRC_CACHE to be used for speeding up boot time on future reboots and/or power cycles. +config HAVE_MRC + bool "Add a System Agent binary" + depends on !HAVE_FSP
nits: indention of "depends on.." is wrong.
Quoted 16 lines
arch/x86/Kconfig +16
-0+ help + Select this option to add a System Agent binary to + the resulting U-Boot image. MRC stands for Memory Reference Code. + It is a binary blob which U-Boot uses to set up SDRAM. + + Note: Without this binary U-Boot will not be able to set up its + SDRAM so will not boot. + +config CACHE_MRC_BIN + bool + depends on HAVE_MRC + default n + +config CACHE_MRC_SIZE_KB + int + depends on HAVE_MRC
arch/x86/Kconfig config ENABLE_MRC_CACHE · line 297
Quoted 10 lines
arch/x86/Kconfig +10
-0+ default 512 + +config DCACHE_RAM_BASE + hex + depends on HAVE_MRC + +config DCACHE_RAM_SIZE + hex + depends on HAVE_MRC + default 0x40000
Can we add some help text to the above options?
Quoted 53 lines
arch/x86/Kconfig +10
-0+ +config DCACHE_RAM_MRC_VAR_SIZE + hex + depends on HAVE_MRC + help + This is the amount of CAR (Cache as RAM) reserved for use by the + memory reference code. This depends on the implementation of the + memory reference code and must be set correctly or the board will + not boot. + config SMP bool "Enable Symmetric Multiprocessing" default narch/x86/cpu/ivybridge/Kconfig +1
-21@@ -7,43 +7,18 @@ config NORTHBRIDGE_INTEL_IVYBRIDGE bool - select CACHE_MRC_BIN + select CACHE_MRC_BIN if HAVE_MRC if NORTHBRIDGE_INTEL_IVYBRIDGE -config CACHE_MRC_BIN - bool - default n - -config CACHE_MRC_SIZE_KB - int - default 512 - config DCACHE_RAM_BASE - hex default 0xff7e0000 config DCACHE_RAM_SIZE - hex default 0x20000 -config HAVE_MRC - bool "Add a System Agent binary" - help - Select this option to add a System Agent binary to - the resulting U-Boot image. MRC stands for Memory Reference Code. - It is a binary blob which U-Boot uses to set up SDRAM. - - Note: Without this binary U-Boot will not be able to set up its - SDRAM so will not boot. - config DCACHE_RAM_MRC_VAR_SIZE
arch/x86/cpu/ivybridge/Kconfig
Quoted 10 lines
arch/x86/cpu/ivybridge/Kconfig +0
-6- hex default 0x4000 - help - This is the amount of CAR (Cache as RAM) reserved for use by the - memory reference code. This should be set to 16KB (0x4000 hex) - so that MRC has enough space to run. config CPU_SPECIFIC_OPTIONS def_bool y --
Regards,
Bin
PATCH 39/69 x86: Tidy up mp_init to reduce duplication
In reply to Simon GlassThe timeout step is always 50us. By updating apic_wait_timeout() to print the debug messages we can simplify the code. Also tidy up a few messages and comments while we are here.
---
arch/x86/cpu/mp_init.c | 79 +++++++++++++++++--------------------------------- 1 file changed, 26 insertions(+), 53 deletions(-)
arch/x86/cpu/mp_init.c +26 -53
@@ -195,7 +195,7 @@ static int save_bsp_msrs(char *start, int size) msr_count =2 * num_var_mtrrs +NUM_FIXED_MTRRS +1 ;if ((msr_count *sizeof (struct saved_msr )) > size) { -printf ("Cannot mirror all %d msrs.\n" , msr_count); +printf ("Cannot mirror all %d msrs\n" , msr_count);return -ENOSPC ; }
@@ -283,21 +283,25 @@ static int check_cpu_devices(int expected_cpus) }/* Returns 1 for timeout. 0 on success */ -static int apic_wait_timeout (int total_delay,int delay_step) +static int apic_wait_timeout (int total_delay,const char *msg) {int total =0 ; -int timeout =0 ; +if (!(lapic_read (LAPIC_ICR ) &LAPIC_ICR_BUSY )) +return 0 ; + +debug ("Waiting for %s..." , msg);while (lapic_read (LAPIC_ICR ) &LAPIC_ICR_BUSY ) { -udelay (delay_step); - total += delay_step; +udelay (50 ); + total +=50 ;if (total >= total_delay) { - timeout =1 ; -break ; +debug ("timed out: aborting\n" ); +return -ETIMEDOUT ; } } +debug ("done\n" ); -return timeout; +return 0 ; }static int start_aps (int ap_count,atomic_t *num_aps)
@@ -320,73 +324,42 @@ static int start_aps(int ap_count, atomic_t *num_aps)debug ("Attempting to start %d APs\n" , ap_count); -if ((lapic_read (LAPIC_ICR ) &LAPIC_ICR_BUSY )) { -debug ("Waiting for ICR not to be busy..." ); -if (apic_wait_timeout (1000 ,50 )) { -debug ("timed out. Aborting.\n" ); -return -1 ; - }else { -debug ("done.\n" ); - } - } +if (apic_wait_timeout (1000 ,"ICR not to be busy" )) +return -ETIMEDOUT ;/* Send INIT IPI to all but self */ lapic_write (LAPIC_ICR2 ,SET_LAPIC_DEST_FIELD (0 ));lapic_write (LAPIC_ICR ,LAPIC_DEST_ALLBUT |LAPIC_INT_ASSERT |LAPIC_DM_INIT ); -debug ("Waiting for 10ms after sending INIT.\n" ); +debug ("Waiting for 10ms after sending INIT\n" );mdelay (10 );/* Send 1st SIPI */ -if ((lapic_read (LAPIC_ICR ) &LAPIC_ICR_BUSY )) { -debug ("Waiting for ICR not to be busy..." ); -if (apic_wait_timeout (1000 ,50 )) { -debug ("timed out. Aborting.\n" ); -return -1 ; - }else { -debug ("done.\n" ); - } - } +if (apic_wait_timeout (1000 ,"ICR not to be busy" )) +return -ETIMEDOUT ;lapic_write (LAPIC_ICR2 ,SET_LAPIC_DEST_FIELD (0 ));lapic_write (LAPIC_ICR ,LAPIC_DEST_ALLBUT |LAPIC_INT_ASSERT |LAPIC_DM_STARTUP | sipi_vector); -debug ("Waiting for 1st SIPI to complete..." ); -if (apic_wait_timeout (10000 ,50 )) { -debug ("timed out.\n" ); -return -1 ; - }else { -debug ("done.\n" ); - } +if (apic_wait_timeout (10000 ,"first SIPI to complete" )) +return -ETIMEDOUT ;/* Wait for CPUs to check in up to 200 us */ wait_for_aps (num_aps, ap_count,200 ,15 );/* Send 2nd SIPI */ -if ((lapic_read (LAPIC_ICR ) &LAPIC_ICR_BUSY )) { -debug ("Waiting for ICR not to be busy..." ); -if (apic_wait_timeout (1000 ,50 )) { -debug ("timed out. Aborting.\n" ); -return -1 ; - }else { -debug ("done.\n" ); - } - } +if (apic_wait_timeout (1000 ,"ICR not to be busy" )) +return -ETIMEDOUT ;lapic_write (LAPIC_ICR2 ,SET_LAPIC_DEST_FIELD (0 ));lapic_write (LAPIC_ICR ,LAPIC_DEST_ALLBUT |LAPIC_INT_ASSERT |LAPIC_DM_STARTUP | sipi_vector); -debug ("Waiting for 2nd SIPI to complete..." ); -if (apic_wait_timeout (10000 ,50 )) { -debug ("timed out.\n" ); -return -1 ; - }else { -debug ("done.\n" ); - } +if (apic_wait_timeout (10000 ,"second SIPI to complete" )) +return -ETIMEDOUT ;/* Wait for CPUs to check in */ if (wait_for_aps (num_aps, ap_count,10000 ,50 )) { -debug ("Not all APs checked in: %d/%d.\n" , +debug ("Not all APs checked in: %d/%d\n" ,atomic_read (num_aps), ap_count);return -1 ; }
@@ -410,7 +383,7 @@ static int bsp_do_flight_plan(struct udevice *cpu, struct mp_params *mp_params)/* Wait for the APs to check in */ if (wait_for_aps (&rec->cpus_entered, num_aps, timeout_us, step_us)) { -debug ("MP record %d timeout.\n" , i); +debug ("MP record %d timeout\n" , i); ret =-1 ; } }
@@ -430,7 +403,7 @@ static int init_bsp(struct udevice **devp)int ret;cpu_get_name (processor_name); -debug ("CPU: %s.\n" , processor_name); +debug ("CPU: %s\n" , processor_name);lapic_setup ();
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 39/69 x86: Tidy up mp_init to reduce duplication
Quoted 10 lines · Simon Glass
The timeout step is always 50us. By updating
apic_wait_timeout()to print the debug messages we can simplify the code. Also tidy up a few messages and comments while we are here.Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/mp_init.c | 79 +++++++++++++++++--------------------------------- 1 file changed, 26 insertions(+), 53 deletions(-)
PATCH 39/69 x86: Tidy up mp_init to reduce duplication
Quoted 5 lines · Bin Meng
Quoted 4 lines · Simon Glass
The timeout step is always 50us. By updating
apic_wait_timeout()to print the debug messages we can simplify the code. Also tidy up a few messages and comments while we are here.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/mp_init.c | 79 +++++++++++++++++--------------------------------- 1 file changed, 26 insertions(+), 53 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 40/69 x86: Record the CPU details when starting each core
In reply to Simon GlassAs each core starts up, record its microcode version and CPU ID so these can be presented with the 'cpu detail' command.
---
arch/x86/cpu/intel_common/microcode_intel.c | 2 +- arch/x86/cpu/mp_init.c | 5 +++++ arch/x86/include/asm/microcode.h | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-)
arch/x86/cpu/intel_common/microcode_intel.c +1 -1
@@ -64,7 +64,7 @@ static int microcode_decode_node(const void *blob, int node,return 0 ; } -static inline uint32_t microcode_read_rev (void ) +int microcode_read_rev (void ) {/* * Some Intel CPUs can be very finicky about the CPUID sequence used.
arch/x86/cpu/mp_init.c +5 -0
@@ -15,6 +15,7 @@#include <asm/cpu.h> #include <asm/interrupt.h> #include <asm/lapic.h> +#include <asm/microcode.h> #include <asm/mp.h> #include <asm/msr.h> #include <asm/mtrr.h>
@@ -560,12 +561,16 @@ int mp_init(struct mp_params *p)int mp_init_cpu (struct udevice *cpu,void *unused) { +struct cpu_platdata *plat =dev_get_parent_platdata (cpu); +/* * Multiple APs are brought up simultaneously and they may get the same * seq num in the uclass_resolve_seq() during device_probe(). To avoid * this, set req_seq to the reg number in the device tree in advance. */ cpu->req_seq =fdtdec_get_int (gd->fdt_blob, cpu->of_offset,"reg" ,-1 ); + plat->ucode_version =microcode_read_rev (); + plat->device_id =cpuid_eax (1 );return device_probe (cpu); }
arch/x86/include/asm/microcode.h +9 -0
@@ -18,6 +18,15 @@* not updates were found, -EINVAL if an update was invalid */ int microcode_update_intel (void ); + +/** +* microcode_read_rev() - Read the microcode version +* +* This reads the microcode version of the currently running CPU +* +* @return microcode version number +*/ +int microcode_read_rev (void );#endif /* __ASSEMBLY__ */ #endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 40/69 x86: Record the CPU details when starting each core
Hi Simon,
Quoted 39 lines · Simon Glass
As each core starts up, record its microcode version and CPU ID so these can be presented with the 'cpu detail' command.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/intel_common/microcode_intel.c | 2 +- arch/x86/cpu/mp_init.c | 5 +++++ arch/x86/include/asm/microcode.h | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-)arch/x86/cpu/intel_common/microcode_intel.c +1
-1@@ -64,7 +64,7 @@ static int microcode_decode_node(const void *blob, int node,return 0 ; } -static inline uint32_t microcode_read_rev (void ) +int microcode_read_rev (void ) {/* * Some Intel CPUs can be very finicky about the CPUID sequence used. arch/x86/cpu/mp_init.c +1
-0@@ -15,6 +15,7 @@#include <asm/cpu.h> #include <asm/interrupt.h> #include <asm/lapic.h> +#include <asm/microcode.h> #include <asm/mp.h> #include <asm/msr.h> #include <asm/mtrr.h> @@ -560,12 +561,16 @@ int mp_init(struct mp_params *p)int mp_init_cpu (struct udevice *cpu,void *unused)
arch/x86/cpu/mp_init.c int mp_init(struct mp_params *p) · line 572
Quoted 10 lines
arch/x86/cpu/mp_init.c +3
-0{ +struct cpu_platdata *plat =dev_get_parent_platdata (cpu); +/* * Multiple APs are brought up simultaneously and they may get the same * seq num in the uclass_resolve_seq() during device_probe(). To avoid * this, set req_seq to the reg number in the device tree in advance. */ cpu->req_seq =fdtdec_get_int (gd->fdt_blob, cpu->of_offset,"reg" ,-1 ); + plat->ucode_version =microcode_read_rev ();
This won't work on Quark as Quark does not have microcode MSRs.
arch/x86/cpu/mp_init.c int mp_init(struct mp_params *p) · line 573
Quoted 1 line
arch/x86/cpu/mp_init.c +1
-0+ plat->device_id =cpuid_eax (1 );
Why not just use gd->arch.x86_device?
Quoted 14 lines
arch/x86/cpu/mp_init.c +0
-0return device_probe (cpu); }arch/x86/include/asm/microcode.h +3
-0@@ -18,6 +18,15 @@* not updates were found, -EINVAL if an update was invalid */ int microcode_update_intel (void ); + +/** +* microcode_read_rev() - Read the microcode version
arch/x86/include/asm/microcode.h
Quoted 10 lines
arch/x86/include/asm/microcode.h +6
-1+* +* This reads the microcode version of the currently running CPU +* +* @return microcode version number +*/ +int microcode_read_rev (void );#endif /* __ASSEMBLY__ */ #endif --
Regards,
Bin
PATCH 41/69 x86: ivybridge: Show microcode version for each code
In reply to Simon GlassEnable the microcode feature so that the microcode version is shown with the 'cpu detail' command.
---
arch/x86/cpu/ivybridge/model_206ax.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/cpu/ivybridge/model_206ax.c +2 -1
@@ -458,7 +458,8 @@ static int model_206ax_get_info(struct udevice *dev, struct cpu_info *info) msr =msr_read (MSR_IA32_PERF_CTL ); info->cpu_freq = ((msr.lo >>8 ) &0xff ) *SANDYBRIDGE_BCLK *1000000 ; - info->features =1 <<CPU_FEAT_L1_CACHE |1 <<CPU_FEAT_MMU ; + info->features =1 <<CPU_FEAT_L1_CACHE |1 <<CPU_FEAT_MMU | +1 <<CPU_FEAT_UCODE ;return 0 ; }
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 41/69 x86: ivybridge: Show microcode version for each code
Quoted 14 lines · Simon Glass
Enable the microcode feature so that the microcode version is shown with the 'cpu detail' command.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/ivybridge/model_206ax.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/x86/cpu/ivybridge/model_206ax.c +0
-0
arch/x86/cpu/ivybridge/model_206ax.c static int model_206ax_get_info(struct udevice *dev, struct cpu_info *info)
Quoted 10 lines
arch/x86/cpu/ivybridge/model_206ax.c +2
-2@@ -458,7 +458,8 @@ static int model_206ax_get_info(struct udevice *dev, struct cpu_info *info) msr =msr_read (MSR_IA32_PERF_CTL ); info->cpu_freq = ((msr.lo >>8 ) &0xff ) *SANDYBRIDGE_BCLK *1000000 ; - info->features =1 <<CPU_FEAT_L1_CACHE |1 <<CPU_FEAT_MMU ; + info->features =1 <<CPU_FEAT_L1_CACHE |1 <<CPU_FEAT_MMU | +1 <<CPU_FEAT_UCODE ;return 0 ; } --
PATCH 42/69 x86: Add comments to the SIPI vector
In reply to Simon GlassThe Intel SIPI (start-up inter-processor interrupt) vector is the entry point for each secondary CPU (also called an AP - applications processor). The assembler and C code are linked, so add comments to indicate this.
---
arch/x86/cpu/sipi_vector.S | 1 + arch/x86/include/asm/sipi.h | 1 + 2 files changed, 2 insertions(+)
arch/x86/cpu/sipi_vector.S +1 -0
@@ -193,6 +193,7 @@ load_msr: mov c_handler, %esi call *%esi + /* This matches struct sipi_param */ .align 4 .globl sipi_params sipi_params:
arch/x86/include/asm/sipi.h +1 -0
@@ -42,6 +42,7 @@ struct __packed sipi_params_16bit {* struct sipi_params - 32-bit SIP entry-point parameters * * These are used by the AP init code and must be set up before the APs start. +* The members must match with the sipi_params layout in sipi_vector.S. * * The stack area extends down from @stack_top, with @stack_size allocated * for each AP.
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 42/69 x86: Add comments to the SIPI vector
Quoted 11 lines · Simon Glass
The Intel SIPI (start-up inter-processor interrupt) vector is the entry point for each secondary CPU (also called an AP - applications processor). The assembler and C code are linked, so add comments to indicate this.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/sipi_vector.S | 1 + arch/x86/include/asm/sipi.h | 1 + 2 files changed, 2 insertions(+)
PATCH 42/69 x86: Add comments to the SIPI vector
Quoted 8 lines · Bin Meng
Quoted 7 lines · Simon Glass
The Intel SIPI (start-up inter-processor interrupt) vector is the entry point for each secondary CPU (also called an AP - applications processor). The assembler and C code are linked, so add comments to indicate this.
Signed-off-by Simon Glass <[email protected]>---
Quoted 6 lines
Quoted 4 lines
arch/x86/cpu/sipi_vector.S | 1 + arch/x86/include/asm/sipi.h | 1 + 2 files changed, 2 insertions(+)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 43/69 x86: Update microcode for secondary CPUs
In reply to Simon GlassEach CPU needs to have its microcode loaded. Add support for this so that all CPUs will have the same version.
---
arch/x86/cpu/cpu.c | 1 + arch/x86/cpu/intel_common/car.S | 2 ++ arch/x86/cpu/mp_init.c | 6 ++++-- arch/x86/include/asm/microcode.h | 3 +++ arch/x86/lib/fsp/fsp_car.S | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-)
arch/x86/cpu/cpu.c +1 -0
@@ -27,6 +27,7 @@#include <asm/control_regs.h> #include <asm/cpu.h> #include <asm/lapic.h> +#include <asm/microcode.h> #include <asm/mp.h> #include <asm/msr.h> #include <asm/mtrr.h>
arch/x86/cpu/intel_common/car.S +2 -0
@@ -237,5 +237,7 @@ mtrr_table_end: .align 4 _dt_ucode_base_size: /* These next two fields are filled in by ifdtool */ +.globl ucode_base +ucode_base: /* Declared in micrcode.h */ .long 0 /* microcode base */ .long 0 /* microcode size */
arch/x86/cpu/mp_init.c +4 -2
@@ -248,8 +248,10 @@ static int load_sipi_vector(atomic_t **ap_countp, int num_cpus)if (!stack)return -ENOMEM ; params->stack_top = (u32)(stack + size); - - params->microcode_ptr =0 ; +#ifndef CONFIG_QEMU + params->microcode_ptr = ucode_base; +debug ("Microcode at %x\n" , params->microcode_ptr); +#endif params->msr_table_ptr = (u32 )msr_save; ret =save_bsp_msrs (msr_save,sizeof (msr_save));if (ret <0 )
arch/x86/include/asm/microcode.h +3 -0
@@ -9,6 +9,9 @@#ifndef __ASSEMBLY__ +/* This is a declaration for ucode_base in start.S */ +extern u32 ucode_base; +/** * microcode_update_intel() - Apply microcode updates *
arch/x86/lib/fsp/fsp_car.S +2 -0
@@ -102,6 +102,8 @@ temp_ram_init_romstack: temp_ram_init_params: _dt_ucode_base_size: /* These next two fields are filled in by ifdtool */ +.globl ucode_base +ucode_base: /* Declared in micrcode.h */ .long 0 /* microcode base */ .long 0 /* microcode size */ .long CONFIG_SYS_MONITOR_BASE /* code region base */
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 43/69 x86: Update microcode for secondary CPUs
Hi Simon,
Quoted 30 lines · Simon Glass
Each CPU needs to have its microcode loaded. Add support for this so that all CPUs will have the same version.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/cpu.c | 1 + arch/x86/cpu/intel_common/car.S | 2 ++ arch/x86/cpu/mp_init.c | 6 ++++-- arch/x86/include/asm/microcode.h | 3 +++ arch/x86/lib/fsp/fsp_car.S | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-)arch/x86/cpu/cpu.c +1
-0@@ -27,6 +27,7 @@#include <asm/control_regs.h> #include <asm/cpu.h> #include <asm/lapic.h> +#include <asm/microcode.h> #include <asm/mp.h> #include <asm/msr.h> #include <asm/mtrr.h> arch/x86/cpu/intel_common/car.S +0
-0
arch/x86/cpu/intel_common/car.S mtrr_table_end: · line 241
Quoted 5 lines
arch/x86/cpu/intel_common/car.S +2
-0@@ -237,5 +237,7 @@ mtrr_table_end: .align 4 _dt_ucode_base_size: /* These next two fields are filled in by ifdtool */ +.globl ucode_base +ucode_base: /* Declared in micrcode.h */
typo: microcode.h
arch/x86/cpu/mp_init.c static int load_sipi_vector(atomic_t **ap_countp, int num_cpus) · line 251
Quoted 13 lines
arch/x86/cpu/intel_common/car.S +0
-0.long 0 /* microcode base */ .long 0 /* microcode size */arch/x86/cpu/mp_init.c +1
-2@@ -248,8 +248,10 @@ static int load_sipi_vector(atomic_t **ap_countp, int num_cpus)if (!stack)return -ENOMEM ; params->stack_top = (u32)(stack + size); - - params->microcode_ptr =0 ; +#ifndef CONFIG_QEMU
I believe for FSP case, we should not load microcode to APs as FSP already did this for us.
Quoted 25 lines
arch/x86/cpu/mp_init.c +3
-0+ params->microcode_ptr = ucode_base; +debug ("Microcode at %x\n" , params->microcode_ptr); +#endif params->msr_table_ptr = (u32 )msr_save; ret =save_bsp_msrs (msr_save,sizeof (msr_save));if (ret <0 )arch/x86/include/asm/microcode.h +3
-0@@ -9,6 +9,9 @@#ifndef __ASSEMBLY__ +/* This is a declaration for ucode_base in start.S */ +extern u32 ucode_base; +/** * microcode_update_intel() - Apply microcode updates * arch/x86/lib/fsp/fsp_car.S +0
-0
arch/x86/lib/fsp/fsp_car.S temp_ram_init_romstack: · line 106
Quoted 5 lines
arch/x86/lib/fsp/fsp_car.S +2
-0@@ -102,6 +102,8 @@ temp_ram_init_romstack: temp_ram_init_params: _dt_ucode_base_size: /* These next two fields are filled in by ifdtool */ +.globl ucode_base +ucode_base: /* Declared in micrcode.h */
typo: microcode.h
arch/x86/lib/fsp/fsp_car.S temp_ram_init_romstack:
Quoted 4 lines
arch/x86/lib/fsp/fsp_car.S +0
-1.long 0 /* microcode base */ .long 0 /* microcode size */ .long CONFIG_SYS_MONITOR_BASE /* code region base */ --
Regards,
Bin
PATCH 44/69 x86: link: Add pin configuration to the device tree
In reply to Simon GlassAt present pin configuration on link does not use the standard mechanism, but some rather ugly custom code. As a first step to resolving this, add the pin configuration to the device tree.
Four of the GPIOs must be available before relocation (for SDRAM pin strapping).
---
arch/x86/dts/chromebook_link.dts | 151 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+)
arch/x86/dts/chromebook_link.dts +151 -0
@@ -1,5 +1,7 @@ /dts-v1/; +#include <dt-bindings/gpio/x86-gpio.h> + /include/ "skeleton.dtsi" /include/ "keyboard.dtsi" /include/ "serial.dtsi"
@@ -62,6 +64,155 @@ intel,duplicate-por; }; + pch_pinctrl { + compatible = "intel,x86-pinctrl"; + u-boot,dm-pre-reloc; + reg = <0 0>; + + gpio_a0 { + gpio-offset = <0 0>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a1 { + gpio-offset = <0 >; + output-value = <1>; + }; + + gpio_a3 { + gpio-offset = <0 3>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a5 { + gpio-offset = <0 5>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a6 { + gpio-offset = <0 6>; + output-value = <1>; + }; + + gpio_a7 { + gpio-offset = <0 7>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a8 { + gpio-offset = <0 8>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a9 { + gpio-offset = <0 9>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a10 { + u-boot,dm-pre-reloc; + gpio-offset = <0 10>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a11 { + gpio-offset = <0 11>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a12 { + gpio-offset = <0 12>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a14 { + gpio-offset = <0 14>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a15 { + gpio-offset = <0 15>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a21 { + gpio-offset = <0 21>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a24 { + gpio-offset = <0 24>; + mode-gpio; + output-value = <0>; + direction = <PIN_OUTPUT>; + }; + + gpio_a28 { + gpio-offset = <0 28>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b4 { + gpio-offset = <0x30 4>; + mode-gpio; + direction = <PIN_OUTPUT>; + output-value = <1>; + }; + + gpio_b9 { + u-boot,dm-pre-reloc; + gpio-offset = <0x30 9>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b10 { + u-boot,dm-pre-reloc; + gpio-offset = <0x30 10>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b11 { + u-boot,dm-pre-reloc; + gpio-offset = <0x30 11>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b25 { + gpio-offset = <0x30 25>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b28 { + gpio-offset = <0x30 28>; + mode-gpio; + direction = <PIN_OUTPUT>; + output-value = <1>; + }; + + }; + pci { compatible = "pci-x86"; #address-cells = <3>;
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 44/69 x86: link: Add pin configuration to the device tree
Hi Simon,
Quoted 33 lines · Simon Glass
At present pin configuration on link does not use the standard mechanism, but some rather ugly custom code. As a first step to resolving this, add the pin configuration to the device tree.
Four of the GPIOs must be available before relocation (for SDRAM pin strapping).
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_link.dts | 151 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+)arch/x86/dts/chromebook_link.dts +6
-0@@ -1,5 +1,7 @@ /dts-v1/; +#include <dt-bindings/gpio/x86-gpio.h> + /include/ "skeleton.dtsi" /include/ "keyboard.dtsi" /include/ "serial.dtsi"@@ -62,6 +64,155 @@ intel,duplicate-por; }; + pch_pinctrl { + compatible = "intel,x86-pinctrl"; + u-boot,dm-pre-reloc; + reg = <0 0>;
arch/x86/dts/chromebook_link.dts line 80
Quoted 10 lines
arch/x86/dts/chromebook_link.dts +10
-0+ + gpio_a0 { + gpio-offset = <0 0>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a1 { + gpio-offset = <0 >; + output-value = <1>;
No "direction = <PIN_OUTPUT>"? and no "mode-gpio"?
Quoted 7 lines
arch/x86/dts/chromebook_link.dts +7
-0+ }; + + gpio_a3 { + gpio-offset = <0 3>; + mode-gpio; + direction = <PIN_INPUT>; + };
arch/x86/dts/chromebook_link.dts line 97
Quoted 10 lines
arch/x86/dts/chromebook_link.dts +10
-0+ + gpio_a5 { + gpio-offset = <0 5>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a6 { + gpio-offset = <0 6>; + output-value = <1>;
ditto.
Quoted 112 lines
arch/x86/dts/chromebook_link.dts +112
-0+ }; + + gpio_a7 { + gpio-offset = <0 7>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a8 { + gpio-offset = <0 8>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a9 { + gpio-offset = <0 9>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a10 { + u-boot,dm-pre-reloc; + gpio-offset = <0 10>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a11 { + gpio-offset = <0 11>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a12 { + gpio-offset = <0 12>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a14 { + gpio-offset = <0 14>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a15 { + gpio-offset = <0 15>; + mode-gpio; + direction = <PIN_INPUT>; + invert; + }; + + gpio_a21 { + gpio-offset = <0 21>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_a24 { + gpio-offset = <0 24>; + mode-gpio; + output-value = <0>; + direction = <PIN_OUTPUT>; + }; + + gpio_a28 { + gpio-offset = <0 28>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b4 { + gpio-offset = <0x30 4>; + mode-gpio; + direction = <PIN_OUTPUT>; + output-value = <1>; + }; + + gpio_b9 { + u-boot,dm-pre-reloc; + gpio-offset = <0x30 9>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b10 { + u-boot,dm-pre-reloc; + gpio-offset = <0x30 10>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b11 { + u-boot,dm-pre-reloc; + gpio-offset = <0x30 11>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b25 { + gpio-offset = <0x30 25>; + mode-gpio; + direction = <PIN_INPUT>; + }; + + gpio_b28 { + gpio-offset = <0x30 28>; + mode-gpio;
arch/x86/dts/chromebook_link.dts
Quoted 10 lines
arch/x86/dts/chromebook_link.dts +6
-1+ direction = <PIN_OUTPUT>; + output-value = <1>; + }; + + }; + pci { compatible = "pci-x86"; #address-cells = <3>; --
Regards,
Bin
PATCH 45/69 x86: Add an ICH6 pin configuration driver
In reply to Simon GlassAdd a driver which sets up the pin configuration on x86 devices with an ICH6 (or later) Platform Controller Hub.
The driver is not in the pinctrl uclass due to some oddities of the way x86 devices work:
- The GPIO controller is not present in I/O space until it is set up
- This is done by writing a register in the PCH
- The PCH has a driver which itself uses PCI, another driver
- The pinctrl uclass requires that a pinctrl device be available before any other device can be probed
It would be possible to work around the limitations by:
- Hard-coding the GPIO address rather than reading it from the PCH
- Using special x86 PCI access to set the GPIO address in the PCH
However it is not clear that this is better, since the pin configuration driver does not actually provide normal pin configuration services - it simply sets up all the pins statically when probed. While this remains the case, it seems better to use a syscon uclass instead. This can be probed whenever it is needed, without any limitations.
Also add an 'invert' property to support inverting the input.
---
arch/x86/include/asm/cpu.h | 1 + arch/x86/lib/Makefile | 1 + arch/x86/lib/pinctrl_ich6.c | 216 +++++++++++++++++++++ .../gpio/intel,x86-pinctrl.txt | 1 + 4 files changed, 219 insertions(+) create mode 100644 arch/x86/lib/pinctrl_ich6.c
arch/x86/include/asm/cpu.h +1 -0
@@ -54,6 +54,7 @@ enum {X86_NONE ,X86_SYSCON_ME ,/* Intel Management Engine */ X86_SYSCON_GMA ,/* Intel Graphics Media Accelerator */ + X86_SYSCON_PINCONF, /* Intel x86 pin configuration */ }; struct cpuid_result {
arch/x86/lib/Makefile +1 -0
@@ -22,6 +22,7 @@ obj-y += cmd_mtrr.o obj-y += northbridge-uclass.o obj-$(CONFIG_I8259_PIC) += i8259.o obj-$(CONFIG_I8254_TIMER) += i8254.o +obj-y += pinctrl_ich6.o obj-y += pirq_routing.o obj-y += relocate.o obj-y += physmem.o
arch/x86/lib/pinctrl_ich6.c new file +216 -0
216 lines not on this page · raw message
doc/device-tree-bindings/gpio/intel,x86-pinctrl.txt +1 -0
@@ -19,6 +19,7 @@ in case of 'mode-gpio' property set: - direction - (optional) this set the direction of the gpio. - pull-str - (optional) this set the pull strength of the pin. - pull-assign - (optional) this set the pull assignement (up/down) of the pin. +- invert - (optional) this input pin is inverted Example:
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 45/69 x86: Add an ICH6 pin configuration driver
Quoted 25 lines · Simon Glass
Add a driver which sets up the pin configuration on x86 devices with an ICH6 (or later) Platform Controller Hub.
The driver is not in the pinctrl uclass due to some oddities of the way x86 devices work:
- The GPIO controller is not present in I/O space until it is set up
- This is done by writing a register in the PCH
- The PCH has a driver which itself uses PCI, another driver
- The pinctrl uclass requires that a pinctrl device be available before any other device can be probedIt would be possible to work around the limitations by:
- Hard-coding the GPIO address rather than reading it from the PCH
- Using special x86 PCI access to set the GPIO address in the PCHHowever it is not clear that this is better, since the pin configuration driver does not actually provide normal pin configuration services - it simply sets up all the pins statically when probed. While this remains the case, it seems better to use a syscon uclass instead. This can be probed whenever it is needed, without any limitations.
Also add an 'invert' property to support inverting the input.
Signed-off-by Simon Glass <[email protected]>
Quoted 9 lines
---
arch/x86/include/asm/cpu.h | 1 + arch/x86/lib/Makefile | 1 + arch/x86/lib/pinctrl_ich6.c | 216 +++++++++++++++++++++ .../gpio/intel,x86-pinctrl.txt | 1 + 4 files changed, 219 insertions(+) create mode 100644 arch/x86/lib/pinctrl_ich6.c
PATCH 45/69 x86: Add an ICH6 pin configuration driver
Quoted 36 lines · Bin Meng
Quoted 25 lines · Simon Glass
Add a driver which sets up the pin configuration on x86 devices with an ICH6 (or later) Platform Controller Hub.
The driver is not in the pinctrl uclass due to some oddities of the way x86 devices work:
- The GPIO controller is not present in I/O space until it is set up
- This is done by writing a register in the PCH
- The PCH has a driver which itself uses PCI, another driver
- The pinctrl uclass requires that a pinctrl device be available before any other device can be probedIt would be possible to work around the limitations by:
- Hard-coding the GPIO address rather than reading it from the PCH
- Using special x86 PCI access to set the GPIO address in the PCHHowever it is not clear that this is better, since the pin configuration driver does not actually provide normal pin configuration services - it simply sets up all the pins statically when probed. While this remains the case, it seems better to use a syscon uclass instead. This can be probed whenever it is needed, without any limitations.
Also add an 'invert' property to support inverting the input.
Signed-off-by Simon Glass <[email protected]>Quoted 9 lines
---
arch/x86/include/asm/cpu.h | 1 + arch/x86/lib/Makefile | 1 + arch/x86/lib/pinctrl_ich6.c | 216 +++++++++++++++++++++ .../gpio/intel,x86-pinctrl.txt | 1 + 4 files changed, 219 insertions(+) create mode 100644 arch/x86/lib/pinctrl_ich6.c
Quoted 1 line
Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 45/69 x86: Add an ICH6 pin configuration driver
Quoted 37 lines · Bin Meng
Quoted 36 lines · Bin Meng
Quoted 34 lines · Simon Glass
Add a driver which sets up the pin configuration on x86 devices with an ICH6 (or later) Platform Controller Hub.
The driver is not in the pinctrl uclass due to some oddities of the way x86 devices work:
- The GPIO controller is not present in I/O space until it is set up
- This is done by writing a register in the PCH
- The PCH has a driver which itself uses PCI, another driver
- The pinctrl uclass requires that a pinctrl device be available before any other device can be probedIt would be possible to work around the limitations by:
- Hard-coding the GPIO address rather than reading it from the PCH
- Using special x86 PCI access to set the GPIO address in the PCHHowever it is not clear that this is better, since the pin configuration driver does not actually provide normal pin configuration services - it simply sets up all the pins statically when probed. While this remains the case, it seems better to use a syscon uclass instead. This can be probed whenever it is needed, without any limitations.
Also add an 'invert' property to support inverting the input.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/include/asm/cpu.h | 1 + arch/x86/lib/Makefile | 1 + arch/x86/lib/pinctrl_ich6.c | 216 +++++++++++++++++++++ .../gpio/intel,x86-pinctrl.txt | 1 + 4 files changed, 219 insertions(+) create mode 100644 arch/x86/lib/pinctrl_ich6.c
Quoted 3 lines
Quoted 1 line
Reviewed-by Bin Meng <[email protected]>applied to u-boot-x86/next, thanks!
Sorry this patch has dependencies to previous setio_le32 patch, thus removed from u-boot-x86/next branch.
Regards,
Bin
PATCH 46/69 x86: gpio: Allow the pinctrl driver to set up the pin config
In reply to Simon GlassRather than setting up the pin configuration in the GPIO driver, use the new pinctrl driver to do it.
---
configs/bayleybay_defconfig | 2 + configs/cougarcanyon2_defconfig | 2 + configs/crownbay_defconfig | 2 + configs/galileo_defconfig | 2 + configs/minnowmax_defconfig | 6 +- drivers/gpio/intel_ich6_gpio.c | 180 ++-------------------------------------- 6 files changed, 17 insertions(+), 177 deletions(-)
configs/bayleybay_defconfig +2 -0
@@ -19,6 +19,8 @@ CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_CMD_BOOTSTAGE=y CONFIG_OF_CONTROL=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y CONFIG_CPU=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_GIGADEVICE=y
configs/cougarcanyon2_defconfig +2 -0
@@ -8,6 +8,8 @@ CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_NFS is not set CONFIG_OF_CONTROL=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_WINBOND=y CONFIG_DM_PCI=y
configs/crownbay_defconfig +2 -0
@@ -17,6 +17,8 @@ CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_CMD_BOOTSTAGE=y CONFIG_OF_CONTROL=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y CONFIG_CPU=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_GIGADEVICE=y
configs/galileo_defconfig +2 -0
@@ -13,6 +13,8 @@ CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_CMD_BOOTSTAGE=y CONFIG_OF_CONTROL=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_GIGADEVICE=y
configs/minnowmax_defconfig +4 -2
@@ -8,16 +8,18 @@ CONFIG_SMP=y CONFIG_HAVE_VGA_BIOS=y CONFIG_GENERATE_PIRQ_TABLE=y CONFIG_GENERATE_MP_TABLE=y +CONFIG_BOOTSTAGE=y +CONFIG_BOOTSTAGE_REPORT=y CONFIG_CMD_CPU=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_NFS is not set -CONFIG_BOOTSTAGE=y -CONFIG_BOOTSTAGE_REPORT=y CONFIG_CMD_BOOTSTAGE=y CONFIG_OF_CONTROL=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y CONFIG_CPU=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_GIGADEVICE=y
drivers/gpio/intel_ich6_gpio.c +5 -175
213 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 46/69 x86: gpio: Allow the pinctrl driver to set up the pin config
Quoted 6 lines · Simon Glass
Rather than setting up the pin configuration in the GPIO driver, use the new pinctrl driver to do it.
Signed-off-by Simon Glass <[email protected]>---
Quoted 8 lines
configs/bayleybay_defconfig | 2 + configs/cougarcanyon2_defconfig | 2 + configs/crownbay_defconfig | 2 + configs/galileo_defconfig | 2 + configs/minnowmax_defconfig | 6 +- drivers/gpio/intel_ich6_gpio.c | 180 ++-------------------------------------- 6 files changed, 17 insertions(+), 177 deletions(-)
PATCH 47/69 x86: Drop all the old pin configuration code
In reply to Simon GlassWe don't need this anymore - we can use device tree and the new pinconfig driver instead.
---
arch/x86/include/asm/gpio.h | 141 ------------------------------ board/coreboot/coreboot/coreboot.c | 5 -- board/efi/efi-x86/efi.c | 5 -- board/google/chromebook_link/link.c | 138 ----------------------------- board/google/chromebox_panther/panther.c | 4 - board/intel/bayleybay/bayleybay.c | 5 -- board/intel/cougarcanyon2/cougarcanyon2.c | 5 -- board/intel/crownbay/crownbay.c | 5 -- board/intel/galileo/galileo.c | 5 -- board/intel/minnowmax/minnowmax.c | 8 -- drivers/gpio/intel_ich6_gpio.c | 11 --- include/fdtdec.h | 1 - lib/fdtdec.c | 1 - 13 files changed, 334 deletions(-)
arch/x86/include/asm/gpio.h +0 -141
@@ -6,7 +6,6 @@#ifndef _X86_GPIO_H_#define _X86_GPIO_H_ -#include <linux/compiler.h> #include <asm-generic/gpio.h> struct ich6_bank_platdata {
@@ -15,144 +14,4 @@ struct ich6_bank_platdata { int offset; }; -#define GPIO_MODE_NATIVE 0 -#define GPIO_MODE_GPIO 1 -#define GPIO_MODE_NONE 1 - -#define GPIO_DIR_OUTPUT 0 -#define GPIO_DIR_INPUT 1 - -#define GPIO_NO_INVERT 0 -#define GPIO_INVERT 1 - -#define GPIO_LEVEL_LOW 0 -#define GPIO_LEVEL_HIGH 1 - -#define GPIO_NO_BLINK 0 -#define GPIO_BLINK 1 - -#define GPIO_RESET_PWROK 0 -#define GPIO_RESET_RSMRST 1 - -struct pch_gpio_set1 { -u32 gpio0:1 ; -u32 gpio1:1 ; -u32 gpio2:1 ; -u32 gpio3:1 ; -u32 gpio4:1 ; -u32 gpio5:1 ; -u32 gpio6:1 ; -u32 gpio7:1 ; -u32 gpio8:1 ; -u32 gpio9:1 ; -u32 gpio10:1 ; -u32 gpio11:1 ; -u32 gpio12:1 ; -u32 gpio13:1 ; -u32 gpio14:1 ; -u32 gpio15:1 ; -u32 gpio16:1 ; -u32 gpio17:1 ; -u32 gpio18:1 ; -u32 gpio19:1 ; -u32 gpio20:1 ; -u32 gpio21:1 ; -u32 gpio22:1 ; -u32 gpio23:1 ; -u32 gpio24:1 ; -u32 gpio25:1 ; -u32 gpio26:1 ; -u32 gpio27:1 ; -u32 gpio28:1 ; -u32 gpio29:1 ; -u32 gpio30:1 ; -u32 gpio31:1 ; -} __packed; - -struct pch_gpio_set2 { -u32 gpio32:1 ; -u32 gpio33:1 ; -u32 gpio34:1 ; -u32 gpio35:1 ; -u32 gpio36:1 ; -u32 gpio37:1 ; -u32 gpio38:1 ; -u32 gpio39:1 ; -u32 gpio40:1 ; -u32 gpio41:1 ; -u32 gpio42:1 ; -u32 gpio43:1 ; -u32 gpio44:1 ; -u32 gpio45:1 ; -u32 gpio46:1 ; -u32 gpio47:1 ; -u32 gpio48:1 ; -u32 gpio49:1 ; -u32 gpio50:1 ; -u32 gpio51:1 ; -u32 gpio52:1 ; -u32 gpio53:1 ; -u32 gpio54:1 ; -u32 gpio55:1 ; -u32 gpio56:1 ; -u32 gpio57:1 ; -u32 gpio58:1 ; -u32 gpio59:1 ; -u32 gpio60:1 ; -u32 gpio61:1 ; -u32 gpio62:1 ; -u32 gpio63:1 ; -} __packed; - -struct pch_gpio_set3 { -u32 gpio64:1 ; -u32 gpio65:1 ; -u32 gpio66:1 ; -u32 gpio67:1 ; -u32 gpio68:1 ; -u32 gpio69:1 ; -u32 gpio70:1 ; -u32 gpio71:1 ; -u32 gpio72:1 ; -u32 gpio73:1 ; -u32 gpio74:1 ; -u32 gpio75:1 ; -} __packed; - -/* -* This hilariously complex structure came from Coreboot. The -* setup_pch_gpios() function uses it. It could be move to device tree, or -* adjust to use masks instead of bitfields. -*/ -struct pch_gpio_map { -struct { -const struct pch_gpio_set1 *mode; -const struct pch_gpio_set1 *direction; -const struct pch_gpio_set1 *level; -const struct pch_gpio_set1 *reset; -const struct pch_gpio_set1 *invert; -const struct pch_gpio_set1 *blink; - } set1; -struct { -const struct pch_gpio_set2 *mode; -const struct pch_gpio_set2 *direction; -const struct pch_gpio_set2 *level; -const struct pch_gpio_set2 *reset; - } set2; -struct { -const struct pch_gpio_set3 *mode; -const struct pch_gpio_set3 *direction; -const struct pch_gpio_set3 *level; -const struct pch_gpio_set3 *reset; - } set3; -}; - -/* -* Deprecated functions to set up the GPIO map. The device tree should be used -* instead. -*/ -int gpio_ich6_pinctrl_init (void ); -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio); -void ich_gpio_set_gpio_map (const struct pch_gpio_map *map); -#endif /* _X86_GPIO_H_ */
board/coreboot/coreboot/coreboot.c +0 -5
@@ -12,8 +12,3 @@ int arch_early_init_r(void) {return 0 ; } - -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio) -{ -return ; -}
board/efi/efi-x86/efi.c +0 -5
@@ -11,8 +11,3 @@ int arch_early_init_r(void) {return 0 ; } - -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio) -{ -return ; -}
board/google/chromebook_link/link.c +0 -138
145 lines not on this page · raw message
board/google/chromebox_panther/panther.c +0 -4
@@ -16,7 +16,3 @@ int board_early_init_f(void) {return 0 ; } - -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio) -{ -}
board/intel/bayleybay/bayleybay.c +0 -5
@@ -6,8 +6,3 @@#include <common.h> #include <asm/gpio.h> - -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio) -{ -return ; -}
board/intel/cougarcanyon2/cougarcanyon2.c +0 -5
@@ -52,8 +52,3 @@ int board_early_init_f(void)return 0 ; } - -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio) -{ -return ; -}
board/intel/crownbay/crownbay.c +0 -5
@@ -18,8 +18,3 @@ int board_early_init_f(void)return 0 ; } - -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio) -{ -return ; -}
board/intel/galileo/galileo.c +0 -5
@@ -65,8 +65,3 @@ void board_deassert_perst(void) val |= (1 <<0 );outl (val, port); } - -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio) -{ -return ; -}
board/intel/minnowmax/minnowmax.c +0 -8
@@ -9,13 +9,5 @@int arch_early_init_r (void ) { -/* do the pin-muxing */ -gpio_ich6_pinctrl_init (); -return 0 ; } - -void setup_pch_gpios (u16 gpiobase,const struct pch_gpio_map *gpio) -{ -return ; -}
drivers/gpio/intel_ich6_gpio.c +0 -11
@@ -53,12 +53,6 @@ struct ich6_bank_priv {#define GPIO_IOSEL_OFFSET (x) (x + 4)#define GPIO_LVL_OFFSET (x) (x + 8) -/* TODO: Move this to device tree, or platform data */ -void ich_gpio_set_gpio_map (const struct pch_gpio_map *map) -{ - gd->arch.gpio_map = map; -} -static int _ich6_gpio_set_value (uint16_t base,unsigned offset,int value) {u32 val;
@@ -90,11 +84,6 @@ static int _ich6_gpio_set_direction(uint16_t base, unsigned offset, int dir)return 0 ; } -int gpio_ich6_pinctrl_init (void ) -{ -return 0 ; -} -static int gpio_ich6_ofdata_to_platdata (struct udevice *dev) {struct ich6_bank_platdata *plat =dev_get_platdata (dev);
include/fdtdec.h +0 -1
@@ -158,7 +158,6 @@ enum fdt_compat_id {COMPAT_AMS_AS3722 ,/* AMS AS3722 PMIC */ COMPAT_INTEL_ICH_SPI ,/* Intel ICH7/9 SPI controller */ COMPAT_INTEL_QRK_MRC ,/* Intel Quark MRC */ -COMPAT_INTEL_X86_PINCTRL ,/* Intel ICH7/9 pin control */ COMPAT_SOCIONEXT_XHCI ,/* Socionext UniPhier xHCI */ COMPAT_INTEL_PCH ,/* Intel PCH */ COMPAT_ALTERA_SOCFPGA_DWMAC, /* SoCFPGA Ethernet controller */
lib/fdtdec.c +0 -1
@@ -63,7 +63,6 @@ static const char * const compat_names[COMPAT_COUNT] = {COMPAT (AMS_AS3722 ,"ams,as3722" ),COMPAT (INTEL_ICH_SPI ,"intel,ich-spi" ),COMPAT (INTEL_QRK_MRC ,"intel,quark-mrc" ), -COMPAT (INTEL_X86_PINCTRL ,"intel,x86-pinctrl" ),COMPAT (SOCIONEXT_XHCI ,"socionext,uniphier-xhci" ),COMPAT (COMPAT_INTEL_PCH ,"intel,bd82x6x" ), COMPAT(ALTERA_SOCFPGA_DWMAC, "altr,socfpga-stmmac"),
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 47/69 x86: Drop all the old pin configuration code
Quoted 6 lines · Simon Glass
We don't need this anymore - we can use device tree and the new pinconfig driver instead.
Signed-off-by Simon Glass <[email protected]>---
Quoted 15 lines
arch/x86/include/asm/gpio.h | 141 ------------------------------ board/coreboot/coreboot/coreboot.c | 5 -- board/efi/efi-x86/efi.c | 5 -- board/google/chromebook_link/link.c | 138 ----------------------------- board/google/chromebox_panther/panther.c | 4 - board/intel/bayleybay/bayleybay.c | 5 -- board/intel/cougarcanyon2/cougarcanyon2.c | 5 -- board/intel/crownbay/crownbay.c | 5 -- board/intel/galileo/galileo.c | 5 -- board/intel/minnowmax/minnowmax.c | 8 -- drivers/gpio/intel_ich6_gpio.c | 11 --- include/fdtdec.h | 1 - lib/fdtdec.c | 1 - 13 files changed, 334 deletions(-)
PATCH 48/69 x86: Add support for running Intel reference code
In reply to Simon GlassIntel has invented yet another binary blob which firmware is required to run. This is run after SDRAM is ready. It is linked to load at a particular address, typically 0, but is a relocatable ELF so can be moved if required.
Add support for this in the build system. The file should be placed in the board directory, and called refcode.elf.
---
Makefile | 14 +++++++++++++- arch/x86/Kconfig | 11 +++++++++++ arch/x86/include/asm/cpu.h | 12 ++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-)
Makefile +13 -1
@@ -1044,6 +1044,10 @@ ifneq ($(CONFIG_HAVE_VGA_BIOS),) IFDTOOL_FLAGS += -w $(CONFIG_VGA_BIOS_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_VGA_BIOS_FILE) endif +ifneq ($(CONFIG_HAVE_REFCODE),) +IFDTOOL_FLAGS += -w $(CONFIG_X86_REFCODE_ADDR):refcode.bin +endif + quiet_cmd_ifdtool = IFDTOOL $@ cmd_ifdtool = $(IFDTOOL) -c -r $(CONFIG_ROM_SIZE) u-boot.tmp; ifneq ($(CONFIG_HAVE_INTEL_ME),)
@@ -1052,7 +1056,15 @@ endif cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp; cmd_ifdtool += mv u-boot.tmp $@ -u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE +refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE + $(call if_changed,copy) + +quiet_cmd_ldr = LD $@ +cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ + $(filter-out FORCE,$^) -o $@ + +u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE \ + $(if $(CONFIG_HAVE_REFCODE),refcode.bin) $(call if_changed,ifdtool) OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
arch/x86/Kconfig +11 -0
@@ -305,6 +305,17 @@ config DCACHE_RAM_MRC_VAR_SIZE memory reference code and must be set correctly or the board will not boot. +config HAVE_REFCODE + bool "Add a Reference Code binary" + help + Select this option to add a Reference Code binary to the resulting + U-Boot image. This is an Intel binary blob that handles system + initialisation, in this case the PCH and System Agent. + + Note: Without this binary (on platforms that need it such as + broadwell) U-Boot will be missing some critical setup steps. + Various peripherals may fail to work. + config SMP bool "Enable Symmetric Multiprocessing" default n
arch/x86/include/asm/cpu.h +12 -0
@@ -275,4 +275,16 @@ u32 cpu_get_family_model(void);*/ u32 cpu_get_stepping (void ); +/** +* cpu_run_reference_code() - Run the platform reference code +* +* Some platforms require a binary blob to be executed once SDRAM is +* available. This is used to set up various platform features, such as the +* platform controller hub (PCB). This function should be implemented by the +* CPU-specific code. +* +* @return 0 on success, -ve on failure +*/ +int cpu_run_reference_code (void ); +#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 48/69 x86: Add support for running Intel reference code
Hi Simon,
Quoted 4 lines · Simon Glass
Intel has invented yet another binary blob which firmware is required to run. This is run after SDRAM is ready. It is linked to load at a particular address, typically 0, but is a relocatable ELF so can be moved if required.
This is really bad!
Quoted 2 lines
Add support for this in the build system. The file should be placed in the board directory, and called refcode.elf.
Is there any public documentation that explains this binary blob? Is this blob supposed to hide any top-secret of their chipset?! Why not just a single FSP binary? I fail to understand Intel's firmware strategy given they seem to actively promote FSP.
Quoted 68 lines
Signed-off-by Simon Glass <[email protected]>---
Makefile | 14 +++++++++++++- arch/x86/Kconfig | 11 +++++++++++ arch/x86/include/asm/cpu.h | 12 ++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-)Makefile +13
-1@@ -1044,6 +1044,10 @@ ifneq ($(CONFIG_HAVE_VGA_BIOS),) IFDTOOL_FLAGS += -w $(CONFIG_VGA_BIOS_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_VGA_BIOS_FILE) endif +ifneq ($(CONFIG_HAVE_REFCODE),) +IFDTOOL_FLAGS += -w $(CONFIG_X86_REFCODE_ADDR):refcode.bin +endif + quiet_cmd_ifdtool = IFDTOOL $@ cmd_ifdtool = $(IFDTOOL) -c -r $(CONFIG_ROM_SIZE) u-boot.tmp; ifneq ($(CONFIG_HAVE_INTEL_ME),)@@ -1052,7 +1056,15 @@ endif cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp; cmd_ifdtool += mv u-boot.tmp $@ -u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE +refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE + $(call if_changed,copy) + +quiet_cmd_ldr = LD $@ +cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ + $(filter-out FORCE,$^) -o $@ + +u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE \ + $(if $(CONFIG_HAVE_REFCODE),refcode.bin) $(call if_changed,ifdtool) OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvecarch/x86/Kconfig +11
-0@@ -305,6 +305,17 @@ config DCACHE_RAM_MRC_VAR_SIZE memory reference code and must be set correctly or the board will not boot. +config HAVE_REFCODE + bool "Add a Reference Code binary" + help + Select this option to add a Reference Code binary to the resulting + U-Boot image. This is an Intel binary blob that handles system + initialisation, in this case the PCH and System Agent. + + Note: Without this binary (on platforms that need it such as + broadwell) U-Boot will be missing some critical setup steps. + Various peripherals may fail to work. + config SMP bool "Enable Symmetric Multiprocessing" default narch/x86/include/asm/cpu.h +0
-0
arch/x86/include/asm/cpu.h u32 cpu_get_family_model(void); · line 283
Quoted 9 lines
arch/x86/include/asm/cpu.h +6
-0@@ -275,4 +275,16 @@ u32 cpu_get_family_model(void);*/ u32 cpu_get_stepping (void ); +/** +* cpu_run_reference_code() - Run the platform reference code +* +* Some platforms require a binary blob to be executed once SDRAM is +* available. This is used to set up various platform features, such as the +* platform controller hub (PCB). This function should be implemented by the
typo: PCH
arch/x86/include/asm/cpu.h u32 cpu_get_family_model(void);
Quoted 8 lines
arch/x86/include/asm/cpu.h +6
-1+* CPU-specific code. +* +* @return 0 on success, -ve on failure +*/ +int cpu_run_reference_code (void ); +#endif --
Regards,
Bin
PATCH 48/69 x86: Add support for running Intel reference code
Hi Bin,
Quoted 10 lines · Bin Meng
Hi Simon,
Quoted 4 lines · Simon Glass
Intel has invented yet another binary blob which firmware is required to run. This is run after SDRAM is ready. It is linked to load at a particular address, typically 0, but is a relocatable ELF so can be moved if required.
This is really bad!
Quoted 7 lines
Quoted 2 lines
Add support for this in the build system. The file should be placed in the board directory, and called refcode.elf.
Is there any public documentation that explains this binary blob? Is this blob supposed to hide any top-secret of their chipset?! Why not just a single FSP binary? I fail to understand Intel's firmware strategy given they seem to actively promote FSP.
Not that i know of. Samus doesn't use FSP, although I suspect it might be possible. I'm really not sure which is worse.
I don't know if the chipset has top-secret stuff. It might just be that they don't want to release the source code, or spend lots of time writing documentation. I really don't know.
[snip]
Regards,
Simon
PATCH 49/69 x86: dts: Update the pinctrl binding a little
In reply to Simon GlassMake a few minor updates to make the meaning clearer.
---
doc/device-tree-bindings/gpio/intel,x86-pinctrl.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
doc/device-tree-bindings/gpio/intel,x86-pinctrl.txt +11 -10
@@ -8,17 +8,18 @@ The PINCTRL master node requires the following properties: Pin nodes must be children of the pinctrl master node and can contain the following properties: -- pad-offset - (required) offset in the IOBASE for the pin to configured. -- gpio-offset - (required) offset in the GPIOBASE for the pin to configured and - also the bit shift in this register. -- mode-gpio - (optional) standalone property to force the pin into GPIO mode. -- mode-func - (optional) function number to assign to the pin. if 'mode-gpio' - is set, this property will be ignored. +- pad-offset - (required) offset in the IOBASE for the pin to configure +- gpio-offset - (required) 2 cells + - offset in the GPIOBASE for the pin to configure + - the bit shift in this register (4 = bit 4) +- mode-gpio - (optional) standalone property to force the pin into GPIO mode +- mode-func - (optional) function number to assign to the pin. If + 'mode-gpio' is set, this property will be ignored. in case of 'mode-gpio' property set: -- output-value - (optional) this set the default output value of the GPIO. -- direction - (optional) this set the direction of the gpio. -- pull-str - (optional) this set the pull strength of the pin. -- pull-assign - (optional) this set the pull assignement (up/down) of the pin. +- output-value - (optional) this set the default output value of the GPIO +- direction - (optional) this set the direction of the gpio +- pull-str - (optional) this set the pull strength of the pin +- pull-assign - (optional) this set the pull assignement (up/down) of the pin - invert - (optional) this input pin is inverted Example:
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 49/69 x86: dts: Update the pinctrl binding a little
Quoted 8 lines · Simon Glass
Make a few minor updates to make the meaning clearer.
Signed-off-by Simon Glass <[email protected]>---
doc/device-tree-bindings/gpio/intel,x86-pinctrl.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
PATCH 50/69 x86: Add basic support for broadwell
In reply to Simon GlassThis adds the broadwell architecture, with the CPU driver and some useful header files.
---
arch/x86/Kconfig | 1 + arch/x86/cpu/Makefile | 1 + arch/x86/cpu/broadwell/Kconfig | 30 ++ arch/x86/cpu/broadwell/Makefile | 7 + arch/x86/cpu/broadwell/cpu.c | 761 ++++++++++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/cpu.h | 48 ++ arch/x86/include/asm/arch-broadwell/iomap.h | 53 ++ arch/x86/include/asm/arch-broadwell/me.h | 200 ++++++++ arch/x86/include/asm/arch-broadwell/rcb.h | 58 +++ arch/x86/include/asm/arch-broadwell/spi.h | 87 ++++ 10 files changed, 1246 insertions(+) create mode 100644 arch/x86/cpu/broadwell/Kconfig create mode 100644 arch/x86/cpu/broadwell/Makefile create mode 100644 arch/x86/cpu/broadwell/cpu.c create mode 100644 arch/x86/include/asm/arch-broadwell/cpu.h create mode 100644 arch/x86/include/asm/arch-broadwell/iomap.h create mode 100644 arch/x86/include/asm/arch-broadwell/me.h create mode 100644 arch/x86/include/asm/arch-broadwell/rcb.h create mode 100644 arch/x86/include/asm/arch-broadwell/spi.h
arch/x86/Kconfig +1 -0
@@ -34,6 +34,7 @@ source "board/intel/Kconfig" # platform-specific options below source "arch/x86/cpu/baytrail/Kconfig" +source "arch/x86/cpu/broadwell/Kconfig" source "arch/x86/cpu/coreboot/Kconfig" source "arch/x86/cpu/ivybridge/Kconfig" source "arch/x86/cpu/qemu/Kconfig"
arch/x86/cpu/Makefile +1 -0
@@ -20,6 +20,7 @@ extra-y += call32.o obj-y += intel_common/ obj-$(CONFIG_INTEL_BAYTRAIL) += baytrail/ +obj-$(CONFIG_INTEL_BROADWELL) += broadwell/ obj-$(CONFIG_SYS_COREBOOT) += coreboot/ obj-$(CONFIG_EFI_APP) += efi/ obj-$(CONFIG_QEMU) += qemu/
arch/x86/cpu/broadwell/Kconfig new file +30 -0
@@ -0,0 +1,30 @@ +# +# Copyright (C) 2016 Google Inc. +# +# SPDX-License-Identifier: GPL-2.0 + +config INTEL_BROADWELL + bool + select CACHE_MRC_BIN + +if INTEL_BROADWELL + +config DCACHE_RAM_BASE + default 0xff7c0000 + +config DCACHE_RAM_SIZE + default 0x40000 + +config DCACHE_RAM_MRC_VAR_SIZE + default 0x30000 + +config CPU_SPECIFIC_OPTIONS + def_bool y + select SMM_TSEG + select X86_RAMTEST + +config SMM_TSEG_SIZE + hex + default 0x800000 + +endif
arch/x86/cpu/broadwell/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (c) 2016 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += cpu.o
arch/x86/cpu/broadwell/cpu.c new file +761 -0
761 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/cpu.h new file +48 -0
48 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/iomap.h new file +53 -0
53 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/me.h new file +200 -0
200 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/rcb.h new file +58 -0
58 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/spi.h new file +87 -0
87 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 50/69 x86: Add basic support for broadwell
Hi Simon,
Quoted 17 lines · Simon Glass
This adds the broadwell architecture, with the CPU driver and some useful header files.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/Kconfig | 1 + arch/x86/cpu/Makefile | 1 + arch/x86/cpu/broadwell/Kconfig | 30 ++ arch/x86/cpu/broadwell/Makefile | 7 + arch/x86/cpu/broadwell/cpu.c | 761 ++++++++++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/cpu.h | 48 ++ arch/x86/include/asm/arch-broadwell/iomap.h | 53 ++ arch/x86/include/asm/arch-broadwell/me.h | 200 ++++++++ arch/x86/include/asm/arch-broadwell/rcb.h | 58 +++ arch/x86/include/asm/arch-broadwell/spi.h | 87 ++++ 10 files changed, 1246 insertions(+)
Quoted 9 lines
create mode 100644 arch/x86/cpu/broadwell/Kconfig create mode 100644 arch/x86/cpu/broadwell/Makefile create mode 100644 arch/x86/cpu/broadwell/cpu.c create mode 100644 arch/x86/include/asm/arch-broadwell/cpu.h create mode 100644 arch/x86/include/asm/arch-broadwell/iomap.h create mode 100644 arch/x86/include/asm/arch-broadwell/me.h create mode 100644 arch/x86/include/asm/arch-broadwell/rcb.h create mode 100644 arch/x86/include/asm/arch-broadwell/spi.h
Except for several nits about "GPL-2.0+", generally they look good. So
Regards,
Bin
PATCH 51/69 x86: broadwell: Add a few microcode files
In reply to Simon GlassAdd two microcode files for broadwell.
---
arch/x86/dts/microcode/m7240651_0000001c.dtsi | 1328 +++++++++++++++++++++++++ arch/x86/dts/microcode/mc0306d4_00000018.dtsi | 944 ++++++++++++++++++ 2 files changed, 2272 insertions(+) create mode 100644 arch/x86/dts/microcode/m7240651_0000001c.dtsi create mode 100644 arch/x86/dts/microcode/mc0306d4_00000018.dtsi
arch/x86/dts/microcode/m7240651_0000001c.dtsi new file +1328 -0
@@ -0,0 +1,1328 @@ +/* + * Copyright (c) <1995-2015>, Intel Corporation. + * All rights reserved. + * Redistribution. Redistribution and use in binary form, without modification, are + * permitted provided that the following conditions are met: + * .Redistributions must reproduce the above copyright notice and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * .Neither the name of Intel Corporation nor the names of its suppliers may be used + * to endorse or promote products derived from this software without specific prior + * written permission. + * .No reverse engineering, decompilation, or disassembly of this software is + * permitted. + * ."Binary form" includes any format commonly used for electronic conveyance + * which is a reversible, bit-exact translation of binary representation to ASCII or + * ISO text, for example, "uuencode." + * DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT + * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * --- + * This is a device tree fragment. Use #include to add these properties to a + * node. + * + * Date: Wed Jan 7 17:15:10 CST 2015 + */ + +compatible = "intel,microcode"; +intel,header-version = <1>; +intel,update-revision = <0x1c>; +intel,date-code = <0x7032014>; +intel,processor-signature = <0x40651>; +intel,checksum = <0x4f9aa4c4>; +intel,loader-revision = <1>; +intel,processor-flags = <0x72>; + +/* The first 48-bytes are the public header which repeats the above data */ +data = < + 0x01000000 0x1c000000 0x14200307 0x51060400 + 0xc4a49a4f 0x01000000 0x72000000 0xd04f0000 + 0x00500000 0x00000000 0x00000000 0x00000000 + 0x00000000 0xa1000000 0x01000200 0x1c000000 + 0x02000000 0x31130000 0x02071420 0x31130000 + 0x01000000 0x51060400 0x00000000 0x00000000 + 0x00000000 0x00000000 0x00000000 0x00000000 + 0x00000000 0x00000000 0x00000000 0x00000000 + 0x00000000 0x00000000 0x00000000 0x00000000 + 0x36358054 0x2a09425b 0x907d339f 0xe56a8e53 + 0x877c79ee 0xe74bb340 0x4ada5820 0x1f5b6602 + 0xa30893a1 0xb7c4195b 0x5b421b4a 0xf6746a7d + 0x93416281 0x0596553a 0x0b287554 0x589d31e7 + 0xa74c6248 0x30f07a50 0x6ad9323b 0x68401630 + 0xf5d28452 0x15295b72 0x80923cf6 0x42c1b744 + 0xb3a77ce6 0xe763f1d6 0x3c1ff5cd 0xa180d141 + 0xb13139cc 0xa944a5f7 0x7df76b7f 0x5fa445fc + 0x365898f0 0x2e7e2d65 0xf3b12403 0x8c54b924 + 0xa5e7ca7b 0x79bfdedc 0x22590127 0x06c6830c + 0xb7ee2c3d 0xc8eec561 0xc699686b 0x3105503e + 0x44fa8bf0 0xf4a804b3 0x13f7e8ce 0x86c71229 + 0x4cc3e6fa 0x602929a5 0x89e3637d 0x017a25aa + 0x5450b21f 0x76c63f96 0xd39fcb5b 0xa469f358 + 0xb2bee3f6 0xb05e8ba5 0xa4ebc733 0x668bfe37 + 0x03447100 0x4e0cfdf0 0x962912aa 0x84b1559a + 0x07152000 0x3a6efbc9 0xc860ab11 0x846eff80 + 0xddab7ac3 0x7531c20f 0x348cb1b0 0x6c80ecf1 + 0x11000000 0x8e6aec93 0x0e9ee5e7 0x63a85483 + 0x70cc3265 0x6e1f946b 0x15b0efe6 0x72063a81 + 0x34a1d64b 0x2eaed2e7 0x17fd01b8 0xb10d73c6 + 0xc670afff 0x563a9699 0x48242b55 0x4f24da06 + 0x9470dbbd 0x43bd1bc4 0xdabd6685 0x2bb03087 + 0x3618fc0f 0xf583f057 0xf9b47ebc 0x900c7293 + 0x82e048b9 0xc2296a64 0xa65c78ab 0x29ded622 + 0xee3266ad 0x05c481f7 0x9f188cab 0x8848f8e9 + 0xdd1ec9df 0x9e22427c 0x2e0b3f71 0x6288ecbf + 0x761404d7 0xdfc9cd30 0x9747886a 0x5015f54d + 0x9ad0e3e6 0xf3af632b 0x9a7a43be 0x7e6abc2b + 0xac4ccd36 0x835d3a4c 0xa15be322 0x9dcf0226 + 0x166b5090 0xae4d5ead 0x6ce702fd 0xf1faec41 + 0x6a658558 0x4729daf1 0xea026e9a 0x63b58a33 + 0x3e7ade73 0x04101380 0xc56229d8 0xef888c8e + 0xfad2e07a 0x2ac82034 0x5c792e20 0x04940d3a + 0x0879333d 0x6df5c8c1 0x9a5f9d1a 0x4d4c298d + 0xf0a44f05 0xba3ceb1f 0x1ff4ca1f 0xfa8dce36 + 0x44567615 0x8dc04157 0x16e758d2 0x761fd567 + 0xf6fc6ee1 0xe97a8753 0x3f053256 0x6935fc3e + 0x382e2021 0xef7d3659 0x1bc3e873 0x94b35855 + 0x26fe0138 0xadf191a2 0x1c5753b8 0x5b84d843 + 0xde9e9a91 0x904daf5e 0xb6b66c98 0x0b632a82 + 0x9ee70409 0xb6ca0da2 0x250b4705 0x6911dc62 + 0x15cee70d 0x8afdcad4 0xfab41622 0xdf58a63b + 0x79b84df8 0xc05e3694 0x6b6cd7ff 0xd00350cf + 0xddd6b82a 0x0ce97cb8 0xc441b377 0xd1d2bde9 + 0xca3c3405 0x13780a0d 0x22da23cc 0xc9f3aebb + 0xd035bb82 0x277ed9c8 0xf0072c06 0x4367fc31 + 0x6eb8d7a5 0x4a9a39fb 0x98a20cea 0x0c6fc545 + 0xe034e39d 0x2287802b 0xee0fb9dc 0x39048886 + 0x0f52b54b 0x3fcd8c2f 0xf55411b3 0xc137b076 + 0x0d72cfc8 0x5e12539e 0xd6b15a49 0x8f0909dc + 0xe569ff90 0xfa2eb54f 0x04be7de0 0x0ece5d50 + 0x8e353099 0x953a24c7 0xb376aeac 0xed2c7023 + 0xa82bba36 0xd6a4f612 0xdfa59162 0x5197e043 + 0x06866ed8 0x73d1b8e5 0x387fcf84 0x2d732a5a + 0x57ec8dea 0xbdb45a07 0x05ea9330 0x2346dc7d + 0x7dc0ea9e 0x5e6cae0b 0x5fd87011 0xe55c5854 + 0x30594b42 0xd02e966f 0x70c19162 0x3b249ada + 0x60a41a7a 0x6b42fe07 0xefbc0f3e 0x2e5ef6e6 + 0x9866a716 0x74c9e22e 0x42d02dd4 0xc2d4b260 + 0xe90dca84 0x8214321b 0xe74708d8 0xc99fcf97 + 0x624eadab 0x34755e4c 0x3d4a47ba 0xe16f384b + 0x4abdd3b1 0x48e7f266 0x297d99ff 0xcb5e9a7f + 0x9746b708 0xe351ffd5 0x080fe8f0 0x50378abc + 0x50b1c296 0x82dd3d99 0x1aadfcb1 0xed57c439 + 0xa987788e 0xc2851395 0x7725195e 0xe64bce5e + 0xce0caad8 0xddb09dda 0x0556a6f0 0xfb33e1cb + 0x7c182dd6 0x215cd643 0x2b51ffd9 0x0f671e2c + 0x112f8694 0x6f87d52a 0x79f44703 0x9a9d7c83 + 0xb5cf88d5 0xbebc8431 0x9d20294d 0xfa3115b1 + 0x5f6060cf 0x2ec28285 0x84ec0af8 0x92097756 + 0x0e2708b0 0x47021fe6 0x82ca965b 0xd7a6f6dd + 0x9f30fda8 0xf0eb375a 0x2259c589 0x43e9d3a1 + 0x577f43c7 0xb9c36787 0x09e4ac2a 0x65eaffd3 + 0x82336701 0x4dcc6230 0x0ea73cdc 0x3f82ec72 + 0xf0fc3d01 0x0f3cea3c 0x92986f5c 0x8b230104 + 0xa9c9f5d0 0x3a36d583 0xfe4a5920 0xf72516f3 + 0x4dbfd936 0xe2109d97 0x2196ec82 0x7eda7515 + 0x07b1481e 0x763427cf 0xcec66b8f 0xf1a168c4 + 0xe24d3019 0xde4a518a 0x49eda80d 0x58a3bb89 + 0x7fe6cd4f 0x876a231b 0xc4349cbd 0x24761ec3 + 0x941b4e8d 0x485a71ca 0x13b5aa57 0x7a0901dc + 0xbc6a5361 0x226eb69a 0xacace9c3 0xc13d79f9 + 0x3e7dd201 0x0a3b78ec 0x0a7b8a7f 0x32bd5289 + 0x0079f978 0x745016ea 0x4f9b3b6a 0x45be9469 + 0xdb78b297 0x59107a2d 0x4d589a2a 0x71f90231 + 0xfdedd23d 0x8107d475 0xf7b38bbd 0xade2c969 + 0x3d452429 0x11a671f9 0x206a4cc4 0xf0dd5864 + 0x8d944e34 0x94108699 0xce16c2ff 0xac44a546 + 0x8022e1a0 0xd0bd4223 0x3a1564d2 0x10557cef + 0x4bdb2f98 0xe16180aa 0x06cbb4ee 0xbb244e1c + 0xd07a1335 0xb0e783d3 0x985b51b3 0x9c78ab34 + 0x017167c6 0xc69e173a 0x837f1b8e 0x582295bc + 0x06c58c52 0x96e40ebb 0xc7201a04 0x64175c43 + 0xe5bfffc5 0x66adad7a 0xb5497cba 0x551f9616 + 0xb073a953 0x22c3b782 0x00d30861 0x565f461e + 0xdf0c5bde 0x43c8b41d 0x8d0684dc 0xa8866b74 + 0x90b68be1 0xc3e6319c 0xdb45be3f 0xbc70cd9f + 0xbbe3f1eb 0x6aed93f2 0x5f3ccc9a 0xa7d4d8c2 + 0x0e0ff1b4 0xdeaa088f 0xe358f67f 0xe4871f57 + 0x20109153 0x6cc1ab8e 0xe643de66 0x1d3e3186 + 0xf2381609 0xcfd2ab4f 0x06884af6 0xc4f3a934 + 0x8cb92e34 0xf821a26d 0x3dadc95d 0xa45c233f + 0x29ae3af1 0x0dae8ae5 0xb0060fbb 0x07ce4601 + 0xd1ee82db 0x5eb3a5b8 0xaff1d25a 0xcdfa04c9 + 0x4d68b29c 0xc1dc4c66 0x8c05838b 0xad4b143a + 0xfbe918d8 0xe378431a 0xc7e27e08 0xe81258c4 + 0xf10507d1 0x37dc0b04 0xd6cedc24 0x0971915d + 0x17b54465 0x6dea1b32 0x5a4bc7b4 0x7119b193 + 0xa04dd0db 0xadfd8091 0x5b205c9b 0xe03b128e + 0x98e35227 0xb449ab74 0xae90803b 0x954f568e + 0xb9eb58ae 0x71b72a7c 0x59458b8d 0xb059ae4a + 0x4b72573d 0x18f32453 0x5b4f6b3f 0x69ddc2a7 + 0x3e2fcc75 0x091ed858 0xdd5d4a72 0x86353700 + 0x27fc1bfe 0xc4d8eeeb 0xddf44d9f 0x0f15d7a3 + 0x991dcfd4 0x00386677 0xee2673ba 0x1dbb99f7 + 0xa111f717 0x9634680b 0x62437316 0xfac01e1c + 0xd50676bd 0xaacf0ede 0xe1d7a34f 0xfecab518 + 0xcbd1de86 0xa426eb84 0x1bd25ae1 0x5a132262 + 0x2b611348 0x0d1635f4 0xefcdb98b 0xbcbefec0 + 0x68a28e90 0x6dec1461 0x2c7772de 0xf263e32d + 0xffca07ac 0xd267134d 0x204ecb5c 0x0c48c2b8 + 0xf1880ad4 0x04af8a4c 0xdfea69ec 0xd403d608 + 0xc2726b1d 0x7922cb45 0x57a4189c 0xd5fceeb1 + 0x8abe5b6f 0x63da5686 0xef01bd5a 0xa90f3abd + 0x48b8f807 0xdae82347 0x04748a1c 0x0dc6e20e + 0x1037d7f4 0x50dd982e 0x93532642 0x51ae7c60 + 0x5ad6d25a 0x0aae3f44 0xc1da2b21 0xe7f1ef94 + 0x3dd8d08f 0x2987f4f3 0xeb3e61aa 0xaf162753 + 0x557bf622 0x62d57d19 0x19c6bb30 0xb8a52c45 + 0x84551269 0x8ffd8fbe 0x4138c3cd 0x4fdffa1a + 0x0a7b326c 0x36e6fe1f 0x3d313ebc 0x2ff07422 + 0xabd14b1d 0x61f6f7ad 0xba5daec6 0xce7cc665 + 0xb401bad8 0x5ec17e06 0x9781d9cd 0x4d813af6 + 0xb1f33ea6 0xb77a0f3a 0x9712140b 0xfddf16bd + 0xc907de80 0x9154855b 0x17795d77 0x80990379 + 0xa2b5f0c4 0xf389d17a 0x2c8e805b 0xf8486c6e + 0x1a294bea 0xfb534124 0x7a3866d8 0x7fd8ba0f + 0x9726fd37 0xcc688de3 0xbeb96bd5 0x3c18e90f + 0xc78642fe 0x4e8f23a9 0xfebac657 0xda647c7e + 0xc6b3f0f5 0x394817f2 0xbdaa2296 0xd1adb9bf + 0xf3839d7a 0x40c9cd22 0x40d1aed0 0x1c2a84b2 + 0xde0e3519 0x83ea4c84 0xb624f803 0xd1806a2d + 0xf53472cc 0xf922e564 0xc13e4668 0x5aa22cc2 + 0x0b48fbf6 0x3435df92 0x853a14cd 0xd197a7cb + 0xeb4030ab 0xda2c86aa 0x5abb8deb 0xe77bf872 + 0x93be7405 0xe8a46779 0x18563dc4 0x0f8bf495 + 0xf1845360 0xd0bbd749 0x24ffe620 0x61ad9188 + 0x81fb37be 0xacc94ca1 0x5da13717 0xc8648c0d + 0xcdd81ef3 0x381abaae 0x9835b799 0x11e758fb + 0x2a0acde2 0x0fe63aba 0x28418753 0xf6d96bca + 0x5a86a3da 0x1e8d55df 0xea74c069 0x884dd7d2 + 0xfa4c92d7 0x04bafb9c 0xacb20e56 0xfbb38eb5 + 0x1a470fac 0xa675978b 0xbd3af904 0x7b0a8371 + 0xa2e5ecab 0x03960b7d 0x37047e44 0xf0fd199b + 0x4f90eb2a 0xab81c5b6 0xe6a6c469 0xf96b999e + 0x95533428 0x13c09787 0x480f77ab 0xb34c4102 + 0xa80a40f1 0x385db877 0xd419156c 0x188daa68 + 0xf689d54a 0x678510de 0xc83cce26 0x9d735d85 + 0x48b42341 0x11afcf0a 0x6e701d3d 0xc2fb6dcf + 0x0e9b8602 0xb5c4d48a 0x06ed18b1 0x29fcde19 + 0xe2e35d95 0xbbd34642 0x0759d520 0x1aee6392 + 0x96a8b1e3 0xf64aa62a 0xe42b65ac 0xdbf519c3 + 0xbcbd871f 0x64a2355d 0x4df65a91 0x9d8b3fa6 + 0x716f598b 0x37a689b2 0xf4f84dbf 0xdd237263 + 0xaa177b1c 0x48ff3cb7 0x3b6e0b49 0x70c79cfb + 0x85c0ddbd 0x42931bf6 0x9ccb32f6 0xc873127a + 0x92572ee1 0xda4f87c8 0xcba2c1ba 0x42df2525 + 0x6b5a7314 0xd423b148 0x9f7380bf 0x23acaca5 + 0x61b409e5 0x2c2e2ed7 0x2d3b5594 0x8a4a2761 + 0x2a72d8ba 0xcb98de9c 0xb78d7a49 0x00a5bc84 + 0x93f4dd85 0xa71757cb 0x1fa3addb 0x4ed1e934 + 0xd7203dc2 0x2528a3f3 0x06a68e68 0x7913bcec + 0x177eccf7 0x91668298 0x03c12f0a 0x0d1b89fa + 0x29f83160 0x5ca2933d 0x73edeb45 0xb538e9d5 + 0xcbe0a8b3 0x09fb71d2 0x65ec016c 0xfb8b5226 + 0x21258e35 0x04a30ede 0x6de2a03a 0x82e6bb06 + 0x871d140e 0x9241f880 0x6c91cad2 0x293f1938 + 0xb8fc261f 0x2cf7b048 0xd4b9e5a9 0x25197b75 + 0x24c87121 0x28db5c7a 0x39cda967 0xcf82e658 + 0x603477fe 0x8864f554 0x184aab4f 0x562fd6d5 + 0x3cf71faa 0xdc3a3a66 0x30b0285b 0xae2f7ccf + 0xaa086ce8 0xf9cd5e67 0x4e90546c 0xcdc9ba59 + 0xb5b630e8 0xc8f3729c 0xc2dfd2c2 0x6018ea7e + 0x6e95683e 0x65e3beca 0x3fccbe2a 0xfd4e58f5 + 0xb24a4997 0x19de4745 0x7751b723 0xe78d15f5 + 0x6873888f 0xf937aa82 0xb6b6ed45 0x7e56d48c + 0xf153a835 0xe1dddfab 0x5d776a12 0x03139774 + 0x54559692 0x13f04a88 0x078e6701 0x49e9e55c + 0xb7a0920e 0xb383aeb4 0xe1173fb3 0x2caeeac1 + 0x73a3d8f4 0x2282aa7a 0x6bd5f9bd 0x5f13344b + 0x8339c55e 0xad0695d7 0x78159348 0x09267b90 + 0xe3a09c12 0x157dfdd1 0x2ef4cfd6 0xcc4215e9 + 0x50d76d00 0x70b55dd4 0xcb87670d 0x08c0fa41 + 0x50bb4aa1 0xdb6d83e3 0x2a7c8da0 0x1e08420c + 0xc91a2399 0xd2a672c5 0xc7f7d8ed 0x45029a29 + 0x9ddcd81d 0xff3cf467 0x63009ce5 0xa50637b5 + 0x2ede7947 0x62aed401 0x1fafb3f1 0x8316fe04 + 0xd295aea6 0x06f749c0 0xf973da35 0xfe556c78 + 0xe01f5445 0x3528710b 0x0808a80b 0x0183fafb + 0x8e6543f2 0x07a2a03f 0x1a36adf1 0x47cd2210 + 0x4a193199 0xba188145 0x421cb065 0x94d0ae9e + 0x7d1c3cea 0x4a74541f 0x82c4933a 0x9fd224b6 + 0x89500178 0x2b78680a 0x567249f5 0xb222940d + 0x9ca89cf7 0x462ca6d0 0x79b2bff6 0x4f9d6387 + 0xca313485 0xce82bf7c 0x9f57b8b0 0xcaf9db91 + 0x8d1ab4a4 0x6936c06c 0xaa59840a 0xee9849a8 + 0x2d44e5b0 0x646620c1 0x9cb2661d 0xfe62a62a + 0xf530f23f 0x5eeab9b3 0x7295d528 0x84271a07 + 0xf48dad48 0x9da972b6 0xc5371843 0xd2a92d31 + 0x1e1f2f55 0x31bf76ba 0xfc86de0f 0x5b0e4b3a + 0x32717627 0x66cd0732 0x752dcd7a 0x7a2b4ca0 + 0x6e57b5be 0xd79693e6 0x761647db 0xd95d15c1 + 0x38f4efed 0x56ac1fad 0x246cdd2b 0xed296a1b + 0x1fd35031 0xdc2df3fe 0xcfc87844 0xb3fd91e2 + 0x1258f8bf 0xa045f907 0x1e47e52b 0xf9f938cc + 0x7cce7223 0x48fc9f8a 0x7aee764e 0x41dd6e6f + 0xc10c2c19 0x52aaede2 0x8c385a45 0x9e12f133 + 0x3db90d3a 0x27e28231 0x55be51d7 0x00e6368f + 0x1fd4fd3c 0x6def9a4b 0xdc93772f 0x457f3ac5 + 0x8eedc98f 0xae155751 0xf75cd60f 0xe898a7d9 + 0x7fc25a51 0x76bc5cd4 0x9b09de8b 0xb91799ff + 0xe3d3af8a 0xd147a45f 0xa9f5cf7d 0xa70ca9bb + 0xd0666030 0xe722ced8 0x25e9829b 0x1a507818 + 0x3c68043c 0x3c347881 0xeee5f72b 0x2578e4e9 + 0xd9907e3b 0x7022704e 0x37250966 0xa69e498c + 0xc91a7dfa 0xe75fca08 0x79def8ca 0x7575ed1f + 0x9c8a87c0 0x3bdfc7e4 0x902e19d1 0xd1681cae + 0x183ae48a 0xd4028c37 0xc207fabc 0xd716f9c9 + 0x7692210e 0xa55162f5 0x2a417afa 0xf760cf34 + 0x655a8c51 0xa947d18b 0x34300451 0xc86738b6 + 0x613af90e 0xaba61359 0xd4e36f5f 0x57d2a32e + 0x1d760d72 0xff0d5c4b 0x7a06a9a9 0xf3cc7635 + 0xd771a952 0x8abca0eb 0x7de39d60 0x2069cce6 + 0x2e62a5f5 0x0623c4d0 0xa2ecd9f9 0x890b4bc2 + 0x1f007c31 0x6094f199 0xe86eb4ea 0xe943af14 + 0xa25568a5 0xcd455f33 0x356397fc 0x5044a17f + 0x69f2a636 0x9ca1b4e6 0x83c302b7 0x8b1b163e + 0x5e2bf6cd 0x06219ec7 0xf3c5f611 0x91cf2805 + 0xda7fc176 0x9f699220 0xe12e12ed 0x542e44d0 + 0x3aa933f5 0x81dbddc1 0xa9e8484c 0x08ba7f51 + 0x46f25ac0 0x1a1eea19 0x2b89537a 0x76931ef8 + 0x382b0ea5 0x6897263f 0x2499d2d0 0xd6eee651 + 0x1f7bc0c4 0x3e175b1c 0xb2aacb80 0x1eb1a88b + 0x80952bdc 0xd379d2a5 0x5ed564f2 0xadb00e5e + 0x2bc146ae 0x0be7dde1 0x1685f647 0xbab0da68 + 0x14b078e9 0xc64ce2a0 0x3da71d96 0x76266660 + 0x243c5f18 0xce33dad7 0xb2397ee3 0x850fee64 + 0x60842053 0x85222609 0x96f95e16 0x0d34df66 + 0x42d77ad0 0x44394210 0xb7f0725f 0xed8963bb + 0xf198a6cb 0x49f0b0a1 0x91c10d80 0xc11643b4 + 0x9d472e20 0xe545e06e 0xdc0b2575 0xc5a73c70 + 0x5e129549 0x5fec143b 0xf4a54b6b 0x7376d098 + 0x94890946 0x6b159168 0xdbf5d559 0x2d15d2c5 + 0x62beed84 0x496ae635 0x830a8ba5 0x9485d01a + 0x18000f33 0x227d3a56 0x57a79da3 0x78fdeea8 + 0x9a4fd2b6 0x4c6c640b 0xb66dc174 0xd5ae918c + 0x08d64dad 0xb5c10d4e 0x8566cfc8 0x7fc417a6 + 0x8ea49797 0x57dc0ba6 0x88394257 0xb2243957 + 0xbd996dd2 0x514ba51e 0x9ce33543 0x9ec5575f + 0xd06a02a2 0x971925be 0x73f782e7 0x2ef325e8 + 0xd9e8ef23 0x1f8193d1 0xed943ab4 0xb6c70406 + 0xa68d5a01 0xc129e2fd 0x083ba4e4 0x88834b40 + 0x30c8fe6d 0x3e6beb66 0x8d27cd02 0x473b2a7b + 0xecf2d253 0xf3c0822d 0x426515b8 0x00e6b48c + 0xb320b7c2 0x85f26aa1 0xcdd377b3 0x1b19bb4a + 0xa66fc688 0x501c824a 0x28bfa4b6 0x2d069cc0 + 0xf76c85fb 0xf72511a4 0x7f809c21 0xacd48b6f + 0x656127d6 0x81d79e3f 0x611cff49 0xa04d85e3 + 0x2f470eba 0x1bf8e9ea 0xd493b7da 0x6cd63a57 + 0x0fbfa26b 0x4430e93e 0x79b59d39 0xacbc2656 + 0x25a9ba25 0xb87acac5 0x5f0a632f 0xfb1ecbea + 0xb18d5c43 0xfa68bbd8 0xb31f1bd4 0x604a4306 + 0x405e28ba 0x1165abed 0xb0b965e2 0xa9ad3f38 + 0x6ce908b9 0x9fa5aa6b 0x0775320b 0x2d287317 + 0x60bd9f4e 0x31cd01c7 0x626b8962 0x5f0f70ed + 0x589edf38 0x08f3ea97 0xd1fd07e7 0x621c0ecc + 0xd590dc2c 0xd514c36f 0x93788b25 0x79283a30 + 0x2c985995 0x0d40d7ee 0xf5911cc9 0x7da4569a + 0x86274827 0x5f6e7a2b 0xd8a9a6d1 0x629e34c2 + 0x624df9e2 0xcb351189 0x82ea6097 0x9f8d2cdd + 0x61cfb400 0x9d6c3b45 0xff19366c 0x79690958 + 0x6ed4ddf3 0x4b33e4e9 0x653f0b2f 0x83a591cc + 0xe1722cc4 0x856120d8 0x7b00c52c 0xf7674979 + 0x597c1d35 0x036883c1 0x4d08ef96 0xa0c8f2f7 + 0xf384e306 0x7300e5f4 0x83839ef9 0x20ad1d51 + 0x7e1f18a3 0x2098dd76 0xe6b65690 0x9bef2e5e + 0xb38d701b 0x2045cd61 0xa954fb21 0xc4dff68d + 0xc28b7666 0xbb9a4184 0xaafc7eb5 0x45456e66 + 0x67db7454 0x9a05253e 0x28122206 0x625d39a7 + 0x04592faa 0xdba42c40 0x9a3a4993 0xd3d6c2bf + 0x3c40982a 0x6431b67f 0x0ea7cedf 0x2b0ac9f7 + 0x9ea5d4d6 0xe791d5f0 0xaadd0723 0xe4fb9c43 + 0xc8201ba8 0xe1932301 0x0ce03a52 0x3496246e + 0xf137bc12 0x26a323c5 0x390958c7 0x483106ab + 0x6b86c7e1 0x7a66b1c9 0x241fad2f 0x952d52ee + 0x482ee92f 0x5c9a3c81 0xaf6a220b 0xe4009d00 + 0x2df7ab42 0x3b13f244 0x0a8e893e 0xf212a578 + 0x725e101c 0x8a1b9508 0xde355a1e 0x56e8280e + 0x5a98cf5d 0xb327ff63 0x534a0d5c 0x96da187c + 0x39ddcd11 0xc70595b2 0x46244641 0xf4e2f10e + 0x62859f24 0x6d6678d1 0x34aa8dd9 0x4fc01a56 + 0x6a64e34d 0xe17ed716 0x249c6ac3 0xd47d1fde + 0xaf3e638a 0x676ee17a 0x650eaff1 0x887e2825 + 0x4568605c 0xdafd3994 0xaa38516f 0xbfc697df + 0xe99c9a63 0xbd891af4 0x0a50dbce 0xcf7ef33c + 0x7ad7b95b 0x3e85b834 0x29149b84 0x82366554 + 0xd30e026a 0x111ab9f3 0xd5ef6860 0x9a28b5dd + 0x694cb602 0x97bab21e 0x476ec4a6 0xcf1e4c2a + 0xb41217a7 0x99548940 0xf1fc374f 0xed9cbc5c + 0xccb162c6 0x705553ac 0xa16ced27 0xd8a37721 + 0x2be25c67 0x955c09e3 0xd6528a68 0xe6fcf157 + 0x872eab32 0xb835c145 0xe05948f6 0x21d9cdbb + 0xf575408b 0x22ec501b 0x3c1ea4bb 0x4b7f3078 + 0x45efafca 0x4b5a64c8 0x8c3b74eb 0xd9876f32 + 0x808744e4 0xb486a14d 0xe91fe265 0x94e39478 + 0xb730a4f9 0xbc086921 0xe16b8506 0xaa6deeaa + 0x90d5c750 0x8e446d6e 0x9d67c80c 0x29625ab5 + 0x1953ad92 0x9394ad85 0x753b1636 0x1f844fa8 + 0x85af68a4 0x16867851 0x5ccc7e43 0x0afe0376 + 0x34e74ec9 0x1d5110e6 0x57261d88 0x812f0a62 + 0xd7c4b769 0xb2f30a49 0xc89e0d57 0x391f54ed + 0xc43f5790 0x9dcbe811 0x1e81afad 0x16b6d454 + 0xf5cefcd5 0x707e3d0b 0x5958fe66 0xba383ccb + 0x707291e2 0xc65a0a2f 0x747f9560 0x51db16a6 + 0x89462d49 0x438ead4e 0x6313b326 0x9472a519 + 0x6628fc48 0x1f95d3e4 0x06ac59d9 0x0149755d + 0x946d99fd 0x64e8be5a 0x7c56dd78 0x1ebe2d9a + 0x3544c47a 0xb02e58a7 0x1fcb9959 0x2ec10642 + 0x0a665998 0x4f198f24 0x82c4daa4 0x4cada36b + 0x3cbc1c5f 0xb4b58554 0xbe3040ca 0xa5e0f771 + 0xd6f10bdb 0xe8b8c75b 0x785128b2 0x2dba4eaa + 0xc22a1a20 0x57ca1766 0x950cebad 0x7164255a + 0x1ca5bfc5 0x32f879fd 0x633415c3 0x8671a86a + 0x97d1231e 0xb42eb0c7 0xdc7548dd 0x76073c5c + 0xffa2b6d9 0xccf1826a 0x13e25e0a 0x81f0d572 + 0x0872ee56 0xd7b0b7b7 0x6622b528 0x2eafee6d + 0x3fbde14f 0x60f14acd 0x10e6313b 0x2fd9c84b + 0xe95358d7 0x2a66a304 0xde93d150 0x0b903a36 + 0x66fe047b 0x5e2e0799 0xb75faa2d 0x01b31a01 + 0xb86a5e56 0x7688a8bf 0xaddd7310 0xd842a919 + 0x4257a4b5 0xd367ce43 0x90670d88 0x3d68096d + 0xb328ba2b 0xd3b5309e 0xb594e0a5 0x541ffbbf + 0xcf6628da 0xd2610017 0x9dbd7b08 0x147714e9 + 0xad5af7cc 0x14ed8059 0x0e4eb5b9 0xcecf70b3 + 0x797c47d4 0x2e9a5629 0xffc303ee 0x92adb18d + 0x38fc626b 0x28d90f28 0xe406e993 0xf786fcc0 + 0xb089ea66 0x2b298595 0xb57836ee 0x40e97ef5 + 0x7ee51371 0xeaa0c668 0x09abf083 0x827d5dab + 0x286d7caa 0x3b8abe7f 0x9207ecab 0xbcfd1c10 + 0xf32c77a0 0xb479119b 0x8fb80b72 0x04007837 + 0xdaea926c 0x0a45f5fa 0x898f4cfd 0xd6570824 + 0xe94c1364 0x85dcbdba 0xa836cc7c 0x82fbb300 + 0x8f0194d4 0xcc4e0c4b 0xecde1ec5 0x64fe947e + 0x491a07e8 0xf2fa274e 0x753bcc2a 0xf8acefdd + 0x8c08c75a 0xff4ea493 0x85d2950b 0xf0dde553 + 0xc81b49bd 0x61798da1 0x582f0e73 0xac899e79 + 0x37131e86 0x6fb7b794 0xa93e9bb2 0x543a052b + 0x4f7545d7 0x547c593e 0x1ae5b597 0x7e8921dd + 0xaf7738cb 0x1724cf35 0x38666b1d 0x45bed06d + 0xb02db85a 0xeba54624 0x6e82a670 0x4eb126e3 + 0x008c65a3 0xf89fc360 0x7554657c 0xd0fda40c + 0xcdb31573 0x3236ef91 0x35cc7d91 0x46dadb32 + 0x42385866 0xc7e9b5b5 0x421fbb07 0x98c6e1b7 + 0x74640f5b 0xa1164da1 0x2396c6f7 0xfc070c24 + 0xd1c9da6e 0x45d528cb 0xe7a1bfdb 0xfcccb5e5 + 0x331842c1 0x5e52068c 0x700df099 0x6a75f141 + 0xb16d4b01 0x9d4c0e0b 0x6294a17b 0xf2bdd77e + 0x8e0b4658 0x4864cea6 0x902b1b1a 0x40da3ae4 + 0xb21ec43f 0xb6aa1fcb 0x98c59e25 0x05d121f2 + 0x12df7d44 0x6ea64f78 0xbffb9638 0x56bd07d6 + 0x47951e5d 0xdcff5b07 0x00e039fd 0xf367d08c + 0x7f0391dc 0xf44bd71c 0x6e55aefd 0x6868e5e9 + 0x29e2ab06 0x0dafec72 0x465dd93d 0x92506550 + 0xb4e86b8c 0xa0c68258 0xe602ca48 0xed2bd7dd + 0xc0bbef81 0x759ab650 0x20429eb2 0x67b92b3b + 0x740860b8 0xa89f4d7e 0x9811aff4 0xc5090423 + 0xdeeaed1d 0x5694b80e 0x301bab2d 0x4e760e67 + 0x5f93041b 0xf922237c 0x7e9a501a 0xff974f99 + 0x70c1493c 0x7ade6d44 0x51924c7e 0x093c6617 + 0xcdc8d641 0xafce8c92 0x36df5db6 0x92ec9f36 + 0x44bcd121 0x3c693f2d 0xfdda3f10 0x5e1af637 + 0xc457c9d9 0x5c083fd8 0x3fb0ae4f 0xed10d011 + 0xccdd403e 0xe337f655 0x5cc5a0e7 0x83909519 + 0x9df20176 0x11082484 0x6b346426 0x22b3ffa0 + 0xf80f36cb 0x4e51aa9f 0x402f66c7 0x3fcba7c2 + 0x70718156 0x02c30feb 0xe4fab120 0x36ef1781 + 0xc7020c16 0x05843068 0x67a5b55e 0xb3ff0e87 + 0x56d90cdb 0x195ffa41 0x13c72463 0xaf6d776e + 0x94d7e951 0x1a68d757 0x68a9f6d6 0x987530e7 + 0x2bac05ae 0xfd4c2953 0x0637fadb 0x43978dac + 0xdbd6bf6f 0x3aa74e3f 0x9b05c191 0xd5206ef6 + 0x8e98538f 0xe3a0c4a0 0x289b963d 0xf20ffa7b + 0xd9212ce9 0x597553e9 0xf7629b53 0x5bd93bc3 + 0xbfa8e24d 0x8d64da85 0xc1480167 0xe5a7f74a + 0xf39af6c8 0x64ba7c27 0x8a4416c3 0xbef8e773 + 0x4533701b 0xe076c393 0x44fd530f 0xbaf32be6 + 0x91c38e6f 0xa92c973c 0xc6a31c09 0x601e3e71 + 0x7ab14696 0x3a738d1c 0x3a526f47 0x36428cf7 + 0x2d42a935 0x43c23b8a 0xa19717ed 0xde0f9dc3 + 0xe2e0d482 0xa61a571a 0x3b0737cb 0x83b5e88c + 0x1bb2460e 0xfcede58b 0x264126c3 0x8508e56d + 0x0b145431 0x4f5203eb 0x86739042 0xbcac8ef2 + 0x2ebdbad5 0xbdd600b1 0xa3769f70 0x2b64b113 + 0x510456d4 0xc2148b14 0x30d1b7f2 0x5baf8b95 + 0x5fb82f72 0xd7c4d86a 0x3c5550a0 0xed2d9573 + 0xc9cfa502 0xaf78d702 0xd76fd581 0xee87d5ab + 0xd70d8e22 0xc89a29bb 0x2611a169 0xed6b51cc + 0x274b1ae2 0xb48c88fa 0x793b6258 0x008e406b + 0xcfab29f6 0x38e3d921 0x01740270 0x6e70096a + 0xc7aefdc3 0xd80c45e6 0x2e44366b 0xe1c90426 + 0xc042cf77 0x22051e9b 0x540f3479 0x9f7f35bf + 0x5d1de0a7 0xd98a991e 0x55ec626b 0xd9ffc82c + 0xf16272ca 0xc09f7529 0x3fe2b13f 0x8b7e7b40 + 0x387b5d39 0x0dcbc77f 0xd5cd4849 0xd1d11cac + 0x3a81db4b 0x918f714b 0xfd36aaac 0x7d99c7a7 + 0xf17a14cd 0xd23a9976 0x779011d7 0x26697b23 + 0x22fc8d6a 0x46ecf917 0x7c91000b 0xc166ae9a + 0xca4ba72d 0x2a48862f 0x261e726b 0xd7531502 + 0x78bf5417 0x25389b56 0x61e5005c 0xc8033170 + 0x4e00e018 0x708cf6d4 0xf04cb696 0xcb3d0f20 + 0xb046e418 0x209d248f 0xded466bb 0x016d7f8a + 0x7959b87a 0xf784eaad 0x8d54961d 0x9b752161 + 0xe0119966 0xd7ab91db 0x11dbc152 0x3e47581d + 0x890d8481 0x6f3b72b4 0xbe486e2a 0x22eb5779 + 0xfde7df8b 0xf322e970 0xc002f7aa 0xcf26edfe + 0x4402cce3 0xb2c50725 0x039fb57b 0xb4763a8c + 0xda8833a0 0x7c622b2f 0x0196f2e8 0xcfdfa120 + 0x1d84466c 0x617f4810 0xa554e9b9 0x4a65213e + 0xa8e6447a 0xdd454003 0x2a191f8f 0xe90888e7 + 0x0cbb1e1e 0xc0014e3e 0xf8fa5110 0x14bf1e9f + 0x1f58cc1d 0x401eb5de 0xd389fc93 0x2e5c4138 + 0x9f8e7c4d 0x2a114200 0xa8480323 0x5568fe3a + 0x29aaa87f 0xe00d1ef1 0x6529b380 0xbb25daab + 0xd88cab32 0x6b81bb11 0x408a8c3f 0x03969bb9 + 0xf4e12ee9 0xe9ef423d 0x523ef85c 0xfea8abe9 + 0xd03d0d5b 0xd7f52b16 0x50924023 0x9f5ddf21 + 0x077c2d28 0x2d2de8ba 0xfb344a20 0xdacbc873 + 0x58d4b24a 0xc5c93dd3 0x2fd90431 0x5fade189 + 0xbf1eecd4 0x80e8e6ec 0xc34cc52c 0xaa7909f5 + 0x2b29ab08 0xa11b7aba 0xef0c9042 0x0ee739b2 + 0x528b4375 0xa469ce9f 0x99c5ea7a 0xada779c4 + 0x13b5f495 0xed8fada4 0x821438e1 0x0ef7b4fd + 0x0dadddb7 0xf7b0126e 0x0122aa70 0xe85c0393 + 0x43d987fe 0xcb807e6a 0x3d640cbe 0xb455abd3 + 0x16fb3f4d 0x186eff0d 0xed772eee 0x4b24f0a3 + 0xc7740459 0x47558d79 0x6aa1ff59 0x5b5edf38 + 0xc458a17a 0x82541e75 0x9ea3ebaa 0x2112cd2c + 0x3545f49b 0xfbf236f9 0x69dea934 0x5c17ca33 + 0x5e858504 0x01aac0c6 0x11ef33f6 0x8854c6f6 + 0x34ebd4cf 0x512345e7 0x2d3ce674 0x3037b243 + 0xba71633e 0xd416e216 0x5d98bd1b 0x169c473d + 0x27048f4e 0x70293e28 0x1e0f2644 0x8ee3457c + 0x7af12b70 0x0691621e 0xfc31ebfe 0x3b3c5afe + 0x1ac47d72 0xe9e14234 0x35773bfd 0xd8efb085 + 0xe9130b25 0xff66974a 0x0784ce95 0xea94b8bf + 0x5e19a597 0x734a65a6 0x90aa4fec 0x0ae1650b + 0xc98c92fb 0x6b454b49 0x0422fae7 0x0b3d3795 + 0x2d974bd2 0xc1da7d45 0x277b747a 0x4beb18f3 + 0x5da6e424 0x9a74f0a3 0xe8ab17e7 0xbd808cba + 0x30be527d 0x4e3cc912 0xca176f12 0x24de5a90 + 0x301bfd72 0x4809f186 0x3ad505de 0xe1d9c240 + 0x94c2293d 0xe1e00502 0x4f182e78 0x969de138 + 0x05153ec2 0x7beea3b0 0x94fc29a6 0x1dbea067 + 0xb34c9cf1 0xf03b6643 0x9fbed0c2 0x3b64555f + 0xfeb2cedb 0xc84fd85d 0xfb48aa5d 0xb435f74c + 0x1da90905 0xf4ff49f3 0xaef0b05e 0x372cc04b + 0xf275770a 0x83412ce8 0xcc8ef6f3 0x3cf61a91 + 0x8f825847 0x0ff84984 0x1911424c 0x5f7f6414 + 0x9d2b9e77 0x441aabe4 0x20a99f43 0x5bb7d84b + 0x01004cf9 0x794d2def 0xc2426978 0x3aee4a5e + 0x9023ce81 0xba06c7bf 0x86331c72 0x97ed04e4 + 0x9daa4d57 0xd80d4732 0xef0ce33d 0x7bb634f3 + 0x86b8c306 0x9117c5bc 0xd2493a34 0xf705284c + 0x081ecd4b 0x594cbab5 0xf1d18aa3 0x5f7065b2 + 0xc9f54c16 0x4ce69755 0xd673c1db 0xbac9cd34 + 0x149eebbc 0x3219fac8 0x90898889 0x048a66d8 + 0x09d33838 0xc77eb874 0x636af1ab 0x3911f3f2 + 0xb081e3f6 0x50b6cf1d 0x1b062c31 0x15921863 + 0x644d3d11 0xca8d9c94 0x1593d492 0x3d862993 + 0x4092dd00 0x8728936a 0x0c621f31 0x97c7e076 + 0x68672d98 0x27a3c786 0xc536e4c6 0x628aa80f + 0x7e3042b1 0xba983931 0x9233976f 0xd3e1feee + 0x454ddaec 0x7cbabe45 0x626f5680 0x86d62425 + 0x3747293e 0x7bbe541c 0x19a3ab12 0xf2505a05 + 0x2c2bdf16 0xf197013f 0x36d8c917 0x8469a25a + 0x954a3585 0x567d06c1 0x31190459 0xa9cf6769 + 0xee56d8ec 0xb2a25d79 0x4e9522be 0x5c53b346 + 0x2498f858 0xb53a56b6 0xbf1dd8b5 0x07cae034 + 0x77b831cf 0x56d025d2 0x23941f5d 0x41c94630 + 0x84c8f997 0x497a3f80 0x6f4851da 0xe11e1e22 + 0xa9cb39da 0x32573406 0xd2dd24fe 0x097b2c23 + 0x10fcf14b 0x76108b3c 0x791e9ac5 0x1588e2ee + 0xd76e51fb 0xed83c5d9 0x0921d0a3 0xe6ed2241 + 0x18b12102 0xcec961f1 0x018ceb98 0x9055f200 + 0xb8c139b2 0x0c6a8ea2 0x80113e98 0x168051ac + 0x275327b2 0x0c2a2b86 0x8fdabceb 0xb96339fb + 0xac03247a 0x8d016f69 0x52905c25 0xd43063f6 + 0x03859acb 0xb0b82819 0x662639c4 0x9df25b87 + 0x905c8493 0x2f82ced3 0xdc4ca8af 0x3be8fe34 + 0xca04372e 0x2bdcd311 0x21c4b1e7 0xa2026acf + 0x956cc1b9 0xcb12e0a8 0x210edfc1 0x4003fe60 + 0x7615d091 0x4ad2db99 0x2b78dac3 0x45a28b4b + 0xfaa2c78e 0x93f8851b 0xe819f776 0x301ba8a5 + 0xe8c611f4 0xb57a86a0 0x22ba84d0 0xe534ca91 + 0x353d9a80 0xba5eb547 0x767b440d 0xa0aa0501 + 0x27e91c51 0xce8f3edb 0xec1f28df 0x1d51c345 + 0x3501e714 0x535cac3a 0x414330de 0x798b4e98 + 0x49a151fb 0x5dbb2a08 0x8812c1d7 0x6dbd0647 + 0x229fe96d 0xf8880ecf 0x9fb56948 0xa42812fb + 0xb3bbeaea 0x7e301c94 0x3fcb5808 0xb7aab8b0 + 0x2cfc9729 0xc62adc08 0x9f8aeeda 0x79289a00 + 0xee2792e0 0x27fa60e7 0x3b758c80 0x2a5a64ed + 0x9452b3e7 0xd5a65d87 0xf5d0a791 0xf97be2a7 + 0x7191d713 0x8deac7dd 0xf8191187 0x052f7805 + 0xdadb6713 0x83cfab61 0x2b96f96b 0x7ac15508 + 0x5cb6d698 0xc13b3e8b 0xc0079fcd 0xddac8a5a + 0xe451de56 0x71713f63 0xbc068461 0x7936ad26 + 0xb9d78db7 0x111a6e9d 0x97038690 0x0586772f + 0xbf2baea3 0x7a09ab77 0xe9749e25 0x7c69d049 + 0xb4e8eb34 0x7032f28a 0xa558cbe0 0xa01328f4 + 0x080db42a 0x5b8fc345 0xfc6807e4 0x817e0aa0 + 0xcb2216cb 0xbb2b9376 0x03bd0b38 0x148e884e + 0x958f7457 0xa2a9b3eb 0xb08a2615 0x09a10c5f + 0xfbd37e19 0xc7cb96a3 0xd34445dd 0x87adbc72 + 0xc5f1ac9b 0x86259ac2 0x8a13ffaf 0x7e18ae06 + 0xa1b809fa 0x2cd861ce 0x6d70cfe1 0xc886b3b4 + 0x2fa9e7d1 0x746fcfd8 0x6cc1048e 0x3a90bcbe + 0xe128aa6d 0x17926080 0x32016f56 0xda94ed0c + 0x7e9378c5 0x5042aae9 0xa3dc912b 0x1623e997 + 0xc4b94ccd 0x307ae247 0x03247b7c 0x6c6d0108 + 0xd410be0b 0xb623d11e 0x9663c906 0x6bbfa5f8 + 0xc27210ad 0xc41c94ba 0x05e237e0 0xa668f183 + 0xec6065ec 0x26ca40fa 0x94fc5cd6 0x6a82dc1b + 0x1dc1d96b 0x7c005bff 0xf8366526 0x73c2cefd + 0xe528f243 0x14dfb490 0x15f80a8a 0x394b095b + 0x72775581 0xb7ea99a2 0x44f5c936 0x410bac20 + 0x1f5db398 0x117825a9 0x379c138b 0x602ee0ab + 0x2d3c0109 0x1f438f92 0xdf27eddf 0xb02293f3 + 0xfb38fa7a 0xa7a4e06b 0xdd9fe2d1 0x20e40a7d + 0x227ca003 0x17b74fcd 0x2cea8dba 0x6769ebe5 + 0xc949674c 0x8eaf9112 0xff8b63ab 0x4035bc30 + 0xc0aa874d 0x7ac4058b 0x21d0ef5e 0xf62af154 + 0x8b05b4c2 0x43c74cf3 0x842dc532 0x3c8a3e5f + 0x95d801bd 0xb5a83d10 0xadc1a8a7 0x670c26da + 0x4bf0507e 0x035e8bfb 0x46b1e6cc 0x7fc4c2d3 + 0xed22a187 0x5135992b 0x7d1371fd 0xc953608a + 0xeaa25648 0xc31bc809 0x8603bc0b 0xc8ad6d91 + 0x5fc84456 0x99b9e025 0xe829948f 0x5cbc3eee + 0xae8f59b7 0x3ec97bd3 0x3abce245 0x228bd681 + 0xb2b1ada9 0xead6e411 0xabd2e254 0x7e45dbdc + 0x8a50ec7e 0x24298ff0 0xf09d0f1d 0xb74d4551 + 0xac207b87 0x9f5a762b 0xd668e27c 0xe7e54ebc + 0x498656cf 0x1e5db0ff 0x52f38a55 0x7d2204ca + 0xf31dee2d 0x3959e778 0x69a7cd84 0xc37f5e23 + 0xc1bd4c03 0x7ee89c4e 0xbafcbb55 0x129ce932 + 0xaf91dc8d 0xe00eb9ab 0x8b019109 0x10b1a3cd + 0x687e815c 0xfdab2350 0x0a2b819c 0x07eb579b + 0xdb8287a1 0x061cf9a0 0x7205de9b 0x14fdb63b + 0x1e11e597 0xfa83c8d5 0x4a512886 0xfc901e00 + 0xb84bbaf3 0xc4014e8e 0x59fd5ace 0xcb6bb236 + 0xc97d40b7 0x879ff4d5 0x32ff0c8a 0x50535056 + 0xcadc03b3 0x93e571c9 0xe11ea5a4 0x1b815fd2 + 0xe138f177 0x3c5a8235 0x0d8e5621 0xa02662cc + 0xc9d27418 0xa4764016 0xa725d85f 0x4abdc3cb + 0xb3b67e4c 0x18352967 0x888cc657 0xb5803d8d + 0xa10faffa 0x43db196e 0x9e3af00f 0x448c0fc9 + 0x534a5eea 0xdf1276f5 0x38391564 0x3a3b84ea + 0x9e582ea3 0x633c5686 0x968e2d0f 0xf58ccfa9 + 0x51912f0c 0x757d93c0 0x6a552350 0xbc694325 + 0x6ae6c819 0xaf36dcd6 0xbcb68d50 0xf92263a5 + 0x1e7cd73d 0x6b7d1301 0xac441acf 0x5212030e + 0x0b44cdd2 0x56efc50f 0x8b3f7559 0x2356f8ba + 0xc36deb85 0xd0e9aee5 0xa6c60c4e 0xb0bd681e + 0xc2ee0867 0xf98bf1c1 0x12c63c40 0xe5782e98 + 0xb9901ad4 0xccba733f 0x045c4cf1 0xcb5b1e42 + 0xaaea0f67 0x8506733f 0x72c05b72 0x47a556b7 + 0x53e6c4b4 0xcf837da7 0x97b0767a 0x0d21fc30 + 0xac2c8d22 0x7941ee41 0xdc223433 0xee048605 + 0x32851301 0x4a8a02bf 0xb78b9b0e 0xbcef4f9e + 0xf8a69e38 0x9d96bb7b 0x48a60e1a 0x8c37a194 + 0x85f03df6 0xf96558ce 0x209de5cd 0x394f3931 + 0xf4ea2e34 0x5a772269 0xd0a90533 0x70da5e0d + 0xe6f946c1 0xb68e5b5c 0x3a5aeca8 0x8b1c27f7 + 0xa34ba11d 0x00964212 0x1e02f951 0x6bc0646a + 0x7651beb7 0x1ea01e5c 0x63a727c5 0xe9b419d3 + 0x39b5df2f 0xb50a4f30 0xa6e303ab 0xb39edb7b + 0x23486564 0xd3773590 0x07028db7 0x43150998 + 0x6ad0a086 0xd3c108b9 0x6ed00042 0xd3811dae + 0xa7174bf8 0x863b87fd 0xc7f973d5 0xaad2bb3c + 0x3cb5a2dc 0x753a86e4 0x3b6271d6 0x85edb580 + 0x3222df02 0xa402cb55 0xb34dd452 0xe974bb39 + 0xaf075f9b 0x4efc599b 0xb56033e0 0x7c725abe + 0x5f5b9862 0x9b4d05f4 0xdd89f80e 0x0d7aa2ec + 0x4a9a5ed7 0x1e127584 0x5b9e9642 0x7b38fc92 + 0xea3e5bac 0x23cfaebe 0x15341ce4 0x0a556611 + 0x85728991 0xeb785d51 0x1bb099b9 0x01e67032 + 0x9f922599 0x9d657a29 0xd842759a 0x26c3e32f + 0x88494390 0xb39ec049 0x3394958d 0x90511d85 + 0x5fae55b3 0x70b505c9 0x6687f4de 0x0fef1a3e + 0xb0972ddd 0xc4884dda 0x84394eaf 0x9a37d103 + 0x8d0fd419 0x2f4c109c 0x11fe6969 0xa374e237 + 0xc5a571f9 0x156bad26 0xd03e7f9f 0x581c80b8 + 0xe58c0bc9 0x8fde060e 0xd5518ab3 0x1e740775 + 0xff22caa5 0xbdc7a492 0xbf82cffa 0xa87e23c8 + 0xe35e4b27 0x5f730aa0 0x8da1b0e4 0xa8f15416 + 0x812fd749 0xc4147542 0xbcaf27d5 0x9981822b + 0x84e8bcf2 0x4465aca3 0xe1ee2fef 0x00a0358a + 0x2e5df776 0x563c9f8e 0xdd906c83 0xaa1a17e2 + 0x23bd41d7 0x6bfe1dba 0xf4a329e9 0xfc3c1993 + 0x460278a1 0x81bc8ee0 0x8ea301f2 0x8033a3ea + 0xcb7bada0 0xbf1d5fc5 0x373dad3c 0xc2f63e34 + 0x583dba2a 0x2a35ee8a 0x2800004d 0xd7a8ab40 + 0x1e6b529e 0x87a50cea 0x0d31b543 0xb180a106 + 0xd1f47e4c 0x84e80915 0x4c43e7bf 0x73a055d3 + 0xa3fc6dc4 0xec84ae87 0xe5547254 0xcb6be707 + 0xcc4eb60a 0xd8381b9d 0x7a030d2c 0x1be55721 + 0x7bd3f24f 0xce9d7482 0x5e03d45e 0x8790ba10 + 0x321eaffc 0xe0844c90 0xa4a17f8f 0xe01b527c + 0x66816314 0x3e3690e1 0xb1c30644 0x954ccf70 + 0x5f6d6ffd 0xc6823aef 0x73d98a2b 0x838f8ba1 + 0x7212df98 0x6326fcdd 0x74d3b3cc 0x17042050 + 0xcde9e524 0x29db5b8e 0x0cd3e7f0 0x65234e04 + 0x2c75a35a 0xfa032996 0x806d0908 0x1950cc6c + 0x76920d98 0xaaa006ab 0xea4d182c 0x51d030d0 + 0x6c282cfa 0x5267eec5 0x75c7010d 0x9d0bdc08 + 0x920ee8e0 0x5aaec307 0xf383fd0a 0x135e5ac7 + 0xbf4aaa43 0xe373c54f 0xf9f3fed5 0xd0be25c9 + 0x5a54cd3d 0x4aa0389c 0xc29665e7 0x777a4158 + 0x5b57415d 0xe6a422fe 0xdb6611f0 0x6f54ecfd + 0x28c28df6 0xd6f2988d 0x1789dfb9 0x27df77cb + 0x1fa26ed9 0xae0fd39a 0xf94c4bc1 0x65d042d0 + 0x88a5f87e 0x570b29e1 0xdc1330b6 0x06378e2d + 0x20b0b8c7 0xff319526 0x17b042f5 0xbbadff3b + 0xb8ef0bf1 0xa64ad683 0x6bdb49f2 0x760ab25c + 0xb417b977 0x8d92b175 0x6b65f954 0x220b8d37 + 0xa6badd1f 0x89e2df4f 0x0aa7d325 0x40a42a74 + 0xc0dad423 0x6e7bf809 0xac4aae6c 0xd9ddcb69 + 0x3cc5e5da 0x744133b3 0xec86b2b9 0x162f0ad0 + 0x15045bf8 0x460d946d 0xa506c28d 0xfbab3479 + 0x154692ff 0x3073b90a 0x92384f53 0xb33fcc5c + 0x0abc1983 0x532daae6 0x8091960c 0x36f5cea8 + 0x0c94471d 0x816b6d8f 0x5d3c99ea 0x80cb627b + 0xa4afd8d3 0x3a9ff641 0x30c90501 0xaea17610 + 0x3b511cfc 0x23304b93 0xb9ed3860 0x54785451 + 0xdb12df70 0x4e06805f 0xa849b8a3 0xe42a6f81 + 0x76c9bf2f 0xfa8c77f9 0x6bfdfc0d 0x8a2bad5c + 0x4e49ba6d 0xcbd6b2bc 0x3b181174 0xb4099608 + 0x0d420811 0x13ff2ffb 0x7d9be0ff 0x3f554804 + 0xc84fb966 0xaa6276e5 0x7645e15a 0x3e7ac11a + 0xa0f60ada 0x238badca 0x255e2d2c 0xf238b8b5 + 0x73739f1c 0x981daa16 0xc4fe7449 0x267af5a8 + 0xc6b8cb45 0xa34b380a 0xa6a5c773 0xe301778b + 0xdc4ee904 0x28af3bb2 0x68a42bd7 0x197656bd + 0x24d44d79 0x1d9d5f71 0xcaa55a1d 0xc2b5d1e6 + 0xf94f45c4 0x7c1ca577 0xcca26345 0x47a8e42d + 0x2dbe9f75 0x48295826 0x857c1f7e 0x45f9022c + 0x9d8fb30c 0xb9c10c73 0x53e98143 0x0cb261ac + 0xecb4ecba 0xaeaf602d 0xc8ddc19e 0xcad6221e + 0xdacdb56d 0xd0729d38 0x26019f2f 0x4988623e + 0x4d0eb009 0x771bce37 0x327e5ea4 0x6bce2ef3 + 0x415629f1 0x8c3e7f4b 0xbe2af3b0 0x8ee07f14 + 0xe95f1dd2 0x6517ad5d 0x694f9468 0xfdb0a74c + 0x99edc6de 0xe5d60fce 0x3e05765a 0x41d652ff + 0x034aa17b 0x8eace912 0xfb7aa25d 0xe38b179a + 0xdbc48363 0x727299c4 0xf59fbd14 0xfdd4549a + 0xe12a1562 0x9cf616ad 0x56a0fc70 0x5878fedf + 0x7006ed17 0x67b6a794 0x46690825 0x34df8caf + 0x89e9e2f0 0x9bfac410 0xb9e96bcc 0x1913d4a7 + 0x4a505351 0x44c2605e 0x45ba2b5e 0xa437684f + 0x1c781405 0xc6be10fb 0x409bfe58 0x63b0013f + 0xa90be299 0xb4089f7a 0x3fef5391 0x7a63871c + 0x0fca68c7 0x915b006a 0x48c61ed8 0xf8b462a5 + 0x29de81f1 0x9d001eed 0xc839aa5c 0x6818083f + 0xe9bfa7b1 0xb1be11d9 0x89bd0960 0x9bc6a6b6 + 0x17b8b5c2 0x7115c557 0xd9e0c250 0x4d24a387 + 0x95f37451 0x338692e3 0x647f5c6b 0xc4e89994 + 0x5f552dc4 0x89079a11 0x460cbfdf 0xd2652f47 + 0xdd57ff68 0x0dd2ffe4 0x0ba525aa 0x31e2e225 + 0xc1fba237 0xba2447c1 0xb9f554ee 0xd9387061 + 0x543951a5 0xb6089667 0xcb1d01b5 0xec66da11 + 0x5639c0f9 0x373d0ef4 0x53581b5d 0xc24ba72a + 0x0e2ccdd6 0x5e7f9e6f 0xe0201507 0x8aee59b8 + 0x08c35a68 0x93ae2c80 0x1a32a759 0xeb853473 + 0x7e63ba72 0x187c7db4 0x6f698b12 0xecbfced2 + 0x0d8d15c7 0x074406b4 0x9ddd36e5 0x099082e9 + 0xe4aadf97 0x01723d8c 0x59066199 0x538271d4 + 0x7af12596 0xf2b7fa43 0x0eca2126 0xf6194325 + 0xb3e2025a 0x2ff5c9dd 0x9a77e22f 0x52086e4f + 0xb7e8bd4d 0x90c72c53 0x2bd8928c 0x8ca5855d + 0x9f898915 0x173e43e9 0x9bbe3d12 0x384ef9ef + 0x452319b7 0xbc040cd1 0x703c650a 0xcb65da27 + 0x66034c72 0x70d56086 0xb12f756f 0x25492f7a + 0x1c593374 0x3a579886 0xf082d898 0xf8dc037a + 0xd45eda9b 0xb1a2a2a2 0xc5f03ee4 0x56d21d3b + 0xb2b26117 0xdc561e6e 0x8898d15d 0x5de5daa2 + 0x0bee75c5 0xac3b4578 0xf3a75d7b 0x4e0f8347 + 0xe0eb24fd 0xa9469170 0x35ce0c5c 0x74219b52 + 0x8bd0c8f7 0xb5cd84dd 0x98bac3e1 0x9aba924b + 0x19e3ee9e 0x0d3bf514 0x2b2fd328 0x47c6084b + 0xd7fe9866 0x8767b2cd 0xabb314b3 0xdefc6e37 + 0x31555b34 0x687feab0 0x1583ef18 0x70c92033 + 0xe6bf756c 0xf765f10f 0xb7b87e32 0x79f605be + 0x4c42e879 0xff8afa4d 0x36ad291a 0x7cffb06d + 0x7ec9d636 0xdcdf2dec 0xd3a8432e 0x7eb77583 + 0xeed53dbd 0xa178b9d4 0x85680ccb 0x15cbb728 + 0x65d25cb1 0x1e5f1cc6 0x32d7add3 0x0d2c8941 + 0xb7049d9a 0x6acde4b3 0x90b17afb 0x481b6151 + 0xa6f981e1 0xcd466bac 0xd28da681 0x0e1fe5ad + 0x8c15eaaf 0x82ca6cc6 0xd94f3a84 0x0abacfcb + 0xd8846fa0 0xb026ac09 0xfc947434 0x9380a723 + 0x9cab000a 0x575030fc 0x10634e19 0xc0d9ce62 + 0x0b3b8303 0x4359fd8a 0xf5dcc1bb 0x3e977300 + 0x681eacdb 0xb6c71eb7 0x71091ed9 0x644e7dcc + 0x9477da03 0x6c63c913 0xe0092603 0x3795d8bc + 0xe0a1eb1e 0xd2b70b75 0xc88a33b7 0x6a7f7f94 + 0xb3b1a895 0x4a32fdcd 0xda58e610 0xff3d2e17 + 0xa7d8b293 0x0e656a23 0xae671b1f 0xbb054522 + 0x7e41733a 0x83f84dd7 0xa5336e2a 0xf854b99f + 0x6695add6 0xc9a1df2d 0x6d5812ab 0x0ba66d9c + 0xbabaddc3 0x48b7416d 0x16bfa9ab 0xc84c227c + 0xc0e5394e 0x59e5eb4a 0xeed26fc2 0x6e1a811f + 0xf7e53bb7 0xd3104000 0xdec8eefc 0x7ff6b7bf + 0xd2677945 0x53b2a359 0xddb118ec 0xcfe0e0cd + 0xdccd7b6d 0xb3d71b5d 0xcef8518b 0x519be194 + 0xa58d8183 0x7f8cfea8 0xc8ac18f1 0x3511d390 + 0x4c6c5774 0xe9c5c986 0xdd8c2ac7 0xe6d7a259 + 0x6eb90668 0x77542650 0xba343d0a 0x994d8541 + 0x3d3ef48c 0xd6ae1127 0x9bc381e8 0x0a83a841 + 0xc56b846b 0xd2b05a9d 0xe79b14f2 0xf51d0a36 + 0x95791126 0x7baab402 0x6b0d95e1 0x1a275ddb + 0x39f53b9f 0x2ce8ff88 0xc01aeac4 0xec535e5f + 0x3827d4aa 0xf62e268c 0x6a069baf 0x1c2d87f0 + 0x11f08c17 0xdfab8da1 0x4962cb4a 0x0faff7ae + 0x0a73e186 0x0ce79d52 0xa35ad594 0x3ca44ced + 0xad35d996 0x4e90e6d1 0x68af0ac7 0xa866a665 + 0xba5420fe 0x440f36c8 0xf3a05cd1 0x42d925d2 + 0x355a4d16 0x3cbe6190 0xeb0a3ad9 0xb0283dbe + 0x6e6a87cf 0x4f34ee24 0xfdf93d66 0x18d77c49 + 0xced0c573 0x0e546aaf 0x557b511e 0x083c4cb6 + 0x4a0def79 0x84f303a1 0xd8d6896d 0x4f489dba + 0xbb77a0e7 0x137b4b37 0x4d4ec3f6 0x67d69767 + 0xca495a59 0x67d64a7e 0x5508c504 0x607a8c61 + 0x85894432 0x679a59f6 0x5e0bbbcd 0x3020ab69 + 0x5f82d53c 0x5edc4ca9 0x0de12d4d 0x6110948d + 0x19b32565 0x786f8a39 0x1deea5da 0x3c76c5a8 + 0xcdecd0c6 0xd4a2da42 0x195a1946 0x7636ebad + 0xc8350338 0x8e58aa25 0xc1880b7a 0xcc3400cb + 0x16d9390b 0x4ebb864a 0x66c56674 0xbe6d21c1 + 0xa539b9e0 0x607fb2c0 0xe9c0fa11 0xfc48169d + 0x7fbe8e6d 0x2a604636 0x0af25fd7 0x6bacb48e + 0xa1b6bc06 0xfa14057c 0xc7cdcc76 0x25fccb3e + 0x2c7a471d 0x7a167c84 0xa095f155 0xe70827e6 + 0x0352b136 0x09324b83 0xad3202ff 0x62962ee7 + 0x7003fd3d 0x1165f945 0x0cefca06 0x79d61619 + 0xce7d5448 0xaac42add 0x0b9f6b05 0x56ce5e02 + 0xb0ceac2b 0xe123be16 0x91b3225a 0xb270c869 + 0xe012966e 0xff796d3f 0xf342882c 0xed63fe08 + 0xac7ef0ee 0x9e2bfb86 0xa30080f2 0xc2f43b42 + 0x605fac6d 0x588d43a3 0x0f5f1c22 0x396b7482 + 0x8a2dd0e4 0x8422c5e1 0xb08657fc 0x931ed316 + 0xcc30d191 0x7fc6e305 0x271885d3 0xc88212fe + 0x8e8e3d7c 0xc1792b10 0x41a5303d 0xb690f3b0 + 0xc39ee3b6 0x96cede0b 0xc1382ec6 0x49267fc7 + 0x022738df 0xd1701f67 0x65d8aa02 0x8885b81f + 0x729a6eab 0xa9534a99 0x861d0933 0x277d9600 + 0x9a5a05ab 0xb9eb0bd1 0xad6760e0 0x72c2ef2e + 0x634f7b50 0xc26d77a6 0xe9b154d3 0xde3b33f5 + 0x213d64dc 0x6c243758 0x0bb289f7 0x217b8136 + 0xdc0095dd 0x188eeec7 0xb6ce8c31 0xf91074ce + 0x645ec280 0xb80a25fb 0xa86e0d99 0xe6286d6a + 0x5dd6b6f2 0x5243d686 0xb3f9634a 0x65d3fdaa + 0x5e868aa4 0x3039d124 0xbb8088a3 0x96870f96 + 0xc61274d3 0x35c317d3 0x05c58b64 0x7672442f + 0x02c72a1b 0xac258d31 0x86a8288f 0x071e12b4 + 0x9d038beb 0xf6fbbb2b 0x6ed7b5f3 0xc4f9fcdc + 0xf5ef49eb 0xfc5ebeae 0x43e4c4ff 0x5acc83d3 + 0xfc96ffed 0x90651cc8 0x18221103 0xe6a3f1d8 + 0xdf47a32a 0xb27b35bb 0x232aae32 0xd00be32b + 0x0849ab0f 0x0958ca28 0x91b6ca97 0xf984b343 + 0xaffa535d 0x123e77e7 0xf7e209ea 0x59174d7e + 0x68ee5e17 0xa8795f95 0x59a2199a 0x18091ea0 + 0x67b706d5 0x2bd6edb9 0x35cc965f 0xe0f9a923 + 0x495f7a6c 0xacad111d 0xa0c8ab69 0x300e7abb + 0x7383b901 0x5f389445 0x59abce2d 0x680369f0 + 0x8548c495 0x572ec514 0x1dd71294 0xafb52e6b + 0x9ec9177e 0xdbac3f44 0x1a12a547 0xd6251878 + 0xcf3f77a7 0xa571c92b 0xbd4d31ad 0x2a791fda + 0xb57bbe1c 0xdf3dc778 0xe68410fb 0xbff32015 + 0x7249e6cb 0xf57ff26a 0x9c49fa78 0x0988e756 + 0x2df657f1 0x56d59cd7 0x740d63b3 0xf193e10f + 0x155f523a 0x700736b8 0xeb79fcb9 0x65c419c1 + 0xea6c4e9c 0xe0d26e79 0x3abfa57e 0x9260c9bb + 0xbb2aab7f 0xbb14db51 0x89b26f39 0x7ffeb19b + 0x87c58bb7 0x4a821ea1 0xd0c77e0e 0x88a85e93 + 0x6e8131cd 0x19adffe6 0xfaeef425 0x99de85cd + 0xf29cdfc4 0xa42b5f32 0x742fe930 0xafaf2832 + 0x192fb41d 0x0c463d86 0x9815f049 0x2ec74d39 + 0x02814cf3 0xa724f39b 0x48e3ba20 0x96efa18b + 0xe1c9837f 0xa2d372c8 0x6b5abfa2 0x6595ce3a + 0xebcfc193 0xd07bda68 0xc3fc6ff6 0xf35a617c + 0xf6454a9d 0x887a767a 0xc6631983 0x7f01a27d + 0x817c6ab2 0xa34c3f76 0xd8f47831 0xc2e565fa + 0x93d3fcec 0x88c3e6fb 0x9d1743a3 0x833c8fd5 + 0x0fa12d7e 0x186d6353 0x74af27ed 0x9262576c + 0xb4904c37 0xe97ff03b 0x179051a6 0xe76ae3e7 + 0x0c0ccc23 0xb51bf186 0x68ecfae6 0xd7826d06 + 0x57f7740f 0x9352b1f4 0x2194c680 0x20edef77 + 0xf8fa25bd 0x00e30bd2 0x8164d603 0x74690299 + 0xb6748634 0x7e0945e7 0x8f94c14c 0x8ab50139 + 0x7bbe4cba 0x321184c7 0xf6eeea60 0x74ee1aa2 + 0x13271f47 0x29c7ed4e 0x320a94eb 0xd74cdb9e + 0xd617b96a 0x80333a88 0xb1f1da0c 0xb227c317 + 0xb2be59ed 0x8aa71728 0x37b60fad 0x0456f28a + 0xc9e07783 0xc6fc5381 0x5b6fd04d 0xf86034c5 + 0xf8d11346 0x2bcb1e88 0x00586361 0x25f66131 + 0x7942512a 0x5994973a 0x2e6f8180 0x792b3aa4 + 0xd3570bbe 0xb980c388 0x6bbac1d6 0xc2c958bb + 0x9a471500 0xbb4dd7a2 0x172aa1f6 0x1169027f + 0x6e2c7b1b 0xa2762787 0xd7a129d2 0xd48aa1a8 + 0xe4cad492 0x50ce92ed 0x0d94c689 0x6e132b53 + 0x13a9d0d1 0xb9c28b76 0xa1197ca0 0xb44a11d0 + 0x81fb3038 0xa41dfbee 0xff252eb8 0x6ce0df62 + 0xd71c1715 0x96770f3d 0x179b7736 0x6cac1bec + 0xc7cf8ea0 0x0f39262a 0xe51dbe11 0x34988c38 + 0xd56f75bb 0x0aefa928 0xaf5fc582 0x736d1002 + 0xbc07bacf 0x7fe2dadf 0xdea78951 0xb8d00e1c + 0xb2a2ccb3 0xb54a0519 0x7595a849 0x56b6ee9a + 0x389b1bc3 0xf4444795 0xf62bc28f 0x199ff3d8 + 0x4d82bdb7 0x8ebbfafa 0xb4d9e422 0x6b420bdb + 0x03191e66 0x3047f236 0x233de214 0xcdc8877d + 0x236cb79e 0x0fb239e5 0x1320ae46 0x6696a576 + 0xc26025bb 0x8bb094c5 0x85cc50b0 0xfa907646 + 0x8c9551a9 0xaa21fa1f 0x610dc418 0x6c4b4339 + 0x0179104b 0x0ee75662 0x11223470 0x46aa52c5 + 0x64d190da 0x0d21a99c 0x3de332aa 0x003d1e21 + 0xc7169b4e 0xfa926f18 0xa4c095fd 0xa9b19bea + 0xd388621d 0x7c27d919 0x2fa0e38e 0x99724539 + 0xd6a58e6b 0xf82acceb 0x07b11f3f 0x983e3ef2 + 0xe50bc4a1 0x519d45c9 0x3cf98ca4 0xf9d27135 + 0x5abf4d7c 0xc25777f7 0x4a1ed0aa 0xd9b90d97 + 0x1d1cc73a 0x79d1fa78 0x3cbbb84f 0x38a9bb70 + 0x6fe5ed83 0x71e96161 0x0d837c8d 0x0dad9b82 + 0xe6b8210a 0x63743d39 0xab76202c 0xe5d04da7 + 0x606e3794 0x3105d51c 0x726cef1a 0xa7689844 + 0x4ff57f92 0xf74852bd 0x53776432 0x0c18aaba + 0x6451a4a2 0xd79fdeda 0xe93e4f6e 0x199fb742 + 0x9a96c23f 0x00507b8d 0x7d64fb14 0x7e0ec4b1 + 0x6bb78854 0x026e1374 0xe2401e35 0x50f60683 + 0x095eb3bd 0xb2a061e5 0x5639f5c0 0x0e59d4d8 + 0x07a00a41 0xfb6255c8 0x6a51bc29 0xcbf61ff4 + 0xeca26823 0xd3848606 0xffafa5df 0xdf589c9b + 0xdbb81eec 0x421b063a 0x0a89e58b 0x660e9041 + 0x975328aa 0x9cea68a0 0xbedc93a1 0x2efb7f9f + 0x9751aa80 0xc7d173e4 0xbccc1b80 0x45ef35c4 + 0xcb762a58 0x21382865 0x52154f8d 0xb0a46943 + 0xb658fb6f 0x9f70699d 0x219d98c4 0xffb51a3c + 0xdb12adeb 0x670933ac 0x9ff86734 0x5c7e4f26 + 0xad69be04 0xd874314b 0x2b244637 0xb7d599c2 + 0x01a634c1 0x94529f7a 0x19d3ec4a 0x34421551 + 0x80715a0a 0xb2bdefad 0x37f13bfb 0xad39c855 + 0x81e03a33 0xb83972ac 0x7754de96 0x1625563c + 0xf7439a81 0x643ba9f0 0xcfc91790 0xbe960ad9 + 0x6bbd6a95 0x2dd914be 0x1db5f0bf 0xbd4fbc54 + 0x3c2d587b 0x18ad16d0 0xe992eab9 0x25184a40 + 0xc448ad96 0x600bc301 0x4a761bb7 0x2230e8c5 + 0xdfa3d66b 0xed52d799 0x6001a5db 0x76aee68a + 0xb9344897 0x85f9437b 0x7a333059 0xa3a87d63 + 0x463b8d49 0x895954ff 0xbf4b6e63 0x68bdf536 + 0xe8e022ab 0x9537a15b 0xbb928b33 0x1e20fd8b + 0x7553cfd7 0x6b2cf5e0 0xa01c8127 0x9f0d42a1 + 0x9e4c596e 0xa805f5c5 0x9dc7ff08 0x41c920ed + 0x018142b9 0x524c4b06 0x2fdbaa5e 0x1f55f01a + 0x78aff861 0xf412e1f5 0x634be8b9 0xb35b72cf + 0x652e2aa0 0xfaab7bc0 0x00eb703f 0x69f5d306 + 0x254128c8 0x239861a6 0xb4449272 0xa6fa0fd2 + 0x46f25a02 0x9cf57227 0x740a13ed 0x07d81a8d + 0x66342f60 0x0235484c 0x7c5184a9 0x849788af + 0x6c071f18 0x4edbe7c2 0xd1ddbe21 0x1f74304f + 0x799756f7 0xbf746dec 0x8f876f8c 0x498e0528 + 0xfae16a3b 0xa4546101 0xaf3e9bd8 0x86338967 + 0x02c84849 0x2d9f3572 0x7c6e58bd 0x58e5adef + 0xd7ebf566 0x5639904d 0x3a57c7b7 0xf067bf98 + 0xb5a6c6a9 0x152d6531 0x908f1ac7 0x6dc67c74 + 0xd483a80c 0x855b7ab4 0x417a3f7b 0x54526563 + 0xfb6fb861 0x370bc285 0x44acf8e2 0x3e08232a + 0x3dc911e6 0xb7362054 0x31a78230 0x01fec5db + 0xe23fa0d7 0x021435fb 0x7b5121aa 0xb4558a95 + 0xb2208b86 0x87fff4a9 0x8ee2fdaa 0xf7170909 + 0x8658fc90 0x7cc2ff89 0xc0465813 0xffff5751 + 0xe0e6dfad 0x5fe00d42 0x92f14f4c 0x8f2d1b50 + 0x6b320beb 0xed5dab57 0xe88610db 0xe9fb76ab + 0xf0910917 0xf3e9bf3d 0x0949c21c 0xea3a2edb + 0x32a955ff 0xc5a59efb 0x5babd7b5 0x5f6cf0d1 + 0x720a191f 0x2d79a1ba 0x788d6ce9 0xe6585b57 + 0xbf41d206 0xbbc34488 0xb216304e 0x0e4dfd32 + 0xcd9df645 0x76c91a2d 0x4a1623ca 0x20d0f0eb + 0x505fb401 0x3bbe87e3 0x59138510 0xa032e5b0 + 0x4c4bd1fd 0xa19bc006 0x57faf36f 0x24aeb37b + 0x9dfe2e39 0xa3918228 0x12ed3f76 0x1adc7868 + 0x52d54b6f 0x3b3bb87e 0x04217038 0x2ccca010 + 0x3dfe7d32 0x515a26ab 0x061deda8 0x8750ec31 + 0xda25aedb 0x63630030 0xfc45346b 0x21aba1c5 + 0xb4904998 0x749d2e6b 0x0f1909d3 0x132a6862 + 0x754eabce 0xa55c0618 0x5cd98176 0xb96737ff + 0xd8b05179 0x9c8e3da4 0x97f2e2e3 0xb61429ff + 0xbbdc939c 0x4aec61d9 0x4faf0e89 0x4f6cd1f4 + 0x10b5f482 0xd99b668c 0xe7ec4f14 0xd74e81f6 + 0xcd33f1de 0xd0f94d9d 0xc810f619 0xd8fbcc7e + 0xb6280ea7 0x0d382991 0xdbc5b115 0x6fd8f0f0 + 0xf55341e7 0x91e21353 0x17f9dc9b 0x37a575b7 + 0x6fc85088 0x6d0a7996 0x9827385e 0x4f623d15 + 0xc91112bf 0x80a59bf3 0xa9bb9866 0x16380b9d + 0xf8b5bfbc 0x054d65d4 0x6aae53ae 0xb25c9b40 + 0x5dcbbd8f 0x6ff8db9e 0x15158a2f 0xcdc10109 + 0x25e42ded 0x2fdea368 0xb7be3ccc 0x7b34ca65 + 0x97ad2729 0xcd32c218 0xedf23b2a 0x46693400 + 0xb84e3dca 0x40e671d5 0x5e0f7ce7 0xa94b7ae6 + 0xbe35d5d1 0x760d210b 0x9fd65609 0x6e36daa5 + 0xe56a2654 0x441641f5 0x673013fe 0xa65f7ff6 + 0x06500fa9 0x0b822091 0xa1d6851e 0x0b7a49df + 0x5c2b0f82 0x7ee49fd1 0xb4e85e7a 0x9d999c6f + 0x530758ac 0xd40876bc 0xe68ec478 0x4a84397e + 0x295fdf21 0xfacf7dea 0x509fe59c 0x7bc7ae8b + 0xe7e858f7 0x68050a7e 0xc88e0538 0x7da5cd9b + 0x41f64aff 0xc4b52ce6 0x0f2da494 0x74c60878 + 0x263f4e91 0xc6087f9c 0xe3fab089 0x2e15f961 + 0x03494236 0xa92f04da 0x99c18104 0x8612d706 + 0x50acaea4 0xd499bdc0 0x34cbe2a6 0xc9cfe5c4 + 0x487ccac6 0x756461b7 0xdd495436 0xadd5d979 + 0x9a9b3224 0x5b09e765 0x6d333eaa 0x1f9e7406 + 0x3c96a504 0x8fcd07e5 0x0c0578d2 0xcdce6073 + 0xa4bf4a2c 0x7d2f610b 0x8b1055b6 0x35b73bdb + 0x80b8fdc0 0xc5e5b334 0x932b95c2 0xa73a9bc9 + 0x391d05e7 0x7b4f34e3 0xe51f2431 0xe58e958c + 0x87cce4dd 0xf3300188 0xb3d528fd 0x2b855db1 + 0x4acbd783 0xc06ff27b 0x363c9e2d 0xf30403ab + 0x0b935c43 0x0dc7ebc5 0x316b4108 0xebdfac89 + 0x3ee8c912 0x8c9605aa 0xd8675a9e 0x481bac3b + 0xabc0325d 0xa8090333 0xaade994b 0x35cd1e8f + 0x98d7d180 0x8fbf0767 0x0c56bb25 0x285b14b9 + 0x2e3be447 0xb675ea9d 0x306ffe95 0xb767b19f + 0xdd02ef7a 0xd1b3f4ab 0x419dd098 0x49190362 + 0xd2a5d71e 0x88859a3a 0x618af917 0x06c10947 + 0x4362174f 0x98162338 0x09113545 0x25fea1e1 + 0x97c50ea2 0x1c222ff8 0xc142bda2 0x12004e77 + 0x5b0a3ac3 0x39a45dd0 0xa24ad6df 0xf48e542f + 0x9599ab56 0x6f857a2b 0x27cc03d4 0x69d4cc80 + 0x8c86b444 0xbd9d2f64 0xc0b8ea5c 0x636606a4 + 0x01d28968 0x3f6bdf13 0xe1673b48 0xcb14f95a + 0xc22b6c13 0x9abd6d91 0xb8ad10b5 0x424014e2 + 0x6b2057b6 0x40fb28d5 0xcf9edea5 0xd5582ab7 + 0xd2df8dff 0x2d19d5f5 0x6451bdab 0xad3872f1 + 0xdf1734da 0x71726dc7 0x8c13b61e 0x46d87bfb + 0xf0c4b8a3 0xe1b6913e 0x12eae34d 0xbfbe9831 + 0xe57174e5 0x72ff6118 0xd30e2c10 0xfdd503b3 + 0x7b305e6e 0xe1e1905d 0x5e0a883e 0x29cd08c3 + 0x25527858 0x9af006a7 0xf4d55499 0xdb5ed0b2 + 0x23826a83 0x949220f0 0x3dff8dca 0x0e843e66 + 0xf7d7a997 0xc3787919 0x43696ab9 0x66976447 + 0x859f3c9f 0x6ced7846 0xf7a459d3 0x8466d520 + 0xcef6f6cc 0x06d820a4 0x82bf0302 0x1511d393 + 0x08f0e990 0xeb88a7ca 0x8c552ada 0x55ed0dbe + 0xc8b687c9 0xd6161b47 0x9b87ec3c 0x76e64faf + 0x9bfe9a55 0x9ab7e327 0xef4ae25b 0x7257088b + 0x7776149e 0x8acce20d 0xf832a123 0xc516ee31 + 0xca07c786 0x2459b81d 0x140e0c0d 0x367db85d + 0x3bffab4c 0x2078946d 0xc934f40f 0x0d76c5c5 + 0x8d44882a 0xc6b1f0cd 0x546cd8b3 0x9c74ae80 + 0x980a4149 0xf8ca5118 0xa0e15063 0x97124c50 + 0x5286a809 0x736150f3 0xa48956b8 0x7695795a + 0xe02c0cbf 0x8a53d5f0 0xf714f228 0xdfb54386 + 0x7d9c8120 0xb72bcd71 0x5776b2bd 0xd44edd72 + 0xc24545c8 0xeeea089a 0xce6f3216 0xc242432d + 0x9c8c00ab 0xeb4c2000 0xefc993a9 0x76c0c3b7 + 0x34852175 0x9db64eb1 0xcfcc18f7 0x675e1eb8 + 0x53fc55ff 0xadbb0b97 0x451a2fda 0x3d336f25 + 0xa8f5f01f 0xa561b62e 0x90ef3703 0x6e65e157 + 0xee079b4a 0x2e4ff5ac 0xeaab1797 0x4c71bbb5 + 0xa6f79217 0xe8d7cd81 0x0624a162 0xf7991f76 + 0x973a2a07 0x3ed92be2 0x03ec00f1 0x91a7e0c8 + 0xf7451136 0x4752e136 0x6a38e92e 0x0d9e431d + 0xf78d8bea 0xe1fb4a67 0xa15d3be3 0x68086923 + 0x8c2ad79f 0x7a3cddf7 0xe8f075ed 0x31308caf + 0xfffb8a19 0xba0e0192 0x06e94877 0xcc4488dd + 0xf6ffaf00 0xc16ad424 0xf095df90 0xa42a0cdd + 0xaa0421ce 0x20463ee2 0x15922b14 0x86819d76 + 0xa821c16e 0x469c30dd 0x9bb8b07f 0xdcaf1680 + 0x548970f3 0xbe393dce 0x50664752 0x3070829e + 0x297aa70c 0x1ea3f37d 0x1597ca4f 0xa2d49ac5 + 0x2d4426bb 0xce3c8a3f 0xa39ee081 0x87969194 + 0x316a8c95 0x82895006 0xab8d9832 0xe96c273a + 0x57f10802 0xd36783cf 0xbfa33b16 0x07961517 + 0x81d565f2 0x544bd8aa 0x5d36a963 0xdc00af80 + 0x01807f25 0x0dfd2d77 0xf1ec7e36 0x96aaa6da + 0x105c6a0f 0x1df5acd5 0xe5c27278 0xf68b7079 + 0x2b650fc4 0xcac72bf6 0x962a9522 0xfacdff5c + 0x3f5ab5fa 0xb95652cf 0x020ede27 0x4795ceda + 0xcf78db92 0x205e00fa 0x5381c93e 0xe5c34716 + 0x7a3986e3 0x10059b03 0xee2f2cb0 0xb9ec2804 + 0xff9f887e 0xf98b9dc3 0xdccdfaad 0x0bcaf264 + 0x83cc2aa8 0x6492cfba 0xd5286e65 0x7b4b0153 + 0x3c594a01 0x087dae43 0x0f665e4e 0x428f546b + 0x8c291cbd 0xb06ce4fa 0x913398b2 0x9ec46154 + 0x21bed0c4 0x619594ae 0x44d419e7 0x7488e8b9 + 0x04b619ae 0x4636dfc8 0x60ab5413 0xab587fe4 + 0xac7a824f 0x8c4c3483 0xe03a23c0 0xecc61821 + 0x97f5e393 0x81025b1b 0x0f48dc0d 0xb6177cfb + 0x4e8dad6f 0x9191ae1d 0x218ed709 0xee75ca53 + 0x4df8c4b9 0xce540161 0x513f117f 0xff2e3333 + 0xedf68b2e 0x020f969a 0xf47e28f4 0x998b4b49 + 0xe51fd08b 0xb7a3bae0 0xff90cd39 0xf87efd12 + 0xdd8716f4 0x35f5bf62 0x361b8b7e 0xb714da0b + 0xce9f177d 0x1d16af9f 0x6646b103 0xb0ec56b3 + 0x0d192b3f 0x43668438 0x2a44a3b9 0x6af8564c + 0x7a85ad05 0x959c7854 0x3372d43a 0xbc442739 + 0x757d7f0b 0x56eda728 0x5a4fa815 0xc6df021b + 0x94f08dbc 0x88096982 0x8508397a 0xa9e4bba1 + 0x53d371dc 0xe0f0266d 0xd50d6686 0x1c8a2423 + 0x0c7a51b1 0x9fd0d8d9 0x3460fc63 0x8ce7b265 + 0xf03c63f9 0xbb9edb97 0xfdaa9a7b 0xd8281335 + 0xb8139d8c 0xb0a2b778 0x0bf660fd 0x94978ef9 + 0xab719015 0x4c65c585 0x2dbfb09f 0x01e570f8 + 0x57494752 0xc73cf0e2 0xc96c969f 0xa3720a39 + 0x69b09650 0x5e5616d6 0xcfc498cc 0xed8b9984 + 0xef3762e7 0xab56bea7 0x0409058a 0x6dcded2e + 0x54703a03 0xcdeea095 0x7a4552c9 0xff570e49 + 0x4f41930a 0x6bbee57e 0xd637b631 0x0e9da0a4 + 0xd02ecd00 0x5e6b109a 0x01356db5 0x31a1fef4 + 0x92665fa0 0x45d7a450 0x25fbae53 0x0d2ba9ef + 0x813e5181 0xccb91b2d 0x1e4f4d66 0xa414439a + 0x1d64caea 0x34d11aa9 0x7a74f4ad 0xd37c3b14 + 0xce81ad7d 0x04e6f9f5 0x123b8579 0x1e9d7869 + 0x5e8e4230 0xc54e32ca 0xe578cc0f 0xca6f3ec5 + 0xb3b7354d 0x3e729731 0xd3a67568 0xb037e3d4 + 0xcf106830 0x435366eb 0x34f3877a 0x768eb454 + 0x3996cabc 0xf75e0197 0xfb9f48f7 0x56751351 + 0x3ae2003a 0x0aa20116 0xe94261a5 0x86663fcf + 0x98d211e0 0xce0c0412 0xa97053c3 0x1c4d33f0 + 0x2c5dadf3 0xf9908b0e 0xc460e9a3 0x4c369445 + 0xab7fc6b2 0xeae2fdb9 0xc077c114 0xd1d137ff + 0x87f2af9c 0xec7ff39f 0xe0d0dd65 0x4056afa3 + 0xaf148be5 0xf211eb20 0x51eebb92 0x1f0708ea + 0x677930a7 0x7948c640 0x828a04cd 0x55cb7bc6 + 0xd0616d79 0x7c44642f 0x30fe3b36 0x2dcc7194 + 0xdcabc9ff 0x51aed4ad 0x0145f869 0xd82d0fa0 + 0x9206ba41 0x28e26a08 0x7a229c39 0xb97b85f5 + 0xe607c481 0x25d289fb 0xda5b13be 0x5ec82846 + 0x1e5b0716 0xff9b4ebd 0xf46cd510 0xad24837b + 0x62c67b10 0xc46a5a14 0xe23c84bb 0x37eeb2c3 + 0xdd6fe432 0x21fffbeb 0xef79f8f7 0xf80c12e9 + 0x2b69a807 0xf97831db 0x6eb12a25 0xae8aa1a1 + 0x8c97fd5f 0xd00a930c 0x5cabc5b9 0x4af113f3 + 0xdf3a260a 0xe55c9e4a 0x81bf0c20 0x330e7651 + 0x9bfc46dc 0xf87440bc 0xfe187c45 0x672eb3a4 + 0xf7de1d6b 0x6031a4c7 0x55a50174 0xaff41f12 + 0x26ca70d5 0x824b8396 0x958c7022 0x38a73ce0 + 0x491cbe0d 0x32ddda3d 0xff33cc7c 0x611090e6 + 0xdc0fd6b1 0xad2ea10d 0x3079126b 0xa6b7a1a8 + 0xb0d17458 0xa810c54d 0xcadacc10 0xd71f26c6 + 0x0d641f9a 0x74fb3008 0x042ed388 0x97cb23a4 + 0x46c147ab 0xaaa22296 0x63b85c64 0xdf1de1de + 0xbd426ea8 0x02feabf9 0x4e880ae9 0xe3c9f7d8 + 0xace7000e 0x0bd04b97 0x6faee32a 0x689676b3 + 0x654aaf12 0xb9fc6881 0x097034d2 0x98cbb76e + 0x18ed7d3d 0x5b9092a9 0x5b9b63cc 0x5c430f07 + 0x575297d7 0x3db1149a 0x283ca860 0x49d6753f + 0x93024c8e 0x22e0fa36 0xc6506f01 0x061aa1d1 + 0xec5a5637 0xf4fd13f0 0x063c3f57 0x3c254361 + 0x9daa76e4 0x68f1b15f 0x377794db 0x591dcb8e + 0xec348007 0xba29de34 0x485e35a6 0xdd00d226 + 0xa41fd95e 0xc29e20fe 0x960e7ff0 0xcdde850c + 0xaa2648dc 0x0e16d6bc 0x67e7fa58 0xb74cbc3a + 0x6c76533e 0xe6654f45 0x2b026d8e 0x87b719cd + 0xaf550f29 0x642dd61f 0x5626cd8a 0x729832ca + 0x9a5209ec 0x7ca92e53 0x92967783 0x8b683023 + 0x7230e183 0x2b46a17d 0x72ed9b62 0x8c3153d5 + 0x104b27a5 0x3a885152 0xa43ba8bc 0x0e38f466 + 0x550ebfc6 0x61aff7b4 0x7a48222e 0x4b1cb5f9 + 0x6214db4e 0x10184d25 0xfffd5568 0x082c65bf + 0x0de275b4 0x9db1d249 0x21948675 0x5a172a34 + 0x3ba61149 0xc843cbfe 0xf6e573a1 0x0aa69e59 + 0x643338ad 0xd14f414b 0xf0d93cc7 0xb2e2bac1 + 0xee2134ff 0xd2dcf80e 0x2f1b6a51 0x70925db3 + 0x30d2fa78 0x9d3c7564 0x49c0e04e 0x4fe8fa3e + 0x0f452a33 0x97fef85d 0xd6657569 0xb1c9f85e + 0x64aefba6 0xe1c08a12 0xa62951f9 0xcd3bf51c + 0x83514304 0x3fca58b0 0x6e083a1a 0x0fc56295 + 0xeae9908c 0x234fdfa0 0x5b153453 0x2628c616 + 0x13320f68 0xf7e8d3ec 0x136f83b3 0x824bb8fb + 0x63ca453e 0x834cce39 0xe792bc39 0xa567a0a1 + 0x7007c69d 0x9fe0329b 0x2bcba778 0xef681fcd + 0x1d26dd8c 0xac0f8fa8 0x4999ceb3 0x61164783 + 0x59343833 0x996d2444 0xcc4f9ccc 0xed898d1f + 0xb6b075bc 0x157a5bd1 0x7fab1605 0x3d55f3ec + 0xfb1dab64 0x43c51e43 0xddffd435 0xce1d1dbe + 0x689aec3c 0x6bfef5c9 0xad16f248 0x8c45d521 + 0x339ce8b4 0xa1c26fdf 0xe82ca875 0xb8d27297 + 0x84eef050 0x6cd69df8 0x953bf91a 0x01db2bc8 + 0x4a204142 0x2a85a038 0xe263a583 0x3f9e57cc + 0x4affc364 0xdb89a455 0x41e4f309 0x7cf4e647 + 0xd39ebc0e 0xd63ea965 0x382028bd 0xcaf7843a + 0xcba1aee9 0x962a38ba 0x64447f0b 0x22dac282 + 0xd724cd08 0x5b417c1f 0x5b2b5908 0x867ed01f + 0xef226386 0x20e7130c 0x1f9b12ab 0xb07b30ad + 0xdd75d29d 0x09eb3647 0x06294756 0xefe36da0 + 0x0d601f05 0x11f98b78 0xc8134be8 0x04b69ec6 + 0x6df37e2a 0xeb0d9335 0xf7b87d27 0xff234b32 + 0xdc7d9fc9 0xe0b92f02 0x11aa6f37 0x42310d88 + 0xe64b36e0 0x2069733d 0x4c1b80fe 0xb6269ec7 + 0x02c85bb1 0xc63c207a 0xe3ce412e 0x90cc4eaf + 0x88330bf0 0xba4c2e47 0x9efac5f5 0xea829249 + 0xd4373cae 0x1dc54d9c 0x18b04744 0x4ec0f396 + 0xad95f8db 0x14732778 0x812632c8 0x12a39947 + 0x2497f5a1 0x940abdcd 0x4b340eaf 0xbb52e0fc + 0x6992bbde 0x3180705b 0x5f15dda6 0x7ee9a828 + 0x5dd3a447 0xb81da4bc 0x898c4ed4 0xd4cfa48e + 0x3e648720 0xa061535c 0x38b0d519 0x714ea4e1 + 0x6558aaba 0x2e5d9832 0x32b10cb3 0x12f74683 + 0x8a2d1272 0x8bfea89d 0xb9b0d38a 0xc62060b8 + 0x4d6c0796 0xdde515af 0x4e69b74e 0xf9e066cb + 0x1178ccc0 0x8c49629f 0xb18e62f7 0x82570fb4 + 0x679990e3 0xeac06852 0x845ad85e 0x66fcdced + 0xcc8bab2a 0x4cccd967 0xa909d3da 0x16f2b84f + 0xff70b687 0x8e964680 0x3e490510 0xcc15ff7a + 0xffb0a318 0x30085e27 0x0c6294e7 0xf092ff84 + 0x1e8ae3ef 0xd9f4135f 0x4eeb655b 0x0b133b0e + 0x0da4c728 0x8a9ee7d2 0x7b0579a9 0xac385286 + 0x5c9ac211 0xb0674a9c 0xe533403a 0x4dced95c + 0x035f6f44 0xec76b93e 0xfb6db00d 0xa4ab917d + 0xae515afe 0xaac11faa 0x78bafa84 0x5a67e774 + 0xd2c3b6b8 0x6708f12b 0x867c2e37 0x826e1ee4 + 0x4b4ba1a4 0x4d93d7cc 0xb82afd9d 0xfa715ef8 + 0x17de030b 0x2e1a71ab 0xb567360c 0xfd8f16c1 + 0x5160138f 0xd9384a40 0x345b1c4b 0x058993ea + 0x3fcae8d7 0x4dc2e776 0x327b2dd1 0xe7d1d383 + 0xfa10dfcb 0x5ba3c956 0x54db7d48 0x37fb2526 + 0x055a1158 0x7796bad7 0xbd5a4832 0x33f01c7f + 0xf5fc6313 0xa7298449 0x43b6e7ce 0xfd3d144a + 0x087127c7 0xb11d0a54 0x792d388f 0x477ad5e6 + 0x7cff7375 0x17a424ab 0x4e798c03 0xae4b553d + 0x02c30177 0x82f30375 0x98b98ed7 0x8f741f98 + 0x7e777486 0x6ad3d150 0x1c2a0d72 0x3ea2735a + 0xd5d5116c 0x9d12505a 0x70a402b1 0x615c72a7 + 0x637f3650 0x99b10cb4 0x6a0de436 0x15621e35 + 0x61194a84 0xd34ee0d7 0xfdd70d84 0x8aca1c6d + 0xfac6878e 0xfa7b5771 0x3022330f 0xa7ed23ee + 0xe9763f69 0xc4d38e3c 0xa5fc726a 0xde7dbc91 + 0x65ad5383 0x7f7ad77f 0x8516fbc9 0x9623d563 + 0xcf8685c5 0x59f21315 0xc1b6b1d0 0x15eecc50 + 0x9009f44b 0x7a2a8ad7 0x766a354e 0x59a6b09d + 0x4cca7284 0xf6ef4ec7 0x388c54e5 0x3d34a34c + 0x49a780a3 0xc7a8bbfc 0xf25d8bec 0xf6a390f2 + 0x1cc94fda 0xf37f034e 0x2be39e36 0x760d4f1e + 0xdfcd71e7 0x55ed5a16 0x0bb9b028 0xe533d067 + 0x033f76bd 0x8ee3d55b 0xa3e59542 0x4fdb93a2 + 0xb47a605f 0xd0a02253 0x948c4cc9 0x4dededec + 0x715c7873 0x88bfe017 0x11095c7f 0x0f71d898 + 0x25837d56 0x8a276147 0xd09ff4b8 0x2c4fae22 + 0x2730915b 0xbb1fda31 0xd5cc59a8 0xd8dc28f6 + 0x12f2080c 0x4ad77d75 0x223648a3 0x73abafa4 + 0xfc9554f8 0x4cbaae79 0xdffe60f7 0x0a98e937 + 0xa8a8af70 0xd3cc1f77 0xae09e4ab 0x14f0caa3 + 0x63b21bc6 0x0a086fdf 0xa1a7b1a1 0x3314cbd4 + 0xb1732177 0x842a7e12 0x37ed7860 0x720daee9 + 0x2eeb8d06 0xb0098553 0x8cca4537 0x2a1c4180 + 0xf1f10adc 0x66d21bbf 0xdae7b1dd 0x030f8be5 + 0x184ef28c 0x4a1082b0 0xf5f73b3f 0x2bc852bc + 0x1893287c 0x7e1c6291 0x8272ba61 0x2aef57e0 + 0xec90742c 0xf9d46e63 0x85e84eef 0xd32c10c2 + 0xfa96b003 0x0fa221a7 0x9bdee2e2 0x9cee99df + 0x4071e863 0x3b4af098 0x15148a99 0xd525d447 + 0x1e8be181 0x73cd75fd 0x2f1e91da 0x9c7531a1 + 0x23c109e6 0x5172cf8b 0x69ca62a0 0x754c25f1 + 0xfa3a0cca 0x6201622b 0xc7cd058f 0x5d5ee3f5 + 0xda0a4d69 0xcded309c 0x5bd1fc91 0x1fa74d7c + 0x65bb3381 0x0811c460 0xbe6efec8 0x41edba24 + 0xe2237b32 0xbded2338 0xe923a277 0x90732deb + 0x73820616 0x53fd3be6 0x30df290f 0x0529d627 + 0x5216acf0 0x0df2f5e6 0xb7aae7fe 0x77a86a6e + 0x216c1fb6 0xde9d0bca 0x4c38b816 0x803cab8e + 0x4653e80d 0xe5323d3d 0x98336658 0xe9330b0b + 0xf5d154d1 0x2574745c 0x0b8b22e4 0x01cb6d85 + 0x7fd416a7 0xa74c5c80 0x1752811d 0x3fcfa0d8 + 0x1740f342 0x298908ba 0x8acda280 0x63fe7f51 + 0x697caa20 0x46772da7 0x6a2f5e16 0x8d56e593 + 0xed1df3f8 0x8a8f59d1 0x7660da2f 0x805c1ba3 + 0xf2b7438d 0xc175237d 0xb7e4002a 0x38cf4010 + 0xd7884e26 0x60e3abc8 0x3e3ce1df 0xb90f753b + 0xc3836140 0x2724bc78 0xd1014b33 0x7aad6cc2 + 0x502bb788 0x3cd6c11b 0xca0e8132 0x23a5f680 + 0x7fa541a1 0x2c73ce32 0x266d5568 0x26dca072 + 0xc0e425dd 0x04241fa6 0x102e59e1 0xc1ac9846 + 0x59e6807d 0xf7dd1309 0x4bf082da 0x43cd88b7 + 0x5628e73d 0xd244c48b 0x7bc83d1d 0xc0fb8023 + 0xd0d24f43 0x27c17ca3 0x486f80a5 0xae90bd2b + 0xbe4e4d0c 0xba06936a 0xd95432ac 0x84fcced7 + 0xa70c8cc9 0xc6b18bea 0xe01f8516 0x658ac202 + 0x63443276 0xc3626cac 0x0dceb29b 0xba20f2e7 + 0xaf50a259 0x1f7332f4 0x43885c55 0xf5dbfbb0 + 0x3174f3c4 0x5081d664 0x9309dab9 0xd2ef2193 + 0xbf01e367 0x44eac6f6 0x5a639230 0x53edebd1 + 0x15581102 0x785a8122 0xea11c074 0x04003b30 + 0x45c97b31 0xb5fdff79 0x16ed5a0f 0xb2ab6eaf + 0x524d6293 0x73df9c8d 0x1a6d65d5 0x442d7abc + 0x4f260f88 0x3078b81d 0x87e6b52d 0xc3bad689 + 0x55093e7d 0x9fdbb5b3 0xb805940d 0xbe18f822 + 0xfd262e29 0xc9eb61b4 0xabddb5a6 0x3ef2e4a6 + 0xfb8c082a 0xd6b8c59f 0xa710b259 0x36dd9814 + 0xaffee9e4 0xb7f3471a 0xbb9356fc 0x44600752 + 0x374907e2 0xfafc6297 0x20fd0007 0x05f324c3 + 0xa2037e3a 0x10ab66c7 0xe44175a1 0xaa4ee6bc + 0xe45a8ce6 0x020af65b 0x5e059ff8 0x98cc3cf1 + 0x06019b96 0x6d1c1922 0xdd0a2e8d 0x86837333 + 0x1a3e36d3 0x17e2e5f2 0xb32ef76b 0x559915a2 + 0xf9c22b32 0x079ee5dc 0x7a3d401a 0x60a10dd4 + 0x053758ce 0x2e005b70 0x3685e353 0xf4b6460b + 0xc7d789c8 0xc8ea82f2 0x8fc74f86 0x9f68e92d + 0x5a1e00ed 0xd0e8fada 0x197640c3 0xeaa6e62a + 0x023a7169 0xcc7fb17b 0x98dac1fe 0xe6c807a6 + 0x0560e399 0x9fb5e511 0x0882c18e 0xf4d767f0 + 0xb508a6e8 0xd27d2026 0x4681cbc7 0xadd7f6ba + 0x35f47df4 0xc72245c5 0x8e8b8a74 0xeb94e799 + 0x8396bff2 0x6c2bf652 0x1562b482 0x5e1d2d57 + 0xdff1c004 0xa29b50e6 0xff880a97 0x7fc22f15 + 0x89633cb9 0xd0ab4601 0xe7341887 0xc07bb55e + 0x71eb0aaa 0x4c0f2ba5 0xa7801724 0xf43a7964 + 0x434daf5a 0x68eedb3c 0x194eca3d 0x0bbfeeba + 0x67850a32 0xd23b1ae1 0xa6911d9b 0xce700d81 + 0x783928d1 0xae5c120d 0x71fa13b0 0x2006c22b + 0xf72f5d3d 0x1cd744de 0x0d9fc67f 0xafe8d24a + 0x82b5142f 0x2bbf5368 0x17959168 0x09655f9d + 0xcab7fad9 0x51e66c7a 0x2420988f 0x847754b5 + 0x0a4974ae 0xfa654071 0xcc725340 0x6fa4583a + 0xca3082e7 0xc0f9ce55 0xd7d2cadb 0x79a92e96 + 0x22298333 0x57c27396 0xc74fa5e2 0x4afe8a75 + 0xcf697c69 0x4f76031d 0x4621473c 0xad0abf11 + 0xc82cd007 0x2bbad261 0x39318b1c 0xdcb0e1a8 + 0x31ea902c 0x6e550361 0x784be9d0 0xb14a31e3 + 0xca23cfd2 0xa43e7604 0x72ebff4c 0xed80ec25 + 0x43baaa63 0x880434aa 0x36a6e985 0xc173ddfc + 0x11f1dd14 0xc7ee29ec 0xaebdcf8a 0x4c8445d5 + 0xaa772022 0x024d91b3 0x048082d0 0xcbaefb3d + 0x4b09b3a9 0x12cf71ef 0x7db43f55 0x93cdd0c1 + 0xa076bad7 0xb46de6fa 0x417dc418 0x324da83a + 0xff365817 0x155f3cdd 0xdac35be4 0x2fd2c82c + 0x11f1bc33 0xedce1813 0x6d7c9f85 0x5c114653 + 0x01c57aae 0x1b96107d 0xe1c9f66d 0xaea3a907 + 0xa884e213 0xf8f98e65 0x91532420 0x01ef2298 + 0x497045c1 0xce8fdb4c 0x27eb66f4 0x4f55e3f0 + 0xba804764 0x26bda14f 0xc9f7f582 0x36bc7f36 + 0x34c2aa75 0xe4f15089 0xb8f9ee73 0xd4266b10 + 0x0fc54a15 0x5aa528c9 0xf8dfec8a 0x508cea6b + 0x22b419f8 0xcf53de4d 0xbbd7e283 0xa14d1b71 + 0x9c32638c 0x1e361701 0x95b3f6bd 0x71ade23c + 0x7dbdaf13 0x703136d9 0xb50676c0 0x1275e5b3 + 0x15efee34 0x3389309d 0xab961f5d 0xf381dc6b + 0x20ade074 0xce316743 0x79d44d92 0x1d4fe039 + 0x6cfce315 0xb13ec789 0xf1a3d756 0x82ae906d + 0x26ef851b 0xd2ca8f32 0xadd6ac28 0x3bce1e22 + 0x2de58e91 0xa0e69d86 0x0a66678e 0x0556a657 + 0x19206ec1 0x078b1a5b 0x06a676bb 0x89e164b8 + 0xc37e2fb4 0x1a4dd1dd 0xea609b2d 0x4a5cab06 + 0x8a0e5f3a 0x5f92a2d8 0x150ac669 0x3dccaa31 + 0x9e0296b6 0xf351dbf1 0x5cfca2f5 0x73e865f8 + 0x078c8312 0xf50254ac 0xc9064d4a 0x4f7176d3 + 0x3effaf99 0xe134aa8f 0xb4601dc4 0x2ba07197 + 0x7bae54f0 0xdf72f3ed 0x867c5d82 0x732c07e3 + 0x24e20500 0x287fc531 0x96166ac1 0x97543ef5 + 0xed62f87e 0xfaa76a7c 0xed4ba778 0x4e115af9 + 0xa11b36aa 0xcff391a1 0xf27a1aed 0x171a552f + >;
arch/x86/dts/microcode/mc0306d4_00000018.dtsi new file +944 -0
944 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 51/69 x86: broadwell: Add a few microcode files
Quoted 11 lines · Simon Glass
Add two microcode files for broadwell.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/microcode/m7240651_0000001c.dtsi | 1328 +++++++++++++++++++++++++ arch/x86/dts/microcode/mc0306d4_00000018.dtsi | 944 ++++++++++++++++++ 2 files changed, 2272 insertions(+) create mode 100644 arch/x86/dts/microcode/m7240651_0000001c.dtsi create mode 100644 arch/x86/dts/microcode/mc0306d4_00000018.dtsi
PATCH 51/69 x86: broadwell: Add a few microcode files
Quoted 6 lines · Bin Meng
Quoted 5 lines · Simon Glass
Add two microcode files for broadwell.
Signed-off-by Simon Glass <[email protected]>---
Quoted 8 lines
Quoted 6 lines
arch/x86/dts/microcode/m7240651_0000001c.dtsi | 1328 +++++++++++++++++++++++++ arch/x86/dts/microcode/mc0306d4_00000018.dtsi | 944 ++++++++++++++++++ 2 files changed, 2272 insertions(+) create mode 100644 arch/x86/dts/microcode/m7240651_0000001c.dtsi create mode 100644 arch/x86/dts/microcode/mc0306d4_00000018.dtsiAcked-by Bin Meng <[email protected]>
applied to u-boot-x86/next, thanks!
PATCH 52/69 x86: broadwell: Add a PCH driver
In reply to Simon GlassAdd a driver for the broadwell low-power platform controller hub.
---
arch/x86/cpu/broadwell/Makefile | 2 + arch/x86/cpu/broadwell/iobp.c | 144 ++++++++ arch/x86/cpu/broadwell/pch.c | 540 ++++++++++++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/pch.h | 153 +++++++++ 4 files changed, 839 insertions(+) create mode 100644 arch/x86/cpu/broadwell/iobp.c create mode 100644 arch/x86/cpu/broadwell/pch.c create mode 100644 arch/x86/include/asm/arch-broadwell/pch.h
arch/x86/cpu/broadwell/Makefile +2 -0
@@ -5,3 +5,5 @@ # obj-y += cpu.o +obj-y += iobp.o +obj-y += pch.o
arch/x86/cpu/broadwell/iobp.c new file +144 -0
144 lines not on this page · raw message
arch/x86/cpu/broadwell/pch.c new file +540 -0
540 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/pch.h new file +153 -0
153 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 52/69 x86: broadwell: Add a PCH driver
Quoted 5 lines · Simon Glass
Add a driver for the broadwell low-power platform controller hub.
Signed-off-by Simon Glass <[email protected]>---
Quoted 9 lines
arch/x86/cpu/broadwell/Makefile | 2 + arch/x86/cpu/broadwell/iobp.c | 144 ++++++++ arch/x86/cpu/broadwell/pch.c | 540 ++++++++++++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/pch.h | 153 +++++++++ 4 files changed, 839 insertions(+) create mode 100644 arch/x86/cpu/broadwell/iobp.c create mode 100644 arch/x86/cpu/broadwell/pch.c create mode 100644 arch/x86/include/asm/arch-broadwell/pch.h
Except several nits about "GPL-2.0+" and capital letters for the __asm_arch_pch_h, generally it looks good, so
PATCH 53/69 x86: broadwell: Add a pinctrl driver
In reply to Simon GlassGPIO pins need to be set up on start-up. Add a driver to provide this, configured from the device tree.
The binding is slightly different from the existing ICH6 binding, since that is quite verbose. The new binding should be just as extensible.
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/pinctrl_broadwell.c | 278 +++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/gpio.h | 91 +++++++ .../gpio/intel,x86-broadwell-pinctrl.txt | 208 +++++++++++++++ include/dt-bindings/gpio/x86-gpio.h | 12 + 5 files changed, 590 insertions(+) create mode 100644 arch/x86/cpu/broadwell/pinctrl_broadwell.c create mode 100644 arch/x86/include/asm/arch-broadwell/gpio.h create mode 100644 doc/device-tree-bindings/gpio/intel,x86-broadwell-pinctrl.txt
arch/x86/cpu/broadwell/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-y += cpu.o obj-y += iobp.o obj-y += pch.o +obj-y += pinctrl_broadwell.o
arch/x86/cpu/broadwell/pinctrl_broadwell.c new file +278 -0
278 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/gpio.h new file +91 -0
91 lines not on this page · raw message
doc/device-tree-bindings/gpio/intel,x86-broadwell-pinctrl.txt new file +208 -0
208 lines not on this page · raw message
include/dt-bindings/gpio/x86-gpio.h +12 -0
@@ -28,4 +28,16 @@#define PULL_STR_2K 0#define PULL_STR_20K 2 +#define ROUTE_SCI 0 +#define ROUTE_SMI 1 + +#define OWNER_ACPI 0 +#define OWNER_GPIO 1 + +#define PIRQ_APIC_MASK 0 +#define PIRQ_APIC_ROUTE 1 + +#define TRIGGER_EDGE 0 +#define TRIGGER_LEVEL 1 +#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 53/69 x86: broadwell: Add a pinctrl driver
Quoted 9 lines · Simon Glass
GPIO pins need to be set up on start-up. Add a driver to provide this, configured from the device tree.
The binding is slightly different from the existing ICH6 binding, since that is quite verbose. The new binding should be just as extensible.
Signed-off-by Simon Glass <[email protected]>---
Quoted 10 lines
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/pinctrl_broadwell.c | 278 +++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/gpio.h | 91 +++++++ .../gpio/intel,x86-broadwell-pinctrl.txt | 208 +++++++++++++++ include/dt-bindings/gpio/x86-gpio.h | 12 + 5 files changed, 590 insertions(+) create mode 100644 arch/x86/cpu/broadwell/pinctrl_broadwell.c create mode 100644 arch/x86/include/asm/arch-broadwell/gpio.h create mode 100644 doc/device-tree-bindings/gpio/intel,x86-broadwell-pinctrl.txt
Except several nits about "GPL-2.0+" and capital letters for the __asm_arch_gpio, generally it looks good, so
PATCH 54/69 x86: broadwell: Add a SATA driver
In reply to Simon GlassAdd a SATA driver for broadwell. This supports connecting an SSD and the usual U-Boot commands to read and write data.
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/sata.c | 269 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 arch/x86/cpu/broadwell/sata.c
arch/x86/cpu/broadwell/Makefile +1 -0
@@ -8,3 +8,4 @@ obj-y += cpu.o obj-y += iobp.o obj-y += pch.o obj-y += pinctrl_broadwell.o +obj-y += sata.o
arch/x86/cpu/broadwell/sata.c new file +269 -0
269 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 54/69 x86: broadwell: Add a SATA driver
Quoted 11 lines · Simon Glass
Add a SATA driver for broadwell. This supports connecting an SSD and the usual U-Boot commands to read and write data.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/sata.c | 269 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 arch/x86/cpu/broadwell/sata.c
Except several nits about "GPL-2.0+", generally it looks good, so
PATCH 55/69 x86: broadwell: Add a northbridge driver
In reply to Simon GlassAdd a driver for the broadwell northbridge. This sets up the location of several blocks of registers.
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/northbridge.c | 59 ++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 arch/x86/cpu/broadwell/northbridge.c
arch/x86/cpu/broadwell/Makefile +1 -0
@@ -6,6 +6,7 @@ obj-y += cpu.o obj-y += iobp.o +obj-y += northbridge.o obj-y += pch.o obj-y += pinctrl_broadwell.o obj-y += sata.o
arch/x86/cpu/broadwell/northbridge.c new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 55/69 x86: broadwell: Add a northbridge driver
Quoted 11 lines · Simon Glass
Add a driver for the broadwell northbridge. This sets up the location of several blocks of registers.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/northbridge.c | 59 ++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 arch/x86/cpu/broadwell/northbridge.c
Except several nits about "GPL-2.0+", generally it looks good, so
PATCH 56/69 x86: broadwell: Add an LPC driver
In reply to Simon GlassAdd a driver for the broadwell LPC (low-pin-count peripheral). This mostly uses common code.
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/lpc.c | 77 +++++++++++++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/lpc.h | 32 +++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 arch/x86/cpu/broadwell/lpc.c create mode 100644 arch/x86/include/asm/arch-broadwell/lpc.h
arch/x86/cpu/broadwell/Makefile +1 -0
@@ -6,6 +6,7 @@ obj-y += cpu.o obj-y += iobp.o +obj-y += lpc.o obj-y += northbridge.o obj-y += pch.o obj-y += pinctrl_broadwell.o
arch/x86/cpu/broadwell/lpc.c new file +77 -0
77 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/lpc.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* From coreboot soc/intel/broadwell/include/soc/lpc.h +* +* Copyright (C) 2016 Google Inc. +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#ifndef _asm_arch_lpc_h +#define _asm_arch_lpc_h + +#define GEN_PMCON_1 0xa0 +#define SMI_LOCK (1 << 4) +#define GEN_PMCON_2 0xa2 +#define SYSTEM_RESET_STS (1 << 4) +#define THERMTRIP_STS (1 << 3) +#define SYSPWR_FLR (1 << 1) +#define PWROK_FLR (1 << 0) +#define GEN_PMCON_3 0xa4 +#define SUS_PWR_FLR (1 << 14) +#define GEN_RST_STS (1 << 9) +#define RTC_BATTERY_DEAD (1 << 2) +#define PWR_FLR (1 << 1) +#define SLEEP_AFTER_POWER_FAIL (1 << 0) +#define GEN_PMCON_LOCK 0xa6 +#define SLP_STR_POL_LOCK (1 << 2) +#define ACPI_BASE_LOCK (1 << 1) +#define PMIR 0xac +#define PMIR_CF9LOCK (1 << 31) +#define PMIR_CF9GR (1 << 20) + +#endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 56/69 x86: broadwell: Add an LPC driver
Quoted 4 lines · Simon Glass
Add a driver for the broadwell LPC (low-pin-count peripheral). This mostly uses common code.
Signed-off-by Simon Glass <[email protected]>
Quoted 9 lines
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/lpc.c | 77 +++++++++++++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/lpc.h | 32 +++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 arch/x86/cpu/broadwell/lpc.c create mode 100644 arch/x86/include/asm/arch-broadwell/lpc.h
Except several nits about "GPL-2.0+" and capital letters for the _asm_arch_lpc_h, generally it looks good, so
PATCH 57/69 x86: broadwell: Add reference code support
In reply to Simon GlassBroadwell needs a special binary blob to set up the PCH. Add code to run this on start-up.
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/refcode.c | 108 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 arch/x86/cpu/broadwell/refcode.c
arch/x86/cpu/broadwell/Makefile +1 -0
@@ -10,4 +10,5 @@ obj-y += lpc.o obj-y += northbridge.o obj-y += pch.o obj-y += pinctrl_broadwell.o +obj-y += refcode.o obj-y += sata.o
arch/x86/cpu/broadwell/refcode.c new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 57/69 x86: broadwell: Add reference code support
Hi Simon,
Quoted 27 lines · Simon Glass
Broadwell needs a special binary blob to set up the PCH. Add code to run this on start-up.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/refcode.c | 108 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 arch/x86/cpu/broadwell/refcode.carch/x86/cpu/broadwell/Makefile +1
-0@@ -10,4 +10,5 @@ obj-y += lpc.o obj-y += northbridge.o obj-y += pch.o obj-y += pinctrl_broadwell.o +obj-y += refcode.o obj-y += sata.oarch/x86/cpu/broadwell/refcode.c new file +0
-0
arch/x86/cpu/broadwell/refcode.c line 7
Quoted 7 lines
arch/x86/cpu/broadwell/refcode.c new file +7
-0@@ -0,0 +1,108 @@ +/* +* Read a coreboot rmodule and execute it. +* The rmodule_header struct is from coreboot. +* +* Copyright (c) 2016 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+
Quoted 8 lines
arch/x86/cpu/broadwell/refcode.c new file +8
-0+*/ + +#include <common.h> +#include <errno.h> +#include <asm/arch/pei_data.h> + +#define RMODULE_MAGIC 0xf8fe +#define RMODULE_VERSION_1 1
arch/x86/cpu/broadwell/refcode.c line 25
Quoted 10 lines
arch/x86/cpu/broadwell/refcode.c new file +10
-0+ +/* +* All fields with '_offset' in the name are byte offsets into the flat blob. +* The linker and the linker script takes are of assigning the values. +*/ +struct rmodule_header { +uint16_t magic; +uint8_t version; +uint8_t type; +/* The payload represents the program's loadable code and data. */
nits: remove ending .
arch/x86/cpu/broadwell/refcode.c line 28
Quoted 3 lines
arch/x86/cpu/broadwell/refcode.c new file +3
-0+uint32_t payload_begin_offset; +uint32_t payload_end_offset; +/* Begin and of relocation information about the program module. */
nits: remove ending .
arch/x86/cpu/broadwell/refcode.c line 35
Quoted 7 lines
arch/x86/cpu/broadwell/refcode.c new file +7
-0+uint32_t relocations_begin_offset; +uint32_t relocations_end_offset; +/* The starting address of the linked program. This address is vital +* for determining relocation offsets as the relocation info and other +* symbols (bss, entry point) need this value as a basis to calculate +* the offsets. +*/
nits: please use correct multi-line comment format.
arch/x86/cpu/broadwell/refcode.c line 39
Quoted 4 lines
arch/x86/cpu/broadwell/refcode.c new file +4
-0+uint32_t module_link_start_address; +/* The module_program_size is the size of memory used while running +* the program. The program is assumed to consume a contiguous amount +* of memory. */
ditto.
arch/x86/cpu/broadwell/refcode.c line 41
Quoted 2 lines
arch/x86/cpu/broadwell/refcode.c new file +2
-0+uint32_t module_program_size; +/* This is program's execution entry point. */
nits: remove ending .
arch/x86/cpu/broadwell/refcode.c line 44
Quoted 3 lines
arch/x86/cpu/broadwell/refcode.c new file +3
-0+uint32_t module_entry_point; +/* Optional parameter structure that can be used to pass data into +* the module. */
nits: please use correct multi-line comment format.
arch/x86/cpu/broadwell/refcode.c line 47
Quoted 3 lines
arch/x86/cpu/broadwell/refcode.c new file +3
-0+uint32_t parameters_begin; +uint32_t parameters_end; +/* BSS section information so the loader can clear the bss. */
nits: remove ending .
arch/x86/cpu/broadwell/refcode.c line 50
Quoted 3 lines
arch/x86/cpu/broadwell/refcode.c new file +3
-0+uint32_t bss_begin; +uint32_t bss_end; +/* Add some room for growth. */
nits: remove ending .
Quoted 49 lines
arch/x86/cpu/broadwell/refcode.c new file +49
-0+uint32_t padding[4 ]; +} __packed; + +int cpu_run_reference_code (void ) +{ +struct pei_data _pei_data__aligned(8) ; +struct pei_data *pei_data = &_pei_data; + asmlinkage int (*func)(void *); +struct rmodule_header *hdr; +char *src, *dest; +int ret, dummy; +int size; + + hdr = (struct rmodule_header *)CONFIG_X86_REFCODE_ADDR ; +debug ("Extracting code from rmodule at %p\n" , hdr); +if (hdr->magic !=RMODULE_MAGIC ) { +debug ("Invalid rmodule magic\n" ); +return -EINVAL ; + } +if (hdr->module_link_start_address !=0 ) { +debug ("Link start address must be 0\n" ); +return -EPERM ; + } +if (hdr->module_entry_point !=0 ) { +debug ("Entry point must be 0\n" ); +return -EPERM ; + } + +memset (pei_data,'\0' ,sizeof (struct pei_data )); +broadwell_fill_pei_data (pei_data); +mainboard_fill_pei_data (pei_data); + pei_data->saved_data = (void *)&dummy; + + src = (char *)hdr + hdr->payload_begin_offset; + dest = (char *)CONFIG_X86_REFCODE_RUN_ADDR ; + + size = hdr->payload_end_offset - hdr->payload_begin_offset; +debug ("Copying refcode from %p to %p, size %x\n" , src, dest, size); +memcpy (dest, src, size); + + size = hdr->bss_end - hdr->bss_begin; +debug ("Zeroing BSS at %p, size %x\n" , dest + hdr->bss_begin, size); +memset (dest + hdr->bss_begin,'\0' , size); + + func = (asmlinkage int (*)(void *))dest; +debug ("Running reference code at %p\n" , func); +#ifdef DEBUG +print_buffer (CONFIG_X86_REFCODE_RUN_ADDR , (void *)func,1 ,0x40 ,0 ); +#endif
arch/x86/cpu/broadwell/refcode.c
Quoted 10 lines
arch/x86/cpu/broadwell/refcode.c new file +9
-1+ ret =func (pei_data); +if (ret !=0 ) { +debug ("Reference code returned %d\n" , ret); +return -EL2HLT ; + } +debug ("Refereence code completed\n" ); + +return 0 ; +} --
Regards,
Bin
PATCH 58/69 x86: broadwell: Add power-control support
In reply to Simon GlassBroadwell requires quite a bit of power-management setup. Add code to set this up correctly.
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/power_state.c | 89 +++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/pm.h | 129 +++++++++++++++++++++++++++++++ 3 files changed, 219 insertions(+) create mode 100644 arch/x86/cpu/broadwell/power_state.c create mode 100644 arch/x86/include/asm/arch-broadwell/pm.h
arch/x86/cpu/broadwell/Makefile +1 -0
@@ -10,5 +10,6 @@ obj-y += lpc.o obj-y += northbridge.o obj-y += pch.o obj-y += pinctrl_broadwell.o +obj-y += power_state.o obj-y += refcode.o obj-y += sata.o
arch/x86/cpu/broadwell/power_state.c new file +89 -0
89 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/pm.h new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 58/69 x86: broadwell: Add power-control support
Quoted 4 lines · Simon Glass
Broadwell requires quite a bit of power-management setup. Add code to set this up correctly.
Signed-off-by Simon Glass <[email protected]>
Quoted 9 lines
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/power_state.c | 89 +++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/pm.h | 129 +++++++++++++++++++++++++++++++ 3 files changed, 219 insertions(+) create mode 100644 arch/x86/cpu/broadwell/power_state.c create mode 100644 arch/x86/include/asm/arch-broadwell/pm.h
Except several nits about "GPL-2.0+" and capital letters for the __asm_arch_pm_h, generally it looks good, so
PATCH 59/69 x86: broadwell: Add support for SDRAM setup
In reply to Simon GlassBroadwell uses a binary blob called the memory reference code (MRC) to start up its SDRAM. This is similar to ivybridge so we can mostly use common code for running this blob.
---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/sdram.c | 307 +++++++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/pei_data.h | 177 ++++++++++++++ arch/x86/include/asm/global_data.h | 24 ++ 4 files changed, 509 insertions(+) create mode 100644 arch/x86/cpu/broadwell/sdram.c create mode 100644 arch/x86/include/asm/arch-broadwell/pei_data.h
arch/x86/cpu/broadwell/Makefile +1 -0
@@ -13,3 +13,4 @@ obj-y += pinctrl_broadwell.o obj-y += power_state.o obj-y += refcode.o obj-y += sata.o +obj-y += sdram.o
arch/x86/cpu/broadwell/sdram.c new file +307 -0
307 lines not on this page · raw message
arch/x86/include/asm/arch-broadwell/pei_data.h new file +177 -0
177 lines not on this page · raw message
arch/x86/include/asm/global_data.h +24 -0
@@ -19,6 +19,29 @@ enum pei_boot_mode_t { }; +struct dimm_info { +uint32_t dimm_size; +uint16_t ddr_type; +uint16_t ddr_frequency; +uint8_t rank_per_dimm; +uint8_t channel_num; +uint8_t dimm_num; +uint8_t bank_locator; +/* The 5th byte is '\0' for the end of string */ +uint8_t serial[5 ]; +/* The 19th byte is '\0' for the end of string */ +uint8_t module_part_number[19 ]; +uint16_t mod_id; +uint8_t mod_type; +uint8_t bus_width; +} __packed; + +struct pei_memory_info { +uint8_t dimm_cnt; +/* Maximum num of dimm is 8 */ +struct dimm_info dimm[8 ]; +} __packed; +struct memory_area {uint64_t start;uint64_t size;
@@ -59,6 +82,7 @@ struct arch_global_data {enum pei_boot_mode_t pei_boot_mode;const struct pch_gpio_map *gpio_map;/* board GPIO map */ struct memory_info meminfo;/* Memory information */ +struct pei_memory_info pei_meminfo;/* PEI memory information */ #ifdef CONFIG_HAVE_FSP void *hob_list;/* FSP HOB list */ #endif
Signature · 1 line
2.7.0.rc3.207.g0ac5344
PATCH 59/69 x86: broadwell: Add support for SDRAM setup
Hi Simon,
Quoted 30 lines · Simon Glass
Broadwell uses a binary blob called the memory reference code (MRC) to start up its SDRAM. This is similar to ivybridge so we can mostly use common code for running this blob.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/broadwell/Makefile | 1 + arch/x86/cpu/broadwell/sdram.c | 307 +++++++++++++++++++++++++ arch/x86/include/asm/arch-broadwell/pei_data.h | 177 ++++++++++++++ arch/x86/include/asm/global_data.h | 24 ++ 4 files changed, 509 insertions(+) create mode 100644 arch/x86/cpu/broadwell/sdram.c create mode 100644 arch/x86/include/asm/arch-broadwell/pei_data.harch/x86/cpu/broadwell/Makefile +1
-0@@ -13,3 +13,4 @@ obj-y += pinctrl_broadwell.o obj-y += power_state.o obj-y += refcode.o obj-y += sata.o +obj-y += sdram.oarch/x86/cpu/broadwell/sdram.c new file +0
-0
arch/x86/cpu/broadwell/sdram.c line 6
Quoted 6 lines
arch/x86/cpu/broadwell/sdram.c new file +6
-0@@ -0,0 +1,307 @@ +/* +* Copyright (c) 2016 Google, Inc +* +* From coreboot src/soc/intel/broadwell/romstage/raminit.c +* +* SPDX-License-Identifier: GPL-2.0
nits: GPL-2.0+?
Quoted 504 lines
arch/x86/cpu/broadwell/sdram.c new file +301
-0+*/ + +#include <common.h> +#include <dm.h> +#include <pci.h> +#include <syscon.h> +#include <asm/cpu.h> +#include <asm/io.h> +#include <asm/lpc_common.h> +#include <asm/mrccache.h> +#include <asm/mtrr.h> +#include <asm/pci.h> +#include <asm/sdram_common.h> +#include <asm/arch/iomap.h> +#include <asm/arch/me.h> +#include <asm/arch/pch.h> +#include <asm/arch/pei_data.h> +#include <asm/arch/pm.h> + +ulong board_get_usable_ram_top (ulong total_size) +{ +return sdram_common_board_get_usable_ram_top (total_size); +} + +void dram_init_banksize (void ) +{ +sdram_common_dram_init_banksize (); +} + +void broadwell_fill_pei_data (struct pei_data *pei_data) +{ + pei_data->pei_version =PEI_VERSION ; + pei_data->board_type =BOARD_TYPE_ULT ; + pei_data->pciexbar =MCFG_BASE_ADDRESS ; + pei_data->smbusbar =SMBUS_BASE_ADDRESS ; + pei_data->ehcibar =EARLY_EHCI_BAR ; + pei_data->xhcibar =EARLY_XHCI_BAR ; + pei_data->gttbar =EARLY_GTT_BAR ; + pei_data->pmbase =ACPI_BASE_ADDRESS ; + pei_data->gpiobase =GPIO_BASE_ADDRESS ; + pei_data->tseg_size =CONFIG_SMM_TSEG_SIZE ; + pei_data->temp_mmio_base =EARLY_TEMP_MMIO ; + pei_data->tx_byte = sdram_console_tx_byte; + pei_data->ddr_refresh_2x =1 ; +} + +static inline void pei_data_usb2_port (struct pei_data *pei_data,int port, +uint16_t length,uint8_t enable, +uint8_t oc_pin,uint8_t location) +{ + pei_data->usb2_ports[port].length = length; + pei_data->usb2_ports[port].enable = enable; + pei_data->usb2_ports[port].oc_pin = oc_pin; + pei_data->usb2_ports[port].location = location; +} + +static inline void pei_data_usb3_port (struct pei_data *pei_data,int port, +uint8_t enable,uint8_t oc_pin, +uint8_t fixed_eq) +{ + pei_data->usb3_ports[port].enable = enable; + pei_data->usb3_ports[port].oc_pin = oc_pin; + pei_data->usb3_ports[port].fixed_eq = fixed_eq; +} + +void mainboard_fill_pei_data (struct pei_data *pei_data) +{ +/* DQ byte map for Samus board */ +const u8 dq_map[2 ][6 ][2 ] = { + { {0x0F ,0xF0 }, {0x00 ,0xF0 }, {0x0F ,0xF0 }, + {0x0F ,0x00 }, {0xFF ,0x00 }, {0xFF ,0x00 } }, + { {0x0F ,0xF0 }, {0x00 ,0xF0 }, {0x0F ,0xF0 }, + {0x0F ,0x00 }, {0xFF ,0x00 }, {0xFF ,0x00 } } }; +/* DQS CPU<>DRAM map for Samus board */ +const u8 dqs_map[2 ][8 ] = { + {2 ,0 ,1 ,3 ,6 ,4 ,7 ,5 }, + {2 ,1 ,0 ,3 ,6 ,5 ,4 ,7 } }; + + pei_data->ec_present =1 ; + +/* One installed DIMM per channel */ + pei_data->dimm_channel0_disabled =2 ; + pei_data->dimm_channel1_disabled =2 ; + +memcpy (pei_data->dq_map, dq_map,sizeof (dq_map)); +memcpy (pei_data->dqs_map, dqs_map,sizeof (dqs_map)); + +/* P0: HOST PORT */ +pei_data_usb2_port (pei_data,0 ,0x0080 ,1 ,0 , +USB_PORT_BACK_PANEL ); +/* P1: HOST PORT */ +pei_data_usb2_port (pei_data,1 ,0x0080 ,1 ,1 , +USB_PORT_BACK_PANEL ); +/* P2: RAIDEN */ +pei_data_usb2_port (pei_data,2 ,0x0080 ,1 ,USB_OC_PIN_SKIP , +USB_PORT_BACK_PANEL ); +/* P3: SD CARD */ +pei_data_usb2_port (pei_data,3 ,0x0040 ,1 ,USB_OC_PIN_SKIP , +USB_PORT_INTERNAL ); +/* P4: RAIDEN */ +pei_data_usb2_port (pei_data,4 ,0x0080 ,1 ,USB_OC_PIN_SKIP , +USB_PORT_BACK_PANEL ); +/* P5: WWAN (Disabled) */ +pei_data_usb2_port (pei_data,5 ,0x0000 ,0 ,USB_OC_PIN_SKIP , +USB_PORT_SKIP ); +/* P6: CAMERA */ +pei_data_usb2_port (pei_data,6 ,0x0040 ,1 ,USB_OC_PIN_SKIP , +USB_PORT_INTERNAL ); +/* P7: BT */ +pei_data_usb2_port (pei_data,7 ,0x0040 ,1 ,USB_OC_PIN_SKIP , +USB_PORT_INTERNAL ); + +/* P1: HOST PORT */ +pei_data_usb3_port (pei_data,0 ,1 ,0 ,0 ); +/* P2: HOST PORT */ +pei_data_usb3_port (pei_data,1 ,1 ,1 ,0 ); +/* P3: RAIDEN */ +pei_data_usb3_port (pei_data,2 ,1 ,USB_OC_PIN_SKIP ,0 ); +/* P4: RAIDEN */ +pei_data_usb3_port (pei_data,3 ,1 ,USB_OC_PIN_SKIP ,0 ); +} + +static unsigned long get_top_of_ram (struct udevice *dev) +{ +/* +* Base of DPR is top of usable DRAM below 4GiB. The register has +* 1 MiB alignment and reports the TOP of the range, the base +* must be calculated from the size in MiB in bits 11:4. +*/ +u32 dpr, tom; + +dm_pci_read_config32 (dev,DPR , &dpr); + tom = dpr & ~((1 <<20 ) -1 ); + +debug ("dpt %08x tom %08x\n" , dpr, tom); +/* Subtract DMA Protected Range size if enabled */ +if (dpr &DPR_EPM ) + tom -= (dpr &DPR_SIZE_MASK ) <<16 ; + +return (unsigned long )tom; +} + +/** +* sdram_find() - Find available memory +* +* This is a bit complicated since on x86 there are system memory holes all +* over the place. We create a list of available memory blocks +* +* @dev: Northbridge device +*/ +static int sdram_find (struct udevice *dev) +{ +struct memory_info *info = &gd->arch.meminfo; +ulong top_of_ram; + + top_of_ram =get_top_of_ram (dev); +sdram_add_memory_area (info,0 , top_of_ram); + +/* Add MTRRs for memory */ +mtrr_add_request (MTRR_TYPE_WRBACK ,0 ,2ULL <<30 ); + +return 0 ; +} + +static int prepare_mrc_cache (struct pei_data *pei_data) +{ +struct mrc_data_container *mrc_cache; +struct mrc_region entry; +int ret; + + ret =mrccache_get_region (NULL , &entry); +if (ret) +return ret; + mrc_cache =mrccache_find_current (&entry); +if (!mrc_cache) +return -ENOENT ; + + pei_data->saved_data = mrc_cache->data; + pei_data->saved_data_size = mrc_cache->data_size; +debug ("%s: at %p, size %x checksum %04x\n" , __func__, + pei_data->saved_data, pei_data->saved_data_size, + mrc_cache->checksum); + +return 0 ; +} + +int reserve_arch (void ) +{ +return mrccache_reserve (); +} + +int dram_init (void ) +{ +struct pei_data _pei_data__aligned(8) ; +struct pei_data *pei_data = &_pei_data; +struct udevice *dev, *me_dev, *pch_dev; +struct chipset_power_state ps; +const void *spd_data; +int ret, size; + +memset (pei_data,'\0' ,sizeof (struct pei_data )); + +/* Print ME state before MRC */ + ret =syscon_get_by_driver_data (X86_SYSCON_ME , &me_dev); +if (ret) +return ret; +intel_me_status (me_dev); + +/* Save ME HSIO version */ + ret =uclass_first_device (UCLASS_PCH , &pch_dev); +if (ret) +return ret; +if (!pch_dev) +return -ENODEV ; +power_state_get (pch_dev, &ps); + +intel_me_hsio_version (me_dev, &ps.hsio_version, &ps.hsio_checksum); + +broadwell_fill_pei_data (pei_data); +mainboard_fill_pei_data (pei_data); + + ret =uclass_first_device (UCLASS_NORTHBRIDGE , &dev); +if (ret) +return ret; +if (!dev) +return -ENODEV ; + size =256 ; + ret =sdram_locate_spd (dev, size, &spd_data); +if (ret) +return ret; +memcpy (pei_data->spd_data[0 ][0 ], spd_data, size); +memcpy (pei_data->spd_data[1 ][0 ], spd_data, size); + + ret =prepare_mrc_cache (pei_data); +if (ret) +debug ("prepare_mrc_cache failed: %d\n" , ret); + +debug ("PEI version %#x\n" , pei_data->pei_version); + ret =sdram_common_init (dev, pei_data, true); +if (ret) +return ret; +debug ("Memory init done\n" ); + + ret =sdram_find (dev); +if (ret) +return ret; + gd->ram_size = gd->arch.meminfo.total_32bit_memory; +debug ("RAM size %llx\n" , (unsigned long long )gd->ram_size); + +debug ("MRC output data length %#x at %p\n" , pei_data->data_to_save_size, + pei_data->data_to_save); +/* S3 resume: don't save scrambler seed or MRC data */ +if (pei_data->boot_mode !=SLEEP_STATE_S3 ) { +/* +* This will be copied to SDRAM in reserve_arch(), then written +* to SPI flash in mrccache_save() +*/ + gd->arch.mrc_output = (char *)pei_data->data_to_save; + gd->arch.mrc_output_len = pei_data->data_to_save_size; + } + gd->arch.pei_meminfo = pei_data->meminfo; + +return 0 ; +} + +/* Use this hook to save our SDRAM parameters */ +int misc_init_r (void ) +{ +int ret; + + ret =mrccache_save (); +if (ret) +printf ("Unable to save MRC data: %d\n" , ret); +else +debug ("Saved MRC cache data\n" ); + +return 0 ; +} + +void board_debug_uart_init (void ) +{ +struct udevice *bus =NULL ; + +/* com1 / com2 decode range */ +pci_x86_write_config (bus,PCH_DEV_LPC ,LPC_IO_DEC ,1 <<4 ,PCI_SIZE_16 ); + +pci_x86_write_config (bus,PCH_DEV_LPC ,LPC_EN ,COMA_LPC_EN , +PCI_SIZE_16 ); +} + +static const struct udevice_id broadwell_syscon_ids[] = { + { .compatible ="intel,me" , .data =X86_SYSCON_ME }, + { .compatible ="intel,gma" , .data =X86_SYSCON_GMA }, + { } +}; + +U_BOOT_DRIVER (syscon_intel_me) = { + .name ="intel_me_syscon" , + .id =UCLASS_SYSCON , + .of_match = broadwell_syscon_ids, +};arch/x86/include/asm/arch-broadwell/pei_data.h new file +177
-0@@ -0,0 +1,177 @@ +/* +* From Coreboot soc/intel/broadwell/include/soc/pei_data.h +* +* Copyright (C) 2014 Google Inc. +* +* SPDX-License-Identifier: BSD-3-Clause +*/ + +#ifndef ASM_ARCH_PEI_DATA_H +#define ASM_ARCH_PEI_DATA_H + +#include <linux/linkage.h> + +#define PEI_VERSION 22 + +typedef void asmlinkage (*tx_byte_func)(unsigned char byte); + +enum board_type { +BOARD_TYPE_CRB_MOBILE =0 ,/* CRB Mobile */ +BOARD_TYPE_CRB_DESKTOP ,/* CRB Desktop */ +BOARD_TYPE_USER1 ,/* SV mobile */ +BOARD_TYPE_USER2 ,/* SV desktop */ +BOARD_TYPE_USER3 ,/* SV server */ +BOARD_TYPE_ULT ,/* ULT */ +BOARD_TYPE_CRB_EMBDEDDED ,/* CRB Embedded */ +BOARD_TYPE_UNKNOWN , +}; + +#define MAX_USB2_PORTS 14 +#define MAX_USB3_PORTS 6 +#define USB_OC_PIN_SKIP 8 + +enum usb2_port_location { +USB_PORT_BACK_PANEL =0 , +USB_PORT_FRONT_PANEL , +USB_PORT_DOCK , +USB_PORT_MINI_PCIE , +USB_PORT_FLEX , +USB_PORT_INTERNAL , +USB_PORT_SKIP , +USB_PORT_NGFF_DEVICE_DOWN , +}; + +struct usb2_port_setting { +/* +* Usb Port Length: +* [16:4] = length in inches in octal format +* [3:0] = decimal point +*/ +uint16_t length; +uint8_t enable; +uint8_t oc_pin; +uint8_t location; +} __packed; + +struct usb3_port_setting { +uint8_t enable; +uint8_t oc_pin; +/* +* Set to 0 if trace length is > 5 inches +* Set to 1 if trace length is <= 5 inches +*/ +uint8_t fixed_eq; +} __packed; + + +struct pei_data { +uint32_t pei_version; + +enum board_type board_type; +int boot_mode; +int ec_present; +int usbdebug; + +/* Base addresses */ +uint32_t pciexbar; +uint16_t smbusbar; +uint32_t xhcibar; +uint32_t ehcibar; +uint32_t gttbar; +uint32_t rcba; +uint32_t pmbase; +uint32_t gpiobase; +uint32_t temp_mmio_base; +uint32_t tseg_size; + +/* +* 0 = leave channel enabled +* 1 = disable dimm 0 on channel +* 2 = disable dimm 1 on channel +* 3 = disable dimm 0+1 on channel +*/ +int dimm_channel0_disabled; +int dimm_channel1_disabled; +/* Set to 0 for memory down */ +uint8_t spd_addresses[4 ]; +/* Enable 2x Refresh Mode */ +int ddr_refresh_2x; +/* DQ pins are interleaved on board */ +int dq_pins_interleaved; +/* Limit DDR3 frequency */ +int max_ddr3_freq; +/* Disable self refresh */ +int disable_self_refresh; +/* Disable cmd power/CKEPD */ +int disable_cmd_pwr; + +/* USB port configuration */ +struct usb2_port_setting usb2_ports[MAX_USB2_PORTS ]; +struct usb3_port_setting usb3_ports[MAX_USB3_PORTS ]; + +/* +* USB3 board specific PHY tuning +*/ + +/* Valid range: 0x69 - 0x80 */ +uint8_t usb3_txout_volt_dn_amp_adj[MAX_USB3_PORTS ]; +/* Valid range: 0x80 - 0x9c */ +uint8_t usb3_txout_imp_sc_volt_amp_adj[MAX_USB3_PORTS ]; +/* Valid range: 0x39 - 0x80 */ +uint8_t usb3_txout_de_emp_adj[MAX_USB3_PORTS ]; +/* Valid range: 0x3d - 0x4a */ +uint8_t usb3_txout_imp_adj_volt_amp[MAX_USB3_PORTS ]; + +/* Console output function */ +tx_byte_func tx_byte; + +/* +* DIMM SPD data for memory down configurations +* [CHANNEL][SLOT][SPD] +*/ +uint8_t spd_data[2 ][2 ][512 ]; + +/* +* LPDDR3 DQ byte map +* [CHANNEL][ITERATION][2] +* +* Maps which PI clocks are used by what LPDDR DQ Bytes (from CPU side) +* DQByteMap[0] - ClkDQByteMap: +* - If clock is per rank, program to [0xFF, 0xFF] +* - If clock is shared by 2 ranks, program to [0xFF, 0] or [0, 0xFF] +* - If clock is shared by 2 ranks but does not go to all bytes, +* Entry[i] defines which DQ bytes Group i services +* DQByteMap[1] - CmdNDQByteMap: [0] is CmdN/CAA and [1] is CmdN/CAB +* DQByteMap[2] - CmdSDQByteMap: [0] is CmdS/CAA and [1] is CmdS/CAB +* DQByteMap[3] - CkeDQByteMap : [0] is CKE /CAA and [1] is CKE /CAB +* For DDR, DQByteMap[3:1] = [0xFF, 0] +* DQByteMap[4] - CtlDQByteMap : Always program to [0xFF, 0] +* since we have 1 CTL / rank +* DQByteMap[5] - CmdVDQByteMap: Always program to [0xFF, 0] +* since we have 1 CA Vref +*/ +uint8_t dq_map[2 ][6 ][2 ]; + +/* +* LPDDR3 Map from CPU DQS pins to SDRAM DQS pins +* [CHANNEL][MAX_BYTES] +*/ +uint8_t dqs_map[2 ][8 ]; + +/* Data read from flash and passed into MRC */ +const void *saved_data; +int saved_data_size; + +/* Disable use of saved data (can be set by mainboard) */ +int disable_saved_data; + +/* Data from MRC that should be saved to flash */ +void *data_to_save; +int data_to_save_size; +struct pei_memory_info meminfo; +} __packed; + +void mainboard_fill_pei_data (struct pei_data *pei_data); +void broadwell_fill_pei_data (struct pei_data *pei_data); + +#endif arch/x86/include/asm/global_data.h +12
-0@@ -19,6 +19,29 @@ enum pei_boot_mode_t { }; +struct dimm_info { +uint32_t dimm_size; +uint16_t ddr_type; +uint16_t ddr_frequency; +uint8_t rank_per_dimm; +uint8_t channel_num; +uint8_t dimm_num; +uint8_t bank_locator; +/* The 5th byte is '\0' for the end of string */ +uint8_t serial[5 ]; +/* The 19th byte is '\0' for the end of string */ +uint8_t module_part_number[19 ];
arch/x86/include/asm/global_data.h enum pei_boot_mode_t { · line 43
Quoted 10 lines
arch/x86/include/asm/global_data.h +10
-0+uint16_t mod_id; +uint8_t mod_type; +uint8_t bus_width; +} __packed; + +struct pei_memory_info { +uint8_t dimm_cnt; +/* Maximum num of dimm is 8 */ +struct dimm_info dimm[8 ]; +} __packed;
I am thinking whether we can put these platform specific structures to somewhere else? It looks the broadwell is using different memory_info from ivybridge.
arch/x86/include/asm/global_data.h struct arch_global_data {
Quoted 13 lines
arch/x86/include/asm/global_data.h +2
-1+struct memory_area {uint64_t start;uint64_t size;@@ -59,6 +82,7 @@ struct arch_global_data {enum pei_boot_mode_t pei_boot_mode;const struct pch_gpio_map *gpio_map;/* board GPIO map */ struct memory_info meminfo;/* Memory information */ +struct pei_memory_info pei_meminfo;/* PEI memory information */ #ifdef CONFIG_HAVE_FSP void *hob_list;/* FSP HOB list */ #endif --
Regards,
Bin