Skip to contentSkip to conversation

axi: add AXI bus driver

RFC PATCH In review Rafał Miłecki 8 participants 31 messages Apr 11, 2011 – Apr 13, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 axi: add AXI bus driver

Cc Michael Büsch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def
Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

---
 drivers/Kconfig                           |    2 +
 drivers/Makefile                          |    1 +
 drivers/axi/Kconfig                       |   33 +++
 drivers/axi/Makefile                      |    7 +
 drivers/axi/TODO                          |    3 +
 drivers/axi/axi_pci_bridge.c              |   33 +++
 drivers/axi/axi_private.h                 |   37 +++
 drivers/axi/core.c                        |   52 ++++
 drivers/axi/driver_chipcommon.c           |   87 +++++++
 drivers/axi/driver_chipcommon_pmu.c       |  134 ++++++++++
 drivers/axi/driver_pci.c                  |  163 ++++++++++++
 drivers/axi/host_pci.c                    |  175 +++++++++++++
 drivers/axi/main.c                        |  253 +++++++++++++++++++
 drivers/axi/scan.c                        |  391 +++++++++++++++++++++++++++++
 drivers/axi/scan.h                        |   56 ++++
 include/linux/axi/axi.h                   |  207 +++++++++++++++
 include/linux/axi/axi_driver_chipcommon.h |  308 +++++++++++++++++++++++
 include/linux/axi/axi_driver_pci.h        |   89 +++++++
 include/linux/axi/axi_regs.h              |   34 +++
 include/linux/mod_devicetable.h           |   17 ++
 scripts/mod/file2alias.c                  |   21 ++
 21 files changed, 2103 insertions(+), 0 deletions(-)
 create mode 100644 drivers/axi/Kconfig
 create mode 100644 drivers/axi/Makefile
 create mode 100644 drivers/axi/TODO
 create mode 100644 drivers/axi/axi_pci_bridge.c
 create mode 100644 drivers/axi/axi_private.h
 create mode 100644 drivers/axi/core.c
 create mode 100644 drivers/axi/driver_chipcommon.c
 create mode 100644 drivers/axi/driver_chipcommon_pmu.c
 create mode 100644 drivers/axi/driver_pci.c
 create mode 100644 drivers/axi/host_pci.c
 create mode 100644 drivers/axi/main.c
 create mode 100644 drivers/axi/scan.c
 create mode 100644 drivers/axi/scan.h
 create mode 100644 include/linux/axi/axi.h
 create mode 100644 include/linux/axi/axi_driver_chipcommon.h
 create mode 100644 include/linux/axi/axi_driver_pci.h
 create mode 100644 include/linux/axi/axi_regs.h
drivers/Kconfig +2 -0
index 177c7d1..1244e8c 100644
@@ -68,6 +68,8 @@ source "drivers/watchdog/Kconfig"
 
 source "drivers/ssb/Kconfig"
 
+source "drivers/axi/Kconfig"
+
 source "drivers/mfd/Kconfig"
 
 source "drivers/regulator/Kconfig"
drivers/Makefile +1 -0
index 3f135b6..6e1979b 100644
@@ -110,6 +110,7 @@ obj-$(CONFIG_HID)		+= hid/
 obj-$(CONFIG_PPC_PS3)		+= ps3/
 obj-$(CONFIG_OF)		+= of/
 obj-$(CONFIG_SSB)		+= ssb/
+obj-$(CONFIG_AXI)		+= axi/
 obj-$(CONFIG_VHOST_NET)		+= vhost/
 obj-$(CONFIG_VLYNQ)		+= vlynq/
 obj-$(CONFIG_STAGING)		+= staging/
drivers/axi/Kconfig new file +33 -0
new file mode 100644
index 0000000..6221af0
@@ -0,0 +1,33 @@
+config AXI_POSSIBLE
+	bool
+	depends on HAS_IOMEM && HAS_DMA
+	default y
+
+menu "AMBA AXI"
+	depends on AXI_POSSIBLE
+
+config AXI
+	tristate "AXI support"
+	depends on AXI_POSSIBLE
+	help
+	  Bus driver for one of the Advanced Microcontroller Bus Architecture
+	  interfaces: Advanced eXtensible Interface.
+
+config AXI_HOST_PCI_POSSIBLE
+	bool
+	depends on AXI && PCI = y
+	default y
+
+config AXI_HOST_PCI
+	bool "Support for AXI on PCI-host bus"
+	depends on AXI_HOST_PCI_POSSIBLE
+
+config AXI_DEBUG
+	bool "AXI debugging"
+	depends on AXI
+	help
+	  This turns on additional debugging messages.
+
+	  If unsure, say N
+
+endmenu
drivers/axi/Makefile new file +7 -0
new file mode 100644
index 0000000..5e1628d
@@ -0,0 +1,7 @@
+axi-y					+= main.o scan.o core.o
+axi-y					+= driver_chipcommon.o driver_chipcommon_pmu.o
+axi-y					+= driver_pci.o
+axi-$(CONFIG_AXI_HOST_PCI)		+= host_pci.o axi_pci_bridge.o
+obj-$(CONFIG_AXI)			+= axi.o
+
+ccflags-$(CONFIG_AXI_DEBUG)		:= -DDEBUG
\ No newline at end of file
drivers/axi/TODO new file +3 -0
new file mode 100644
index 0000000..5190336
@@ -0,0 +1,3 @@
+- Interrupts
+- Defines for PCI core driver
+- Convert axi_bus->cores into linked list
drivers/axi/axi_pci_bridge.c new file +33 -0
new file mode 100644
index 0000000..17e882c
@@ -0,0 +1,33 @@
+/*
+ * AXI PCI bridge module
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+#include "axi_private.h"
+
+#include <linux/axi/axi.h>
+#include <linux/pci.h>
+
+static DEFINE_PCI_DEVICE_TABLE(axi_pci_bridge_tbl) = {
+	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4353) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
+	{ 0, },
+};
+MODULE_DEVICE_TABLE(pci, axi_pci_bridge_tbl);
+
+static struct pci_driver axi_pci_bridge_driver = {
+	.name = "axi-pci-bridge",
+	.id_table = axi_pci_bridge_tbl,
+};
+
+int __init axi_pci_bridge_init(void)
+{
+	return axi_host_pci_register(&axi_pci_bridge_driver);
+}
+
+void __exit axi_pci_bridge_exit(void)
+{
+	axi_host_pci_unregister(&axi_pci_bridge_driver);
+}
drivers/axi/axi_private.h new file +37 -0
new file mode 100644
index 0000000..756efb6
@@ -0,0 +1,37 @@
+#ifndef LINUX_AXI_PRIVATE_H_
+#define LINUX_AXI_PRIVATE_H_
+
+#ifndef pr_fmt
+#define pr_fmt(fmt)		KBUILD_MODNAME ": " fmt
+#endif
+
+#include <linux/axi/axi.h>
+
+#define AXI_ADDR_BASE		0x18000000
+#define AXI_WRAP_BASE		0x18100000
+
+#define AXI_CORE_SIZE		0x1000
+
+struct axi_bus;
+
+/* main.c */
+extern int axi_bus_register(struct axi_bus *bus);
+extern void axi_bus_unregister(struct axi_bus *bus);
+
+/* scan.c */
+int axi_bus_scan(struct axi_bus *bus);
+
+#ifdef CONFIG_AXI_HOST_PCI
+/* b43_pci_ai_bridge.c */
+extern int __init axi_pci_bridge_init(void);
+extern void __exit axi_pci_bridge_exit(void);
+
+/* host_pci.c */
+extern int axi_host_pci_register(struct pci_driver *driver);
+static inline void axi_host_pci_unregister(struct pci_driver *driver)
+{
+	pci_unregister_driver(driver);
+}
+#endif /* CONFIG_AXI_HOST_PCI */
+
+#endif
drivers/axi/core.c new file +52 -0

52 lines not on this page · raw message

drivers/axi/driver_chipcommon.c new file +87 -0

87 lines not on this page · raw message

drivers/axi/driver_chipcommon_pmu.c new file +134 -0

134 lines not on this page · raw message

drivers/axi/driver_pci.c new file +163 -0

163 lines not on this page · raw message

drivers/axi/host_pci.c new file +175 -0

175 lines not on this page · raw message

drivers/axi/main.c new file +253 -0

253 lines not on this page · raw message

drivers/axi/scan.c new file +391 -0

391 lines not on this page · raw message

drivers/axi/scan.h new file +56 -0

56 lines not on this page · raw message

include/linux/axi/axi.h new file +207 -0

207 lines not on this page · raw message

include/linux/axi/axi_driver_chipcommon.h new file +308 -0

308 lines not on this page · raw message

include/linux/axi/axi_driver_pci.h new file +89 -0

89 lines not on this page · raw message

include/linux/axi/axi_regs.h new file +34 -0
new file mode 100644
index 0000000..3bfb1d0
@@ -0,0 +1,34 @@
+#ifndef LINUX_AXI_REGS_H_
+#define LINUX_AXI_REGS_H_
+
+/* Agent registers (common for every core) */
+#define AXI_IOCTL			0x0408
+#define  AXI_IOCTL_CORE_BITS		0x3FFC
+#define  AXI_IOCTL_CLK			0x0001
+#define  AXI_IOCTL_FGC			0x0002
+#define  AXI_IOCTL_PME_EN		0x4000
+#define  AXI_IOCTL_BIST_EN		0x8000
+#define AXI_RESET_CTL			0x0800
+#define  AXI_RESET_CTL_RESET		0x0001
+
+/* AXI PCI config space registers. */
+#define AXI_PCI_PMCSR			0x44
+#define  AXI_PCI_PE			0x100
+#define	AXI_PCI_BAR0_WIN		0x80	/* Backplane address space 0 */
+#define	AXI_PCI_BAR1_WIN		0x84	/* Backplane address space 1 */
+#define	AXI_PCI_SPROMCTL		0x88	/* SPROM control */
+#define  AXI_PCI_SPROMCTL_WE		0x10	/* SPROM write enable */
+#define	AXI_PCI_BAR1_CONTROL		0x8c	/* Address space 1 burst control */
+#define AXI_PCI_IRQS			0x90	/* PCI interrupts */
+#define AXI_PCI_IRQMASK			0x94	/* PCI IRQ control and mask (pcirev >= 6 only) */
+#define AXI_PCI_BACKPLANE_IRQS		0x98	/* Backplane Interrupts */
+#define AXI_PCI_BAR0_WIN2		0xAC
+#define AXI_PCI_GPIO_IN			0xB0	/* GPIO Input (pcirev >= 3 only) */
+#define AXI_PCI_GPIO_OUT		0xB4	/* GPIO Output (pcirev >= 3 only) */
+#define AXI_PCI_GPIO_OUT_ENABLE		0xB8	/* GPIO Output Enable/Disable (pcirev >= 3 only) */
+#define  AXI_PCI_GPIO_SCS		0x10	/* PCI config space bit 4 for 4306c0 slow clock source */
+#define  AXI_PCI_GPIO_HWRAD		0x20	/* PCI config space GPIO 13 for hw radio disable */
+#define  AXI_PCI_GPIO_XTAL		0x40	/* PCI config space GPIO 14 for Xtal powerup */
+#define  AXI_PCI_GPIO_PLL		0x80	/* PCI config space GPIO 15 for PLL powerdown */
+
+#endif /* LINUX_AXI_REGS_H_ */
include/linux/mod_devicetable.h +17 -0
index 48c007d..b3b6424 100644
@@ -382,6 +382,23 @@ struct ssb_device_id {
 #define SSB_ANY_ID		0xFFFF
 #define SSB_ANY_REV		0xFF
 
+/* AMBA AXI core, see drivers/axi/ */
+struct axi_device_id {
+	__u16	manuf;
+	__u16	id;
+	__u8	rev;
+	__u8	class;
+};
+#define AXI_CORE(_manuf, _id, _rev, _class)  \
+	{ .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, }
+#define AXI_CORETABLE_END  \
+	{ 0, },
+
+#define AXI_ANY_MANUF		0xFFFF
+#define AXI_ANY_ID		0xFFFF
+#define AXI_ANY_REV		0xFF
+#define AXI_ANY_CLASS		0xFF
+
 struct virtio_device_id {
 	__u32 device;
 	__u32 vendor;
scripts/mod/file2alias.c +21 -0
index 88f3f07..d9eebd0 100644
@@ -702,6 +702,23 @@ static int do_ssb_entry(const char *filename,
 	return 1;
 }
 
+/* Looks like: axi:mNidNrevNclN. */
+static int do_axi_entry(const char *filename,
+			struct axi_device_id *id, char *alias)
+{
+	id->manuf = TO_NATIVE(id->manuf);
+	id->id = TO_NATIVE(id->id);
+	id->rev = TO_NATIVE(id->rev);
+
+	strcpy(alias, "axi:");
+	ADD(alias, "m", id->manuf != AXI_ANY_MANUF, id->manuf);
+	ADD(alias, "id", id->id != AXI_ANY_ID, id->id);
+	ADD(alias, "rev", id->rev != AXI_ANY_REV, id->rev);
+	ADD(alias, "cl", id->class != AXI_ANY_CLASS, id->class);
+	add_wildcard(alias);
+	return 1;
+}
+
 /* Looks like: virtio:dNvN */
 static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
 			   char *alias)
@@ -968,6 +985,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
 		do_table(symval, sym->st_size,
 			 sizeof(struct ssb_device_id), "ssb",
 			 do_ssb_entry, mod);
+	else if (sym_is(symname, "__mod_axi_device_table"))
+		do_table(symval, sym->st_size,
+			 sizeof(struct axi_device_id), "axi",
+			 do_axi_entry, mod);
 	else if (sym_is(symname, "__mod_virtio_device_table"))
 		do_table(symval, sym->st_size,
 			 sizeof(struct virtio_device_id), "virtio",
Signature · 1 line
1.7.3.4
#1 lore raw

2011/4/12 Rafa? Mi?ecki <[email protected]>:

Quoted 2 lines

V3.1: Include forgotten changes (pr_* and include related) ? ?Explain why we dare to implement empty release function

I forgot to include TODO in commit message. This is still not ready for mainline.

TODO:
- Documentation/ABI/README entry for new sysfs files

(Greg: earlier in V3 I put this part of TODO in file, sorry for confusing).

I hope rest of tasks from *file* TODO can be done after getting this mainline.

Signature · 1 line
Rafa?
#2 lore raw
In reply to Rafał Miłecki
Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE
Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def

Quoted 8 lines

Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

Nope, still not allowed, see my other email, sorry.

thanks,

greg k-h

#3 lore raw
In reply to Rafał Miłecki

2011/4/12 Rafa? Mi?ecki <[email protected]>:

Quoted 20 lines
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
? ?Use DEFINE_PCI_DEVICE_TABLE in bridge
? ?Make use of pr_fmt and pr_*
? ?Store core class
? ?Rename bridge to not b43 specific
? ?Replace magic 0x1000 with BCMAI_CORE_SIZE
? ?Remove some old "ssb" names and defines
? ?Move BCMAI_ADDR_BASE def

Quoted 8 lines

? ?Add drvdata field
V3: Fix reloading (kfree issue)
? ?Add 14e4:0x4331
? ?Fix non-initialized struct issue
? ?Drop useless inline functions wrappers for pci core drv ? ?Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related) ? ?Explain why we dare to implement empty release function

There is one more change I started to consider. Is "core" correct name for AXI's device? Almost everywhere we can read about *components* on the AXI interconnect.

Maybe it'd make sense to s/core/comp/? Arend?

Signature · 1 line
Rafa?
#4 lore raw
Quoted 5 lines · Rafa? Mi?ecki

There is one more change I started to consider. Is "core" correct name for AXI's device? Almost everywhere we can read about *components* on the AXI interconnect.

Maybe it'd make sense to s/core/comp/? Arend?

I have no strong preference on this. I tried the latest patch and it does not crash anymore with load/unload.

Gr. AvS

Signature · 1 line
"The world is indeed comic, but the joke is on mankind." ? H.P. Lovecraft
#5 lore raw

2011/4/12 Arend van Spriel <[email protected]>:

Quoted 10 lines · Rafa? Mi?ecki
Quoted 6 lines

There is one more change I started to consider. Is "core" correct name for AXI's device? Almost everywhere we can read about *components* on the AXI interconnect.

Maybe it'd make sense to s/core/comp/? Arend?

I have no strong preference on this. I tried the latest patch and it does not crash anymore with load/unload.

Could you post dmesg? Probably nothing exciting, just my curiosity :)

Signature · 1 line
Rafa?
#6 lore raw
Quoted 8 lines · Rafa? Mi?ecki

2011/4/12 Arend van Spriel <[email protected]>:

Quoted 7 lines
Quoted 4 lines · Rafa? Mi?ecki

There is one more change I started to consider. Is "core" correct name for AXI's device? Almost everywhere we can read about *components* on the AXI interconnect.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Maybe it'd make sense to s/core/comp/? Arend?

I have no strong preference on this. I tried the latest patch and it does
not crash anymore with load/unload.

Could you post dmesg? Probably nothing exciting, just my curiosity :)

Apr 12 11:56:52 arend-laptop kernel: [ 6615.077417] axi-pci-bridge  
0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
Apr 12 11:56:52 arend-laptop kernel: [ 6615.078690] axi: Core 0 found:  
ChipCommon (manuf 0x4BF, id 0x800, rev 0x22, class 0x0)
Apr 12 11:56:52 arend-laptop kernel: [ 6615.079215] axi: Core 1 found:  
IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x17, class 0x0)
Apr 12 11:56:52 arend-laptop kernel: [ 6615.079777] axi: Core 2 found:  
PCIe (manuf 0x4BF, id 0x820, rev 0x0F, class 0x0)
Apr 12 11:56:52 arend-laptop kernel: [ 6615.111608] axi: AXI registered
Apr 12 11:57:25 arend-laptop kernel: [ 6648.556024] axi-pci-bridge  

0000:03:00.0: PCI INT A disabled

Happy to satisfy your curiosity.

Gr. AvS

Signature · 1 line
"The world is indeed comic, but the joke is on mankind." ? H.P. Lovecraft
#7 lore raw
In reply to Rafał Miłecki

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE
Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def

Quoted 8 lines

Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Signature · 1 line
balbi
#8 lore raw
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE
Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def

Quoted 8 lines

Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Also can't figure out how is this implementation supposed to manage multicore devices.

Any plans on embeddables' support ?

Have nice day,
George

#9 lore raw

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
? ? Use DEFINE_PCI_DEVICE_TABLE in bridge
? ? Make use of pr_fmt and pr_*
? ? Store core class
? ? Rename bridge to not b43 specific
? ? Replace magic 0x1000 with BCMAI_CORE_SIZE
? ? Remove some old "ssb" names and defines
? ? Move BCMAI_ADDR_BASE def

Quoted 8 lines

? ? Add drvdata field
V3: Fix reloading (kfree issue)
? ? Add 14e4:0x4331
? ? Fix non-initialized struct issue
? ? Drop useless inline functions wrappers for pci core drv ? ? Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related) ? ? Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Quoted 2 lines

Also can't figure out how is this implementation supposed to manage multicore devices.

We have got ideas, but let's first find (wait for) such a device ;)

Quoted 1 line

Any plans on embeddables' support ?

Sure, if noone will come before me, I'll try to provide support for embedded devices. However basic support for PCI host in higher on my priority list. First I want to know it is working at all ;)

Signature · 1 line
Rafa?
#10 lore raw
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE
Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def

Quoted 8 lines

Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Quoted 6 lines
Quoted 4 lines

Also can't figure out how is this implementation supposed to manage multicore devices.

We have got ideas, but let's first find (wait for) such a device ;)

bcm4716 usb host ? Don't really know if there are any other multicores.

Quoted 8 lines
Quoted 3 lines

Any plans on embeddables' support ?

Sure, if noone will come before me, I'll try to provide support for embedded devices. However basic support for PCI host in higher on my priority list. First I want to know it is working at all ;)

Have nice day,
George

#11 lore raw

2011/4/12 George Kashperko <[email protected]>:

Quoted 69 lines
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
? ? Use DEFINE_PCI_DEVICE_TABLE in bridge
? ? Make use of pr_fmt and pr_*
? ? Store core class
? ? Rename bridge to not b43 specific
? ? Replace magic 0x1000 with BCMAI_CORE_SIZE
? ? Remove some old "ssb" names and defines
? ? Move BCMAI_ADDR_BASE def

Quoted 8 lines

? ? Add drvdata field
V3: Fix reloading (kfree issue)
? ? Add 14e4:0x4331
? ? Fix non-initialized struct issue
? ? Drop useless inline functions wrappers for pci core drv ? ? Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related) ? ? Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Quoted 6 lines

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Do you think that in my code only scanning is Broadcom specific? In such a case we could keep it "axi", and just s/scan/bcmscan/. This is only correct choice if the rest (addressing, core enabling, host management) is AXI specific.

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Also can't figure out how is this implementation supposed to manage multicore devices.

We have got ideas, but let's first find (wait for) such a device ;)

bcm4716 usb host ? Don't really know if there are any other multicores.

This is SoC, we do not have any problems supporting multiple cores on SoCs. All cores are available at the same time, without any sliding windows.

Signature · 1 line
Rafa?
#12 lore raw
Quoted 78 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 69 lines
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE
Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def

Quoted 8 lines

Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Quoted 6 lines

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Quoted 4 lines

Do you think that in my code only scanning is Broadcom specific? In such a case we could keep it "axi", and just s/scan/bcmscan/. This is only correct choice if the rest (addressing, core enabling, host management) is AXI specific.

We rely on core identification following its id/ven/rev/class layout from EROM. Corelink cores use different layout/location. Also core enabling/disabling are DMP related. Another _if_ here -- is DMP obligatory for all axi buses?

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Also can't figure out how is this implementation supposed to manage multicore devices.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

We have got ideas, but let's first find (wait for) such a device ;)

bcm4716 usb host ? Don't really know if there are any other multicores.

This is SoC, we do not have any problems supporting multiple cores on SoCs. All cores are available at the same time, without any sliding windows.

Multicores have multiple slave ports bound to single master port (agent). Individual core driver must be confident of its "partner" device/driver and both must know who is permitted to enable/disable/reset and who is not or there should be some other technique for agent management.

Have nice day,
George

#13 lore raw

2011/4/12 George Kashperko <[email protected]>:

Quoted 78 lines
Quoted 78 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 75 lines
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
? ? Use DEFINE_PCI_DEVICE_TABLE in bridge
? ? Make use of pr_fmt and pr_*
? ? Store core class
? ? Rename bridge to not b43 specific
? ? Replace magic 0x1000 with BCMAI_CORE_SIZE
? ? Remove some old "ssb" names and defines
? ? Move BCMAI_ADDR_BASE def

Quoted 8 lines

? ? Add drvdata field
V3: Fix reloading (kfree issue)
? ? Add 14e4:0x4331
? ? Fix non-initialized struct issue
? ? Drop useless inline functions wrappers for pci core drv ? ? Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related) ? ? Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Quoted 8 lines
Quoted 4 lines

Do you think that in my code only scanning is Broadcom specific? In such a case we could keep it "axi", and just s/scan/bcmscan/. This is only correct choice if the rest (addressing, core enabling, host management) is AXI specific.

We rely on core identification following its id/ven/rev/class layout from EROM. Corelink cores use different layout/location. Also core enabling/disabling are DMP related. Another _if_ here -- is DMP obligatory for all axi buses?

Why do you use "Corelink" name? Do you mean AMBA AXI cores? Please, try to keep it simple, do not introduce more things we need to make clear for this discussion.
What do you mean by DMP?

Quoted 10 lines
Quoted 10 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Also can't figure out how is this implementation supposed to manage multicore devices.

We have got ideas, but let's first find (wait for) such a device ;)

bcm4716 usb host ? Don't really know if there are any other multicores.

This is SoC, we do not have any problems supporting multiple cores on SoCs. All cores are available at the same time, without any sliding windows.

Quoted 5 lines

Multicores have multiple slave ports bound to single master port (agent). Individual core driver must be confident of its "partner" device/driver and both must know who is permitted to enable/disable/reset and who is not or there should be some other technique for agent management.

Let's leave that multi-core discussion for later, or I'll freak.

Signature · 1 line
Rafa?
#15 lore raw
In reply to Rafał Miłecki

Hi Rafa?,

Quoted 77 lines · Rafa? Mi?ecki

2011/4/12 George Kashperko <[email protected]>:

Quoted 69 lines
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE
Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def

Quoted 8 lines

Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Quoted 6 lines

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Quoted 4 lines

Do you think that in my code only scanning is Broadcom specific? In such a case we could keep it "axi", and just s/scan/bcmscan/. This is only correct choice if the rest (addressing, core enabling, host management) is AXI specific.

The specification for the AMBA AXI Interface is available for free download from ARM if you register to their website and accept their license:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.amba/index.html
I got it from there without any problems and the license does not look too bad for me, by having a quick look at it. I do not know if it will help you in any way or if it is completely unrelated.

Why is the existing support for the amba bus not extended or used in any way for this? It exists for some time in drivers/amba/. There already was a discussion about this in https://lkml.org/lkml/2011/3/30/186 , but with no result as I see.

Quoted 10 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Also can't figure out how is this implementation supposed to manage multicore devices.

We have got ideas, but let's first find (wait for) such a device ;)

bcm4716 usb host ? Don't really know if there are any other multicores.

This is SoC, we do not have any problems supporting multiple cores on SoCs. All cores are available at the same time, without any sliding windows.

Hauke

#16 lore raw

2011/4/12 Hauke Mehrtens <[email protected]>:

Quoted 92 lines

Hi Rafa?,

Quoted 77 lines · Rafa? Mi?ecki

2011/4/12 George Kashperko <[email protected]>:

Quoted 69 lines
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
? ? Use DEFINE_PCI_DEVICE_TABLE in bridge
? ? Make use of pr_fmt and pr_*
? ? Store core class
? ? Rename bridge to not b43 specific
? ? Replace magic 0x1000 with BCMAI_CORE_SIZE
? ? Remove some old "ssb" names and defines
? ? Move BCMAI_ADDR_BASE def

Quoted 8 lines

? ? Add drvdata field
V3: Fix reloading (kfree issue)
? ? Add 14e4:0x4331
? ? Fix non-initialized struct issue
? ? Drop useless inline functions wrappers for pci core drv ? ? Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related) ? ? Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Quoted 6 lines

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Quoted 4 lines

Do you think that in my code only scanning is Broadcom specific? In such a case we could keep it "axi", and just s/scan/bcmscan/. This is only correct choice if the rest (addressing, core enabling, host management) is AXI specific.

The specification for the AMBA AXI Interface is available for free download from ARM if you register to their website and accept their license:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.amba/index.html
I got it from there without any problems and the license does not look too bad for me, by having a quick look at it. I do not know if it will help you in any way or if it is completely unrelated.

Quoted 4 lines

Why is the existing support for the amba bus not extended or used in any way for this? It exists for some time in drivers/amba/. There already was a discussion about this in https://lkml.org/lkml/2011/3/30/186 , but with no result as I see.

I can see exactly nothing I could use from whatever driver/amba is. What does it do from things we need? How do you imagine using that with out (non)Broadcom buses?

Signature · 1 line
Rafa?
#14 lore raw
In reply to Rafał Miłecki
Quoted 89 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 78 lines
Quoted 78 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 75 lines
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE
Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def

Quoted 8 lines

Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Quoted 8 lines
Quoted 4 lines

Do you think that in my code only scanning is Broadcom specific? In such a case we could keep it "axi", and just s/scan/bcmscan/. This is only correct choice if the rest (addressing, core enabling, host management) is AXI specific.

We rely on core identification following its id/ven/rev/class layout from EROM. Corelink cores use different layout/location. Also core enabling/disabling are DMP related. Another _if_ here -- is DMP obligatory for all axi buses?

Quoted 4 lines

Why do you use "Corelink" name? Do you mean AMBA AXI cores? Please, try to keep it simple, do not introduce more things we need to make clear for this discussion.
What do you mean by DMP?

DMP, Device Management Plugin (mentioned several times here by Broadcom guys) - don't know for sure as there are no public docs at ARM regarding this thingy. I suppose its arm instrument used to build master ports for amba to talk to the interconnect on behalf of non-native (e. g. Broadcom proprietary) IP cores. Its my raw guess ofcourse but think I'm not that far from actual truth here. All that oobseloxxxx stuff in aidmp.h is that DMP. Among those peripherialid and componentid registers are documented in public corelink specs.
Think it would be beneficial for you to do some research among those docs available publicly from arm (see Hauke Mertens message few mins ago for link) before claiming sumthing just related to axi as actual axi. Here I don't mean I know everything on the subject, just the time spent on clearing this question for myself make me think we deal with Broadcom-specific implementation but not the _real_ axi as it is.

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines

Also can't figure out how is this implementation supposed to manage multicore devices.

We have got ideas, but let's first find (wait for) such a device ;)

bcm4716 usb host ? Don't really know if there are any other multicores.

This is SoC, we do not have any problems supporting multiple cores on SoCs. All cores are available at the same time, without any sliding windows.

Quoted 8 lines
Quoted 5 lines

Multicores have multiple slave ports bound to single master port (agent). Individual core driver must be confident of its "partner" device/driver and both must know who is permitted to enable/disable/reset and who is not or there should be some other technique for agent management.

Let's leave that multi-core discussion for later, or I'll freak

Sure thing ;)

Have nice day,
George

#17 lore raw
In reply to Rafał Miłecki

2011/4/12 Rafa? Mi?ecki <[email protected]>:

Quoted 93 lines

2011/4/12 Hauke Mehrtens <[email protected]>:

Quoted 92 lines

Hi Rafa?,

Quoted 77 lines · Rafa? Mi?ecki

2011/4/12 George Kashperko <[email protected]>:

Quoted 69 lines
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
? ? Use DEFINE_PCI_DEVICE_TABLE in bridge
? ? Make use of pr_fmt and pr_*
? ? Store core class
? ? Rename bridge to not b43 specific
? ? Replace magic 0x1000 with BCMAI_CORE_SIZE
? ? Remove some old "ssb" names and defines
? ? Move BCMAI_ADDR_BASE def

Quoted 8 lines

? ? Add drvdata field
V3: Fix reloading (kfree issue)
? ? Add 14e4:0x4331
? ? Fix non-initialized struct issue
? ? Drop useless inline functions wrappers for pci core drv ? ? Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related) ? ? Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Quoted 6 lines

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Quoted 4 lines

Do you think that in my code only scanning is Broadcom specific? In such a case we could keep it "axi", and just s/scan/bcmscan/. This is only correct choice if the rest (addressing, core enabling, host management) is AXI specific.

The specification for the AMBA AXI Interface is available for free download from ARM if you register to their website and accept their license:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.amba/index.html
I got it from there without any problems and the license does not look too bad for me, by having a quick look at it. I do not know if it will help you in any way or if it is completely unrelated.

Quoted 8 lines
Quoted 4 lines

Why is the existing support for the amba bus not extended or used in any way for this? It exists for some time in drivers/amba/. There already was a discussion about this in https://lkml.org/lkml/2011/3/30/186 , but with no result as I see.

I can see exactly nothing I could use from whatever driver/amba is. What does it do from things we need? How do you imagine using that with out (non)Broadcom buses?

1) I checked for amba_device_register:
http://lxr.free-electrons.com/ident?i=amba_device_register
and do not understand that. There are a lot of drivers registering some pre-defined devices. I could not find any driver scanning for amba devices and registering them. Are we going to be the first driver registering devices dynamically or do I get this totally wrong

2) amba_id contains only some interesting "id". How can we relate this with our core id/rev/manuf/class?

3) There is no code for managing AMBA cores (enable, checking status, disabling, resetting)...

That way I see really low (or not at all) relation between out (not)Broadcom bus and present AMBA bus.

Signature · 1 line
Rafa?
#30 lore raw
In reply to Hauke Mehrtens
Quoted 8 lines

The specification for the AMBA AXI Interface is available for free download from ARM if you register to their website and accept their license:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.amba/index.html
I got it from there without any problems and the license does not look too bad for me, by having a quick look at it. I do not know if it will help you in any way or if it is completely unrelated.

Quoted 4 lines

Why is the existing support for the amba bus not extended or used in any way for this? It exists for some time in drivers/amba/. There already was a discussion about this in https://lkml.org/lkml/2011/3/30/186 , but with no result as I see.

Existing AMBA bus might is the proper place to publish axi master port cores but Rafal's implementation manage those internally. Rafal introduces separate Broadcom-specific bus intended exclusively for Broadcom-specific devices management. Those devices share common identification/management techniques which are completely different from those implemented by other existant kernel buses and amba bus (at least at it current state) as well. Might be there are good and proper ways to extend amba bus driver to support axi as well but its a field for guys and girls confident with closed proprietary arm docs. Therefore IMHO the bus introduced by Rafal deserves its own driver and name. But I'm sure that the "axi" tag isn't good one for this bus.

Quoted 12 lines
Quoted 11 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Also can't figure out how is this implementation supposed to manage multicore devices.

We have got ideas, but let's first find (wait for) such a device ;)

bcm4716 usb host ? Don't really know if there are any other multicores.

This is SoC, we do not have any problems supporting multiple cores on SoCs. All cores are available at the same time, without any sliding windows.

Quoted 6 lines

Hauke
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Have nice day,
George

#18 lore raw
In reply to Rafał Miłecki
Quoted 111 lines

2011/4/12 Rafa? Mi?ecki <[email protected]>:

Quoted 93 lines

2011/4/12 Hauke Mehrtens <[email protected]>:

Quoted 92 lines

Hi Rafa?,

Quoted 77 lines · Rafa? Mi?ecki

2011/4/12 George Kashperko <[email protected]>:

Quoted 69 lines
Quoted 65 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 55 lines
Quoted 38 lines

Hi,

Quoted 20 lines · Rafa? Mi?ecki
Cc Michael B?sch <[email protected]>
Cc Larry Finger <[email protected]>
Cc George Kashperko <[email protected]>
Cc Arend van Spriel <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andy Botting <[email protected]>
Cc linuxdriverproject <[email protected]>
Cc linux-kernel at vger.kernel.org <[email protected]>

---
V2: Rename to axi
Use DEFINE_PCI_DEVICE_TABLE in bridge
Make use of pr_fmt and pr_*
Store core class
Rename bridge to not b43 specific
Replace magic 0x1000 with BCMAI_CORE_SIZE
Remove some old "ssb" names and defines
Move BCMAI_ADDR_BASE def

Quoted 8 lines

