diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2008-03-26 22:00:38 (GMT) |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2008-04-08 07:58:32 (GMT) |
commit | 2a2fa797e63b1e3cd4d570318ca5fbf8723ef53a (patch) | |
tree | 0507d85576ec9356290c9d655cbdee73ffb51eea /cpu | |
parent | 1e9a164e22976933002c5e4b0b79b09fcede9cd4 (diff) | |
download | u-boot-2a2fa797e63b1e3cd4d570318ca5fbf8723ef53a.tar.xz |
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 <daniel@gaisler.com>
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/leon3/ambapp.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cpu/leon3/ambapp.c b/cpu/leon3/ambapp.c index 60ff1a2..efd41ae 100644 --- a/cpu/leon3/ambapp.c +++ b/cpu/leon3/ambapp.c @@ -28,6 +28,14 @@ #include <command.h> #include <ambapp.h> +#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))) { |