From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 14/18] ARM: zynq: switch to DT based probing
Date: Sat, 9 Nov 2019 15:28:33 +0100 [thread overview]
Message-ID: <20191109142837.82409-14-dev@lynxeye.de> (raw)
In-Reply-To: <20191109142837.82409-1-dev@lynxeye.de>
All the currently supported devices can now be probed
from the DT. Remove platform devices and switch to DT.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
arch/arm/boards/avnet-zedboard/board.c | 24 -----------------------
arch/arm/mach-zynq/Kconfig | 3 +++
arch/arm/mach-zynq/Makefile | 2 +-
arch/arm/mach-zynq/devices.c | 13 ------------
arch/arm/mach-zynq/include/mach/devices.h | 20 -------------------
arch/arm/mach-zynq/zynq.c | 4 ----
6 files changed, 4 insertions(+), 62 deletions(-)
delete mode 100644 arch/arm/mach-zynq/devices.c
delete mode 100644 arch/arm/mach-zynq/include/mach/devices.h
diff --git a/arch/arm/boards/avnet-zedboard/board.c b/arch/arm/boards/avnet-zedboard/board.c
index 722bda302e1f..f53dde47c204 100644
--- a/arch/arm/boards/avnet-zedboard/board.c
+++ b/arch/arm/boards/avnet-zedboard/board.c
@@ -17,38 +17,14 @@
#include <environment.h>
#include <generated/mach-types.h>
#include <init.h>
-#include <mach/devices.h>
#include <mach/zynq7000-regs.h>
#include <linux/sizes.h>
-static int zedboard_mem_init(void)
-{
- arm_add_mem_device("ram0", 0, SZ_512M);
-
- return 0;
-}
-mem_initcall(zedboard_mem_init);
-
-static struct macb_platform_data macb_pdata = {
- .phy_interface = PHY_INTERFACE_MODE_RGMII,
- .phy_addr = 0x0,
-};
-
-static int zedboard_device_init(void)
-{
- zynq_add_eth0(&macb_pdata);
-
- return 0;
-}
-device_initcall(zedboard_device_init);
static int zedboard_console_init(void)
{
- barebox_set_model("Avnet ZedBoard");
barebox_set_hostname("zedboard");
- zynq_add_uart1();
-
return 0;
}
console_initcall(zedboard_console_init);
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index d35bd41232a1..944f325bcc08 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -16,8 +16,11 @@ config ARCH_ZYNQ7000
select CPU_V7
select CLKDEV_LOOKUP
select COMMON_CLK
+ select COMMON_CLK_OF_PROVIDER
select ARM_SMP_TWD
select HAS_MACB
+ select OFTREE
+ select OFDEVICE
endchoice
diff --git a/arch/arm/mach-zynq/Makefile b/arch/arm/mach-zynq/Makefile
index b401c77983d3..3252247d176d 100644
--- a/arch/arm/mach-zynq/Makefile
+++ b/arch/arm/mach-zynq/Makefile
@@ -1 +1 @@
-obj-y += zynq.o devices.o
+obj-y += zynq.o
diff --git a/arch/arm/mach-zynq/devices.c b/arch/arm/mach-zynq/devices.c
deleted file mode 100644
index 55e9433c517d..000000000000
--- a/arch/arm/mach-zynq/devices.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <common.h>
-#include <driver.h>
-#include <mach/devices.h>
-
-struct device_d *zynq_add_uart(resource_size_t base, int id)
-{
- return add_generic_device("cadence-uart", id, NULL, base, 0x1000, IORESOURCE_MEM, NULL);
-}
-
-struct device_d *zynq_add_eth(resource_size_t base, int id, struct macb_platform_data *pdata)
-{
- return add_generic_device("macb", id, NULL, base, 0x1000, IORESOURCE_MEM, pdata);
-}
diff --git a/arch/arm/mach-zynq/include/mach/devices.h b/arch/arm/mach-zynq/include/mach/devices.h
deleted file mode 100644
index c9670b02f30c..000000000000
--- a/arch/arm/mach-zynq/include/mach/devices.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <mach/zynq7000-regs.h>
-#include <platform_data/macb.h>
-
-struct device_d *zynq_add_uart(resource_size_t base, int id);
-struct device_d *zynq_add_eth(resource_size_t base, int id, struct macb_platform_data *pdata);
-
-static inline struct device_d *zynq_add_uart0(void)
-{
- return zynq_add_uart((resource_size_t)ZYNQ_UART0_BASE_ADDR, 0);
-}
-
-static inline struct device_d *zynq_add_uart1(void)
-{
- return zynq_add_uart((resource_size_t)ZYNQ_UART1_BASE_ADDR, 1);
-}
-
-static inline struct device_d *zynq_add_eth0(struct macb_platform_data *pdata)
-{
- return zynq_add_eth((resource_size_t)ZYNQ_GEM0_BASE_ADDR, 0, pdata);
-}
diff --git a/arch/arm/mach-zynq/zynq.c b/arch/arm/mach-zynq/zynq.c
index ec22b16c91cd..ad06c624d90b 100644
--- a/arch/arm/mach-zynq/zynq.c
+++ b/arch/arm/mach-zynq/zynq.c
@@ -48,10 +48,6 @@ static int zynq_init(void)
writel(val, 0xf8f00000);
dmb();
- add_generic_device("zynq-clock", 0, NULL, ZYNQ_SLCR_BASE + 0x100,
- 0x4000, IORESOURCE_MEM, NULL);
- add_generic_device("smp_twd", 0, NULL, CORTEXA9_SCU_TIMER_BASE_ADDR,
- 0x4000, IORESOURCE_MEM, NULL);
restart_handler_register_fn(zynq_restart_soc);
return 0;
--
2.23.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-11-09 14:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-09 14:28 [PATCH v2 01/18] ARM: zynq: zedboard: enable MACB driver in defconfig Lucas Stach
2019-11-09 14:28 ` [PATCH v2 02/18] ARM: zynq: add trivial image build mechanism Lucas Stach
2019-11-09 14:28 ` [PATCH v2 03/18] ARM: zynq: use getopt in zynq_mkimage Lucas Stach
2019-11-09 14:28 ` [PATCH v2 04/18] ARM: zynq: move header generation to zynq_mkimage Lucas Stach
2019-11-09 14:28 ` [PATCH v2 05/18] ARM: zynq: add size check in zynq_mkimage Lucas Stach
2019-11-09 14:28 ` [PATCH v2 06/18] ARM: zynq: zedboard: provide DTB Lucas Stach
2019-11-09 14:28 ` [PATCH v2 07/18] net: macb: handle more clocks Lucas Stach
2019-11-09 14:28 ` [PATCH v2 08/18] net: macb: add Zynq compatible Lucas Stach
2019-11-09 14:28 ` [PATCH v2 09/18] ARM: zynq: move clock controller driver to drivers/clk Lucas Stach
2019-11-09 14:28 ` [PATCH v2 10/18] clk: zynq: use base address of clock controller Lucas Stach
2019-11-09 14:28 ` [PATCH v2 11/18] clk: zynq: improve PLL enable handling Lucas Stach
2019-11-09 14:28 ` [PATCH v2 12/18] clk: zynq: fix up address from DT Lucas Stach
2019-11-09 14:28 ` [PATCH v2 13/18] clk: zynq: partially sync with Linux Lucas Stach
2019-11-09 14:28 ` Lucas Stach [this message]
2019-11-09 14:28 ` [PATCH v2 15/18] clk: zynq: remove clkdevs Lucas Stach
2019-11-09 14:28 ` [PATCH v2 16/18] ARM: zynq: switch to multi-image build Lucas Stach
2019-11-09 14:28 ` [PATCH v2 17/18] bootsource: add JTAG bootsource Lucas Stach
2019-11-09 14:28 ` [PATCH v2 18/18] ARM: zynq: add bootsource detection Lucas Stach
2019-11-11 8:16 ` [PATCH v2 01/18] ARM: zynq: zedboard: enable MACB driver in defconfig Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191109142837.82409-14-dev@lynxeye.de \
--to=dev@lynxeye.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox