2009-06-18 15:13:19

by Nicolas Ferre

[permalink] [raw]
Subject: [PATCH 0/5] at91: Introduction of at91sam9g10 SOC

AT91sam9g10 is an ARM 926ej-s SOC. It is an evolution of the at91sam9261 with a
faster clock speed: 266/133MHz.

This patchset is relying on the integration of at91sam9g45 already posted. Here
is the patch series that you will have to take into account before applying
those patches.

clock.c changes:
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=5438/1

9g45 introduction:
http://lkml.org/lkml/2009/6/4/77
http://lkml.org/lkml/2009/6/4/76
http://lkml.org/lkml/2009/6/4/78

---
arch/arm/mach-at91/Kconfig | 25 +++++++++++++-
arch/arm/mach-at91/Makefile | 2 +
arch/arm/mach-at91/at91sam9261.c | 22 ++++++++++++-
arch/arm/mach-at91/board-sam9261ek.c | 14 ++++++++
arch/arm/mach-at91/clock.c | 6 ++-
arch/arm/mach-at91/include/mach/at91sam9261.h | 3 ++
arch/arm/mach-at91/include/mach/cpu.h | 7 ++++
arch/arm/mach-at91/include/mach/hardware.h | 2 +-
arch/arm/mach-at91/include/mach/timex.h | 5 +++
arch/arm/mach-at91/pm.c | 3 +-
drivers/usb/gadget/at91_udc.c | 6 ++--
drivers/usb/host/ohci-at91.c | 10 +++---
drivers/video/Kconfig | 4 +-
drivers/video/atmel_lcdfb.c | 6 ++-
drivers/video/backlight/Kconfig | 2 +-
15 files changed, 97 insertions(+), 20 deletions(-)


2009-06-18 15:12:58

by Nicolas Ferre

[permalink] [raw]
Subject: [PATCH 1/5] at91: Basic support for at91sam9g10: header files

From: Hong Xu <[email protected]>

AT91sam9g10 is an ARM 926ej-s SOC. It is an evolution of the at91sam9261 with a
faster clock speed: 266/133MHz.

Here is the basic header file support for this product.

Signed-off-by: Hong Xu <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
---
arch/arm/mach-at91/include/mach/at91sam9261.h | 3 +++
arch/arm/mach-at91/include/mach/cpu.h | 7 +++++++
arch/arm/mach-at91/include/mach/hardware.h | 2 +-
arch/arm/mach-at91/include/mach/timex.h | 5 +++++
4 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h b/arch/arm/mach-at91/include/mach/at91sam9261.h
index 3a348ca..87de8be 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261.h
@@ -95,6 +95,9 @@
#define AT91SAM9261_SRAM_BASE 0x00300000 /* Internal SRAM base address */
#define AT91SAM9261_SRAM_SIZE 0x00028000 /* Internal SRAM size (160Kb) */

+#define AT91SAM9G10_SRAM_BASE AT91SAM9261_SRAM_BASE /* Internal SRAM base address */
+#define AT91SAM9G10_SRAM_SIZE 0x00004000 /* Internal SRAM size (16Kb) */
+
#define AT91SAM9261_ROM_BASE 0x00400000 /* Internal ROM base address */
#define AT91SAM9261_ROM_SIZE SZ_32K /* Internal ROM size (32Kb) */

diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index b73e7bf..34a9502 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -21,6 +21,7 @@
#define ARCH_ID_AT91SAM9260 0x019803a0
#define ARCH_ID_AT91SAM9261 0x019703a0
#define ARCH_ID_AT91SAM9263 0x019607a0
+#define ARCH_ID_AT91SAM9G10 0x819903a0
#define ARCH_ID_AT91SAM9G20 0x019905a0
#define ARCH_ID_AT91SAM9RL64 0x019b03a0
#define ARCH_ID_AT91SAM9G45 0x819b05a0
@@ -97,6 +98,12 @@ static inline unsigned long at91cap9_rev_identify(void)
#define cpu_is_at91sam9261() (0)
#endif

+#ifdef CONFIG_ARCH_AT91SAM9G10
+#define cpu_is_at91sam9g10() (at91_cpu_identify() == ARCH_ID_AT91SAM9G10)
+#else
+#define cpu_is_at91sam9g10() (0)
+#endif
+
#ifdef CONFIG_ARCH_AT91SAM9263
#define cpu_is_at91sam9263() (at91_cpu_identify() == ARCH_ID_AT91SAM9263)
#else
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index f086917..a0df8b0 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -20,7 +20,7 @@
#include <mach/at91rm9200.h>
#elif defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
#include <mach/at91sam9260.h>
-#elif defined(CONFIG_ARCH_AT91SAM9261)
+#elif defined(CONFIG_ARCH_AT91SAM9261) || defined(CONFIG_ARCH_AT91SAM9G10)
#include <mach/at91sam9261.h>
#elif defined(CONFIG_ARCH_AT91SAM9263)
#include <mach/at91sam9263.h>
diff --git a/arch/arm/mach-at91/include/mach/timex.h b/arch/arm/mach-at91/include/mach/timex.h
index 38f6c42..31ac2d9 100644
--- a/arch/arm/mach-at91/include/mach/timex.h
+++ b/arch/arm/mach-at91/include/mach/timex.h
@@ -42,6 +42,11 @@
#define AT91SAM9_MASTER_CLOCK 99300000
#define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16)

+#elif defined(CONFIG_ARCH_AT91SAM9G10)
+
+#define AT91SAM9_MASTER_CLOCK 133000000
+#define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16)
+
#elif defined(CONFIG_ARCH_AT91SAM9263)

#if defined(CONFIG_MACH_USB_A9263)
--
1.5.3.7

2009-06-18 15:13:33

by Nicolas Ferre

[permalink] [raw]
Subject: [PATCH 5/5] at91/atmel_lcdfb: add at91sam9g10 support to atmel LCD driver

From: Hong Xu <[email protected]>

Modify atmel LCD driver: atmel_lcdfb for at91sam9g10. This add a clock
management equivalent to at91sam9261.

Signed-off-by: Hong Xu <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
---
drivers/video/Kconfig | 4 ++--
drivers/video/atmel_lcdfb.c | 6 ++++--
drivers/video/backlight/Kconfig | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 5152168..2dbede4 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -933,7 +933,7 @@ config FB_S1D13XXX

config FB_ATMEL
tristate "AT91/AT32 LCD Controller support"
- depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
+ depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -949,7 +949,7 @@ config FB_INTSRAM

config FB_ATMEL_STN
bool "Use a STN display with AT91/AT32 LCD Controller"
- depends on FB_ATMEL && MACH_AT91SAM9261EK
+ depends on FB_ATMEL && (MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK)
default n
help
Say Y if you want to connect a STN LCD display to the AT91/AT32 LCD
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 9a577a8..fc10ac5 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -188,7 +188,8 @@ static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2)
{
unsigned long value;

- if (!(cpu_is_at91sam9261() || cpu_is_at32ap7000()))
+ if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10()
+ || cpu_is_at32ap7000()))
return xres;

value = xres;
@@ -827,7 +828,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
info->fix = atmel_lcdfb_fix;

