From 092c340a2062fa98b7387fc5fd63578ddae7d0b6 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 15 Jul 2020 19:40:55 -0400 Subject: [1/4] Remove SH support and all archos targets This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061 --- flash/minimon/Makefile | 53 ---------------- flash/minimon/README | 9 --- flash/minimon/minimon.c | 156 ---------------------------------------------- flash/minimon/minimon.h | 24 ------- flash/minimon/minimon.lds | 60 ------------------ 5 files changed, 302 deletions(-) delete mode 100644 flash/minimon/Makefile delete mode 100644 flash/minimon/README delete mode 100644 flash/minimon/minimon.c delete mode 100644 flash/minimon/minimon.h delete mode 100644 flash/minimon/minimon.lds (limited to 'flash/minimon') diff --git a/flash/minimon/Makefile b/flash/minimon/Makefile deleted file mode 100644 index 16b6c2724e..0000000000 --- a/flash/minimon/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# __________ __ ___. -# Open \______ \ ____ ____ | | _\_ |__ _______ ___ -# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -# \/ \/ \/ \/ \/ -# $Id$ -# - -CC = sh-elf-gcc -LD = sh-elf-ld -AR = sh-elf-ar -AS = sh-elf-as -OC = sh-elf-objcopy - -FIRMWARE := ../../firmware -TOOLSDIR=../../tools - -TARGET = minimon -LDS := $(TARGET).lds - -INCLUDES= -I$(FIRMWARE)/export -I. -I$(OBJDIR) -OBJDIR := . - -CFLAGS = -fpic -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES) -AFLAGS += -small -relax - - -ifdef DEBUG - DEFINES := -DDEBUG - CFLAGS += -g -endif - -SRC := $(wildcard *.c) - -OBJS := $(SRC:%.c=$(OBJDIR)/%.o) - -LINKFILE = $(OBJDIR)/$(TARGET).lds - - -$(OBJDIR)/$(TARGET).bin : $(OBJDIR)/$(TARGET).elf - $(OC) -O binary $(OBJDIR)/$(TARGET).elf $(OBJDIR)/$(TARGET).bin - $(TOOLSDIR)/sh2d $(OBJDIR)/$(TARGET).bin -o 0x0ffff000 > $(OBJDIR)/$(TARGET).asm - -$(OBJDIR)/$(TARGET).elf : $(OBJS) - $(CC) -Os -nostdlib -o $(OBJDIR)/$(TARGET).elf -L$(OBJDIR) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$(TARGET).map - - -clean: - -rm -f $(OBJS) $(OBJDIR)/$(TARGET).asm \ - $(OBJDIR)/$(TARGET).bin \ - $(OBJDIR)/$(TARGET).elf \ - $(OBJDIR)/$(TARGET).map diff --git a/flash/minimon/README b/flash/minimon/README deleted file mode 100644 index d2dc1707a6..0000000000 --- a/flash/minimon/README +++ /dev/null @@ -1,9 +0,0 @@ -(c) 2003 by Jörg Hohensohn - -MiniMon is the tiny but powerful-enough piece of code that can be loaded -with the UART boot mod. -It allows to read and write memory, flash program, execute code. -This is suitable to reflash the box, load Rockbox or the gdb stub, etc. - -The SVN version is linked to 0x0ffff000, i.e. start of IRAM. -This address has to match the address uart_boot downloads it to. \ No newline at end of file diff --git a/flash/minimon/minimon.c b/flash/minimon/minimon.c deleted file mode 100644 index aca9cb5523..0000000000 --- a/flash/minimon/minimon.c +++ /dev/null @@ -1,156 +0,0 @@ -// minimalistic monitor -// to be loaded with the UART boot feature -// capable of reading and writing bytes, commanded by UART - -#include "sh7034.h" -#include "minimon.h" - -// scalar types -typedef unsigned char UINT8; -typedef unsigned short UINT16; -typedef unsigned long UINT32; - -typedef void(*tpFunc)(void); // type for exec -typedef int(*tpMain)(void); // type for start vector to main() - - -// prototypes -int main(void); - -// our binary has to start with a vector to the entry point -tpMain start_vector[] __attribute__ ((section (".startvector"))) = {main}; - - -static UINT8 uart_read(void) -{ - UINT8 byte; - while (!(SSR1 & SCI_RDRF)); // wait for char to be available - byte = RDR1; - SSR1 &= ~SCI_RDRF; - return byte; -} - - -static void uart_write(UINT8 byte) -{ - while (!(SSR1 & SCI_TDRE)); // wait for transmit buffer empty - TDR1 = byte; - SSR1 &= ~SCI_TDRE; -} - - -int main(void) -{ - UINT8 cmd; - UINT32 addr; - UINT32 size; - UINT32 content; - volatile UINT8* paddr = 0; - volatile UINT8* pflash = 0; // flash base address - - while (1) - { - cmd = uart_read(); - switch (cmd) - { - case BAUDRATE: - content = uart_read(); - uart_write(cmd); // acknowledge by returning the command value - while (!(SSR1 & SCI_TEND)); // wait for empty shift register, before changing baudrate - BRR1 = content; - break; - - case ADDRESS: - addr = (uart_read() << 24) | (uart_read() << 16) | (uart_read() << 8) | uart_read(); - paddr = (UINT8*)addr; - pflash = (UINT8*)(addr & 0xFFF80000); // round down to 512k align - uart_write(cmd); // acknowledge by returning the command value - break; - - case BYTE_READ: - content = *paddr++; - uart_write(content); // the content is the ack - break; - - case BYTE_WRITE: - content = uart_read(); - *paddr++ = content; - uart_write(cmd); // acknowledge by returning the command value - break; - - case BYTE_READ16: - size = 16; - while (size--) - { - content = *paddr++; - uart_write(content); // the content is the ack - } - break; - - case BYTE_WRITE16: - size = 16; - while (size--) - { - content = uart_read(); - *paddr++ = content; - } - uart_write(cmd); // acknowledge by returning the command value - break; - - case BYTE_FLASH: - content = uart_read(); - pflash[0x5555] = 0xAA; // set flash to command mode - pflash[0x2AAA] = 0x55; - pflash[0x5555] = 0xA0; // byte program command - *paddr++ = content; - uart_write(cmd); // acknowledge by returning the command value - break; - - case BYTE_FLASH16: - size = 16; - while (size--) - { - content = uart_read(); - pflash[0x5555] = 0xAA; // set flash to command mode - pflash[0x2AAA] = 0x55; - pflash[0x5555] = 0xA0; // byte program command - *paddr++ = content; - } - uart_write(cmd); // acknowledge by returning the command value - break; - - case HALFWORD_READ: - content = *(UINT16*)paddr; - paddr += 2; - uart_write(content >> 8); // highbyte - uart_write(content & 0xFF); // lowbyte - break; - - case HALFWORD_WRITE: - content = uart_read() << 8 | uart_read(); - *(UINT16*)paddr = content; - paddr += 2; - uart_write(cmd); // acknowledge by returning the command value - break; - - case EXECUTE: - { - tpFunc pFunc = (tpFunc)paddr; - pFunc(); - uart_write(cmd); // acknowledge by returning the command value - } - break; - - - default: - { - volatile UINT16* pPortB = (UINT16*)0x05FFFFC2; - *pPortB |= 1 << 6; // bit 6 is red LED on - uart_write(~cmd); // error acknowledge - } - - } // case - } - - return 0; -} diff --git a/flash/minimon/minimon.h b/flash/minimon/minimon.h deleted file mode 100644 index b6e9805ecf..0000000000 --- a/flash/minimon/minimon.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _MINIMON_H -#define _MINIMON_H - - -// Commands -// all multibyte values (address, halfwords) are passed as big endian -// (most significant of the bytes first) - -// set the address (all read/write commands will auto-increment it) -#define BAUDRATE 0x00 // followed by BRR value; response: command byte -#define ADDRESS 0x01 // followed by 4 bytes address; response: command byte -#define BYTE_READ 0x02 // response: 1 byte content -#define BYTE_WRITE 0x03 // followed by 1 byte content; response: command byte -#define BYTE_READ16 0x04 // response: 16 bytes content -#define BYTE_WRITE16 0x05 // followed by 16 bytes; response: command byte -#define BYTE_FLASH 0x06 // followed by 1 byte content; response: command byte -#define BYTE_FLASH16 0x07 // followed by 16 bytes; response: command byte -#define HALFWORD_READ 0x08 // response: 2 byte content -#define HALFWORD_WRITE 0x09 // followed by 2 byte content; response: command byte -#define EXECUTE 0x0A // response: command byte if call returns -#define VERSION 0x0B // response: version - - -#endif // _MINIMON_H diff --git a/flash/minimon/minimon.lds b/flash/minimon/minimon.lds deleted file mode 100644 index 14150b2123..0000000000 --- a/flash/minimon/minimon.lds +++ /dev/null @@ -1,60 +0,0 @@ -OUTPUT_FORMAT(elf32-sh) -INPUT(minimon.o) - -MEMORY -{ - IRAM : ORIGIN = 0x0FFFF000, LENGTH = 0x500 -} - -SECTIONS -{ - .startvector : - { - *(.startvector) - . = ALIGN(0x4); - } > IRAM - - .got : - { - *(.got) - } > IRAM - - .got.plt : - { - *(.got.plt) - } > IRAM - - .rela.got : - { - *(.rela.got) - } > IRAM - - .text : - { - . = ALIGN(0x200); - *(.entry) - *(.text) - . = ALIGN(0x4); - } > IRAM - - .data : - { - *(.data) - } > IRAM - - .rodata : - { - *(.rodata) - . = ALIGN(0x4); - } > IRAM - - .bss : - { - *(.bss) - } > IRAM - - .stack : - { - *(.stack) - } > IRAM -} -- cgit