[PATCH 02/17] MIPS: malta: use CKSEG instead of KSEG macros

Denis Orlov denorl2009 at gmail.com
Tue Jun 6 02:14:30 PDT 2023


On Tue, 6 Jun 2023 at 11:03, Ahmad Fatoum <a.fatoum at pengutronix.de> wrote:
>
> On 05.06.23 22:10, Denis Orlov wrote:
> > KSEG macro is not available when compiling with CONFIG_64BIT enabled, so
> > use CKSEG instead.
>
> If they're interchangeable, why do we need KSEG?

Hmm, I think maybe we don't. We can replace every instance of KSEG with
CKSEG without any change in functionality, except for the fact that the
latter will compile with 64BIT enabled. Overall, it seems that a lot of
MIPS-specific headers were taken from Linux as is back when the support
for MIPS was being added to barebox. Those were already old and crufty
back then but there are also a lot of definitions that we neither need
nor use, yet which unnecessarily complicate the code. I might try
cleaning up those headers sometime in the future.

Regards,
Denis

>
> >
> > Signed-off-by: Denis Orlov <denorl2009 at gmail.com>
> > ---
> >  arch/mips/boards/qemu-malta/lowlevel.S | 4 ++--
> >  arch/mips/mach-malta/pci.c             | 2 +-
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/mips/boards/qemu-malta/lowlevel.S b/arch/mips/boards/qemu-malta/lowlevel.S
> > index 98821e0426..541d62fc2a 100644
> > --- a/arch/mips/boards/qemu-malta/lowlevel.S
> > +++ b/arch/mips/boards/qemu-malta/lowlevel.S
> > @@ -56,14 +56,14 @@ __start:
> >        */
> >
> >       /* move GT64120 registers to 0x1be00000 */
> > -     li      t1, KSEG1ADDR(GT_DEF_BASE)
> > +     li      t1, CKSEG1ADDR(GT_DEF_BASE)
> >       li      t0, GT_LD(MIPS_GT_BASE)
> >       sw      t0, GT_ISD_OFS(t1)
> >
> >       /*
> >        * setup MEM-to-PCI0 mapping
> >        */
> > -     li      t1, KSEG1ADDR(MIPS_GT_BASE)
> > +     li      t1, CKSEG1ADDR(MIPS_GT_BASE)
> >
> >       /* setup PCI0 io window */
> >       li      t0, GT_LD(0x18000000)
> > diff --git a/arch/mips/mach-malta/pci.c b/arch/mips/mach-malta/pci.c
> > index 113b94fe23..0ab239f509 100644
> > --- a/arch/mips/mach-malta/pci.c
> > +++ b/arch/mips/mach-malta/pci.c
> > @@ -136,7 +136,7 @@ static int gt64xxx_pci0_pcibios_write(struct pci_bus *bus, unsigned int devfn,
> >  static resource_size_t gt64xxx_res_start(struct pci_bus *bus,
> >                                        resource_size_t res_addr)
> >  {
> > -     return KSEG0ADDR(res_addr);
> > +     return CKSEG0ADDR(res_addr);
> >  }
> >
> >  struct pci_ops gt64xxx_pci0_ops = {
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>




More information about the barebox mailing list