1 Commits

Author SHA1 Message Date
Serge
427487850c Use pic32-tools from uecide.org.
Cannot build user binaries yet though.
2022-05-23 20:29:21 -07:00
17 changed files with 63 additions and 172 deletions

View File

@@ -262,7 +262,7 @@ bad1: (void)lseek(rfd, (off_t)r_off, SEEK_SET);
void symobj()
{
register RLIB *rp;
char hb[sizeof(struct ar_hdr) + 1];
char hb[sizeof(struct ar_hdr) + 1 + 64];
long ransize, baseoff;
/* Rewind the archive, leaving the magic number. */

View File

@@ -3,18 +3,19 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips)
OUTPUT_ARCH(pic32mx)
ENTRY(_start)
/* Required by Microchip C32 linker */
/*MEMORY
MEMORY
{
kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x80000
kseg0_boot_mem : ORIGIN = 0x9FC00490, LENGTH = 0x970
exception_mem : ORIGIN = 0x9FC01000, LENGTH = 0x1000
kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0x490
kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 512K
exception_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x1000
kseg0_boot_mem (rx) : ORIGIN = 0x9FC00000, LENGTH = 12K-16
kseg1_boot_mem (rx) : ORIGIN = 0xBFC00000, LENGTH = 0x490
kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x20000
}*/
}
_min_heap_size = 0;
SECTIONS
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips)
OUTPUT_ARCH(pic32mx)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -3,7 +3,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips)
OUTPUT_ARCH(pic32mx)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -1,77 +1,8 @@
# chipKIT PIC32 compiler from UECIDE
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# PIC32 compiler from UECIDE
# Use UECIDE package from http://uecide.org/download
ifndef MIPS_GCC_PREFIX
ifdef UECIDE
ifeq ($(UECIDE)/compilers/pic32-tools-452/bin/pic32-gcc,$(wildcard $(UECIDE)/compilers/pic32-tools-452/bin/pic32-gcc))
MIPS_GCC_PREFIX = $(UECIDE)/compilers/pic32-tools-452/bin/pic32-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif
endif
# chipKIT PIC32 compiler on Linux
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Download from https://github.com/jasonkajita/chipKIT-cxx/downloads
# and unzip to /usr/local.
# Need to copy pic32-tools/pic32mx/include/stdarg.h
# to pic32-tools/lib/gcc/pic32mx/4.5.1/include.
# MPLABX C32 compiler doesn't support some functionality
# we need, so use chipKIT compiler by default.
ifndef MIPS_GCC_PREFIX
ifeq (/usr/local/pic32-tools/bin/pic32-gcc,$(wildcard /usr/local/pic32-tools/bin/pic32-gcc))
MIPS_GCC_PREFIX = /usr/local/pic32-tools/bin/pic32-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif
# Generic MIPS toolchain
# ~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
ifndef MIPS_GCC_PREFIX
ifeq (/usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc,$(wildcard /usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-gcc-4.8.1/bin/mips-elf-
endif
endif
# Generic MIPS toolchain on *BSD
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
# Maybe you can install it from packages one day too.
ifndef MIPS_GCC_PREFIX
ifeq (/usr/local/mips-elf/bin/mips-elf-gcc,$(wildcard /usr/local/mips-elf/bin/mips-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-elf/bin/mips-elf-
endif
endif
# Mentor Sourcery CodeBench Lite toolchain
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ifndef MIPS_GCC_PREFIX
# Download a Linux binary package from
# https://sourcery.mentor.com/GNUToolchain/release2641
ifeq (/usr/local/mips-2013.11/bin/mips-sde-elf-gcc,$(wildcard /usr/local/mips-2013.11/bin/mips-sde-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-2013.11/bin/mips-sde-elf-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif
ifndef MIPS_GCC_PREFIX
# Download a Linux binary package from
# https://sourcery.mentor.com/GNUToolchain/release2774
ifeq (/usr/local/mips-2014.05/bin/mips-sde-elf-gcc,$(wildcard /usr/local/mips-2014.05/bin/mips-sde-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-2014.05/bin/mips-sde-elf-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif
# Imagination Codescape MIPS SDK Essentials
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Download a Linux binary package from:
# http://community.imgtec.com/developers/mips/tools/codescape-mips-sdk/download-codescape-mips-sdk-essentials/
ifndef MIPS_GCC_ROOT
ifeq (/opt/imgtec/Toolchains/mips-mti-elf/2015.01-7,$(wildcard /opt/imgtec/Toolchains/mips-mti-elf/2015.01-7))
MIPS_GCC_ROOT = /opt/imgtec/Toolchains/mips-mti-elf/2015.01-7
ifeq ($(HOME)/.uecide/compilers/pic32-tools/bin/pic32-gcc,$(wildcard $(HOME)/.uecide/compilers/pic32-tools/bin/pic32-gcc))
MIPS_GCC_PREFIX = $(HOME)/.uecide/compilers/pic32-tools/bin/pic32-
MIPS_GCC_FORMAT = elf32-tradlittlemips
endif
endif

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips)
OUTPUT_ARCH(pic32mx)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips)
OUTPUT_ARCH(pic32mx)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips)
OUTPUT_ARCH(pic32mx)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips)
OUTPUT_ARCH(pic32mx)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -5,7 +5,7 @@
*/
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_ARCH(mips)
OUTPUT_ARCH(pic32mx)
ENTRY(_reset_vector_)
MEMORY
{

View File

@@ -4,75 +4,14 @@ RELEASE = 0.0
BUILD = $(shell git rev-list HEAD --count)
VERSION = $(RELEASE)-$(BUILD)
# chipKIT PIC32 compiler from UECIDE
ifdef UECIDE
# PIC32 compiler from UECIDE
# Use UECIDE package from http://uecide.org/download
ifndef GCCPREFIX
ifeq ($(UECIDE)/compilers/pic32-tools-452/bin/pic32-gcc,$(wildcard $(UECIDE)/compilers/pic32-tools-452/bin/pic32-gcc))
GCCPREFIX = ${UECIDE}/compilers/pic32-tools-452/bin/pic32-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES = -I${UECIDE}/compilers/pic32-tools-452/lib/gcc/pic32mx/4.5.2/include
endif
endif
endif
# chipKIT PIC32 compiler on Linux
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Download from https://github.com/jasonkajita/chipKIT-cxx/downloads
# and unzip to /usr/local.
# Need to copy pic32-tools/pic32mx/include/stdarg.h
# to pic32-tools/lib/gcc/pic32mx/4.5.1/include.
# MPLABX C32 compiler doesn't support some functionality
# we need, so use chipKIT compiler by default.
ifndef GCCPREFIX
ifeq (/usr/local/pic32-tools/bin/pic32-gcc,$(wildcard /usr/local/pic32-tools/bin/pic32-gcc))
GCCPREFIX = /usr/local/pic32-tools/bin/pic32-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES = -I/usr/local/pic32-tools/lib/gcc/pic32mx/4.5.1/include
endif
endif
# Generic MIPS toolchain
# ~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
ifndef GCCPREFIX
ifeq (/usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc,$(wildcard /usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc))
GCCPREFIX = /usr/local/mips-gcc-4.8.1/bin/mips-elf-
LDFLAGS =
INCLUDES =
endif
endif
# Generic MIPS toolchain on *BSD
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
# Maybe you can install it from packages one day too.
ifndef GCCPREFIX
ifeq (/usr/local/mips-elf/bin/mips-elf-gcc,$(wildcard /usr/local/mips-elf/bin/mips-elf-gcc))
GCCPREFIX = /usr/local/mips-elf/bin/mips-elf-
LDFLAGS =
INCLUDES =
endif
endif
# Mentor Sourcery CodeBench Lite toolchain
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can download a Linux or Windows binary package from
# https://sourcery.mentor.com/GNUToolchain/release2641
ifndef GCCPREFIX
ifeq (/usr/local/mips-2013.11/bin/mips-sde-elf-gcc,$(wildcard /usr/local/mips-2013.11/bin/mips-sde-elf-gcc))
GCCPREFIX = /usr/local/mips-2013.11/bin/mips-sde-elf-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES =
endif
endif
ifndef GCCPREFIX
ifeq (/usr/local/mips-2014.05/bin/mips-sde-elf-gcc,$(wildcard /usr/local/mips-2014.05/bin/mips-sde-elf-gcc))
GCCPREFIX = /usr/local/mips-2014.05/bin/mips-sde-elf-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES =
endif
ifeq ($(HOME)/.uecide/compilers/pic32-tools/bin/pic32-gcc,$(wildcard $(HOME)/.uecide/compilers/pic32-tools/bin/pic32-gcc))
GCCPREFIX = $(HOME)/.uecide/compilers/pic32-tools/bin/pic32-
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
INCLUDES = -I$(HOME)/.uecide/compilers/pic32-tools/lib/gcc/pic32mx/4.5.2/include
endif
endif
ifndef GCCPREFIX

View File

@@ -27,6 +27,7 @@
#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
#include <sys/sysmacros.h>
#define FUSE_USE_VERSION 26
#include <fuse.h>

View File

@@ -125,15 +125,15 @@ struct config {
/*
* Config has a global notion of which architecture is being used.
*/
int arch;
char *archname;
extern int arch;
extern char *archname;
#define ARCH_PIC32 1
/*
* For each architecture, a set of CPU's may be specified as supported.
* These and the options (below) are put in the C flags in the makefile.
*/
struct cputype {
extern struct cputype {
char *cpu_name;
struct cputype *cpu_next;
} *cputype;
@@ -143,7 +143,7 @@ struct cputype {
* but which may also specify values for the options.
* A separate set of options may be defined for make-style options.
*/
struct opt {
extern struct opt {
char *op_name;
char *op_value;
struct opt *op_next;
@@ -152,30 +152,30 @@ struct opt {
/*
* Mapping of signal names to pins.
*/
struct signal {
extern struct signal {
char *sig_name;
int sig_pin;
int sig_invert;
struct signal *sig_next;
} *siglist;
char *board;
char *ldscript;
extern char *board;
extern char *ldscript;
int do_trace;
extern int do_trace;
struct device *dtab;
extern struct device *dtab;
char errbuf[80];
int yyline;
extern char errbuf[80];
extern int yyline;
struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
extern struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
int zone, hadtz;
int dst;
int debugging;
extern int zone, hadtz;
extern int dst;
extern int debugging;
int maxusers;
extern int maxusers;
#define eq(a,b) (!strcmp(a,b))

View File

@@ -102,6 +102,7 @@
#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <sys/sysmacros.h>
struct device cur;
struct device *curp = 0;

View File

@@ -38,6 +38,23 @@
#include "y.tab.h"
#include "config.h"
int arch;
char *archname;
struct cputype *cputype;
struct opt *opt, *mkopt;
struct signal *siglist;
char *board;
char *ldscript;
int do_trace;
struct device *dtab;
char errbuf[80];
int yyline;
struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
int zone, hadtz;
int dst;
int debugging;
int maxusers;
/*
* Config builds a set of files for building a UNIX
* system given a description of the desired system.

View File

@@ -38,6 +38,7 @@
#include <unistd.h>
#include <ctype.h>
#include <sys/sysmacros.h>
void swapconf()
{

View File

@@ -373,7 +373,7 @@ static int load_nand_flash_file (nand_flash_1g_data_t * d)
int i, j = 0;
struct dirent *ent = NULL;
DIR *p_dir;
char file_path[64];
char file_path[1024];
char *file_name;
char block_number[16];
int fd;