Kconfig: use named pins for SD select and enable signals.

This commit is contained in:
Serge Vakulenko
2015-09-08 22:17:10 -07:00
parent c631ae5d43
commit 355ad339ef
28 changed files with 277 additions and 251 deletions

View File

@@ -49,25 +49,26 @@ controller spi4 # SD card
# sdcard's definition for the SPI port, sdcard's chipselect and high-side power switch
# because of a mod on the board we use power=B13, otherwise it shall be D12
disk sd0 at spi4 flags 0x63 # select pin RF3
device sd0 at spi4
pins RF3, RB13 # select pin, enable pin
options "SD0_MHZ=10" # speed 10 MHz
options "SD0_PORT=4" # at spi4 TODO: delete
options "SD0_CS_PORT=TRISF" # for chip select... TODO: use flags
options "SD0_CS_PIN=3" # ...use pin RF3 TODO: use flags
options "SD0_ENA_PORT=TRISB" # for microSD enable... TODO: use flags
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: use flags
options "SD0_CS_PORT=TRISF" # for chip select... TODO: delete
options "SD0_CS_PIN=3" # ...use pin RF3 TODO: delete
options "SD0_ENA_PORT=TRISB" # for microSD enable... TODO: delete
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm
# Use SDRAM driver for the external ramdisk
disk sdramp0 # SDRAM on external memory bus
device sdramp0 # SDRAM on external memory bus
options "KERNEL_EXECUTABLE_RAM" # allow kernel code in RAM area
# This defines the swap size and a fs partition size on the external ramdisk.

View File

@@ -86,13 +86,14 @@ options "CONSOLE_DEVICE=tty0" # /dev/tty0
controller spi2 # SD card
# microSD card
disk sd0 at spi2 flags 0x3e # select pin RC14
device sd0 at spi2
pins RC14, RA5 # select pin, enable pin
options "SD0_MHZ=10" # speed 10 MHz
options "SD0_PORT=2" # at spi2 TODO: delete
options "SD0_CS_PORT=TRISC" # for chip select... TODO: use flags
options "SD0_CS_PIN=14" # ...use pin RC14 TODO: use flags
options "SD0_ENA_PORT=TRISA" # to enable SD card...
options "SD0_ENA_PIN=5" # ...use pin RA5
options "SD0_CS_PORT=TRISC" # for chip select... TODO: delete
options "SD0_CS_PIN=14" # ...use pin RC14 TODO: delete
options "SD0_ENA_PORT=TRISA" # to enable SD card... TODO: delete
options "SD0_ENA_PIN=5" # ...use pin RA5 TODO: delete
# General purpose I/O ports
device gpio0
@@ -100,10 +101,10 @@ options "GPIO_CLEAR_PORT=TRISA" # clear on startup...
options "GPIO_CLEAR_PIN=5" # ...pin RA5
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm
# GLCD driver
device glcd
@@ -112,16 +113,16 @@ device glcd
device hxtft
# Skeleton driver
device skel0
device skel
# Pseudo terminals
pseudo-device pty 4
service pty 4
# System log
pseudo-device log
service log
# Power control
pseudo-device power
device power
options "POWER_LED_PORT=TRISA" # for power LED...
options "POWER_LED_PIN=3" # ...use pin RA3
options "POWER_SWITCH_PORT=TRISA" # for power switch...
@@ -134,11 +135,11 @@ options "POWER_CONTROL_PIN=5" # ...use pin RA5
#
# sdramp - SDRAM block device
disk sdramp0 # SDRAM on external memory bus
device sdramp0 # SDRAM on external memory bus
options "KERNEL_EXECUTABLE_RAM" # allow kernel code in RAM area
# sramc - SRAM block device
disk sramc0 # SRAM via 4-wire CPLD interface
device sramc0 # SRAM via 4-wire CPLD interface
options "SRAMC_DATA_PORT=TRISE" # for DATA signal...
options "SRAMC_DATA_PIN=0" # ...use pin RE0
options "SRAMC_LDA_PORT=TRISC" # for LDA signal...
@@ -150,14 +151,14 @@ options "SRAMC_WR_PIN=0" # ...use pin RF0
# picga - SPI block device
controller spi1 # RAM disk: picga
disk picga0 at spi1
device picga0 at spi1
options "PICGA_BUS=SPI1CON" # TODO: delete this option
options "PICGA_CS_PORT=TRISA" # for CS...
options "PICGA_CS_PIN=4" # ...use pin RA4
# mrams - SPI block device
controller spi1 # RAM disk: mrams
disk mrams0 at spi1
device mrams0 at spi1
options "MRAMS_PORT=SPI1CON" # TODO: delete this option
options "MRAMS_CHIPS=6" # number of chips
options "MRAMS_CHIPSIZE=512" # chip size in kbytes
@@ -189,7 +190,7 @@ options "MRAMS_LED5_PIN=5" # ...use pin RF5
# spirams - SPI block device
controller spi1 # RAM disk: spirams
disk spirams0 at spi1
device spirams0 at spi1
options "SPIRAMS_PORT=SPI1CON" # TODO: delete this option
options "SPIRAMS_CHIPSIZE=128" # chip size in kbytes
options "SPIRAMS_CHIPS=16" # number of chips

View File

@@ -44,17 +44,17 @@ options "CONSOLE_DEVICE=tty0" # /dev/tty0
controller spi2 # SD card
# SD card
disk sd0 at spi2 flags 0x41 # select pin RD1
device sd0 at spi2 pin RD1 # select pin
options "SD0_MHZ=16" # speed 16 MHz
options "SD0_PORT=2" # at spi2 TODO: delete
options "SD0_CS_PORT=TRISD" # for chip select... TODO: use flags
options "SD0_CS_PIN=1" # ...use pin RD1 TODO: use flags
options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete
options "SD0_CS_PIN=1" # ...use pin RD1 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -38,7 +38,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -46,18 +46,19 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi3 # SD card
# microSD card
disk sd0 at spi3 flags 0x7c # select pin RG12
device sd0 at spi3
pins RG12, RG13 # select pin, enable pin
options "SD0_PORT=3" # at spi3 TODO: delete
options "SD0_CS_PORT=TRISG" # for chip select... TODO: use flags
options "SD0_CS_PIN=12" # ...use pin RG12 TODO: use flags
options "SD0_ENA_PORT=TRISG" # for SD enable... TODO: use flags
options "SD0_ENA_PIN=13" # ...use pin RG13 TODO: use flags
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
options "SD0_CS_PIN=12" # ...use pin RG12 TODO: delete
options "SD0_ENA_PORT=TRISG" # for SD enable... TODO: delete
options "SD0_ENA_PIN=13" # ...use pin RG13 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -38,26 +38,27 @@ config unix root on sd0a
options "CONSOLE_DEVICE=tty4" # Console on UART5
# Serial UART ports
device uart5 # RS-232 port
options "UART5_ENA_PORT=TRISB" # for RS-232 enable... TODO: use flags
options "UART5_ENA_PIN=13" # ...use pin RB13 TODO: use flags
device uart5 pin RB13 # RS-232 port, enable pin
options "UART5_ENA_PORT=TRISB" # for RS-232 enable... TODO: delete
options "UART5_ENA_PIN=13" # ...use pin RB13 TODO: delete
# SPI ports
controller spi3 # SD card
# microSD card
disk sd0 at spi3 flags 0x7c # select pin RG12
device sd0 at spi3
pins RG12, RG13 # select pin, enable pin
options "SD0_PORT=3" # at spi3 TODO: delete
options "SD0_CS_PORT=TRISG" # for chip select... TODO: use flags
options "SD0_CS_PIN=12" # ...use pin RG12 TODO: use flags
options "SD0_ENA_PORT=TRISG" # for SD enable... TODO: use flags
options "SD0_ENA_PIN=13" # ...use pin RG13 TODO: use flags
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
options "SD0_CS_PIN=12" # ...use pin RG12 TODO: delete
options "SD0_ENA_PORT=TRISG" # for SD enable... TODO: delete
options "SD0_ENA_PIN=13" # ...use pin RG13 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -37,7 +37,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb0
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -45,18 +45,19 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi3 # SD card
# microSD card
disk sd0 at spi3 flags 0x45 # select pin RD5
device sd0 at spi3
pins RD5, RB13 # select pin, enable pin
options "SD0_PORT=3" # at spi3 TODO: delete
options "SD0_CS_PORT=TRISD" # for chip select... TODO: use flags
options "SD0_CS_PIN=5" # ...use pin RD5 TODO: use flags
options "SD0_ENA_PORT=TRISB" # for SD enable... TODO: use flags
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: use flags
options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete
options "SD0_CS_PIN=5" # ...use pin RD5 TODO: delete
options "SD0_ENA_PORT=TRISB" # for SD enable... TODO: delete
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -37,26 +37,27 @@ config unix root on sd0a
options "CONSOLE_DEVICE=tty4" # Console on UART5
# Serial UART ports
device uart5 # RS-232 port
options "UART5_ENA_PORT=TRISB" # for RS-232 enable... TODO: use flags
options "UART5_ENA_PIN=13" # ...use pin RB13 TODO: use flags
device uart5 pin RB13 # RS-232 port, enable pin
options "UART5_ENA_PORT=TRISB" # for RS-232 enable... TODO: delete
options "UART5_ENA_PIN=13" # ...use pin RB13 TODO: delete
# SPI ports
controller spi3 # SD card
# microSD card
disk sd0 at spi3 flags 0x45 # select pin RD5
device sd0 at spi3
pins RD5, RB13 # select pin, enable pin
options "SD0_PORT=3" # at spi3 TODO: delete
options "SD0_CS_PORT=TRISD" # for chip select... TODO: use flags
options "SD0_CS_PIN=5" # ...use pin RD5 TODO: use flags
options "SD0_ENA_PORT=TRISB" # for SD enable... TODO: use flags
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: use flags
options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete
options "SD0_CS_PIN=5" # ...use pin RD5 TODO: delete
options "SD0_ENA_PORT=TRISB" # for SD enable... TODO: delete
options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -46,17 +46,17 @@ options "CONSOLE_DEVICE=tty1" # /dev/tty1
controller spi1 # SD card
# SD card
disk sd0 at spi1 flags 0x21 # select pin RB1
device sd0 at spi1 pin RB1 # select pin
options "SD0_MHZ=10" # speed 10 MHz
options "SD0_PORT=1" # at spi1 TODO: delete
options "SD0_CS_PORT=TRISB" # for chip select... TODO: use flags
options "SD0_CS_PIN=1" # ...use pin RB1 TODO: use flags
options "SD0_CS_PORT=TRISB" # for chip select... TODO: delete
options "SD0_CS_PIN=1" # ...use pin RB1 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -35,7 +35,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -43,19 +43,19 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi2 # SD card
# microSD card
disk sd0 at spi2 flags 0x79 # select pin RG9
device sd0 at spi2 pin RG9 # select pin
options "SD0_PORT=2" # sd0 at spi2 TODO: delete
options "SD0_CS_PORT=TRISG" # for chip select... TODO: use flags
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: use flags
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm
# GLCD driver
device glcd0
device glcd

View File

@@ -47,21 +47,21 @@ device uart2 # Console
controller spi2 # SD card
# microSD card
disk sd0 at spi2 flags 0x79 # select pin RG9
device sd0 at spi2 pin RG9 # select pin
options "SD0_PORT=2" # sd0 at spi2 TODO: delete
options "SD0_CS_PORT=TRISG" # for chip select... TODO: use flags
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: use flags
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: delete
options "SD0_MHZ=20" # increase data speed
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm
# sramc - SRAM block device
disk sramc0 # SRAM via 4-wire CPLD interface
device sramc0 # SRAM via 4-wire CPLD interface
options "PARTITION='sramc0:sa@2048,fs@6140'" # Partition schema

View File

@@ -43,20 +43,20 @@ options "CONSOLE_DEVICE=tty0" # /dev/tty0
controller spi2 # SD card
# microSD card
disk sd0 at spi2 flags 0x3e # select pin RC14
device sd0 at spi2 pin RC14 # select pin
options "SD0_MHZ=10" # speed 10 MHz
options "SD0_PORT=2" # at spi2 TODO: delete
options "SD0_CS_PORT=TRISC" # for chip select... TODO: use flags
options "SD0_CS_PIN=14" # ...use pin RC14 TODO: use flags
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm
# Skeleton driver
#device skel0
#device skel

View File

@@ -37,7 +37,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -45,16 +45,16 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi4 # SD card
# microSD card
disk sd0 at spi4 flags 0x11 # select pin RA1
device sd0 at spi4 pin RA1 # select pin
options "SD0_PORT=4" # at spi3 TODO: delete
options "SD0_CS_PORT=TRISA" # for chip select... TODO: use flags
options "SD0_CS_PIN=1" # ...use pin RA1 TODO: use flags
options "SD0_CS_PORT=TRISA" # for chip select... TODO: delete
options "SD0_CS_PIN=1" # ...use pin RA1 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -38,7 +38,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -46,16 +46,16 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi4 # SD card
# microSD card
disk sd0 at spi4 flags 0x50 # select pin RE0
device sd0 at spi4 pin RE0 # select pin
options "SD0_PORT=4" # at spi3 TODO: delete
options "SD0_CS_PORT=TRISE" # for chip select... TODO: use flags
options "SD0_CS_PIN=0" # ...use pin RE0 TODO: use flags
options "SD0_CS_PORT=TRISE" # for chip select... TODO: delete
options "SD0_CS_PIN=0" # ...use pin RE0 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -41,7 +41,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -52,19 +52,19 @@ device uart1 # RS-232 port
controller spi1 # SD card
# microSD card
disk sd0 at spi1 flags 0x19 # select pin RA9
device sd0 at spi1 pin RA9 # select pin
options "SD0_PORT=1" # sd0 at spi1 TODO: delete
options "SD0_CS_PORT=TRISA" # for sd0 chip select...TODO: delete
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: delete
options "SD0_MHZ=8" # speed 8 MHz
options "SD0_CS_PORT=TRISA" # for sd0 chip select...TODO: use flags
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: use flags
# General purpose I/O ports
device gpio0
device gpio
options "GPIO_CLEAR_PORT=TRISD" # clear on startup...
options "GPIO_CLEAR_PIN=2" # ...pin RD2
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -9,9 +9,9 @@ PARAM += -DADC_ENABLED
PARAM += -DPWM_ENABLED
PARAM += -DGPIO_CLEAR_PIN=2
PARAM += -DGPIO_CLEAR_PORT=TRISD
PARAM += -DSD0_MHZ=8
PARAM += -DSD0_CS_PIN=9
PARAM += -DSD0_CS_PORT=TRISA
PARAM += -DSD0_MHZ=8
PARAM += -DSD0_PORT=1
PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3
PARAM += -DUSB_MAX_EP_NUMBER=3

View File

@@ -37,20 +37,20 @@ options "CONSOLE_DEVICE=tty0" # /dev/tty0
controller spi2 # SD card
# microSD card
disk sd0 at spi2 flags 0x79 # select pin RG9
device sd0 at spi2 pin RG9 # select pin
options "SD0_MHZ=10" # speed 10 MHz
options "SD0_PORT=2" # at spi2 TODO: delete
options "SD0_CS_PORT=TRISG" # for chip select... TODO: use flags
options "SD0_CS_PIN=9" # ...use pin RG9 TODO: use flags
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
options "SD0_CS_PIN=9" # ...use pin RG9 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm
# HX8357 TFT display driver
device hxtft0
device hxtft

View File

@@ -38,26 +38,26 @@ controller spi2 # SD card
controller spi4 # RAM disk: spirams
# microSD card
disk sd0 at spi2 flags 0x79 # select pin RG9
device sd0 at spi2 pin RG9 # select pin
options "SD0_MHZ=10" # speed 10 MHz
options "SD0_PORT=2" # at spi2 TODO: delete
options "SD0_CS_PORT=TRISG" # for chip select... TODO: use flags
options "SD0_CS_PIN=9" # ...use pin RG9 TODO: use flags
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
options "SD0_CS_PIN=9" # ...use pin RG9 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm
# HX8357 TFT display driver
device hxtft0
device hxtft
# spirams - SPI block device
disk spirams0 at spi4
device spirams0 at spi4
options "PARTITION='spirams0:sa@2040'" # Partition schema
options "SPIRAMS_PORT=SPI4CON" # TODO: delete this option
options "SPIRAMS_CHIPSIZE=128" # chip size in kbytes

View File

@@ -35,7 +35,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -43,16 +43,16 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi2 # SD card
# microSD card
disk sd0 at spi2 flags 0x2d # select pin RB13
device sd0 at spi2 pin RB13 # select pin
options "SD0_PORT=2" # at spi2 TODO: delete
options "SD0_CS_PORT=TRISB" # for chip select... TODO: use flags
options "SD0_CS_PIN=13" # ...use pin RB13 TODO: use flags
options "SD0_CS_PORT=TRISB" # for chip select... TODO: delete
options "SD0_CS_PIN=13" # ...use pin RB13 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -36,7 +36,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -44,19 +44,19 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi2 # SD card
# microSD card
disk sd0 at spi2 flags 0x79 # select pin RG9
device sd0 at spi2 pin RG9 # select pin RG9
options "SD0_PORT=2" # sd0 at spi2 TODO: delete
options "SD0_CS_PORT=TRISG" # for chip select... TODO: use flags
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: use flags
options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm
# GLCD driver
device glcd0
device glcd

View File

@@ -37,7 +37,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -45,16 +45,16 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi1 # SD card
# SD card
disk sd0 at spi1 flags 0x21 # select pin RB1
device sd0 at spi1 pin RB1 # select pin RB1
options "SD0_PORT=1" # at spi1 TODO: delete
options "SD0_CS_PORT=TRISB" # for chip select... TODO: use flags
options "SD0_CS_PIN=1" # ...use pin RB1 TODO: use flags
options "SD0_CS_PORT=TRISB" # for chip select... TODO: delete
options "SD0_CS_PIN=1" # ...use pin RB1 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -46,7 +46,7 @@ config unix root on sd0a
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB
# Virtual UART on USB
pseudo-device uartusb
device uartusb
options "USB_MAX_EP_NUMBER=3"
options "USB_NUM_STRING_DESCRIPTORS=3"
@@ -54,20 +54,20 @@ options "USB_NUM_STRING_DESCRIPTORS=3"
controller spi1 # SD card
# microSD card
disk sd0 at spi1 flags 0x19 # select pin RA9
disk sd1 at spi1 flags 0x1a # select pin RA10
device sd0 at spi1 pin RA9 # select pin
device sd1 at spi1 pin RA10 # select pin
options "SD0_PORT=1" # sd0 at spi1 TODO: delete
options "SD0_CS_PORT=TRISA" # for sd0 chip select...TODO: use flags
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: use flags
options "SD0_CS_PORT=TRISA" # for sd0 chip select...TODO: delete
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: delete
options "SD1_PORT=1" # sd1 at spi1 TODO: delete
options "SD1_CS_PORT=TRISA" # for sd1 chip select...TODO: use flags
options "SD1_CS_PIN=10" # ...use pin RA9 TODO: use flags
options "SD1_CS_PORT=TRISA" # for sd1 chip select...TODO: delete
options "SD1_CS_PIN=10" # ...use pin RA9 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -51,20 +51,20 @@ device uart2 # USB-to-serial adapter
controller spi1 # SD card
# microSD card
disk sd0 at spi1 flags 0x19 # select pin RA9
disk sd1 at spi1 flags 0x1a # select pin RA10
device sd0 at spi1 pin RA9 # select pin
device sd1 at spi1 pin RA10 # select pin
options "SD0_PORT=1" # sd0 at spi1 TODO: delete
options "SD0_CS_PORT=TRISA" # for sd0 chip select...TODO: use flags
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: use flags
options "SD0_CS_PORT=TRISA" # for sd0 chip select...TODO: delete
options "SD0_CS_PIN=9" # ...use pin RA9 TODO: delete
options "SD1_PORT=1" # sd1 at spi1 TODO: delete
options "SD1_CS_PORT=TRISA" # for sd1 chip select...TODO: use flags
options "SD1_CS_PIN=10" # ...use pin RA9 TODO: use flags
options "SD1_CS_PORT=TRISA" # for sd1 chip select...TODO: delete
options "SD1_CS_PIN=10" # ...use pin RA9 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -42,17 +42,17 @@ options "CONSOLE_DEVICE=tty0" # /dev/tty0
controller spi2 # SD card
# microSD card
disk sd0 at spi2 flags 0x44 # select pin RD4
device sd0 at spi2 pin RD4 # select pin RD4
options "SD0_MHZ=10" # speed 10 MHz
options "SD0_PORT=2" # at spi2 TODO: delete
options "SD0_CS_PORT=TRISD" # for chip select... TODO: use flags
options "SD0_CS_PIN=4" # ...use pin RD4 TODO: use flags
options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete
options "SD0_CS_PIN=4" # ...use pin RD4 TODO: delete
# General purpose I/O ports
device gpio0
device gpio
# ADC driver
device adc0
device adc
# PWM driver
device pwm0
device pwm

View File

@@ -93,27 +93,28 @@ struct idlst {
};
struct device {
int d_type; /* CONTROLLER, DEVICE, bus adaptor */
struct device *d_conn; /* what it is connected to */
char *d_name; /* name of device (e.g. rk11) */
struct idlst *d_vec; /* interrupt vectors */
int d_pri; /* interrupt priority */
int d_addr; /* address of csr */
int d_unit; /* unit number */
int d_drive; /* drive number */
int d_slave; /* slave number */
#define QUES -1 /* -1 means '?' */
#define UNKNOWN -2 /* -2 means not set yet */
int d_dk; /* if init 1 set to number for iostat */
int d_flags; /* flags for device init */
char *d_port; /* io port base manifest constant */
int d_portn; /* io port base (if number not manifest) */
char *d_mask; /* interrupt mask */
int d_maddr; /* io memory base */
int d_msize; /* io memory size */
int d_drq; /* DMA request */
int d_irq; /* interrupt request */
struct device *d_next; /* Next one in list */
int d_type; /* CONTROLLER, DEVICE, bus adaptor */
struct device *d_conn; /* what it is connected to */
char *d_name; /* name of device (e.g. rk11) */
struct idlst *d_vec; /* interrupt vectors */
int d_pri; /* interrupt priority */
int d_addr; /* address of csr */
int d_unit; /* unit number */
int d_drive; /* drive number */
int d_slave; /* slave number */
#define QUES -1 /* -1 means '?' */
#define UNKNOWN -2 /* -2 means not set yet */
int d_flags; /* flags for device init */
char *d_port; /* io port base manifest constant */
char *d_mask; /* interrupt mask */
int d_maddr; /* io memory base */
int d_msize; /* io memory size */
int d_drq; /* DMA request */
int d_irq; /* interrupt request */
struct device *d_next; /* Next one in list */
#define MAXPINS 32 /* max number of pins */
short d_pins[MAXPINS]; /* pins assigned */
int d_npins; /* pin count */
};
struct config {

View File

@@ -16,7 +16,6 @@
%token CPU
%token CSR
%token DEVICE
%token DISK
%token DRIVE
%token DST
%token DUMPS
@@ -25,20 +24,19 @@
%token HZ
%token LDSCRIPT
%token MAJOR
%token MASTER
%token MAXUSERS
%token MINOR
%token MINUS
%token ON
%token OPTIONS
%token MAKEOPTIONS
%token PINS
%token PRIORITY
%token PSEUDO_DEVICE
%token SERVICE
%token ROOT
%token SEMICOLON
%token SEQUENTIAL
%token SIZE
%token SLAVE
%token SWAP
%token TIMEZONE
%token TRACE
@@ -47,6 +45,7 @@
%token <str> ID
%token <val> NUMBER
%token <val> FPNUMBER
%token <val> PIN
%type <str> Save_id
%type <str> Opt_value
@@ -435,25 +434,19 @@ Device_spec:
DEVICE Dev_name Dev_info Int_spec
= { cur.d_type = DEVICE; }
|
MASTER Dev_name Dev_info Int_spec
= { cur.d_type = MASTER; }
|
DISK Dev_name Dev_info Int_spec
= { cur.d_dk = 1; cur.d_type = DEVICE; }
|
CONTROLLER Dev_name Dev_info Int_spec
= { cur.d_type = CONTROLLER; }
|
PSEUDO_DEVICE Init_dev Dev
SERVICE Init_dev Dev
= {
cur.d_name = $3;
cur.d_type = PSEUDO_DEVICE;
cur.d_type = SERVICE;
}
|
PSEUDO_DEVICE Init_dev Dev NUMBER
SERVICE Init_dev Dev NUMBER
= {
cur.d_name = $3;
cur.d_type = PSEUDO_DEVICE;
cur.d_type = SERVICE;
cur.d_slave = $4;
}
;
@@ -464,6 +457,11 @@ Dev_name:
cur.d_name = $2;
cur.d_unit = $3;
}
|
Init_dev Dev
= {
cur.d_name = $2;
}
;
Init_dev:
@@ -497,17 +495,10 @@ Info:
DRIVE NUMBER
= { cur.d_drive = $2; }
|
SLAVE NUMBER
= {
if (cur.d_conn != 0 &&
cur.d_conn->d_type == MASTER)
cur.d_slave = $2;
else
yyerror("can't specify slave--not to master");
}
|
FLAGS NUMBER
= { cur.d_flags = $2; }
|
PINS Pin_list
;
Int_spec:
@@ -533,6 +524,14 @@ Id_list:
a->id = $1; a->id_next = $2; $$ = a;
}
;
Pin_list:
PIN
= { cur.d_pins[cur.d_npins++] = $1; }
|
PIN COMMA Pin_list
= { cur.d_pins[cur.d_npins++] = $1; }
;
%%
void yyerror(s)
@@ -654,7 +653,7 @@ connect(dev, num)
for (dp = dtab; dp != 0; dp = dp->d_next) {
if ((num != dp->d_unit) || !eq(dev, dp->d_name))
continue;
if (dp->d_type != CONTROLLER && dp->d_type != MASTER) {
if (dp->d_type != CONTROLLER) {
(void) sprintf(errbuf,
"%s connected to non-controller", dev);
yyerror(errbuf);
@@ -736,15 +735,15 @@ void init_dev(dp)
dp->d_type = DEVICE;
dp->d_conn = 0;
dp->d_vec = 0;
dp->d_addr = dp->d_flags = dp->d_dk = 0;
dp->d_addr = dp->d_flags;
dp->d_pri = -1;
dp->d_slave = dp->d_drive = dp->d_unit = UNKNOWN;
dp->d_port = (char *)0;
dp->d_portn = 0;
dp->d_irq = -1;
dp->d_drq = -1;
dp->d_maddr = 0;
dp->d_msize = 0;
dp->d_npins = 0;
dp->d_mask = "null";
}

View File

@@ -58,7 +58,6 @@ static struct kt key_words[] = {
{ "cpu", CPU },
{ "csr", CSR },
{ "device", DEVICE },
{ "disk", DISK },
{ "drive", DRIVE },
{ "dst", DST },
{ "dumps", DUMPS },
@@ -68,17 +67,17 @@ static struct kt key_words[] = {
{ "architecture", ARCHITECTURE },
{ "major", MAJOR },
{ "makeoptions", MAKEOPTIONS },
{ "master", MASTER },
{ "maxusers", MAXUSERS },
{ "minor", MINOR },
{ "on", ON },
{ "options", OPTIONS },
{ "pin", PINS },
{ "pins", PINS },
{ "priority", PRIORITY },
{ "pseudo-device", PSEUDO_DEVICE },
{ "root", ROOT },
{ "sequential", SEQUENTIAL },
{ "service", SERVICE },
{ "size", SIZE },
{ "slave", SLAVE },
{ "swap", SWAP },
{ "tape", DEVICE },
{ "timezone", TIMEZONE },
@@ -104,7 +103,14 @@ kw_lookup(word)
}
%}
WORD [A-Za-z_][-A-Za-z_]*
PIN R[A-Z][0-9][0-9]*
%%
{PIN} {
/* Pin name from RA0 to RZ255. */
yylval.val = atoi(yytext + 2) & 0xff;
yylval.val |= (yytext[1] - 'A' + 1) << 8;
return PIN;
}
{WORD} {
int i;
@@ -138,7 +144,6 @@ WORD [A-Za-z_][-A-Za-z_]*
return NUMBER;
}
[0-9]"."[0-9]* {
double atof();
yylval.val = (int) (60 * atof(yytext) + 0.5);
return FPNUMBER;
}

View File

@@ -37,19 +37,19 @@
* build the ioconf.c file
*/
static void
pseudo_ioconf(fp)
service_ioconf(fp)
register FILE *fp;
{
register struct device *dp;
for (dp = dtab; dp != NULL; dp = dp->d_next)
if (dp->d_type == PSEUDO_DEVICE)
if (dp->d_type == SERVICE)
fprintf(fp, "extern void %sattach __P((int));\n",
dp->d_name);
fprintf(fp, "\nstruct conf_pdev conf_pdinit[] = {\n");
fprintf(fp, "\nstruct conf_pdev conf_sinit[] = {\n");
for (dp = dtab; dp != NULL; dp = dp->d_next)
if (dp->d_type == PSEUDO_DEVICE)
if (dp->d_type == SERVICE)
fprintf(fp, " { %sattach, %d },\n", dp->d_name,
dp->d_slave > 0 ? dp->d_slave : 1);
@@ -70,6 +70,7 @@ void pic32_ioconf()
{
register struct device *dp, *mp;
FILE *fp;
int i;
fp = fopen("ioconf.c", "w");
if (fp == 0) {
@@ -83,17 +84,17 @@ void pic32_ioconf()
/* print controller initialization structures */
for (dp = dtab; dp != 0; dp = dp->d_next) {
if (dp->d_type == PSEUDO_DEVICE)
if (dp->d_type == SERVICE)
continue;
fprintf(fp, "extern struct driver %sdriver;\n", dp->d_name);
}
fprintf(fp, "\nstruct conf_ctlr conf_cinit[] = {\n");
fprintf(fp, " /* driver,\t\tunit,\taddr,\t\tpri,\tflags */\n");
for (dp = dtab; dp != 0; dp = dp->d_next) {
if (dp->d_type != CONTROLLER && dp->d_type != MASTER)
if (dp->d_type != CONTROLLER)
continue;
if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
printf("can't specify drive/slave for %s%s\n",
if (dp->d_drive != UNKNOWN) {
printf("can't specify drive for %s%s\n",
dp->d_name, wnum(dp->d_unit));
continue;
}
@@ -109,10 +110,9 @@ void pic32_ioconf()
/* print devices connected to other controllers */
fprintf(fp, "\nstruct conf_device conf_dinit[] = {\n");
fprintf(fp,
" /* driver,\t\tctlr driver,\tunit,\tctlr,\tdrive,\tslave,\tdk,\tflags */\n");
" /* driver,\t\tctlr driver,\tunit,\tctlr,\tdrive,\tflags,\tpins */\n");
for (dp = dtab; dp != 0; dp = dp->d_next) {
if (dp->d_type == CONTROLLER || dp->d_type == MASTER ||
dp->d_type == PSEUDO_DEVICE)
if (dp->d_type == CONTROLLER || dp->d_type == SERVICE)
continue;
mp = dp->d_conn;
@@ -121,14 +121,29 @@ void pic32_ioconf()
fprintf(fp, "&%sdriver,\t%d,\t%d,\t",
mp->d_name, dp->d_unit, mp->d_unit);
} else {
fprintf(fp, "0,\t\t%d,\t0,\t",
dp->d_unit);
fprintf(fp, "0,\t\t%d,\t0,\t", dp->d_unit);
}
fprintf(fp, "%d,\t%d,\t%d,\t0x%x },\n",
dp->d_drive, dp->d_slave, dp->d_dk, dp->d_flags);
fprintf(fp, "%d,\t0x%x,\t", dp->d_drive, dp->d_flags);
if (dp->d_npins > 0) {
fprintf(fp, "{");
for (i=dp->d_npins-1; i>=0; i--) {
int bit = dp->d_pins[i] & 0xff;
int port = dp->d_pins[i] >> 8;
if (bit > 15 || port < 1 || port > 7) {
printf("R%c%u: invalid pin name\n", 'A'+port-1, bit);
exit(1);
}
fprintf(fp, "0x%x%x", port, bit);
if (i > 0)
fprintf(fp, ",");
}
fprintf(fp, "}");
} else
fprintf(fp, "{0}");
fprintf(fp, " },\n");
}
fprintf(fp, " { 0 }\n};\n");
pseudo_ioconf(fp);
service_ioconf(fp);
fclose(fp);
}
#endif

View File

@@ -212,7 +212,7 @@ nextparam:
goto invis;
for (dp = dtab; dp != 0; save_dp = dp, dp = dp->d_next)
if (eq(dp->d_name, wd)) {
if (std && dp->d_type == PSEUDO_DEVICE &&
if (std && dp->d_type == SERVICE &&
dp->d_slave <= 0)
dp->d_slave = 1;
goto nextparam;
@@ -221,7 +221,7 @@ nextparam:
dp = (struct device *) malloc(sizeof *dp);
init_dev(dp);
dp->d_name = strdup(wd);
dp->d_type = PSEUDO_DEVICE;
dp->d_type = SERVICE;
dp->d_slave = 1;
if (save_dp)
save_dp->d_next = dp;