Re: [U-Boot] [PATCH 1/7] drivers: Add AXI uclass and ihs_axi driver
Hi Simon, On Fri, Mar 30, 2018 at 10:41 AM, Simon Glasswrote: > Hi Mario, > > On 28 March 2018 at 20:40, Mario Six wrote: >> Add a uclass for AXI (Advanced eXtensible Interface) busses, and a >> driver for the gdsys IHS AXI bus on IHS FPGAs. >> >> Signed-off-by: Mario Six >> --- >> drivers/Kconfig | 2 + >> drivers/Makefile | 1 + >> drivers/axi/Kconfig | 24 ++ >> drivers/axi/Makefile | 9 +++ >> drivers/axi/axi-uclass.c | 40 ++ >> drivers/axi/ihs_axi.c| 199 >> +++ >> include/axi.h| 75 ++ >> include/dm/uclass-id.h | 1 + >> 8 files changed, 351 insertions(+) >> create mode 100644 drivers/axi/Kconfig >> create mode 100644 drivers/axi/Makefile >> create mode 100644 drivers/axi/axi-uclass.c >> create mode 100644 drivers/axi/ihs_axi.c >> create mode 100644 include/axi.h > > Would UCLASS_MAILBOX be suitable here? > > It's fine if you want a new uclass, just checking. > From what I understand about the mailbox uclass, it's more for "one-off" devices that need to transfer messages, while AXI is a type of bus, much like I2C or SPI, so I think the mailbox uclass doesn't really encompass all that AXI is about. > Please split out your driver into a separate patch. Adding the new > uclass should be in its own patch. > OK, will split them in v2. >> >> diff --git a/drivers/Kconfig b/drivers/Kconfig >> index c2e813f5ad..eeaaa7575c 100644 >> --- a/drivers/Kconfig >> +++ b/drivers/Kconfig >> @@ -8,6 +8,8 @@ source "drivers/adc/Kconfig" >> >> source "drivers/ata/Kconfig" >> >> +source "drivers/axi/Kconfig" >> + >> source "drivers/block/Kconfig" >> >> source "drivers/bootcount/Kconfig" >> diff --git a/drivers/Makefile b/drivers/Makefile >> index 6846d181aa..f54a10f3ad 100644 >> --- a/drivers/Makefile >> +++ b/drivers/Makefile >> @@ -100,6 +100,7 @@ obj-y += input/ >> obj-y += soc/ >> obj-$(CONFIG_REMOTEPROC) += remoteproc/ >> obj-y += thermal/ >> +obj-y += axi/ >> >> obj-$(CONFIG_MACH_PIC32) += ddr/microchip/ >> endif >> diff --git a/drivers/axi/Kconfig b/drivers/axi/Kconfig >> new file mode 100644 >> index 00..19e1b7fd2f >> --- /dev/null >> +++ b/drivers/axi/Kconfig >> @@ -0,0 +1,24 @@ >> +menuconfig AXI >> + bool "AXI bus drivers" >> + help >> + Support AXI (Advanced eXtensible Interface) busses, a on-chip >> + interconnect specification for managing functional blocks in SoC >> + designs, which is also often used in designs involving FPGAs (e.g. >> + communication with IP cores in Xilinx FPGAs). >> + >> + These types of busses expose a virtual address space that can be >> + accessed using different address widths (8, 16, and 32 are >> supported >> + for now). >> + >> + Other similar bus architectures may be compatible as well. >> + >> +if AXI >> + >> +config IHS_AXI >> + bool "Enable IHS AXI driver" >> + depends on DM >> + help >> + Support for IHS AXI bus on a gdsys IHS FPGA used to communicate >> with >> + IP cores in the FPGA (e.g. video transmitter cores). > > Please also spell out the abbreviations in the help > Will do in v2. > [...] > > Regards, > Simon > Best regards, Mario ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/7] drivers: Add AXI uclass and ihs_axi driver
Hi Mario, On 28 March 2018 at 20:40, Mario Sixwrote: > Add a uclass for AXI (Advanced eXtensible Interface) busses, and a > driver for the gdsys IHS AXI bus on IHS FPGAs. > > Signed-off-by: Mario Six > --- > drivers/Kconfig | 2 + > drivers/Makefile | 1 + > drivers/axi/Kconfig | 24 ++ > drivers/axi/Makefile | 9 +++ > drivers/axi/axi-uclass.c | 40 ++ > drivers/axi/ihs_axi.c| 199 > +++ > include/axi.h| 75 ++ > include/dm/uclass-id.h | 1 + > 8 files changed, 351 insertions(+) > create mode 100644 drivers/axi/Kconfig > create mode 100644 drivers/axi/Makefile > create mode 100644 drivers/axi/axi-uclass.c > create mode 100644 drivers/axi/ihs_axi.c > create mode 100644 include/axi.h Would UCLASS_MAILBOX be suitable here? It's fine if you want a new uclass, just checking. Please split out your driver into a separate patch. Adding the new uclass should be in its own patch. > > diff --git a/drivers/Kconfig b/drivers/Kconfig > index c2e813f5ad..eeaaa7575c 100644 > --- a/drivers/Kconfig > +++ b/drivers/Kconfig > @@ -8,6 +8,8 @@ source "drivers/adc/Kconfig" > > source "drivers/ata/Kconfig" > > +source "drivers/axi/Kconfig" > + > source "drivers/block/Kconfig" > > source "drivers/bootcount/Kconfig" > diff --git a/drivers/Makefile b/drivers/Makefile > index 6846d181aa..f54a10f3ad 100644 > --- a/drivers/Makefile > +++ b/drivers/Makefile > @@ -100,6 +100,7 @@ obj-y += input/ > obj-y += soc/ > obj-$(CONFIG_REMOTEPROC) += remoteproc/ > obj-y += thermal/ > +obj-y += axi/ > > obj-$(CONFIG_MACH_PIC32) += ddr/microchip/ > endif > diff --git a/drivers/axi/Kconfig b/drivers/axi/Kconfig > new file mode 100644 > index 00..19e1b7fd2f > --- /dev/null > +++ b/drivers/axi/Kconfig > @@ -0,0 +1,24 @@ > +menuconfig AXI > + bool "AXI bus drivers" > + help > + Support AXI (Advanced eXtensible Interface) busses, a on-chip > + interconnect specification for managing functional blocks in SoC > + designs, which is also often used in designs involving FPGAs (e.g. > + communication with IP cores in Xilinx FPGAs). > + > + These types of busses expose a virtual address space that can be > + accessed using different address widths (8, 16, and 32 are supported > + for now). > + > + Other similar bus architectures may be compatible as well. > + > +if AXI > + > +config IHS_AXI > + bool "Enable IHS AXI driver" > + depends on DM > + help > + Support for IHS AXI bus on a gdsys IHS FPGA used to communicate with > + IP cores in the FPGA (e.g. video transmitter cores). Please also spell out the abbreviations in the help [...] Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/7] drivers: Add AXI uclass and ihs_axi driver
Add a uclass for AXI (Advanced eXtensible Interface) busses, and a driver for the gdsys IHS AXI bus on IHS FPGAs. Signed-off-by: Mario Six--- drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/axi/Kconfig | 24 ++ drivers/axi/Makefile | 9 +++ drivers/axi/axi-uclass.c | 40 ++ drivers/axi/ihs_axi.c| 199 +++ include/axi.h| 75 ++ include/dm/uclass-id.h | 1 + 8 files changed, 351 insertions(+) create mode 100644 drivers/axi/Kconfig create mode 100644 drivers/axi/Makefile create mode 100644 drivers/axi/axi-uclass.c create mode 100644 drivers/axi/ihs_axi.c create mode 100644 include/axi.h diff --git a/drivers/Kconfig b/drivers/Kconfig index c2e813f5ad..eeaaa7575c 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -8,6 +8,8 @@ source "drivers/adc/Kconfig" source "drivers/ata/Kconfig" +source "drivers/axi/Kconfig" + source "drivers/block/Kconfig" source "drivers/bootcount/Kconfig" diff --git a/drivers/Makefile b/drivers/Makefile index 6846d181aa..f54a10f3ad 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -100,6 +100,7 @@ obj-y += input/ obj-y += soc/ obj-$(CONFIG_REMOTEPROC) += remoteproc/ obj-y += thermal/ +obj-y += axi/ obj-$(CONFIG_MACH_PIC32) += ddr/microchip/ endif diff --git a/drivers/axi/Kconfig b/drivers/axi/Kconfig new file mode 100644 index 00..19e1b7fd2f --- /dev/null +++ b/drivers/axi/Kconfig @@ -0,0 +1,24 @@ +menuconfig AXI + bool "AXI bus drivers" + help + Support AXI (Advanced eXtensible Interface) busses, a on-chip + interconnect specification for managing functional blocks in SoC + designs, which is also often used in designs involving FPGAs (e.g. + communication with IP cores in Xilinx FPGAs). + + These types of busses expose a virtual address space that can be + accessed using different address widths (8, 16, and 32 are supported + for now). + + Other similar bus architectures may be compatible as well. + +if AXI + +config IHS_AXI + bool "Enable IHS AXI driver" + depends on DM + help + Support for IHS AXI bus on a gdsys IHS FPGA used to communicate with + IP cores in the FPGA (e.g. video transmitter cores). + +endif diff --git a/drivers/axi/Makefile b/drivers/axi/Makefile new file mode 100644 index 00..18d9380e9b --- /dev/null +++ b/drivers/axi/Makefile @@ -0,0 +1,9 @@ +# +# (C) Copyright 2017 +# Mario Six, Guntermann & Drunck GmbH, mario@gdsys.cc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-$(CONFIG_AXI) += axi-uclass.o +obj-$(CONFIG_IHS_AXI) += ihs_axi.o diff --git a/drivers/axi/axi-uclass.c b/drivers/axi/axi-uclass.c new file mode 100644 index 00..3a5ddf3a46 --- /dev/null +++ b/drivers/axi/axi-uclass.c @@ -0,0 +1,40 @@ +/* + * (C) Copyright 2017 + * Mario Six, Guntermann & Drunck GmbH, mario@gdsys.cc + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include +#include +#include + +int axi_read(struct udevice *dev, ulong address, void *data, +enum axi_size_t size) +{ + struct axi_ops *ops = axi_get_ops(dev); + + if (!ops->read) + return -ENOSYS; + + return ops->read(dev, address, data, size); +} + +int axi_write(struct udevice *dev, ulong address, void *data, + enum axi_size_t size) +{ + struct axi_ops *ops = axi_get_ops(dev); + + if (!ops->write) + return -ENOSYS; + + return ops->write(dev, address, data, size); +} + +UCLASS_DRIVER(axi) = { + .id = UCLASS_AXI, + .name = "axi", + .post_bind = dm_scan_fdt_dev, + .flags = DM_UC_FLAG_SEQ_ALIAS, +}; + diff --git a/drivers/axi/ihs_axi.c b/drivers/axi/ihs_axi.c new file mode 100644 index 00..71bb67421f --- /dev/null +++ b/drivers/axi/ihs_axi.c @@ -0,0 +1,199 @@ +/* + * (C) Copyright 2016 + * Dirk Eibach, Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc + * + * (C) Copyright 2017 + * Mario Six, Guntermann & Drunck GmbH, mario@gdsys.cc + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include +#include +#include +#include +#include "../misc/gdsys_soc.h" + +DECLARE_GLOBAL_DATA_PTR; + +enum { + REG_INTERRUPT_STATUS = 0x00, + REG_INTERRUPT_ENABLE_CONTROL = 0x02, + REG_ADDRESS_LSB = 0x04, + REG_ADDRESS_MSB = 0x06, + REG_WRITE_DATA_LSB = 0x08, + REG_WRITE_DATA_MSB = 0x0A, + REG_READ_DATA_LSB = 0x0C, + REG_READ_DATA_MSB = 0x0E, +}; + +struct ihs_axi_priv { + fdt_addr_t addr; +}; + +enum { + STATUS_EVENT_MASK = GENMASK(15, 12), + + STATUS_READ_COMPLETE_EVENT = BIT(15), + STATUS_WRITE_COMPLETE_EVENT = BIT(14), + STATUS_TIMEOUT_EVENT = BIT(13), + STATUS_ERROR_EVENT = BIT(12), + STATUS_AXI_INT = BIT(11), + STATUS_READ_DATA_AVAILABLE = BIT(7), +