Add drvdata field
V3: Fix reloading (kfree issue)
Add 14e4:0x4331
Fix non-initialized struct issue
Drop useless inline functions wrappers for pci core drv Proper pr_* usage
V3.1: Include forgotten changes (pr_* and include related)
Explain why we dare to implement empty release function

I'm not sure we need this. If you have an IP Core which talks AXI and you want to put it on a PCI bus, you will have a PCI Bus wrapper around that IP Core, so you should go and let the kernel know about that. See
[1] for a core IP which talks AXI and [2] for a PCI bus glue layer.

Quoted 8 lines

Besides, if you introduce this bus layer, it'll be more difficult for other licensees of the same core to re-use the same driver, since it's now talking a PCI emulated on top of AXI. The same can be achieved with the platform_bus which is more widely used, specially on ARM SoCs.

[1] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/core.c
[2] http://gitorious.org/usb/usb/blobs/dwc3/drivers/usb/dwc3/dwc3-haps.c

Already noticed earlier that AXI isnt really good name for Broadcom-specific axi bus customization. As of tech docs available from arm, corelink AXI cores use own identification registers which feature different format and layout comparing to that we use for Broadcom cores.

Maybe there is something "standartized" by the DMP specs? If so I'm curious if that DMP is obligatory for every axi bus ?

Quoted 7 lines

Naming particular Broadcom's implementation just axi limits other licensees in reusing axi bus name/code or will require hacks/workarounds from them to fit Broadcom-like core scanning/identificating techniques. You use bus named AXI to group and manage Broadcom cores, while never even publish device records for native axi cores Broadcom use to talk to the interconnect through. Yet again, something like bcmb/bcmai looks like better name for this bus.

Quoted 4 lines

I don't know, I'm really tired of this. Earlier I was told to not use anything like bcmai, because it is not Broadcom specific. Now it seems (and I'm afraid I agree) there is quite a lot of Broadcom specific stuff.

Quoted 6 lines

Well, _if_ that "magic" EROM core layout is arm's "standard" for axi ports identification _and_ _if_ that EROM core is obligatory axi component then sure axi name is good one as soon as you consider registering master port (agent) cores with device subsystem as well. I have no clue here about how resolve those _if_'s, hopefully Broadcom guys can enlighten us on the subject.

Quoted 4 lines

Do you think that in my code only scanning is Broadcom specific? In such a case we could keep it "axi", and just s/scan/bcmscan/. This is only correct choice if the rest (addressing, core enabling, host management) is AXI specific.

The specification for the AMBA AXI Interface is available for free download from ARM if you register to their website and accept their license:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.amba/index.html
I got it from there without any problems and the license does not look too bad for me, by having a quick look at it. I do not know if it will help you in any way or if it is completely unrelated.

Quoted 8 lines
Quoted 4 lines

Why is the existing support for the amba bus not extended or used in any way for this? It exists for some time in drivers/amba/. There already was a discussion about this in https://lkml.org/lkml/2011/3/30/186 , but with no result as I see.

I can see exactly nothing I could use from whatever driver/amba is. What does it do from things we need? How do you imagine using that with out (non)Broadcom buses?

1) I checked for amba_device_register:
http://lxr.free-electrons.com/ident?i=amba_device_register
and do not understand that. There are a lot of drivers registering some pre-defined devices. I could not find any driver scanning for amba devices and registering them. Are we going to be the first driver registering devices dynamically or do I get this totally wrong

Quoted 2 lines

2) amba_id contains only some interesting "id". How can we relate this with our core id/rev/manuf/class?

I guess that id corresponds to corelink-compatible peripheral/component 4x8bit registers' layout.

Quoted 2 lines

3) There is no code for managing AMBA cores (enable, checking status, disabling, resetting)...

These could be of interest for DMP core driver if someone decide to publish agent cores on amba_bustype.

Quoted 4 lines

That way I see really low (or not at all) relation between out (not)Broadcom bus and present AMBA bus.

Agree.

Have nice day,

#19 lore raw

2011/4/12 George Kashperko <[email protected]>:

Quoted 5 lines
Quoted 4 lines

2011/4/12 Rafa? Mi?ecki <[email protected]>:
That way I see really low (or not at all) relation between out (not)Broadcom bus and present AMBA bus.

Agree.

Ehh, sounds like one more renaming to functions, defines, prefixes.

Let's wait for Arend comments, he was the one voting for not-bcm-specific name.

Signature · 1 line
Rafa?
#20 lore raw
Quoted 6 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 4 lines
Quoted 4 lines

2011/4/12 Rafa? Mi?ecki <[email protected]>:
That way I see really low (or not at all) relation between out (not)Broadcom bus and present AMBA bus.

Quoted 6 lines
Quoted 1 line

Agree.

Ehh, sounds like one more renaming to functions, defines, prefixes.

Let's wait for Arend comments, he was the one voting for not-bcm-specific name.

Sounds like good plan :)

Btw, while waiting.... Digging the web clearing different things around ssb/axi found few broadcom ssb docs some of you maybe find interesting to look through.
http://read.pudn.com/downloads127/doc/fileformat/537112/mips/bcm5836/5836-5836P-PG01-RDS.pdf
http://www.broadcom.com/collateral/pg/440X-PG02-R.pdf

Also, one more question to Arend:
could you please ask if there are any plans on lifting UNPUBLISHED PROPRIETARY for GMAC core driver sources (etcgmac.c, have this core at bcm4716-based ASUS N16, might used at other bcm471X socs as well) or possibly Broadcom could publish some doc for the chip?

Have nice day,
George

#21 lore raw

SDHCI pre-rootfs kernel oops problem...?

Hi everyone,

My Samsung S5PC100 target bootstraps zImage from a MicroSD card, but then kernel oopses if an mmc error happens just before the rootfs is mounted. Specifically, the output I'm getting looks like this:-

