public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: am33xx: Make pin multiplexing functions optional
Date: Thu, 7 Sep 2017 11:14:28 -0400	[thread overview]
Message-ID: <20170907151428.GS17058@bill-the-cat> (raw)
In-Reply-To: <be48049d-62e3-d80a-431a-65a6ce3de7de@ltec.ch>

On Wed, Sep 06, 2017 at 04:57:52PM +0200, Felix Brack wrote:
> On 01.09.2017 17:21, Tom Rini wrote:
> > On Thu, Aug 31, 2017 at 03:16:17PM +0200, Felix Brack wrote:
> > 
> >> Boards using the single-register-pin-controller can  configure all
> >> pins by means of the device tree. This renders the implementation of
> >> the two functions set_uart_mux_conf and set_mux_conf_regs obsolete.
> >> Using the weak attribute for these two function declarations allows
> >> the omission of the respective definitions.
> >>
> >> Signed-off-by: Felix Brack <fb@ltec.ch>
> >> ---
> >>
> >>  arch/arm/include/asm/arch-am33xx/sys_proto.h | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> >> index 4e78aaf..e31c25c 100644
> >> --- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
> >> +++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> >> @@ -31,8 +31,8 @@ void enable_gpmc_cs_config(const u32 *gpmc_config, const struct gpmc_cs *cs, u32
> >>  			u32 size);
> >>  int omap_nand_switch_ecc(uint32_t, uint32_t);
> >>  
> >> -void set_uart_mux_conf(void);
> >> -void set_mux_conf_regs(void);
> >> +__weak void set_uart_mux_conf(void);
> >> +__weak void set_mux_conf_regs(void);
> >>  void sdram_init(void);
> >>  u32 wait_on_value(u32, u32, void *, u32);
> >>  #ifdef CONFIG_NOR_BOOT
> > 
> > This seems wrong in a few ways.  First, this (and the matching ones for
> > omap3, etc) should be full of externs instead and in that case __weak
> > makes no sense.  Then, on the technical side, what you're describing
> > isn't quite true in that you're likely relying on having the ROM to have
> > setup the 'normal' UART still for you, as it so often does, I believe.
> > Or in the case I'm wrong, then yes, you do get UART to work once we have
> > parsed the DT, but the "usual" case is that we want UART and thus
> > printf/etc to be available asap in case of errors, so it's still not a
> > recommended way to go.  Thanks!
> > 
> 
> Hi Tom,
> 
> Could you please explain what you mean by "... should be full of externs
> instead and in that case __weak makes no sense"?

I mean it's a header file.  We should only be declaring function
prototypes, and thus using 'extern' here.  It's not the right place to
have an inline weak function.

> The pins of the UART I use are not configured by the ROM, it is the pin
> controller driver configuring them.
> You are of course right in that UART output is not available before the
> pin controller driver has executed correctly. In my case the UART is
> available in 'spl_board_init()'. I know that many things can go wrong
> before this and therefore configuring UART pins in 'set_uart_mux_conf()'
> while using 'CONFIG_DEBUG_UART' is fine. In this context the word
> 'obsolete' may be wrong. The idea behind the patch is to not force the
> implementation of those two (potentially empty) functions.

I'm open to discussing making these functions be not required but then
the weak empty function should be under arch/arm/mach-omap2/ somewhere.
Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170907/58fe9e7f/attachment.sig>

  reply	other threads:[~2017-09-07 15:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 13:16 [U-Boot] [PATCH] arm: am33xx: Make pin multiplexing functions optional Felix Brack
2017-09-01 15:21 ` Tom Rini
2017-09-06 14:57   ` Felix Brack
2017-09-07 15:14     ` Tom Rini [this message]
2017-09-12 12:05       ` Felix Brack
2017-09-13  2:56         ` Tom Rini

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=20170907151428.GS17058@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox