diff mbox

[U-Boot,10/10] dm: imx: Move cm_fx6 to use driver model for serial and GPIO

Message ID 1410785865-27946-11-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Sept. 15, 2014, 12:57 p.m. UTC
Now that serial and GPIO are available for iMX.6, move cm_fx6 over as an
example.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 board/compulab/cm_fx6/cm_fx6.c | 10 ++++++++++
 include/configs/cm_fx6.h       | 11 +++++++++++
 2 files changed, 21 insertions(+)

Comments

Igor Grinberg Sept. 15, 2014, 6:50 p.m. UTC | #1
On 09/15/14 15:57, Simon Glass wrote:
> Now that serial and GPIO are available for iMX.6, move cm_fx6 over as an
> example.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  board/compulab/cm_fx6/cm_fx6.c | 10 ++++++++++
>  include/configs/cm_fx6.h       | 11 +++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
> index 80a123d..41222cb 100644
> --- a/board/compulab/cm_fx6/cm_fx6.c
> +++ b/board/compulab/cm_fx6/cm_fx6.c
> @@ -9,11 +9,13 @@
>   */
>  
>  #include <common.h>
> +#include <dm.h>
>  #include <fsl_esdhc.h>
>  #include <miiphy.h>
>  #include <netdev.h>
>  #include <fdt_support.h>
>  #include <sata.h>
> +#include <serial_mxc.h>
>  #include <asm/arch/crm_regs.h>
>  #include <asm/arch/sys_proto.h>
>  #include <asm/arch/iomux.h>
> @@ -490,3 +492,11 @@ u32 get_board_rev(void)
>  	return cl_eeprom_get_board_rev();
>  }
>  
> +struct mxc_serial_platdata serial_mxc_plat = {

This isn't referenced outside, right?
If so, should it be static?

Also, can we please have it in the same name space like
all (well.. almost all) other structures/functions names
e.g. cm_fx6_mxc_serial_plat ?

> +	.reg = (struct mxc_uart *)UART4_BASE,
> +};
> +
> +U_BOOT_DEVICE(mxc_serial) = {
> +	.name	= "serial_mxc",
> +	.platdata = &serial_mxc_plat,
> +};
> diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
> index 10d02b4..1f55150 100644
> --- a/include/configs/cm_fx6.h
> +++ b/include/configs/cm_fx6.h
> @@ -21,6 +21,17 @@
>  #define CONFIG_MACH_TYPE		4273
>  #define CONFIG_SYS_HZ			1000
>  
> +#ifndef CONFIG_SPL_BUILD
> +#define CONFIG_DM
> +#define CONFIG_CMD_DM
> +
> +#define CONFIG_DM_GPIO
> +#define CONFIG_CMD_GPIO
> +
> +#define CONFIG_DM_SERIAL
> +#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
> +#endif
> +
>  /* Display information on boot */
>  #define CONFIG_DISPLAY_CPUINFO
>  #define CONFIG_DISPLAY_BOARDINFO
>
Simon Glass Sept. 17, 2014, 3:50 a.m. UTC | #2
Hi Igor,

On 15 September 2014 12:50, Igor Grinberg <grinberg@compulab.co.il> wrote:
> On 09/15/14 15:57, Simon Glass wrote:
>> Now that serial and GPIO are available for iMX.6, move cm_fx6 over as an
>> example.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>  board/compulab/cm_fx6/cm_fx6.c | 10 ++++++++++
>>  include/configs/cm_fx6.h       | 11 +++++++++++
>>  2 files changed, 21 insertions(+)
>>
>> diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
>> index 80a123d..41222cb 100644
>> --- a/board/compulab/cm_fx6/cm_fx6.c
>> +++ b/board/compulab/cm_fx6/cm_fx6.c
>> @@ -9,11 +9,13 @@
>>   */
>>
>>  #include <common.h>
>> +#include <dm.h>
>>  #include <fsl_esdhc.h>
>>  #include <miiphy.h>
>>  #include <netdev.h>
>>  #include <fdt_support.h>
>>  #include <sata.h>
>> +#include <serial_mxc.h>
>>  #include <asm/arch/crm_regs.h>
>>  #include <asm/arch/sys_proto.h>
>>  #include <asm/arch/iomux.h>
>> @@ -490,3 +492,11 @@ u32 get_board_rev(void)
>>       return cl_eeprom_get_board_rev();
>>  }
>>
>> +struct mxc_serial_platdata serial_mxc_plat = {
>
> This isn't referenced outside, right?
> If so, should it be static?

OK

>
> Also, can we please have it in the same name space like
> all (well.. almost all) other structures/functions names
> e.g. cm_fx6_mxc_serial_plat ?

OK

Regards,
Simon
diff mbox

Patch

diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index 80a123d..41222cb 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -9,11 +9,13 @@ 
  */
 
 #include <common.h>
+#include <dm.h>
 #include <fsl_esdhc.h>
 #include <miiphy.h>
 #include <netdev.h>
 #include <fdt_support.h>
 #include <sata.h>
+#include <serial_mxc.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/iomux.h>
@@ -490,3 +492,11 @@  u32 get_board_rev(void)
 	return cl_eeprom_get_board_rev();
 }
 
+struct mxc_serial_platdata serial_mxc_plat = {
+	.reg = (struct mxc_uart *)UART4_BASE,
+};
+
+U_BOOT_DEVICE(mxc_serial) = {
+	.name	= "serial_mxc",
+	.platdata = &serial_mxc_plat,
+};
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 10d02b4..1f55150 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -21,6 +21,17 @@ 
 #define CONFIG_MACH_TYPE		4273
 #define CONFIG_SYS_HZ			1000
 
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_DM
+#define CONFIG_CMD_DM
+
+#define CONFIG_DM_GPIO
+#define CONFIG_CMD_GPIO
+
+#define CONFIG_DM_SERIAL
+#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
+#endif
+
 /* Display information on boot */
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO