From 428764c187f6e10191b670885992828f08ad9177 Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Mon, 1 Jun 2015 21:43:57 -0700 Subject: [PATCH] SD diag utility moved to tools. Makefile for Retro 1 kernel modified to get rid of file drivers.mk. --- sys/pic32/devcfg.c | 20 -------------- sys/pic32/drivers.mk | 43 ------------------------------ sys/pic32/retroone/Makefile | 41 +++++++++++----------------- sys/pic32/retroone/README | 2 ++ {sys/pic32 => tools}/diag/Makefile | 26 +----------------- {sys/pic32 => tools}/diag/main.c | 0 6 files changed, 19 insertions(+), 113 deletions(-) delete mode 100644 sys/pic32/devcfg.c delete mode 100644 sys/pic32/drivers.mk create mode 100644 sys/pic32/retroone/README rename {sys/pic32 => tools}/diag/Makefile (85%) rename {sys/pic32 => tools}/diag/main.c (100%) diff --git a/sys/pic32/devcfg.c b/sys/pic32/devcfg.c deleted file mode 100644 index 5418445..0000000 --- a/sys/pic32/devcfg.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Chip configuration. - */ -#include "machine/pic32mx.h" - -PIC32_DEVCFG ( - 0| DC0_DEBUG | DC0_ICE, - - 0| DC1_FNOSC | DC1_SOSC | DC1_IESO | DC1_POSCMOD | - DC1_OSCIOFNC | DC1_PBDIV | DC1_CKM | DC1_CKS | - DC1_WDTPS | DC1_WDTEN, - - 0| DC2_PLLIDIV | DC2_PLLMUL | DC2_UPLLIDIV | DC2_UPLL | - DC2_PLLODIV, - - 0| DEVCFG3_USERID(DC3_USERID) | DC3_SRS | DC3_MII | - DC3_ETH | DC3_CAN | DC3_USBID | DC3_VBUSON -); - - diff --git a/sys/pic32/drivers.mk b/sys/pic32/drivers.mk deleted file mode 100644 index 7729900..0000000 --- a/sys/pic32/drivers.mk +++ /dev/null @@ -1,43 +0,0 @@ -ifeq ($(DRIVER_GPIO),yes) - KERNOBJ += gpio.o - DEFS += -DGPIO_ENABLED -endif - -ifeq ($(DRIVER_POWER),yes) - KERNOBJ += power_control.o - POWER_LED_PORT ?= TRISG - POWER_LED_PIN ?= 14 - POWER_SWITCH_PORT ?= TRISE - POWER_SWITCH_PIN ?= 9 - POWER_CONTROL_PORT ?= TRISE - POWER_CONTROL_PIN ?= 9 - DEFS += -DPOWER_ENABLED -DPOWER_LED_PORT=$(POWER_LED_PORT) -DPOWER_LED_PIN=$(POWER_LED_PIN) - DEFS += -DPOWER_SWITCH_PORT=$(POWER_SWITCH_PORT) -DPOWER_SWITCH_PIN=$(POWER_SWITCH_PIN) - DEFS += -DPOWER_CONTROL_PORT=$(POWER_CONTROL_PORT) -DPOWER_CONTROL_PIN=$(POWER_CONTROL_PIN) -endif - -ifeq ($(DRIVER_ADC),yes) - KERNOBJ += adc.o - DEFS += -DADC_ENABLED -endif - -ifeq ($(DRIVER_SPI),yes) - KERNOBJ += spi.o - DEFS += -DSPI_ENABLED -endif - -ifeq ($(DRIVER_GLCD),yes) - KERNOBJ += glcd.o - DEFS += -DGLCD_ENABLED -endif - -ifeq ($(DRIVER_PWM),yes) - KERNOBJ += pwm.o - DEFS += -DPWM_ENABLED -endif - -ifeq ($(DRIVER_SDRAMP),yes) - NEEDS_FEATURE_KERNEL_EXECUTABLE_RAM = yes - KERNOBJ += sdram.o rd_sdramp.o - DEFS += -DSDRAMP_ENABLED -endif diff --git a/sys/pic32/retroone/Makefile b/sys/pic32/retroone/Makefile index 6933f26..c08ebdd 100644 --- a/sys/pic32/retroone/Makefile +++ b/sys/pic32/retroone/Makefile @@ -14,7 +14,7 @@ DEFS += -DGLOBAL_DEBUG # CPU frequency 80 MHz. DEFS += -DCPU_KHZ=80000 -DEFS += -DBUS_KHZ=80000 +DEFS += -DBUS_KHZ=80000 -DBUS_DIV=1 # # Basic pic32mx795f512l chip with internal oscillator @@ -32,28 +32,6 @@ DEFS += -DLED_KERNEL_PORT=TRISB -DLED_KERNEL_PIN=8 DEFS += -DLED_TTY_PORT=TRISB -DLED_TTY_PIN=9 DEFS += -DLED_AUX_PORT=TRISA -DLED_AUX_PIN=9 -# Include or exclude drivers - -# General Purpose I/O -DRIVER_GPIO = yes - -# Basic ADC interface -DRIVER_ADC = yes - -# Power control (power LED, and soft power-off by button) -# requires supported PSU (ATX) -DRIVER_POWER = no - -DRIVER_GLCD = yes -DRIVER_PWM = yes - -POWER_LED_PORT = TRISG -POWER_LED_PIN = 12 -POWER_SWITCH_PORT = TRISG -POWER_SWITCH_PIN = 0 -POWER_CONTROL_PORT = TRISE -POWER_CONTROL_PIN = 9 - DEPFLAGS = -MT $@ -MD -MP -MF .deps/$*.dep CFLAGS = -O $(DEFS) $(DEPFLAGS) ASFLAGS = $(DEFS) $(DEPFLAGS) @@ -97,8 +75,21 @@ KERNOBJ += vers.o devcfg.o # Include any local specific configuration overrides -include Makefile.local -# This makefile does the work including the right files and options for the drivers -include ../drivers.mk +# GPIO driver +KERNOBJ += gpio.o +DEFS += -DGPIO_ENABLED + +# ADC driver +KERNOBJ += adc.o +DEFS += -DADC_ENABLED + +# GLCD driver +KERNOBJ += glcd.o +DEFS += -DGLCD_ENABLED + +# PWM driver +KERNOBJ += pwm.o +DEFS += -DPWM_ENABLED all: .deps sys machine unix.elf $(SIZE) unix.elf diff --git a/sys/pic32/retroone/README b/sys/pic32/retroone/README new file mode 100644 index 0000000..c648880 --- /dev/null +++ b/sys/pic32/retroone/README @@ -0,0 +1,2 @@ +This directory contains an example of RetroBSD kernel build +using plain Makefile (no configsys or kconfig tools). diff --git a/sys/pic32/diag/Makefile b/tools/diag/Makefile similarity index 85% rename from sys/pic32/diag/Makefile rename to tools/diag/Makefile index ff2b8d6..0744184 100644 --- a/sys/pic32/diag/Makefile +++ b/tools/diag/Makefile @@ -12,7 +12,7 @@ DEFS += -I. -I$(H) -DKERNEL -DPIC32MX7 # CPU frequency 80 MHz. DEFS += -DCPU_KHZ=80000 -DEFS += -DBUS_KHZ=80000 +DEFS += -DBUS_KHZ=80000 -DBUS_DIV=1 # # Ethernet/USB Starter Kit with I/O Expansion board @@ -54,27 +54,6 @@ DEFS += -DLED_DISK_PORT=TRISE -DLED_DISK_PIN=1 -DLED_DISK_INVERT DEFS += -DLED_KERNEL_PORT=TRISE -DLED_KERNEL_PIN=2 -DLED_KERNEL_INVERT DEFS += -DLED_TTY_PORT=TRISE -DLED_TTY_PIN=3 -DLED_TTY_INVERT -# -# Include or exclude drivers -# - -# General Purpose I/O -DRIVER_GPIO = no - -# Basic ADC interface -DRIVER_ADC = no - -# Power control (power LED, and soft power-off by button) -# requires supported PSU (ATX) -DRIVER_POWER = no - -POWER_LED_PORT = TRISG -POWER_LED_PIN = 12 -POWER_SWITCH_PORT = TRISG -POWER_SWITCH_PIN = 0 -POWER_CONTROL_PORT = TRISE -POWER_CONTROL_PIN = 9 - DEPFLAGS = -MT $@ -MD -MP -MF .deps/$*.dep CFLAGS = -O $(DEFS) $(DEPFLAGS) ASFLAGS = $(DEFS) $(DEPFLAGS) @@ -101,9 +80,6 @@ KERNOBJ += rdisk.o rd_sd.o spi_bus.o # Include any local specific configuration overrides -include Makefile.local -# This makefile does the work including the right files and options for the drivers -include ../drivers.mk - all: .deps sys machine diag.elf $(SIZE) diag.elf diff --git a/sys/pic32/diag/main.c b/tools/diag/main.c similarity index 100% rename from sys/pic32/diag/main.c rename to tools/diag/main.c