1 sdhci: Secure Digital Host Controller Interface driver
2 sdhci: Copyright(c) Pierre Ossman
3 s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133500000 Hz)
4 s3c-sdhci s3c-sdhci.0: clock source 2: sclk_mmc (66750000 Hz)
5 mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
6 Unable to handle kernel NULL pointer dereference at virtual address 00000000
7 pgd = c0004000
8 [00000000] *pgd=00000000
9 Internal error: Oops: 5 [#1]
10 (--etc--)

The precise sequence of events that triggers the problem seems to be:-
* sdhci_drv_init() is being called and is executing OK (lines 1-2 above)
* the sdhci clocks are being set up OK (lines 3-4 above)
* sdhci_add_host() is being called and is executing OK (line 5 above)
* sdhci_irq() gets triggered with SDHCI_INT_CMD_MASK (i.e. a command has arrived)
* sdhci_irq() calls sdhci_cmd_irq() to handle the command
* sdhci_cmd_irq() notices that there's a SDHCI_INT_TIMEOUT (i.e. a timeout error)
* sdhci_cmd_irq() schedules tasklet to call sdhci_tasklet_finish() later
* sdhci_cmd_irq() exits OK
* sdhci_irq() exits OK
* the kernel immediately crashes (lines 6-9 etc)
* curiously, sdhci_tasklet_finish() is not getting called at all.

This is on 2.6.38.1, but happened on previous builds too (I only today managed to isolate the problem). My best current guess is that this is happening because the bootstrap loader loads the kernel from the mmc card, and then not all the SDHCI / MMC registers in the SoC are getting cleared before the SDHCI is reinitialized for the kernel booting several seconds later (hence the timeout error bit being set, perhaps spuriously?)

Is this perhaps a known problem with other Samsung SDHCI drivers when booting from mmc? If so, what were the workarounds for them?

Any suggestions and pointers much appreciated!

Cheers, ....Nick Pelling....

PS: remainder of crash output appended below...

* * * * * * *

last sysfs file:

CPU: 0    Not tainted  (2.6.38.1 #69)
PC is at try_to_wake_up+0x20/0xa0
LR is at task_rq_lock.clone.89+0x20/0x2c
pc : [<c002f22c>]    lr : [<c002f200>]    psr: 20000193

sp : c0259ed0 ip : 00003f00 fp : c0259ef4
r10: 00000000 r9 : 412fc081 r8 : 0000000f
r7 : 00000000 r6 : 00000001 r5 : 00000001 r4 : 00000000 r3 : 00000001 r2 : 0000000f r1 : c02621a8 r0 : c02621a8
Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 10c5387d Table: 20004019 DAC: 00000015
Process swapper (pid: 0, stack limit = 0xc0258268)

Stack: (0xc0259ed0 to 0xc025a000)

9ec0: 412fc081 60000193 c78c7e28 c78c7c00
9ee0: 00000001 00000001 c78c7e28 00018101 00000000 c01c8404 00000000 00000001 9f00: 00000000 00000000 00000001 c7826c00 c0297300 c01d3600 00000000 c7862580 9f20: 00000000 00000000 0000005a 2001ba90 412fc081 00000000 00000000 c0059ac0 9f40: 00000001 c0266c68 c0266ca8 0000005a c7862580 c005b6c4 0000005a 00000000 9f60: 00000005 c025c000 2001ba90 c001f070 60000013 ffffffff f6000000 c001f9b4 9f80: c0269d30 00000000 c0259fc8 00000000 c025a16c c001d09c c03abd00 c025c000 9fa0: 2001ba90 412fc081 00000000 00000000 c7836044 c0259fc8 c002a8d0 c002a8d4 9fc0: 60000013 ffffffff c002a8b0 c0020f7c 00000000 c00089ac c000843c 00000cb0 9fe0: 20000100 c001d09c 10c53c7d c025a0c0 c001d098 20008034 00000000 00000000 [<c002f22c>] (try_to_wake_up+0x20/0xa0) from [<c01c8404>] (sdhci_irq+0x584/0x5d4)
[<c01c8404>] (sdhci_irq+0x584/0x5d4) from [<c0059ac0>] (handle_IRQ_event+0x24/0xe0)
[<c0059ac0>] (handle_IRQ_event+0x24/0xe0) from [<c005b6c4>] (handle_level_irq+0xbc/0x13c)
[<c005b6c4>] (handle_level_irq+0xbc/0x13c) from [<c001f070>] (asm_do_IRQ+0x70/0x94)
[<c001f070>] (asm_do_IRQ+0x70/0x94) from [<c001f9b4>] (__irq_svc+0x34/0xa0)

Exception stack(0xc0259f80 to 0xc0259fc8)

9f80: c0269d30 00000000 c0259fc8 00000000 c025a16c c001d09c c03abd00 c025c000 9fa0: 2001ba90 412fc081 00000000 00000000 c7836044 c0259fc8 c002a8d0 c002a8d4 9fc0: 60000013 ffffffff
[<c001f9b4>] (__irq_svc+0x34/0xa0) from [<c002a8d4>] (s5pc100_idle+0x24/0x28) [<c002a8d4>] (s5pc100_idle+0x24/0x28) from [<c0020f7c>] (cpu_idle+0x34/0x7c) [<c0020f7c>] (cpu_idle+0x34/0x7c) from [<c00089ac>] (start_kernel+0x254/0x2a8) [<c00089ac>] (start_kernel+0x254/0x2a8) from [<20008034>] (0x20008034)

Code: e1a08001 e1a07002 e24b0020 ebffffec (e5945000)

Then, about two seconds later, the following gets printk()ed - I'm not sure if it's connected or just a crash from an already crashed system, but here it is anyway:-

BUG: spinlock lockup on CPU#0, swapper/0, c02621a8
[<c0024c4c>] (unwind_backtrace+0x0/0xe0) from [<c0144b24>] 
(do_raw_spin_lock+0x10c/0x148)
[<c0144b24>] (do_raw_spin_lock+0x10c/0x148) from [<c0032304>] 
(scheduler_tick+0x18/0x188)
[<c0032304>] (scheduler_tick+0x18/0x188) from [<c003f804>] 
(update_process_times+0x3c/0x48)
[<c003f804>] (update_process_times+0x3c/0x48) from [<c002b4cc>] 
(s3c2410_timer_interrupt+0x8/0x10)
[<c002b4cc>] (s3c2410_timer_interrupt+0x8/0x10) from [<c0059ac0>] 
(handle_IRQ_event+0x24/0xe0)
[<c0059ac0>] (handle_IRQ_event+0x24/0xe0) from [<c005b6c4>] 
(handle_level_irq+0xbc/0x13c)
[<c005b6c4>] (handle_level_irq+0xbc/0x13c) from [<c002c5dc>] 
(s3c_irq_demux_vic_timer+0x20/0x24)
[<c002c5dc>] (s3c_irq_demux_vic_timer+0x20/0x24) from [<c001f070>] 
(asm_do_IRQ+0x70/0x94)
[<c001f070>] (asm_do_IRQ+0x70/0x94) from [<c001f9b4>] (__irq_svc+0x34/0xa0)
Exception stack(0xc0259d38 to 0xc0259d80)

9d20: c025c1f4 c0276c8c
9d40: c025b310 00000001 c0259e88 c025b310 c0258268 00000000 00000005 00000001 9d60: 00000000 c0259ef4 00003f00 c0259d80 c01d3600 c01d3604 60000113 ffffffff [<c001f9b4>] (__irq_svc+0x34/0xa0) from [<c01d3604>] (_raw_spin_unlock_irq+0xc/0x10)
[<c01d3604>] (_raw_spin_unlock_irq+0xc/0x10) from [<c0023680>] (die+0x138/0x1b8)
[<c0023680>] (die+0x138/0x1b8) from [<c0025bfc>] (__do_kernel_fault+0x64/0x84) [<c0025bfc>] (__do_kernel_fault+0x64/0x84) from [<c0025de4>] (do_page_fault+0x1c8/0x1e0)
[<c0025de4>] (do_page_fault+0x1c8/0x1e0) from [<c001f23c>] (do_DataAbort+0x30/0x98)
[<c001f23c>] (do_DataAbort+0x30/0x98) from [<c001f96c>] (__dabt_svc+0x4c/0x60)

Exception stack(0xc0259e88 to 0xc0259ed0)

9e80: c02621a8 c02621a8 0000000f 00000001 00000000 00000001
9ea0: 00000001 00000000 0000000f 412fc081 00000000 c0259ef4 00003f00 c0259ed0 9ec0: c002f200 c002f22c 20000193 ffffffff
[<c001f96c>] (__dabt_svc+0x4c/0x60) from [<c002f22c>] (try_to_wake_up+0x20/0xa0)
[<c002f22c>] (try_to_wake_up+0x20/0xa0) from [<c01c8404>] (sdhci_irq+0x584/0x5d4)
[<c01c8404>] (sdhci_irq+0x584/0x5d4) from [<c0059ac0>] (handle_IRQ_event+0x24/0xe0)
[<c0059ac0>] (handle_IRQ_event+0x24/0xe0) from [<c005b6c4>] (handle_level_irq+0xbc/0x13c)
[<c005b6c4>] (handle_level_irq+0xbc/0x13c) from [<c001f070>] (asm_do_IRQ+0x70/0x94)
[<c001f070>] (asm_do_IRQ+0x70/0x94) from [<c001f9b4>] (__irq_svc+0x34/0xa0)

Exception stack(0xc0259f80 to 0xc0259fc8)

9f80: c0269d30 00000000 c0259fc8 00000000 c025a16c c001d09c c03abd00 c025c000 9fa0: 2001ba90 412fc081 00000000 00000000 c7836044 c0259fc8 c002a8d0 c002a8d4 9fc0: 60000013 ffffffff
[<c001f9b4>] (__irq_svc+0x34/0xa0) from [<c002a8d4>] (s5pc100_idle+0x24/0x28) [<c002a8d4>] (s5pc100_idle+0x24/0x28) from [<c0020f7c>] (cpu_idle+0x34/0x7c) [<c0020f7c>] (cpu_idle+0x34/0x7c) from [<c00089ac>] (start_kernel+0x254/0x2a8) [<c00089ac>] (start_kernel+0x254/0x2a8) from [<20008034>] (0x20008034)

#22 lore raw
In reply to Rafał Miłecki
Quoted 5 lines · Rafa? Mi?ecki

2011/4/12 George Kashperko <[email protected]>:

Quoted 4 lines
Quoted 4 lines

2011/4/12 Rafa? Mi?ecki <[email protected]>:
That way I see really low (or not at all) relation between out (not)Broadcom bus and present AMBA bus.

Quoted 7 lines
Quoted 1 line

Agree.

Ehh, sounds like one more renaming to functions, defines, prefixes.

Let's wait for Arend comments, he was the one voting for not-bcm-specific name.

Hi Rafa?,

Still think its better to stick with a generic name even if currently you only come across this in Broadcom chips right now. I do agree that the term 'axi' is implying something else than what this bus driver is providing. The name 'axi-dmp' I gave earlier may be more to the point.

I also looked at the amba driver after receiving comments on the brcmaxi library module (this is what Hauke Mehrtens referred to) and came to similar conclusion as you did. It does however support PM properly so you may want to get inspiration in that area. I also noticed a reference to AMBA term APB which is a different bus in the AMBA family. AXI was introduced later as higher performance bus (in AMBA rev3 if I remember correctly).

Gr. AvS

Signature · 1 line
"The world is indeed comic, but the joke is on mankind." ? H.P. Lovecraft
#23 lore raw

2011/4/13 Arend van Spriel <[email protected]>:

Quoted 23 lines · Rafa? Mi?ecki
Quoted 7 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 5 lines
Quoted 5 lines

2011/4/12 Rafa? Mi?ecki <[email protected]>:
That way I see really low (or not at all) relation between out (not)Broadcom bus and present AMBA bus.

Quoted 7 lines
Quoted 1 line

Agree.

Ehh, sounds like one more renaming to functions, defines, prefixes.

Let's wait for Arend comments, he was the one voting for not-bcm-specific name.

Hi Rafa?,

Still think its better to stick with a generic name even if currently you only come across this in Broadcom chips right now. I do agree that the term 'axi' is implying something else than what this bus driver is providing. The name 'axi-dmp' I gave earlier may be more to the point.

Quoted 6 lines

I also looked at the amba driver after receiving comments on the brcmaxi library module (this is what Hauke Mehrtens referred to) and came to similar conclusion as you did. It does however support PM properly so you may want to get inspiration in that area. I also noticed a reference to AMBA term APB which is a different bus in the AMBA family. AXI was introduced later as higher performance bus (in AMBA rev3 if I remember correctly).

I don't focus on PM yet, do not consider it a problem, it just needs some time.

Note for not involved: AMBA is family with few buses/interfaces
possible: AXI, AHB, ASB, APB, ATB [1].

So what are you saying is that drivers/amba/ is for AMBA APB? OK, I can accept such a explanation and it makes me even more sure we need another AMBA driver (this time: AMBA AXI).

The left question is: how much of the implemented code is AMBA AXI specific and how much is Broadcom specific?
1) Does AMBA AXI identify cores by manuf, id, rev and class? Is this really AMBA AXI specific and a evolution from simple "id" in AMBA APB?
2) Is this standard for AMBA AXI to keep list of available cores in some specific memory (is this always EPROM like in case of Bcm?)?
3) Does every AMBA AXI device need enabling/disabling/resetting routine we implemented? Is that really Bcm independent?

