diff --git a/src/cmd/aout/.gitignore b/src/cmd/aout/.gitignore new file mode 100644 index 0000000..347b11f --- /dev/null +++ b/src/cmd/aout/.gitignore @@ -0,0 +1 @@ +aout diff --git a/sys/pic32/Makefile b/sys/pic32/Makefile index e82501f..dc975c9 100644 --- a/sys/pic32/Makefile +++ b/sys/pic32/Makefile @@ -5,7 +5,7 @@ SUBDIR = baremetal dip duinomite duinomite-uart duinomite-e \ duinomite-e-uart explorer16 max32 max32-eth maximite \ meb pinguino-micro starter-kit ubw32 ubw32-uart \ ubw32-uart-sdram baremetal fubarino mmb-mx7 maximite-color \ - 32mxsdram-uart + 32mxsdram-uart picadillo default: diff --git a/sys/pic32/picadillo/Makefile b/sys/pic32/picadillo/Makefile new file mode 100644 index 0000000..a2e2339 --- /dev/null +++ b/sys/pic32/picadillo/Makefile @@ -0,0 +1,64 @@ +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 += -DPIC32MX7 +DEFS += -DSD0_CS_PIN=9 +DEFS += -DSD0_CS_PORT=TRISG +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 = PICADILLO +CONFIGPATH = ../../../tools/configsys + +include ../../../tools/configsys/../../sys/pic32/kernel-post.mk diff --git a/sys/pic32/picadillo/PICADILLO b/sys/pic32/picadillo/PICADILLO new file mode 100644 index 0000000..bc50dc9 --- /dev/null +++ b/sys/pic32/picadillo/PICADILLO @@ -0,0 +1,19 @@ +# +# Picadillo 35T board +# =================== + +core pic32mx7 +mapping generic +linker bootloader-max32 + +device kernel cpu_khz=80000 bus_khz=80000 + +device console device=tty0 +device uart1 baud=115200 + +device rdisk +device sd0 port=2 cs=G9 + +device gpio +device adc +device foreignbootloader diff --git a/sys/pic32/startup.S b/sys/pic32/startup.S index dddbdee..44b0bd4 100644 --- a/sys/pic32/startup.S +++ b/sys/pic32/startup.S @@ -109,6 +109,17 @@ _entry_vector_: .globl _entry_vector_ jr $k0 nop +/* + * Data for bootloader. + */ + .org 0xf8 + .type _ebase, @object +_ebase: .word 0x9d000000 # EBase value + + .type _imgptr, @object +_imgptr: .word -1 # Image header pointer + + #--------------------------------------- # Exception vector: handle interrupts and exceptions # diff --git a/sys/pic32/uart.c b/sys/pic32/uart.c index d2093e7..26e2cb5 100644 --- a/sys/pic32/uart.c +++ b/sys/pic32/uart.c @@ -639,7 +639,7 @@ void uartstart (register struct tty *tp) s = spltty(); if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) { out: /* Disable transmit_interrupt. */ - led_control (LED_TTY, 0); + led_control (LED_TTY, 0); splx (s); return; } @@ -705,7 +705,7 @@ again: if (--timo == 0) break; if (tp->t_state & TS_BUSY) { - uartintr (0); + uartintr (dev); goto again; } led_control (LED_TTY, 1);