From 1916f8c9da1811e8e574526b0d8ace4c4b092010 Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Wed, 28 Jan 2015 19:14:41 -0800 Subject: [PATCH] New kernel configuration: chipKIT WF32 board with microSD card on 2.4" LCD TFT display shield. WF32 board by itself already has a microSD socket. It's useless for RetroBSD though, as it is not connected to any of available SPI ports (must use GPIO instead). Fortunately, a cheap shield is widely available, which adds a microSD slot connected to SPI2 pins. --- Makefile | 1 + sys/pic32/Makefile | 2 +- sys/pic32/cfg/wf32.map | 92 +++++++++++++++++++++++++++++++++++++++ sys/pic32/wf32/.gitignore | 9 ++++ sys/pic32/wf32/Makefile | 70 +++++++++++++++++++++++++++++ sys/pic32/wf32/WF32 | 24 ++++++++++ 6 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 sys/pic32/cfg/wf32.map create mode 100644 sys/pic32/wf32/.gitignore create mode 100644 sys/pic32/wf32/Makefile create mode 100644 sys/pic32/wf32/WF32 diff --git a/Makefile b/Makefile index 2271c99..7ad9eae 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ FUBARINO = sys/pic32/fubarino/FUBARINO FUBARINOBIG = sys/pic32/fubarino/FUBARINO-UART2CONS-UART1-SRAMC SDXL = sys/pic32/sdxl/SDXL MMBMX7 = sys/pic32/mmb-mx7/MMB-MX7 +WF32 = sys/pic32/wf32/WF32 # Select target board TARGET ?= $(MAX32) diff --git a/sys/pic32/Makefile b/sys/pic32/Makefile index a37601f..2ad2510 100644 --- a/sys/pic32/Makefile +++ b/sys/pic32/Makefile @@ -5,7 +5,7 @@ SUBDIR = baremetal duinomite duinomite-uart duinomite-e \ duinomite-e-uart explorer16 max32 max32-eth maximite \ meb starter-kit sdxl ubw32 ubw32-uart \ ubw32-uart-sdram baremetal fubarino mmb-mx7 maximite-color \ - 32mxsdram-uart picadillo + 32mxsdram-uart picadillo wf32 default: diff --git a/sys/pic32/cfg/wf32.map b/sys/pic32/cfg/wf32.map new file mode 100644 index 0000000..9b77bcd --- /dev/null +++ b/sys/pic32/cfg/wf32.map @@ -0,0 +1,92 @@ +RX F 2 +0 F 2 +TX F 8 +1 F 8 +2 E 8 +3 D 0 +4 F 1 +5 D 1 +6 D 2 +7 E 9 +8 A 14 +9 D 3 +10 D 4 +11 G 8 +12 G 7 +LD6 G 6 +13 G 6 +A0 B 2 +14 B 2 +A1 B 4 +15 B 4 +A2 B 8 +16 B 8 +A3 B 0 +17 B 0 +A4 B 10 +18 B 10 +A5 B 11 +19 B 11 +A6 B 3 +20 B 3 +A7 B 5 +21 B 5 +A8 B 9 +22 B 9 +A9 B 1 +23 B 1 +A10 B 14 +24 B 14 +A11 B 15 +25 B 15 +26 E 0 +27 E 1 +28 E 2 +29 E 3 +30 E 4 +31 E 5 +32 E 6 +33 E 7 +34 D 5 +35 D 11 +36 D 6 +37 D 7 +38 C 4 +39 D 14 +40 D 15 +41 A 9 +42 A 10 +LD5 F 0 +43 F 0 +44 G 9 +45 A 2 +46 A 3 +LD4 A 0 +47 A 0 +LD3 A 1 +48 A 1 +49 G 15 +50 G 14 +51 G 12 +52 G 13 +53 F 13 +54 F 12 +55 F 4 +56 F 5 +57 A 15 +58 G 1 +59 G 0 +60 B 12 +61 B 13 +62 A 4 +63 A 5 +64 D 13 +65 A 6 +66 A 7 +67 C 1 +68 C 2 +69 C 3 +70 D 8 +71 D 9 +72 D 10 +73 D 12 diff --git a/sys/pic32/wf32/.gitignore b/sys/pic32/wf32/.gitignore new file mode 100644 index 0000000..6a22af6 --- /dev/null +++ b/sys/pic32/wf32/.gitignore @@ -0,0 +1,9 @@ +.compileversion +.deps/ +.oldversion +machine +sys +unix.bin +unix.map +usbboot.map +vers.c diff --git a/sys/pic32/wf32/Makefile b/sys/pic32/wf32/Makefile new file mode 100644 index 0000000..6a289a6 --- /dev/null +++ b/sys/pic32/wf32/Makefile @@ -0,0 +1,70 @@ +BUILDPATH = ../../../tools/configsys/../../sys/pic32 +H = ../../../tools/configsys/../../sys/include +M = ../../../tools/configsys/../../sys/pic32 +S = ../../../tools/configsys/../../sys/kernel + +vpath %.c $(M):$(S) +vpath %.S $(M):$(S) + +KERNOBJ += adc.o clock.o cons.o devsw.o exception.o exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o gpio.o init_main.o init_sysent.o kern_clock.o kern_descrip.o kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o kern_subr.o kern_synch.o kern_sysctl.o kern_time.o machdep.o mem.o rd_sd.o rdisk.o signal.o spi_bus.o startup.o subr_prf.o subr_rmap.o swap.o sys_generic.o sys_inode.o sys_pipe.o sys_process.o syscalls.o sysctl.o tty.o tty_subr.o tty_tty.o uart.o ufs_alloc.o ufs_bio.o ufs_bmap.o ufs_dsort.o ufs_fio.o ufs_inode.o ufs_mount.o ufs_namei.o ufs_subr.o ufs_syscalls.o ufs_syscalls2.o vers.o vfs_vnops.o vm_sched.o vm_swap.o vm_swp.o +EXTRA_TARGETS = + +DEFS += -DADC_ENABLED=YES +DEFS += -DBUS_DIV=1 +DEFS += -DBUS_KHZ=80000 +DEFS += -DCONSOLE_DEVICE=tty0 +DEFS += -DCPU_IDIV=2 +DEFS += -DCPU_KHZ=80000 +DEFS += -DCPU_MUL=20 +DEFS += -DCPU_ODIV=1 +DEFS += -DCRYSTAL=8 +DEFS += -DDC0_DEBUG=DEVCFG0_DEBUG_DISABLED +DEFS += -DDC0_ICE=0 +DEFS += -DDC1_CKM=0 +DEFS += -DDC1_CKS=0 +DEFS += -DDC1_FNOSC=DEVCFG1_FNOSC_PRIPLL +DEFS += -DDC1_IESO=DEVCFG1_IESO +DEFS += -DDC1_OSCIOFNC=0 +DEFS += -DDC1_PBDIV=DEVCFG1_FPBDIV_1 +DEFS += -DDC1_POSCMOD=DEVCFG1_POSCMOD_HS +DEFS += -DDC1_SOSC=0 +DEFS += -DDC1_WDTEN=0 +DEFS += -DDC1_WDTPS=DEVCFG1_WDTPS_1 +DEFS += -DDC2_PLLIDIV=DEVCFG2_FPLLIDIV_2 +DEFS += -DDC2_PLLMUL=DEVCFG2_FPLLMUL_20 +DEFS += -DDC2_PLLODIV=DEVCFG2_FPLLODIV_1 +DEFS += -DDC2_UPLL=0 +DEFS += -DDC2_UPLLIDIV=DEVCFG2_UPLLIDIV_2 +DEFS += -DDC3_CAN=DEVCFG3_FCANIO +DEFS += -DDC3_ETH=DEVCFG3_FETHIO +DEFS += -DDC3_MII=DEVCFG3_FMIIEN +DEFS += -DDC3_SRS=DEVCFG3_FSRSSEL_7 +DEFS += -DDC3_USBID=DEVCFG3_FUSBIDIO +DEFS += -DDC3_USERID=0xffff +DEFS += -DDC3_VBUSON=DEVCFG3_FVBUSONIO +DEFS += -DEXEC_AOUT +DEFS += -DEXEC_ELF +DEFS += -DEXEC_SCRIPT +DEFS += -DGPIO_ENABLED=YES +DEFS += -DKERNEL +DEFS += -DLED_DISK_PIN=0 +DEFS += -DLED_DISK_PORT=TRISF +DEFS += -DLED_KERNEL_PIN=0 +DEFS += -DLED_KERNEL_PORT=TRISA +DEFS += -DLED_TTY_PIN=1 +DEFS += -DLED_TTY_PORT=TRISA +DEFS += -DPIC32MX7 +DEFS += -DSD0_CS_PIN=4 +DEFS += -DSD0_CS_PORT=TRISD +DEFS += -DSD0_PORT=2 +DEFS += -DUART1_BAUD=115200 +DEFS += -DUART1_ENABLED=YES +DEFS += -DUCB_METER + + +LDSCRIPT = ../../../tools/configsys/../../sys/pic32/cfg/bootloader-max32.ld + +CONFIG = WF32 +CONFIGPATH = ../../../tools/configsys + +include ../../../tools/configsys/../../sys/pic32/kernel-post.mk diff --git a/sys/pic32/wf32/WF32 b/sys/pic32/wf32/WF32 new file mode 100644 index 0000000..4778b41 --- /dev/null +++ b/sys/pic32/wf32/WF32 @@ -0,0 +1,24 @@ +# +# chipKIT WF32 board with microSD card on 2.4" LCD TFT display shield +# +# See http://misc.ws/2013/11/08/touch-screen-shield-for-arduino-uno/ +# for shield information +# +core pic32mx7 +linker bootloader-max32 +mapping wf32 +device kernel led=LD4 cpu_khz=80000 bus_khz=80000 + +device console device=tty0 led=LD3 +device uart1 baud=115200 +#device uart2 baud=115200 +#device uart3 baud=115200 +#device uart4 baud=115200 + +device rdisk led=LD5 +device sd0 port=2 cs=10 + +device gpio +device adc + +device foreignbootloader