This is mostly what I already asked, but didn't get answer. Please, explain to us what is AMBA AXI specific and what is Broadcom specific.

[1] http://en.wikipedia.org/wiki/Advanced_Microcontroller_Bus_Architecture

Signature · 1 line
Rafa?
#24 lore raw
Quoted 32 lines

2011/4/13 Arend van Spriel <[email protected]>:

Quoted 23 lines · Rafa? Mi?ecki
Quoted 7 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 5 lines
Quoted 5 lines

2011/4/12 Rafa? Mi?ecki <[email protected]>:
That way I see really low (or not at all) relation between out (not)Broadcom bus and present AMBA bus.

Quoted 7 lines
Quoted 1 line

Agree.

Ehh, sounds like one more renaming to functions, defines, prefixes.

Let's wait for Arend comments, he was the one voting for not-bcm-specific name.

Hi Rafa?,

Still think its better to stick with a generic name even if currently you only come across this in Broadcom chips right now. I do agree that the term 'axi' is implying something else than what this bus driver is providing. The name 'axi-dmp' I gave earlier may be more to the point.

Quoted 6 lines

I also looked at the amba driver after receiving comments on the brcmaxi library module (this is what Hauke Mehrtens referred to) and came to similar conclusion as you did. It does however support PM properly so you may want to get inspiration in that area. I also noticed a reference to AMBA term APB which is a different bus in the AMBA family. AXI was introduced later as higher performance bus (in AMBA rev3 if I remember correctly).

Quoted 8 lines

I don't focus on PM yet, do not consider it a problem, it just needs some time.

Note for not involved: AMBA is family with few buses/interfaces
possible: AXI, AHB, ASB, APB, ATB [1].

So what are you saying is that drivers/amba/ is for AMBA APB? OK, I can accept such a explanation and it makes me even more sure we need another AMBA driver (this time: AMBA AXI).

AMBA is AMBA. axi/apb/ahb etc are all subsets of AMBA and as of current all fit to what already is in drivers/amba.

Quoted 3 lines

The left question is: how much of the implemented code is AMBA AXI specific and how much is Broadcom specific?

Answers to 1. and 2. are there in drivers/amba/bus.c Look _probe and _register fn for more details.

Quoted 2 lines

1) Does AMBA AXI identify cores by manuf, id, rev and class? Is this really AMBA AXI specific and a evolution from simple "id" in AMBA APB?

During amba device registration amba bus code read component/peripheral id registers from known locations, exactly where peripherialid/componentid registers of master port (agent) core are. Look brcm80211/inclue/aidmp.h for those.

Quoted 4 lines

2) Is this standard for AMBA AXI to keep list of available cores in some specific memory (is this always EPROM like in case of Bcm?)?
3) Does every AMBA AXI device need enabling/disabling/resetting routine we implemented? Is that really Bcm independent?

Enable/disable abstracted by clocks interface.

It would be really great if someone could enligten us on 2).

Quoted 5 lines

This is mostly what I already asked, but didn't get answer. Please, explain to us what is AMBA AXI specific and what is Broadcom specific.

[1] http://en.wikipedia.org/wiki/Advanced_Microcontroller_Bus_Architecture

Have nice day,
George

#29 lore raw
In reply to Rafał Miłecki
Quoted 6 lines · Rafa? Mi?ecki

Note for not involved: AMBA is family with few buses/interfaces
possible: AXI, AHB, ASB, APB, ATB [1].

So what are you saying is that drivers/amba/ is for AMBA APB? OK, I can accept such a explanation and it makes me even more sure we need another AMBA driver (this time: AMBA AXI).

I believe the drivers/amba code is mainly (only?) for ARM PrimeCell cores which all include identification information at the end of their memory maps. There are PrimeCell cores available for most if not all AMBA bus interfaces.

Non-primecell cores might not have such identification, and therefore would not be usable with drivers/amba. They are generally used with the platform bus.

Quoted 6 lines

The left question is: how much of the implemented code is AMBA AXI specific and how much is Broadcom specific?
1) Does AMBA AXI identify cores by manuf, id, rev and class? Is this really AMBA AXI specific and a evolution from simple "id" in AMBA APB?
2) Is this standard for AMBA AXI to keep list of available cores in some specific memory (is this always EPROM like in case of Bcm?)?

I don't believe AXI (the physical bus) nor any other AMBA bus interface provides any mechanism whatsoever for device identification or enumeration.

Signature · 1 line
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
#25 lore raw
In reply to George Kashperko

2011/4/13 George Kashperko <[email protected]>:

Quoted 44 lines
Quoted 32 lines

2011/4/13 Arend van Spriel <[email protected]>:

Quoted 23 lines · Rafa? Mi?ecki
Quoted 7 lines

2011/4/12 George Kashperko <[email protected]>:

Quoted 5 lines
Quoted 5 lines

2011/4/12 Rafa? Mi?ecki <[email protected]>:
That way I see really low (or not at all) relation between out (not)Broadcom bus and present AMBA bus.

Quoted 7 lines
Quoted 1 line

Agree.

Ehh, sounds like one more renaming to functions, defines, prefixes.

Let's wait for Arend comments, he was the one voting for not-bcm-specific name.

Hi Rafa?,

Still think its better to stick with a generic name even if currently you only come across this in Broadcom chips right now. I do agree that the term 'axi' is implying something else than what this bus driver is providing. The name 'axi-dmp' I gave earlier may be more to the point.

Quoted 6 lines

I also looked at the amba driver after receiving comments on the brcmaxi library module (this is what Hauke Mehrtens referred to) and came to similar conclusion as you did. It does however support PM properly so you may want to get inspiration in that area. I also noticed a reference to AMBA term APB which is a different bus in the AMBA family. AXI was introduced later as higher performance bus (in AMBA rev3 if I remember correctly).

Quoted 8 lines

I don't focus on PM yet, do not consider it a problem, it just needs some time.

Note for not involved: AMBA is family with few buses/interfaces
possible: AXI, AHB, ASB, APB, ATB [1].

So what are you saying is that drivers/amba/ is for AMBA APB? OK, I can accept such a explanation and it makes me even more sure we need another AMBA driver (this time: AMBA AXI).

AMBA is AMBA. axi/apb/ahb etc are all subsets of AMBA and as of current all fit to what already is in drivers/amba.

Quoted 1 line
Quoted 5 lines
Quoted 2 lines

The left question is: how much of the implemented code is AMBA AXI specific and how much is Broadcom specific?

Answers to 1. and 2. are there in drivers/amba/bus.c Look _probe and _register fn for more details.

Not able to. There is some call to amba_get_enable_vcore in probe. It calls regulator_enable. Which calls some rdev->desc->ops->enable(rdev). I managed to track enable is part of struct regulator_ops but I'm not brave enough to track where does it come from, etc. There are many documented regulator ops, but not general description. I would have to spend some time on it but I'm not sure if it's worth that. Not to mention there is some additional amba_get_enable_pclk which calls some more functions I didn't date to check.

Quoted 6 lines
Quoted 2 lines

