All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 1/4] arm: socfpga: imply SPL config instead of select
Date: Mon, 14 Jan 2019 21:23:53 +0100	[thread overview]
Message-ID: <0984c8c9-f80a-8eef-4bbd-a5723fd0d013@denx.de> (raw)
In-Reply-To: <8569b306-2984-11e3-1d10-7e906749b5b2@gmail.com>

On 1/14/19 9:12 PM, Simon Goldschmidt wrote:
> Am 14.01.2019 um 21:01 schrieb Marek Vasut:
>> On 1/14/19 8:43 PM, Simon Goldschmidt wrote:
>>> Am 14.01.2019 um 20:33 schrieb Marek Vasut:
>>>> On 1/14/19 7:58 PM, Simon Goldschmidt wrote:
>>>>> Am 14.01.2019 um 19:31 schrieb Marek Vasut:
>>>>>> On 1/14/19 5:05 PM, Simon Goldschmidt wrote:
>>>>>>> Hi Dinh,
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>> Am 14.01.2019 um 16:58 schrieb Dinh Nguyen:
>>>>>>>> Hi Simon,
>>>>>>>>
>>>>>>>> On 1/14/19 9:50 AM, Simon Goldschmidt wrote:
>>>>>>>>> Am 11.01.2019 um 23:02 schrieb Marek Vasut:
>>>>>>>>>> On 1/11/19 9:39 PM, Simon Goldschmidt wrote:
>>>>>>>>>>> Am 07.01.2019 um 23:53 schrieb Marek Vasut:
>>>>>>>>>>>> On 1/7/19 10:14 PM, Simon Goldschmidt wrote:
>>>>>>>>>>>>> In order to build a smaller SPL, let's imply SPL_DM_RESET and
>>>>>>>>>>>>> SPL_WATCHDOG_SUPPORT instead of selecting them, so they can be
>>>>>>>>>>>>> disabled
>>>>>>>>>>>>> via defconfig.
>>>>>>>>>>>>>
>>>>>>>>>>>>> This also seems to be required to use OF_PLATDATA, as the
>>>>>>>>>>>>> reset
>>>>>>>>>>>>> drivers
>>>>>>>>>>>>> don't seem to work with it.
>>>>>>>>>>>>
>>>>>>>>>>>> How do you un-reset IP blocks if you disable the reset
>>>>>>>>>>>> controller ?
>>>>>>>>>>>
>>>>>>>>>>> I found that out just now: there's the function
>>>>>>>>>>> 'reset_deassert_peripherals_handoff()' in spl_gen5.c that should
>>>>>>>>>>> "De-assert reset for peripherals and bridges based on handoff".
>>>>>>>>>>> However,
>>>>>>>>>>> at least for Gen5, it just writes a 0 to rstmgr->permodrst. By
>>>>>>>>>>> doing
>>>>>>>>>>> that, it enables *ALL* peripherals on the SoC (except for
>>>>>>>>>>> some DMA
>>>>>>>>>>> channels that aren't really used) :-)
>>>>>>>>>>>
>>>>>>>>>>> I guess that needs some cleaning up as well ;-)
>>>>>>>>>>
>>>>>>>>>> Yes
>>>>>>>>>>
>>>>>>>>>>> I think the proper thing to do here would be to remove this
>>>>>>>>>>> function and
>>>>>>>>>>> convert all drivers to provide appropriate 'resets'
>>>>>>>>>>> properties in
>>>>>>>>>>> the
>>>>>>>>>>> dts?
>>>>>>>>>>
>>>>>>>>>> Indeed
>>>>>>>>>
>>>>>>>>> So I just did that and it works nice for SPL and U-Boot: By adding
>>>>>>>>> some
>>>>>>>>> "resets" properties the the main dtsi and adding reset bulk
>>>>>>>>> code to
>>>>>>>>> the
>>>>>>>>> cadence_qspi, denali_dt nand and drivers, I can nearly remove the
>>>>>>>>> reset
>>>>>>>>> code from arch/mach_socfpga.
>>>>>>>>>
>>>>>>>>> The problem would be that now Linux cannot use peripherals that
>>>>>>>>> aren't
>>>>>>>>> enabled by U-Boot because it relies on them being enabled. How are
>>>>>>>>> such
>>>>>>>>> dependencies solved? Because even if I would add reset support in
>>>>>>>>> the
>>>>>>>>> corresponding Linux drivers, we probably could not bootolder
>>>>>>>>> Kernels
>>>>>>>>> (e.g. the Debian 9 kernel - v4.9.x) with a new U-Boot...
>>>>>>>>>
>>>>>>>>
>>>>>>>> I added an early reset driver for SoCFPGA that should take care of
>>>>>>>> this.
>>>>>>>> The patch is in v5.0-rc2[1].
>>>>>>>
>>>>>>> OK, it's good to know that this work is already done, I haven't
>>>>>>> monitored this close enough.
>>>>>>
>>>>>> We had the same problem with A10, indeed.
>>>>>>
>>>>>>> But am I correct that my above problem remains even in v5.0 as
>>>>>>> not all
>>>>>>> peripherals in socfpga.dtsi have a "resets" property set (e.g.
>>>>>>> mmc and
>>>>>>> qspi) and would thuse not be taken out of reset by Linux?
>>>>>>>
>>>>>>> Plus: should U-Boot work with older Linux kernels? Because if so, we
>>>>>>> need fallback code in U-Boot to unreset peripherals when running
>>>>>>> with an
>>>>>>> older kernel...
>>>>>>
>>>>>> Yes, it'd break old broken kernels . The real question is, do we
>>>>>> care ?
>>>>>
>>>>> Ok, so that at leat shows me I'm going into the right direction :-)
>>>>>
>>>>> There are some problems though:
>>>>> - I do care (we're running 4.9 currently) *g*
>>>>> - people running an RT kernel will care for a while (until the next
>>>>> stable RT after fixing this will be released)
>>>>> - we would currently be breaking *all* kernels, since no kernel should
>>>>> yet be able to deassert reset for mmc and qspi (unless this is already
>>>>> done by U-Boot)...
>>>>>
>>>>> So would it be OK to add a Kconfig option to U-Boot to keep the
>>>>> current
>>>>> behaviour (for old broken kernels like you said) until that code is
>>>>> spread widely enough? Or is that a no-go?
>>>>
>>>> Would be nice to be able to tweak the reset driver behavior at runtime,
>>>> to unreset things before booting the kernel if the user desires so.
>>>
>>> Instead of tweaking the reset driver, we could just add a command that
>>> does that 'rstmgr->permodrst = 0;' thing my patch would remove.
>>
>> I don't want a new custom command.
>>
>>> Since noone has complained so far, I think writing 0 should be OK here.
>>> I don't think it would make too much sense to use the reset handoff
>>> defines from Quartus output for such a command. I think the way Quartus
>>> does this is strange anyway...
>>>
>>> The question is if defconfigs should be able to use this to
>>> automatically build a U-Boot config for older kernels. If so, we'd still
>>> need a Kconfig option?
>>
>> I'd much rather have this runtime configurable.
> 
> Then I'm afraid I don't know what you mean by "runtime configurable".
> What should be the configuration source that is evaluated at runtime?

I wonder ... maybe an environment variable with a U_BOOT_ENV_CALLBACK()
hook ?

>>> Thinking further about cleanup: I guess the clock driver is not that
>>> hard to implement, either. The only thing that's driving me mad is
>>> pinmux. Is there any chance to get more info from Intel to write this
>>> properly so we can get rid of that iocsr scanchain defines?
>>
>> Clock driver should be easy, yes. Pinmux, I don't know, maybe project
>> chibi has some information (the cyclone I documentation project).
> 
> Interesing, I didn't know that project. The only thing I found is a repo
> on github. But it seems like that one only contains FPGA-related stuff,
> nothing about the HPS side...

My understanding is that the IOCSR ring is on the FPGA side and it's
exactly the same as pinmux configuration for the FPGA IO, but I might be
wrong.

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2019-01-14 20:23 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 21:14 [U-Boot] [PATCH v1 0/4] arm: socfgpa: support of-platdata Simon Goldschmidt
2019-01-07 21:14 ` [U-Boot] [PATCH v1 1/4] arm: socfpga: imply SPL config instead of select Simon Goldschmidt
2019-01-07 22:53   ` Marek Vasut
2019-01-08  6:24     ` Simon Goldschmidt
2019-01-08 11:22       ` Marek Vasut
2019-01-08 12:09         ` Simon Goldschmidt
2019-01-08 12:22           ` Marek Vasut
2019-01-08 12:46             ` Simon Goldschmidt
2019-01-08 12:49               ` Marek Vasut
2019-01-08 14:48                 ` Tom Rini
2019-01-08 14:50                   ` Marek Vasut
2019-01-08 14:58                     ` Tom Rini
2019-01-08 15:04                       ` Simon Goldschmidt
2019-01-08 15:11                         ` Tom Rini
2019-01-08 15:05                       ` Marek Vasut
2019-01-08 15:01                     ` Simon Goldschmidt
2019-01-08 20:52                       ` Simon Goldschmidt
2019-01-08 20:54                         ` Marek Vasut
2019-01-11 20:39     ` Simon Goldschmidt
2019-01-11 22:02       ` Marek Vasut
2019-01-14 15:50         ` Simon Goldschmidt
2019-01-14 15:58           ` Dinh Nguyen
2019-01-14 16:05             ` Simon Goldschmidt
2019-01-14 18:31               ` Marek Vasut
2019-01-14 18:58                 ` Simon Goldschmidt
2019-01-14 19:33                   ` Marek Vasut
2019-01-14 19:43                     ` Simon Goldschmidt
2019-01-14 20:01                       ` Marek Vasut
2019-01-14 20:12                         ` Simon Goldschmidt
2019-01-14 20:23                           ` Marek Vasut [this message]
2019-01-14 20:30                             ` Simon Goldschmidt
2019-01-14 20:49                               ` Marek Vasut
2019-01-14 20:59                                 ` Simon Goldschmidt
2019-01-14 21:28                 ` Tom Rini
2019-01-14 21:30                   ` Marek Vasut
2019-01-14 21:35                     ` Simon Goldschmidt
2019-01-14 21:50                     ` Tom Rini
2019-01-14 21:53                       ` Simon Goldschmidt
2019-01-14 21:57                         ` Marek Vasut
2019-01-14 22:26               ` Dinh Nguyen
2019-01-15  6:59                 ` Simon Goldschmidt
2019-01-07 21:14 ` [U-Boot] [PATCH v1 2/4] arm: socfpga: fix compiling with OF_PLATDATA Simon Goldschmidt
2019-01-07 22:53   ` Marek Vasut
2019-01-08  6:32     ` Simon Goldschmidt
2019-01-08 11:46       ` Marek Vasut
2019-01-08 12:14         ` Simon Goldschmidt
2019-01-08 12:23           ` Marek Vasut
2019-01-07 21:14 ` [U-Boot] [PATCH v1 3/4] serial: add an of-platdata driver for "snps, dw-apb-uart" Simon Goldschmidt
2019-01-07 22:12   ` Lukasz Majewski
2019-01-08  6:06     ` Simon Goldschmidt
2019-01-08  7:30       ` Lukasz Majewski
2019-01-08  7:41         ` Simon Goldschmidt
2019-01-08  8:49           ` Lukasz Majewski
2019-01-09  8:35   ` Alexey Brodkin
2019-01-09 11:33     ` Simon Goldschmidt
2019-01-09 18:43     ` Simon Goldschmidt
2019-01-11  8:33       ` Alexey Brodkin
2019-01-11  8:41         ` Simon Goldschmidt
2019-01-11  9:03           ` Alexey Brodkin
2019-01-11 10:00             ` Simon Goldschmidt
2019-01-11  9:22     ` Andy Shevchenko
2019-01-11 10:01       ` Simon Goldschmidt
2019-01-16 21:35         ` Simon Glass
2019-01-10 12:56   ` Simon Glass
2019-01-07 21:14 ` [U-Boot] [PATCH v1 4/4] mmc: socfpga: support of-platdata Simon Goldschmidt
2019-01-07 21:59 ` [U-Boot] [PATCH v1 0/4] arm: socfgpa: " Lukasz Majewski
2019-01-08  6:53   ` Simon Goldschmidt
2019-01-07 22:57 ` Marek Vasut
2019-01-08  6:56   ` Simon Goldschmidt
2019-01-08 11:49     ` Marek Vasut
2019-01-08 12:38       ` Simon Goldschmidt
2019-01-08 12:57         ` Marek Vasut
2019-01-08 13:07           ` Simon Goldschmidt
2019-01-08 13:38             ` Marek Vasut
2019-01-08 13:51               ` Simon Goldschmidt
2019-01-08 14:43                 ` Marek Vasut
2019-02-01 18:58                   ` Simon Goldschmidt

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=0984c8c9-f80a-8eef-4bbd-a5723fd0d013@denx.de \
    --to=marex@denx.de \
    --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.