All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] pinctrl: renesas: Fix linker error when PINCTRL_PFC=n
Date: Tue, 2 Apr 2019 18:02:46 +0200	[thread overview]
Message-ID: <22ce7959-7615-012b-73dd-b3aee3d21220@gmail.com> (raw)
In-Reply-To: <20190402154020.GA21698@vmlxhi-102.adit-jv.com>

On 4/2/19 5:40 PM, Eugeniu Rosca wrote:
> On Tue, Apr 02, 2019 at 05:28:43PM +0200, Marek Vasut wrote:
>> On 4/2/19 5:17 PM, Dirk Behme wrote:
>>> On 02.04.19 15:34, Marek Vasut wrote:
>>>> On 4/2/19 3:18 PM, Eugeniu Rosca wrote:
>>>>> With CONFIG_PINCTRL_PFC=n, aarch64-linux-gnu-ld reports:
>>>>>
>>>>> -----8<-----
>>>>>    LD      u-boot
>>>>> drivers/gpio/built-in.o: In function `rcar_gpio_request':
>>>>> drivers/gpio/gpio-rcar.c:128: undefined reference to
>>>>> `sh_pfc_config_mux_for_gpio'
>>>>> -----8<-----
>>>>>
>>>>> Fix it in the least intrusive way and *avoid* ifdefs in the *.c code.
>>>>>
>>>>> Some recent Linux commits sharing the same approach:
>>>>>   -
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=23222f8f8dce
>>>>>
>>>>>     ("acpi, nfit: Add function to look up nvdimm device and provide
>>>>> SMBIOS handle")
>>>>>   -
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f143af7501e
>>>>>
>>>>>     ("spi: make OF helper available for others")
>>>>>   -
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bccd06223f21
>>>>>
>>>>>     ("IB/uverbs: Add UVERBS_ATTR_FLAGS_IN to the specs language")
>>>>>
>>>>> Fixes: f6e545a73f88 ("pfc: rmobile: Add hook to configure pin as GPIO")
>>>>> Reported-by: Dirk Behme <dirk.behme@de.bosch.com>
>>>>> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
>>>>
>>>> Does CONFIG_PINCTRL_PFC=n produce a bootable binary ?
>>>
>>>
>>> Why not? Main memory, boot device and UART are configured before U-Boot,
>>> no?
>>
>> It depends on what is running before U-Boot, so not necessarily.
>>
>> And speaking of boot device, consider the case where the system runs
>> from eMMC and uses the HS200/HS400 modes, which need to switch bus mode
>> using the pinmux driver.
>>
>> Is there a real-world use case where you would want to disable the
>> pinmux driver ? And what is the benefit of that, except that it would
>> cause all kinds of weird problems.
> 
> My H3ULCB-KF boots just fine [1] with CONFIG_PINCTRL_PFC=n, but I
> personally don't have any use-case which I need to fulfill on a
> Renesas reference design by disabling PFC.

And the eMMC and SDHI both work fine too in HS400/SDR104 modes ?
They cannot, since you cannot switch the pinmux properties of the bus.
What about the errors in the log below, they don't look quite fine.

> Rather, the motivation here is to ensure U-Boot builds fine with as
> many randconfig results as possible, which is a standard practice in
> Linux. I personally favor my solution, but I am also open minded if
> the linker error is avoided by introducing a direct/reverse dependency
> between PFC and another relevant R-Car3 Kconfig symbol.

I am fine with fixing randconfig build errors. My question here is
whether it makes sense to allow U-Boot build without PFC support,
since that would cause all kinds of problems. I am banking toward
playing it safe and not allowing such an option at all. Thoughts ?

> [1] U-Boot 2019.04-rc4-00100-g03ece61db8 (Apr 02 2019 - 17:23:57 +0200)
> 
> CPU: Renesas Electronics R8A7795 rev 2.0
> Model: Renesas H3ULCB board based on r8a7795 ES2.0+
> DRAM:  3.9 GiB
> MMC:   gpio at e6055000: set_value: error: gpio gpio at e60550001 not reserved
> Can't set regulator : regulator-vccq-sdhi0 gpio to: 1
> sd at ee100000: 0, sd at ee140000: 1
> Loading Environment from MMC... OK
> In:    serial at e6e88000
> Out:   serial at e6e88000
> Err:   serial at e6e88000
> Net:   gpio at e6052000: set_value: error: gpio gpio at e605200010 not reserved
> gpio at e6052000: set_value: error: gpio gpio at e605200010 not reserved
> eth0: ethernet at e6800000
> Hit any key to stop autoboot:  0 
> 
>> -- 
>> Best regards,
>> Marek Vasut
> 
> Best regards,
> Eugeniu.
> 


-- 
Best regards,
Marek Vasut

  reply	other threads:[~2019-04-02 16:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 13:18 [U-Boot] [PATCH] pinctrl: renesas: Fix linker error when PINCTRL_PFC=n Eugeniu Rosca
2019-04-02 13:34 ` Marek Vasut
2019-04-02 15:17   ` Dirk Behme
2019-04-02 15:28     ` Marek Vasut
2019-04-02 15:40       ` Eugeniu Rosca
2019-04-02 16:02         ` Marek Vasut [this message]
2019-04-02 17:02           ` Eugeniu Rosca
2019-04-03 12:11             ` Marek Vasut
2019-04-03 12:30               ` Dirk Behme
2019-04-03 14:01                 ` Marek Vasut
2019-04-04  1:36                   ` Marek Vasut
2019-04-04 12:42                     ` Eugeniu Rosca
2019-04-21 22:23                       ` Marek Vasut
2019-04-02 17:58         ` Dirk Behme
2019-04-03 12:08           ` Marek Vasut

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=22ce7959-7615-012b-73dd-b3aee3d21220@gmail.com \
    --to=marek.vasut@gmail.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 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.