diff options
author | Avik Sil <aviksil@linux.vnet.ibm.com> | 2013-09-23 14:07:35 +0530 |
---|---|---|
committer | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-10-04 11:58:51 +0530 |
commit | 89dee020cfc6101125c5f558e6e1e844f5cef129 (patch) | |
tree | 2e1caab96233c605d95b9fadb805c610dedff923 /slof/helpers.c | |
parent | 43ba6e5c7faa2bf7ca202279ebbd4be3575bdf0a (diff) | |
download | SLOF-89dee020cfc6101125c5f558e6e1e844f5cef129.zip SLOF-89dee020cfc6101125c5f558e6e1e844f5cef129.tar.gz SLOF-89dee020cfc6101125c5f558e6e1e844f5cef129.tar.bz2 |
Add SLOF pci wrapper functions
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'slof/helpers.c')
-rw-r--r-- | slof/helpers.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/slof/helpers.c b/slof/helpers.c index 564052f..cee8729 100644 --- a/slof/helpers.c +++ b/slof/helpers.c @@ -93,3 +93,38 @@ void SLOF_dma_map_out(long phys, void *virt, long size) forth_push(size); forth_eval("dma-map-out"); } + +long SLOF_pci_config_read32(long offset) +{ + forth_push(offset); + forth_eval("config-l@"); + return forth_pop(); +} + +long SLOF_pci_config_read16(long offset) +{ + forth_push(offset); + forth_eval("config-w@"); + return forth_pop(); +} + +void SLOF_pci_config_write32(long offset, long value) +{ + forth_push(value); + forth_push(offset); + forth_eval("config-l!"); +} + +void SLOF_pci_config_write16(long offset, long value) +{ + forth_push(value); + forth_push(offset); + forth_eval("config-w!"); +} + +void *SLOF_translate_my_address(void *addr) +{ + forth_push((long)addr); + forth_eval("translate-my-address"); + return (void *)forth_pop(); +} |