################################################################################
#
# SPI configuration file
#
# This file (or one similar) can be used to configure the SPI bus and devices
# for SPI driver. It is utilized by specifying it as the parameter to the '-c='
# command line option.
#
# Parameters and their acceptable values are described below. Parameter names
# are (typically) case invariant.
#
# The file is separated into sections. Each section describes the parameters
# which can be set. Each section is started with a [<section type>] declaration.
# All parameters after the [<section type>] declaration and upto the next
# [<section type>] declaration (or end-of-file) will be treated as belonging to
# the section. The [] character sequence should not be used in any non-commented
# section elsewhere in the file.
#
# For the purpose of documentation, all parameters are included in this file
# along with their default values. These are left commented out with '##'.
# Changes should be made by copying the line and changing the value. That way
# the default value is always known.
#
# All text following a '#' until the end-of-line will be treated as a comment.
#
# White space is ignored unless otherwise stated.
#
# Rules for the config file:
#
# 1. Only alphanumeric characters are allowed for section name
# 2. Only alphanumeric characters and '_' are allowed for parameter name
# 3. Must have at least one bus section in each config file
# 4. Must have at least one device section under each bus
# 5. In each bus section, all the mandatory parameters must be set
# 6. In each bus section, bus number and bus name can not duplicate
# 7. In each dev section, all the mandatory parameters must be set
# 8. Under the same parent bus, dev number and dev name can not duplicate
# 9. In each dev section, the parent_busno has to be a existing busno in previous bus sections
#
#
# The following known sections are currently defined:
#
# [globals]
# [bus]
# [dev]
#
#############################  S E C T I O N  ##################################
# Section globals
# Parameters:
# verbose: verbosity. Default 2.(Optional)
#          The "-v" command-line option will override the "verbose" value in the config file.
[globals]


#############################  S E C T I O N  ##################################
# Section bus
# Parameters:
# busno:       bus no. (Mandatory)
# name:        bus name. (Mandatory)
# base:        bus base address. (Mandatory)
# irq:         bus irq num. (Mandatory)
# input_clock: bus input clock. (Mandatory)
# bs:          board/controller specific parameters. (Optional)
# dma_init_opts:    DMA init options. Used by dma_funcs.init. Default NULL. (Optional)
# dma_attach_opts:  DMA attach options. Used by dma_funcs.channel_attach. Default NULL. (Optional)
# dma_thld:         DMA threshold. Default 0. (Optional)
#
[bus]
busno=0
name=spi0
base=0xfe204000
irq=150
input_clock=500000000
bs=rpanic=48,tpanic=16
dma_attach_opts=num_cbs=256,range_min=0,range_max=14,typed_mem=sysram&below1G
dma_thld=4

#############################  S E C T I O N  ##################################
# Section dev
# Parameters:
# parent_busno: parent bus no. (Mandatory)
# devno:        device no. (Mandatory)
# name:         device name. (Mandatory)
# clock_rate:   bus speed for this device. (Mandatory)
# cpha:         SPI CPHA. 0 or 1. Default 0.(Optional)
# cpol:         SPI CPOL. 0 or 1. Default 0.(Optional)
# bit_order:    SPI bit order. MSB or LSB. Case insensitive. Default MSB.(Optional)
# word_width:   SPI transfer word width in bits. 8, 16 or 32. Default 8.(Optional)
# idle_insert:  SPI idle insertion support. 0 or 1. Default 0. (Optional)
#
# NOTE:
# Section dev has to be after its parent bus section and has to provide its
# parent_busno. Otherwise this dev section won't be added to devlist.
#
[dev]
parent_busno=0
devno=0
name=dev0
clock_rate=5000000
cpha=1
word_width=32
idle_insert=1

#############################  S E C T I O N  ##################################
# Section dev
#
[dev]
parent_busno=0
devno=1
name=dev1
clock_rate=5000000
cpol=1
word_width=32

#############################  S E C T I O N  ##################################
# Section bus
#
[bus]
busno=3
name=spi3
base=0xfe204600
irq=151
input_clock=500000000

#############################  S E C T I O N  ##################################
# Section dev
#
[dev]
parent_busno=3
devno=0
name=dev0
clock_rate=5000000
cpol=1

