All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: yeeloong: cs5536 (Geode companion) not working in grub master
       [not found] <87io8g1p8u.fsf@netris.org>
@ 2015-08-17 18:02 ` Andrei Borzenkov
  2015-08-19  8:44   ` Mark H Weaver
       [not found] ` <CAA91j0XWGssTGgUrcHuEY1mgs9EDV+vpqhDpjzjphSW8yU_pOA@mail.gmail.com>
  1 sibling, 1 reply; 3+ messages in thread
From: Andrei Borzenkov @ 2015-08-17 18:02 UTC (permalink / raw)
  To: Mark H Weaver, bug-grub, The development of GNU GRUB

15.08.2015 19:38, Mark H Weaver пишет:
> I'm attempting to get grub working on the Lemote Yeeloong 8101B
> (Loongson 2F) as a second-stage bootloader from PMON.
>
> I have grub-2.02-beta2-499-g4fe8e6d mostly working, with one exception:
> none of the devices on the cs5536 (Geode companion) are accessible,
> which unfortunately includes the IDE interface for the internal disk.
>

As far as I understand code, if GRUB wants to have cs5536 and does not 
find it it stops. If you enter GRUB it means it skipped cs5536 
initialization. According to code, it can happen only if 
grub_arch_memsize != 0. I do not see where GRUB itself sets it before 
this check. So my only guess that PMON (whatever it is) fills in this 
field in GRUB header. We could add debug print to verify this.

> This grub is able to access filesystems from a thumb drive plugged into
> one of the USB ports: the one next to the ethernet jack, which is the
> one that is not connected to the cs5536.  Grub is unable to access the
> other two USB ports, which are connected to the cs5536.
>
> I'm judging what disks are accessible based on tab completion, trying
> various partition names like (hd0,msdos1) (ata0,msdos1), and also using
> the 'search' command.
>
> lspci from grub prints:
>
>    00:02.0 10ec:8139 [0200] Ethernet Controller
>    00:03.0 126f:0712 [0300] VGA Controller
>    00:04.0 1033:0035 [0c03] USB Controller [PI 10]
>    00:04.1 1033:00e0 [0c03] USB Controller [PI 20]
>    00:09.0 1022:208f [ff00]
>

This is correct; it is the PCI ID that GRUB expects.

> whereas "lspci -nn" from my booted system reports:
>
>    00:07.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ [10ec:8139] (rev 10)
>    00:08.0 VGA compatible controller [0300]: Silicon Motion, Inc. SM712 LynxEM+ [126f:0712] (rev b0)
>    00:09.0 USB controller [0c03]: NEC Corporation OHCI USB Controller [1033:0035] (rev 44)
>    00:09.1 USB controller [0c03]: NEC Corporation uPD72010x USB 2.0 Controller [1033:00e0] (rev 05)
>    00:0e.0 ISA bridge [0601]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] ISA [1022:2090] (rev 03)
>    00:0e.2 IDE interface [0101]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] IDE [1022:209a] (rev 01)
>    00:0e.3 Multimedia audio controller [0401]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] Audio [1022:2093] (rev 01)
>    00:0e.4 USB controller [0c03]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] OHC [1022:2094] (rev 02)
>    00:0e.5 USB controller [0c03]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] EHC [1022:2095] (rev 02)
>
> I built this grub from GNU Guix, which uses stock GCC 4.9.3 and binutils
> 2.25 configured for the N32 ABI.  I passed TARGET_CFLAGS="-Os -mabi=32"
> and TARGET_CCASFLAGS="-mabi=32" to configure.  Here's the command I used
> to build the grub image:
>
>    grub-mkimage --prefix='(hd0,0)/boot/grub'                            \
>      --config=grub.elf.conf --output=grub.elf                           \
>      --format=mipsel-yeeloong-elf --verbose ata part_msdos ext2 reboot  \
>      halt lspci ohci usbtest usbms linux fat xfs part_gpt multiboot2    \
>      minicmd configfile gcry_md5 hashsum echo search
>
> where grub.elf.conf contains:
>
>    set root=hd0,0
>    set prefix=($root)/boot/grub
>
> If it would help, I can provide instructions for how to reproduce the
> same toolchain and/or grub using GNU Guix.
>
> Any ideas or suggestions would be much appreciated.
>
>        Mark
>
> _______________________________________________
> Bug-grub mailing list
> Bug-grub@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-grub
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: yeeloong: cs5536 (Geode companion) not working in grub master
  2015-08-17 18:02 ` yeeloong: cs5536 (Geode companion) not working in grub master Andrei Borzenkov