/* Enable LCDC Clocks */
- if (cpu_is_at91sam9261() || cpu_is_at32ap7000()) {
+ if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()
+ || cpu_is_at32ap7000()) {
sinfo->bus_clk = clk_get(dev, "hck1");
if (IS_ERR(sinfo->bus_clk)) {
ret = PTR_ERR(sinfo->bus_clk);
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index f9d19be..90861cd 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -110,7 +110,7 @@ config BACKLIGHT_CLASS_DEVICE
config BACKLIGHT_ATMEL_LCDC
bool "Atmel LCDC Contrast-as-Backlight control"
depends on BACKLIGHT_CLASS_DEVICE && FB_ATMEL
- default y if MACH_SAM9261EK || MACH_SAM9263EK
+ default y if MACH_SAM9261EK || MACH_SAM9G10EK || MACH_SAM9263EK
help
This provides a backlight control internal to the Atmel LCDC
driver. If the LCD "contrast control" on your board is wired
--
1.5.3.7

2009-06-18 15:13:46

by Nicolas Ferre

[permalink] [raw]
Subject: [PATCH 4/5] at91/USB: USB drivers modifications for at91sam9g10

From: Hong Xu <[email protected]>

Modify both host and gadget USB drivers for at91sam9g10.
This add a clock management equivalent to at91sam9261 on usb drivers.
It also add the way of handling gadget pull-ups (like the at91sam9261).

Signed-off-by: Hong Xu <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
---
drivers/usb/gadget/at91_udc.c | 6 +++---
drivers/usb/host/ohci-at91.c | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 0b2bb8f..bfed3d9 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -892,7 +892,7 @@ static void pullup(struct at91_udc *udc, int is_on)

txvc |= AT91_UDP_TXVC_PUON;
at91_udp_write(udc, AT91_UDP_TXVC, txvc);
- } else if (cpu_is_at91sam9261()) {
+ } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
u32 usbpucr;

usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
@@ -910,7 +910,7 @@ static void pullup(struct at91_udc *udc, int is_on)

txvc &= ~AT91_UDP_TXVC_PUON;
at91_udp_write(udc, AT91_UDP_TXVC, txvc);
- } else if (cpu_is_at91sam9261()) {
+ } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
u32 usbpucr;

usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
@@ -1692,7 +1692,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
udc->ep[3].maxpacket = 64;
udc->ep[4].maxpacket = 512;
udc->ep[5].maxpacket = 512;
- } else if (cpu_is_at91sam9261()) {
+ } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
udc->ep[3].maxpacket = 64;
} else if (cpu_is_at91sam9263()) {
udc->ep[0].maxpacket = 64;
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index b29b0fe..fb64def 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -35,7 +35,7 @@ extern int usb_disabled(void);

static void at91_start_clock(void)
{
- if (cpu_is_at91sam9261())
+ if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
clk_enable(hclk);
clk_enable(iclk);
clk_enable(fclk);
@@ -46,7 +46,7 @@ static void at91_stop_clock(void)
{
clk_disable(fclk);
clk_disable(iclk);
- if (cpu_is_at91sam9261())
+ if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
clk_disable(hclk);
clocked = 0;
}
@@ -142,7 +142,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,

iclk = clk_get(&pdev->dev, "ohci_clk");
fclk = clk_get(&pdev->dev, "uhpck");
- if (cpu_is_at91sam9261())
+ if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
hclk = clk_get(&pdev->dev, "hck0");

at91_start_hc(pdev);
@@ -156,7 +156,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
/* Error handling */
at91_stop_hc(pdev);

- if (cpu_is_at91sam9261())
+ if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
clk_put(hclk);
clk_put(fclk);
clk_put(iclk);
@@ -193,7 +193,7 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd,
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
usb_put_hcd(hcd);

- if (cpu_is_at91sam9261())
+ if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
clk_put(hclk);
clk_put(fclk);
clk_put(iclk);
--
1.5.3.7

2009-06-18 15:14:00

by Nicolas Ferre

[permalink] [raw]
Subject: [PATCH 2/5] at91: Support for at91sam9g10: clocks management

From: Hong Xu <[email protected]>

Add the at91sam9g10 support to the AT91 generic clock file. It takes
advantage of the management by functionalities of those PLLs and clocks.

Signed-off-by: Hong Xu <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
---
arch/arm/mach-at91/clock.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 6396680..c042dcf 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -53,7 +53,7 @@
#define cpu_has_800M_plla() ( cpu_is_at91sam9g20() \
|| cpu_is_at91sam9g45())

-#define cpu_has_300M_plla() (0)
+#define cpu_has_300M_plla() (cpu_is_at91sam9g10())

#define cpu_has_pllb() (!(cpu_is_at91sam9rl() \
|| cpu_is_at91sam9g45()))
@@ -626,7 +626,9 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock)
uhpck.pmc_mask = AT91RM9200_PMC_UHP;
udpck.pmc_mask = AT91RM9200_PMC_UDP;
at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
- } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) {
+ } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() ||
+ cpu_is_at91sam9263() || cpu_is_at91sam9g20() ||
+ cpu_is_at91sam9g10()) {
uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
udpck.pmc_mask = AT91SAM926x_PMC_UDP;
} else if (cpu_is_at91cap9()) {
--
1.5.3.7

2009-06-18 15:14:39

by Nicolas Ferre

[permalink] [raw]
Subject: [PATCH 3/5] at91: Support for at91sam9g10: core chip & board support

From: Hong Xu <[email protected]>

Here are the modification to at91sam9261 files dedicated to the support of
at91sam9g10. This direction has been adopted to minimize code duplication.

All at91sam9261 drivers are enabled in _devices and board- files. Modificaton
to peripherals that support at91sam9g10 will be added in future patches.

Signed-off-by: Hong Xu <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
---
arch/arm/mach-at91/Kconfig | 25 +++++++++++++++++++++++--
arch/arm/mach-at91/Makefile | 2 ++
arch/arm/mach-at91/at91sam9261.c | 22 +++++++++++++++++++++-
arch/arm/mach-at91/board-sam9261ek.c | 14 ++++++++++++++
arch/arm/mach-at91/pm.c | 3 ++-
5 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 22309ba..8f3e15a 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -23,6 +23,12 @@ config ARCH_AT91SAM9261
select GENERIC_TIME
select GENERIC_CLOCKEVENTS

+config ARCH_AT91SAM9G10
+ bool "AT91SAM9G10"
+ select CPU_ARM926T
+ select GENERIC_TIME
+ select GENERIC_CLOCKEVENTS
+
config ARCH_AT91SAM9263
bool "AT91SAM9263"
select CPU_ARM926T
@@ -230,6 +236,21 @@ endif

# ----------------------------------------------------------

+if ARCH_AT91SAM9G10
+
+comment "AT91SAM9G10 Board Type"
+
+config MACH_AT91SAM9G10EK
+ bool "Atmel AT91SAM9G10-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G10
+ help
+ Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
+
+endif
+
+# ----------------------------------------------------------
+
if ARCH_AT91SAM9263

comment "AT91SAM9263 Board Type"
@@ -337,13 +358,13 @@ comment "AT91 Board Options"

config MTD_AT91_DATAFLASH_CARD
bool "Enable DataFlash Card support"
- depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK || MACH_NEOCORE926)
+ depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK || MACH_NEOCORE926)
help
Enable support for the DataFlash card.

config MTD_NAND_ATMEL_BUSWIDTH_16
bool "Enable 16-bit data bus interface to NAND flash"
- depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK)
+ depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK)
help
On AT91SAM926x boards both types of NAND flash can be present
(8 and 16 bit data bus width).
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 2975f9a..4eaf80a 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_AT91_PMC_UNIT) += clock.o
obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o
obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o
+obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o
obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o sam9_smc.o
obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o
obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o
@@ -44,6 +45,7 @@ obj-$(CONFIG_MACH_AFEB9260) += board-afeb-9260v1.o

# AT91SAM9261 board-specific support
obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
+obj-$(CONFIG_MACH_AT91SAM9G10EK) += board-sam9261ek.o

