All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Bert Vermeulen <bert@biot.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Sander Vanheule <sander@svanheule.net>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 2/4] MIPS: Add Realtek RTL838x/RTL839x support as generic MIPS system
Date: Tue, 5 Jan 2021 11:20:30 +0100	[thread overview]
Message-ID: <20210105102030.GA7323@alpha.franken.de> (raw)
In-Reply-To: <20201230212205.2605383-2-bert@biot.com>

On Wed, Dec 30, 2020 at 10:22:03PM +0100, Bert Vermeulen wrote:
> This is just enough system to boot the kernel with earlycon working.
> 
> Signed-off-by: Bert Vermeulen <bert@biot.com>
> Signed-off-by: Sander Vanheule <sander@svanheule.net>
> ---
>  arch/mips/Kconfig                       | 21 ++++++++++++++++++
>  arch/mips/generic/Platform              |  1 +
>  arch/mips/include/asm/realtek/ioremap.h | 29 +++++++++++++++++++++++++
>  3 files changed, 51 insertions(+)
>  create mode 100644 arch/mips/include/asm/realtek/ioremap.h
> [..]
> diff --git a/arch/mips/include/asm/realtek/ioremap.h b/arch/mips/include/asm/realtek/ioremap.h
> new file mode 100644
> index 000000000000..ea51af023e26
> --- /dev/null
> +++ b/arch/mips/include/asm/realtek/ioremap.h
> @@ -0,0 +1,29 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef _REALTEK_RTL_IOREMAP_H_
> +#define _REALTEK_RTL_IOREMAP_H_
> +
> +static inline int is_rtl8380_internal_registers(phys_addr_t offset)
> +{
> +	/* IO Block */
> +	if (offset >= 0xb8000000 && offset < 0xb9000000)
> +		return 1;
> +	/* Switch block */
> +	if (offset >= 0xbb000000 && offset < 0xbc000000)
> +		return 1;
> +	return 0;
> +}
> +
> +static inline void __iomem *plat_ioremap(phys_addr_t offset, unsigned long size,
> +					 unsigned long flags)
> +{
> +	if (is_rtl8380_internal_registers(offset))
> +		return (void __iomem *)offset;
> +	return NULL;
> +}
> +
> +static inline int plat_iounmap(const volatile void __iomem *addr)
> +{
> +	return is_rtl8380_internal_registers((unsigned long)addr);
> +}
> +
> +#endif /* _REALTEK_RTL_IOREMAP_H_ */

this looks like papering over using KSEG1 addresses instead of
physical addresses in your DT. You should be able to drop this file
and use 0x18000000/0x1B000000 instead of 0xb8000000/0xbb000000
in the DT file.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

  reply	other threads:[~2021-01-05 10:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 21:22 [PATCH v3 1/4] Add support for Realtek RTL838x/RTL839x switch SoCs Bert Vermeulen
2020-12-30 21:22 ` [PATCH v3 2/4] MIPS: Add Realtek RTL838x/RTL839x support as generic MIPS system Bert Vermeulen
2021-01-05 10:20   ` Thomas Bogendoerfer [this message]
2020-12-30 21:22 ` [PATCH v3 3/4] dt-bindings: Add Cisco prefix to vendor list Bert Vermeulen
2021-01-11 22:01   ` Rob Herring
2020-12-30 21:22 ` [PATCH v3 4/4] dts: Add support for Cisco SG220-26 switch Bert Vermeulen
2020-12-30 21:26 ` [PATCH v3 1/4] Add support for Realtek RTL838x/RTL839x switch SoCs Bert Vermeulen
2021-01-11 21:59 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210105102030.GA7323@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=bert@biot.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sander@svanheule.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.