[LinuxBIOS] [BUILDROM] Add support for the AMD SimNow (TM) simulator (try 2)

Here is the refreshed patch for the SimNow support against current RCS. Something is triggering my bat sense that the tree isn't exactly in a right state, but I can't remember what it is. Please test the tree with and without the patch to make sure that its sane. Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc. [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 @@ -87,4 +87,13 @@ config PLATFORM_SERENGETI_CHEETAH select PLATFORM_SUPPORT_64BIT endchoice + +config SIMNOW + bool "Build for the AMD SimNow (TM) emulator" + depends PLATFORM_SERENGETI_CHEETAH || PLATFORM_SERENGETI_CHEETAH_64 + 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/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; Index: buildrom-devel/packages/linuxbios/serengeti_cheetah.mk =================================================================== --- buildrom-devel.orig/packages/linuxbios/serengeti_cheetah.mk +++ buildrom-devel/packages/linuxbios/serengeti_cheetah.mk @@ -15,12 +15,17 @@ ifeq ($(HAVE_IASL),n) $(error To build LinuxBIOS, you need to install the 'iasl' tool) endif + ifeq ($(CONFIG_PAYLOAD_LAB),y) LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/serengeti_cheetah-lab.patch else LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/serengeti_cheetah-payload.patch endif +ifeq ($(CONFIG_SIMNOW),y) +LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/simnow.patch +endif + LINUXBIOS_BASE_DIR=svn LINUXBIOS_URL=svn://linuxbios.org/repos/trunk/LinuxBIOSv2 LINUXBIOS_TARBALL=linuxbios-svn-$(LINUXBIOS_TAG).tar.gz

On 11/28/07, Jordan Crouse <jordan.crouse@amd.com> wrote:
Here is the refreshed patch for the SimNow support against current RCS. Something is triggering my bat sense that the tree isn't exactly in a right state, but I can't remember what it is. Please test the tree with and without the patch to make sure that its sane.
Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
[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> It boots for me with the patch, and builds with and without. Acked-by: Myles Watson <myles@pel.cs.byu.edu>

On 28/11/07 11:47 -0700, Myles Watson wrote:
On 11/28/07, Jordan Crouse <jordan.crouse@amd.com> wrote:
Here is the refreshed patch for the SimNow support against current RCS. Something is triggering my bat sense that the tree isn't exactly in a right state, but I can't remember what it is. Please test the tree with and without the patch to make sure that its sane.
Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
[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> It boots for me with the patch, and builds with and without. Acked-by: Myles Watson <myles@pel.cs.byu.edu>
r64. Thanks.
-- linuxbios mailing list linuxbios@linuxbios.org http://www.linuxbios.org/mailman/listinfo/linuxbios
-- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.

Is there a howto on the web page to show how to use this sim environment? This is really cool. We can also use it for v3 development. ron p.s. v3 status on alix1c -- had no time last night, won't get back to it since I am going on travel. But it's still stuck in pll_reset -- seems to crash on the rdmsr ...

On 28/11/07 12:31 -0800, ron minnich wrote:
Is there a howto on the web page to show how to use this sim environment? This is really cool.
Its on my list to do. Maybe Myles can beat me to it, since he has experienced getting it from the developers website and getting it going (I compile it from the code, which is a different path). Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.

On 11/28/07, Jordan Crouse <jordan.crouse@amd.com> wrote:
On 28/11/07 12:31 -0800, ron minnich wrote:
Is there a howto on the web page to show how to use this sim environment? This is really cool.
I put up a basic page today that should help someone get started. It's at http://www.linuxbios.org/AMD_SimNow and it's linked to from the homepage, down by QEMU. Feel free to ask questions or clean it up as suits your tastes. Myles

On 04/12/07 14:39 -0700, Myles Watson wrote:
On 11/28/07, Jordan Crouse <jordan.crouse@amd.com> wrote:
On 28/11/07 12:31 -0800, ron minnich wrote:
Is there a howto on the web page to show how to use this sim environment? This is really cool.
I put up a basic page today that should help someone get started. It's at http://www.linuxbios.org/AMD_SimNow and it's linked to from the homepage, down by QEMU.
Feel free to ask questions or clean it up as suits your tastes.
Awesome! Thanks. Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.

On Tue, Dec 04, 2007 at 02:39:04PM -0700, Myles Watson wrote:
On 11/28/07, Jordan Crouse <jordan.crouse@amd.com> wrote:
On 28/11/07 12:31 -0800, ron minnich wrote:
Is there a howto on the web page to show how to use this sim environment? This is really cool.
I put up a basic page today that should help someone get started. It's at http://www.linuxbios.org/AMD_SimNow and it's linked to from the homepage, down by QEMU.
Very nice, thanks! But please add a license at the bottom of the page (use {{GPL}} or {{PD-self}} etc). See here for a list of licenses: http://linuxbios.org/index.php?title=Special%3AAllpages&from=&namespace=10 We can add others if you prefer another (free-ish) one. Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org

Is there a howto on the web page to show how to use this sim environment? This is really cool.
I put up a basic page today that should help someone get started. It's at http://www.linuxbios.org/AMD_SimNow and it's linked to from the homepage, down by QEMU.
Very nice, thanks! But please add a license at the bottom of the page (use {{GPL}} or {{PD-self}} etc).
Done. Thanks, Myles

On 04/12/07 14:39 -0700, Myles Watson wrote:
On 11/28/07, Jordan Crouse <jordan.crouse@amd.com> wrote:
On 28/11/07 12:31 -0800, ron minnich wrote:
Is there a howto on the web page to show how to use this sim environment? This is really cool.
I put up a basic page today that should help someone get started. It's at http://www.linuxbios.org/AMD_SimNow and it's linked to from the homepage, down by QEMU.
I noticed your part about the serial port. Interacting with the serial port is difficult since you have to write to one file and read from another. I wrote a tool to help with that; it muxes the serial pipes into a telnet server. All you have to do is run the tool along side SimNow, and then telnet into port 9000 on your box, and you're in. You can also output the muxed pipes to a pseudo-tty and access it with Minicom, but I really find the telnet interface much easier. I put the tarball here: http://linuxbios.org/~jcrouse/snserial-1.0.tar.gz I'll write up some instructions on the SimNow page on how to use it. Jordan -- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
participants (4)
-
Jordan Crouse
-
Myles Watson
-
ron minnich
-
Uwe Hermann