Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-03 Thread Marek Vasut
On 08/03/2018 10:24 PM, Simon Goldschmidt wrote:
> 
> 
> On 03.08.2018 13:01, Simon Goldschmidt wrote:
>>
>>
>> Marek Vasut mailto:ma...@denx.de>> schrieb am Fr., 3.
>> Aug. 2018, 11:22:
>>
>>     On 08/03/2018 11:10 AM, Simon Goldschmidt wrote:
>>  >
>>  >
>>  > Marek Vasut mailto:ma...@denx.de>
>>     >> schrieb am Fr., 3.
>>  > Aug. 2018, 11:00:
>>  >
>>  >     On 08/03/2018 10:40 AM, Simon Goldschmidt wrote:
>>  >     >
>>  >     >
>>  >     > On 01.08.2018 09:34, Marek Vasut wrote:
>>  >     >> On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
>>  >     >>>
>>  >     >>> On 30.07.2018 16:04, Marek Vasut wrote:
>>  >      On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
>>  >     >
>>  >     > On 12.05.2018 22:28, Marek Vasut wrote:
>>  >     >> Pull the serial port configuration from DT and use DM
>>     serial
>>  >     instead
>>  >     >> of having the serial configuration in two places, DT
>>     and board
>>  >     >> config.
>>  >     >>
>>  >     >> Signed-off-by: Marek Vasut >      >>
>>  >     >> Cc: Chin Liang See >     
>>  >     >     >>
>>  >     >> Cc: Dinh Nguyen >     
>>  >     >>
>>  >     >> ---
>>  >     >>     arch/arm/Kconfig | 3
>> +++
>>  >     >>     arch/arm/dts/socfpga.dtsi    | 2 ++
>>  >     >>     arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
>>  >     >>     include/configs/socfpga_common.h | 8
>>     
>>  >     >>     4 files changed, 6 insertions(+), 8 deletions(-)
>>  >     >>
>>  >     >> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>  >     >> index 532aa41a87..2012ac6410 100644
>>  >     >> --- a/arch/arm/Kconfig
>>  >     >> +++ b/arch/arm/Kconfig
>>  >     >> @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
>>  >     >>     select ARCH_MISC_INIT
>>  >     >>     select CPU_V7A
>>  >     >>     select DM
>>  >     >> +    select DM_SERIAL
>>  >     >>     select ENABLE_ARM_SOC_BOOT0_HOOK
>>  >     >>     select OF_CONTROL
>>  >     >>     select SPL_LIBCOMMON_SUPPORT
>>  >     >> @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
>>  >     >>     select SPL_NAND_SUPPORT if SPL_NAND_DENALI
>>  >     >>     select SPL_OF_CONTROL
>>  >     >>     select SPL_SERIAL_SUPPORT
>>  >     >> +    select SPL_DM_SERIAL
>>  >     >>     select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
>>  >     >>     select SPL_SPI_SUPPORT if DM_SPI
>>  >     >>     select SPL_WATCHDOG_SUPPORT
>>  >     >>     select SUPPORT_SPL
>>  >     >>     select
>>     SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
>>  >     >> +    select SYS_NS16550
>>  >     >>     select SYS_THUMB_BUILD
>>  >     >>     imply CMD_MTDPARTS
>>  >     >>     imply CRC32_VERIFY
>>  >     >> diff --git a/arch/arm/dts/socfpga.dtsi
>>  >     b/arch/arm/dts/socfpga.dtsi
>>  >     >> index e64127fcb2..314449478d 100644
>>  >     >> --- a/arch/arm/dts/socfpga.dtsi
>>  >     >> +++ b/arch/arm/dts/socfpga.dtsi
>>  >     >> @@ -737,6 +737,7 @@
>>  >     >>     reg-shift = <2>;
>>  >     >>     reg-io-width = <4>;
>>  >     >>     clocks = <_sp_clk>;
>>  >     >> +    clock-frequency = <1>;
>>  >     >>     };
>>  >     >>       uart1: serial1@ffc03000 {
>>  >     >> @@ -746,6 +747,7 @@
>>  >     >>     reg-shift = <2>;
>>  >     >>     reg-io-width = <4>;
>>  >     >>     clocks = <_sp_clk>;
>>  >     >> +    clock-frequency = <1>;
>>  >     >>     };
>>  >     >>       rst: rstmgr@ffd05000 {
>>  >     >> diff --git
>> a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>>  >     >> b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>>  >     >> index b573d0e658..06b61cb0af 100644
>>  >     >> --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>>  >     >> +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>>  >     >> @@ -24,6 +24,7 @@
>>  >     >>     };
>>  >     >>        {
>>  >     >> +    clock-frequency = <5000>;
>>  >     >>     u-boot,dm-pre-reloc;
>>  >  

Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-03 Thread Simon Goldschmidt



On 03.08.2018 13:01, Simon Goldschmidt wrote:



Marek Vasut mailto:ma...@denx.de>> schrieb am Fr., 3. 
Aug. 2018, 11:22:


On 08/03/2018 11:10 AM, Simon Goldschmidt wrote:
 >
 >
 > Marek Vasut mailto:ma...@denx.de>
>> schrieb am Fr., 3.
 > Aug. 2018, 11:00:
 >
 >     On 08/03/2018 10:40 AM, Simon Goldschmidt wrote:
 >     >
 >     >
 >     > On 01.08.2018 09:34, Marek Vasut wrote:
 >     >> On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
 >     >>>
 >     >>> On 30.07.2018 16:04, Marek Vasut wrote:
 >      On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
 >     >
 >     > On 12.05.2018 22:28, Marek Vasut wrote:
 >     >> Pull the serial port configuration from DT and use DM
serial
 >     instead
 >     >> of having the serial configuration in two places, DT
and board
 >     >> config.
 >     >>
 >     >> Signed-off-by: Marek Vasut mailto:ma...@denx.de> >>
 >     >> Cc: Chin Liang See mailto:chin.liang@intel.com>
 >     >>
 >     >> Cc: Dinh Nguyen mailto:dingu...@kernel.org>
 >     >>
 >     >> ---
 >     >>     arch/arm/Kconfig | 3 +++
 >     >>     arch/arm/dts/socfpga.dtsi    | 2 ++
 >     >>     arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
 >     >>     include/configs/socfpga_common.h | 8

 >     >>     4 files changed, 6 insertions(+), 8 deletions(-)
 >     >>
 >     >> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
 >     >> index 532aa41a87..2012ac6410 100644
 >     >> --- a/arch/arm/Kconfig
 >     >> +++ b/arch/arm/Kconfig
 >     >> @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
 >     >>     select ARCH_MISC_INIT
 >     >>     select CPU_V7A
 >     >>     select DM
 >     >> +    select DM_SERIAL
 >     >>     select ENABLE_ARM_SOC_BOOT0_HOOK
 >     >>     select OF_CONTROL
 >     >>     select SPL_LIBCOMMON_SUPPORT
 >     >> @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
 >     >>     select SPL_NAND_SUPPORT if SPL_NAND_DENALI
 >     >>     select SPL_OF_CONTROL
 >     >>     select SPL_SERIAL_SUPPORT
 >     >> +    select SPL_DM_SERIAL
 >     >>     select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
 >     >>     select SPL_SPI_SUPPORT if DM_SPI
 >     >>     select SPL_WATCHDOG_SUPPORT
 >     >>     select SUPPORT_SPL
 >     >>     select
SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
 >     >> +    select SYS_NS16550
 >     >>     select SYS_THUMB_BUILD
 >     >>     imply CMD_MTDPARTS
 >     >>     imply CRC32_VERIFY
 >     >> diff --git a/arch/arm/dts/socfpga.dtsi
 >     b/arch/arm/dts/socfpga.dtsi
 >     >> index e64127fcb2..314449478d 100644
 >     >> --- a/arch/arm/dts/socfpga.dtsi
 >     >> +++ b/arch/arm/dts/socfpga.dtsi
 >     >> @@ -737,6 +737,7 @@
 >     >>     reg-shift = <2>;
 >     >>     reg-io-width = <4>;
 >     >>     clocks = <_sp_clk>;
 >     >> +    clock-frequency = <1>;
 >     >>     };
 >     >>       uart1: serial1@ffc03000 {
 >     >> @@ -746,6 +747,7 @@
 >     >>     reg-shift = <2>;
 >     >>     reg-io-width = <4>;
 >     >>     clocks = <_sp_clk>;
 >     >> +    clock-frequency = <1>;
 >     >>     };
 >     >>       rst: rstmgr@ffd05000 {
 >     >> diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
 >     >> b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
 >     >> index b573d0e658..06b61cb0af 100644
 >     >> --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
 >     >> +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
 >     >> @@ -24,6 +24,7 @@
 >     >>     };
 >     >>        {
 >     >> +    clock-frequency = <5000>;
 >     >>     u-boot,dm-pre-reloc;
 >     >>     status = "okay";
 >     >>     };
 >     >> diff --git a/include/configs/socfpga_common.h
 >     >> b/include/configs/socfpga_common.h
 >     >> index 54b9edc97c..a60da85499 100644
 >     >> --- a/include/configs/socfpga_common.h
 >     >> +++ b/include/configs/socfpga_common.h
 >     >> @@ -173,14 

Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-03 Thread Simon Goldschmidt
Marek Vasut  schrieb am Fr., 3. Aug. 2018, 11:22:

> On 08/03/2018 11:10 AM, Simon Goldschmidt wrote:
> >
> >
> > Marek Vasut mailto:ma...@denx.de>> schrieb am Fr., 3.
> > Aug. 2018, 11:00:
> >
> > On 08/03/2018 10:40 AM, Simon Goldschmidt wrote:
> > >
> > >
> > > On 01.08.2018 09:34, Marek Vasut wrote:
> > >> On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
> > >>>
> > >>> On 30.07.2018 16:04, Marek Vasut wrote:
> >  On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
> > >
> > > On 12.05.2018 22:28, Marek Vasut wrote:
> > >> Pull the serial port configuration from DT and use DM serial
> > instead
> > >> of having the serial configuration in two places, DT and board
> > >> config.
> > >>
> > >> Signed-off-by: Marek Vasut  ma...@denx.de>>
> > >> Cc: Chin Liang See  > >
> > >> Cc: Dinh Nguyen  > >
> > >> ---
> > >> arch/arm/Kconfig | 3 +++
> > >> arch/arm/dts/socfpga.dtsi| 2 ++
> > >> arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
> > >> include/configs/socfpga_common.h | 8 
> > >> 4 files changed, 6 insertions(+), 8 deletions(-)
> > >>
> > >> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > >> index 532aa41a87..2012ac6410 100644
> > >> --- a/arch/arm/Kconfig
> > >> +++ b/arch/arm/Kconfig
> > >> @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
> > >> select ARCH_MISC_INIT
> > >> select CPU_V7A
> > >> select DM
> > >> +select DM_SERIAL
> > >> select ENABLE_ARM_SOC_BOOT0_HOOK
> > >> select OF_CONTROL
> > >> select SPL_LIBCOMMON_SUPPORT
> > >> @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
> > >> select SPL_NAND_SUPPORT if SPL_NAND_DENALI
> > >> select SPL_OF_CONTROL
> > >> select SPL_SERIAL_SUPPORT
> > >> +select SPL_DM_SERIAL
> > >> select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
> > >> select SPL_SPI_SUPPORT if DM_SPI
> > >> select SPL_WATCHDOG_SUPPORT
> > >> select SUPPORT_SPL
> > >> select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
> > >> +select SYS_NS16550
> > >> select SYS_THUMB_BUILD
> > >> imply CMD_MTDPARTS
> > >> imply CRC32_VERIFY
> > >> diff --git a/arch/arm/dts/socfpga.dtsi
> > b/arch/arm/dts/socfpga.dtsi
> > >> index e64127fcb2..314449478d 100644
> > >> --- a/arch/arm/dts/socfpga.dtsi
> > >> +++ b/arch/arm/dts/socfpga.dtsi
> > >> @@ -737,6 +737,7 @@
> > >> reg-shift = <2>;
> > >> reg-io-width = <4>;
> > >> clocks = <_sp_clk>;
> > >> +clock-frequency = <1>;
> > >> };
> > >>   uart1: serial1@ffc03000 {
> > >> @@ -746,6 +747,7 @@
> > >> reg-shift = <2>;
> > >> reg-io-width = <4>;
> > >> clocks = <_sp_clk>;
> > >> +clock-frequency = <1>;
> > >> };
> > >>   rst: rstmgr@ffd05000 {
> > >> diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> > >> b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> > >> index b573d0e658..06b61cb0af 100644
> > >> --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> > >> +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> > >> @@ -24,6 +24,7 @@
> > >> };
> > >>{
> > >> +clock-frequency = <5000>;
> > >> u-boot,dm-pre-reloc;
> > >> status = "okay";
> > >> };
> > >> diff --git a/include/configs/socfpga_common.h
> > >> b/include/configs/socfpga_common.h
> > >> index 54b9edc97c..a60da85499 100644
> > >> --- a/include/configs/socfpga_common.h
> > >> +++ b/include/configs/socfpga_common.h
> > >> @@ -173,14 +173,6 @@ unsigned int
> > >> cm_get_qspi_controller_clk_hz(void);
> > >>  * Serial Driver
> > >>  */
> > >> #define CONFIG_SYS_NS16550_SERIAL
> > >> -#define CONFIG_SYS_NS16550_REG_SIZE-4
> > >> -#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> > >> -#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART0_ADDRESS
> > >> -#define CONFIG_SYS_NS16550_CLK1
> > >> -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
> > >> -#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART1_ADDRESS
> > >> -#define 

Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-03 Thread Marek Vasut
On 08/03/2018 11:10 AM, Simon Goldschmidt wrote:
> 
> 
> Marek Vasut mailto:ma...@denx.de>> schrieb am Fr., 3.
> Aug. 2018, 11:00:
> 
> On 08/03/2018 10:40 AM, Simon Goldschmidt wrote:
> >
> >
> > On 01.08.2018 09:34, Marek Vasut wrote:
> >> On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
> >>>
> >>> On 30.07.2018 16:04, Marek Vasut wrote:
>  On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
> >
> > On 12.05.2018 22:28, Marek Vasut wrote:
> >> Pull the serial port configuration from DT and use DM serial
> instead
> >> of having the serial configuration in two places, DT and board
> >> config.
> >>
> >> Signed-off-by: Marek Vasut mailto:ma...@denx.de>>
> >> Cc: Chin Liang See  >
> >> Cc: Dinh Nguyen  >
> >> ---
> >>     arch/arm/Kconfig | 3 +++
> >>     arch/arm/dts/socfpga.dtsi    | 2 ++
> >>     arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
> >>     include/configs/socfpga_common.h | 8 
> >>     4 files changed, 6 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >> index 532aa41a87..2012ac6410 100644
> >> --- a/arch/arm/Kconfig
> >> +++ b/arch/arm/Kconfig
> >> @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
> >>     select ARCH_MISC_INIT
> >>     select CPU_V7A
> >>     select DM
> >> +    select DM_SERIAL
> >>     select ENABLE_ARM_SOC_BOOT0_HOOK
> >>     select OF_CONTROL
> >>     select SPL_LIBCOMMON_SUPPORT
> >> @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
> >>     select SPL_NAND_SUPPORT if SPL_NAND_DENALI
> >>     select SPL_OF_CONTROL
> >>     select SPL_SERIAL_SUPPORT
> >> +    select SPL_DM_SERIAL
> >>     select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
> >>     select SPL_SPI_SUPPORT if DM_SPI
> >>     select SPL_WATCHDOG_SUPPORT
> >>     select SUPPORT_SPL
> >>     select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
> >> +    select SYS_NS16550
> >>     select SYS_THUMB_BUILD
> >>     imply CMD_MTDPARTS
> >>     imply CRC32_VERIFY
> >> diff --git a/arch/arm/dts/socfpga.dtsi
> b/arch/arm/dts/socfpga.dtsi
> >> index e64127fcb2..314449478d 100644
> >> --- a/arch/arm/dts/socfpga.dtsi
> >> +++ b/arch/arm/dts/socfpga.dtsi
> >> @@ -737,6 +737,7 @@
> >>     reg-shift = <2>;
> >>     reg-io-width = <4>;
> >>     clocks = <_sp_clk>;
> >> +    clock-frequency = <1>;
> >>     };
> >>       uart1: serial1@ffc03000 {
> >> @@ -746,6 +747,7 @@
> >>     reg-shift = <2>;
> >>     reg-io-width = <4>;
> >>     clocks = <_sp_clk>;
> >> +    clock-frequency = <1>;
> >>     };
> >>       rst: rstmgr@ffd05000 {
> >> diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> >> b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> >> index b573d0e658..06b61cb0af 100644
> >> --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> >> +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> >> @@ -24,6 +24,7 @@
> >>     };
> >>        {
> >> +    clock-frequency = <5000>;
> >>     u-boot,dm-pre-reloc;
> >>     status = "okay";
> >>     };
> >> diff --git a/include/configs/socfpga_common.h
> >> b/include/configs/socfpga_common.h
> >> index 54b9edc97c..a60da85499 100644
> >> --- a/include/configs/socfpga_common.h
> >> +++ b/include/configs/socfpga_common.h
> >> @@ -173,14 +173,6 @@ unsigned int
> >> cm_get_qspi_controller_clk_hz(void);
> >>  * Serial Driver
> >>  */
> >>     #define CONFIG_SYS_NS16550_SERIAL
> >> -#define CONFIG_SYS_NS16550_REG_SIZE    -4
> >> -#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> >> -#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART0_ADDRESS
> >> -#define CONFIG_SYS_NS16550_CLK    1
> >> -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
> >> -#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART1_ADDRESS
> >> -#define CONFIG_SYS_NS16550_CLK    5000
> >> -#endif
> >>       /*
> >>  * USB
> >>
> > Unfortunately I saw this just now, but it seems this breaks GEN5
> > SPL? At
> > least git-bisect told me that
> 

Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-03 Thread Simon Goldschmidt
Marek Vasut  schrieb am Fr., 3. Aug. 2018, 11:00:

> On 08/03/2018 10:40 AM, Simon Goldschmidt wrote:
> >
> >
> > On 01.08.2018 09:34, Marek Vasut wrote:
> >> On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
> >>>
> >>> On 30.07.2018 16:04, Marek Vasut wrote:
>  On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
> >
> > On 12.05.2018 22:28, Marek Vasut wrote:
> >> Pull the serial port configuration from DT and use DM serial instead
> >> of having the serial configuration in two places, DT and board
> >> config.
> >>
> >> Signed-off-by: Marek Vasut 
> >> Cc: Chin Liang See 
> >> Cc: Dinh Nguyen 
> >> ---
> >> arch/arm/Kconfig | 3 +++
> >> arch/arm/dts/socfpga.dtsi| 2 ++
> >> arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
> >> include/configs/socfpga_common.h | 8 
> >> 4 files changed, 6 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >> index 532aa41a87..2012ac6410 100644
> >> --- a/arch/arm/Kconfig
> >> +++ b/arch/arm/Kconfig
> >> @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
> >> select ARCH_MISC_INIT
> >> select CPU_V7A
> >> select DM
> >> +select DM_SERIAL
> >> select ENABLE_ARM_SOC_BOOT0_HOOK
> >> select OF_CONTROL
> >> select SPL_LIBCOMMON_SUPPORT
> >> @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
> >> select SPL_NAND_SUPPORT if SPL_NAND_DENALI
> >> select SPL_OF_CONTROL
> >> select SPL_SERIAL_SUPPORT
> >> +select SPL_DM_SERIAL
> >> select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
> >> select SPL_SPI_SUPPORT if DM_SPI
> >> select SPL_WATCHDOG_SUPPORT
> >> select SUPPORT_SPL
> >> select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
> >> +select SYS_NS16550
> >> select SYS_THUMB_BUILD
> >> imply CMD_MTDPARTS
> >> imply CRC32_VERIFY
> >> diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
> >> index e64127fcb2..314449478d 100644
> >> --- a/arch/arm/dts/socfpga.dtsi
> >> +++ b/arch/arm/dts/socfpga.dtsi
> >> @@ -737,6 +737,7 @@
> >> reg-shift = <2>;
> >> reg-io-width = <4>;
> >> clocks = <_sp_clk>;
> >> +clock-frequency = <1>;
> >> };
> >>   uart1: serial1@ffc03000 {
> >> @@ -746,6 +747,7 @@
> >> reg-shift = <2>;
> >> reg-io-width = <4>;
> >> clocks = <_sp_clk>;
> >> +clock-frequency = <1>;
> >> };
> >>   rst: rstmgr@ffd05000 {
> >> diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> >> b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> >> index b573d0e658..06b61cb0af 100644
> >> --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> >> +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> >> @@ -24,6 +24,7 @@
> >> };
> >>{
> >> +clock-frequency = <5000>;
> >> u-boot,dm-pre-reloc;
> >> status = "okay";
> >> };
> >> diff --git a/include/configs/socfpga_common.h
> >> b/include/configs/socfpga_common.h
> >> index 54b9edc97c..a60da85499 100644
> >> --- a/include/configs/socfpga_common.h
> >> +++ b/include/configs/socfpga_common.h
> >> @@ -173,14 +173,6 @@ unsigned int
> >> cm_get_qspi_controller_clk_hz(void);
> >>  * Serial Driver
> >>  */
> >> #define CONFIG_SYS_NS16550_SERIAL
> >> -#define CONFIG_SYS_NS16550_REG_SIZE-4
> >> -#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> >> -#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART0_ADDRESS
> >> -#define CONFIG_SYS_NS16550_CLK1
> >> -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
> >> -#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART1_ADDRESS
> >> -#define CONFIG_SYS_NS16550_CLK5000
> >> -#endif
> >>   /*
> >>  * USB
> >>
> > Unfortunately I saw this just now, but it seems this breaks GEN5
> > SPL? At
> > least git-bisect told me that
> 73172753f4f3351ed1c9d2f6586fc599ce4e728c
> > is the first bad commit.
> >
> > I tested socfpga_socrates_defconfig on my socrates board.
> >
> > Any idea what's wrong there?
>  Nope, this should work fine. Can you investigate ?
> >>>
> >>> Ok, so after adding "u-boot,dm-pre-reloc" to uart0 in
> >>> socfpga_cyclone5_socrates.dts, U-Boot works (combined with an old SPL).
> >>
> >> Good!
> >>
> >>> SPL still does not work. Any idea? How does SPL get the uart?
> >>>
> >>> Thanks for any pointers.
> >>
> >> Dig around the NS16550 driver .
> > OK, so my DS-5 debugger shows me it's not 

Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-03 Thread Marek Vasut
On 08/03/2018 10:40 AM, Simon Goldschmidt wrote:
> 
> 
> On 01.08.2018 09:34, Marek Vasut wrote:
>> On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
>>>
>>> On 30.07.2018 16:04, Marek Vasut wrote:
 On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
>
> On 12.05.2018 22:28, Marek Vasut wrote:
>> Pull the serial port configuration from DT and use DM serial instead
>> of having the serial configuration in two places, DT and board
>> config.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Chin Liang See 
>> Cc: Dinh Nguyen 
>> ---
>>     arch/arm/Kconfig | 3 +++
>>     arch/arm/dts/socfpga.dtsi    | 2 ++
>>     arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
>>     include/configs/socfpga_common.h | 8 
>>     4 files changed, 6 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 532aa41a87..2012ac6410 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
>>     select ARCH_MISC_INIT
>>     select CPU_V7A
>>     select DM
>> +    select DM_SERIAL
>>     select ENABLE_ARM_SOC_BOOT0_HOOK
>>     select OF_CONTROL
>>     select SPL_LIBCOMMON_SUPPORT
>> @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
>>     select SPL_NAND_SUPPORT if SPL_NAND_DENALI
>>     select SPL_OF_CONTROL
>>     select SPL_SERIAL_SUPPORT
>> +    select SPL_DM_SERIAL
>>     select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
>>     select SPL_SPI_SUPPORT if DM_SPI
>>     select SPL_WATCHDOG_SUPPORT
>>     select SUPPORT_SPL
>>     select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
>> +    select SYS_NS16550
>>     select SYS_THUMB_BUILD
>>     imply CMD_MTDPARTS
>>     imply CRC32_VERIFY
>> diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
>> index e64127fcb2..314449478d 100644
>> --- a/arch/arm/dts/socfpga.dtsi
>> +++ b/arch/arm/dts/socfpga.dtsi
>> @@ -737,6 +737,7 @@
>>     reg-shift = <2>;
>>     reg-io-width = <4>;
>>     clocks = <_sp_clk>;
>> +    clock-frequency = <1>;
>>     };
>>       uart1: serial1@ffc03000 {
>> @@ -746,6 +747,7 @@
>>     reg-shift = <2>;
>>     reg-io-width = <4>;
>>     clocks = <_sp_clk>;
>> +    clock-frequency = <1>;
>>     };
>>       rst: rstmgr@ffd05000 {
>> diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>> b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>> index b573d0e658..06b61cb0af 100644
>> --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>> +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>> @@ -24,6 +24,7 @@
>>     };
>>        {
>> +    clock-frequency = <5000>;
>>     u-boot,dm-pre-reloc;
>>     status = "okay";
>>     };
>> diff --git a/include/configs/socfpga_common.h
>> b/include/configs/socfpga_common.h
>> index 54b9edc97c..a60da85499 100644
>> --- a/include/configs/socfpga_common.h
>> +++ b/include/configs/socfpga_common.h
>> @@ -173,14 +173,6 @@ unsigned int
>> cm_get_qspi_controller_clk_hz(void);
>>  * Serial Driver
>>  */
>>     #define CONFIG_SYS_NS16550_SERIAL
>> -#define CONFIG_SYS_NS16550_REG_SIZE    -4
>> -#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>> -#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART0_ADDRESS
>> -#define CONFIG_SYS_NS16550_CLK    1
>> -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
>> -#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART1_ADDRESS
>> -#define CONFIG_SYS_NS16550_CLK    5000
>> -#endif
>>       /*
>>  * USB
>>
> Unfortunately I saw this just now, but it seems this breaks GEN5
> SPL? At
> least git-bisect told me that 73172753f4f3351ed1c9d2f6586fc599ce4e728c
> is the first bad commit.
>
> I tested socfpga_socrates_defconfig on my socrates board.
>
> Any idea what's wrong there?
 Nope, this should work fine. Can you investigate ?
>>>
>>> Ok, so after adding "u-boot,dm-pre-reloc" to uart0 in
>>> socfpga_cyclone5_socrates.dts, U-Boot works (combined with an old SPL).
>>
>> Good!
>>
>>> SPL still does not work. Any idea? How does SPL get the uart?
>>>
>>> Thanks for any pointers.
>>
>> Dig around the NS16550 driver .
> OK, so my DS-5 debugger shows me it's not the driver that fails but
> "malloc_simple()" returns 0x0 when being called from
> uclass_get_device_by_seq(). Which is strange because gd->malloc_base is
> 0xe000.

malloc() returns NULL because it ran out of space ?

> Also, gd->fdt_blob is not initialized at the time serial_init() is
> 

Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-03 Thread Simon Goldschmidt



On 01.08.2018 09:34, Marek Vasut wrote:

On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:


On 30.07.2018 16:04, Marek Vasut wrote:

On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:


On 12.05.2018 22:28, Marek Vasut wrote:

Pull the serial port configuration from DT and use DM serial instead
of having the serial configuration in two places, DT and board config.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
---
    arch/arm/Kconfig | 3 +++
    arch/arm/dts/socfpga.dtsi    | 2 ++
    arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
    include/configs/socfpga_common.h | 8 
    4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 532aa41a87..2012ac6410 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -737,6 +737,7 @@ config ARCH_SOCFPGA
    select ARCH_MISC_INIT
    select CPU_V7A
    select DM
+    select DM_SERIAL
    select ENABLE_ARM_SOC_BOOT0_HOOK
    select OF_CONTROL
    select SPL_LIBCOMMON_SUPPORT
@@ -746,11 +747,13 @@ config ARCH_SOCFPGA
    select SPL_NAND_SUPPORT if SPL_NAND_DENALI
    select SPL_OF_CONTROL
    select SPL_SERIAL_SUPPORT
+    select SPL_DM_SERIAL
    select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
    select SPL_SPI_SUPPORT if DM_SPI
    select SPL_WATCHDOG_SUPPORT
    select SUPPORT_SPL
    select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
+    select SYS_NS16550
    select SYS_THUMB_BUILD
    imply CMD_MTDPARTS
    imply CRC32_VERIFY
diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
index e64127fcb2..314449478d 100644
--- a/arch/arm/dts/socfpga.dtsi
+++ b/arch/arm/dts/socfpga.dtsi
@@ -737,6 +737,7 @@
    reg-shift = <2>;
    reg-io-width = <4>;
    clocks = <_sp_clk>;
+    clock-frequency = <1>;
    };
      uart1: serial1@ffc03000 {
@@ -746,6 +747,7 @@
    reg-shift = <2>;
    reg-io-width = <4>;
    clocks = <_sp_clk>;
+    clock-frequency = <1>;
    };
      rst: rstmgr@ffd05000 {
diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
index b573d0e658..06b61cb0af 100644
--- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
+++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
@@ -24,6 +24,7 @@
    };
       {
+    clock-frequency = <5000>;
    u-boot,dm-pre-reloc;
    status = "okay";
    };
diff --git a/include/configs/socfpga_common.h
b/include/configs/socfpga_common.h
index 54b9edc97c..a60da85499 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -173,14 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
     * Serial Driver
     */
    #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    -4
-#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
-#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART0_ADDRESS
-#define CONFIG_SYS_NS16550_CLK    1
-#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
-#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART1_ADDRESS
-#define CONFIG_SYS_NS16550_CLK    5000
-#endif
      /*
     * USB


Unfortunately I saw this just now, but it seems this breaks GEN5 SPL? At
least git-bisect told me that 73172753f4f3351ed1c9d2f6586fc599ce4e728c
is the first bad commit.

I tested socfpga_socrates_defconfig on my socrates board.

Any idea what's wrong there?

Nope, this should work fine. Can you investigate ?


Ok, so after adding "u-boot,dm-pre-reloc" to uart0 in
socfpga_cyclone5_socrates.dts, U-Boot works (combined with an old SPL).


Good!


SPL still does not work. Any idea? How does SPL get the uart?

Thanks for any pointers.


Dig around the NS16550 driver .
OK, so my DS-5 debugger shows me it's not the driver that fails but 
"malloc_simple()" returns 0x0 when being called from 
uclass_get_device_by_seq(). Which is strange because gd->malloc_base is 
0xe000.


Also, gd->fdt_blob is not initialized at the time serial_init() is 
called from SPL. Should it be? Because that way, we don't seem to have 
dts control over which uart is used as console?


Simon

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-02 Thread Marek Vasut
On 08/02/2018 10:36 AM, Simon Goldschmidt wrote:
> 
> 
> On 01.08.2018 18:34, Marek Vasut wrote:
>> On 08/01/2018 05:42 PM, Simon Goldschmidt wrote:
>>>
>>>
>>> Marek Vasut mailto:ma...@denx.de>> schrieb am Mi., 1.
>>> Aug. 2018, 09:35:
>>>
>>>  On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
>>>  >
>>>  > On 30.07.2018 16:04, Marek Vasut wrote:
>>>  >> On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
>>>  >>>
>>>  >>> On 12.05.2018 22:28, Marek Vasut wrote:
>>>   Pull the serial port configuration from DT and use DM serial
>>>  instead
>>>   of having the serial configuration in two places, DT and board
>>>  config.
>>>  [..]
>>>
>>>
>>> While debugging, a more generic question: which drivers are now
>>> remaining non-DM for socfpga?
>>
>> Not much I believe, I can't think of anything right now.
>>
>>> And am I correct with the assumption that we could get rid of the qts
>>> files (other than sdram maybe) by implementing pinctrl and clk drivers
>>> as DM drivers? (Not that I would have found documentation about the pin
>>> mux hardware cyclone5...)
>>
>> Yes. The pinmux docs are probably not public, it has to do with the
>> iocsr ring programming and that's super-secret for whatever reason.
>> What Altera did on Arria10 is pure trash, they encode registers in DT
>> and are done with it. If you can design something saner, that'd be so
>> nice.
> 
> As I'm not familiar with pinmux DTS, that might be hard for me, but I
> might try to get it done somehow (or by  someone... :)
> 
> Could you give me a hint of a platform to take as a good example?

Maybe iMX series ?

>> I am working on a clock driver for Arria10 now, I might do Gen5 too
>> afterward, since the clock block is similar.
> 
> That would be cool. You can count on me testing on cyclone5 as much as I
> can (as much as I have the hardware, that is).
> 
>> The clock DT bindings on
>> the other hand are complete insanity, words fail me. The clock stuff in
>> U-Boot on SoCFPGA right now is a complete disaster too, the way stuff
>> gets added to mach-socfpga is really irritating.
> 
> But you would still use the existing bindings? How does this stuff get
> added to U-Boot, by first being added to Linux and the DTS being copied
> here?

Pretty much, except on A10 there are the generated handoff files at play
too. Basically Altera really screwed it up there, it contains redundant
nodes which are both in the base DT and handoff files, but each contain
different set of DT properties and have different names, although they
represent the same thing. Sigh ...

>>> I'm looking for a way to control pins from a fit image that includes
>>> kernel, dts and fpga because the pins may change depending on the fpga
>>> config...
>>
>> DTOs maybe ?
> 
> Yeah, I thought of that too. The problem I see is that we would need
> pinmux and clock support for DTS in Linux but we're kind of stuck to
> 4.9.y for now due to using an RT configuration.

Well, implement those drivers ?

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-02 Thread Simon Goldschmidt



On 01.08.2018 18:34, Marek Vasut wrote:

On 08/01/2018 05:42 PM, Simon Goldschmidt wrote:



Marek Vasut mailto:ma...@denx.de>> schrieb am Mi., 1.
Aug. 2018, 09:35:

 On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
 >
 > On 30.07.2018 16:04, Marek Vasut wrote:
 >> On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
 >>>
 >>> On 12.05.2018 22:28, Marek Vasut wrote:
  Pull the serial port configuration from DT and use DM serial
 instead
  of having the serial configuration in two places, DT and board
 config.
 [..]


While debugging, a more generic question: which drivers are now
remaining non-DM for socfpga?


Not much I believe, I can't think of anything right now.


And am I correct with the assumption that we could get rid of the qts
files (other than sdram maybe) by implementing pinctrl and clk drivers
as DM drivers? (Not that I would have found documentation about the pin
mux hardware cyclone5...)


Yes. The pinmux docs are probably not public, it has to do with the
iocsr ring programming and that's super-secret for whatever reason.
What Altera did on Arria10 is pure trash, they encode registers in DT
and are done with it. If you can design something saner, that'd be so nice.


As I'm not familiar with pinmux DTS, that might be hard for me, but I 
might try to get it done somehow (or by  someone... :)


Could you give me a hint of a platform to take as a good example?


I am working on a clock driver for Arria10 now, I might do Gen5 too
afterward, since the clock block is similar.


That would be cool. You can count on me testing on cyclone5 as much as I 
can (as much as I have the hardware, that is).



The clock DT bindings on
the other hand are complete insanity, words fail me. The clock stuff in
U-Boot on SoCFPGA right now is a complete disaster too, the way stuff
gets added to mach-socfpga is really irritating.


But you would still use the existing bindings? How does this stuff get 
added to U-Boot, by first being added to Linux and the DTS being copied 
here?



I'm looking for a way to control pins from a fit image that includes
kernel, dts and fpga because the pins may change depending on the fpga
config...


DTOs maybe ?


Yeah, I thought of that too. The problem I see is that we would need 
pinmux and clock support for DTS in Linux but we're kind of stuck to 
4.9.y for now due to using an RT configuration.



Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-01 Thread Simon Goldschmidt
Marek Vasut  schrieb am Mi., 1. Aug. 2018, 09:35:

> On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
> >
> > On 30.07.2018 16:04, Marek Vasut wrote:
> >> On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
> >>>
> >>> On 12.05.2018 22:28, Marek Vasut wrote:
>  Pull the serial port configuration from DT and use DM serial instead
>  of having the serial configuration in two places, DT and board config.
> [..]
>

While debugging, a more generic question: which drivers are now remaining
non-DM for socfpga?

And am I correct with the assumption that we could get rid of the qts files
(other than sdram maybe) by implementing pinctrl and clk drivers as DM
drivers? (Not that I would have found documentation about the pin mux
hardware cyclone5...)

I'm looking for a way to control pins from a fit image that includes
kernel, dts and fpga because the pins may change depending on the fpga
config...

Simon (from my private mail)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-01 Thread Marek Vasut
On 08/01/2018 05:42 PM, Simon Goldschmidt wrote:
> 
> 
> Marek Vasut mailto:ma...@denx.de>> schrieb am Mi., 1.
> Aug. 2018, 09:35:
> 
> On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
> >
> > On 30.07.2018 16:04, Marek Vasut wrote:
> >> On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
> >>>
> >>> On 12.05.2018 22:28, Marek Vasut wrote:
>  Pull the serial port configuration from DT and use DM serial
> instead
>  of having the serial configuration in two places, DT and board
> config.
> [..]
> 
> 
> While debugging, a more generic question: which drivers are now
> remaining non-DM for socfpga?

Not much I believe, I can't think of anything right now.

> And am I correct with the assumption that we could get rid of the qts
> files (other than sdram maybe) by implementing pinctrl and clk drivers
> as DM drivers? (Not that I would have found documentation about the pin
> mux hardware cyclone5...)

Yes. The pinmux docs are probably not public, it has to do with the
iocsr ring programming and that's super-secret for whatever reason.
What Altera did on Arria10 is pure trash, they encode registers in DT
and are done with it. If you can design something saner, that'd be so nice.

I am working on a clock driver for Arria10 now, I might do Gen5 too
afterward, since the clock block is similar. The clock DT bindings on
the other hand are complete insanity, words fail me. The clock stuff in
U-Boot on SoCFPGA right now is a complete disaster too, the way stuff
gets added to mach-socfpga is really irritating.

> I'm looking for a way to control pins from a fit image that includes
> kernel, dts and fpga because the pins may change depending on the fpga
> config...

DTOs maybe ?

> Simon (from my private mail)


-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-01 Thread Marek Vasut
On 08/01/2018 09:29 AM, Goldschmidt Simon wrote:
> 
> On 30.07.2018 16:04, Marek Vasut wrote:
>> On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
>>>
>>> On 12.05.2018 22:28, Marek Vasut wrote:
 Pull the serial port configuration from DT and use DM serial instead
 of having the serial configuration in two places, DT and board config.

 Signed-off-by: Marek Vasut 
 Cc: Chin Liang See 
 Cc: Dinh Nguyen 
 ---
    arch/arm/Kconfig | 3 +++
    arch/arm/dts/socfpga.dtsi    | 2 ++
    arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
    include/configs/socfpga_common.h | 8 
    4 files changed, 6 insertions(+), 8 deletions(-)

 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
 index 532aa41a87..2012ac6410 100644
 --- a/arch/arm/Kconfig
 +++ b/arch/arm/Kconfig
 @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
    select ARCH_MISC_INIT
    select CPU_V7A
    select DM
 +    select DM_SERIAL
    select ENABLE_ARM_SOC_BOOT0_HOOK
    select OF_CONTROL
    select SPL_LIBCOMMON_SUPPORT
 @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
    select SPL_NAND_SUPPORT if SPL_NAND_DENALI
    select SPL_OF_CONTROL
    select SPL_SERIAL_SUPPORT
 +    select SPL_DM_SERIAL
    select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
    select SPL_SPI_SUPPORT if DM_SPI
    select SPL_WATCHDOG_SUPPORT
    select SUPPORT_SPL
    select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
 +    select SYS_NS16550
    select SYS_THUMB_BUILD
    imply CMD_MTDPARTS
    imply CRC32_VERIFY
 diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
 index e64127fcb2..314449478d 100644
 --- a/arch/arm/dts/socfpga.dtsi
 +++ b/arch/arm/dts/socfpga.dtsi
 @@ -737,6 +737,7 @@
    reg-shift = <2>;
    reg-io-width = <4>;
    clocks = <_sp_clk>;
 +    clock-frequency = <1>;
    };
      uart1: serial1@ffc03000 {
 @@ -746,6 +747,7 @@
    reg-shift = <2>;
    reg-io-width = <4>;
    clocks = <_sp_clk>;
 +    clock-frequency = <1>;
    };
      rst: rstmgr@ffd05000 {
 diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
 b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
 index b573d0e658..06b61cb0af 100644
 --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
 +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
 @@ -24,6 +24,7 @@
    };
       {
 +    clock-frequency = <5000>;
    u-boot,dm-pre-reloc;
    status = "okay";
    };
 diff --git a/include/configs/socfpga_common.h
 b/include/configs/socfpga_common.h
 index 54b9edc97c..a60da85499 100644
 --- a/include/configs/socfpga_common.h
 +++ b/include/configs/socfpga_common.h
 @@ -173,14 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
     * Serial Driver
     */
    #define CONFIG_SYS_NS16550_SERIAL
 -#define CONFIG_SYS_NS16550_REG_SIZE    -4
 -#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
 -#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART0_ADDRESS
 -#define CONFIG_SYS_NS16550_CLK    1
 -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
 -#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART1_ADDRESS
 -#define CONFIG_SYS_NS16550_CLK    5000
 -#endif
      /*
     * USB

>>> Unfortunately I saw this just now, but it seems this breaks GEN5 SPL? At
>>> least git-bisect told me that 73172753f4f3351ed1c9d2f6586fc599ce4e728c
>>> is the first bad commit.
>>>
>>> I tested socfpga_socrates_defconfig on my socrates board.
>>>
>>> Any idea what's wrong there?
>> Nope, this should work fine. Can you investigate ?
> 
> Ok, so after adding "u-boot,dm-pre-reloc" to uart0 in
> socfpga_cyclone5_socrates.dts, U-Boot works (combined with an old SPL).

Good!

> SPL still does not work. Any idea? How does SPL get the uart?
> 
> Thanks for any pointers.

Dig around the NS16550 driver .

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-08-01 Thread Goldschmidt Simon


On 30.07.2018 16:04, Marek Vasut wrote:

On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:


On 12.05.2018 22:28, Marek Vasut wrote:

Pull the serial port configuration from DT and use DM serial instead
of having the serial configuration in two places, DT and board config.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
---
   arch/arm/Kconfig | 3 +++
   arch/arm/dts/socfpga.dtsi    | 2 ++
   arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
   include/configs/socfpga_common.h | 8 
   4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 532aa41a87..2012ac6410 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -737,6 +737,7 @@ config ARCH_SOCFPGA
   select ARCH_MISC_INIT
   select CPU_V7A
   select DM
+    select DM_SERIAL
   select ENABLE_ARM_SOC_BOOT0_HOOK
   select OF_CONTROL
   select SPL_LIBCOMMON_SUPPORT
@@ -746,11 +747,13 @@ config ARCH_SOCFPGA
   select SPL_NAND_SUPPORT if SPL_NAND_DENALI
   select SPL_OF_CONTROL
   select SPL_SERIAL_SUPPORT
+    select SPL_DM_SERIAL
   select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
   select SPL_SPI_SUPPORT if DM_SPI
   select SPL_WATCHDOG_SUPPORT
   select SUPPORT_SPL
   select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
+    select SYS_NS16550
   select SYS_THUMB_BUILD
   imply CMD_MTDPARTS
   imply CRC32_VERIFY
diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
index e64127fcb2..314449478d 100644
--- a/arch/arm/dts/socfpga.dtsi
+++ b/arch/arm/dts/socfpga.dtsi
@@ -737,6 +737,7 @@
   reg-shift = <2>;
   reg-io-width = <4>;
   clocks = <_sp_clk>;
+    clock-frequency = <1>;
   };
     uart1: serial1@ffc03000 {
@@ -746,6 +747,7 @@
   reg-shift = <2>;
   reg-io-width = <4>;
   clocks = <_sp_clk>;
+    clock-frequency = <1>;
   };
     rst: rstmgr@ffd05000 {
diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
index b573d0e658..06b61cb0af 100644
--- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
+++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
@@ -24,6 +24,7 @@
   };
      {
+    clock-frequency = <5000>;
   u-boot,dm-pre-reloc;
   status = "okay";
   };
diff --git a/include/configs/socfpga_common.h
b/include/configs/socfpga_common.h
index 54b9edc97c..a60da85499 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -173,14 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
    * Serial Driver
    */
   #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    -4
