Message ID | 20231219-sam-sparc32-sunset-v3-v1-0-64bb44b598c5@ravnborg.org |
---|---|
Headers | show |
Series | sparc32: sunset sun4m and sun4d | expand |
On 2023-12-20 18:25, John Paul Adrian Glaubitz wrote: > Hi Sam, > > On Wed, 2023-12-20 at 16:22 +0100, Sam Ravnborg wrote: >>> The leon3_generic machine is maintained by different people so I'd suggest >>> contacting them: see [1] for their contact details. I see there is an >>> avocado boot test for the leon3_generic machine included within the QEMU >>> source tree, but it uses a downloadable image of HelenOS rather than Linux. >> >> Thanks for the pointer, I will try to reach out to them when I have >> something a bit more solid than "it does not work". >> >> I tried to hack around a little in qemu and I have an idea where things >> goes wrong. The leon_generic assumes another address layout than what is >> used by the kernel, so the very first jump to a kernel address fails. The MKLINUXIMG second stage bootloader sets up MMU tables and the SPARC OPENPROM interface for LEON systems, so you need to run the vmlinux image through that. You can find it (and our other Linux related releases) via https://gaisler.com/index.php/downloads/linux. The manual is at https://www.gaisler.com/doc/mklinuximg.pdf and the latest release at https://gaisler.com/anonftp/linux/linux-2.6/kernel/mklinuximg-2.0.15.tar.bz2 With a sparc-linux-gcc in the PATH (or using CROSS_COMPILE to point out a toolchain stem) you can do: mklinuximg vmlinux image.ram and then run the resulting image.ram in e.g. QEMU 8.2.0 with qemu-system-sparc -nographic -M leon3_generic -m 256 -kernel image.ram This at least boots the kernel and let me log in when quickly testing a few images with root filesystems in initramfs, admittedly with our kernel patches in place. > I would argue that before we start introducing larger changes to arch/sparc, > we should settle the maintainership question first. Once we have an active > maintainer again, we can have a more extended discussion about what to keep > and how to name things. I agree. Cheers, Andreas
Hi Andreas. Congratulation being the new sparc co-maintainer! On Tue, Dec 19, 2023 at 11:03:05PM +0100, Sam Ravnborg via B4 Relay wrote: > This is the second attempt to sunset sun4m and sun4d. > See [1] for the inital attempt. I have now verified that the kernel can boot with qemu. There was a bug in the uart driver that is fixed and upstream, and then using the instructions you provided I could use buildroot with an external kernel tree to get a booting kernel. Assuming you agree with the patchset how do you want me to move forward? I can rebase on top of the latest -rc and collect acks if that helps. Arnd promised to pick up the patches until you got a git tree up, but I do not expect Arnd to pick up anything unless you have acked or reviewed said patch(es). If I rebase the patch-set I will likely include a few bug-fix patches that was prepared in the meantime. I can also send them as a separate series, no worries. Sam
Hi Andreas, > > diff --git a/arch/sparc/include/asm/winmacro.h b/arch/sparc/include/asm/winmacro.h > > index b6e911f5d93c..c496b04cdfaf 100644 > > --- a/arch/sparc/include/asm/winmacro.h > > +++ b/arch/sparc/include/asm/winmacro.h > > @@ -108,18 +108,11 @@ > > 661: rd %tbr, %idreg; \ > > srl %idreg, 10, %idreg; \ > > and %idreg, 0xc, %idreg; \ > > These three lines, including the label, should also be removed as they > are not for LEON. Additionally, I think it would be best to split out > removing the cpuid instruction fixups to one patch and the MMU ASI > instruction fixups to another patch. Nice catch! I will fix this and split up in two patches in v2. It will take some days before I have v2 ready, and I will base it on top of your for-next branch in the sparc.git tree. Sam > > > - .section .cpuid_patch, "ax"; \ > > - /* Instruction location. */ \ > > - .word 661b; \ > > - /* SUN4D implementation. */ \ > > - lda [%g0] ASI_M_VIKING_TMP1, %idreg; \ > > - sll %idreg, 2, %idreg; \ > > - nop; \ > > - /* LEON implementation. */ \ > > + \ > > rd %asr17, %idreg; \ > > srl %idreg, 0x1c, %idreg; \ > > sll %idreg, 0x02, %idreg; \ > > - .previous; \ > > + \ > > sethi %hi(current_set), %dest_reg; \ > > or %dest_reg, %lo(current_set), %dest_reg;\ > > ld [%idreg + %dest_reg], %dest_reg; > > diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S > > index 0f2417ee3f95..9cf8f87e8c42 100644 > > --- a/arch/sparc/kernel/entry.S > > +++ b/arch/sparc/kernel/entry.S > > The hard_smp_processor_id function also needs to be reduced to just the > LEON code. With the patching removed, SMP otherwise breaks with CPUs > other than CPU 0 getting stuck. > > Thanks, > Andreas