AT91: more DT soc and boards support
Subsystems (4)
cover AT91: more DT soc and boards support
HI,
In this patch series you will found the support for
- at91sam9260 (nearly the same as 9g20)
- at91sam9263
and boards
- at91sam9g20ek (1 mmc and 2mmc version)
- at91sam9263ek
- Calao USB A9260
- Calao TNY A9260 & A9G20
The following changes since commit 0b51efa18140c8a134e64a987417ff02d30f7363:
gpio: drop CONFIG_OF_GPIO in the definition of the struct gpio_chip (2012-04-10 21:37:22 +0800)
are available in the git repository at:
git at github.com:at91linux/linux-at91.git j/for-3.5
for you to fetch changes up to c8a6a45dd44db2526caeda45606e6c47621878d2:
ARM: at91: add at91sam9263ek DT support (2012-04-11 23:43:06 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (9):
ARM: at91: add at91sam9260 DT support
arm: at91: add Calao TNY-A9260 and TNY-A9G20 board support
ARM: at91: add at91sam9g20ek boards dt support
ARM: at91: USB A926x update nand partition
ARM: at91: Calao USB A926x factorize common binding in usb_a9260_common
ARM: at91: DT: add Calao USB A9260 DT support
ARM: at91: standard device init only if DT is not populated.
ARM: at91: add at91sam9263 DT support
ARM: at91: add at91sam9263ek DT support
arch/arm/boot/dts/at91sam9260.dtsi | 239 +++++++++++++++++++++++++++ arch/arm/boot/dts/at91sam9263.dtsi | 221 +++++++++++++++++++++++++ arch/arm/boot/dts/at91sam9263ek.dts | 156 +++++++++++++++++ arch/arm/boot/dts/at91sam9g20.dtsi | 227 +------------------------- arch/arm/boot/dts/at91sam9g20ek.dts | 29 ++++ arch/arm/boot/dts/at91sam9g20ek_2mmc.dts | 29 ++++ arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 142 ++++++++++++++++ arch/arm/boot/dts/tny_a9260.dts | 15 ++ arch/arm/boot/dts/tny_a9260_common.dtsi | 83 +++++++++ arch/arm/boot/dts/tny_a9g20.dts | 15 ++ arch/arm/boot/dts/usb_a9260.dts | 23 +++ arch/arm/boot/dts/usb_a9260_common.dtsi | 117 +++++++++++++ arch/arm/boot/dts/usb_a9g20.dts | 102 +----------- arch/arm/mach-at91/Makefile.boot | 8 + arch/arm/mach-at91/at91sam9260_devices.c | 20 +-- arch/arm/mach-at91/at91sam9263.c | 10 + arch/arm/mach-at91/at91sam9263_devices.c | 20 +++ arch/arm/mach-at91/at91sam9g45_devices.c | 30 +--- arch/arm/mach-at91/board-usb-a926x.c | 4 + 19 files changed, 1122 insertions(+), 368 deletions(-) create mode 100644 arch/arm/boot/dts/at91sam9260.dtsi create mode 100644 arch/arm/boot/dts/at91sam9263.dtsi create mode 100644 arch/arm/boot/dts/at91sam9263ek.dts create mode 100644 arch/arm/boot/dts/at91sam9g20ek.dts create mode 100644 arch/arm/boot/dts/at91sam9g20ek_2mmc.dts create mode 100644 arch/arm/boot/dts/at91sam9g20ek_common.dtsi create mode 100644 arch/arm/boot/dts/tny_a9260.dts create mode 100644 arch/arm/boot/dts/tny_a9260_common.dtsi create mode 100644 arch/arm/boot/dts/tny_a9g20.dts create mode 100644 arch/arm/boot/dts/usb_a9260.dts create mode 100644 arch/arm/boot/dts/usb_a9260_common.dtsi
Best Regards,
J.
PATCH 1/9 ARM: at91: add at91sam9260 DT support
The at91sam9260 and at91sam9g20 share most of the same IP. So udpate the node property in the at91sam9g20 only.
---
.../dts/{at91sam9g20.dtsi => at91sam9260.dtsi} | 8 +-
arch/arm/boot/dts/at91sam9g20.dtsi | 257 ++------------------
arch/arm/mach-at91/Makefile.boot | 1 +
3 files changed, 23 insertions(+), 243 deletions(-)
rename arch/arm/boot/dts/{at91sam9g20.dtsi => at91sam9260.dtsi} (96%) rewrite arch/arm/boot/dts/at91sam9g20.dtsi (95%)
arch/arm/boot/dts/at91sam9260.dtsi renamed from arch/arm/boot/dts/at91sam9g20.dtsi +4 -4
@@ -1,5 +1,5 @@ /* - * at91sam9g20.dtsi - Device Tree Include file for AT91SAM9G20 family SoC + * at91sam9260.dtsi - Device Tree Include file for AT91SAM9260 family SoC * * Copyright (C) 2011 Atmel, * 2011 Nicolas Ferre <[email protected]>,
@@ -11,8 +11,8 @@ /include/ "skeleton.dtsi" / { - model = "Atmel AT91SAM9G20 family SoC"; - compatible = "atmel,at91sam9g20"; + model = "Atmel AT91SAM9260 family SoC"; + compatible = "atmel,at91sam9260"; interrupt-parent = <&aic>; aliases {
@@ -36,7 +36,7 @@ }; memory { - reg = <0x20000000 0x08000000>; + reg = <0x20000000 0x04000000>; }; ahb {
arch/arm/boot/dts/at91sam9g20.dtsi +18 -239
257 lines not on this page · raw message
arch/arm/mach-at91/Makefile.boot +1 -0
@@ -14,6 +14,7 @@ initrd_phys-y := 0x20410000 endif # Keep dtb files sorted alphabetically for each SoC +# sam9260 # sam9g20 dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb # sam9g45
Signature · 1 line
1.7.9.1
PATCH 2/9 arm: at91: add Calao TNY-A9260 and TNY-A9G20 board support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boot/dts/tny_a9260.dts | 15 ++++++ arch/arm/boot/dts/tny_a9260_common.dtsi | 83 +++++++++++++++++++++++++++++++ arch/arm/boot/dts/tny_a9g20.dts | 15 ++++++ arch/arm/mach-at91/Makefile.boot | 2 + 4 files changed, 115 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/tny_a9260.dts create mode 100644 arch/arm/boot/dts/tny_a9260_common.dtsi create mode 100644 arch/arm/boot/dts/tny_a9g20.dts
arch/arm/boot/dts/tny_a9260.dts new file +15 -0
@@ -0,0 +1,15 @@ +/* + * tny_a9260.dts - Device Tree file for Caloa TNY A9260 board + * + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> + * + * Licensed under GPLv2. + */ +/dts-v1/; +/include/ "at91sam9260.dtsi" +/include/ "tny_a9260_common.dtsi" + +/ { + model = "Calao TNY A9260"; + compatible = "calao,tny-a9260", "atmel,at91sam9260", "atmel,at91sam9"; +};
arch/arm/boot/dts/tny_a9260_common.dtsi new file +83 -0
83 lines not on this page · raw message
arch/arm/boot/dts/tny_a9g20.dts new file +15 -0
@@ -0,0 +1,15 @@ +/* + * tny_a9g20.dts - Device Tree file for Caloa TNY A9G20 board + * + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> + * + * Licensed under GPLv2. + */ +/dts-v1/; +/include/ "at91sam9g20.dtsi" +/include/ "tny_a9260_common.dtsi" + +/ { + model = "Calao TNY A9G20"; + compatible = "calao,tny-a9g20", "atmel,at91sam9g20", "atmel,at91sam9"; +};
arch/arm/mach-at91/Makefile.boot +2 -0
@@ -15,7 +15,9 @@ endif # Keep dtb files sorted alphabetically for each SoC # sam9260 +dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9260.dtb # sam9g20 +dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9g20.dtb dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb # sam9g45 dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb
Signature · 1 line
1.7.9.1
PATCH 3/9 ARM: at91: add at91sam9g20ek boards dt support
In reply to Jean-Christophe PLAGNIOL-VILLARDAdd both board revision support 1mmc and 2mmc and use a dtsi for common part.
--- arch/arm/boot/dts/at91sam9g20ek.dts | 29 ++++++ arch/arm/boot/dts/at91sam9g20ek_2mmc.dts | 29 ++++++ arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 142 +++++++++++++++++++++++++++ arch/arm/mach-at91/Makefile.boot | 2 + 4 files changed, 202 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/at91sam9g20ek.dts create mode 100644 arch/arm/boot/dts/at91sam9g20ek_2mmc.dts create mode 100644 arch/arm/boot/dts/at91sam9g20ek_common.dtsi
arch/arm/boot/dts/at91sam9g20ek.dts new file +29 -0
@@ -0,0 +1,29 @@ +/* + * at91sam9g20ek.dts - Device Tree file for Atmel at91sam9g20ek board + * + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> + * + * Licensed under GPLv2. + */ +/dts-v1/; +/include/ "at91sam9g20ek_common.dtsi" + +/ { + model = "Atmel at91sam9g20ek"; + compatible = "atmel,at91sam9g20ek", "atmel,at91sam9g20", "atmel,at91sam9"; + + leds { + compatible = "gpio-leds"; + + ds1 { + label = "ds1"; + gpios = <&pioA 9 0>; + linux,default-trigger = "heartbeat"; + }; + + ds5 { + label = "ds5"; + gpios = <&pioA 6 1>; + }; + }; +};
arch/arm/boot/dts/at91sam9g20ek_2mmc.dts new file +29 -0
@@ -0,0 +1,29 @@ +/* + * at91sam9g20ek_2mmc.dts - Device Tree file for Atmel at91sam9g20ek 2 MMC board + * + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> + * + * Licensed under GPLv2. + */ +/dts-v1/; +/include/ "at91sam9g20ek_common.dtsi" + +/ { + model = "Atmel at91sam9g20ek 2 mmc"; + compatible = "atmel,at91sam9g20ek_2mmc", "atmel,at91sam9g20", "atmel,at91sam9"; + + leds { + compatible = "gpio-leds"; + + ds1 { + label = "ds1"; + gpios = <&pioB 9 0>; + linux,default-trigger = "heartbeat"; + }; + + ds5 { + label = "ds5"; + gpios = <&pioB 8 1>; + }; + }; +};
arch/arm/boot/dts/at91sam9g20ek_common.dtsi new file +142 -0
142 lines not on this page · raw message
arch/arm/mach-at91/Makefile.boot +2 -0
@@ -17,6 +17,8 @@ endif # sam9260 dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9260.dtb # sam9g20 +dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g20ek.dtb +dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g20ek_2mmc.dtb dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9g20.dtb dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb # sam9g45
Signature · 1 line
1.7.9.1
PATCH 3/9 ARM: at91: add at91sam9g20ek boards dt support
+ omap ml
Hi Jean, Andrew, Nicolas,
Quoted 20 lines · Jean-Christophe PLAGNIOL-VILLARD
arch/arm/boot/dts/at91sam9g20ek_common.dtsi new file +20
-0+ ahb { + apb { + dbgu: serial at fffff200 { + status = "okay"; + }; + + usart0: serial at fffb0000 { + status = "okay"; + }; + + usart1: serial at fffb4000 { + status = "okay"; + }; + + macb0: ethernet at fffc4000 { + phy-mode = "rmii"; + status = "okay"; + }; + + usb1: gadget at fffa4000 {
arch/arm/boot/dts/at91sam9g20ek_common.dtsi line 60
Quoted 10 lines
arch/arm/boot/dts/at91sam9g20ek_common.dtsi new file +10
-0+ atmel,vbus-gpio = <&pioC 5 0>; + status = "okay"; + }; + }; + + nand0: nand at 40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "soft"; + nand-on-flash-bbt; + status = "okay";
I have a few queries about handling static memory controller (SMC) of ATMEL
1. How is SMC configured when DT is used ?
2. With "d6a0166 atmel/nand: add DT support", ek_add_device_nand() is no more present (which was earlier configuring SMC), so is SMC configuration handled by Kernel on DT boot or is it done by bootloader when DT ?
3. How ek_add_device_dm9000() is going to be achieved with DT ?
4. Is there any plan to create a driver out of SMC code & use DT with it ?
Reason for bringing these queries is that TI OMAP chips have GPMC [1], SMC in ATMEL seems somewhat similar and currently GPMC is configured in platform code, & we are creating a driver out of that code [2]. There are different views on where GPMC driver should go, mfd, misc folders etc, but could not yet get concrete suggestions even with a loud cry.
If ATMEL is also going driver way, then probably our voice together may be heard and hopefully it will expedite the matter.
Regards
Afzal
[1]
GPMC (General Purpose Memory Controller) in brief:
GPMC is an unified memory controller dedicated to interfacing external memory devices like
Asynchronous SRAM like memories and application specific integrated circuit devices. Asynchronous, synchronous, and page mode burst NOR flash devices NAND flash Pseudo-SRAM devices
GPMC has to be configured as required by timings of the connected peripheral. It needs to be configured only initially. Once it is configured it can be used to handle different protocols like NAND, NOR. Various kinds of devices like ethernet, uart, usb, fpga etc can work using GPMC interface. GPMC has a seperate additional functionality of NAND handling
PATCH 3/9 ARM: at91: add at91sam9g20ek boards dt support
Quoted 45 lines · Afzal
+ omap ml
Hi Jean, Andrew, Nicolas,
Quoted 20 lines · Jean-Christophe PLAGNIOL-VILLARD
arch/arm/boot/dts/at91sam9g20ek_common.dtsi new file +20
-0+ ahb { + apb { + dbgu: serial at fffff200 { + status = "okay"; + }; + + usart0: serial at fffb0000 { + status = "okay"; + }; + + usart1: serial at fffb4000 { + status = "okay"; + }; + + macb0: ethernet at fffc4000 { + phy-mode = "rmii"; + status = "okay"; + }; + + usb1: gadget at fffa4000 {arch/arm/boot/dts/at91sam9g20ek_common.dtsi line 60
Quoted 10 lines
arch/arm/boot/dts/at91sam9g20ek_common.dtsi new file +10
-0+ atmel,vbus-gpio = <&pioC 5 0>; + status = "okay"; + }; + }; + + nand0: nand at 40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "soft"; + nand-on-flash-bbt; + status = "okay";I have a few queries about handling static memory controller (SMC) of ATMEL
1. How is SMC configured when DT is used ?
2. With "d6a0166 atmel/nand: add DT support",ek_add_device_nand()is no more present (which was earlier configuring SMC), so is SMC configuration handled by Kernel on DT boot or is it done by bootloader when DT ?
3. Howek_add_device_dm9000()is going to be achieved with DT ?
4. Is there any plan to create a driver out of SMC code & use DT with it ?
Quoted 5 lines
Reason for bringing these queries is that TI OMAP chips have GPMC [1], SMC in ATMEL seems somewhat similar and currently GPMC is configured in platform code, & we are creating a driver out of that code [2]. There are different views on where GPMC driver should go, mfd, misc folders etc, but could not yet get concrete suggestions even with a loud cry.
put me in ccc I'll take a look
Quoted 3 lines
If ATMEL is also going driver way, then probably our voice together may be heard and hopefully it will expedite the matter.
I'm going to add it too my idea was to create something similiar as the pintrl
you register the ddifferent bank supported buy the SoC and then the driver request the bank for the dev_name
at soc level you will set the default timings and then the drvier may manipulate them
I already update the API of sam9_smc to abstract the access to the register.
I expect the code for the request to be generic but handling of the timing IP specific
Evenif the GPMC is smiliar as the SMC I do not expect a generic API to manage it easly (for the timings).
Best Regrds,
J
PATCH 3/9 ARM: at91: add at91sam9g20ek boards dt support
Hi Jean,
Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines
If ATMEL is also going driver way, then probably our voice together may be heard and hopefully it will expedite the matter.
I'm going to add it too my idea was to create something similiar as the pintrl
you register the ddifferent bank supported buy the SoC and then the driver request the bank for thedev_nameat soc level you will set the default timings and then the drvier may manipulate them
I already update the API of
sam9_smcto abstract the access to the register.
Is SMC code being converted to driver ?
Regards
Afzal
PATCH 3/9 ARM: at91: add at91sam9g20ek boards dt support
Quoted 10 lines · Afzal
Hi Jean,
Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines
If ATMEL is also going driver way, then probably our voice together may be heard and hopefully it will expedite the matter.
I'm going to add it too my idea was to create something similiar as the pintrl
you register the ddifferent bank supported buy the SoC and then the driver request the bank for thedev_name
Quoted 6 lines
Quoted 4 lines
at soc level you will set the default timings and then the drvier may manipulate them
I already update the API of
sam9_smcto abstract the access to the register.Is SMC code being converted to driver ?
no I'm busy on pinctrl I just cereate an abstracted API
Best Regards,
J.
PATCH 4/9 ARM: at91: USB A926x update nand partition
In reply to Jean-Christophe PLAGNIOL-VILLARDWe now store the dtb in a nand partition.
--- arch/arm/boot/dts/usb_a9g20.dts | 11 ++++++++--- arch/arm/mach-at91/board-usb-a926x.c | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-)
arch/arm/boot/dts/usb_a9g20.dts +8 -3
@@ -74,19 +74,24 @@ reg = <0x80000 0x20000>; }; + oftree at 80000 { + label = "oftree"; + reg = <0xa0000 0x20000>; + }; + kernel at a0000 { label = "kernel"; - reg = <0xa0000 0x400000>; + reg = <0xc0000 0x400000>; }; rootfs at 4a0000 { label = "rootfs"; - reg = <0x4a0000 0x7800000>; + reg = <0x4c0000 0x7800000>; }; data at 7ca0000 { label = "data"; - reg = <0x7ca0000 0x8360000>; + reg = <0x7cc0000 0x8340000>; }; };
arch/arm/mach-at91/board-usb-a926x.c +4 -0
@@ -172,6 +172,10 @@ static struct mtd_partition __initdata ek_nand_partition[] = { .offset = MTDPART_OFS_NXTBLK, .size = SZ_128K, }, { + .name = "oftree", + .offset = MTDPART_OFS_NXTBLK, + .size = SZ_128K, + }, { .name = "kernel", .offset = MTDPART_OFS_NXTBLK, .size = 4 * SZ_1M,
Signature · 1 line
1.7.9.1
PATCH 5/9 ARM: at91: Calao USB A926x factorize common binding in usb_a9260_common
In reply to Jean-Christophe PLAGNIOL-VILLARDThis will simplify the adding of the A9260.
---
.../dts/{usb_a9g20.dts => usb_a9260_common.dtsi} | 22 +---
arch/arm/boot/dts/usb_a9g20.dts | 165 ++++----------------
2 files changed, 32 insertions(+), 155 deletions(-)
rename arch/arm/boot/dts/{usb_a9g20.dts => usb_a9260_common.dtsi} (77%) rewrite arch/arm/boot/dts/usb_a9g20.dts (74%)
arch/arm/boot/dts/usb_a9260_common.dtsi renamed from arch/arm/boot/dts/usb_a9g20.dts +2 -20
@@ -1,25 +1,12 @@ /* - * usb_a9g20.dts - Device Tree file for Caloa USB A9G20 board + * usb_a926x.dts - Device Tree file for Caloa USB A926x board * - * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> + * Copyright (C) 2011-2012 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> * * Licensed under GPLv2 or later. */ -/dts-v1/; -/include/ "at91sam9g20.dtsi" / { - model = "Calao USB A9G20"; - compatible = "calao,usb-a9g20", "atmel,at91sam9g20", "atmel,at91sam9"; - - chosen { - bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs"; - }; - - memory { - reg = <0x20000000 0x4000000>; - }; - clocks { #address-cells = <1>; #size-cells = <1>;
@@ -126,10 +113,5 @@ i2c at 0 { status = "okay"; - - rv3029c2 at 56 { - compatible = "rv3029c2"; - reg = <0x56>; - }; }; };
arch/arm/boot/dts/usb_a9g20.dts +30 -135
165 lines not on this page · raw message
Signature · 1 line
1.7.9.1
PATCH 6/9 ARM: at91: DT: add Calao USB A9260 DT support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boot/dts/usb_a9260.dts | 23 +++++++++++++++++++++++ arch/arm/mach-at91/Makefile.boot | 1 + 2 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/usb_a9260.dts
arch/arm/boot/dts/usb_a9260.dts new file +23 -0
@@ -0,0 +1,23 @@ +/* + * usb_a9260.dts - Device Tree file for Caloa USB A9260 board + * + * Copyright (C) 2011-2012 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +/include/ "at91sam9260.dtsi" +/include/ "usb_a9260_common.dtsi" + +/ { + model = "Calao USB A9260"; + compatible = "calao,usb-a9260", "atmel,at91sam9260", "atmel,at91sam9"; + + chosen { + bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; +};
arch/arm/mach-at91/Makefile.boot +1 -0
@@ -16,6 +16,7 @@ endif # Keep dtb files sorted alphabetically for each SoC # sam9260 dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9260.dtb +dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9260.dtb # sam9g20 dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g20ek.dtb dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g20ek_2mmc.dtb
Signature · 1 line
1.7.9.1
PATCH 7/9 ARM: at91: standard device init only if DT is not populated.
In reply to Jean-Christophe PLAGNIOL-VILLARDThis will avoid the CONFIG_OF on the *_devices.c as this file is deprecated for DT support.
--- arch/arm/mach-at91/at91sam9260_devices.c | 20 +++----------------- arch/arm/mach-at91/at91sam9g45_devices.c | 30 ++++-------------------------- 2 files changed, 7 insertions(+), 43 deletions(-)
arch/arm/mach-at91/at91sam9260_devices.c +3 -17
@@ -702,25 +702,8 @@ static struct platform_device at91sam9260_tcb1_device = { .num_resources = ARRAY_SIZE(tcb1_resources), }; -#if defined(CONFIG_OF ) -static struct of_device_id tcb_ids[] = { - { .compatible ="atmel,at91rm9200-tcb" }, - {/*sentinel*/ } -}; -#endif -static void __init at91_add_device_tc (void ) { -#if defined(CONFIG_OF ) -struct device_node *np; - - np =of_find_matching_node (NULL , tcb_ids); -if (np) { -of_node_put (np); -return ; - } -#endif -platform_device_register (&at91sam9260_tcb0_device);platform_device_register (&at91sam9260_tcb1_device); }
@@ -1364,6 +1347,9 @@ void __init at91_add_device_cf(struct at91_cf_data * data) {}*/ static int __init at91_add_standard_devices (void ) { +if (of_have_populated_dt ()) +return 0 ; +at91_add_device_rtt ();at91_add_device_watchdog ();at91_add_device_tc ();
arch/arm/mach-at91/at91sam9g45_devices.c +4 -26
@@ -69,15 +69,7 @@ static struct platform_device at_hdmac_device = {void __init at91_add_device_hdmac (void ) { -#if defined(CONFIG_OF ) -struct device_node *of_node = -of_find_node_by_name (NULL ,"dma-controller" ); - -if (of_node) -of_node_put (of_node); - else -#endif -platform_device_register (&at_hdmac_device); +platform_device_register (&at_hdmac_device); }#else void __init at91_add_device_hdmac (void ) {}
@@ -1094,25 +1086,8 @@ static struct platform_device at91sam9g45_tcb1_device = { .num_resources = ARRAY_SIZE(tcb1_resources), }; -#if defined(CONFIG_OF ) -static struct of_device_id tcb_ids[] = { - { .compatible ="atmel,at91rm9200-tcb" }, - {/*sentinel*/ } -}; -#endif -static void __init at91_add_device_tc (void ) { -#if defined(CONFIG_OF ) -struct device_node *np; - - np =of_find_matching_node (NULL , tcb_ids); -if (np) { -of_node_put (np); -return ; - } -#endif -platform_device_register (&at91sam9g45_tcb0_device);platform_device_register (&at91sam9g45_tcb1_device); }
@@ -1763,6 +1738,9 @@ void __init at91_add_device_serial(void) {}*/ static int __init at91_add_standard_devices (void ) { +if (of_have_populated_dt ()) +return 0 ; +at91_add_device_hdmac ();at91_add_device_rtc ();at91_add_device_rtt ();
Signature · 1 line
1.7.9.1
PATCH 8/9 ARM: at91: add at91sam9263 DT support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boot/dts/at91sam9263.dtsi | 221 ++++++++++++++++++++++++++++++ arch/arm/mach-at91/at91sam9263.c | 10 ++ arch/arm/mach-at91/at91sam9263_devices.c | 20 +++ 3 files changed, 251 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/at91sam9263.dtsi
arch/arm/boot/dts/at91sam9263.dtsi new file +221 -0
@@ -0,0 +1,221 @@ +/* + * at91sam9263.dtsi - Device Tree Include file for AT91SAM9263 family SoC + * + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> + * + * Licensed under GPLv2 only. + */ + +/include/ "skeleton.dtsi" + +/ { + model = "Atmel AT91SAM9263 family SoC"; + compatible = "atmel,at91sam9263"; + interrupt-parent = <&aic>; + + aliases { + serial0 = &dbgu; + serial1 = &usart0; + serial2 = &usart1; + serial3 = &usart2; + gpio0 = &pioA; + gpio1 = &pioB; + gpio2 = &pioC; + gpio3 = &pioD; + gpio4 = &pioE; + tcb0 = &tcb0; + }; + cpus { + cpu at 0 { + compatible = "arm,arm926ejs"; + }; + }; + + memory { + reg = <0x20000000 0x08000000>; + }; + + ahb { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + apb { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + aic: interrupt-controller at fffff000 { + #interrupt-cells = <2>; + compatible = "atmel,at91rm9200-aic"; + interrupt-controller; + interrupt-parent; + reg = <0xfffff000 0x200>; + }; + + pmc: pmc at fffffc00 { + compatible = "atmel,at91rm9200-pmc"; + reg = <0xfffffc00 0x100>; + }; + + ramc: ramc at ffffe200 { + compatible = "atmel,at91sam9260-sdramc"; + reg = <0xffffe200 0x200 + 0xffffe800 0x200>; + }; + + pit: timer at fffffd30 { + compatible = "atmel,at91sam9260-pit"; + reg = <0xfffffd30 0xf>; + interrupts = <1 4>; + }; + + tcb0: timer at fff7c000 { + compatible = "atmel,at91rm9200-tcb"; + reg = <0xfff7c000 0x100>; + interrupts = <19 4>; + }; + + rstc at fffffd00 { + compatible = "atmel,at91sam9260-rstc"; + reg = <0xfffffd00 0x10>; + }; + + shdwc at fffffd10 { + compatible = "atmel,at91sam9260-shdwc"; + reg = <0xfffffd10 0x10>; + }; + + pioA: gpio at fffff200 { + compatible = "atmel,at91rm9200-gpio"; + reg = <0xfffff200 0x100>; + interrupts = <2 4>; + #gpio-cells = <2>; + gpio-controller; + interrupt-controller; + }; + + pioB: gpio at fffff400 { + compatible = "atmel,at91rm9200-gpio"; + reg = <0xfffff400 0x100>; + interrupts = <3 4>; + #gpio-cells = <2>; + gpio-controller; + interrupt-controller; + }; + + pioC: gpio at fffff600 { + compatible = "atmel,at91rm9200-gpio"; + reg = <0xfffff600 0x100>; + interrupts = <4 4>; + #gpio-cells = <2>; + gpio-controller; + interrupt-controller; + }; + + pioD: gpio at fffff800 { + compatible = "atmel,at91rm9200-gpio"; + reg = <0xfffff800 0x100>; + interrupts = <4 4>; + #gpio-cells = <2>; + gpio-controller; + interrupt-controller; + }; + + pioE: gpio at fffffa00 { + compatible = "atmel,at91rm9200-gpio"; + reg = <0xfffffa00 0x100>; + interrupts = <4 4>; + #gpio-cells = <2>; + gpio-controller; + interrupt-controller; + }; + + dbgu: serial at ffffee00 { + compatible = "atmel,at91sam9260-usart"; + reg = <0xffffee00 0x200>; + interrupts = <1 4>; + status = "disabled"; + }; + + usart0: serial at fff8c000 { + compatible = "atmel,at91sam9260-usart"; + reg = <0xfff8c000 0x200>; + interrupts = <7 4>; + atmel,use-dma-rx; + atmel,use-dma-tx; + status = "disabled"; + }; + + usart1: serial at fff90000 { + compatible = "atmel,at91sam9260-usart"; + reg = <0xfff90000 0x200>; + interrupts = <8 4>; + atmel,use-dma-rx; + atmel,use-dma-tx; + status = "disabled"; + }; + + usart2: serial at fff94000 { + compatible = "atmel,at91sam9260-usart"; + reg = <0xfff94000 0x200>; + interrupts = <9 4>; + atmel,use-dma-rx; + atmel,use-dma-tx; + status = "disabled"; + }; + + macb0: ethernet at fffbc000 { + compatible = "cdns,at32ap7000-macb", "cdns,macb"; + reg = <0xfffbc000 0x100>; + interrupts = <21 4>; + status = "disabled"; + }; + + usb1: gadget at fff78000 { + compatible = "atmel,at91rm9200-udc"; + reg = <0xfff78000 0x4000>; + interrupts = <24 4>; + status = "disabled"; + }; + }; + + nand0: nand at 40000000 { + compatible = "atmel,at91rm9200-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x40000000 0x10000000 + 0xffffe000 0x200 + >; + atmel,nand-addr-offset = <21>; + atmel,nand-cmd-offset = <22>; + gpios = <&pioA 22 0 + &pioD 15 0 + 0 + >; + status = "disabled"; + }; + + usb0: ohci at 00a00000 { + compatible = "atmel,at91rm9200-ohci", "usb-ohci"; + reg = <0x00a00000 0x100000>; + interrupts = <29 4>; + status = "disabled"; + }; + }; + + i2c at 0 { + compatible = "i2c-gpio"; + gpios = <&pioB 4 0 /* sda */ + &pioB 5 0 /* scl */ + >; + i2c-gpio,sda-open-drain; + i2c-gpio,scl-open-drain; + i2c-gpio,delay-us = <2>; /* ~100 kHz */ + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; +};
arch/arm/mach-at91/at91sam9263.c +10 -0
@@ -199,6 +199,16 @@ static struct clk_lookup periph_clocks_lookups[] = {CLKDEV_CON_ID ("pioC" , &pioCDE_clk),CLKDEV_CON_ID ("pioD" , &pioCDE_clk),CLKDEV_CON_ID ("pioE" , &pioCDE_clk), +/* more usart lookup table for DT entries */ +CLKDEV_CON_DEV_ID ("usart" ,"ffffee00.serial" , &mck), +CLKDEV_CON_DEV_ID ("usart" ,"fff8c000.serial" , &usart0_clk), +CLKDEV_CON_DEV_ID ("usart" ,"fff90000.serial" , &usart1_clk), +CLKDEV_CON_DEV_ID ("usart" ,"fff94000.serial" , &usart2_clk), +/* more tc lookup table for DT entries */ +CLKDEV_CON_DEV_ID ("t0_clk" ,"fff7c000.timer" , &tcb_clk), +CLKDEV_CON_DEV_ID ("hclk" ,"a00000.ohci" , &ohci_clk), +CLKDEV_CON_DEV_ID ("spi_clk" ,"fffa4000.spi" , &spi0_clk), + CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk), }; static struct clk_lookup usart_clocks_lookups[] = {
arch/arm/mach-at91/at91sam9263_devices.c +20 -0
@@ -953,8 +953,25 @@ static struct platform_device at91sam9263_tcb_device = { .num_resources = ARRAY_SIZE(tcb_resources), }; +#if defined(CONFIG_OF ) +static struct of_device_id tcb_ids[] = { + { .compatible ="atmel,at91rm9200-tcb" }, + {/*sentinel*/ } +}; +#endif +static void __init at91_add_device_tc (void ) { +#if defined(CONFIG_OF ) +struct device_node *np; + + np =of_find_matching_node (NULL , tcb_ids); +if (np) { +of_node_put (np); +return ; + } +#endif +platform_device_register (&at91sam9263_tcb_device); }#else
@@ -1483,6 +1500,9 @@ void __init at91_add_device_serial(void) {}*/ static int __init at91_add_standard_devices (void ) { +if (of_have_populated_dt ()) +return 0 ; +at91_add_device_rtt ();at91_add_device_watchdog ();at91_add_device_tc ();
Signature · 1 line
1.7.9.1
PATCH 9/9 ARM: at91: add at91sam9263ek DT support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/boot/dts/at91sam9263ek.dts | 156 +++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/Makefile.boot | 2 + 2 files changed, 158 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/at91sam9263ek.dts
arch/arm/boot/dts/at91sam9263ek.dts new file +156 -0
@@ -0,0 +1,156 @@ +/* + * at91sam9263ek.dts - Device Tree file for Atmel at91sam9263 reference board + * + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> + * + * Licensed under GPLv2 only + */ +/dts-v1/; +/include/ "at91sam9263.dtsi" + +/ { + model = "Atmel at91sam9263ek"; + compatible = "atmel,at91sam9263ek", "atmel,at91sam9263", "atmel,at91sam9"; + + chosen { + bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock at 0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <16367660>; + }; + }; + + ahb { + apb { + dbgu: serial at ffffee00 { + status = "okay"; + }; + + usart0: serial at fff8c000 { + status = "okay"; + }; + + macb0: ethernet at fffbc000 { + phy-mode = "rmii"; + status = "okay"; + }; + + usb1: gadget at fff78000 { + atmel,vbus-gpio = <&pioA 25 0>; + status = "okay"; + }; + }; + + nand0: nand at 40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "soft"; + nand-on-flash-bbt = <1>; + status = "okay"; + + at91bootstrap at 0 { + label = "at91bootstrap"; + reg = <0x0 0x20000>; + }; + + barebox at 20000 { + label = "barebox"; + reg = <0x20000 0x40000>; + }; + + bareboxenv at 60000 { + label = "bareboxenv"; + reg = <0x60000 0x20000>; + }; + + bareboxenv2 at 80000 { + label = "bareboxenv2"; + reg = <0x80000 0x20000>; + }; + + oftree at 80000 { + label = "oftree"; + reg = <0xa0000 0x20000>; + }; + + kernel at a0000 { + label = "kernel"; + reg = <0xc0000 0x400000>; + }; + + rootfs at 4a0000 { + label = "rootfs"; + reg = <0x4c0000 0x7800000>; + }; + + data at 7ca0000 { + label = "data"; + reg = <0x7cc0000 0x8340000>; + }; + }; + + usb0: ohci at 00a00000 { + num-ports = <2>; + status = "okay"; + atmel,vbus-gpio = <&pioA 24 0 + &pioA 21 0 + >; + }; + }; + + leds { + compatible = "gpio-leds"; + + d3 { + label = "d3"; + gpios = <&pioB 7 0>; + linux,default-trigger = "heartbeat"; + }; + + d2 { + label = "d2"; + gpios = <&pioC 29 1>; + linux,default-trigger = "nand-disk"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + left_click { + label = "left_click"; + gpios = <&pioC 5 1>; + linux,code = <272>; + gpio-key,wakeup; + }; + + right_click { + label = "right_click"; + gpios = <&pioC 4 1>; + linux,code = <273>; + gpio-key,wakeup; + }; + }; + + i2c at 0 { + status = "okay"; + + 24c512 at 50 { + compatible = "24c512"; + reg = <0x50>; + pagesize = <128>; + }; + }; +};
arch/arm/mach-at91/Makefile.boot +2 -0
@@ -17,6 +17,8 @@ endif # sam9260 dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9260.dtb dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9260.dtb +# sam9263 +dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9263ek.dtb # sam9g20 dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g20ek.dtb dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g20ek_2mmc.dtb
Signature · 1 line
1.7.9.1