@ 2015-08-19  8:44   ` Mark H Weaver
  0 siblings, 0 replies; 3+ messages in thread
From: Mark H Weaver @ 2015-08-19  8:44 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: bug-grub, The development of GNU GRUB

Hi Andrei, thank you for the quick response.

Andrei Borzenkov <arvidjaar@gmail.com> writes:

> 15.08.2015 19:38, Mark H Weaver пишет:
>> I'm attempting to get grub working on the Lemote Yeeloong 8101B
>> (Loongson 2F) as a second-stage bootloader from PMON.
>>
>> I have grub-2.02-beta2-499-g4fe8e6d mostly working, with one exception:
>> none of the devices on the cs5536 (Geode companion) are accessible,
>> which unfortunately includes the IDE interface for the internal disk.
>>
>
> As far as I understand code, if GRUB wants to have cs5536 and does not
> find it it stops. If you enter GRUB it means it skipped cs5536
> initialization. According to code, it can happen only if
> grub_arch_memsize != 0. I do not see where GRUB itself sets it before
> this check. So my only guess that PMON (whatever it is) fills in this
> field in GRUB header. We could add debug print to verify this.

Indeed, your guess is correct.  I applied the following patch and the
output was: "orig_grub_arch_memsize == 100".

--8<---------------cut here---------------start------------->8---
diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c
index 7b96531..15a6dfd 100644
--- a/grub-core/kern/mips/loongson/init.c
+++ b/grub-core/kern/mips/loongson/init.c
@@ -121,6 +121,7 @@ grub_machine_init (void)
 {
   grub_addr_t modend;
   grub_uint32_t prid;
+  grub_uint32_t orig_grub_arch_memsize;
 
   asm volatile ("mfc0 %0, " GRUB_CPU_LOONGSON_COP0_PRID : "=r" (prid));
 
@@ -154,6 +155,7 @@ grub_machine_init (void)
 
   grub_install_get_time_ms (grub_rtc_get_time_ms);
 
+  orig_grub_arch_memsize = grub_arch_memsize;
   if (grub_arch_memsize == 0)
     {
       grub_port_t smbbase;
@@ -223,6 +225,10 @@ grub_machine_init (void)
   grub_serial_init ();
 
   grub_boot_init ();
+
+  grub_printf ("orig_grub_arch_memsize == %lx\n\n",
+               (unsigned long) orig_grub_arch_memsize);
+  grub_getkey ();
 }
 
 void
--8<---------------cut here---------------end--------------->8---

I then tried changing "if (grub_arch_memsize == 0)" to "if (1)", but
that didn't help.  The 'lspci' output didn't change, and I was still
unable to access the internal disk.  The only change I noticed is that
tab completion within grub partition specifiers now hangs grub for
several seconds before failing to generate any completions, whereas
before there was no perceptible delay.

>> This grub is able to access filesystems from a thumb drive plugged into
>> one of the USB ports: the one next to the ethernet jack, which is the
>> one that is not connected to the cs5536.  Grub is unable to access the
>> other two USB ports, which are connected to the cs5536.
>>
>> I'm judging what disks are accessible based on tab completion, trying
>> various partition names like (hd0,msdos1) (ata0,msdos1), and also using
>> the 'search' command.
>>
>> lspci from grub prints:
>>
>>    00:02.0 10ec:8139 [0200] Ethernet Controller
>>    00:03.0 126f:0712 [0300] VGA Controller
>>    00:04.0 1033:0035 [0c03] USB Controller [PI 10]
>>    00:04.1 1033:00e0 [0c03] USB Controller [PI 20]
>>    00:09.0 1022:208f [ff00]
>>
>
> This is correct; it is the PCI ID that GRUB expects.

Okay, but should 'lspci' with GRUB also show entries for the IDE
interface and USB controllers that are part of the cs5536?

>> whereas "lspci -nn" from my booted system reports:
>>
>>    00:07.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ [10ec:8139] (rev 10)
>>    00:08.0 VGA compatible controller [0300]: Silicon Motion, Inc. SM712 LynxEM+ [126f:0712] (rev b0)
>>    00:09.0 USB controller [0c03]: NEC Corporation OHCI USB Controller [1033:0035] (rev 44)
>>    00:09.1 USB controller [0c03]: NEC Corporation uPD72010x USB 2.0 Controller [1033:00e0] (rev 05)
>>    00:0e.0 ISA bridge [0601]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] ISA [1022:2090] (rev 03)
>>    00:0e.2 IDE interface [0101]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] IDE [1022:209a] (rev 01)
>>    00:0e.3 Multimedia audio controller [0401]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] Audio [1022:2093] (rev 01)
>>    00:0e.4 USB controller [0c03]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] OHC [1022:2094] (rev 02)
>>    00:0e.5 USB controller [0c03]: AMD [Advanced Micro Devices, Inc.] CS5536 [Geode companion] EHC [1022:2095] (rev 02)

    Thanks!
      Mark


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: yeeloong: cs5536 (Geode companion) not working in grub master
       [not found] ` <CAA91j0XWGssTGgUrcHuEY1mgs9EDV+vpqhDpjzjphSW8yU_pOA@mail.gmail.com>
@ 2015-08-19 16:18   ` Mark H Weaver
  0 siblings, 0 replies; 3+ messages in thread
From: Mark H Weaver @ 2015-08-19 16:18 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: bug-grub, grub-devel

Andrei Borzenkov <arvidjaar@gmail.com> writes:

>>   grub-mkimage --prefix='(hd0,0)/boot/grub'                            \
>>     --config=grub.elf.conf --output=grub.elf                           \
>>     --format=mipsel-yeeloong-elf --verbose ata part_msdos ext2 reboot  \
>
> You need to included pata, not ata, module which knows about cs5536.

This fixed the problem, and now I have a working GRUB.  Thank you!

      Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-19 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87io8g1p8u.fsf@netris.org>
2015-08-17 18:02 ` yeeloong: cs5536 (Geode companion) not working in grub master Andrei Borzenkov
2015-08-19  8:44   ` Mark H Weaver
     [not found] ` <CAA91j0XWGssTGgUrcHuEY1mgs9EDV+vpqhDpjzjphSW8yU_pOA@mail.gmail.com>
2015-08-19 16:18   ` Mark H Weaver

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.