# AT91SAM9263 board-specific support
obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 3acd7d7..4ecf379 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -16,6 +16,7 @@
#include <asm/irq.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
+#include <mach/cpu.h>
#include <mach/at91sam9261.h>
#include <mach/at91_pmc.h>
#include <mach/at91_rstc.h>
@@ -30,7 +31,11 @@ static struct map_desc at91sam9261_io_desc[] __initdata = {
.pfn = __phys_to_pfn(AT91_BASE_SYS),
.length = SZ_16K,
.type = MT_DEVICE,
- }, {
+ },
+};
+
+static struct map_desc at91sam9261_sram_desc[] __initdata = {
+ {
.virtual = AT91_IO_VIRT_BASE - AT91SAM9261_SRAM_SIZE,
.pfn = __phys_to_pfn(AT91SAM9261_SRAM_BASE),
.length = AT91SAM9261_SRAM_SIZE,
@@ -38,6 +43,15 @@ static struct map_desc at91sam9261_io_desc[] __initdata = {
},
};

+static struct map_desc at91sam9g10_sram_desc[] __initdata = {
+ {
+ .virtual = AT91_IO_VIRT_BASE - AT91SAM9G10_SRAM_SIZE,
+ .pfn = __phys_to_pfn(AT91SAM9G10_SRAM_BASE),
+ .length = AT91SAM9G10_SRAM_SIZE,
+ .type = MT_DEVICE,
+ },
+};
+
/* --------------------------------------------------------------------
* Clocks
* -------------------------------------------------------------------- */
@@ -263,6 +277,12 @@ void __init at91sam9261_initialize(unsigned long main_clock)
/* Map peripherals */
iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));

+ if (cpu_is_at91sam9g10())
+ iotable_init(at91sam9g10_sram_desc, ARRAY_SIZE(at91sam9g10_sram_desc));
+ else
+ iotable_init(at91sam9261_sram_desc, ARRAY_SIZE(at91sam9261_sram_desc));
+
+
at91_arch_reset = at91sam9261_reset;
pm_power_off = at91sam9261_poweroff;
at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index d5266da..f9b1999 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -287,7 +287,11 @@ static void __init ek_add_device_ts(void) {}
*/
static struct at73c213_board_info at73c213_data = {
.ssc_id = 1,
+#if defined(CONFIG_MACH_AT91SAM9261EK)
.shortname = "AT91SAM9261-EK external DAC",
+#else
+ .shortname = "AT91SAM9G10-EK external DAC",
+#endif
};

#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
@@ -414,6 +418,9 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
.default_monspecs = &at91fb_default_stn_monspecs,
.atmel_lcdfb_power_control = at91_lcdc_stn_power_control,
.guard_time = 1,
+#if defined(CONFIG_MACH_AT91SAM9G10EK)
+ .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
+#endif
};

#else
@@ -467,6 +474,9 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
.default_monspecs = &at91fb_default_tft_monspecs,
.atmel_lcdfb_power_control = at91_lcdc_tft_power_control,
.guard_time = 1,
+#if defined(CONFIG_MACH_AT91SAM9G10EK)
+ .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
+#endif
};
#endif

@@ -600,7 +610,11 @@ static void __init ek_board_init(void)
at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
}

+#if defined(CONFIG_MACH_AT91SAM9261EK)
MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
+#else
+MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
+#endif
/* Maintainer: Atmel */
.phys_io = AT91_BASE_SYS,
.io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index e26c4fe..4028724 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -201,7 +201,8 @@ static int at91_pm_verify_clocks(void)
pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
return 0;
}
- } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) {
+ } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263()
+ || cpu_is_at91sam9g20() || cpu_is_at91sam9g10()) {
if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) {
pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
return 0;
--
1.5.3.7

Subject: Re: [PATCH 5/5] at91/atmel_lcdfb: add at91sam9g10 support to atmel LCD driver

On 18:16 Thu 18 Jun , Nicolas Ferre wrote:
> From: Hong Xu <[email protected]>
>
> Modify atmel LCD driver: atmel_lcdfb for at91sam9g10. This add a clock
> management equivalent to at91sam9261.
>
> Signed-off-by: Hong Xu <[email protected]>
> Signed-off-by: Nicolas Ferre <[email protected]>
> ---
> drivers/video/Kconfig | 4 ++--
> drivers/video/atmel_lcdfb.c | 6 ++++--
> drivers/video/backlight/Kconfig | 2 +-
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index 5152168..2dbede4 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -933,7 +933,7 @@ config FB_S1D13XXX
>
> config FB_ATMEL
> tristate "AT91/AT32 LCD Controller support"
> - depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
> + depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
create a ARCH_ATMEL_HAS_FB then select it at the soc will allow to reduce this || xx... by
depends on FB && ARCH_ATMEL_HAS_FB

Best Regards,
J.

Subject: Re: [PATCH 3/5] at91: Support for at91sam9g10: core chip & board support

On 18:16 Thu 18 Jun , Nicolas Ferre wrote:
> From: Hong Xu <[email protected]>
>
> Here are the modification to at91sam9261 files dedicated to the support of
> at91sam9g10. This direction has been adopted to minimize code duplication.
>
> All at91sam9261 drivers are enabled in _devices and board- files. Modificaton
> to peripherals that support at91sam9g10 will be added in future patches.
>
> Signed-off-by: Hong Xu <[email protected]>
> Signed-off-by: Nicolas Ferre <[email protected]>
> ---
> arch/arm/mach-at91/Kconfig | 25 +++++++++++++++++++++++--
> arch/arm/mach-at91/Makefile | 2 ++
> arch/arm/mach-at91/at91sam9261.c | 22 +++++++++++++++++++++-
> arch/arm/mach-at91/board-sam9261ek.c | 14 ++++++++++++++
> arch/arm/mach-at91/pm.c | 3 ++-
> 5 files changed, 62 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index 22309ba..8f3e15a 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -23,6 +23,12 @@ config ARCH_AT91SAM9261
> select GENERIC_TIME
> select GENERIC_CLOCKEVENTS
>
> +config ARCH_AT91SAM9G10
> + bool "AT91SAM9G10"
> + select CPU_ARM926T
> + select GENERIC_TIME
> + select GENERIC_CLOCKEVENTS
> +
> config ARCH_AT91SAM9263
> bool "AT91SAM9263"
> select CPU_ARM926T
> @@ -230,6 +236,21 @@ endif
>
> # ----------------------------------------------------------
>
> +if ARCH_AT91SAM9G10
> +
> +comment "AT91SAM9G10 Board Type"
> +
> +config MACH_AT91SAM9G10EK
> + bool "Atmel AT91SAM9G10-EK Evaluation Kit"
> + depends on ARCH_AT91SAM9G10
> + help
> + Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
> + <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
> +
> +endif
> +
> +# ----------------------------------------------------------
> +
> if ARCH_AT91SAM9263
>
> comment "AT91SAM9263 Board Type"
> @@ -337,13 +358,13 @@ comment "AT91 Board Options"
>
> config MTD_AT91_DATAFLASH_CARD
> bool "Enable DataFlash Card support"
> - depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK || MACH_NEOCORE926)
> + depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK || MACH_NEOCORE926)
can we reduce it and do as the propostion for the FB and create a new
config and then select it at the board?
> help
> Enable support for the DataFlash card.
>
> config MTD_NAND_ATMEL_BUSWIDTH_16
> bool "Enable 16-bit data bus interface to NAND flash"
> - depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK)
> + depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK)
ditto
> help
> On AT91SAM926x boards both types of NAND flash can be present
> (8 and 16 bit data bus width).
> diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> index 2975f9a..4eaf80a 100644
> --- a/arch/arm/mach-at91/Makefile
> +++ b/arch/arm/mach-at91/Makefile
> @@ -13,6 +13,7 @@ obj-$(CONFIG_AT91_PMC_UNIT) += clock.o
> obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
> obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o
> obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o
> +obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o
> obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o sam9_smc.o
> obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o
> obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o
> @@ -44,6 +45,7 @@ obj-$(CONFIG_MACH_AFEB9260) += board-afeb-9260v1.o
>
> # AT91SAM9261 board-specific support
> obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
> +obj-$(CONFIG_MACH_AT91SAM9G10EK) += board-sam9261ek.o
>
> # AT91SAM9263 board-specific support
> obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
> diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
> index 3acd7d7..4ecf379 100644
> --- a/arch/arm/mach-at91/at91sam9261.c
> +++ b/arch/arm/mach-at91/at91sam9261.c
> @@ -16,6 +16,7 @@
> #include <asm/irq.h>
> #include <asm/mach/arch.h>
> #include <asm/mach/map.h>
> +#include <mach/cpu.h>
> #include <mach/at91sam9261.h>
> #include <mach/at91_pmc.h>
> #include <mach/at91_rstc.h>
> @@ -30,7 +31,11 @@ static struct map_desc at91sam9261_io_desc[] __initdata = {
> .pfn = __phys_to_pfn(AT91_BASE_SYS),
> .length = SZ_16K,
> .type = MT_DEVICE,
> - }, {
> + },
> +};
> +
> +static struct map_desc at91sam9261_sram_desc[] __initdata = {
> + {
> .virtual = AT91_IO_VIRT_BASE - AT91SAM9261_SRAM_SIZE,
> .pfn = __phys_to_pfn(AT91SAM9261_SRAM_BASE),
> .length = AT91SAM9261_SRAM_SIZE,
> @@ -38,6 +43,15 @@ static struct map_desc at91sam9261_io_desc[] __initdata = {
> },
> };
>
> +static struct map_desc at91sam9g10_sram_desc[] __initdata = {
> + {
> + .virtual = AT91_IO_VIRT_BASE - AT91SAM9G10_SRAM_SIZE,
> + .pfn = __phys_to_pfn(AT91SAM9G10_SRAM_BASE),
> + .length = AT91SAM9G10_SRAM_SIZE,
> + .type = MT_DEVICE,
> + },
> +};
> +
> /* --------------------------------------------------------------------
> * Clocks
> * -------------------------------------------------------------------- */
> @@ -263,6 +277,12 @@ void __init at91sam9261_initialize(unsigned long main_clock)
> /* Map peripherals */
> iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
>
> + if (cpu_is_at91sam9g10())
> + iotable_init(at91sam9g10_sram_desc, ARRAY_SIZE(at91sam9g10_sram_desc));
> + else
> + iotable_init(at91sam9261_sram_desc, ARRAY_SIZE(at91sam9261_sram_desc));
> +
> +
> at91_arch_reset = at91sam9261_reset;
> pm_power_off = at91sam9261_poweroff;
> at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
> diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
> index d5266da..f9b1999 100644
> --- a/arch/arm/mach-at91/board-sam9261ek.c
> +++ b/arch/arm/mach-at91/board-sam9261ek.c
> @@ -287,7 +287,11 @@ static void __init ek_add_device_ts(void) {}
> */
> static struct at73c213_board_info at73c213_data = {
> .ssc_id = 1,
> +#if defined(CONFIG_MACH_AT91SAM9261EK)
> .shortname = "AT91SAM9261-EK external DAC",
> +#else
> + .shortname = "AT91SAM9G10-EK external DAC",
> +#endif
> };
>
> #if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
> @@ -414,6 +418,9 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
> .default_monspecs = &at91fb_default_stn_monspecs,
> .atmel_lcdfb_power_control = at91_lcdc_stn_power_control,
> .guard_time = 1,
> +#if defined(CONFIG_MACH_AT91SAM9G10EK)
> + .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
> +#endif
> };
>
> #else
> @@ -467,6 +474,9 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
> .default_monspecs = &at91fb_default_tft_monspecs,
> .atmel_lcdfb_power_control = at91_lcdc_tft_power_control,
> .guard_time = 1,
> +#if defined(CONFIG_MACH_AT91SAM9G10EK)
> + .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
> +#endif
> };
> #endif
>
> @@ -600,7 +610,11 @@ static void __init ek_board_init(void)
> at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
> }
>
> +#if defined(CONFIG_MACH_AT91SAM9261EK)
> MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
> +#else
> +MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
> +#endif
> /* Maintainer: Atmel */
> .phys_io = AT91_BASE_SYS,
> .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index e26c4fe..4028724 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -201,7 +201,8 @@ static int at91_pm_verify_clocks(void)
> pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
> return 0;
> }
> - } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) {
> + } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263()
> + || cpu_is_at91sam9g20() || cpu_is_at91sam9g10()) {
instead add more and more cpu_is why not cpu_has_pmc_uhp() ?

Best Regards,
J.

2009-06-23 13:20:37

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 5/5] at91/atmel_lcdfb: add at91sam9g10 support to atmel LCD driver

Jean-Christophe PLAGNIOL-VILLARD :
> On 18:16 Thu 18 Jun , Nicolas Ferre wrote:
>> From: Hong Xu <[email protected]>
>>
>> Modify atmel LCD driver: atmel_lcdfb for at91sam9g10. This add a clock
>> management equivalent to at91sam9261.
>>
>> Signed-off-by: Hong Xu <[email protected]>
>> Signed-off-by: Nicolas Ferre <[email protected]>
>> ---
>> drivers/video/Kconfig | 4 ++--
>> drivers/video/atmel_lcdfb.c | 6 ++++--
>> drivers/video/backlight/Kconfig | 2 +-
>> 3 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
>> index 5152168..2dbede4 100644
>> --- a/drivers/video/Kconfig
>> +++ b/drivers/video/Kconfig
>> @@ -933,7 +933,7 @@ config FB_S1D13XXX
>>
>> config FB_ATMEL
>> tristate "AT91/AT32 LCD Controller support"
>> - depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
>> + depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
> create a ARCH_ATMEL_HAS_FB then select it at the soc will allow to reduce this || xx... by
> depends on FB && ARCH_ATMEL_HAS_FB

Maybe we can schedule such an update on top of this patch series.
Indeed, as it impacts also AVR32, I propose to build a patch with both
architecture update once at91sam9g45 and at91sam9g10 patchsets are queued.

A proposition follows.

Regards,
--
Nicolas Ferre

2009-06-23 13:28:49

by Nicolas Ferre

[permalink] [raw]
Subject: [RFC PATCH] atmel_lcdfb Kconfig: remove long dependency line

Many Atmel SOC are embedding a LCD controller. This patch removes the long
dependency line for this Atmel LCD framebuffer driver configuration entry.
The ARCH_ATMEL_HAS_FB configuration option is located in the video Kconfig file
as it may be setup by ARM/AT91 and AVR32 chips.

Signed-off-by: Nicolas Ferre <[email protected]>
---
Beware, this proposition goes on top of at91sam9g45 & at91sam9g10 patchsets
already posted. My proposition is to wait for those series are queued before
applying this modification.

arch/arm/mach-at91/Kconfig | 6 ++++++
arch/avr32/Kconfig | 1 +
drivers/video/Kconfig | 7 ++++++-
3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 8f3e15a..00c7e08 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -22,24 +22,28 @@ config ARCH_AT91SAM9261
select CPU_ARM926T
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+ select ARCH_ATMEL_HAS_FB

config ARCH_AT91SAM9G10
bool "AT91SAM9G10"
select CPU_ARM926T
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+ select ARCH_ATMEL_HAS_FB

config ARCH_AT91SAM9263
bool "AT91SAM9263"
select CPU_ARM926T
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+ select ARCH_ATMEL_HAS_FB

config ARCH_AT91SAM9RL
bool "AT91SAM9RL"
select CPU_ARM926T
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+ select ARCH_ATMEL_HAS_FB

config ARCH_AT91SAM9G20
bool "AT91SAM9G20"
@@ -52,12 +56,14 @@ config ARCH_AT91SAM9G45
select CPU_ARM926T
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+ select ARCH_ATMEL_HAS_FB

config ARCH_AT91CAP9
bool "AT91CAP9"
select CPU_ARM926T
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+ select ARCH_ATMEL_HAS_FB

config ARCH_AT91X40
bool "AT91x40"
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 35e3bd9..43d4946 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -92,6 +92,7 @@ config PLATFORM_AT32AP
select PERFORMANCE_COUNTERS
select ARCH_REQUIRE_GPIOLIB
select GENERIC_ALLOCATOR
+ select ARCH_ATMEL_HAS_FB

#
# CPU types
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 2dbede4..a2cdf88 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -931,9 +931,14 @@ config FB_S1D13XXX
working with S1D13806). Product specs at
<http://www.erd.epson.com/vdc/html/legacy_13xxx.htm>