-#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
-#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART0_ADDRESS
-#define CONFIG_SYS_NS16550_CLK    1
-#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
-#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART1_ADDRESS
-#define CONFIG_SYS_NS16550_CLK    5000
-#endif
     /*
    * USB


Unfortunately I saw this just now, but it seems this breaks GEN5 SPL? At
least git-bisect told me that 73172753f4f3351ed1c9d2f6586fc599ce4e728c
is the first bad commit.

I tested socfpga_socrates_defconfig on my socrates board.

Any idea what's wrong there?

Nope, this should work fine. Can you investigate ?


Ok, so after adding "u-boot,dm-pre-reloc" to uart0 in 
socfpga_cyclone5_socrates.dts, U-Boot works (combined with an old SPL). 
SPL still does not work. Any idea? How does SPL get the uart?


Thanks for any pointers.

Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-07-30 Thread Goldschmidt Simon


On 30.07.2018 16:04, Marek Vasut wrote:

On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:


On 12.05.2018 22:28, Marek Vasut wrote:

Pull the serial port configuration from DT and use DM serial instead
of having the serial configuration in two places, DT and board config.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
---
   arch/arm/Kconfig | 3 +++
   arch/arm/dts/socfpga.dtsi    | 2 ++
   arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
   include/configs/socfpga_common.h | 8 
   4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 532aa41a87..2012ac6410 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -737,6 +737,7 @@ config ARCH_SOCFPGA
   select ARCH_MISC_INIT
   select CPU_V7A
   select DM
+    select DM_SERIAL
   select ENABLE_ARM_SOC_BOOT0_HOOK
   select OF_CONTROL
   select SPL_LIBCOMMON_SUPPORT
@@ -746,11 +747,13 @@ config ARCH_SOCFPGA
   select SPL_NAND_SUPPORT if SPL_NAND_DENALI
   select SPL_OF_CONTROL
   select SPL_SERIAL_SUPPORT
+    select SPL_DM_SERIAL
   select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
   select SPL_SPI_SUPPORT if DM_SPI
   select SPL_WATCHDOG_SUPPORT
   select SUPPORT_SPL
   select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
+    select SYS_NS16550
   select SYS_THUMB_BUILD
   imply CMD_MTDPARTS
   imply CRC32_VERIFY
diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
index e64127fcb2..314449478d 100644
--- a/arch/arm/dts/socfpga.dtsi
+++ b/arch/arm/dts/socfpga.dtsi
@@ -737,6 +737,7 @@
   reg-shift = <2>;
   reg-io-width = <4>;
   clocks = <_sp_clk>;
+    clock-frequency = <1>;
   };
     uart1: serial1@ffc03000 {
@@ -746,6 +747,7 @@
   reg-shift = <2>;
   reg-io-width = <4>;
   clocks = <_sp_clk>;
+    clock-frequency = <1>;
   };
     rst: rstmgr@ffd05000 {
diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
index b573d0e658..06b61cb0af 100644
--- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
+++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
@@ -24,6 +24,7 @@
   };
      {
+    clock-frequency = <5000>;
   u-boot,dm-pre-reloc;
   status = "okay";
   };
diff --git a/include/configs/socfpga_common.h
b/include/configs/socfpga_common.h
index 54b9edc97c..a60da85499 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -173,14 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
    * Serial Driver
    */
   #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    -4
-#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
-#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART0_ADDRESS
-#define CONFIG_SYS_NS16550_CLK    1
-#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
-#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART1_ADDRESS
-#define CONFIG_SYS_NS16550_CLK    5000
-#endif
     /*
    * USB


Unfortunately I saw this just now, but it seems this breaks GEN5 SPL? At
least git-bisect told me that 73172753f4f3351ed1c9d2f6586fc599ce4e728c
is the first bad commit.

I tested socfpga_socrates_defconfig on my socrates board.

Any idea what's wrong there?

Nope, this should work fine. Can you investigate ?


OK, I'll try.


Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-07-30 Thread Marek Vasut
On 07/30/2018 04:03 PM, Simon Goldschmidt wrote:
> 
> 
> On 12.05.2018 22:28, Marek Vasut wrote:
>> Pull the serial port configuration from DT and use DM serial instead
>> of having the serial configuration in two places, DT and board config.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Chin Liang See 
>> Cc: Dinh Nguyen 
>> ---
>>   arch/arm/Kconfig | 3 +++
>>   arch/arm/dts/socfpga.dtsi    | 2 ++
>>   arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
>>   include/configs/socfpga_common.h | 8 
>>   4 files changed, 6 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 532aa41a87..2012ac6410 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
>>   select ARCH_MISC_INIT
>>   select CPU_V7A
>>   select DM
>> +    select DM_SERIAL
>>   select ENABLE_ARM_SOC_BOOT0_HOOK
>>   select OF_CONTROL
>>   select SPL_LIBCOMMON_SUPPORT
>> @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
>>   select SPL_NAND_SUPPORT if SPL_NAND_DENALI
>>   select SPL_OF_CONTROL
>>   select SPL_SERIAL_SUPPORT
>> +    select SPL_DM_SERIAL
>>   select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
>>   select SPL_SPI_SUPPORT if DM_SPI
>>   select SPL_WATCHDOG_SUPPORT
>>   select SUPPORT_SPL
>>   select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
>> +    select SYS_NS16550
>>   select SYS_THUMB_BUILD
>>   imply CMD_MTDPARTS
>>   imply CRC32_VERIFY
>> diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
>> index e64127fcb2..314449478d 100644
>> --- a/arch/arm/dts/socfpga.dtsi
>> +++ b/arch/arm/dts/socfpga.dtsi
>> @@ -737,6 +737,7 @@
>>   reg-shift = <2>;
>>   reg-io-width = <4>;
>>   clocks = <_sp_clk>;
>> +    clock-frequency = <1>;
>>   };
>>     uart1: serial1@ffc03000 {
>> @@ -746,6 +747,7 @@
>>   reg-shift = <2>;
>>   reg-io-width = <4>;
>>   clocks = <_sp_clk>;
>> +    clock-frequency = <1>;
>>   };
>>     rst: rstmgr@ffd05000 {
>> diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>> b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>> index b573d0e658..06b61cb0af 100644
>> --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>> +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
>> @@ -24,6 +24,7 @@
>>   };
>>      {
>> +    clock-frequency = <5000>;
>>   u-boot,dm-pre-reloc;
>>   status = "okay";
>>   };
>> diff --git a/include/configs/socfpga_common.h
>> b/include/configs/socfpga_common.h
>> index 54b9edc97c..a60da85499 100644
>> --- a/include/configs/socfpga_common.h
>> +++ b/include/configs/socfpga_common.h
>> @@ -173,14 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
>>    * Serial Driver
>>    */
>>   #define CONFIG_SYS_NS16550_SERIAL
>> -#define CONFIG_SYS_NS16550_REG_SIZE    -4
>> -#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>> -#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART0_ADDRESS
>> -#define CONFIG_SYS_NS16550_CLK    1
>> -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
>> -#define CONFIG_SYS_NS16550_COM1    SOCFPGA_UART1_ADDRESS
>> -#define CONFIG_SYS_NS16550_CLK    5000
>> -#endif
>>     /*
>>    * USB
>>
> 
> Unfortunately I saw this just now, but it seems this breaks GEN5 SPL? At
> least git-bisect told me that 73172753f4f3351ed1c9d2f6586fc599ce4e728c
> is the first bad commit.
> 
> I tested socfpga_socrates_defconfig on my socrates board.
> 
> Any idea what's wrong there?

Nope, this should work fine. Can you investigate ?

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-07-30 Thread Simon Goldschmidt



On 12.05.2018 22:28, Marek Vasut wrote:

Pull the serial port configuration from DT and use DM serial instead
of having the serial configuration in two places, DT and board config.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
---
  arch/arm/Kconfig | 3 +++
  arch/arm/dts/socfpga.dtsi| 2 ++
  arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
  include/configs/socfpga_common.h | 8 
  4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 532aa41a87..2012ac6410 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -737,6 +737,7 @@ config ARCH_SOCFPGA
select ARCH_MISC_INIT
select CPU_V7A
select DM
+   select DM_SERIAL
select ENABLE_ARM_SOC_BOOT0_HOOK
select OF_CONTROL
select SPL_LIBCOMMON_SUPPORT
@@ -746,11 +747,13 @@ config ARCH_SOCFPGA
select SPL_NAND_SUPPORT if SPL_NAND_DENALI
select SPL_OF_CONTROL
select SPL_SERIAL_SUPPORT
+   select SPL_DM_SERIAL
select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
select SPL_SPI_SUPPORT if DM_SPI
select SPL_WATCHDOG_SUPPORT
select SUPPORT_SPL
select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
+   select SYS_NS16550
select SYS_THUMB_BUILD
imply CMD_MTDPARTS
imply CRC32_VERIFY
diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
index e64127fcb2..314449478d 100644
--- a/arch/arm/dts/socfpga.dtsi
+++ b/arch/arm/dts/socfpga.dtsi
@@ -737,6 +737,7 @@
reg-shift = <2>;
reg-io-width = <4>;
clocks = <_sp_clk>;
+   clock-frequency = <1>;
};
  
  		uart1: serial1@ffc03000 {

@@ -746,6 +747,7 @@
reg-shift = <2>;
reg-io-width = <4>;
clocks = <_sp_clk>;
+   clock-frequency = <1>;
};
  
  		rst: rstmgr@ffd05000 {

diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts 
b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
index b573d0e658..06b61cb0af 100644
--- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
+++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
@@ -24,6 +24,7 @@
  };
  
   {

+   clock-frequency = <5000>;
u-boot,dm-pre-reloc;
status = "okay";
  };
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 54b9edc97c..a60da85499 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -173,14 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
   * Serial Driver
   */
  #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE-4
