From: Eugen.Hristev at microchip.com Date: Wed, 3 Apr 2019 11:05:09 +0000 Subject: [U-Boot] [PATCH 3/13 v4] serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL In-Reply-To: <508fba0a-a435-00eb-6786-8f44ccbddf7b@denx.de> References: <20190402112105.16492-1-sr@denx.de> <508fba0a-a435-00eb-6786-8f44ccbddf7b@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On 03.04.2019 13:58, Stefan Roese wrote: > Hi Eugen, > > On 03.04.19 12:52, Eugen.Hristev at microchip.com wrote: >> >> >> On 02.04.2019 14:21, Stefan Roese wrote: >> >>> This patch adds an alterative SPL version of atmel_serial_enable_clk(). >>> This enables the usage of this driver without full clock support (in >>> drivers and DT nodes). This saves some space in the SPL image. >>> >>> Please note that this fixed clock support is only added to the SPL code >>> in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL >>> should not be affected. >>> >>> This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART >>> input clock. It defaults to 132096000 for ARCH_AT91 but can be set to >>> a different value if needed. >>> >>> Signed-off-by: Stefan Roese >>> Cc: Heiko Schocher >>> Cc: Andreas Bießmann >>> Cc: Eugen Hristev >>> --- >>> v4: >>> - Restrict SPL_UART_CLOCK on SPL && !SPL_CLK >>> - Provide default value for non AT91 platforms to not break the >>>     build >>> - Fix typo in Kconfig text >>> >>> v3: >>> - Depend fixed clock atmel_serial_enable_clk() function also on >>>     !CONFIG_SPL_CLK so that board with full clocj support in SPL >>>     can still use the normal function here >>> - Introcude CONFIG_SPL_UART_CLOCK and use this Kconfig option instead >>>     of the hardcoded value >>> >>> v2: >>> - Reword patch subject and commit text to make it more clear, that >>>     this change only affects ports with SPL and DM_SERIAL enabled >>>    drivers/serial/Kconfig       | 10 ++++++++++ >>>    drivers/serial/atmel_usart.c | 12 ++++++++++++ >>>    2 files changed, 22 insertions(+) >>> >>> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig >>> index 887cd687c0..79fb397cf9 100644 >>> --- a/drivers/serial/Kconfig >>> +++ b/drivers/serial/Kconfig >>> @@ -508,6 +508,16 @@ config ATMEL_USART >>>          configured in the device tree, and input clock frequency can >>>          be got from the clk node. >>> +config SPL_UART_CLOCK >>> +    int "SPL fixed UART input clock" >>> +    depends on SPL && !SPL_CLK >>> +    default 132096000 if ARCH_AT91 >>> +    default 0 >>> +    help >>> +      Provide a fixed clock value as input to the UART controller. This >>> +      might be needed on platforms which can't enable CONFIG_SPL_CLK >>> +      because of SPL image size restrictions. >>> + >> Hi Stefan, >> >> Looking again over this, the Kconfig you added is useless and has no >> effect unless ATMEL_USART driver... >> Can you make it to depend on atmel usart or be named >> ATMEL_SPL_UART_CLOCK if this is not needed for anything else whatsoever >> (no other platforms/drivers) >> This way nobody gets confused that by enabling this Kconfig on their >> platform, something changes (like a fixed clock for their serial in SPL, >> which will not happen). > > My first intention was to add this Kconfig option as a generic one, > which can be used by other (non-AT91) platforms as well. This is > the reasoning for its name and the non-exclusive availability. > > But I have no hard feelings here. If nobody sees any use of this > Kconfig option on other platforms (hard for us to guess), then I can > definitely make your suggested changes from above. > Makes sense, but as it is now, it has no effect on other platforms. So I think it's best to make it a generic name indeed, but dependent on ATMEL_USART then... and other platforms can add their dependency once and if they implement it. Sounds good to you ? > Thanks, > Stefan