+config ARCH_ATMEL_HAS_FB
+ bool
+ depends on FB
+ default n
+
config FB_ATMEL
tristate "AT91/AT32 LCD Controller support"
- depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
+ depends on FB && ARCH_ATMEL_HAS_FB
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
--
1.5.3.7

2009-06-23 13:37:32

by Haavard Skinnemoen

[permalink] [raw]
Subject: Re: [RFC PATCH] atmel_lcdfb Kconfig: remove long dependency line

Nicolas Ferre wrote:
> +config ARCH_ATMEL_HAS_FB
> + bool
> + depends on FB
> + default n

What happens when we unconditionally select something which depends on
something else?

Haavard

2009-06-23 14:13:32

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [RFC PATCH] atmel_lcdfb Kconfig: remove long dependency line

Haavard Skinnemoen :
> Nicolas Ferre wrote:
>> +config ARCH_ATMEL_HAS_FB
>> + bool
>> + depends on FB
>> + default n
>
> What happens when we unconditionally select something which depends on
> something else?

:-P

Experience shows that this configuration is selected.

The dependency allows to have a good hierarchy in the configuration tree...
Better proposition welcome.

Bye,
--
Nicolas Ferre

Subject: Re: [RFC PATCH] atmel_lcdfb Kconfig: remove long dependency line

>
> +config ARCH_ATMEL_HAS_FB
> + bool
> + depends on FB
as you use it just under with the FB condition too
I think you can avoid this depend here
> + default n
> +
> config FB_ATMEL
> tristate "AT91/AT32 LCD Controller support"
> - depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
> + depends on FB && ARCH_ATMEL_HAS_FB
> select FB_CFB_FILLRECT
> select FB_CFB_COPYAREA
> select FB_CFB_IMAGEBLIT

Best Regards,
J.

2009-06-25 08:46:59

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [RFC PATCH] atmel_lcdfb Kconfig: remove long dependency line

On Tue, Jun 23, 2009 at 04:12:54PM +0200, Nicolas Ferre wrote:
> Haavard Skinnemoen :
> > Nicolas Ferre wrote:
> >> +config ARCH_ATMEL_HAS_FB
> >> + bool
> >> + depends on FB
> >> + default n
> >
> > What happens when we unconditionally select something which depends on
> > something else?
>
> :-P
>
> Experience shows that this configuration is selected.
>
> The dependency allows to have a good hierarchy in the configuration tree...
> Better proposition welcome.

1st - no need for 'default n' - you're specifying something that's already
the default.

2nd - don't make this symbol depend on anything, and don't use the symbol
for anything except providing a dependency for FB_ATMEL. Instead, let
FB_ATMEL deal with the dependency on FB and ARCH_ATMEL_HAS_FB.

3rd - ISTR we have a convention for these - 'HAVE_foo' for a configuration
option named 'foo'. So it should probably be HAVE_FB_ATMEL.

2009-06-25 22:00:15

by Andrew Victor

[permalink] [raw]
Subject: Re: [PATCH 0/5] at91: Introduction of at91sam9g10 SOC

hi Nicolas,

> AT91sam9g10 is an ARM 926ej-s SOC. It is an evolution of the at91sam9261 with a
> faster clock speed: 266/133MHz.
>
> This patchset is relying on the integration of at91sam9g45 already posted. Here
> is the patch series that you will have to take into account before applying
> those patches.

This set of patches looks fine to me.

Acked-by: Andrew Victor <[email protected]>

2009-07-06 10:45:14

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 5/5] at91/atmel_lcdfb: add at91sam9g10 support to atmel LCD driver

Hi,

Nicolas Ferre :
> From: Hong Xu <[email protected]>
>
> Modify atmel LCD driver: atmel_lcdfb for at91sam9g10. This add a clock
> management equivalent to at91sam9261.

Can we consider an inclusion in linux-fbdev ?

> Signed-off-by: Hong Xu <[email protected]>
> Signed-off-by: Nicolas Ferre <[email protected]>

Andrew Victor added his:
Acked-by: Andrew Victor <[email protected]>

> ---
> drivers/video/Kconfig | 4 ++--
> drivers/video/atmel_lcdfb.c | 6 ++++--
> drivers/video/backlight/Kconfig | 2 +-
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index 5152168..2dbede4 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -933,7 +933,7 @@ config FB_S1D13XXX
>
> config FB_ATMEL
> tristate "AT91/AT32 LCD Controller support"
> - depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
> + depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32)
> select FB_CFB_FILLRECT
> select FB_CFB_COPYAREA
> select FB_CFB_IMAGEBLIT
> @@ -949,7 +949,7 @@ config FB_INTSRAM
>
> config FB_ATMEL_STN
> bool "Use a STN display with AT91/AT32 LCD Controller"
> - depends on FB_ATMEL && MACH_AT91SAM9261EK
> + depends on FB_ATMEL && (MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK)
> default n
> help
> Say Y if you want to connect a STN LCD display to the AT91/AT32 LCD
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index 9a577a8..fc10ac5 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -188,7 +188,8 @@ static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2)
> {
> unsigned long value;
>
> - if (!(cpu_is_at91sam9261() || cpu_is_at32ap7000()))
> + if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10()
> + || cpu_is_at32ap7000()))
> return xres;
>
> value = xres;
> @@ -827,7 +828,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
> info->fix = atmel_lcdfb_fix;
>
> /* Enable LCDC Clocks */
> - if (cpu_is_at91sam9261() || cpu_is_at32ap7000()) {
> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()
> + || cpu_is_at32ap7000()) {
> sinfo->bus_clk = clk_get(dev, "hck1");
> if (IS_ERR(sinfo->bus_clk)) {
> ret = PTR_ERR(sinfo->bus_clk);
> diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
> index f9d19be..90861cd 100644
> --- a/drivers/video/backlight/Kconfig
> +++ b/drivers/video/backlight/Kconfig
> @@ -110,7 +110,7 @@ config BACKLIGHT_CLASS_DEVICE
> config BACKLIGHT_ATMEL_LCDC
> bool "Atmel LCDC Contrast-as-Backlight control"
> depends on BACKLIGHT_CLASS_DEVICE && FB_ATMEL
> - default y if MACH_SAM9261EK || MACH_SAM9263EK
> + default y if MACH_SAM9261EK || MACH_SAM9G10EK || MACH_SAM9263EK
> help
> This provides a backlight control internal to the Atmel LCDC
> driver. If the LCD "contrast control" on your board is wired


Best regards,
--
Nicolas Ferre

2009-07-20 22:25:09

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 5/5] at91/atmel_lcdfb: add at91sam9g10 support to atmel LCD driver

On Mon, 06 Jul 2009 12:32:53 +0200
Nicolas Ferre <[email protected]> wrote:

> Hi,
>
> Nicolas Ferre :
> > From: Hong Xu <[email protected]>
> >
> > Modify atmel LCD driver: atmel_lcdfb for at91sam9g10. This add a clock
> > management equivalent to at91sam9261.
>
> Can we consider an inclusion in linux-fbdev ?

The patch looks OK to me.

> > Signed-off-by: Hong Xu <[email protected]>
> > Signed-off-by: Nicolas Ferre <[email protected]>
>
> Andrew Victor added his:
> Acked-by: Andrew Victor <[email protected]>
>
> > ---
> > drivers/video/Kconfig | 4 ++--
> > drivers/video/atmel_lcdfb.c | 6 ++++--
> > drivers/video/backlight/Kconfig | 2 +-
> > 3 files changed, 7 insertions(+), 5 deletions(-)

Please merge it via an ARM tree?

2009-07-21 09:31:52

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 5/5] at91/atmel_lcdfb: add at91sam9g10 support to atmel LCD driver

