[SLOF] [PATCH v2 01/19] pci: add byte read/write helper routines

Thomas Huth thuth at redhat.com
Wed Jan 20 23:27:45 AEDT 2016


On 20.01.2016 13:10, Nikunj A Dadhania wrote:
> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
> ---
>  include/helpers.h |  2 ++
>  slof/helpers.c    | 14 ++++++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/include/helpers.h b/include/helpers.h
> index fb10534..5b3d711 100644
> --- a/include/helpers.h
> +++ b/include/helpers.h
> @@ -30,8 +30,10 @@ extern long SLOF_dma_map_in(void *virt, long size, int cacheable);
>  extern void SLOF_dma_map_out(long phys, void *virt, long size);
>  extern long SLOF_pci_config_read32(long offset);
>  extern long SLOF_pci_config_read16(long offset);
> +extern long SLOF_pci_config_read8(long offset);
>  extern void SLOF_pci_config_write32(long offset, long value);
>  extern void SLOF_pci_config_write16(long offset, long value);
> +extern void SLOF_pci_config_write8(long offset, long value);
>  extern void *SLOF_translate_my_address(void *addr);
>  
>  #define offset_of(type, member) ((long) &((type *)0)->member)
> diff --git a/slof/helpers.c b/slof/helpers.c
> index d7c1888..48c34a6 100644
> --- a/slof/helpers.c
> +++ b/slof/helpers.c
> @@ -114,6 +114,13 @@ long SLOF_pci_config_read16(long offset)
>  	return forth_pop();
>  }
>  
> +long SLOF_pci_config_read8(long offset)
> +{
> +	forth_push(offset);
> +	forth_eval("config-b@");
> +	return forth_pop();
> +}
> +
>  void SLOF_pci_config_write32(long offset, long value)
>  {
>  	forth_push(value);
> @@ -128,6 +135,13 @@ void SLOF_pci_config_write16(long offset, long value)
>  	forth_eval("config-w!");
>  }
>  
> +void SLOF_pci_config_write8(long offset, long value)
> +{
> +	forth_push(value);
> +	forth_push(offset);
> +	forth_eval("config-b!");
> +}
> +
>  void *SLOF_translate_my_address(void *addr)
>  {
>  	forth_push((long)addr);

Reviewed-by: Thomas Huth <thuth at redhat.com>




More information about the SLOF mailing list