Re: [PATCH 2/3] m68k: Add support for M68040 CPU
On Sun, Dec 21, 2025 at 12:43:08AM +0800, Kuan-Wei Chiu wrote: > Hi Tom, > > On Thu, Dec 18, 2025 at 01:00:32PM -0600, Tom Rini wrote: > > On Thu, Dec 18, 2025 at 06:52:51PM +, Kuan-Wei Chiu wrote: > > > Add support for the Motorola 68040 architecture. Currently, m68k > > > support in U-Boot is primarily focused on ColdFire (MCF5xxx) variants. > > > Introduce the necessary infrastructure to support the classic M680x0 > > > series, specifically targeting the M68040 as emulated by QEMU. > > > > > > The implementation includes exception vectors, early startup code, and > > > minimal CPU initialization and relocation stubs. It also defines the > > > standard m68k boot information structure used for passing hardware > > > information to the operating system. To ensure compatibility, ColdFire- > > > specific library objects such as cache and interrupt handling are > > > excluded from the build when M68040 is selected. > > > > > > Additionally, apply a specific workaround during the early memory > > > reservation stage. Use a manual loop to clear global data instead of > > > the standard memset() function, as utilizing memset() at this point was > > > observed to cause a hang on the QEMU platform. > > > > > > Signed-off-by: Kuan-Wei Chiu > > [snip] > > > diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig > > > index 8ade6f7b9d1..a41c375f6be 100644 > > > --- a/arch/m68k/Kconfig > > > +++ b/arch/m68k/Kconfig > > > @@ -56,6 +56,9 @@ config MCF5441x > > > select DM_SERIAL > > > bool > > > > > > +config M68040 > > > +bool > > > + > > > > The file is unfortunately inconsistent about tabs vs spaces, but all the > > new options should be tab-indent only, and no extra blank lines added. > > I'll fix this in v2. > > BTW, do you think it would be helpful to add a check in checkpatch.pl > to warn about space indentation in Kconfig files? I checked and the linux kernel has many space-not-tab in Kconfig files, so it would be a change to add it to the U-Boot specific tests part of checkpatch.pl, and a patch to do so would be welcome, thanks! -- Tom signature.asc Description: PGP signature
Re: [PATCH 2/3] m68k: Add support for M68040 CPU
Hi Daniel, On Sun, Dec 21, 2025 at 01:53:40PM +0900, Daniel Palmer wrote: > Hi Kuan-Wei > > On Fri, 19 Dec 2025 at 04:06, Kuan-Wei Chiu wrote: > > > > Add support for the Motorola 68040 architecture. Currently, m68k > > support in U-Boot is primarily focused on ColdFire (MCF5xxx) variants. > > Introduce the necessary infrastructure to support the classic M680x0 > > series, specifically targeting the M68040 as emulated by QEMU. > > For all of this: It really needs to be split into the bits for all > classic 68K and then the supplemental bits for 040 (basically the > cache stuff that you only have stubs for). > That way if your parts get merged I can rework my support for 000, 030 > etc on top of that. Yeah, proper split is definitely needed for the long term. Here is my plan for v2 to address this. Could you let me know if this structure matches what you have in mind? 1. Create a common directory for Classic m68k (non-ColdFire): Possible path: arch/m68k/cpu/classic/ I plan to move the following generic parts there: - start.S: The entry point, basic stack setup, and exception vector definitions (likely shared across 000-060). - bootinfo.h: Since this is standard for m68k Linux. 2. Keep 040-specific code in arch/m68k/cpu/classic/m68040/: - cpu.c: Containing 040-specific cache handling (or stubs for now) and specific initialization. 3. Refactor arch/m68k/lib/Makefile: Instead of using ifndef CONFIG_M68040 to exclude ColdFire files, I should probably restructure it to clearly distinguish between "ColdFire common" and "Classic m68k common" libraries. Does this separation align with your requirements for layering 000/030 support on top of it later? Regards, Kuan-Wei
Re: [PATCH 2/3] m68k: Add support for M68040 CPU
On 12/21/25 05:53, Daniel Palmer wrote: Hi Kuan-Wei On Fri, 19 Dec 2025 at 04:06, Kuan-Wei Chiu wrote: Add support for the Motorola 68040 architecture. Currently, m68k support in U-Boot is primarily focused on ColdFire (MCF5xxx) variants. Introduce the necessary infrastructure to support the classic M680x0 series, specifically targeting the M68040 as emulated by QEMU. For all of this: It really needs to be split into the bits for all classic 68K and then the supplemental bits for 040 (basically the cache stuff that you only have stubs for). That way if your parts get merged I can rework my support for 000, 030 etc on top of that. Cheers, Daniel Looks good to me, even if i can't test any of them here. Angelo
Re: [PATCH 2/3] m68k: Add support for M68040 CPU
Hi Kuan-Wei On Fri, 19 Dec 2025 at 04:06, Kuan-Wei Chiu wrote: > > Add support for the Motorola 68040 architecture. Currently, m68k > support in U-Boot is primarily focused on ColdFire (MCF5xxx) variants. > Introduce the necessary infrastructure to support the classic M680x0 > series, specifically targeting the M68040 as emulated by QEMU. For all of this: It really needs to be split into the bits for all classic 68K and then the supplemental bits for 040 (basically the cache stuff that you only have stubs for). That way if your parts get merged I can rework my support for 000, 030 etc on top of that. Cheers, Daniel
Re: [PATCH 2/3] m68k: Add support for M68040 CPU
Hi Tom, On Thu, Dec 18, 2025 at 01:00:32PM -0600, Tom Rini wrote: > On Thu, Dec 18, 2025 at 06:52:51PM +, Kuan-Wei Chiu wrote: > > Add support for the Motorola 68040 architecture. Currently, m68k > > support in U-Boot is primarily focused on ColdFire (MCF5xxx) variants. > > Introduce the necessary infrastructure to support the classic M680x0 > > series, specifically targeting the M68040 as emulated by QEMU. > > > > The implementation includes exception vectors, early startup code, and > > minimal CPU initialization and relocation stubs. It also defines the > > standard m68k boot information structure used for passing hardware > > information to the operating system. To ensure compatibility, ColdFire- > > specific library objects such as cache and interrupt handling are > > excluded from the build when M68040 is selected. > > > > Additionally, apply a specific workaround during the early memory > > reservation stage. Use a manual loop to clear global data instead of > > the standard memset() function, as utilizing memset() at this point was > > observed to cause a hang on the QEMU platform. > > > > Signed-off-by: Kuan-Wei Chiu > [snip] > > diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig > > index 8ade6f7b9d1..a41c375f6be 100644 > > --- a/arch/m68k/Kconfig > > +++ b/arch/m68k/Kconfig > > @@ -56,6 +56,9 @@ config MCF5441x > > select DM_SERIAL > > bool > > > > +config M68040 > > +bool > > + > > The file is unfortunately inconsistent about tabs vs spaces, but all the > new options should be tab-indent only, and no extra blank lines added. I'll fix this in v2. BTW, do you think it would be helpful to add a check in checkpatch.pl to warn about space indentation in Kconfig files? Regards, Kuan-Wei
Re: [PATCH 2/3] m68k: Add support for M68040 CPU
On Thu, Dec 18, 2025 at 06:52:51PM +, Kuan-Wei Chiu wrote: > Add support for the Motorola 68040 architecture. Currently, m68k > support in U-Boot is primarily focused on ColdFire (MCF5xxx) variants. > Introduce the necessary infrastructure to support the classic M680x0 > series, specifically targeting the M68040 as emulated by QEMU. > > The implementation includes exception vectors, early startup code, and > minimal CPU initialization and relocation stubs. It also defines the > standard m68k boot information structure used for passing hardware > information to the operating system. To ensure compatibility, ColdFire- > specific library objects such as cache and interrupt handling are > excluded from the build when M68040 is selected. > > Additionally, apply a specific workaround during the early memory > reservation stage. Use a manual loop to clear global data instead of > the standard memset() function, as utilizing memset() at this point was > observed to cause a hang on the QEMU platform. > > Signed-off-by: Kuan-Wei Chiu [snip] > diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig > index 8ade6f7b9d1..a41c375f6be 100644 > --- a/arch/m68k/Kconfig > +++ b/arch/m68k/Kconfig > @@ -56,6 +56,9 @@ config MCF5441x > select DM_SERIAL > bool > > +config M68040 > +bool > + The file is unfortunately inconsistent about tabs vs spaces, but all the new options should be tab-indent only, and no extra blank lines added. -- Tom signature.asc Description: PGP signature

