By popular request, this is a patch to buildrom adding support for the AMD SimNow simulator. Basically, it patches LinuxBIOS to work around a few SimNow related quirks that are currently in the public version of SimNow. The quirks themselves have been reported, and hopefully will be fixed in future releases.
What is SimNow, and why does it rock, you might ask? SimNow (TM) is a processor simulator that we have developed at AMD. Its a great way to simulate the processor / chipset boot process and develop LinuxBIOS and payloads, because it features an integrated debugger, and its easy to fix when you brick the thing (just hit reset). There is a public version here:
http://developer.amd.com/simnow.jsp
For the more commercial customers out there, there is also a NDA version that has support for more processors (contact your friendly AMD representative for more information). I'll put this information on the wiki as well, for posterity.
Myles and other SimNow users - let me know if this works.
Thanks, Jordan
[BUILDROM] Add support for the AMD SimNow (TM) simulator
Add a build option and a patch against LinuxBIOS to allow the Serengeti-Cheetah platform to come up on its emulated self in the SimNow simulator.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com
Index: buildrom-devel/config/platforms/Config.in =================================================================== --- buildrom-devel.orig/config/platforms/Config.in +++ buildrom-devel/config/platforms/Config.in @@ -81,4 +81,13 @@ config PLATFORM_SERENGETI_CHEETAH depends VENDOR_AMD select PLATFORM endchoice + +config SIMNOW + bool "Build for the AMD SimNow (TM) emulator" + depends PLATFORM_SERENGETI_CHEETAH + default n + help + Say 'y' here to patch the build to work on an + emulated platform in the AMD SimNow (TM) simulator + endmenu Index: buildrom-devel/packages/linuxbios/generic-linuxbios.mk =================================================================== --- buildrom-devel.orig/packages/linuxbios/generic-linuxbios.mk +++ buildrom-devel/packages/linuxbios/generic-linuxbios.mk @@ -21,6 +21,10 @@ endif
LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/s-c-buildrom-payload.patch
+ifeq ($(CONFIG_SIMNOW),y) +LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/simnow.patch +endif + include $(PACKAGE_DIR)/linuxbios/linuxbios.inc
$(SOURCE_DIR)/$(LINUXBIOS_TARBALL): Index: buildrom-devel/packages/linuxbios/patches/simnow.patch =================================================================== --- /dev/null +++ buildrom-devel/packages/linuxbios/patches/simnow.patch @@ -0,0 +1,59 @@ +Index: svn/src/northbridge/amd/amdk8/raminit_f_dqs.c +=================================================================== +--- svn.orig/src/northbridge/amd/amdk8/raminit_f_dqs.c ++++ svn/src/northbridge/amd/amdk8/raminit_f_dqs.c +@@ -1987,6 +1987,16 @@ static inline void train_ram_on_node(uns + struct sys_info *sysinfox = ((CONFIG_LB_MEM_TOPK<<10) - DCACHE_RAM_GLOBAL_VAR_SIZE); + wait_till_sysinfo_in_ram(); // use pci to get it + ++ /* In SimNow, when we get to this point, CAR is disabled, so ++ * our stack pointer points to never-never land, andjust it. ++ */ ++ ++ __asm__ volatile ( ++ "subl %0, %%ebp\n\t" ++ "subl %0, %%esp\n\t" ++ ::"a"( (DCACHE_RAM_BASE + DCACHE_RAM_SIZE)- (CONFIG_LB_MEM_TOPK<<10) ) ++ ); ++ + if(sysinfox->mem_trained[nodeid] == 0x80) { + #if 0 + sysinfo->tom_k = sysinfox->tom_k; +Index: svn/src/mainboard/amd/serengeti_cheetah/Options.lb +=================================================================== +--- svn.orig/src/mainboard/amd/serengeti_cheetah/Options.lb ++++ svn/src/mainboard/amd/serengeti_cheetah/Options.lb +@@ -218,7 +218,7 @@ default CONFIG_USE_INIT=0 + ## + ## for rev F training on AP purpose + ## +-default CONFIG_AP_CODE_IN_CAR=1 ++default CONFIG_AP_CODE_IN_CAR=0 + default MEM_TRAIN_SEQ=1 + default WAIT_BEFORE_CPUS_INIT=1 + +Index: svn/src/mainboard/amd/serengeti_cheetah/cache_as_ram_auto.c +=================================================================== +--- svn.orig/src/mainboard/amd/serengeti_cheetah/cache_as_ram_auto.c ++++ svn/src/mainboard/amd/serengeti_cheetah/cache_as_ram_auto.c +@@ -338,16 +338,18 @@ void real_main(unsigned long bist, unsig + } + #endif + +-#if 1 + needs_reset = optimize_link_coherent_ht(); ++#if 0 ++ /* On SimNow, this causes issues - remove it for now */ + needs_reset |= optimize_link_incoherent_ht(sysinfo); ++#endif + + // fidvid change will issue one LDTSTOP and the HT change will be effective too + if (needs_reset) { + print_info("ht reset -\r\n"); + soft_reset_x(sysinfo->sbbusn, sysinfo->sbdn); + } +-#endif ++ + allow_all_aps_stop(bsp_apicid); + + //It's the time to set ctrl in sysinfo now;
On 11/9/07, Jordan Crouse jordan.crouse@amd.com wrote:
By popular request, this is a patch to buildrom adding support for the AMD SimNow simulator. Basically, it patches LinuxBIOS to work around a few SimNow related quirks that are currently in the public version of SimNow. The quirks themselves have been reported, and hopefully will be fixed in future releases.
What is SimNow, and why does it rock, you might ask? SimNow (TM) is a processor simulator that we have developed at AMD. Its a great way to simulate the processor / chipset boot process and develop LinuxBIOS and payloads, because it features an integrated debugger, and its easy to fix when you brick the thing (just hit reset). There is a public version here:
http://developer.amd.com/simnow.jsp
For the more commercial customers out there, there is also a NDA version that has support for more processors (contact your friendly AMD representative for more information). I'll put this information on the wiki as well, for posterity.
Myles and other SimNow users - let me know if this works.
It doesn't work for me yet. 1. It still resets (I comment out the actual soft reset, not the needs_reset calculation when I do it) 2. You modify generic-linuxbios.mk instead of a specific one for the target (see my earlier patch) 3. I'd like it if it depended on either serengeti-cheetah config option (also in the earlier patch)
I also commented inline with the patch if it's more clear.
I haven't run into the other issues (beside the reset), so I don't know how to test them.
Thanks, Myles
Thanks, Jordan
[BUILDROM] Add support for the AMD SimNow (TM) simulator
Add a build option and a patch against LinuxBIOS to allow the Serengeti-Cheetah platform to come up on its emulated self in the SimNow simulator.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com
Index: buildrom-devel/config/platforms/Config.in
--- buildrom-devel.orig/config/platforms/Config.in +++ buildrom-devel/config/platforms/Config.in @@ -81,4 +81,13 @@ config PLATFORM_SERENGETI_CHEETAH depends VENDOR_AMD select PLATFORM endchoice
+config SIMNOW
bool "Build for the AMD SimNow (TM) emulator"
depends PLATFORM_SERENGETI_CHEETAH
How about: + depends PLATFORM_SERENGETI_CHEETAH | PLATFORM_SERENGETI_CHEETAH_64 To let mine use the same option
default n
help
Say 'y' here to patch the build to work on an
emulated platform in the AMD SimNow (TM) simulator
endmenu Index: buildrom-devel/packages/linuxbios/generic-linuxbios.mk
Should modify specific linuxbios.mk file
===================================================================
--- buildrom-devel.orig/packages/linuxbios/generic-linuxbios.mk +++ buildrom-devel/packages/linuxbios/generic-linuxbios.mk @@ -21,6 +21,10 @@ endif
LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/s-c-buildrom-payload.patch
+ifeq ($(CONFIG_SIMNOW),y) +LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/simnow.patch +endif
include $(PACKAGE_DIR)/linuxbios/linuxbios.inc
$(SOURCE_DIR)/$(LINUXBIOS_TARBALL): Index: buildrom-devel/packages/linuxbios/patches/simnow.patch =================================================================== --- /dev/null +++ buildrom-devel/packages/linuxbios/patches/simnow.patch @@ -0,0 +1,59 @@ +Index: svn/src/northbridge/amd/amdk8/raminit_f_dqs.c +=================================================================== +--- svn.orig/src/northbridge/amd/amdk8/raminit_f_dqs.c ++++ svn/src/northbridge/amd/amdk8/raminit_f_dqs.c +@@ -1987,6 +1987,16 @@ static inline void train_ram_on_node(uns
struct sys_info *sysinfox = ((CONFIG_LB_MEM_TOPK<<10) - DCACHE_RAM_GLOBAL_VAR_SIZE);
wait_till_sysinfo_in_ram(); // use pci to get it
++ /* In SimNow, when we get to this point, CAR is disabled, so ++ * our stack pointer points to never-never land, andjust it. ++ */ ++ ++ __asm__ volatile ( ++ "subl %0, %%ebp\n\t" ++ "subl %0, %%esp\n\t" ++ ::"a"( (DCACHE_RAM_BASE + DCACHE_RAM_SIZE)- (CONFIG_LB_MEM_TOPK<<10) ) ++ ); ++
if(sysinfox->mem_trained[nodeid] == 0x80) {
#if 0
sysinfo->tom_k = sysinfox->tom_k;
+Index: svn/src/mainboard/amd/serengeti_cheetah/Options.lb +=================================================================== +--- svn.orig/src/mainboard/amd/serengeti_cheetah/Options.lb ++++ svn/src/mainboard/amd/serengeti_cheetah/Options.lb +@@ -218,7 +218,7 @@ default CONFIG_USE_INIT=0
- ##
- ## for rev F training on AP purpose
- ##
+-default CONFIG_AP_CODE_IN_CAR=1 ++default CONFIG_AP_CODE_IN_CAR=0
- default MEM_TRAIN_SEQ=1
- default WAIT_BEFORE_CPUS_INIT=1
+Index: svn/src/mainboard/amd/serengeti_cheetah/cache_as_ram_auto.c +=================================================================== +--- svn.orig/src/mainboard/amd/serengeti_cheetah/cache_as_ram_auto.c ++++ svn/src/mainboard/amd/serengeti_cheetah/cache_as_ram_auto.c +@@ -338,16 +338,18 @@ void real_main(unsigned long bist, unsig
}
- #endif
+-#if 1
needs_reset = optimize_link_coherent_ht();
++#if 0 ++ /* On SimNow, this causes issues - remove it for now */
needs_reset |= optimize_link_incoherent_ht(sysinfo);
++#endif
// fidvid change will issue one LDTSTOP and the HT change will be effective too
if (needs_reset) {
print_info("ht reset -\r\n");
This is the line I comment out
soft_reset_x(sysinfo->sbbusn, sysinfo->sbdn);
}
+-#endif ++
allow_all_aps_stop(bsp_apicid);
//It's the time to set ctrl in sysinfo now;
On 09/11/07 12:46 -0700, Myles Watson wrote:
On 11/9/07, Jordan Crouse jordan.crouse@amd.com wrote:
By popular request, this is a patch to buildrom adding support for the AMD SimNow simulator. Basically, it patches LinuxBIOS to work around a few SimNow related quirks that are currently in the public version of SimNow. The quirks themselves have been reported, and hopefully will be fixed in future releases.
What is SimNow, and why does it rock, you might ask? SimNow (TM) is a processor simulator that we have developed at AMD. Its a great way to simulate the processor / chipset boot process and develop LinuxBIOS and payloads, because it features an integrated debugger, and its easy to fix when you brick the thing (just hit reset). There is a public version here:
http://developer.amd.com/simnow.jsp
For the more commercial customers out there, there is also a NDA version that has support for more processors (contact your friendly AMD representative for more information). I'll put this information on the wiki as well, for posterity.
Myles and other SimNow users - let me know if this works.
It doesn't work for me yet.
- It still resets (I comment out the actual soft reset, not the
needs_reset calculation when I do it)
It will reset once - it shouldn't reset repeatedly (doesn't on my test setup). I haven't tried the public version yet, I'll do that. The issue is on the non-coherent devices - the coherent ones should optimize correctly - if they don't, thats a way bigger problem.
- You modify generic-linuxbios.mk instead of a specific one for the
target (see my earlier patch) 3. I'd like it if it depended on either serengeti-cheetah config option (also in the earlier patch)
Yes - I haven't refactored against your previous patch. Its still in my queue.
I haven't run into the other issues (beside the reset), so I don't know how to test them.
If it boots quickly, then you don't hit the other problem. If the thing grinds to a halt then you hit it.
-----Original Message----- From: Jordan Crouse [mailto:jordan.crouse@amd.com]
It will reset once - it shouldn't reset repeatedly (doesn't on my test setup). I haven't tried the public version yet, I'll do that. The issue is on the non-coherent devices - the coherent ones should optimize correctly - if they don't, thats a way bigger problem.
It continuously reset for me. It seems to work fine with a LAB payload with the soft_reset commented out.
I haven't run into the other issues (beside the reset), so I don't know how to test them.
If it boots quickly, then you don't hit the other problem. If the thing grinds to a halt then you hit it.
Maybe that's related to the single reset?
Myles
On 09/11/07 13:26 -0700, Myles Watson wrote:
-----Original Message----- From: Jordan Crouse [mailto:jordan.crouse@amd.com]
It will reset once - it shouldn't reset repeatedly (doesn't on my test setup). I haven't tried the public version yet, I'll do that. The issue is on the non-coherent devices - the coherent ones should optimize correctly - if they don't, thats a way bigger problem.
It continuously reset for me. It seems to work fine with a LAB payload with the soft_reset commented out.
what version of SimNow are you using, and what BSD?
I haven't run into the other issues (beside the reset), so I don't know how to test them.
If it boots quickly, then you don't hit the other problem. If the thing grinds to a halt then you hit it.
Maybe that's related to the single reset?
No, it has to do with CAR issues on multiple nodes - you might not hit it if you only have 1 processor x 1 core.
-----Original Message----- From: Jordan Crouse [mailto:jordan.crouse@amd.com] Sent: Friday, November 09, 2007 1:32 PM To: Myles Watson Cc: linuxbios@linuxbios.org Subject: Re: Add support for the AMD SimNow (TM) simulator
On 09/11/07 13:26 -0700, Myles Watson wrote:
-----Original Message----- From: Jordan Crouse [mailto:jordan.crouse@amd.com]
It will reset once - it shouldn't reset repeatedly (doesn't on my test setup). I haven't tried the public version yet, I'll do that. The issue is on the non-coherent devices - the coherent ones should optimize correctly - if they don't, thats a way bigger problem.
It continuously reset for me. It seems to work fine with a LAB payload
with
the soft_reset commented out.
what version of SimNow are you using, and what BSD?
4.4.1 cheetah_1p.bsd
When I use cheetah_1p_jh.bsd it works.
Myles
I haven't run into the other issues (beside the reset), so I don't know how to test them.
If it boots quickly, then you don't hit the other problem. If the thing grinds to a halt then you hit it.
Maybe that's related to the single reset?
No, it has to do with CAR issues on multiple nodes - you might not hit it if you only have 1 processor x 1 core.
-- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
On 09/11/07 13:37 -0700, Myles Watson wrote:
what version of SimNow are you using, and what BSD?
4.4.1 cheetah_1p.bsd
When I use cheetah_1p_jh.bsd it works.
Well - thats strange. I can't get it to break with cheetah_1p.bsd, but that doesn't mean I don't believe you.
Its possible that the coherent optimize is buggy if there are no other coherent devices to optimize with.
The easy way to fix this is just to remove the whole kit and kaboodle all together. I'll ack your patch, update my patch to match your patch, and remove the reset bits.
Jordan
On 09/11/07 12:46 -0700, Myles Watson wrote:
On 11/9/07, Jordan Crouse jordan.crouse@amd.com wrote:
By popular request, this is a patch to buildrom adding support for the AMD SimNow simulator. Basically, it patches LinuxBIOS to work around a few SimNow related quirks that are currently in the public version of SimNow. The quirks themselves have been reported, and hopefully will be fixed in future releases.
What is SimNow, and why does it rock, you might ask? SimNow (TM) is a processor simulator that we have developed at AMD. Its a great way to simulate the processor / chipset boot process and develop LinuxBIOS and payloads, because it features an integrated debugger, and its easy to fix when you brick the thing (just hit reset). There is a public version here:
http://developer.amd.com/simnow.jsp
For the more commercial customers out there, there is also a NDA version that has support for more processors (contact your friendly AMD representative for more information). I'll put this information on the wiki as well, for posterity.
Myles and other SimNow users - let me know if this works.
It doesn't work for me yet.
- It still resets (I comment out the actual soft reset, not the
needs_reset calculation when I do it)
hmmm - I just build a ROM and ran it on the public version, with cheetah_1p_jh.bsd, and it worked fine. Which BSD are you using?
Jordan