Andrew Morton :
> On Mon, 06 Jul 2009 12:32:53 +0200
> Nicolas Ferre <[email protected]> wrote:
>
>> Hi,
>>
>> Nicolas Ferre :
>>> From: Hong Xu <[email protected]>
>>>
>>> Modify atmel LCD driver: atmel_lcdfb for at91sam9g10. This add a clock
>>> management equivalent to at91sam9261.
>> Can we consider an inclusion in linux-fbdev ?
>
> The patch looks OK to me.
>
>>> Signed-off-by: Hong Xu <[email protected]>
>>> Signed-off-by: Nicolas Ferre <[email protected]>
>> Andrew Victor added his:
>> Acked-by: Andrew Victor <[email protected]>
>>
>>> ---
>>> drivers/video/Kconfig | 4 ++--
>>> drivers/video/atmel_lcdfb.c | 6 ++++--
>>> drivers/video/backlight/Kconfig | 2 +-
>>> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> Please merge it via an ARM tree?

Ok, queued in arm patch tracking system with number: 5614/1
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=5614/1

Thanks, Bye,
--
Nicolas Ferre

2009-09-16 11:59:39

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 4/5] at91/USB: USB drivers modifications for at91sam9g10

Hi,

Here is a little "ping" about integration of this patch.

Nicolas Ferre :
> From: Hong Xu <[email protected]>
>
> Modify both host and gadget USB drivers for at91sam9g10.
> This add a clock management equivalent to at91sam9261 on usb drivers.
> It also add the way of handling gadget pull-ups (like the at91sam9261).

I wonder if we can consider its inclusion as at91sam9g10 is now
integrated in mainline.
Do you want me to split this in several pieces for host/gadget split.

Thanks.

> Signed-off-by: Hong Xu <[email protected]>
> Signed-off-by: Nicolas Ferre <[email protected]>
> ---
> drivers/usb/gadget/at91_udc.c | 6 +++---
> drivers/usb/host/ohci-at91.c | 10 +++++-----
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
> index 0b2bb8f..bfed3d9 100644
> --- a/drivers/usb/gadget/at91_udc.c
> +++ b/drivers/usb/gadget/at91_udc.c
> @@ -892,7 +892,7 @@ static void pullup(struct at91_udc *udc, int is_on)
>
> txvc |= AT91_UDP_TXVC_PUON;
> at91_udp_write(udc, AT91_UDP_TXVC, txvc);
> - } else if (cpu_is_at91sam9261()) {
> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
> u32 usbpucr;
>
> usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
> @@ -910,7 +910,7 @@ static void pullup(struct at91_udc *udc, int is_on)
>
> txvc &= ~AT91_UDP_TXVC_PUON;
> at91_udp_write(udc, AT91_UDP_TXVC, txvc);
> - } else if (cpu_is_at91sam9261()) {
> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
> u32 usbpucr;
>
> usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
> @@ -1692,7 +1692,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
> udc->ep[3].maxpacket = 64;
> udc->ep[4].maxpacket = 512;
> udc->ep[5].maxpacket = 512;
> - } else if (cpu_is_at91sam9261()) {
> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
> udc->ep[3].maxpacket = 64;
> } else if (cpu_is_at91sam9263()) {
> udc->ep[0].maxpacket = 64;
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> index b29b0fe..fb64def 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -35,7 +35,7 @@ extern int usb_disabled(void);
>
> static void at91_start_clock(void)
> {
> - if (cpu_is_at91sam9261())
> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> clk_enable(hclk);
> clk_enable(iclk);
> clk_enable(fclk);
> @@ -46,7 +46,7 @@ static void at91_stop_clock(void)
> {
> clk_disable(fclk);
> clk_disable(iclk);
> - if (cpu_is_at91sam9261())
> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> clk_disable(hclk);
> clocked = 0;
> }
> @@ -142,7 +142,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
>
> iclk = clk_get(&pdev->dev, "ohci_clk");
> fclk = clk_get(&pdev->dev, "uhpck");
> - if (cpu_is_at91sam9261())
> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> hclk = clk_get(&pdev->dev, "hck0");
>
> at91_start_hc(pdev);
> @@ -156,7 +156,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
> /* Error handling */
> at91_stop_hc(pdev);
>
> - if (cpu_is_at91sam9261())
> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> clk_put(hclk);
> clk_put(fclk);
> clk_put(iclk);
> @@ -193,7 +193,7 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd,
> release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
> usb_put_hcd(hcd);
>
> - if (cpu_is_at91sam9261())
> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> clk_put(hclk);
> clk_put(fclk);
> clk_put(iclk);


--
Nicolas Ferre

2009-09-25 10:24:16

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 4/5] at91/USB: USB drivers modifications for at91sam9g10

Greg,

Please, can you consider the inclusion of this patch. I have no news
about it for a long time...

Here is a link to its patchwork entry:
http://patchwork.kernel.org/patch/31173/

Thanks for your help.

Nicolas Ferre :
> Hi,
>
> Here is a little "ping" about integration of this patch.
>
> Nicolas Ferre :
>> From: Hong Xu <[email protected]>
>>
>> Modify both host and gadget USB drivers for at91sam9g10.
>> This add a clock management equivalent to at91sam9261 on usb drivers.
>> It also add the way of handling gadget pull-ups (like the at91sam9261).
>
> I wonder if we can consider its inclusion as at91sam9g10 is now
> integrated in mainline.
> Do you want me to split this in several pieces for host/gadget split.
>
> Thanks.
>
>> Signed-off-by: Hong Xu <[email protected]>
>> Signed-off-by: Nicolas Ferre <[email protected]>
>> ---
>> drivers/usb/gadget/at91_udc.c | 6 +++---
>> drivers/usb/host/ohci-at91.c | 10 +++++-----
>> 2 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
>> index 0b2bb8f..bfed3d9 100644
>> --- a/drivers/usb/gadget/at91_udc.c
>> +++ b/drivers/usb/gadget/at91_udc.c
>> @@ -892,7 +892,7 @@ static void pullup(struct at91_udc *udc, int is_on)
>>
>> txvc |= AT91_UDP_TXVC_PUON;
>> at91_udp_write(udc, AT91_UDP_TXVC, txvc);
>> - } else if (cpu_is_at91sam9261()) {
>> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
>> u32 usbpucr;
>>
>> usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
>> @@ -910,7 +910,7 @@ static void pullup(struct at91_udc *udc, int is_on)
>>
>> txvc &= ~AT91_UDP_TXVC_PUON;
>> at91_udp_write(udc, AT91_UDP_TXVC, txvc);
>> - } else if (cpu_is_at91sam9261()) {
>> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
>> u32 usbpucr;
>>
>> usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
>> @@ -1692,7 +1692,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
>> udc->ep[3].maxpacket = 64;
>> udc->ep[4].maxpacket = 512;
>> udc->ep[5].maxpacket = 512;
>> - } else if (cpu_is_at91sam9261()) {
>> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
>> udc->ep[3].maxpacket = 64;
>> } else if (cpu_is_at91sam9263()) {
>> udc->ep[0].maxpacket = 64;
>> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
>> index b29b0fe..fb64def 100644
>> --- a/drivers/usb/host/ohci-at91.c
>> +++ b/drivers/usb/host/ohci-at91.c
>> @@ -35,7 +35,7 @@ extern int usb_disabled(void);
>>
>> static void at91_start_clock(void)
>> {
>> - if (cpu_is_at91sam9261())
>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>> clk_enable(hclk);
>> clk_enable(iclk);
>> clk_enable(fclk);
>> @@ -46,7 +46,7 @@ static void at91_stop_clock(void)
>> {
>> clk_disable(fclk);
>> clk_disable(iclk);
>> - if (cpu_is_at91sam9261())
>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>> clk_disable(hclk);
>> clocked = 0;
>> }
>> @@ -142,7 +142,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
>>
>> iclk = clk_get(&pdev->dev, "ohci_clk");
>> fclk = clk_get(&pdev->dev, "uhpck");
>> - if (cpu_is_at91sam9261())
>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>> hclk = clk_get(&pdev->dev, "hck0");
>>
>> at91_start_hc(pdev);
>> @@ -156,7 +156,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
>> /* Error handling */
>> at91_stop_hc(pdev);
>>
>> - if (cpu_is_at91sam9261())
>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>> clk_put(hclk);
>> clk_put(fclk);
>> clk_put(iclk);
>> @@ -193,7 +193,7 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd,
>> release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
>> usb_put_hcd(hcd);
>>
>> - if (cpu_is_at91sam9261())
>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>> clk_put(hclk);
>> clk_put(fclk);
>> clk_put(iclk);
>
>


--
Nicolas Ferre

2009-09-25 17:58:13

by David Brownell

[permalink] [raw]
Subject: Re: [PATCH 4/5] at91/USB: USB drivers modifications for at91sam9g10

On Friday 25 September 2009, Nicolas Ferre wrote:
> Greg,
>
> Please, can you consider the inclusion of this patch. I have no news
> about it for a long time...

ISTR either acking this or suggesting it go with the rest
of the G10 patches ... regardless, seems OK to me now that
its precursors have merged.


> Here is a link to its patchwork entry:
> http://patchwork.kernel.org/patch/31173/
>
> Thanks for your help.
>
> Nicolas Ferre :
> > Hi,
> >
> > Here is a little "ping" about integration of this patch.
> >
> > Nicolas Ferre :
> >> From: Hong Xu <[email protected]>
> >>
> >> Modify both host and gadget USB drivers for at91sam9g10.
> >> This add a clock management equivalent to at91sam9261 on usb drivers.
> >> It also add the way of handling gadget pull-ups (like the at91sam9261).
> >
> > I wonder if we can consider its inclusion as at91sam9g10 is now
> > integrated in mainline.
> > Do you want me to split this in several pieces for host/gadget split.
> >
> > Thanks.
> >
> >> Signed-off-by: Hong Xu <[email protected]>
> >> Signed-off-by: Nicolas Ferre <[email protected]>
> >> ---
> >> drivers/usb/gadget/at91_udc.c | 6 +++---
> >> drivers/usb/host/ohci-at91.c | 10 +++++-----
> >> 2 files changed, 8 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
> >> index 0b2bb8f..bfed3d9 100644
> >> --- a/drivers/usb/gadget/at91_udc.c
> >> +++ b/drivers/usb/gadget/at91_udc.c
> >> @@ -892,7 +892,7 @@ static void pullup(struct at91_udc *udc, int is_on)
> >>
> >> txvc |= AT91_UDP_TXVC_PUON;
> >> at91_udp_write(udc, AT91_UDP_TXVC, txvc);
> >> - } else if (cpu_is_at91sam9261()) {
> >> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
> >> u32 usbpucr;
> >>
> >> usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
> >> @@ -910,7 +910,7 @@ static void pullup(struct at91_udc *udc, int is_on)
> >>
> >> txvc &= ~AT91_UDP_TXVC_PUON;
> >> at91_udp_write(udc, AT91_UDP_TXVC, txvc);
> >> - } else if (cpu_is_at91sam9261()) {
> >> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
> >> u32 usbpucr;
> >>
> >> usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
> >> @@ -1692,7 +1692,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
> >> udc->ep[3].maxpacket = 64;
> >> udc->ep[4].maxpacket = 512;
> >> udc->ep[5].maxpacket = 512;
> >> - } else if (cpu_is_at91sam9261()) {
> >> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
> >> udc->ep[3].maxpacket = 64;
> >> } else if (cpu_is_at91sam9263()) {
> >> udc->ep[0].maxpacket = 64;
> >> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> >> index b29b0fe..fb64def 100644
> >> --- a/drivers/usb/host/ohci-at91.c
> >> +++ b/drivers/usb/host/ohci-at91.c
> >> @@ -35,7 +35,7 @@ extern int usb_disabled(void);
> >>
> >> static void at91_start_clock(void)
> >> {
> >> - if (cpu_is_at91sam9261())
> >> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> >> clk_enable(hclk);
> >> clk_enable(iclk);
> >> clk_enable(fclk);
> >> @@ -46,7 +46,7 @@ static void at91_stop_clock(void)
> >> {
> >> clk_disable(fclk);
> >> clk_disable(iclk);
> >> - if (cpu_is_at91sam9261())
> >> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> >> clk_disable(hclk);
> >> clocked = 0;
> >> }
> >> @@ -142,7 +142,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
> >>
> >> iclk = clk_get(&pdev->dev, "ohci_clk");
> >> fclk = clk_get(&pdev->dev, "uhpck");
> >> - if (cpu_is_at91sam9261())
> >> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> >> hclk = clk_get(&pdev->dev, "hck0");
> >>
> >> at91_start_hc(pdev);
> >> @@ -156,7 +156,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
> >> /* Error handling */
> >> at91_stop_hc(pdev);
> >>
> >> - if (cpu_is_at91sam9261())
> >> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> >> clk_put(hclk);
> >> clk_put(fclk);
> >> clk_put(iclk);
> >> @@ -193,7 +193,7 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd,
> >> release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
> >> usb_put_hcd(hcd);
> >>
> >> - if (cpu_is_at91sam9261())
> >> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
> >> clk_put(hclk);
> >> clk_put(fclk);
> >> clk_put(iclk);
> >
> >
>
>
> --
> Nicolas Ferre
>
>

2009-09-29 07:59:58

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 4/5] at91/USB: USB drivers modifications for at91sam9g10

David Brownell :
> On Friday 25 September 2009, Nicolas Ferre wrote:
>> Greg,
>>
>> Please, can you consider the inclusion of this patch. I have no news
>> about it for a long time...
>
> ISTR either acking this or suggesting it go with the rest
> of the G10 patches ... regardless, seems OK to me now that
> its precursors have merged.

Good.

Greg, can you handle this for inclusion in mainline soon ?

Thanks, Bye.

>> Here is a link to its patchwork entry:
>> http://patchwork.kernel.org/patch/31173/
>>
>> Thanks for your help.
>>
>> Nicolas Ferre :
>>> Hi,
>>>
>>> Here is a little "ping" about integration of this patch.
>>>
>>> Nicolas Ferre :
>>>> From: Hong Xu <[email protected]>
>>>>
>>>> Modify both host and gadget USB drivers for at91sam9g10.
>>>> This add a clock management equivalent to at91sam9261 on usb drivers.
>>>> It also add the way of handling gadget pull-ups (like the at91sam9261).
>>> I wonder if we can consider its inclusion as at91sam9g10 is now
>>> integrated in mainline.
>>> Do you want me to split this in several pieces for host/gadget split.
>>>
>>> Thanks.
>>>
>>>> Signed-off-by: Hong Xu <[email protected]>
>>>> Signed-off-by: Nicolas Ferre <[email protected]>
>>>> ---
>>>> drivers/usb/gadget/at91_udc.c | 6 +++---
>>>> drivers/usb/host/ohci-at91.c | 10 +++++-----
>>>> 2 files changed, 8 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
>>>> index 0b2bb8f..bfed3d9 100644
>>>> --- a/drivers/usb/gadget/at91_udc.c
>>>> +++ b/drivers/usb/gadget/at91_udc.c
>>>> @@ -892,7 +892,7 @@ static void pullup(struct at91_udc *udc, int is_on)
>>>>
>>>> txvc |= AT91_UDP_TXVC_PUON;
>>>> at91_udp_write(udc, AT91_UDP_TXVC, txvc);
>>>> - } else if (cpu_is_at91sam9261()) {
>>>> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
>>>> u32 usbpucr;
>>>>
>>>> usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
>>>> @@ -910,7 +910,7 @@ static void pullup(struct at91_udc *udc, int is_on)
>>>>
>>>> txvc &= ~AT91_UDP_TXVC_PUON;
>>>> at91_udp_write(udc, AT91_UDP_TXVC, txvc);
>>>> - } else if (cpu_is_at91sam9261()) {
>>>> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
>>>> u32 usbpucr;
>>>>
>>>> usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR);
>>>> @@ -1692,7 +1692,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
>>>> udc->ep[3].maxpacket = 64;
>>>> udc->ep[4].maxpacket = 512;
>>>> udc->ep[5].maxpacket = 512;
>>>> - } else if (cpu_is_at91sam9261()) {
>>>> + } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
>>>> udc->ep[3].maxpacket = 64;
>>>> } else if (cpu_is_at91sam9263()) {
>>>> udc->ep[0].maxpacket = 64;
>>>> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
>>>> index b29b0fe..fb64def 100644
>>>> --- a/drivers/usb/host/ohci-at91.c
>>>> +++ b/drivers/usb/host/ohci-at91.c
>>>> @@ -35,7 +35,7 @@ extern int usb_disabled(void);
>>>>
>>>> static void at91_start_clock(void)
>>>> {
>>>> - if (cpu_is_at91sam9261())
>>>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>>>> clk_enable(hclk);
>>>> clk_enable(iclk);
>>>> clk_enable(fclk);
>>>> @@ -46,7 +46,7 @@ static void at91_stop_clock(void)
>>>> {
>>>> clk_disable(fclk);
>>>> clk_disable(iclk);
>>>> - if (cpu_is_at91sam9261())
>>>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>>>> clk_disable(hclk);
>>>> clocked = 0;
>>>> }
>>>> @@ -142,7 +142,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
>>>>
>>>> iclk = clk_get(&pdev->dev, "ohci_clk");
>>>> fclk = clk_get(&pdev->dev, "uhpck");
>>>> - if (cpu_is_at91sam9261())
>>>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>>>> hclk = clk_get(&pdev->dev, "hck0");
>>>>
>>>> at91_start_hc(pdev);
>>>> @@ -156,7 +156,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
>>>> /* Error handling */
>>>> at91_stop_hc(pdev);
>>>>
>>>> - if (cpu_is_at91sam9261())
>>>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>>>> clk_put(hclk);
>>>> clk_put(fclk);
>>>> clk_put(iclk);
>>>> @@ -193,7 +193,7 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd,
>>>> release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
>>>> usb_put_hcd(hcd);
>>>>
>>>> - if (cpu_is_at91sam9261())
>>>> + if (cpu_is_at91sam9261() || cpu_is_at91sam9g10())
>>>> clk_put(hclk);
>>>> clk_put(fclk);
>>>> clk_put(iclk);



--
Nicolas Ferre

2009-09-29 17:47:54

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 4/5] at91/USB: USB drivers modifications for at91sam9g10

On Tue, Sep 29, 2009 at 09:59:36AM +0200, Nicolas Ferre wrote:
> David Brownell :
> > On Friday 25 September 2009, Nicolas Ferre wrote:
> >> Greg,
> >>
> >> Please, can you consider the inclusion of this patch. I have no news
> >> about it for a long time...
> >
> > ISTR either acking this or suggesting it go with the rest
> > of the G10 patches ... regardless, seems OK to me now that
> > its precursors have merged.
>
> Good.
>
> Greg, can you handle this for inclusion in mainline soon ?

I'll dig it out and work on this after the x.org conference this week...

thanks,

greg k-h

2009-10-20 13:01:39

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 4/5] at91/USB: USB drivers modifications for at91sam9g10

Greg KH :
> On Tue, Sep 29, 2009 at 09:59:36AM +0200, Nicolas Ferre wrote:
>> David Brownell :
>>> On Friday 25 September 2009, Nicolas Ferre wrote:
>>>> Greg,
>>>>
>>>> Please, can you consider the inclusion of this patch. I have no news
>>>> about it for a long time...
>>> ISTR either acking this or suggesting it go with the rest
>>> of the G10 patches ... regardless, seems OK to me now that
>>> its precursors have merged.
>> Good.
>>
>> Greg, can you handle this for inclusion in mainline soon ?
>
> I'll dig it out and work on this after the x.org conference this week...

Ping ?

Thanks, Bye,
--
Nicolas Ferre

2009-11-03 14:42:27

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [RFC PATCH] atmel_lcdfb Kconfig: remove long dependency line

I come back on this patch as I have a Kconfig cleanup patch series coming.

Russell King - ARM Linux :
> On Tue, Jun 23, 2009 at 04:12:54PM +0200, Nicolas Ferre wrote:
>> Haavard Skinnemoen :
>>> Nicolas Ferre wrote:
>>>> +config ARCH_ATMEL_HAS_FB
>>>> + bool
>>>> + depends on FB
>>>> + default n
>>> What happens when we unconditionally select something which depends on
>>> something else?
>> :-P
>>
>> Experience shows that this configuration is selected.
>>
>> The dependency allows to have a good hierarchy in the configuration tree...
>> Better proposition welcome.
>
> 1st - no need for 'default n' - you're specifying something that's already
> the default.

Ok.

> 2nd - don't make this symbol depend on anything, and don't use the symbol
> for anything except providing a dependency for FB_ATMEL. Instead, let
> FB_ATMEL deal with the dependency on FB and ARCH_ATMEL_HAS_FB.

The problem is that if I do not setup the dependency here the menu entry
will not be available at the proper level. In fact I will see the Atmel
LCD entry here:
"Graphics support"
<*> Support for frame buffer devices --->
<*> AT91/AT32 LCD Controller support

instead of here:
"Graphics support"
---> "Support for frame buffer devices"
[..]
<*> "AT91/AT32 LCD Controller support"
[..]

So I keep the depend.

> 3rd - ISTR we have a convention for these - 'HAVE_foo' for a configuration
> option named 'foo'. So it should probably be HAVE_FB_ATMEL.

Ok, changed to HAVE_FB_ATMEL indeed.

Thanks. Best regards,
--
Nicolas Ferre

2009-11-03 21:05:57

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [RFC PATCH] atmel_lcdfb Kconfig: remove long dependency line

On Tue, Nov 03, 2009 at 03:42:16PM +0100, Nicolas Ferre wrote:
> The problem is that if I do not setup the dependency here the menu entry
> will not be available at the proper level. In fact I will see the Atmel
> LCD entry here:
> "Graphics support"
> <*> Support for frame buffer devices --->
> <*> AT91/AT32 LCD Controller support
>
> instead of here:
> "Graphics support"
> ---> "Support for frame buffer devices"
> [..]
> <*> "AT91/AT32 LCD Controller support"
> [..]
>
> So I keep the depend.

The depend is on ARCH_ATMEL_HAS_FB which has no description (and therefore
does not appear in the menus) not the symbol for "AT91/AT32 LCD Controller
support".

2009-11-13 15:27:56

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [RFC PATCH] atmel_lcdfb Kconfig: remove long dependency line

Russell King - ARM Linux :
> On Tue, Nov 03, 2009 at 03:42:16PM +0100, Nicolas Ferre wrote:
>> The problem is that if I do not setup the dependency here the menu entry
>> will not be available at the proper level. In fact I will see the Atmel
>> LCD entry here:
>> "Graphics support"
>> <*> Support for frame buffer devices --->
>> <*> AT91/AT32 LCD Controller support
>>
>> instead of here:
>> "Graphics support"
>> ---> "Support for frame buffer devices"
>> [..]
>> <*> "AT91/AT32 LCD Controller support"
>> [..]
>>
>> So I keep the depend.
>
> The depend is on ARCH_ATMEL_HAS_FB which has no description (and therefore
> does not appear in the menus) not the symbol for "AT91/AT32 LCD Controller
> support".

The issue with the menu was that the additional variable was in the middle
of the list of frame buffer devices.

Here is a snippet of the solution I propose without the not needed depend.
I cook a v2 patch just now.

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 9bbb285..6d3f291 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -5,6 +5,9 @@
menu "Graphics support"
depends on HAS_IOMEM

+config HAVE_FB_ATMEL
+ bool
+
source "drivers/char/agp/Kconfig"

source "drivers/gpu/vga/Kconfig"
@@ -937,7 +940,7 @@ config FB_S1D13XXX

config FB_ATMEL
tristate "AT91/AT32 LCD Controller support"
- depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT9
+ depends on FB && HAVE_FB_ATMEL
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT

Best regards,
--
Nicolas Ferre