From 2a2fa797e63b1e3cd4d570318ca5fbf8723ef53a Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Wed, 26 Mar 2008 23:00:38 +0100 Subject: SPARC/LEON3: Added AMBA Bus Plug&Play information print command (ambapp). It can print available cores (type: AHB Master, AHB Slave, APB Slave), their address ranges, IRQ number and version. Signed-off-by: Daniel Hellstrom --- cpu/leon3/ambapp.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cpu') diff --git a/cpu/leon3/ambapp.c b/cpu/leon3/ambapp.c index 60ff1a2aef..efd41ae0a8 100644 --- a/cpu/leon3/ambapp.c +++ b/cpu/leon3/ambapp.c @@ -28,6 +28,14 @@ #include #include +#if defined(CONFIG_CMD_AMBAPP) +extern void ambapp_print_apb(apbctrl_pp_dev * apb, + ambapp_ahbdev * apbmst, int index); +extern void ambapp_print_ahb(ahbctrl_pp_dev * ahb, int index); +extern int ambapp_apb_print; +extern int ambapp_ahb_print; +#endif + static int ambapp_apb_scan(unsigned int vendor, /* Plug&Play Vendor ID */ unsigned int driver, /* Plug&Play Device ID */ ambapp_apbdev * dev, /* Result(s) is placed here */ @@ -58,6 +66,12 @@ static int ambapp_apb_scan(unsigned int vendor, /* Plug&Play Vendor ID */ apb = (apbctrl_pp_dev *) (apbmst_base | LEON3_CONF_AREA); for (i = 0; i < LEON3_APB_SLAVES; i++) { +#if defined(CONFIG_CMD_AMBAPP) + if (ambapp_apb_print && amba_vendor(apb->conf) + && amba_device(apb->conf)) { + ambapp_print_apb(apb, &apbmst, i); + } +#endif if ((amba_vendor(apb->conf) == vendor) && (amba_device(apb->conf) == driver) && ((index < 0) || (index-- == 0))) { @@ -192,6 +206,12 @@ static int ambapp_ahb_scan(unsigned int vendor, /* Plug&Play Vendor ID */ } for (i = 0; i < max_pp_devs; i++) { +#if defined(CONFIG_CMD_AMBAPP) + if (ambapp_ahb_print && amba_vendor(ahb->conf) && + amba_device(ahb->conf)) { + ambapp_print_ahb(ahb, i); + } +#endif if ((amba_vendor(ahb->conf) == vendor) && (amba_device(ahb->conf) == driver) && ((index < 0) || (index-- == 0))) { -- cgit v1.2.1