1) Does AMBA AXI identify cores by manuf, id, rev and class? Is this really AMBA AXI specific and a evolution from simple "id" in AMBA APB?

During amba device registration amba bus code read component/peripheral id registers from known locations, exactly where peripherialid/componentid registers of master port (agent) core are. Look brcm80211/inclue/aidmp.h for those.

I guess you mean:
pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) << (i * 8); cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) << (i * 8); Well, OK, it proves Broadcom uses AMBA somehow, but not more than that (at least for me).

Quoted 5 lines
Quoted 4 lines

2) Is this standard for AMBA AXI to keep list of available cores in some specific memory (is this always EPROM like in case of Bcm?)?
3) Does every AMBA AXI device need enabling/disabling/resetting routine we implemented? Is that really Bcm independent?

Enable/disable abstracted by clocks interface.

Will comment on that later.

Signature · 1 line
Rafa?
#26 lore raw

2011/4/13 Rafa? Mi?ecki <[email protected]>:

Quoted 1 line

Will comment on that later.

Can we try to decide, how to implement our driver correctly? This should be main focus for now. I tried to analyze drivers/amba/, how it works, how it relates to our code, Broadcom.

AFAICS AMBA so far is mostly (always?) used for embedded devices with pre-defined hardware layout. Let's take as example mach-u300 (just some random one). One of the amba_devices it registers is uart0_device which has two interesting fields:
.start = U300_UART0_BASE,
.end = U300_UART0_BASE + SZ_4K - 1,
U300_UART0_BASE == (U300_SLOW_PER_PHYS_BASE+0x3000) == 0xc0013000 So this mach-u300 is well-specified device, every mach-u300 has uart0 at 0xc0013000.

It looks every AMBA device (like uart0) has some common fields, like:
u32 peripherialid0, peripherialid1, peripherialid2, peripherialid3; u32 componentid0, componentid1, componentid2, componentid3;

I believe Broadcom's *agent* AKA *wrapper* is comparable to standard amba device.

Of course agents/wrappers are not the same for every Broadcom AMBA AXI card, so we can not use strict .start and .end declarations and the same agents/wrappers for every card. Instead, we have to do scanning of EPROM to read info about agents/wrappers.

If someone does not know: every core on Broadcom AMBA AXI card has it's agent/wrapper. We access agent/wrapper registers to enable/disable/reset core.

So we could scan EPROM for agents/wrappers, register them in AMBA driver using our *_core_enable as AMBA's clock management.

Please verify if my understanding is correct. I tried to explain easily whole situation I just analyzed.

If I'm right: is this really the right path to follow? What about real core, like PCIe core, or IEEE core? I guess they are not standard AMBA cores, so we can not simply register them. Should we look for clever way to connect everything we have with drivers/amba? How to connect "real" cores (PCIe, IEEE) with agents?

Please, share how do you see this situation now.

Signature · 1 line
Rafa?
#27 lore raw

2011/4/13 Rafa? Mi?ecki <[email protected]>:

Quoted 40 lines

2011/4/13 Rafa? Mi?ecki <[email protected]>:

Quoted 1 line

Will comment on that later.

Can we try to decide, how to implement our driver correctly? This should be main focus for now. I tried to analyze drivers/amba/, how it works, how it relates to our code, Broadcom.

AFAICS AMBA so far is mostly (always?) used for embedded devices with pre-defined hardware layout. Let's take as example mach-u300 (just some random one). One of the amba_devices it registers is uart0_device which has two interesting fields:
.start = U300_UART0_BASE,
.end ? = U300_UART0_BASE + SZ_4K - 1,
U300_UART0_BASE == (U300_SLOW_PER_PHYS_BASE+0x3000) == 0xc0013000 So this mach-u300 is well-specified device, every mach-u300 has uart0 at 0xc0013000.

It looks every AMBA device (like uart0) has some common fields, like:
u32 peripherialid0, peripherialid1, peripherialid2, peripherialid3; u32 componentid0, componentid1, componentid2, componentid3;

I believe Broadcom's *agent* AKA *wrapper* is comparable to standard amba device.

Of course agents/wrappers are not the same for every Broadcom AMBA AXI card, so we can not use strict .start and .end declarations and the same agents/wrappers for every card. Instead, we have to do scanning of EPROM to read info about agents/wrappers.

If someone does not know: every core on Broadcom AMBA AXI card has it's agent/wrapper. We access agent/wrapper registers to enable/disable/reset core.

So we could scan EPROM for agents/wrappers, register them in AMBA driver using our *_core_enable as AMBA's clock management.

Please verify if my understanding is correct. I tried to explain easily whole situation I just analyzed.

Quoted 7 lines

If I'm right: is this really the right path to follow? What about real core, like PCIe core, or IEEE core? I guess they are not standard AMBA cores, so we can not simply register them. Should we look for clever way to connect everything we have with drivers/amba? How to connect "real" cores (PCIe, IEEE) with agents?

Please, share how do you see this situation now.

I've done a little more thinking & investigation on this.

First of all, our agent/wrapper cores are real AMBA components. I've done such a reading:
pr_info("XXX wrapper AXI_PERIPHERIALID0 0x%08X\n", axi_aread32(core, AXI_PERIPHERIALID0));
pr_info("XXX wrapper AXI_COMPONENTID0 0x%08X\n", axi_aread32(core, AXI_COMPONENTID0));
for every agent/wrapper.

The result was:

[  362.720551] axi: Switched to core: 0x800
[  362.720519] axi: CC wrapper AXI_PERIPHERIALID0 0x00000069
[  362.720523] axi: CC wrapper AXI_PERIPHERIALID1 0x000000B3
[  362.720527] axi: CC wrapper AXI_PERIPHERIALID2 0x0000003B
[  362.720531] axi: CC wrapper AXI_PERIPHERIALID3 0x00000010
[  362.720535] axi: CC wrapper AXI_COMPONENTID0 0x0000000D
[  362.720539] axi: CC wrapper AXI_COMPONENTID1 0x000000F0
[  362.720542] axi: CC wrapper AXI_COMPONENTID2 0x00000005
[  362.720546] axi: CC wrapper AXI_COMPONENTID3 0x000000B1
[  362.720551] axi: Switched to core: 0x820
[  362.728037] axi: PCIE wrapper AXI_PERIPHERIALID0 0x00000069
[  362.728041] axi: PCIE wrapper AXI_PERIPHERIALID1 0x000000B3
[  362.728045] axi: PCIE wrapper AXI_PERIPHERIALID2 0x0000003B
[  362.728049] axi: PCIE wrapper AXI_PERIPHERIALID3 0x00000010
[  362.728053] axi: PCIE wrapper AXI_COMPONENTID0 0x0000000D
[  362.728056] axi: PCIE wrapper AXI_COMPONENTID1 0x000000F0
[  362.728060] axi: PCIE wrapper AXI_COMPONENTID2 0x00000005
[  362.728064] axi: PCIE wrapper AXI_COMPONENTID3 0x000000B1
[  362.728068] axi: Switched to core: 0x812
[  362.728076] axi: 80211 wrapper AXI_PERIPHERIALID0 0x00000069
[  362.728079] axi: 80211 wrapper AXI_PERIPHERIALID1 0x000000B3
[  362.728083] axi: 80211 wrapper AXI_PERIPHERIALID2 0x0000003B
[  362.728087] axi: 80211 wrapper AXI_PERIPHERIALID3 0x00000010
[  362.728091] axi: 80211 wrapper AXI_COMPONENTID0 0x0000000D
[  362.728095] axi: 80211 wrapper AXI_COMPONENTID1 0x000000F0
[  362.728098] axi: 80211 wrapper AXI_COMPONENTID2 0x00000005
[  362.728102] axi: 80211 wrapper AXI_COMPONENTID3 0x000000B1

Tip:
#define AMBA_CID 0xb105f00d

*So*:
1) We could read info about existing agents/wrappers from EPROM and register them as amba_devices
2) We could register amba_driver for id 0x103BB369
3) We could register our core-managing functions as clock operators

Problem:
b43 can not be our amba_driver, because this is not the correct layer. We would need to create separated amba_driver driver for 0x103BB369, initializing whole stuff (PCIe core, ChipCommon, ChipCommon PMU) *and* registering new kind of device in the system, identified by manuf, id, rev and class. That devices would be of course Broadcom cores present on AMBA, but not AMBA-compatible (not wrappers, they are real AMBA devices!).

I've also try treating Broadcom cores (not wrappers, which are real AMBA devices!) as AMBA devices. For that I've tried:
pr_info("80211 AXI_PERIPHERIALID0 0x%08X\n", axi_read32(core, AXI_PERIPHERIALID0));
Please, note, that this time I used "read32", not "aread32". It means I was accessing Broadcom core, not AMBA agent/wrapper core. This operation hanger my machine right away.

Signature · 1 line
Rafa?