1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2025-04-21 12:27:27 +03:00

lots of stuff

This commit is contained in:
Bas Wijnen
2009-10-31 09:32:23 +01:00
parent afb496f20b
commit a383b3ffd3
28 changed files with 441 additions and 230 deletions

View File

@@ -17,25 +17,25 @@
load = 0x80000000
ARCH_CXXFLAGS = -DNUM_THREADS=3
ARCH_CPPFLAGS = -Imips -Wa,-mips32
ARCH_CXXFLAGS = -DNUM_THREADS=3 -DTRENDTAC
ARCH_CPPFLAGS = -I. -Imips -Imips/trendtac -Wa,-mips32
CROSS = mipsel-linux-gnu-
OBJDUMP = $(CROSS)objdump
junk = mdebug.abi32 reginfo comment pdr
OBJCOPYFLAGS = $(addprefix --remove-section=.,$(junk))
arch_iris_sources = mips/interrupts.cc mips/arch.cc
boot_sources = mips/init.cc
arch_headers = mips/arch.hh mips/jz4730.hh
boot_sources = mips/init.cc mips/trendtac/board.cc
arch_headers = mips/arch.hh mips/trendtac/jz4730.hh mips/trendtac/board.hh
boot_threads = init gpio lcd
uimage:
mips/boot.o: TARGET_FLAGS = -DMEMORY_SIZE = "128 << 20"
mips/threadlist.o: $(boot_threads)
mips/boot.o: TARGET_FLAGS = -DMEMORY_SIZE="128 << 20"
mips/trendtac/threadlist.o: $(addsuffix .elf,$(boot_threads))
mips/init.o: TARGET_FLAGS = -I/usr/include
$(boot_threads): TARGET_FLAGS = -I.
$(addprefix boot-programs/,$(addsuffix .cc,$(boot_threads))): boot-programs/devices.hh boot-programs/init.hh
$(addsuffix .elf,$(boot_threads)): TARGET_FLAGS = -I.
$(addprefix boot-programs/,$(addsuffix .cc,$(boot_threads))): devices.hh
lcd: boot-programs/charset.data
boot-programs/charset.data: boot-programs/charset
@@ -58,4 +58,4 @@ iris: mips/entry.o $(subst .cc,.o,$(iris_sources)) mips/trendtac/threadlist.o mi
%.gz: %
gzip < $< > $@
ARCH_CLEAN_FILES = uimage $(boot_threads) mips/*.o boot-programs/charset.data iris iris.raw iris.raw.gz
ARCH_CLEAN_FILES = uimage $(addsuffix .elf,$(boot_threads)) mips/*.o boot-programs/charset.data iris iris.raw iris.raw.gz

View File

@@ -16,6 +16,10 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#define ARCH
#define INIT
#include "kernel.hh"
void board_init ():
// Disable all gpio interrupts and alternate functions initially.
for unsigned i = 0; i < 4; ++i:
@@ -54,3 +58,12 @@ void board_init ():
ost_set_count (0, 1)
ost_set_mode (0, OST_TCSR_UIE | OST_TCSR_CKS_EXTAL)
ost_enable_channel (0)
void arch_reboot ():
// Wait for serial port to be done.
while !(UART0_LSR & UARTLSR_TEMT):
// Reboot.
wdt_set_count (~0)
wdt_start ()
// Wait for wdt to trigger reboot.
while true:

19
mips/trendtac/board.hhp Normal file
View File

@@ -0,0 +1,19 @@
#pypp 0
// Iris: micro-kernel for a capability-based operating system.
// mips/trendtac/board.hhp: nanonote-specific declarations and type definitions.
// Copyright 2009 Bas Wijnen <wijnen@debian.org>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "jz4730.hh"

View File

@@ -62,7 +62,7 @@
#define UPRT_PHYSICAL 0x10061000
#define KBC_PHYSICAL 0x10062000
#ifdef __KERNEL
#ifdef __KERNEL__
// In kernel space you need to add 0xa0000000 to see them unmapped uncached in kseg2.
#define HARB_BASE (HARB_PHYSICAL + 0xa0000000)
#define EMC_BASE (EMC_PHYSICAL + 0xa0000000)
@@ -2324,7 +2324,7 @@ static __inline__ void udelay (unsigned us):
for unsigned k = 0; k < 100; ++k:
GPIO_GPDR (0) = GPIO_GPDR (0)
#ifndef __KERNEL
#ifndef __KERNEL__
static __inline__ void cdelay (unsigned ds):
Kernel::my_receiver.set_alarm (ds * (HZ / 100))
Kernel::Cap ().call (~0)
@@ -3029,7 +3029,7 @@ static __inline__ void gpio_as_cim ():
#define i2c_read() ( I2C_DR )
#define i2c_write(val) ( I2C_DR = (val) )
#ifndef __KERNEL
#ifndef __KERNEL__
static __inline__ void i2c_open ():
i2c_set_clk (JZ_EXTAL, 10000)
i2c_enable ()

View File

@@ -21,15 +21,15 @@
.balign 0x1000
thread0:
.incbin "init"
.incbin "init.elf"
.balign 0x1000
thread1:
.incbin "lcd"
.incbin "lcd.elf"
.balign 0x1000
thread2:
.incbin "gpio"
.incbin "gpio.elf"
thread3: