diff mbox

[U-Boot,v3,4/4] ftsmc020: move ftsmc020 static mem controller to driver/mtd

Message ID 1302939431-27337-4-git-send-email-macpaul@andestech.com
State Accepted
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Macpaul Lin April 16, 2011, 7:37 a.m. UTC
Move the header file and definitions of ftsmc020
static memory control unit from a320 SoC folder to
"drivers/mtd" folder.

This change will let other SoC which also use ftsmc020
could share the same header file.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
---
Changes for v2:
 - Move the header file of ftsmc020.h to include/faraday.
 - Fix the include path of ftsmc020 for a320evb.
 - v1 of this patch /patch/71957/ in patchworks has been marked as superseded.

Changes for V3:
 - format patch by using -M option.

 arch/arm/cpu/arm920t/a320/Makefile                 |    1 -
 board/faraday/a320evb/a320evb.c                    |    2 +-
 drivers/mtd/Makefile                               |    1 +
 .../cpu/arm920t/a320 => drivers/mtd}/ftsmc020.c    |    2 +-
 include/configs/a320evb.h                          |    4 +++-
 .../asm/arch-a320 => include/faraday}/ftsmc020.h   |    0
 6 files changed, 6 insertions(+), 4 deletions(-)
 rename {arch/arm/cpu/arm920t/a320 => drivers/mtd}/ftsmc020.c (97%)
 rename {arch/arm/include/asm/arch-a320 => include/faraday}/ftsmc020.h (100%)

diff --git a/arch/arm/include/asm/arch-a320/ftsmc020.h b/include/faraday/ftsmc020.h
similarity index 100%
rename from arch/arm/include/asm/arch-a320/ftsmc020.h
rename to include/faraday/ftsmc020.h

Comments

Albert ARIBAUD April 23, 2011, 7:34 a.m. UTC | #1
Hi MacPaul,

Le 16/04/2011 09:37, Macpaul Lin a écrit :
> Move the header file and definitions of ftsmc020
> static memory control unit from a320 SoC folder to
> "drivers/mtd" folder.
>
> This change will let other SoC which also use ftsmc020
> could share the same header file.
>
> Signed-off-by: Macpaul Lin<macpaul@andestech.com>
> ---

Applied to u-boot-arm/master, thanks.

Amicalement,
Po-Yu Chuang April 28, 2011, 6:45 a.m. UTC | #2
Hi Macpaul,

On Sat, Apr 16, 2011 at 3:37 PM, Macpaul Lin <macpaul@andestech.com> wrote:
> Move the header file and definitions of ftsmc020
> static memory control unit from a320 SoC folder to
> "drivers/mtd" folder.
>
> This change will let other SoC which also use ftsmc020
> could share the same header file.
>
> Signed-off-by: Macpaul Lin <macpaul@andestech.com>

This patch makes a320evb failed to build.

> diff --git a/include/configs/a320evb.h b/include/configs/a320evb.h
> index 5373bcb..4b297f0 100644
> --- a/include/configs/a320evb.h
> +++ b/include/configs/a320evb.h
> @@ -163,7 +163,8 @@
>  * Static memory controller configuration
>  */
>
> -#include <asm/arch/ftsmc020.h>
> +#define CONFIG_FTSMC020
> +#include <faraday/ftsmc020.h>
>
>  #define FTSMC020_BANK0_CONFIG  (FTSMC020_BANK_ENABLE             |     \
>                                 FTSMC020_BANK_BASE(PHYS_FLASH_1) |     \
> @@ -196,6 +197,7 @@
>        { FTSMC020_BANK0_CONFIG, FTSMC020_BANK0_TIMING, },      \
>        { FTSMC020_BANK1_CONFIG, FTSMC020_BANK1_TIMING, },      \
>  }
> +#endif /* CONFIG_FTSMC020 */

Looks like this #endif is unnecessary?

best regards,
Po-Yu Chuang
Macpaul Lin April 28, 2011, 7:33 a.m. UTC | #3
Hi Po-Yu,

2011/4/28 Po-Yu Chuang <ratbert.chuang@gmail.com>:
> Hi Macpaul,
>
>> -#include <asm/arch/ftsmc020.h>
>> +#define CONFIG_FTSMC020
>> +#include <faraday/ftsmc020.h>
>>
>>  #define FTSMC020_BANK0_CONFIG  (FTSMC020_BANK_ENABLE             |     \
>>                                 FTSMC020_BANK_BASE(PHYS_FLASH_1) |     \
>> @@ -196,6 +197,7 @@
>>        { FTSMC020_BANK0_CONFIG, FTSMC020_BANK0_TIMING, },      \
>>        { FTSMC020_BANK1_CONFIG, FTSMC020_BANK1_TIMING, },      \
>>  }
>> +#endif /* CONFIG_FTSMC020 */
>
> Looks like this #endif is unnecessary?
>
> best regards,
> Po-Yu Chuang
>

At the time the patch has been generated, I could bulid a320evb.
I'm not in the office in these 2 days.
Could I check it and reply to you later?

According to your reply, I guess I was meant to support
#define CONFIG_FTSMC020 in board's config file.

I'll check it later after 10:00 in Taiwan time. Sorry.
Po-Yu Chuang April 28, 2011, 7:47 a.m. UTC | #4
Hi Macpaul,

On Thu, Apr 28, 2011 at 3:33 PM, Macpaul Lin <macpaul@gmail.com> wrote:
> Hi Po-Yu,
>
> 2011/4/28 Po-Yu Chuang <ratbert.chuang@gmail.com>:
>> Hi Macpaul,
>>
>>> -#include <asm/arch/ftsmc020.h>
>>> +#define CONFIG_FTSMC020

This is for drivers/mtd/Makefile.

>>> +#include <faraday/ftsmc020.h>
>>>
>>>  #define FTSMC020_BANK0_CONFIG  (FTSMC020_BANK_ENABLE             |     \
>>>                                 FTSMC020_BANK_BASE(PHYS_FLASH_1) |     \
>>> @@ -196,6 +197,7 @@
>>>        { FTSMC020_BANK0_CONFIG, FTSMC020_BANK0_TIMING, },      \
>>>        { FTSMC020_BANK1_CONFIG, FTSMC020_BANK1_TIMING, },      \
>>>  }
>>> +#endif /* CONFIG_FTSMC020 */
>>
>> Looks like this #endif is unnecessary?
>
> At the time the patch has been generated, I could bulid a320evb.
> I'm not in the office in these 2 days.
> Could I check it and reply to you later?
>
> According to your reply, I guess I was meant to support
> #define CONFIG_FTSMC020 in board's config file.
>
> I'll check it later after 10:00 in Taiwan time. Sorry.

After removed the #endif line, it builds again.
I will submit a simple patch. Please check it later.

Thanks, :-)
Po-Yu Chuang
Macpaul Lin April 28, 2011, 7:53 a.m. UTC | #5
Hi Po-Yu,

2011/4/28 Po-Yu Chuang <ratbert.chuang@gmail.com>:
> Hi Macpaul,
>> According to your reply, I guess I was meant to support
>> #define CONFIG_FTSMC020 in board's config file.
>>

I think it might be a problem when I'm clean up about the following
redundant code
#ifndef CONFIG_FTSMC020
#define CONFIG_FTSMC020
.....
#endif

> After removed the #endif line, it builds again.
> I will submit a simple patch. Please check it later.
>
> Thanks, :-)
> Po-Yu Chuang
>

Sorry to make you a problem here.
Thanks!
diff mbox

Patch

diff --git a/arch/arm/cpu/arm920t/a320/Makefile b/arch/arm/cpu/arm920t/a320/Makefile
index 31da706..50eb265 100644
--- a/arch/arm/cpu/arm920t/a320/Makefile
+++ b/arch/arm/cpu/arm920t/a320/Makefile
@@ -27,7 +27,6 @@  LIB	= $(obj)lib$(SOC).o
 
 SOBJS	+= reset.o
 COBJS	+= timer.o
-COBJS	+= ftsmc020.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/board/faraday/a320evb/a320evb.c b/board/faraday/a320evb/a320evb.c
index b9343e4..2578be4 100644
--- a/board/faraday/a320evb/a320evb.c
+++ b/board/faraday/a320evb/a320evb.c
@@ -21,7 +21,7 @@ 
 #include <netdev.h>
 #include <asm/io.h>
 
-#include <asm/arch/ftsmc020.h>
+#include <faraday/ftsmc020.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 999431c..5a5ecdf 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -32,6 +32,7 @@  COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o
 COBJS-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
 COBJS-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o
 COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
+COBJS-$(CONFIG_FTSMC020) += ftsmc020.o
 COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
 COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o
 COBJS-$(CONFIG_SPEARSMI) += spr_smi.o
diff --git a/arch/arm/cpu/arm920t/a320/ftsmc020.c b/drivers/mtd/ftsmc020.c
similarity index 97%
rename from arch/arm/cpu/arm920t/a320/ftsmc020.c
rename to drivers/mtd/ftsmc020.c
index 7646537..b027685 100644
--- a/arch/arm/cpu/arm920t/a320/ftsmc020.c
+++ b/drivers/mtd/ftsmc020.c
@@ -20,7 +20,7 @@ 
 #include <config.h>
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ftsmc020.h>
+#include <faraday/ftsmc020.h>
 
 struct ftsmc020_config {
 	unsigned int	config;
diff --git a/include/configs/a320evb.h b/include/configs/a320evb.h
index 5373bcb..4b297f0 100644
--- a/include/configs/a320evb.h
+++ b/include/configs/a320evb.h
@@ -163,7 +163,8 @@ 
  * Static memory controller configuration
  */
 
-#include <asm/arch/ftsmc020.h>
+#define CONFIG_FTSMC020
+#include <faraday/ftsmc020.h>
 
 #define FTSMC020_BANK0_CONFIG	(FTSMC020_BANK_ENABLE             |	\
 				 FTSMC020_BANK_BASE(PHYS_FLASH_1) |	\
@@ -196,6 +197,7 @@ 
 	{ FTSMC020_BANK0_CONFIG, FTSMC020_BANK0_TIMING, },	\
 	{ FTSMC020_BANK1_CONFIG, FTSMC020_BANK1_TIMING, },	\
 }
+#endif /* CONFIG_FTSMC020 */
 
 /*-----------------------------------------------------------------------
  * FLASH and environment organization