-#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
-#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART0_ADDRESS
-#define CONFIG_SYS_NS16550_CLK 1
-#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
-#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART1_ADDRESS
-#define CONFIG_SYS_NS16550_CLK 5000
-#endif
  
  /*

   * USB



Unfortunately I saw this just now, but it seems this breaks GEN5 SPL? At 
least git-bisect told me that 73172753f4f3351ed1c9d2f6586fc599ce4e728c 
is the first bad commit.


I tested socfpga_socrates_defconfig on my socrates board.

Any idea what's wrong there?

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-05-16 Thread Ley Foon Tan
On Sun, May 13, 2018 at 4:28 AM, Marek Vasut  wrote:
> Pull the serial port configuration from DT and use DM serial instead
> of having the serial configuration in two places, DT and board config.
>
> Signed-off-by: Marek Vasut 
> Cc: Chin Liang See 
> Cc: Dinh Nguyen 
> ---
>  arch/arm/Kconfig | 3 +++
>  arch/arm/dts/socfpga.dtsi| 2 ++
>  arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
>  include/configs/socfpga_common.h | 8 
>  4 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 532aa41a87..2012ac6410 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -737,6 +737,7 @@ config ARCH_SOCFPGA
> select ARCH_MISC_INIT
> select CPU_V7A
> select DM
> +   select DM_SERIAL
> select ENABLE_ARM_SOC_BOOT0_HOOK
> select OF_CONTROL
> select SPL_LIBCOMMON_SUPPORT
> @@ -746,11 +747,13 @@ config ARCH_SOCFPGA
> select SPL_NAND_SUPPORT if SPL_NAND_DENALI
> select SPL_OF_CONTROL
> select SPL_SERIAL_SUPPORT
> +   select SPL_DM_SERIAL
> select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
> select SPL_SPI_SUPPORT if DM_SPI
> select SPL_WATCHDOG_SUPPORT
> select SUPPORT_SPL
> select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
> +   select SYS_NS16550
> select SYS_THUMB_BUILD
> imply CMD_MTDPARTS
> imply CRC32_VERIFY
> diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
> index e64127fcb2..314449478d 100644
> --- a/arch/arm/dts/socfpga.dtsi
> +++ b/arch/arm/dts/socfpga.dtsi
> @@ -737,6 +737,7 @@
> reg-shift = <2>;
> reg-io-width = <4>;
> clocks = <_sp_clk>;
> +   clock-frequency = <1>;
> };
>
> uart1: serial1@ffc03000 {
> @@ -746,6 +747,7 @@
> reg-shift = <2>;
> reg-io-width = <4>;
> clocks = <_sp_clk>;
> +   clock-frequency = <1>;
> };
>
> rst: rstmgr@ffd05000 {
> diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts 
> b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> index b573d0e658..06b61cb0af 100644
> --- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> +++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
> @@ -24,6 +24,7 @@
>  };
>
>   {
> +   clock-frequency = <5000>;
> u-boot,dm-pre-reloc;
> status = "okay";
>  };
> diff --git a/include/configs/socfpga_common.h 
> b/include/configs/socfpga_common.h
> index 54b9edc97c..a60da85499 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -173,14 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
>   * Serial Driver
>   */
>  #define CONFIG_SYS_NS16550_SERIAL
> -#define CONFIG_SYS_NS16550_REG_SIZE-4
> -#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> -#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART0_ADDRESS
> -#define CONFIG_SYS_NS16550_CLK 1
> -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
> -#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART1_ADDRESS
> -#define CONFIG_SYS_NS16550_CLK 5000
> -#endif
>
>  /*
>   * USB
> --
Reviewed-by: Ley Foon Tan 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ARM: socfpga: Convert to DM serial

2018-05-12 Thread Marek Vasut
Pull the serial port configuration from DT and use DM serial instead
of having the serial configuration in two places, DT and board config.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
---
 arch/arm/Kconfig | 3 +++
 arch/arm/dts/socfpga.dtsi| 2 ++
 arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts | 1 +
 include/configs/socfpga_common.h | 8 
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 532aa41a87..2012ac6410 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -737,6 +737,7 @@ config ARCH_SOCFPGA
select ARCH_MISC_INIT
select CPU_V7A
select DM
+   select DM_SERIAL
select ENABLE_ARM_SOC_BOOT0_HOOK
select OF_CONTROL
select SPL_LIBCOMMON_SUPPORT
@@ -746,11 +747,13 @@ config ARCH_SOCFPGA
select SPL_NAND_SUPPORT if SPL_NAND_DENALI
select SPL_OF_CONTROL
select SPL_SERIAL_SUPPORT
+   select SPL_DM_SERIAL
select SPL_SPI_FLASH_SUPPORT if SPL_SPI_SUPPORT
select SPL_SPI_SUPPORT if DM_SPI
select SPL_WATCHDOG_SUPPORT
select SUPPORT_SPL
select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
+   select SYS_NS16550
select SYS_THUMB_BUILD
imply CMD_MTDPARTS
imply CRC32_VERIFY
diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
index e64127fcb2..314449478d 100644
--- a/arch/arm/dts/socfpga.dtsi
+++ b/arch/arm/dts/socfpga.dtsi
@@ -737,6 +737,7 @@
reg-shift = <2>;
reg-io-width = <4>;
clocks = <_sp_clk>;
+   clock-frequency = <1>;
};
 
uart1: serial1@ffc03000 {
@@ -746,6 +747,7 @@
reg-shift = <2>;
reg-io-width = <4>;
clocks = <_sp_clk>;
+   clock-frequency = <1>;
};
 
rst: rstmgr@ffd05000 {
diff --git a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts 
b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
index b573d0e658..06b61cb0af 100644
--- a/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
+++ b/arch/arm/dts/socfpga_arria10_socdk_sdmmc.dts
@@ -24,6 +24,7 @@
 };
 
  {
+   clock-frequency = <5000>;
u-boot,dm-pre-reloc;
status = "okay";
 };
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 54b9edc97c..a60da85499 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -173,14 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
  * Serial Driver
  */
 #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE-4
-#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
-#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART0_ADDRESS
-#define CONFIG_SYS_NS16550_CLK 1
-#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
-#define CONFIG_SYS_NS16550_COM1SOCFPGA_UART1_ADDRESS
-#define CONFIG_SYS_NS16550_CLK 5000
-#endif
 
 /*
  * USB
-- 
2.16.2

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot