diff options
Diffstat (limited to 'usr/src')
295 files changed, 0 insertions, 54033 deletions
diff --git a/usr/src/boot/sys/boot/Makefile.amd64 b/usr/src/boot/sys/boot/Makefile.amd64 deleted file mode 100644 index 384cf7a632..0000000000 --- a/usr/src/boot/sys/boot/Makefile.amd64 +++ /dev/null @@ -1,12 +0,0 @@ -# $FreeBSD$ - -SUBDIR+= efi -SUBDIR+= libstand32 -SUBDIR+= zfs -SUBDIR+= userboot - -.if ${MK_FORTH} != "no" -SUBDIR+= ficl32 -.endif - -SUBDIR+= i386 diff --git a/usr/src/boot/sys/boot/Makefile.arm b/usr/src/boot/sys/boot/Makefile.arm deleted file mode 100644 index bb0e01cb5f..0000000000 --- a/usr/src/boot/sys/boot/Makefile.arm +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -.if ${MK_FDT} != "no" -SUBDIR+= fdt -.endif - -SUBDIR+= efi uboot diff --git a/usr/src/boot/sys/boot/Makefile.arm64 b/usr/src/boot/sys/boot/Makefile.arm64 deleted file mode 100644 index 116e903020..0000000000 --- a/usr/src/boot/sys/boot/Makefile.arm64 +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -.if ${MK_FDT} != "no" -SUBDIR+= fdt -.endif - -SUBDIR+= efi diff --git a/usr/src/boot/sys/boot/Makefile.i386 b/usr/src/boot/sys/boot/Makefile.i386 deleted file mode 100644 index e7de353a56..0000000000 --- a/usr/src/boot/sys/boot/Makefile.i386 +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -SUBDIR+= efi -SUBDIR+= libstand32 -SUBDIR+= zfs diff --git a/usr/src/boot/sys/boot/Makefile.sparc64 b/usr/src/boot/sys/boot/Makefile.sparc64 deleted file mode 100644 index 1064a267db..0000000000 --- a/usr/src/boot/sys/boot/Makefile.sparc64 +++ /dev/null @@ -1,4 +0,0 @@ -# $FreeBSD$ - -SUBDIR+= ofw -SUBDIR+= zfs diff --git a/usr/src/boot/sys/boot/arm/Makefile b/usr/src/boot/sys/boot/arm/Makefile deleted file mode 100644 index 1d12d98316..0000000000 --- a/usr/src/boot/sys/boot/arm/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -SUBDIR= uboot - -.include <bsd.subdir.mk> diff --git a/usr/src/boot/sys/boot/arm/Makefile.inc b/usr/src/boot/sys/boot/arm/Makefile.inc deleted file mode 100644 index 265f86d1ed..0000000000 --- a/usr/src/boot/sys/boot/arm/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -.include "../Makefile.inc" diff --git a/usr/src/boot/sys/boot/arm/at91/Makefile b/usr/src/boot/sys/boot/arm/at91/Makefile deleted file mode 100644 index 266c0ad567..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -SUBDIR= libat91 boot0 boot0iic boot0spi boot2 bootiic bootspi - -.include <bsd.subdir.mk> diff --git a/usr/src/boot/sys/boot/arm/at91/Makefile.inc b/usr/src/boot/sys/boot/arm/at91/Makefile.inc deleted file mode 100644 index 3c6f5ca8b0..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/Makefile.inc +++ /dev/null @@ -1,57 +0,0 @@ -# $FreeBSD$ - -.if !target(__at91_boot_Makefile.inc__) -.PATH: ${.CURDIR}/../../../../libkern ${.CURDIR}/../../../../libkern/arm - -__at91_boot_Makefile.inc__: - -# tsc, bwct, kb920x, centipad are the supported flavors -BOOT_FLAVOR?=kb920x - -CFLAGS=-Os -mcpu=arm9 -ffreestanding \ - -I${.CURDIR}/../libat91 \ - -I${.CURDIR}/../../../.. \ - -I${.CURDIR}/../../../../arm \ - -D_KERNEL \ - -Wall -Waggregate-return \ - -Wnested-externs \ - -Wpointer-arith -Wshadow -Wwrite-strings \ - -Werror \ - -Wmissing-prototypes \ - -Wmissing-declarations -# -Wstrict-prototypes - -CFLAGS+=-DBOOT_${BOOT_FLAVOR:tu} - -LIBAT91=${.OBJDIR}/../libat91/libat91.a - -LD ?= ld -OBJCOPY ?= objcopy - -.if defined(P) -${P}: ${P}.out - ${OBJCOPY} -S -O binary ${P}.out ${.TARGET} - @set -- `ls -l ${.TARGET}`; x=$$((12288-$$5)); \ - echo "$$x bytes available"; test $$x -ge 0 - -${P}.out: ${OBJS} - ${LD} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LIBAT91} - -CLEANFILES+= ${P} ${P}.out -.endif - -.if defined(WITH_TAG_LIST) -MK_TAG_LIST:=yes -.else -MK_TAG_LIST:=no -.endif - -.if defined(WITH_FPGA) -MK_FPGA:=yes -.else -MK_FPGA:=no -.endif - -.endif - -.include "../Makefile.inc" diff --git a/usr/src/boot/sys/boot/arm/at91/boot0/Makefile b/usr/src/boot/sys/boot/arm/at91/boot0/Makefile deleted file mode 100644 index 8c22cc9967..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot0/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../libat91 - -P=boot0 -FILES=${P} -SRCS=arm_init.S main.c -MAN= -LDFLAGS=-e 0 -T ${.CURDIR}/linker.cfg -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -.include <bsd.prog.mk> - -CFLAGS+=-DBOOT_BOOT0 diff --git a/usr/src/boot/sys/boot/arm/at91/boot0/README b/usr/src/boot/sys/boot/arm/at91/boot0/README deleted file mode 100644 index 1d617d6fd8..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot0/README +++ /dev/null @@ -1,7 +0,0 @@ -This is a bootstrap bootloader. It is intended to be used when the -AT91RM9200 is running xmodem over DBGU. It will download the next stage -of the booting process (or the recovery program) and jump to it. It loads -the program at a 1MB offset into SDRAM. Programs are expected to be -smaller than this and copy themselves to the right location. - -$FreeBSD$ diff --git a/usr/src/boot/sys/boot/arm/at91/boot0/linker.cfg b/usr/src/boot/sys/boot/arm/at91/boot0/linker.cfg deleted file mode 100644 index b231893969..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot0/linker.cfg +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * - * Filename: linker.cfg - * - * linker config file used for internal RAM or eeprom images at address 0. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin move data to SDRAM - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - ******************************************************************************/ -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", - "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(start) -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = 0; - .text : - { - *(.text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t.*) - *(.glue_7t) *(.glue_7) - } - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - .data : - { - __data_start = . ; - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - SORT(CONSTRUCTORS) - } - _edata = .; - PROVIDE (edata = .); - __bss_start = .; - __bss_start__ = .; - .sbss : - { - PROVIDE (__sbss_start = .); - PROVIDE (___sbss_start = .); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - PROVIDE (__sbss_end = .); - PROVIDE (___sbss_end = .); - } - .bss : - { - *(.dynbss) - *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - /* Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. */ - . = ALIGN(32 / 8); - } - . = ALIGN(32 / 8); - _end = .; - _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; - PROVIDE (end = .); -} diff --git a/usr/src/boot/sys/boot/arm/at91/boot0/main.c b/usr/src/boot/sys/boot/arm/at91/boot0/main.c deleted file mode 100644 index 36dfe82144..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot0/main.c +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "at91rm9200.h" -#include "lib.h" -#include "at91rm9200_lowlevel.h" - -typedef void fn_t(void); - -int main(void); - -int -main(void) -{ - char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ - fn_t *fn = (fn_t *)(SDRAM_BASE + (1 << 20)); /* Load to base + 1MB */ - - while (xmodem_rx(addr) == -1) - continue; - fn(); - return (0); -} diff --git a/usr/src/boot/sys/boot/arm/at91/boot0iic/Makefile b/usr/src/boot/sys/boot/arm/at91/boot0iic/Makefile deleted file mode 100644 index af93ce2e48..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot0iic/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../libat91 - -P=boot0iic -FILES=${P} -SRCS=arm_init.S main.c -MAN= -LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -.include <bsd.prog.mk> - -CFLAGS+=-DBOOT_BOOT0 diff --git a/usr/src/boot/sys/boot/arm/at91/boot0iic/main.c b/usr/src/boot/sys/boot/arm/at91/boot0iic/main.c deleted file mode 100644 index 2a81b937ae..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot0iic/main.c +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "at91rm9200.h" -#include "lib.h" -#include "at91rm9200_lowlevel.h" - -int main(void); - -int -main(void) -{ - char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ - int len, sec; - - printf("\nSend data to be written into EEPROM\n"); - while ((len = xmodem_rx(addr)) == -1) - continue; - sec = GetSeconds() + 1; - while (sec >= GetSeconds()) - continue; - printf("\nWriting EEPROM from 0x%x to addr 0, 0x%x bytes\n", addr, - len); - InitEEPROM(); - printf("init done\n"); - WriteEEPROM(0, addr, len); - printf("\nWrote %d bytes. Press reset\n", len); - return (1); -} diff --git a/usr/src/boot/sys/boot/arm/at91/boot0spi/Makefile b/usr/src/boot/sys/boot/arm/at91/boot0spi/Makefile deleted file mode 100644 index 207d6204cd..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot0spi/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../libat91 - -P=boot0spi -FILES=${P} -SRCS=arm_init.S main.c -MAN= -LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -.include <bsd.prog.mk> - -CFLAGS+=-DBOOT_BOOT0 diff --git a/usr/src/boot/sys/boot/arm/at91/boot0spi/main.c b/usr/src/boot/sys/boot/arm/at91/boot0spi/main.c deleted file mode 100644 index cac037b5b0..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot0spi/main.c +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "at91rm9200.h" -#include "lib.h" -#include "at91rm9200_lowlevel.h" -#include "spi_flash.h" - -#define OFFSET 0 - -int main(void); - -int -main(void) -{ - int len, i, j, off, sec; - char *addr = (char *)SDRAM_BASE + (1 << 20); /* download at + 1MB */ - char *addr2 = (char *)SDRAM_BASE + (2 << 20); /* readback to + 2MB */ - - SPI_InitFlash(); - printf("Waiting for data\n"); - while ((len = xmodem_rx(addr)) == -1) - continue; - printf("Writing %u bytes at %u\n", len, OFFSET); - for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { - off = i + OFFSET; - for (j = 0; j < 10; j++) { - SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE); - SPI_ReadFlash(off, addr2 + i, FLASH_PAGE_SIZE); - if (p_memcmp(addr + i, addr2 + i, FLASH_PAGE_SIZE) == 0) - break; - } - if (j >= 10) - printf("Bad Readback at %u\n", i); - } - sec = GetSeconds() + 2; - while (sec <= GetSeconds()) - continue; - printf("Done\n"); - reset(); - return (1); -} diff --git a/usr/src/boot/sys/boot/arm/at91/boot2/Makefile b/usr/src/boot/sys/boot/arm/at91/boot2/Makefile deleted file mode 100644 index 1150969bc4..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot2/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../libat91 ${.CURDIR}/../bootspi - -P=boot2 -FILES=${P} -SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c -MAN= -LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -.include <bsd.prog.mk> - -.if ${BOOT_FLAVOR} == "kb920x" -CFLAGS+=-DBOOT_IIC -.endif -CFLAGS+= \ - -I${.CURDIR}/../bootspi \ - -I${.CURDIR}/../../../common \ - -I${.CURDIR}/../../../.. \ - -D_KERNEL \ - -DUFS1_ONLY diff --git a/usr/src/boot/sys/boot/arm/at91/boot2/board.h b/usr/src/boot/sys/boot/arm/at91/boot2/board.h deleted file mode 100644 index 823d871f9e..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot2/board.h +++ /dev/null @@ -1,29 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -void Update(void); -void board_init(void); -int drvread(void *, unsigned, unsigned); diff --git a/usr/src/boot/sys/boot/arm/at91/boot2/boot2.c b/usr/src/boot/sys/boot/arm/at91/boot2/boot2.c deleted file mode 100644 index f7510a5a0f..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot2/boot2.c +++ /dev/null @@ -1,361 +0,0 @@ -/*- - * Copyright (c) 2008 John Hay - * Copyright (c) 2006 M Warner Losh <imp@freebsd.org> - * Copyright (c) 1998 Robert Nordier - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/disklabel.h> -#include <sys/diskmbr.h> -#include <sys/dirent.h> -#include <sys/reboot.h> - -#include <machine/elf.h> - -#include <stdarg.h> - -#include "lib.h" -#include "board.h" -#include "paths.h" -#include "rbx.h" - -#undef PATH_KERNEL -#define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" - -extern uint32_t _end; - -#define NOPT 6 - -static const char optstr[NOPT] = "agnrsv"; -static const unsigned char bootflags[NOPT] = { - RBX_ASKNAME, - RBX_GDB, - RBX_NOINTR, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE -}; - -unsigned board_id; /* board type to pass to kernel, if set by board_* code */ -unsigned dsk_start; -static char cmd[512]; -static char kname[1024]; -static uint32_t opts; -static uint8_t dsk_meta; - -int main(void); -static void load(void); -static int parse(void); -static int dskread(void *, unsigned, unsigned); -#ifdef FIXUP_BOOT_DRV -static void fixup_boot_drv(caddr_t, int, int, int); -#endif - -#define UFS_SMALL_CGBASE -#include "ufsread.c" - -#ifdef DEBUG -#define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__) -#else -#define DPRINTF(fmt, ...) -#endif - -static inline int -xfsread(ufs_ino_t inode, void *buf, size_t nbyte) -{ - if ((size_t)fsread(inode, buf, nbyte) != nbyte) - return -1; - return 0; -} - -static inline void -getstr(int c) -{ - char *s; - - s = cmd; - if (c == 0) - c = getc(10000); - for (;;) { - switch (c) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - xputchar(c); - } - c = getc(10000); - } -} - -int -main(void) -{ - int autoboot, c = 0; - ufs_ino_t ino; - - dmadat = (void *)(0x20000000 + (16 << 20)); - board_init(); - - autoboot = 1; - - /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); - - if (*cmd) { - if (parse()) - autoboot = 0; - printf("%s: %s\n", PATH_CONFIG, cmd); - /* Do not process this command twice */ - *cmd = 0; - } - - if (*kname == '\0') - strcpy(kname, PATH_KERNEL); - - /* Present the user with the boot2 prompt. */ - for (;;) { - printf("\nDefault: %s\nboot: ", kname); - if (!autoboot || - (OPT_CHECK(RBX_NOINTR) == 0 && (c = getc(2)) != 0)) - getstr(c); - xputchar('\n'); - autoboot = 0; - c = 0; - if (parse()) - xputchar('\a'); - else - load(); - } - return (1); -} - -static void -load(void) -{ - Elf32_Ehdr eh; - static Elf32_Phdr ep[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr; - int i, j; -#ifdef FIXUP_BOOT_DRV - caddr_t staddr; - int klen; - - staddr = (caddr_t)0xffffffff; - klen = 0; -#endif - if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); - return; - } - if (xfsread(ino, &eh, sizeof(eh))) - return; - if (!IS_ELF(eh)) { - printf("Invalid %s\n", "format"); - return; - } - fs_off = eh.e_phoff; - for (j = i = 0; i < eh.e_phnum && j < 2; i++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) - return; - if (ep[j].p_type == PT_LOAD) - j++; - } - for (i = 0; i < 2; i++) { - p = (caddr_t)ep[i].p_paddr; - fs_off = ep[i].p_offset; -#ifdef FIXUP_BOOT_DRV - if (staddr == (caddr_t)0xffffffff) - staddr = p; - klen += ep[i].p_filesz; -#endif - if (xfsread(ino, p, ep[i].p_filesz)) - return; - } - addr = eh.e_entry; -#ifdef FIXUP_BOOT_DRV - fixup_boot_drv(staddr, klen, bootslice, bootpart); -#endif - ((void(*)(int, int, int, int))addr)(opts & RBX_MASK, board_id, 0, 0); -} - -static int -parse() -{ - char *arg = cmd; - char *ep, *p; - int c, i; - - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return -1; - opts ^= OPT_SET(bootflags[i]); - } - } else { - arg--; - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } - } - arg = p; - } - return 0; -} - -static int -dskread(void *buf, unsigned lba, unsigned nblk) -{ - struct dos_partition *dp; - struct disklabel *d; - char *sec; - int i; - - if (!dsk_meta) { - sec = dmadat->secbuf; - dsk_start = 0; - if (drvread(sec, DOSBBSECTOR, 1)) - return -1; - dp = (void *)(sec + DOSPARTOFF); - for (i = 0; i < NDOSPART; i++) { - if (dp[i].dp_typ == DOSPTYP_386BSD) - break; - } - if (i == NDOSPART) - return -1; - /* - * Although dp_start is aligned within the disk - * partition structure, DOSPARTOFF is 446, which is - * only word (2) aligned, not longword (4) aligned. - * Cope by using memcpy to fetch the start of this - * partition. - */ - memcpy(&dsk_start, &dp[1].dp_start, 4); - if (drvread(sec, dsk_start + LABELSECTOR, 1)) - return -1; - d = (void *)(sec + LABELOFFSET); - if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { - printf("Invalid %s\n", "label"); - return -1; - } - if (!d->d_partitions[0].p_size) { - printf("Invalid %s\n", "partition"); - return -1; - } - dsk_start += d->d_partitions[0].p_offset; - dsk_start -= d->d_partitions[RAW_PART].p_offset; - dsk_meta++; - } - return drvread(buf, dsk_start + lba, nblk); -} - -#ifdef FIXUP_BOOT_DRV -/* - * fixup_boot_drv() will try to find the ROOTDEVNAME spec in the kernel - * and change it to what was specified on the comandline or /boot.conf - * file or to what was encountered on the disk. It will try to handle 3 - * different disk layouts, raw (dangerously dedicated), slice only and - * slice + partition. It will look for the following strings in the - * kernel, but if it is one of the first three, the string in the kernel - * must use the correct form to match the actual disk layout: - * - ufs:ad0a - * - ufs:ad0s1 - * - ufs:ad0s1a - * - ufs:ROOTDEVNAME - * In the case of the first three strings, only the "a" at the end and - * the "1" after the "s" will be modified, if they exist. The string - * length will not be changed. In the case of the last string, the - * whole string will be built up and nul, '\0' terminated. - */ -static void -fixup_boot_drv(caddr_t addr, int klen, int bs, int bp) -{ - const u_int8_t op[] = "ufs:ROOTDEVNAME"; - const u_int8_t op2[] = "ufs:ad0"; - u_int8_t *p, *ps; - - DPRINTF("fixup_boot_drv: 0x%x, %d, slice %d, partition %d\n", - (int)addr, klen, bs, bp); - if (bs > 4) - return; - if (bp > 7) - return; - ps = memmem(addr, klen, op, sizeof(op)); - if (ps != NULL) { - p = ps + 4; /* past ufs: */ - DPRINTF("Found it at 0x%x\n", (int)ps); - p[0] = 'a'; p[1] = 'd'; p[2] = '0'; /* ad0 */ - p += 3; - if (bs > 0) { - /* append slice */ - *p++ = 's'; - *p++ = bs + '0'; - } - if (disk_layout != DL_SLICE) { - /* append partition */ - *p++ = bp + 'a'; - } - *p = '\0'; - } else { - ps = memmem(addr, klen, op2, sizeof(op2) - 1); - if (ps != NULL) { - p = ps + sizeof(op2) - 1; - DPRINTF("Found it at 0x%x\n", (int)ps); - if (*p == 's') { - /* fix slice */ - p++; - *p++ = bs + '0'; - } - if (*p == 'a') - *p = bp + 'a'; - } - } - if (ps == NULL) { - printf("Could not locate \"%s\" to fix kernel boot device, " - "check ROOTDEVNAME is set\n", op); - return; - } - DPRINTF("Changed boot device to %s\n", ps); -} -#endif diff --git a/usr/src/boot/sys/boot/arm/at91/boot2/bwct_board.c b/usr/src/boot/sys/boot/arm/at91/boot2/bwct_board.c deleted file mode 100644 index fffdd2a817..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot2/bwct_board.c +++ /dev/null @@ -1,125 +0,0 @@ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> - -#include "at91rm9200_lowlevel.h" -#include "at91rm9200.h" -#include "emac.h" -#include "lib.h" -#include "ee.h" -#include "board.h" -#include "sd-card.h" - -unsigned char mac[6] = { 0x00, 0x0e, 0x42, 0x02, 0x00, 0x28 }; - -static void USART0_Init(); -static void USART1_Init(); -static void USART2_Init(); -static void USART3_Init(); -static void DS1672_Init(); - -static void -DS1672_Init() { - char buf[] = {0x00, 0xa9}; - - EEWrite(0xd0, buf, sizeof(buf)); -} - -static void -USART0_Init() { - - AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - - // setup GPIO - pPio->PIO_ASR = AT91C_PA17_TXD0 | AT91C_PA18_RXD0; - pPio->PIO_PDR = AT91C_PA17_TXD0 | AT91C_PA18_RXD0; - - // enable power - pPMC->PMC_PCER = 1u << AT91C_ID_US0; -} - -static void -USART1_Init() { - - AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - - // setup GPIO - pPio->PIO_ASR = AT91C_PB20_TXD1 | AT91C_PB21_RXD1; - pPio->PIO_PDR = AT91C_PB20_TXD1 | AT91C_PB21_RXD1; - - // enable power - pPMC->PMC_PCER = 1u << AT91C_ID_US1; -} - -static void -USART2_Init() { - - AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - - // setup GPIO - pPio->PIO_ASR = AT91C_PA23_TXD2 | AT91C_PA22_RXD2; - pPio->PIO_PDR = AT91C_PA23_TXD2 | AT91C_PA22_RXD2; - - // enable power - pPMC->PMC_PCER = 1u << AT91C_ID_US2; -} - -static void -USART3_Init() { - - AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - - // setup GPIO - pPio->PIO_BSR = AT91C_PA5_TXD3 | AT91C_PA6_RXD3; - pPio->PIO_PDR = AT91C_PA5_TXD3 | AT91C_PA6_RXD3; - - // enable power - pPMC->PMC_PCER = 1u << AT91C_ID_US3; -} - -void -board_init(void) -{ - - printf("\n\n"); - printf("BWCT FSB-A920-1\n"); - printf("http://www.bwct.de\n"); - printf("\n"); -#if defined(SDRAM_128M) - printf("AT92RM9200 180MHz 128MB\n"); -#else - printf("AT92RM9200 180MHz 64MB\n"); -#endif - printf("Initialising USART0\n"); - USART0_Init(); - printf("Initialising USART1\n"); - USART1_Init(); - printf("Initialising USART2\n"); - USART2_Init(); - printf("Initialising USART3\n"); - USART3_Init(); - printf("Initialising TWI\n"); - EEInit(); - printf("Initialising DS1672\n"); - DS1672_Init(); - printf("Initialising Ethernet\n"); - printf("MAC %x:%x:%x:%x:%x:%x\n", mac[0], - mac[1], mac[2], mac[3], mac[4], mac[5]); - EMAC_Init(); - EMAC_SetMACAddress(mac); - printf("Initialising SD-card\n"); - sdcard_init(); -} - -#include "../bootspi/ee.c" - -int -drvread(void *buf, unsigned lba, unsigned nblk) -{ - return (MCI_read((char *)buf, lba << 9, nblk << 9)); -} diff --git a/usr/src/boot/sys/boot/arm/at91/boot2/centipad_board.c b/usr/src/boot/sys/boot/arm/at91/boot2/centipad_board.c deleted file mode 100644 index c1b621e038..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot2/centipad_board.c +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> - -#include "emac.h" -#include "lib.h" -#include "board.h" -#include "sd-card.h" - -unsigned char mac[6] = { 0x42, 0x53, 0x44, 0, 1, 1 }; - -static void -MacFromEE() -{ -#if 0 - uint32_t sig; - sig = 0; - ReadEEPROM(12 * 1024, (uint8_t *)&sig, sizeof(sig)); - if (sig != 0x92021054) - return; - ReadEEPROM(12 * 1024 + 4, mac, 6); -#endif - printf("MAC %x:%x:%x:%x:%x:%x\n", mac[0], - mac[1], mac[2], mac[3], mac[4], mac[5]); -} - -void -board_init(void) -{ - InitEEPROM(); - MacFromEE(); - EMAC_Init(); - EMAC_SetMACAddress(mac); - while (sdcard_init() == 0) - printf("Looking for SD card\n"); -} - -int -drvread(void *buf, unsigned lba, unsigned nblk) -{ - return (MCI_read((char *)buf, lba << 9, nblk << 9)); -} diff --git a/usr/src/boot/sys/boot/arm/at91/boot2/kb920x_board.c b/usr/src/boot/sys/boot/arm/at91/boot2/kb920x_board.c deleted file mode 100644 index 52f9676be4..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/boot2/kb920x_board.c +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> - -#include "emac.h" -#include "lib.h" -#include "board.h" -#include "sd-card.h" - -unsigned char mac[6] = { 0x42, 0x53, 0x44, 0, 0, 1 }; - -static void -MacFromEE() -{ - uint32_t sig; - sig = 0; - ReadEEPROM(12 * 1024, (uint8_t *)&sig, sizeof(sig)); - if (sig != 0x92021054) - return; - ReadEEPROM(12 * 1024 + 4, mac, 6); - printf("MAC %x:%x:%x:%x:%x:%x\n", mac[0], - mac[1], mac[2], mac[3], mac[4], mac[5]); -} - -void -board_init(void) -{ - InitEEPROM(); - MacFromEE(); - EMAC_Init(); - EMAC_SetMACAddress(mac); - while (sdcard_init() == 0) - printf("Looking for SD card\n"); -} - -int -drvread(void *buf, unsigned lba, unsigned nblk) -{ - return (MCI_read((char *)buf, lba << 9, nblk << 9)); -} diff --git a/usr/src/boot/sys/boot/arm/at91/bootiic/Makefile b/usr/src/boot/sys/boot/arm/at91/bootiic/Makefile deleted file mode 100644 index 13f2482e62..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootiic/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../libat91 - -P=bootiic -FILES=${P} -SRCS=arm_init.S main.c loader_prompt.c env_vars.c -MAN= -LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -.include <bsd.prog.mk> - -CFLAGS += -DBOOT_IIC -DBOOT_COMMANDS diff --git a/usr/src/boot/sys/boot/arm/at91/bootiic/README b/usr/src/boot/sys/boot/arm/at91/bootiic/README deleted file mode 100644 index 1489d7c09c..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootiic/README +++ /dev/null @@ -1,35 +0,0 @@ -$FreeBSD$ - -This image is intended to be programmed into boot EEPROM. The image is nearly -0x4000 so it will not fit in KB9200's 0x2000. It is intended for KB9201 or -later. Alternatively, the KB9200 can be upgraded with larger EEPROM. -It performs basic functions prior to executing an image at a -specified address. The pre-boot functions can be modified and saved back into -EEPROM. -The MAC address is set with 0.0.0.0.0.0 by default. This is an invalid address -and must be changed to a valid value in order to use the ethernet interface. - -Memory usage: - -EEPROM = 0x4000 -SDRAM = - run stack = 0x21800000 - variables = 0x21200000 - ethernet = 0x21000000 (buffers and descriptors) - - -Functions supported: - - c - copy - d - display auto command table (in RAM) - e - execute image - ? - help - ip - set local ip - m - set mac - server_ip - set server ip - s - set auto command entry - t - create linux boot tag list - tftp - download image via tftp - w - update auto command table - x - download image via xmodem - diff --git a/usr/src/boot/sys/boot/arm/at91/bootiic/env_vars.c b/usr/src/boot/sys/boot/arm/at91/bootiic/env_vars.c deleted file mode 100644 index ac0b4f978f..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootiic/env_vars.c +++ /dev/null @@ -1,207 +0,0 @@ -/****************************************************************************** - * - * Filename: env_vars.c - * - * Instantiation of environment variables, structures, and other globals. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#include "env_vars.h" -#include "loader_prompt.h" -#include "lib.h" - -/******************************* GLOBALS *************************************/ -char boot_commands[MAX_BOOT_COMMANDS][MAX_INPUT_SIZE]; - -char env_table[MAX_ENV_SIZE_BYTES]; - -extern char BootCommandSection; - -/************************** PRIVATE FUNCTIONS ********************************/ - - -static int currentIndex; -static int currentOffset; - - -/* - * .KB_C_FN_DEFINITION_START - * int ReadCharFromEnvironment(char *) - * This private function reads characters from the environment variables - * to service the command prompt during auto-boot or just to setup the - * default environment. Returns positive value if valid character was - * set in the pointer. Returns negative value to signal input stream - * terminated. Returns 0 to indicate _wait_ condition. - * .KB_C_FN_DEFINITION_END - */ -static int -ReadCharFromEnvironment(int timeout) -{ - int ch; - - if (currentIndex < MAX_BOOT_COMMANDS) { - ch = boot_commands[currentIndex][currentOffset++]; - if (ch == '\0' || (currentOffset >= MAX_INPUT_SIZE)) { - currentOffset = 0; - ++currentIndex; - ch = '\r'; - } - return (ch); - } - - return (-1); -} - - -/*************************** GLOBAL FUNCTIONS ********************************/ - - -/* - * .KB_C_FN_DEFINITION_START - * void WriteCommandTable(void) - * This global function write the current command table to the non-volatile - * memory. - * .KB_C_FN_DEFINITION_END - */ -void -WriteCommandTable(void) -{ - int i, size = MAX_ENV_SIZE_BYTES, copySize; - char *cPtr = env_table; - - p_memset(env_table, 0, sizeof(env_table)); - - for (i = 0; i < MAX_BOOT_COMMANDS; ++i) { - - copySize = p_strlen(boot_commands[i]); - size -= copySize + 1; - - if (size < 0) { - continue; - } - memcpy(cPtr, boot_commands[i], copySize); - cPtr += copySize; - *cPtr++ = 0; - } - - /* We're executing in low RAM so addr in ram == offset in eeprom */ - WriteEEPROM((unsigned)&BootCommandSection, env_table, - sizeof(env_table)); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void SetBootCommand(int index, char *command) - * This global function replaces the specified index with the string residing - * at command. Execute this function with a NULL string to clear the - * associated command index. - * .KB_C_FN_DEFINITION_END - */ -void -SetBootCommand(int index, char *command) -{ - int i; - - if ((unsigned)index < MAX_BOOT_COMMANDS) { - - p_memset(boot_commands[index], 0, MAX_INPUT_SIZE); - - if (!command) - return ; - - for (i = 0; i < MAX_INPUT_SIZE; ++i) { - boot_commands[index][i] = command[i]; - if (!(boot_commands[index][i])) - return; - } - } -} - - -/* - * .KB_C_FN_DEFINITION_START - * void DumpBootCommands(void) - * This global function displays the current boot commands. - * .KB_C_FN_DEFINITION_END - */ -void -DumpBootCommands(void) -{ - int i, j; - - for (i = 0; i < MAX_BOOT_COMMANDS; ++i) { - printf("0x%x : ", i); - for (j = 0; j < MAX_INPUT_SIZE; ++j) { - putchar(boot_commands[i][j]); - if (!(boot_commands[i][j])) - break; - } - printf("[E]\n\r"); - } -} - - -/* - * .KB_C_FN_DEFINITION_START - * void LoadBootCommands(void) - * This global function loads the existing boot commands from raw format and - * coverts it to the standard, command-index format. Notice, the processed - * boot command table has much more space allocated than the actual table - * stored in non-volatile memory. This is because the processed table - * exists in RAM which is larger than the non-volatile space. - * .KB_C_FN_DEFINITION_END - */ -void -LoadBootCommands(void) -{ - int index, j, size; - char *cPtr; - - p_memset((char*)boot_commands, 0, sizeof(boot_commands)); - - cPtr = &BootCommandSection; - - size = MAX_ENV_SIZE_BYTES; - - for (index = 0; (index < MAX_BOOT_COMMANDS) && size; ++index) { - for (j = 0; (j < MAX_INPUT_SIZE) && size; ++j) { - size--; - boot_commands[index][j] = *cPtr++; - if (!(boot_commands[index][j])) { - break; - } - } - } -} - - -/* - * .KB_C_FN_DEFINITION_START - * void ExecuteEnvironmentFunctions(void) - * This global function executes applicable entries in the environment. - * .KB_C_FN_DEFINITION_END - */ -void -ExecuteEnvironmentFunctions(void) -{ - currentIndex = 0; - currentOffset = 0; - - DumpBootCommands(); - Bootloader(ReadCharFromEnvironment); -} diff --git a/usr/src/boot/sys/boot/arm/at91/bootiic/env_vars.h b/usr/src/boot/sys/boot/arm/at91/bootiic/env_vars.h deleted file mode 100644 index c6e46b4e43..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootiic/env_vars.h +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * - * Filename: env_vars.h - * - * Definition of environment variables, structures, and other globals. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#ifndef _ENV_VARS_H_ -#define _ENV_VARS_H_ - -/* each environment variable is a string following the standard command */ -/* definition used by the interactive loader in the following format: */ -/* <command> <parm1> <parm2> ... */ -/* all environment variables (or commands) are stored in a string */ -/* format: NULL-terminated. */ -/* this implies that commands can never utilize 0-values: actual 0, not */ -/* the string '0'. this is not an issue as the string '0' is handled */ -/* by the command parse routine. */ - -/* the following defines the maximum size of the environment for */ -/* including variables. */ -/* this value must match that declared in the low-level file that */ -/* actually reserves the space for the non-volatile environment. */ -#define MAX_ENV_SIZE_BYTES 0x100 - -#define MAX_BOOT_COMMANDS 10 - -/* C-style reference section */ -#ifndef __ASSEMBLY__ - -extern void WriteCommandTable(void); -extern void SetBootCommand(int index, char *command); -extern void DumpBootCommands(void); -extern void LoadBootCommands(void); -extern void ExecuteEnvironmentFunctions(void); - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ENV_VARS_H_ */ diff --git a/usr/src/boot/sys/boot/arm/at91/bootiic/loader_prompt.c b/usr/src/boot/sys/boot/arm/at91/bootiic/loader_prompt.c deleted file mode 100644 index 29413b8e6c..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootiic/loader_prompt.c +++ /dev/null @@ -1,387 +0,0 @@ -/****************************************************************************** - * - * Filename: loader_prompt.c - * - * Instantiation of the interactive loader functions. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin massive changes for tftp, strings, and more - * 05JUL2005 kb_admin save tag address, and set registers on boot - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#include "at91rm9200_lowlevel.h" -#ifdef SUPPORT_TAG_LIST -#include "tag_list.h" -#endif -#include "emac.h" -#include "loader_prompt.h" -#include "env_vars.h" -#include "lib.h" - - -/******************************* GLOBALS *************************************/ - - -/*********************** PRIVATE FUNCTIONS/DATA ******************************/ - -static char inputBuffer[MAX_INPUT_SIZE]; -static int buffCount; - -// argv pointer are either NULL or point to locations in inputBuffer -static char *argv[MAX_COMMAND_PARAMS]; - -static const char *backspaceString = "\010 \010"; - -static const command_entry_t CommandTable[] = { - {COMMAND_COPY, "c"}, - {COMMAND_DUMP, "d"}, - {COMMAND_EXEC, "e"}, - {COMMAND_HELP, "?"}, - {COMMAND_LOCAL_IP, "ip"}, - {COMMAND_MAC, "m"}, - {COMMAND_SERVER_IP, "server_ip"}, - {COMMAND_SET, "s"}, -#ifdef SUPPORT_TAG_LIST - {COMMAND_TAG, "t"}, -#endif - {COMMAND_TFTP, "tftp"}, - {COMMAND_WRITE, "w"}, - {COMMAND_XMODEM, "x"}, - {COMMAND_FINAL_FLAG, 0} -}; - -static unsigned tagAddress; - -/* - * .KB_C_FN_DEFINITION_START - * unsigned BuildIP(void) - * This private function packs the test IP info to an unsigned value. - * .KB_C_FN_DEFINITION_END - */ -static unsigned -BuildIP(void) -{ - return ((p_ASCIIToDec(argv[1]) << 24) | - (p_ASCIIToDec(argv[2]) << 16) | - (p_ASCIIToDec(argv[3]) << 8) | - p_ASCIIToDec(argv[4])); -} - - -/* - * .KB_C_FN_DEFINITION_START - * int StringToCommand(char *cPtr) - * This private function converts a command string to a command code. - * .KB_C_FN_DEFINITION_END - */ -static int -StringToCommand(char *cPtr) -{ - int i; - - for (i = 0; CommandTable[i].command != COMMAND_FINAL_FLAG; ++i) - if (!strcmp(CommandTable[i].c_string, cPtr)) - return (CommandTable[i].command); - - return (COMMAND_INVALID); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void RestoreSpace(int) - * This private function restores NULL characters to spaces in order to - * process the remaining args as a string. The number passed is the argc - * of the first entry to begin restoring space in the inputBuffer. - * .KB_C_FN_DEFINITION_END - */ -static void -RestoreSpace(int startArgc) -{ - char *cPtr; - - for (startArgc++; startArgc < MAX_COMMAND_PARAMS; startArgc++) { - if ((cPtr = argv[startArgc])) - *(cPtr - 1) = ' '; - } -} - - -/* - * .KB_C_FN_DEFINITION_START - * int BreakCommand(char *) - * This private function splits the buffer into separate strings as pointed - * by argv and returns the number of parameters (< 0 on failure). - * .KB_C_FN_DEFINITION_END - */ -static int -BreakCommand(char *buffer) -{ - int pCount, cCount, state; - - state = pCount = 0; - p_memset((char*)argv, 0, sizeof(argv)); - - for (cCount = 0; cCount < MAX_INPUT_SIZE; ++cCount) { - - if (!state) { - /* look for next command */ - if (!p_IsWhiteSpace(buffer[cCount])) { - argv[pCount++] = &buffer[cCount]; - state = 1; - } else { - buffer[cCount] = 0; - } - } else { - /* in command, find next white space */ - if (p_IsWhiteSpace(buffer[cCount])) { - buffer[cCount] = 0; - state = 0; - } - } - - if (pCount >= MAX_COMMAND_PARAMS) { - return (-1); - } - } - - return (pCount); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void ParseCommand(char *) - * This private function executes matching functions. - * .KB_C_FN_DEFINITION_END - */ -static void -ParseCommand(char *buffer) -{ - int argc, i; - - if ((argc = BreakCommand(buffer)) < 1) - return; - - switch (StringToCommand(argv[0])) { - case COMMAND_COPY: - { - // "c <to> <from> <size in bytes>" - // copy memory - char *to, *from; - unsigned size; - - if (argc > 3) { - to = (char *)p_ASCIIToHex(argv[1]); - from = (char *)p_ASCIIToHex(argv[2]); - size = p_ASCIIToHex(argv[3]); - memcpy(to, from, size); - } - break; - } - - case COMMAND_DUMP: - // display boot commands - DumpBootCommands(); - break; - - case COMMAND_EXEC: - { - // "e <address>" - // execute at address - void (*execAddr)(unsigned, unsigned, unsigned); - - if (argc > 1) { - /* in future, include machtypes (MACH_KB9200 = 612) */ - execAddr = (void (*)(unsigned, unsigned, unsigned)) - p_ASCIIToHex(argv[1]); - (*execAddr)(0, 612, tagAddress); - } - break; - } - - case COMMAND_TFTP: - { - // "tftp <local_dest_addr filename>" - // tftp download - unsigned address = 0; - - if (argc > 2) - address = p_ASCIIToHex(argv[1]); - TFTP_Download(address, argv[2]); - break; - } - - case COMMAND_SERVER_IP: - // "server_ip <server IP 192 200 1 20>" - // set download server address - if (argc > 4) - SetServerIPAddress(BuildIP()); - break; - - case COMMAND_HELP: - // dump command info - printf("Commands:\n" - "\tc\n" - "\td\n" - "\te\n" - "\tip\n" - "\tserver_ip\n" - "\tm\n" - "\ttftp\n" - "\ts\n" -#ifdef SUPPORT_TAG_LIST - "\tt\n" -#endif - "\tw\n" - "\tx\n"); - break; - - case COMMAND_LOCAL_IP: - // "local_ip <local IP 192 200 1 21> - // set ip of this module - if (argc > 4) - SetLocalIPAddress(BuildIP()); - break; - - case COMMAND_MAC: - { - // "m <mac address 12 34 56 78 9a bc> - // set mac address using 6 byte values - unsigned char mac[6]; - - if (argc > 6) { - for (i = 0; i < 6; i++) - mac[i] = p_ASCIIToHex(argv[i + 1]); - EMAC_SetMACAddress(mac); - } - break; - } - - case COMMAND_SET: - { - // s <index> <new boot command> - // set the boot command at index (0-based) - unsigned index; - - if (argc > 1) { - RestoreSpace(2); - index = p_ASCIIToHex(argv[1]); - SetBootCommand(index, argv[2]); - } - break; - } - -#ifdef SUPPORT_TAG_LIST - case COMMAND_TAG: - // t <address> <boot command line> - // create tag-list for linux boot - if (argc > 2) { - RestoreSpace(2); - tagAddress = p_ASCIIToHex(argv[1]); - InitTagList(argv[2], (void*)tagAddress); - } - break; -#endif - - case COMMAND_WRITE: - // write the command table to non-volatile - WriteCommandTable(); - break; - - case COMMAND_XMODEM: - { - // "x <address>" - // download X-modem record at address - if (argc > 1) - xmodem_rx((char *)p_ASCIIToHex(argv[1])); - break; - } - - default: - break; - } - - printf("\n"); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void ServicePrompt(char) - * This private function process each character checking for valid commands. - * This function is only executed if the character is considered valid. - * Each command is terminated with NULL (0) or ''. - * .KB_C_FN_DEFINITION_END - */ -static void -ServicePrompt(char p_char) -{ - if (p_char == '\r') - p_char = 0; - - if (p_char == '\010') { - if (buffCount) { - /* handle backspace BS */ - inputBuffer[--buffCount] = 0; - printf(backspaceString); - } - return; - } - if (buffCount < MAX_INPUT_SIZE - 1) { - inputBuffer[buffCount++] = p_char; - putchar(p_char); - } - if (!p_char) { - printf("\n"); - ParseCommand(inputBuffer); - p_memset(inputBuffer, 0, MAX_INPUT_SIZE); - buffCount = 0; - printf("\n>"); - } -} - - -/* ************************** GLOBAL FUNCTIONS ********************************/ - - -/* - * .KB_C_FN_DEFINITION_START - * void Bootloader(void *inputFunction) - * This global function is the entry point for the bootloader. If the - * inputFunction pointer is NULL, the loader input will be serviced from - * the uart. Otherwise, inputFunction is called to get characters which - * the loader will parse. - * .KB_C_FN_DEFINITION_END - */ -void -Bootloader(int(*inputFunction)(int)) -{ - int ch = 0; - - p_memset((void*)inputBuffer, 0, sizeof(inputBuffer)); - - buffCount = 0; - if (!inputFunction) { - inputFunction = getc; - } - - printf("\n>"); - - while (1) - if ((ch = ((*inputFunction)(0))) > 0) - ServicePrompt(ch); -} diff --git a/usr/src/boot/sys/boot/arm/at91/bootiic/loader_prompt.h b/usr/src/boot/sys/boot/arm/at91/bootiic/loader_prompt.h deleted file mode 100644 index 02233405f9..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootiic/loader_prompt.h +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** - * - * Filename: loader_prompt.h - * - * Definition of the interactive loader functions. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#ifndef _LOADER_PROMPT_H_ -#define _LOADER_PROMPT_H_ - -#define MAX_INPUT_SIZE 256 -#define MAX_COMMAND_PARAMS 10 - -enum { - COMMAND_INVALID = 0, - COMMAND_COPY, - COMMAND_DUMP, - COMMAND_EXEC, - COMMAND_HELP, - COMMAND_LOCAL_IP, - COMMAND_MAC, - COMMAND_SERVER_IP, - COMMAND_SET, - COMMAND_TAG, - COMMAND_TFTP, - COMMAND_WRITE, - COMMAND_XMODEM, - COMMAND_FINAL_FLAG -} e_cmd_t; - - -typedef struct { - int command; - const char *c_string; -} command_entry_t; - -void EnterInteractiveBootloader(int(*inputFunction)(int)); -void Bootloader(int(*inputFunction)(int)); - -#endif /* _LOADER_PROMPT_H_ */ diff --git a/usr/src/boot/sys/boot/arm/at91/bootiic/main.c b/usr/src/boot/sys/boot/arm/at91/bootiic/main.c deleted file mode 100644 index 86368358ce..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootiic/main.c +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * - * Filename: main.c - * - * Basic entry points for top-level functions - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin cosmetic changes - * 29APR2005 kb_admin modified boot delay - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - ******************************************************************************/ - -#include "env_vars.h" -#include "at91rm9200_lowlevel.h" -#include "loader_prompt.h" -#include "emac.h" -#include "lib.h" - -int main(void); - -/* - * .KB_C_FN_DEFINITION_START - * int main(void) - * This global function waits at least one second, but not more than two - * seconds, for input from the serial port. If no response is recognized, - * it acts according to the parameters specified by the environment. For - * example, the function might boot an operating system. Do not return - * from this function. - * .KB_C_FN_DEFINITION_END - */ -int -main(void) -{ - InitEEPROM(); - EMAC_Init(); - LoadBootCommands(); - printf("\n\rKB9202(www.kwikbyte.com)\n\rAuto boot..\n\r"); - if (getc(1) == -1) - ExecuteEnvironmentFunctions(); - Bootloader(0); - - return (1); -} diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/Makefile b/usr/src/boot/sys/boot/arm/at91/bootspi/Makefile deleted file mode 100644 index a02d447b48..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> - -.PATH: ${.CURDIR}/../libat91 - -P=bootspi -FILES=${P} -SRCS=arm_init.S main.c loader_prompt.c env_vars.c ee.c -MAN= -LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -.include <bsd.prog.mk> - -.if ${MK_FPGA} == "yes" -CFLAGS += -DTSC_FPGA -.endif -CFLAGS += -DBOOT_COMMANDS diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/README b/usr/src/boot/sys/boot/arm/at91/bootspi/README deleted file mode 100644 index 9a4ffa8824..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/README +++ /dev/null @@ -1,34 +0,0 @@ -$FreeBSD$ - -This image is intended to be programmed into boot EEPROM. The image is nearly -0x4000 so it will not fit in KB9200's 0x2000. It is intended for KB9201 or -later. Alternatively, the KB9200 can be upgraded with larger EEPROM. -It performs basic functions prior to executing an image at a -specified address. The pre-boot functions can be modified and saved back into -EEPROM. -The MAC address is set with 0.0.0.0.0.0 by default. This is an invalid address -and must be changed to a valid value in order to use the ethernet interface. - -Memory usage: - -EEPROM = 0x4000 -SDRAM = - run stack = 0x21800000 - variables = 0x21200000 - ethernet = 0x21000000 (buffers and descriptors) - - -Functions supported: - - c - copy - d - display auto command table (in RAM) - e - execute image - ? - help - ip - set local ip - m - set mac - server_ip - set server ip - s - set auto command entry - t - create linux boot tag list - tftp - download image via tftp - w - update auto command table - x - download image via xmodem diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/ee.c b/usr/src/boot/sys/boot/arm/at91/bootspi/ee.c deleted file mode 100644 index ef0571924b..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/ee.c +++ /dev/null @@ -1,160 +0,0 @@ -/****************************************************************************** - * - * Filename: eeprom.c - * - * Instantiation of eeprom routines - * - * Revision information: - * - * 28AUG2004 kb_admin initial creation - adapted from Atmel sources - * 12JAN2005 kb_admin fixed clock generation, write polling, init - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#include "at91rm9200_lowlevel.h" -#include "at91rm9200.h" -#include "lib.h" -#include "ee.h" - -/******************************* GLOBALS *************************************/ - - -/*********************** PRIVATE FUNCTIONS/DATA ******************************/ - - -/* Use a macro to calculate the TWI clock generator value to save code space. */ -#define AT91C_TWSI_CLOCK 100000 -#define TWSI_EEPROM_ADDRESS 0x40 - -#define TWI_CLK_BASE_DIV ((AT91C_MASTER_CLOCK/(4*AT91C_TWSI_CLOCK)) - 2) -#define SET_TWI_CLOCK ((0x00010000) | (TWI_CLK_BASE_DIV) | (TWI_CLK_BASE_DIV << 8)) - - -/*************************** GLOBAL FUNCTIONS ********************************/ - - -/* - * .KB_C_FN_DEFINITION_START - * void InitEEPROM(void) - * This global function initializes the EEPROM interface (TWI). Intended - * to be called a single time. - * .KB_C_FN_DEFINITION_END - */ -void -EEInit(void) -{ - - AT91PS_TWI twiPtr = (AT91PS_TWI)AT91C_BASE_TWI; - - AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - - pPio->PIO_ASR = AT91C_PIO_PA25 | AT91C_PIO_PA26; - pPio->PIO_PDR = AT91C_PIO_PA25 | AT91C_PIO_PA26; - - pPio->PIO_MDDR = ~AT91C_PIO_PA25; - pPio->PIO_MDER = AT91C_PIO_PA25; - - pPMC->PMC_PCER = 1u << AT91C_ID_TWI; - - twiPtr->TWI_IDR = 0xffffffffu; - twiPtr->TWI_CR = AT91C_TWI_SWRST; - twiPtr->TWI_CR = AT91C_TWI_MSEN | AT91C_TWI_SVDIS; - - twiPtr->TWI_CWGR = SET_TWI_CLOCK; -} - -static inline unsigned -iicaddr(unsigned ee_off) -{ - return (TWSI_EEPROM_ADDRESS | ((ee_off >> 8) & 0x7)); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void ReadEEPROM(unsigned ee_addr, char *data_addr, unsigned size) - * This global function reads data from the eeprom at ee_addr storing data - * to data_addr for size bytes. Assume the TWI has been initialized. - * This function does not utilize the page read mode to simplify the code. - * .KB_C_FN_DEFINITION_END - */ -void -EERead(unsigned ee_off, char *data_addr, unsigned size) -{ - const AT91PS_TWI twiPtr = AT91C_BASE_TWI; - unsigned int status; - - if ((ee_off & ~0xff) != ((ee_off + size) & ~0xff)) { - printf("Crosses page boundary: 0x%x 0x%x\n", ee_off, size); - return; - } - - status = twiPtr->TWI_SR; - status = twiPtr->TWI_RHR; - twiPtr->TWI_MMR = (iicaddr(ee_off) << 16) | AT91C_TWI_IADRSZ_1_BYTE | - AT91C_TWI_MREAD; - twiPtr->TWI_IADR = ee_off & 0xff; - twiPtr->TWI_CR = AT91C_TWI_START; - while (size-- > 1) { - while (!(twiPtr->TWI_SR & AT91C_TWI_RXRDY)) - continue; - *(data_addr++) = twiPtr->TWI_RHR; - } - twiPtr->TWI_CR = AT91C_TWI_STOP; - status = twiPtr->TWI_SR; - while (!(twiPtr->TWI_SR & AT91C_TWI_TXCOMP)) - continue; - *data_addr = twiPtr->TWI_RHR; -} - - -/* - * .KB_C_FN_DEFINITION_START - * void WriteEEPROM(unsigned ee_off, char *data_addr, unsigned size) - * This global function writes data to the eeprom at ee_off using data - * from data_addr for size bytes. Assume the TWI has been initialized. - * This function does not utilize the page write mode as the write time is - * much greater than the time required to access the device for byte-write - * functionality. This allows the function to be much simpler. - * .KB_C_FN_DEFINITION_END - */ -void -EEWrite(unsigned ee_off, const char *data_addr, unsigned size) -{ - const AT91PS_TWI twiPtr = AT91C_BASE_TWI; - unsigned status; - char test_data; - - while (size--) { - // Set the TWI Master Mode Register - twiPtr->TWI_MMR = (iicaddr(ee_off) << 16) | - AT91C_TWI_IADRSZ_1_BYTE; - twiPtr->TWI_IADR = ee_off++; - status = twiPtr->TWI_SR; - - // Load one data byte - twiPtr->TWI_THR = *(data_addr++); - twiPtr->TWI_CR = AT91C_TWI_START; - while (!(twiPtr->TWI_SR & AT91C_TWI_TXRDY)) - continue; - twiPtr->TWI_CR = AT91C_TWI_STOP; - status = twiPtr->TWI_SR; - while (!(twiPtr->TWI_SR & AT91C_TWI_TXCOMP)) - continue; - - // wait for write operation to complete, it is done once - // we can read it back... - EERead(ee_off, &test_data, 1); - } -} diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/ee.h b/usr/src/boot/sys/boot/arm/at91/bootspi/ee.h deleted file mode 100644 index d4d8b8dc6f..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/ee.h +++ /dev/null @@ -1,6 +0,0 @@ -/* $FreeBSD$ */ - -void EEInit(void); -void EERead(unsigned ee_off, char *data_addr, unsigned size); -void EEWrite(unsigned ee_off, const char *data_addr, unsigned size); - diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/env_vars.c b/usr/src/boot/sys/boot/arm/at91/bootspi/env_vars.c deleted file mode 100644 index 29b819b229..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/env_vars.c +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * - * Filename: env_vars.c - * - * Instantiation of environment variables, structures, and other globals. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#include "env_vars.h" -#include "loader_prompt.h" -#include "lib.h" - -/******************************* GLOBALS *************************************/ -char boot_commands[MAX_BOOT_COMMANDS][MAX_INPUT_SIZE]; - -char env_table[MAX_ENV_SIZE_BYTES]; - -extern char BootCommandSection; - -/************************** PRIVATE FUNCTIONS ********************************/ - - -static int currentIndex; -static int currentOffset; - - -/* - * .KB_C_FN_DEFINITION_START - * int ReadCharFromEnvironment(char *) - * This private function reads characters from the environment variables - * to service the command prompt during auto-boot or just to setup the - * default environment. Returns positive value if valid character was - * set in the pointer. Returns negative value to signal input stream - * terminated. Returns 0 to indicate _wait_ condition. - * .KB_C_FN_DEFINITION_END - */ -static int -ReadCharFromEnvironment(int timeout) -{ - int ch; - - if (currentIndex < MAX_BOOT_COMMANDS) { - ch = boot_commands[currentIndex][currentOffset++]; - if (ch == '\0' || (currentOffset >= MAX_INPUT_SIZE)) { - currentOffset = 0; - ++currentIndex; - ch = '\r'; - } - return (ch); - } - - return (-1); -} - - -/*************************** GLOBAL FUNCTIONS ********************************/ - - -/* - * .KB_C_FN_DEFINITION_START - * void DumpBootCommands(void) - * This global function displays the current boot commands. - * .KB_C_FN_DEFINITION_END - */ -void -DumpBootCommands(void) -{ - int i; - - for (i = 0; boot_commands[i][0]; i++) - printf("0x%x : %s[E]\n", i, boot_commands[i]); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void LoadBootCommands(void) - * This global function loads the existing boot commands from raw format and - * coverts it to the standard, command-index format. Notice, the processed - * boot command table has much more space allocated than the actual table - * stored in non-volatile memory. This is because the processed table - * exists in RAM which is larger than the non-volatile space. - * .KB_C_FN_DEFINITION_END - */ -void -LoadBootCommands(void) -{ - int index, j; - char *cptr; - - p_memset((char*)boot_commands, 0, sizeof(boot_commands)); - cptr = &BootCommandSection; - for (index = 0; *cptr; index++) { - for (j = 0; *cptr; j++) - boot_commands[index][j] = *cptr++; - cptr++; - } -} - - -/* - * .KB_C_FN_DEFINITION_START - * void ExecuteEnvironmentFunctions(void) - * This global function executes applicable entries in the environment. - * .KB_C_FN_DEFINITION_END - */ -void -ExecuteEnvironmentFunctions(void) -{ - currentIndex = 0; - currentOffset = 0; - - DumpBootCommands(); - printf("Autoboot...\n"); - Bootloader(ReadCharFromEnvironment); -} diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/env_vars.h b/usr/src/boot/sys/boot/arm/at91/bootspi/env_vars.h deleted file mode 100644 index c6e46b4e43..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/env_vars.h +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * - * Filename: env_vars.h - * - * Definition of environment variables, structures, and other globals. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#ifndef _ENV_VARS_H_ -#define _ENV_VARS_H_ - -/* each environment variable is a string following the standard command */ -/* definition used by the interactive loader in the following format: */ -/* <command> <parm1> <parm2> ... */ -/* all environment variables (or commands) are stored in a string */ -/* format: NULL-terminated. */ -/* this implies that commands can never utilize 0-values: actual 0, not */ -/* the string '0'. this is not an issue as the string '0' is handled */ -/* by the command parse routine. */ - -/* the following defines the maximum size of the environment for */ -/* including variables. */ -/* this value must match that declared in the low-level file that */ -/* actually reserves the space for the non-volatile environment. */ -#define MAX_ENV_SIZE_BYTES 0x100 - -#define MAX_BOOT_COMMANDS 10 - -/* C-style reference section */ -#ifndef __ASSEMBLY__ - -extern void WriteCommandTable(void); -extern void SetBootCommand(int index, char *command); -extern void DumpBootCommands(void); -extern void LoadBootCommands(void); -extern void ExecuteEnvironmentFunctions(void); - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ENV_VARS_H_ */ diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/loader_prompt.c b/usr/src/boot/sys/boot/arm/at91/bootspi/loader_prompt.c deleted file mode 100644 index 63bc50e536..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/loader_prompt.c +++ /dev/null @@ -1,363 +0,0 @@ -/****************************************************************************** - * - * Filename: loader_prompt.c - * - * Instantiation of the interactive loader functions. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin massive changes for tftp, strings, and more - * 05JUL2005 kb_admin save tag address, and set registers on boot - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#include "at91rm9200_lowlevel.h" -#include "at91rm9200.h" -#include "emac.h" -#include "loader_prompt.h" -#include "env_vars.h" -#include "lib.h" -#include "spi_flash.h" -#include "ee.h" - -/******************************* GLOBALS *************************************/ - - -/*********************** PRIVATE FUNCTIONS/DATA ******************************/ - -static char inputBuffer[MAX_INPUT_SIZE]; -static int buffCount; - -// argv pointer are either NULL or point to locations in inputBuffer -static char *argv[MAX_COMMAND_PARAMS]; - -#define FLASH_OFFSET (0 * FLASH_PAGE_SIZE) -#define KERNEL_OFFSET (220 * FLASH_PAGE_SIZE) -#define KERNEL_LEN (6 * 1024 * FLASH_PAGE_SIZE) -static const char *backspaceString = "\010 \010"; - -static const command_entry_t CommandTable[] = { - {COMMAND_DUMP, "d"}, - {COMMAND_EXEC, "e"}, - {COMMAND_LOCAL_IP, "ip"}, - {COMMAND_MAC, "m"}, - {COMMAND_SERVER_IP, "server_ip"}, - {COMMAND_TFTP, "tftp"}, - {COMMAND_XMODEM, "x"}, - {COMMAND_RESET, "R"}, - {COMMAND_LOAD_SPI_KERNEL, "k"}, - {COMMAND_REPLACE_KERNEL_VIA_XMODEM, "K"}, - {COMMAND_REPLACE_FLASH_VIA_XMODEM, "I"}, - {COMMAND_REPLACE_ID_EEPROM, "E"}, - {COMMAND_FINAL_FLAG, 0} -}; - -/* - * .KB_C_FN_DEFINITION_START - * unsigned BuildIP(void) - * This private function packs the test IP info to an unsigned value. - * .KB_C_FN_DEFINITION_END - */ -static unsigned -BuildIP(void) -{ - return ((p_ASCIIToDec(argv[1]) << 24) | - (p_ASCIIToDec(argv[2]) << 16) | - (p_ASCIIToDec(argv[3]) << 8) | - p_ASCIIToDec(argv[4])); -} - - -/* - * .KB_C_FN_DEFINITION_START - * int StringToCommand(char *cPtr) - * This private function converts a command string to a command code. - * .KB_C_FN_DEFINITION_END - */ -static int -StringToCommand(char *cPtr) -{ - int i; - - for (i = 0; CommandTable[i].command != COMMAND_FINAL_FLAG; ++i) - if (!strcmp(CommandTable[i].c_string, cPtr)) - return (CommandTable[i].command); - - return (COMMAND_INVALID); -} - - -/* - * .KB_C_FN_DEFINITION_START - * int BreakCommand(char *) - * This private function splits the buffer into separate strings as pointed - * by argv and returns the number of parameters (< 0 on failure). - * .KB_C_FN_DEFINITION_END - */ -static int -BreakCommand(char *buffer) -{ - int pCount, cCount, state; - - state = pCount = 0; - p_memset((char*)argv, 0, sizeof(argv)); - - for (cCount = 0; cCount < MAX_INPUT_SIZE; ++cCount) { - - if (!state) { - /* look for next command */ - if (!p_IsWhiteSpace(buffer[cCount])) { - argv[pCount++] = &buffer[cCount]; - state = 1; - } else { - buffer[cCount] = 0; - } - } else { - /* in command, find next white space */ - if (p_IsWhiteSpace(buffer[cCount])) { - buffer[cCount] = 0; - state = 0; - } - } - - if (pCount >= MAX_COMMAND_PARAMS) { - return (-1); - } - } - - return (pCount); -} - -#if 0 -static void -UpdateEEProm(int eeaddr) -{ - char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ - int len; - - while ((len = xmodem_rx(addr)) == -1) - continue; - printf("\nDownloaded %u bytes.\n", len); - WriteEEPROM(eeaddr, 0, addr, len); -} -#endif - -static void -UpdateFlash(int offset) -{ - char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ - int len, i, off; - - while ((len = xmodem_rx(addr)) == -1) - continue; - printf("\nDownloaded %u bytes.\n", len); - for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { - off = i + offset; - SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE); - } -} - -static void -LoadKernelFromSpi(char *addr) -{ - int i, off; - - for (i = 0; i < KERNEL_LEN; i+= FLASH_PAGE_SIZE) { - off = i + KERNEL_OFFSET; - SPI_ReadFlash(off, addr + i, FLASH_PAGE_SIZE); - } -} - -/* - * .KB_C_FN_DEFINITION_START - * void ParseCommand(char *) - * This private function executes matching functions. - * .KB_C_FN_DEFINITION_END - */ -static void -ParseCommand(char *buffer) -{ - int argc, i; - - if ((argc = BreakCommand(buffer)) < 1) - return; - - switch (StringToCommand(argv[0])) { - case COMMAND_DUMP: - // display boot commands - DumpBootCommands(); - break; - - case COMMAND_EXEC: - { - // "e <address>" - // execute at address - void (*execAddr)(unsigned, unsigned); - - if (argc > 1) { - /* in future, include machtypes (MACH_KB9200 = 612) */ - execAddr = (void (*)(unsigned, unsigned)) - p_ASCIIToHex(argv[1]); - (*execAddr)(0, 612); - } - break; - } - - case COMMAND_TFTP: - { - // "tftp <local_dest_addr filename>" - // tftp download - unsigned address = 0; - - if (argc > 2) - address = p_ASCIIToHex(argv[1]); - TFTP_Download(address, argv[2]); - break; - } - - case COMMAND_SERVER_IP: - // "server_ip <server IP 192 200 1 20>" - // set download server address - if (argc > 4) - SetServerIPAddress(BuildIP()); - break; - - case COMMAND_LOCAL_IP: - // "local_ip <local IP 192 200 1 21> - // set ip of this module - if (argc > 4) - SetLocalIPAddress(BuildIP()); - break; - - case COMMAND_MAC: - { - // "m <mac address 12 34 56 78 9a bc> - // set mac address using 6 byte values - unsigned char mac[6]; - - if (argc > 6) { - for (i = 0; i < 6; i++) - mac[i] = p_ASCIIToHex(argv[i + 1]); - EMAC_SetMACAddress(mac); - } - break; - } - - case COMMAND_LOAD_SPI_KERNEL: - // "k <address>" - if (argc > 1) - LoadKernelFromSpi((char *)p_ASCIIToHex(argv[1])); - break; - - case COMMAND_XMODEM: - // "x <address>" - // download X-modem record at address - if (argc > 1) - xmodem_rx((char *)p_ASCIIToHex(argv[1])); - break; - - case COMMAND_RESET: - printf("Reset\n"); - reset(); - while (1) continue; - break; - - case COMMAND_REPLACE_KERNEL_VIA_XMODEM: - printf("Updating KERNEL image\n"); - UpdateFlash(KERNEL_OFFSET); - break; - case COMMAND_REPLACE_FLASH_VIA_XMODEM: - printf("Updating FLASH image\n"); - UpdateFlash(FLASH_OFFSET); - break; - - case COMMAND_REPLACE_ID_EEPROM: - { - char buf[25]; - printf("Testing Config EEPROM\n"); - EEWrite(0, "This is a test", 15); - EERead(0, buf, 15); - printf("Found '%s'\n", buf); - break; - } - default: - break; - } - - printf("\n"); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void ServicePrompt(char) - * This private function process each character checking for valid commands. - * This function is only executed if the character is considered valid. - * Each command is terminated with NULL (0) or ''. - * .KB_C_FN_DEFINITION_END - */ -static void -ServicePrompt(char p_char) -{ - if (p_char == '\r') - p_char = 0; - - if (p_char == '\010') { - if (buffCount) { - /* handle backspace BS */ - inputBuffer[--buffCount] = 0; - printf(backspaceString); - } - return; - } - if (buffCount < MAX_INPUT_SIZE - 1) { - inputBuffer[buffCount++] = p_char; - putchar(p_char); - } - if (!p_char) { - printf("\n"); - ParseCommand(inputBuffer); - p_memset(inputBuffer, 0, MAX_INPUT_SIZE); - buffCount = 0; - printf("\n>"); - } -} - - -/* ************************** GLOBAL FUNCTIONS ********************************/ - - -/* - * .KB_C_FN_DEFINITION_START - * void Bootloader(void *inputFunction) - * This global function is the entry point for the bootloader. If the - * inputFunction pointer is NULL, the loader input will be serviced from - * the uart. Otherwise, inputFunction is called to get characters which - * the loader will parse. - * .KB_C_FN_DEFINITION_END - */ -void -Bootloader(int(*inputFunction)(int)) -{ - int ch = 0; - - p_memset((void*)inputBuffer, 0, sizeof(inputBuffer)); - buffCount = 0; - - printf("\n>"); - - while (1) - if ((ch = ((*inputFunction)(0))) > 0) - ServicePrompt(ch); -} diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/loader_prompt.h b/usr/src/boot/sys/boot/arm/at91/bootspi/loader_prompt.h deleted file mode 100644 index 70d7514391..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/loader_prompt.h +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** - * - * Filename: loader_prompt.h - * - * Definition of the interactive loader functions. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#ifndef _LOADER_PROMPT_H_ -#define _LOADER_PROMPT_H_ - -#define MAX_INPUT_SIZE 256 -#define MAX_COMMAND_PARAMS 10 - -enum { - COMMAND_INVALID = 0, - COMMAND_COPY, - COMMAND_DUMP, - COMMAND_EXEC, - COMMAND_HELP, - COMMAND_LOCAL_IP, - COMMAND_MAC, - COMMAND_SERVER_IP, - COMMAND_SET, - COMMAND_TAG, - COMMAND_TFTP, - COMMAND_WRITE, - COMMAND_XMODEM, - COMMAND_RESET, - COMMAND_LOAD_SPI_KERNEL, - COMMAND_REPLACE_KERNEL_VIA_XMODEM, - COMMAND_REPLACE_FLASH_VIA_XMODEM, - COMMAND_REPLACE_FPGA_VIA_XMODEM, - COMMAND_REPLACE_ID_EEPROM, - COMMAND_FINAL_FLAG -} e_cmd_t; - - -typedef struct { - int command; - const char *c_string; -} command_entry_t; - -void EnterInteractiveBootloader(int(*inputFunction)(int)); -void Bootloader(int(*inputFunction)(int)); -void fpga_load(void); - -#endif /* _LOADER_PROMPT_H_ */ diff --git a/usr/src/boot/sys/boot/arm/at91/bootspi/main.c b/usr/src/boot/sys/boot/arm/at91/bootspi/main.c deleted file mode 100644 index cb9d1dbc42..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/bootspi/main.c +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provided by kwikbyte without - * copyright as follows: - * - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * - * $FreeBSD$ - */ - -#include "env_vars.h" -#include "at91rm9200.h" -#include "at91rm9200_lowlevel.h" -#include "loader_prompt.h" -#include "emac.h" -#include "lib.h" -#include "spi_flash.h" -#include "ee.h" - -int main(void); - -int -main(void) -{ - printf("\nBoot\n"); - EEInit(); - SPI_InitFlash(); -#ifdef TSC_FPGA - fpga_load(); -#endif - EMAC_Init(); - LoadBootCommands(); - if (getc(1) == -1) { - start_wdog(30); - ExecuteEnvironmentFunctions(); - } - Bootloader(getc); - return (1); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/Makefile b/usr/src/boot/sys/boot/arm/at91/libat91/Makefile deleted file mode 100644 index b02281dc64..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> -.include "${.CURDIR}/../Makefile.inc" - -SOC?=at91rm9200 - -LIB= at91 -INTERNALLIB= -SRCS=${SOC}_lowlevel.c delay.c eeprom.c emac.c emac_init.c getc.c \ - putchar.c printf.c reset.c spi_flash.c xmodem.c \ - sd-card.c strcvt.c strlen.c strcmp.c memcpy.c strcpy.c \ - memset.c memcmp.c -SRCS+=ashldi3.c divsi3.S -MAN= - -.if ${MK_TAG_LIST} != "no" -CFLAGS += -I${.CURDIR}/.. -DSUPPORT_TAG_LIST -SRCS+=tag_list.c -.endif - -.include <bsd.lib.mk> diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/arm_init.S b/usr/src/boot/sys/boot/arm/at91/libat91/arm_init.S deleted file mode 100644 index a15fb540e9..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/arm_init.S +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * - * Filename: arm_init.s - * - * Initialization for C-environment and basic operation. Adapted from - * ATMEL cstartup.s. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin updated for 16KB eeprom - * Atmel stack prevents loading full size at once - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - ******************************************************************************/ - - .equ TWI_EEPROM_SIZE, 0x3000 - .equ ARM_MODE_USER, 0x10 - .equ ARM_MODE_FIQ, 0x11 - .equ ARM_MODE_IRQ, 0x12 - .equ ARM_MODE_SVC, 0x13 - .equ ARM_MODE_ABORT, 0x17 - .equ ARM_MODE_UNDEF, 0x1B - .equ ARM_MODE_SYS, 0x1F - .equ I_BIT, 0x80 - .equ F_BIT, 0x40 - .equ T_BIT, 0x20 - -/* - * Stack definitions - * - * Start near top of internal RAM. - */ - .equ END_INT_SRAM, 0x4000 - .equ SVC_STACK_START, (END_INT_SRAM - 0x4) - .equ SVC_STACK_USE, 0x21800000 - -start: - -/* vectors - must reside at address 0 */ -/* the format of this table is defined in the datasheet */ - B InitReset @; reset -undefvec: - B undefvec @; Undefined Instruction -swivec: - B swivec @; Software Interrupt -pabtvec: - B pabtvec @; Prefetch Abort -dabtvec: - B dabtvec @; Data Abort -rsvdvec: -#ifdef BOOT_IIC - .long (TWI_EEPROM_SIZE >> 9) -#else -#ifdef BOOT_BWCT - .long ((528 << 17) | (13 << 13) | (12 * 2)) -#else - .long ((1056 << 17) | (13 << 13) | (12 * 2)) -#endif -#endif -irqvec: - ldr pc, [pc,#-0xF20] @; IRQ : read the AIC -fiqvec: - B fiqvec @; FIQ - -InitReset: - -/* Set stack and init for SVC */ - ldr r1, = SVC_STACK_START - mov sp, r1 @; Init stack SYS - - msr cpsr_c, #(ARM_MODE_SVC | I_BIT | F_BIT) - mov sp, r1 @ ; Init stack SYS - -/* Perform system initialization */ - - .extern _init - bl _init -#ifndef BOOT_BOOT0 - ldr r1, = SVC_STACK_USE - mov sp, r1 @ ; Move the stack to SDRAM -#endif - -/* Start execution at main */ - .extern main -_main: -__main: - bl main -/* main should not return. If it does, spin forever */ -infiniteLoop: - b infiniteLoop - -#ifdef BOOT_COMMANDS -/* the following section is used to store boot commands in */ -/* non-volatile memory. */ - - .global BootCommandSection -BootCommandSection: -#ifdef SUPPORT_LINUX - .string "Bootloader for KB9202 Evaluation Board." - .string "c 0x20210000 0x10100000 0x80000 " - .string "m 0 0 0 0 0 0 " - .string "t 0x20000100 console=ttyS0,115200 root=/dev/ram rw initrd=0x20210000,654933" - .string "e 0x10000000 " - .string " " -#else -#if 1 - .string "m 42 53 44 0 0 1" - .string "ip 206 168 13 194" - .string "server_ip 206 168 13 207" - .string "tftp 0x20000000 kernel.bin" - .string "e 0x20000000" -#else - .string "m 42 53 44 0 0 1" - .string "k 0x20000000" - .string "e 0x20000000" -#endif - .word 0 -#endif -#endif diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200.h b/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200.h deleted file mode 100644 index c9b9bcc9a0..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200.h +++ /dev/null @@ -1,2411 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// The software is delivered "AS IS" without warranty or condition of any -// kind, either express, implied or statutory. This includes without -// limitation any warranty or condition with respect to merchantability or -// fitness for any particular purpose, or against the infringements of -// intellectual property rights of others. -// ---------------------------------------------------------------------------- -// $FreeBSD$ -// -// File Name : AT91RM9200.h -// Object : AT91RM9200 definitions -// Generated : AT91 SW Application Group 07/04/2003 (11:05:04) -// -// CVS Reference : /AT91RM9200.pl/1.16/Fri Feb 07 09:29:50 2003// -// CVS Reference : /SYS_AT91RM9200.pl/1.2/Fri Jan 17 11:44:36 2003// -// CVS Reference : /MC_1760A.pl/1.1/Fri Aug 23 13:38:22 2002// -// CVS Reference : /AIC_1796B.pl/1.1.1.1/Fri Jun 28 08:36:46 2002// -// CVS Reference : /PMC_2636A.pl/1.1.1.1/Fri Jun 28 08:36:48 2002// -// CVS Reference : /ST_1763B.pl/1.1/Fri Aug 23 13:41:42 2002// -// CVS Reference : /RTC_1245D.pl/1.2/Fri Jan 31 11:19:06 2003// -// CVS Reference : /PIO_1725D.pl/1.1.1.1/Fri Jun 28 08:36:46 2002// -// CVS Reference : /DBGU_1754A.pl/1.4/Fri Jan 31 11:18:24 2003// -// CVS Reference : /UDP_1765B.pl/1.3/Fri Aug 02 13:45:38 2002// -// CVS Reference : /MCI_1764A.pl/1.2/Thu Nov 14 16:48:24 2002// -// CVS Reference : /US_1739C.pl/1.2/Fri Jul 12 06:49:24 2002// -// CVS Reference : /SPI_AT91RMxxxx.pl/1.3/Tue Nov 26 09:20:28 2002// -// CVS Reference : /SSC_1762A.pl/1.2/Fri Nov 08 12:26:38 2002// -// CVS Reference : /TC_1753B.pl/1.2/Fri Jan 31 11:19:54 2003// -// CVS Reference : /TWI_1761B.pl/1.4/Fri Feb 07 09:30:06 2003// -// CVS Reference : /PDC_1734B.pl/1.2/Thu Nov 21 15:38:22 2002// -// CVS Reference : /UHP_xxxxA.pl/1.1/Mon Jul 22 11:21:58 2002// -// CVS Reference : /EMAC_1794A.pl/1.4/Fri Jan 17 11:11:54 2003// -// CVS Reference : /EBI_1759B.pl/1.10/Fri Jan 17 11:44:28 2003// -// CVS Reference : /SMC_1783A.pl/1.3/Thu Oct 31 13:38:16 2002// -// CVS Reference : /SDRC_1758B.pl/1.2/Thu Oct 03 12:04:40 2002// -// CVS Reference : /BFC_1757B.pl/1.3/Thu Oct 31 13:38:00 2002// -// ---------------------------------------------------------------------------- - -#ifndef AT91RM9200_H -#define AT91RM9200_H - -#define ATMEL_ENV - -typedef volatile unsigned int AT91_REG;// Hardware register definition - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR System Peripherals -// ***************************************************************************** -typedef struct _AT91S_SYS { - AT91_REG AIC_SMR[32]; // Source Mode Register - AT91_REG AIC_SVR[32]; // Source Vector Register - AT91_REG AIC_IVR; // IRQ Vector Register - AT91_REG AIC_FVR; // FIQ Vector Register - AT91_REG AIC_ISR; // Interrupt Status Register - AT91_REG AIC_IPR; // Interrupt Pending Register - AT91_REG AIC_IMR; // Interrupt Mask Register - AT91_REG AIC_CISR; // Core Interrupt Status Register - AT91_REG Reserved0[2]; // - AT91_REG AIC_IECR; // Interrupt Enable Command Register - AT91_REG AIC_IDCR; // Interrupt Disable Command Register - AT91_REG AIC_ICCR; // Interrupt Clear Command Register - AT91_REG AIC_ISCR; // Interrupt Set Command Register - AT91_REG AIC_EOICR; // End of Interrupt Command Register - AT91_REG AIC_SPU; // Spurious Vector Register - AT91_REG AIC_DCR; // Debug Control Register (Protect) - AT91_REG Reserved1[1]; // - AT91_REG AIC_FFER; // Fast Forcing Enable Register - AT91_REG AIC_FFDR; // Fast Forcing Disable Register - AT91_REG AIC_FFSR; // Fast Forcing Status Register - AT91_REG Reserved2[45]; // - AT91_REG DBGU_CR; // Control Register - AT91_REG DBGU_MR; // Mode Register - AT91_REG DBGU_IER; // Interrupt Enable Register - AT91_REG DBGU_IDR; // Interrupt Disable Register - AT91_REG DBGU_IMR; // Interrupt Mask Register - AT91_REG DBGU_CSR; // Channel Status Register - AT91_REG DBGU_RHR; // Receiver Holding Register - AT91_REG DBGU_THR; // Transmitter Holding Register - AT91_REG DBGU_BRGR; // Baud Rate Generator Register - AT91_REG Reserved3[7]; // - AT91_REG DBGU_C1R; // Chip ID1 Register - AT91_REG DBGU_C2R; // Chip ID2 Register - AT91_REG DBGU_FNTR; // Force NTRST Register - AT91_REG Reserved4[45]; // - AT91_REG DBGU_RPR; // Receive Pointer Register - AT91_REG DBGU_RCR; // Receive Counter Register - AT91_REG DBGU_TPR; // Transmit Pointer Register - AT91_REG DBGU_TCR; // Transmit Counter Register - AT91_REG DBGU_RNPR; // Receive Next Pointer Register - AT91_REG DBGU_RNCR; // Receive Next Counter Register - AT91_REG DBGU_TNPR; // Transmit Next Pointer Register - AT91_REG DBGU_TNCR; // Transmit Next Counter Register - AT91_REG DBGU_PTCR; // PDC Transfer Control Register - AT91_REG DBGU_PTSR; // PDC Transfer Status Register - AT91_REG Reserved5[54]; // - AT91_REG PIOA_PER; // PIO Enable Register - AT91_REG PIOA_PDR; // PIO Disable Register - AT91_REG PIOA_PSR; // PIO Status Register - AT91_REG Reserved6[1]; // - AT91_REG PIOA_OER; // Output Enable Register - AT91_REG PIOA_ODR; // Output Disable Registerr - AT91_REG PIOA_OSR; // Output Status Register - AT91_REG Reserved7[1]; // - AT91_REG PIOA_IFER; // Input Filter Enable Register - AT91_REG PIOA_IFDR; // Input Filter Disable Register - AT91_REG PIOA_IFSR; // Input Filter Status Register - AT91_REG Reserved8[1]; // - AT91_REG PIOA_SODR; // Set Output Data Register - AT91_REG PIOA_CODR; // Clear Output Data Register - AT91_REG PIOA_ODSR; // Output Data Status Register - AT91_REG PIOA_PDSR; // Pin Data Status Register - AT91_REG PIOA_IER; // Interrupt Enable Register - AT91_REG PIOA_IDR; // Interrupt Disable Register - AT91_REG PIOA_IMR; // Interrupt Mask Register - AT91_REG PIOA_ISR; // Interrupt Status Register - AT91_REG PIOA_MDER; // Multi-driver Enable Register - AT91_REG PIOA_MDDR; // Multi-driver Disable Register - AT91_REG PIOA_MDSR; // Multi-driver Status Register - AT91_REG Reserved9[1]; // - AT91_REG PIOA_PPUDR; // Pull-up Disable Register - AT91_REG PIOA_PPUER; // Pull-up Enable Register - AT91_REG PIOA_PPUSR; // Pad Pull-up Status Register - AT91_REG Reserved10[1]; // - AT91_REG PIOA_ASR; // Select A Register - AT91_REG PIOA_BSR; // Select B Register - AT91_REG PIOA_ABSR; // AB Select Status Register - AT91_REG Reserved11[9]; // - AT91_REG PIOA_OWER; // Output Write Enable Register - AT91_REG PIOA_OWDR; // Output Write Disable Register - AT91_REG PIOA_OWSR; // Output Write Status Register - AT91_REG Reserved12[85]; // - AT91_REG PIOB_PER; // PIO Enable Register - AT91_REG PIOB_PDR; // PIO Disable Register - AT91_REG PIOB_PSR; // PIO Status Register - AT91_REG Reserved13[1]; // - AT91_REG PIOB_OER; // Output Enable Register - AT91_REG PIOB_ODR; // Output Disable Registerr - AT91_REG PIOB_OSR; // Output Status Register - AT91_REG Reserved14[1]; // - AT91_REG PIOB_IFER; // Input Filter Enable Register - AT91_REG PIOB_IFDR; // Input Filter Disable Register - AT91_REG PIOB_IFSR; // Input Filter Status Register - AT91_REG Reserved15[1]; // - AT91_REG PIOB_SODR; // Set Output Data Register - AT91_REG PIOB_CODR; // Clear Output Data Register - AT91_REG PIOB_ODSR; // Output Data Status Register - AT91_REG PIOB_PDSR; // Pin Data Status Register - AT91_REG PIOB_IER; // Interrupt Enable Register - AT91_REG PIOB_IDR; // Interrupt Disable Register - AT91_REG PIOB_IMR; // Interrupt Mask Register - AT91_REG PIOB_ISR; // Interrupt Status Register - AT91_REG PIOB_MDER; // Multi-driver Enable Register - AT91_REG PIOB_MDDR; // Multi-driver Disable Register - AT91_REG PIOB_MDSR; // Multi-driver Status Register - AT91_REG Reserved16[1]; // - AT91_REG PIOB_PPUDR; // Pull-up Disable Register - AT91_REG PIOB_PPUER; // Pull-up Enable Register - AT91_REG PIOB_PPUSR; // Pad Pull-up Status Register - AT91_REG Reserved17[1]; // - AT91_REG PIOB_ASR; // Select A Register - AT91_REG PIOB_BSR; // Select B Register - AT91_REG PIOB_ABSR; // AB Select Status Register - AT91_REG Reserved18[9]; // - AT91_REG PIOB_OWER; // Output Write Enable Register - AT91_REG PIOB_OWDR; // Output Write Disable Register - AT91_REG PIOB_OWSR; // Output Write Status Register - AT91_REG Reserved19[85]; // - AT91_REG PIOC_PER; // PIO Enable Register - AT91_REG PIOC_PDR; // PIO Disable Register - AT91_REG PIOC_PSR; // PIO Status Register - AT91_REG Reserved20[1]; // - AT91_REG PIOC_OER; // Output Enable Register - AT91_REG PIOC_ODR; // Output Disable Registerr - AT91_REG PIOC_OSR; // Output Status Register - AT91_REG Reserved21[1]; // - AT91_REG PIOC_IFER; // Input Filter Enable Register - AT91_REG PIOC_IFDR; // Input Filter Disable Register - AT91_REG PIOC_IFSR; // Input Filter Status Register - AT91_REG Reserved22[1]; // - AT91_REG PIOC_SODR; // Set Output Data Register - AT91_REG PIOC_CODR; // Clear Output Data Register - AT91_REG PIOC_ODSR; // Output Data Status Register - AT91_REG PIOC_PDSR; // Pin Data Status Register - AT91_REG PIOC_IER; // Interrupt Enable Register - AT91_REG PIOC_IDR; // Interrupt Disable Register - AT91_REG PIOC_IMR; // Interrupt Mask Register - AT91_REG PIOC_ISR; // Interrupt Status Register - AT91_REG PIOC_MDER; // Multi-driver Enable Register - AT91_REG PIOC_MDDR; // Multi-driver Disable Register - AT91_REG PIOC_MDSR; // Multi-driver Status Register - AT91_REG Reserved23[1]; // - AT91_REG PIOC_PPUDR; // Pull-up Disable Register - AT91_REG PIOC_PPUER; // Pull-up Enable Register - AT91_REG PIOC_PPUSR; // Pad Pull-up Status Register - AT91_REG Reserved24[1]; // - AT91_REG PIOC_ASR; // Select A Register - AT91_REG PIOC_BSR; // Select B Register - AT91_REG PIOC_ABSR; // AB Select Status Register - AT91_REG Reserved25[9]; // - AT91_REG PIOC_OWER; // Output Write Enable Register - AT91_REG PIOC_OWDR; // Output Write Disable Register - AT91_REG PIOC_OWSR; // Output Write Status Register - AT91_REG Reserved26[85]; // - AT91_REG PIOD_PER; // PIO Enable Register - AT91_REG PIOD_PDR; // PIO Disable Register - AT91_REG PIOD_PSR; // PIO Status Register - AT91_REG Reserved27[1]; // - AT91_REG PIOD_OER; // Output Enable Register - AT91_REG PIOD_ODR; // Output Disable Registerr - AT91_REG PIOD_OSR; // Output Status Register - AT91_REG Reserved28[1]; // - AT91_REG PIOD_IFER; // Input Filter Enable Register - AT91_REG PIOD_IFDR; // Input Filter Disable Register - AT91_REG PIOD_IFSR; // Input Filter Status Register - AT91_REG Reserved29[1]; // - AT91_REG PIOD_SODR; // Set Output Data Register - AT91_REG PIOD_CODR; // Clear Output Data Register - AT91_REG PIOD_ODSR; // Output Data Status Register - AT91_REG PIOD_PDSR; // Pin Data Status Register - AT91_REG PIOD_IER; // Interrupt Enable Register - AT91_REG PIOD_IDR; // Interrupt Disable Register - AT91_REG PIOD_IMR; // Interrupt Mask Register - AT91_REG PIOD_ISR; // Interrupt Status Register - AT91_REG PIOD_MDER; // Multi-driver Enable Register - AT91_REG PIOD_MDDR; // Multi-driver Disable Register - AT91_REG PIOD_MDSR; // Multi-driver Status Register - AT91_REG Reserved30[1]; // - AT91_REG PIOD_PPUDR; // Pull-up Disable Register - AT91_REG PIOD_PPUER; // Pull-up Enable Register - AT91_REG PIOD_PPUSR; // Pad Pull-up Status Register - AT91_REG Reserved31[1]; // - AT91_REG PIOD_ASR; // Select A Register - AT91_REG PIOD_BSR; // Select B Register - AT91_REG PIOD_ABSR; // AB Select Status Register - AT91_REG Reserved32[9]; // - AT91_REG PIOD_OWER; // Output Write Enable Register - AT91_REG PIOD_OWDR; // Output Write Disable Register - AT91_REG PIOD_OWSR; // Output Write Status Register - AT91_REG Reserved33[85]; // - AT91_REG PMC_SCER; // System Clock Enable Register - AT91_REG PMC_SCDR; // System Clock Disable Register - AT91_REG PMC_SCSR; // System Clock Status Register - AT91_REG Reserved34[1]; // - AT91_REG PMC_PCER; // Peripheral Clock Enable Register - AT91_REG PMC_PCDR; // Peripheral Clock Disable Register - AT91_REG PMC_PCSR; // Peripheral Clock Status Register - AT91_REG Reserved35[1]; // - AT91_REG CKGR_MOR; // Main Oscillator Register - AT91_REG CKGR_MCFR; // Main Clock Frequency Register - AT91_REG CKGR_PLLAR; // PLL A Register - AT91_REG CKGR_PLLBR; // PLL B Register - AT91_REG PMC_MCKR; // Master Clock Register - AT91_REG Reserved36[3]; // - AT91_REG PMC_PCKR[8]; // Programmable Clock Register - AT91_REG PMC_IER; // Interrupt Enable Register - AT91_REG PMC_IDR; // Interrupt Disable Register - AT91_REG PMC_SR; // Status Register - AT91_REG PMC_IMR; // Interrupt Mask Register - AT91_REG Reserved37[36]; // - AT91_REG ST_CR; // Control Register - AT91_REG ST_PIMR; // Period Interval Mode Register - AT91_REG ST_WDMR; // Watchdog Mode Register - AT91_REG ST_RTMR; // Real-time Mode Register - AT91_REG ST_SR; // Status Register - AT91_REG ST_IER; // Interrupt Enable Register - AT91_REG ST_IDR; // Interrupt Disable Register - AT91_REG ST_IMR; // Interrupt Mask Register - AT91_REG ST_RTAR; // Real-time Alarm Register - AT91_REG ST_CRTR; // Current Real-time Register - AT91_REG Reserved38[54]; // - AT91_REG RTC_CR; // Control Register - AT91_REG RTC_MR; // Mode Register - AT91_REG RTC_TIMR; // Time Register - AT91_REG RTC_CALR; // Calendar Register - AT91_REG RTC_TIMALR; // Time Alarm Register - AT91_REG RTC_CALALR; // Calendar Alarm Register - AT91_REG RTC_SR; // Status Register - AT91_REG RTC_SCCR; // Status Clear Command Register - AT91_REG RTC_IER; // Interrupt Enable Register - AT91_REG RTC_IDR; // Interrupt Disable Register - AT91_REG RTC_IMR; // Interrupt Mask Register - AT91_REG RTC_VER; // Valid Entry Register - AT91_REG Reserved39[52]; // - AT91_REG MC_RCR; // MC Remap Control Register - AT91_REG MC_ASR; // MC Abort Status Register - AT91_REG MC_AASR; // MC Abort Address Status Register - AT91_REG Reserved40[1]; // - AT91_REG MC_PUIA[16]; // MC Protection Unit Area - AT91_REG MC_PUP; // MC Protection Unit Peripherals - AT91_REG MC_PUER; // MC Protection Unit Enable Register - AT91_REG Reserved41[2]; // - AT91_REG EBI_CSA; // Chip Select Assignment Register - AT91_REG EBI_CFGR; // Configuration Register - AT91_REG Reserved42[2]; // - AT91_REG EBI_SMC2_CSR[8]; // SMC2 Chip Select Register - AT91_REG EBI_SDRC_MR; // SDRAM Controller Mode Register - AT91_REG EBI_SDRC_TR; // SDRAM Controller Refresh Timer Register - AT91_REG EBI_SDRC_CR; // SDRAM Controller Configuration Register - AT91_REG EBI_SDRC_SRR; // SDRAM Controller Self Refresh Register - AT91_REG EBI_SDRC_LPR; // SDRAM Controller Low Power Register - AT91_REG EBI_SDRC_IER; // SDRAM Controller Interrupt Enable Register - AT91_REG EBI_SDRC_IDR; // SDRAM Controller Interrupt Disable Register - AT91_REG EBI_SDRC_IMR; // SDRAM Controller Interrupt Mask Register - AT91_REG EBI_SDRC_ISR; // SDRAM Controller Interrupt Mask Register - AT91_REG Reserved43[3]; // - AT91_REG EBI_BFC_MR; // BFC Mode Register -} AT91S_SYS, *AT91PS_SYS; - - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Memory Controller Interface -// ***************************************************************************** -typedef struct _AT91S_MC { - AT91_REG MC_RCR; // MC Remap Control Register - AT91_REG MC_ASR; // MC Abort Status Register - AT91_REG MC_AASR; // MC Abort Address Status Register - AT91_REG Reserved0[1]; // - AT91_REG MC_PUIA[16]; // MC Protection Unit Area - AT91_REG MC_PUP; // MC Protection Unit Peripherals - AT91_REG MC_PUER; // MC Protection Unit Enable Register -} AT91S_MC, *AT91PS_MC; - -// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- -#define AT91C_MC_RCB (0x1u << 0) // (MC) Remap Command Bit -// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- -#define AT91C_MC_UNDADD (0x1u << 0) // (MC) Undefined Addess Abort Status -#define AT91C_MC_MISADD (0x1u << 1) // (MC) Misaligned Addess Abort Status -#define AT91C_MC_MPU (0x1u << 2) // (MC) Memory protection Unit Abort Status -#define AT91C_MC_ABTSZ (0x3u << 8) // (MC) Abort Size Status -#define AT91C_MC_ABTSZ_BYTE (0x0u << 8) // (MC) Byte -#define AT91C_MC_ABTSZ_HWORD (0x1u << 8) // (MC) Half-word -#define AT91C_MC_ABTSZ_WORD (0x2u << 8) // (MC) Word -#define AT91C_MC_ABTTYP (0x3u << 10) // (MC) Abort Type Status -#define AT91C_MC_ABTTYP_DATAR (0x0u << 10) // (MC) Data Read -#define AT91C_MC_ABTTYP_DATAW (0x1u << 10) // (MC) Data Write -#define AT91C_MC_ABTTYP_FETCH (0x2u << 10) // (MC) Code Fetch -#define AT91C_MC_MST0 (0x1u << 16) // (MC) Master 0 Abort Source -#define AT91C_MC_MST1 (0x1u << 17) // (MC) Master 1 Abort Source -#define AT91C_MC_SVMST0 (0x1u << 24) // (MC) Saved Master 0 Abort Source -#define AT91C_MC_SVMST1 (0x1u << 25) // (MC) Saved Master 1 Abort Source -// -------- MC_PUIA : (MC Offset: 0x10) MC Protection Unit Area -------- -#define AT91C_MC_PROT (0x3u << 0) // (MC) Protection -#define AT91C_MC_PROT_PNAUNA 0x0u // (MC) Privilege: No Access, User: No Access -#define AT91C_MC_PROT_PRWUNA 0x1u // (MC) Privilege: Read/Write, User: No Access -#define AT91C_MC_PROT_PRWURO 0x2u // (MC) Privilege: Read/Write, User: Read Only -#define AT91C_MC_PROT_PRWURW 0x3u // (MC) Privilege: Read/Write, User: Read/Write -#define AT91C_MC_SIZE (0xFu << 4) // (MC) Internal Area Size -#define AT91C_MC_SIZE_1KB (0x0u << 4) // (MC) Area size 1KByte -#define AT91C_MC_SIZE_2KB (0x1u << 4) // (MC) Area size 2KByte -#define AT91C_MC_SIZE_4KB (0x2u << 4) // (MC) Area size 4KByte -#define AT91C_MC_SIZE_8KB (0x3u << 4) // (MC) Area size 8KByte -#define AT91C_MC_SIZE_16KB (0x4u << 4) // (MC) Area size 16KByte -#define AT91C_MC_SIZE_32KB (0x5u << 4) // (MC) Area size 32KByte -#define AT91C_MC_SIZE_64KB (0x6u << 4) // (MC) Area size 64KByte -#define AT91C_MC_SIZE_128KB (0x7u << 4) // (MC) Area size 128KByte -#define AT91C_MC_SIZE_256KB (0x8u << 4) // (MC) Area size 256KByte -#define AT91C_MC_SIZE_512KB (0x9u << 4) // (MC) Area size 512KByte -#define AT91C_MC_SIZE_1MB (0xAu << 4) // (MC) Area size 1MByte -#define AT91C_MC_SIZE_2MB (0xBu << 4) // (MC) Area size 2MByte -#define AT91C_MC_SIZE_4MB (0xCu << 4) // (MC) Area size 4MByte -#define AT91C_MC_SIZE_8MB (0xDu << 4) // (MC) Area size 8MByte -#define AT91C_MC_SIZE_16MB (0xEu << 4) // (MC) Area size 16MByte -#define AT91C_MC_SIZE_64MB (0xFu << 4) // (MC) Area size 64MByte -#define AT91C_MC_BA (0x3FFFFu << 10) // (MC) Internal Area Base Address -// -------- MC_PUP : (MC Offset: 0x50) MC Protection Unit Peripheral -------- -// -------- MC_PUER : (MC Offset: 0x54) MC Protection Unit Area -------- -#define AT91C_MC_PUEB (0x1u << 0) // (MC) Protection Unit enable Bit - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Real-time Clock Alarm and Parallel Load Interface -// ***************************************************************************** -typedef struct _AT91S_RTC { - AT91_REG RTC_CR; // Control Register - AT91_REG RTC_MR; // Mode Register - AT91_REG RTC_TIMR; // Time Register - AT91_REG RTC_CALR; // Calendar Register - AT91_REG RTC_TIMALR; // Time Alarm Register - AT91_REG RTC_CALALR; // Calendar Alarm Register - AT91_REG RTC_SR; // Status Register - AT91_REG RTC_SCCR; // Status Clear Command Register - AT91_REG RTC_IER; // Interrupt Enable Register - AT91_REG RTC_IDR; // Interrupt Disable Register - AT91_REG RTC_IMR; // Interrupt Mask Register - AT91_REG RTC_VER; // Valid Entry Register -} AT91S_RTC, *AT91PS_RTC; - -// -------- RTC_CR : (RTC Offset: 0x0) RTC Control Register -------- -#define AT91C_RTC_UPDTIM (0x1u << 0) // (RTC) Update Request Time Register -#define AT91C_RTC_UPDCAL (0x1u << 1) // (RTC) Update Request Calendar Register -#define AT91C_RTC_TIMEVSEL (0x3u << 8) // (RTC) Time Event Selection -#define AT91C_RTC_TIMEVSEL_MINUTE (0x0u << 8) // (RTC) Minute change. -#define AT91C_RTC_TIMEVSEL_HOUR (0x1u << 8) // (RTC) Hour change. -#define AT91C_RTC_TIMEVSEL_DAY24 (0x2u << 8) // (RTC) Every day at midnight. -#define AT91C_RTC_TIMEVSEL_DAY12 (0x3u << 8) // (RTC) Every day at noon. -#define AT91C_RTC_CALEVSEL (0x3u << 16) // (RTC) Calendar Event Selection -#define AT91C_RTC_CALEVSEL_WEEK (0x0u << 16) // (RTC) Week change (every Monday at time 00:00:00). -#define AT91C_RTC_CALEVSEL_MONTH (0x1u << 16) // (RTC) Month change (every 01 of each month at time 00:00:00). -#define AT91C_RTC_CALEVSEL_YEAR (0x2u << 16) // (RTC) Year change (every January 1 at time 00:00:00). -// -------- RTC_MR : (RTC Offset: 0x4) RTC Mode Register -------- -#define AT91C_RTC_HRMOD (0x1u << 0) // (RTC) 12-24 hour Mode -// -------- RTC_TIMR : (RTC Offset: 0x8) RTC Time Register -------- -#define AT91C_RTC_SEC (0x7Fu << 0) // (RTC) Current Second -#define AT91C_RTC_MIN (0x7Fu << 8) // (RTC) Current Minute -#define AT91C_RTC_HOUR (0x1Fu << 16) // (RTC) Current Hour -#define AT91C_RTC_AMPM (0x1u << 22) // (RTC) Ante Meridiem, Post Meridiem Indicator -// -------- RTC_CALR : (RTC Offset: 0xc) RTC Calendar Register -------- -#define AT91C_RTC_CENT (0x3Fu << 0) // (RTC) Current Century -#define AT91C_RTC_YEAR (0xFFu << 8) // (RTC) Current Year -#define AT91C_RTC_MONTH (0x1Fu << 16) // (RTC) Current Month -#define AT91C_RTC_DAY (0x7u << 21) // (RTC) Current Day -#define AT91C_RTC_DATE (0x3Fu << 24) // (RTC) Current Date -// -------- RTC_TIMALR : (RTC Offset: 0x10) RTC Time Alarm Register -------- -#define AT91C_RTC_SECEN (0x1u << 7) // (RTC) Second Alarm Enable -#define AT91C_RTC_MINEN (0x1u << 15) // (RTC) Minute Alarm -#define AT91C_RTC_HOUREN (0x1u << 23) // (RTC) Current Hour -// -------- RTC_CALALR : (RTC Offset: 0x14) RTC Calendar Alarm Register -------- -#define AT91C_RTC_MONTHEN (0x1u << 23) // (RTC) Month Alarm Enable -#define AT91C_RTC_DATEEN (0x1u << 31) // (RTC) Date Alarm Enable -// -------- RTC_SR : (RTC Offset: 0x18) RTC Status Register -------- -#define AT91C_RTC_ACKUPD (0x1u << 0) // (RTC) Acknowledge for Update -#define AT91C_RTC_ALARM (0x1u << 1) // (RTC) Alarm Flag -#define AT91C_RTC_SECEV (0x1u << 2) // (RTC) Second Event -#define AT91C_RTC_TIMEV (0x1u << 3) // (RTC) Time Event -#define AT91C_RTC_CALEV (0x1u << 4) // (RTC) Calendar event -// -------- RTC_SCCR : (RTC Offset: 0x1c) RTC Status Clear Command Register -------- -// -------- RTC_IER : (RTC Offset: 0x20) RTC Interrupt Enable Register -------- -// -------- RTC_IDR : (RTC Offset: 0x24) RTC Interrupt Disable Register -------- -// -------- RTC_IMR : (RTC Offset: 0x28) RTC Interrupt Mask Register -------- -// -------- RTC_VER : (RTC Offset: 0x2c) RTC Valid Entry Register -------- -#define AT91C_RTC_NVTIM (0x1u << 0) // (RTC) Non valid Time -#define AT91C_RTC_NVCAL (0x1u << 1) // (RTC) Non valid Calendar -#define AT91C_RTC_NVTIMALR (0x1u << 2) // (RTC) Non valid time Alarm -#define AT91C_RTC_NVCALALR (0x1u << 3) // (RTC) Nonvalid Calendar Alarm - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR System Timer Interface -// ***************************************************************************** -typedef struct _AT91S_ST { - AT91_REG ST_CR; // Control Register - AT91_REG ST_PIMR; // Period Interval Mode Register - AT91_REG ST_WDMR; // Watchdog Mode Register - AT91_REG ST_RTMR; // Real-time Mode Register - AT91_REG ST_SR; // Status Register - AT91_REG ST_IER; // Interrupt Enable Register - AT91_REG ST_IDR; // Interrupt Disable Register - AT91_REG ST_IMR; // Interrupt Mask Register - AT91_REG ST_RTAR; // Real-time Alarm Register - AT91_REG ST_CRTR; // Current Real-time Register -} AT91S_ST, *AT91PS_ST; - -// -------- ST_CR : (ST Offset: 0x0) System Timer Control Register -------- -#define AT91C_ST_WDRST (0x1u << 0) // (ST) Watchdog Timer Restart -// -------- ST_PIMR : (ST Offset: 0x4) System Timer Period Interval Mode Register -------- -#define AT91C_ST_PIV (0xFFFFu << 0) // (ST) Watchdog Timer Restart -// -------- ST_WDMR : (ST Offset: 0x8) System Timer Watchdog Mode Register -------- -#define AT91C_ST_WDV (0xFFFFu << 0) // (ST) Watchdog Timer Restart -#define AT91C_ST_RSTEN (0x1u << 16) // (ST) Reset Enable -#define AT91C_ST_EXTEN (0x1u << 17) // (ST) External Signal Assertion Enable -// -------- ST_RTMR : (ST Offset: 0xc) System Timer Real-time Mode Register -------- -#define AT91C_ST_RTPRES (0xFFFFu << 0) // (ST) Real-time Timer Prescaler Value -// -------- ST_SR : (ST Offset: 0x10) System Timer Status Register -------- -#define AT91C_ST_PITS (0x1u << 0) // (ST) Period Interval Timer Interrupt -#define AT91C_ST_WDOVF (0x1u << 1) // (ST) Watchdog Overflow -#define AT91C_ST_RTTINC (0x1u << 2) // (ST) Real-time Timer Increment -#define AT91C_ST_ALMS (0x1u << 3) // (ST) Alarm Status -// -------- ST_IER : (ST Offset: 0x14) System Timer Interrupt Enable Register -------- -// -------- ST_IDR : (ST Offset: 0x18) System Timer Interrupt Disable Register -------- -// -------- ST_IMR : (ST Offset: 0x1c) System Timer Interrupt Mask Register -------- -// -------- ST_RTAR : (ST Offset: 0x20) System Timer Real-time Alarm Register -------- -#define AT91C_ST_ALMV (0xFFFFFu << 0) // (ST) Alarm Value Value -// -------- ST_CRTR : (ST Offset: 0x24) System Timer Current Real-time Register -------- -#define AT91C_ST_CRTV (0xFFFFFu << 0) // (ST) Current Real-time Value - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Power Management Controller -// ***************************************************************************** -typedef struct _AT91S_PMC { - AT91_REG PMC_SCER; // System Clock Enable Register - AT91_REG PMC_SCDR; // System Clock Disable Register - AT91_REG PMC_SCSR; // System Clock Status Register - AT91_REG Reserved0[1]; // - AT91_REG PMC_PCER; // Peripheral Clock Enable Register - AT91_REG PMC_PCDR; // Peripheral Clock Disable Register - AT91_REG PMC_PCSR; // Peripheral Clock Status Register - AT91_REG Reserved1[5]; // - AT91_REG PMC_MCKR; // Master Clock Register - AT91_REG Reserved2[3]; // - AT91_REG PMC_PCKR[8]; // Programmable Clock Register - AT91_REG PMC_IER; // Interrupt Enable Register - AT91_REG PMC_IDR; // Interrupt Disable Register - AT91_REG PMC_SR; // Status Register - AT91_REG PMC_IMR; // Interrupt Mask Register -} AT91S_PMC, *AT91PS_PMC; - -// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- -#define AT91C_PMC_PCK (0x1u << 0) // (PMC) Processor Clock -#define AT91C_PMC_UDP (0x1u << 1) // (PMC) USB Device Port Clock -#define AT91C_PMC_MCKUDP (0x1u << 2) // (PMC) USB Device Port Master Clock Automatic Disable on Suspend -#define AT91C_PMC_UHP (0x1u << 4) // (PMC) USB Host Port Clock -#define AT91C_PMC_PCK0 (0x1u << 8) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK1 (0x1u << 9) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK2 (0x1u << 10) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK3 (0x1u << 11) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK4 (0x1u << 12) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK5 (0x1u << 13) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK6 (0x1u << 14) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK7 (0x1u << 15) // (PMC) Programmable Clock Output -// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- -// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- -// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- -#define AT91C_PMC_CSS (0x3u << 0) // (PMC) Programmable Clock Selection -#define AT91C_PMC_CSS_SLOW_CLK 0x0u // (PMC) Slow Clock is selected -#define AT91C_PMC_CSS_MAIN_CLK 0x1u // (PMC) Main Clock is selected -#define AT91C_PMC_CSS_PLLA_CLK 0x2u // (PMC) Clock from PLL A is selected -#define AT91C_PMC_CSS_PLLB_CLK 0x3u // (PMC) Clock from PLL B is selected -#define AT91C_PMC_PRES (0x7u << 2) // (PMC) Programmable Clock Prescaler -#define AT91C_PMC_PRES_CLK (0x0u << 2) // (PMC) Selected clock -#define AT91C_PMC_PRES_CLK_2 (0x1u << 2) // (PMC) Selected clock divided by 2 -#define AT91C_PMC_PRES_CLK_4 (0x2u << 2) // (PMC) Selected clock divided by 4 -#define AT91C_PMC_PRES_CLK_8 (0x3u << 2) // (PMC) Selected clock divided by 8 -#define AT91C_PMC_PRES_CLK_16 (0x4u << 2) // (PMC) Selected clock divided by 16 -#define AT91C_PMC_PRES_CLK_32 (0x5u << 2) // (PMC) Selected clock divided by 32 -#define AT91C_PMC_PRES_CLK_64 (0x6u << 2) // (PMC) Selected clock divided by 64 -#define AT91C_PMC_MDIV (0x3u << 8) // (PMC) Master Clock Division -#define AT91C_PMC_MDIV_1 (0x0u << 8) // (PMC) The master clock and the processor clock are the same -#define AT91C_PMC_MDIV_2 (0x1u << 8) // (PMC) The processor clock is twice as fast as the master clock -#define AT91C_PMC_MDIV_3 (0x2u << 8) // (PMC) The processor clock is three times faster than the master clock -#define AT91C_PMC_MDIV_4 (0x3u << 8) // (PMC) The processor clock is four times faster than the master clock -// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- -// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- -#define AT91C_PMC_MOSCS (0x1u << 0) // (PMC) MOSC Status/Enable/Disable/Mask -#define AT91C_PMC_LOCKA (0x1u << 1) // (PMC) PLL A Status/Enable/Disable/Mask -#define AT91C_PMC_LOCKB (0x1u << 2) // (PMC) PLL B Status/Enable/Disable/Mask -#define AT91C_PMC_MCKRDY (0x1u << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK0RDY (0x1u << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK1RDY (0x1u << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK2RDY (0x1u << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK3RDY (0x1u << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK4RDY (0x1u << 12) // (PMC) PCK4_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK5RDY (0x1u << 13) // (PMC) PCK5_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK6RDY (0x1u << 14) // (PMC) PCK6_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK7RDY (0x1u << 15) // (PMC) PCK7_RDY Status/Enable/Disable/Mask -// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- -// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- -// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Clock Generator Controller -// ***************************************************************************** -typedef struct _AT91S_CKGR { - AT91_REG CKGR_MOR; // Main Oscillator Register - AT91_REG CKGR_MCFR; // Main Clock Frequency Register - AT91_REG CKGR_PLLAR; // PLL A Register - AT91_REG CKGR_PLLBR; // PLL B Register -} AT91S_CKGR, *AT91PS_CKGR; - -// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- -#define AT91C_CKGR_MOSCEN (0x1u << 0) // (CKGR) Main Oscillator Enable -#define AT91C_CKGR_OSCTEST (0x1u << 1) // (CKGR) Oscillator Test -#define AT91C_CKGR_OSCOUNT (0xFFu << 8) // (CKGR) Main Oscillator Start-up Time -// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- -#define AT91C_CKGR_MAINF (0xFFFFu << 0) // (CKGR) Main Clock Frequency -#define AT91C_CKGR_MAINRDY (0x1u << 16) // (CKGR) Main Clock Ready -// -------- CKGR_PLLAR : (CKGR Offset: 0x8) PLL A Register -------- -#define AT91C_CKGR_DIVA (0xFFu << 0) // (CKGR) Divider Selected -#define AT91C_CKGR_DIVA_0 0x0u // (CKGR) Divider output is 0 -#define AT91C_CKGR_DIVA_BYPASS 0x1u // (CKGR) Divider is bypassed -#define AT91C_CKGR_PLLACOUNT (0x3Fu << 8) // (CKGR) PLL A Counter -#define AT91C_CKGR_OUTA (0x3u << 14) // (CKGR) PLL A Output Frequency Range -#define AT91C_CKGR_OUTA_0 (0x0u << 14) // (CKGR) Please refer to the PLLA datasheet -#define AT91C_CKGR_OUTA_1 (0x1u << 14) // (CKGR) Please refer to the PLLA datasheet -#define AT91C_CKGR_OUTA_2 (0x2u << 14) // (CKGR) Please refer to the PLLA datasheet -#define AT91C_CKGR_OUTA_3 (0x3u << 14) // (CKGR) Please refer to the PLLA datasheet -#define AT91C_CKGR_MULA (0x7FFu << 16) // (CKGR) PLL A Multiplier -#define AT91C_CKGR_SRCA (0x1u << 29) // (CKGR) PLL A Source -// -------- CKGR_PLLBR : (CKGR Offset: 0xc) PLL B Register -------- -#define AT91C_CKGR_DIVB (0xFFu << 0) // (CKGR) Divider Selected -#define AT91C_CKGR_DIVB_0 0x0u // (CKGR) Divider output is 0 -#define AT91C_CKGR_DIVB_BYPASS 0x1u // (CKGR) Divider is bypassed -#define AT91C_CKGR_PLLBCOUNT (0x3Fu << 8) // (CKGR) PLL B Counter -#define AT91C_CKGR_OUTB (0x3u << 14) // (CKGR) PLL B Output Frequency Range -#define AT91C_CKGR_OUTB_0 (0x0u << 14) // (CKGR) Please refer to the PLLB datasheet -#define AT91C_CKGR_OUTB_1 (0x1u << 14) // (CKGR) Please refer to the PLLB datasheet -#define AT91C_CKGR_OUTB_2 (0x2u << 14) // (CKGR) Please refer to the PLLB datasheet -#define AT91C_CKGR_OUTB_3 (0x3u << 14) // (CKGR) Please refer to the PLLB datasheet -#define AT91C_CKGR_MULB (0x7FFu << 16) // (CKGR) PLL B Multiplier -#define AT91C_CKGR_USB_96M (0x1u << 28) // (CKGR) Divider for USB Ports -#define AT91C_CKGR_USB_PLL (0x1u << 29) // (CKGR) PLL Use - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Parallel Input Output Controller -// ***************************************************************************** -typedef struct _AT91S_PIO { - AT91_REG PIO_PER; // PIO Enable Register - AT91_REG PIO_PDR; // PIO Disable Register - AT91_REG PIO_PSR; // PIO Status Register - AT91_REG Reserved0[1]; // - AT91_REG PIO_OER; // Output Enable Register - AT91_REG PIO_ODR; // Output Disable Registerr - AT91_REG PIO_OSR; // Output Status Register - AT91_REG Reserved1[1]; // - AT91_REG PIO_IFER; // Input Filter Enable Register - AT91_REG PIO_IFDR; // Input Filter Disable Register - AT91_REG PIO_IFSR; // Input Filter Status Register - AT91_REG Reserved2[1]; // - AT91_REG PIO_SODR; // Set Output Data Register - AT91_REG PIO_CODR; // Clear Output Data Register - AT91_REG PIO_ODSR; // Output Data Status Register - AT91_REG PIO_PDSR; // Pin Data Status Register - AT91_REG PIO_IER; // Interrupt Enable Register - AT91_REG PIO_IDR; // Interrupt Disable Register - AT91_REG PIO_IMR; // Interrupt Mask Register - AT91_REG PIO_ISR; // Interrupt Status Register - AT91_REG PIO_MDER; // Multi-driver Enable Register - AT91_REG PIO_MDDR; // Multi-driver Disable Register - AT91_REG PIO_MDSR; // Multi-driver Status Register - AT91_REG Reserved3[1]; // - AT91_REG PIO_PPUDR; // Pull-up Disable Register - AT91_REG PIO_PPUER; // Pull-up Enable Register - AT91_REG PIO_PPUSR; // Pad Pull-up Status Register - AT91_REG Reserved4[1]; // - AT91_REG PIO_ASR; // Select A Register - AT91_REG PIO_BSR; // Select B Register - AT91_REG PIO_ABSR; // AB Select Status Register - AT91_REG Reserved5[9]; // - AT91_REG PIO_OWER; // Output Write Enable Register - AT91_REG PIO_OWDR; // Output Write Disable Register - AT91_REG PIO_OWSR; // Output Write Status Register -} AT91S_PIO, *AT91PS_PIO; - - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Debug Unit -// ***************************************************************************** -typedef struct _AT91S_DBGU { - AT91_REG DBGU_CR; // Control Register - AT91_REG DBGU_MR; // Mode Register - AT91_REG DBGU_IER; // Interrupt Enable Register - AT91_REG DBGU_IDR; // Interrupt Disable Register - AT91_REG DBGU_IMR; // Interrupt Mask Register - AT91_REG DBGU_CSR; // Channel Status Register - AT91_REG DBGU_RHR; // Receiver Holding Register - AT91_REG DBGU_THR; // Transmitter Holding Register - AT91_REG DBGU_BRGR; // Baud Rate Generator Register - AT91_REG Reserved0[7]; // - AT91_REG DBGU_C1R; // Chip ID1 Register - AT91_REG DBGU_C2R; // Chip ID2 Register - AT91_REG DBGU_FNTR; // Force NTRST Register - AT91_REG Reserved1[45]; // - AT91_REG DBGU_RPR; // Receive Pointer Register - AT91_REG DBGU_RCR; // Receive Counter Register - AT91_REG DBGU_TPR; // Transmit Pointer Register - AT91_REG DBGU_TCR; // Transmit Counter Register - AT91_REG DBGU_RNPR; // Receive Next Pointer Register - AT91_REG DBGU_RNCR; // Receive Next Counter Register - AT91_REG DBGU_TNPR; // Transmit Next Pointer Register - AT91_REG DBGU_TNCR; // Transmit Next Counter Register - AT91_REG DBGU_PTCR; // PDC Transfer Control Register - AT91_REG DBGU_PTSR; // PDC Transfer Status Register -} AT91S_DBGU, *AT91PS_DBGU; - -// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_RSTRX (0x1u << 2) // (DBGU) Reset Receiver -#define AT91C_US_RSTTX (0x1u << 3) // (DBGU) Reset Transmitter -#define AT91C_US_RXEN (0x1u << 4) // (DBGU) Receiver Enable -#define AT91C_US_RXDIS (0x1u << 5) // (DBGU) Receiver Disable -#define AT91C_US_TXEN (0x1u << 6) // (DBGU) Transmitter Enable -#define AT91C_US_TXDIS (0x1u << 7) // (DBGU) Transmitter Disable -// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_PAR (0x7u << 9) // (DBGU) Parity type -#define AT91C_US_PAR_EVEN (0x0u << 9) // (DBGU) Even Parity -#define AT91C_US_PAR_ODD (0x1u << 9) // (DBGU) Odd Parity -#define AT91C_US_PAR_SPACE (0x2u << 9) // (DBGU) Parity forced to 0 (Space) -#define AT91C_US_PAR_MARK (0x3u << 9) // (DBGU) Parity forced to 1 (Mark) -#define AT91C_US_PAR_NONE (0x4u << 9) // (DBGU) No Parity -#define AT91C_US_PAR_MULTI_DROP (0x6u << 9) // (DBGU) Multi-drop mode -#define AT91C_US_CHMODE (0x3u << 14) // (DBGU) Channel Mode -#define AT91C_US_CHMODE_NORMAL (0x0u << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. -#define AT91C_US_CHMODE_AUTO (0x1u << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. -#define AT91C_US_CHMODE_LOCAL (0x2u << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. -#define AT91C_US_CHMODE_REMOTE (0x3u << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. -// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXRDY (0x1u << 0) // (DBGU) RXRDY Interrupt -#define AT91C_US_TXRDY (0x1u << 1) // (DBGU) TXRDY Interrupt -#define AT91C_US_ENDRX (0x1u << 3) // (DBGU) End of Receive Transfer Interrupt -#define AT91C_US_ENDTX (0x1u << 4) // (DBGU) End of Transmit Interrupt -#define AT91C_US_OVRE (0x1u << 5) // (DBGU) Overrun Interrupt -#define AT91C_US_FRAME (0x1u << 6) // (DBGU) Framing Error Interrupt -#define AT91C_US_PARE (0x1u << 7) // (DBGU) Parity Error Interrupt -#define AT91C_US_TXEMPTY (0x1u << 9) // (DBGU) TXEMPTY Interrupt -#define AT91C_US_TXBUFE (0x1u << 11) // (DBGU) TXBUFE Interrupt -#define AT91C_US_RXBUFF (0x1u << 12) // (DBGU) RXBUFF Interrupt -#define AT91C_US_COMM_TX (0x1u << 30) // (DBGU) COMM_TX Interrupt -#define AT91C_US_COMM_RX (0x1u << 31) // (DBGU) COMM_RX Interrupt -// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- -// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- -#define AT91C_US_FORCE_NTRST (0x1u << 0) // (DBGU) Force NTRST in JTAG - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Peripheral Data Controller -// ***************************************************************************** -typedef struct _AT91S_PDC { - AT91_REG PDC_RPR; // Receive Pointer Register - AT91_REG PDC_RCR; // Receive Counter Register - AT91_REG PDC_TPR; // Transmit Pointer Register - AT91_REG PDC_TCR; // Transmit Counter Register - AT91_REG PDC_RNPR; // Receive Next Pointer Register - AT91_REG PDC_RNCR; // Receive Next Counter Register - AT91_REG PDC_TNPR; // Transmit Next Pointer Register - AT91_REG PDC_TNCR; // Transmit Next Counter Register - AT91_REG PDC_PTCR; // PDC Transfer Control Register - AT91_REG PDC_PTSR; // PDC Transfer Status Register -} AT91S_PDC, *AT91PS_PDC; - -// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- -#define AT91C_PDC_RXTEN (0x1u << 0) // (PDC) Receiver Transfer Enable -#define AT91C_PDC_RXTDIS (0x1u << 1) // (PDC) Receiver Transfer Disable -#define AT91C_PDC_TXTEN (0x1u << 8) // (PDC) Transmitter Transfer Enable -#define AT91C_PDC_TXTDIS (0x1u << 9) // (PDC) Transmitter Transfer Disable -// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller -// ***************************************************************************** -typedef struct _AT91S_AIC { - AT91_REG AIC_SMR[32]; // Source Mode Register - AT91_REG AIC_SVR[32]; // Source Vector Register - AT91_REG AIC_IVR; // IRQ Vector Register - AT91_REG AIC_FVR; // FIQ Vector Register - AT91_REG AIC_ISR; // Interrupt Status Register - AT91_REG AIC_IPR; // Interrupt Pending Register - AT91_REG AIC_IMR; // Interrupt Mask Register - AT91_REG AIC_CISR; // Core Interrupt Status Register - AT91_REG Reserved0[2]; // - AT91_REG AIC_IECR; // Interrupt Enable Command Register - AT91_REG AIC_IDCR; // Interrupt Disable Command Register - AT91_REG AIC_ICCR; // Interrupt Clear Command Register - AT91_REG AIC_ISCR; // Interrupt Set Command Register - AT91_REG AIC_EOICR; // End of Interrupt Command Register - AT91_REG AIC_SPU; // Spurious Vector Register - AT91_REG AIC_DCR; // Debug Control Register (Protect) - AT91_REG Reserved1[1]; // - AT91_REG AIC_FFER; // Fast Forcing Enable Register - AT91_REG AIC_FFDR; // Fast Forcing Disable Register - AT91_REG AIC_FFSR; // Fast Forcing Status Register -} AT91S_AIC, *AT91PS_AIC; - -// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- -#define AT91C_AIC_PRIOR (0x7u << 0) // (AIC) Priority Level -#define AT91C_AIC_PRIOR_LOWEST 0x0u // (AIC) Lowest priority level -#define AT91C_AIC_PRIOR_HIGHEST 0x7u // (AIC) Highest priority level -#define AT91C_AIC_SRCTYPE (0x3u << 5) // (AIC) Interrupt Source Type -#define AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE (0x0u << 5) // (AIC) Internal Sources Code Label Level Sensitive -#define AT91C_AIC_SRCTYPE_INT_EDGE_TRIGGERED (0x1u << 5) // (AIC) Internal Sources Code Label Edge triggered -#define AT91C_AIC_SRCTYPE_EXT_HIGH_LEVEL (0x2u << 5) // (AIC) External Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_EXT_POSITIVE_EDGE (0x3u << 5) // (AIC) External Sources Code Label Positive Edge triggered -// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- -#define AT91C_AIC_NFIQ (0x1u << 0) // (AIC) NFIQ Status -#define AT91C_AIC_NIRQ (0x1u << 1) // (AIC) NIRQ Status -// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- -#define AT91C_AIC_DCR_PROT (0x1u << 0) // (AIC) Protection Mode -#define AT91C_AIC_DCR_GMSK (0x1u << 1) // (AIC) General Mask - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Serial Parallel Interface -// ***************************************************************************** -typedef struct _AT91S_SPI { - AT91_REG SPI_CR; // Control Register - AT91_REG SPI_MR; // Mode Register - AT91_REG SPI_RDR; // Receive Data Register - AT91_REG SPI_TDR; // Transmit Data Register - AT91_REG SPI_SR; // Status Register - AT91_REG SPI_IER; // Interrupt Enable Register - AT91_REG SPI_IDR; // Interrupt Disable Register - AT91_REG SPI_IMR; // Interrupt Mask Register - AT91_REG Reserved0[4]; // - AT91_REG SPI_CSR[4]; // Chip Select Register - AT91_REG Reserved1[48]; // - AT91_REG SPI_RPR; // Receive Pointer Register - AT91_REG SPI_RCR; // Receive Counter Register - AT91_REG SPI_TPR; // Transmit Pointer Register - AT91_REG SPI_TCR; // Transmit Counter Register - AT91_REG SPI_RNPR; // Receive Next Pointer Register - AT91_REG SPI_RNCR; // Receive Next Counter Register - AT91_REG SPI_TNPR; // Transmit Next Pointer Register - AT91_REG SPI_TNCR; // Transmit Next Counter Register - AT91_REG SPI_PTCR; // PDC Transfer Control Register - AT91_REG SPI_PTSR; // PDC Transfer Status Register -} AT91S_SPI, *AT91PS_SPI; - -// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- -#define AT91C_SPI_SPIEN (0x1u << 0) // (SPI) SPI Enable -#define AT91C_SPI_SPIDIS (0x1u << 1) // (SPI) SPI Disable -#define AT91C_SPI_SWRST (0x1u << 7) // (SPI) SPI Software reset -// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- -#define AT91C_SPI_MSTR (0x1u << 0) // (SPI) Master/Slave Mode -#define AT91C_SPI_PS (0x1u << 1) // (SPI) Peripheral Select -#define AT91C_SPI_PS_FIXED (0x0u << 1) // (SPI) Fixed Peripheral Select -#define AT91C_SPI_PS_VARIABLE (0x1u << 1) // (SPI) Variable Peripheral Select -#define AT91C_SPI_PCSDEC (0x1u << 2) // (SPI) Chip Select Decode -#define AT91C_SPI_DIV32 (0x1u << 3) // (SPI) Clock Selection -#define AT91C_SPI_MODFDIS (0x1u << 4) // (SPI) Mode Fault Detection -#define AT91C_SPI_LLB (0x1u << 7) // (SPI) Clock Selection -#define AT91C_SPI_PCS (0xFu << 16) // (SPI) Peripheral Chip Select -#define AT91C_SPI_DLYBCS (0xFFu << 24) // (SPI) Delay Between Chip Selects -// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- -#define AT91C_SPI_RD (0xFFFFu << 0) // (SPI) Receive Data -#define AT91C_SPI_RPCS (0xFu << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- -#define AT91C_SPI_TD (0xFFFFu << 0) // (SPI) Transmit Data -#define AT91C_SPI_TPCS (0xFu << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- -#define AT91C_SPI_RDRF (0x1u << 0) // (SPI) Receive Data Register Full -#define AT91C_SPI_TDRE (0x1u << 1) // (SPI) Transmit Data Register Empty -#define AT91C_SPI_MODF (0x1u << 2) // (SPI) Mode Fault Error -#define AT91C_SPI_OVRES (0x1u << 3) // (SPI) Overrun Error Status -#define AT91C_SPI_SPENDRX (0x1u << 4) // (SPI) End of Receiver Transfer -#define AT91C_SPI_SPENDTX (0x1u << 5) // (SPI) End of Receiver Transfer -#define AT91C_SPI_RXBUFF (0x1u << 6) // (SPI) RXBUFF Interrupt -#define AT91C_SPI_TXBUFE (0x1u << 7) // (SPI) TXBUFE Interrupt -#define AT91C_SPI_SPIENS (0x1u << 16) // (SPI) Enable Status -// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- -// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- -// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- -// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- -#define AT91C_SPI_CPOL (0x1u << 0) // (SPI) Clock Polarity -#define AT91C_SPI_NCPHA (0x1u << 1) // (SPI) Clock Phase -#define AT91C_SPI_BITS (0xFu << 4) // (SPI) Bits Per Transfer -#define AT91C_SPI_BITS_8 (0x0u << 4) // (SPI) 8 Bits Per transfer -#define AT91C_SPI_BITS_9 (0x1u << 4) // (SPI) 9 Bits Per transfer -#define AT91C_SPI_BITS_10 (0x2u << 4) // (SPI) 10 Bits Per transfer -#define AT91C_SPI_BITS_11 (0x3u << 4) // (SPI) 11 Bits Per transfer -#define AT91C_SPI_BITS_12 (0x4u << 4) // (SPI) 12 Bits Per transfer -#define AT91C_SPI_BITS_13 (0x5u << 4) // (SPI) 13 Bits Per transfer -#define AT91C_SPI_BITS_14 (0x6u << 4) // (SPI) 14 Bits Per transfer -#define AT91C_SPI_BITS_15 (0x7u << 4) // (SPI) 15 Bits Per transfer -#define AT91C_SPI_BITS_16 (0x8u << 4) // (SPI) 16 Bits Per transfer -#define AT91C_SPI_SCBR (0xFFu << 8) // (SPI) Serial Clock Baud Rate -#define AT91C_SPI_DLYBS (0xFFu << 16) // (SPI) Serial Clock Baud Rate -#define AT91C_SPI_DLYBCT (0xFFu << 24) // (SPI) Delay Between Consecutive Transfers - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface -// ***************************************************************************** -typedef struct _AT91S_SSC { - AT91_REG SSC_CR; // Control Register - AT91_REG SSC_CMR; // Clock Mode Register - AT91_REG Reserved0[2]; // - AT91_REG SSC_RCMR; // Receive Clock ModeRegister - AT91_REG SSC_RFMR; // Receive Frame Mode Register - AT91_REG SSC_TCMR; // Transmit Clock Mode Register - AT91_REG SSC_TFMR; // Transmit Frame Mode Register - AT91_REG SSC_RHR; // Receive Holding Register - AT91_REG SSC_THR; // Transmit Holding Register - AT91_REG Reserved1[2]; // - AT91_REG SSC_RSHR; // Receive Sync Holding Register - AT91_REG SSC_TSHR; // Transmit Sync Holding Register - AT91_REG SSC_RC0R; // Receive Compare 0 Register - AT91_REG SSC_RC1R; // Receive Compare 1 Register - AT91_REG SSC_SR; // Status Register - AT91_REG SSC_IER; // Interrupt Enable Register - AT91_REG SSC_IDR; // Interrupt Disable Register - AT91_REG SSC_IMR; // Interrupt Mask Register - AT91_REG Reserved2[44]; // - AT91_REG SSC_RPR; // Receive Pointer Register - AT91_REG SSC_RCR; // Receive Counter Register - AT91_REG SSC_TPR; // Transmit Pointer Register - AT91_REG SSC_TCR; // Transmit Counter Register - AT91_REG SSC_RNPR; // Receive Next Pointer Register - AT91_REG SSC_RNCR; // Receive Next Counter Register - AT91_REG SSC_TNPR; // Transmit Next Pointer Register - AT91_REG SSC_TNCR; // Transmit Next Counter Register - AT91_REG SSC_PTCR; // PDC Transfer Control Register - AT91_REG SSC_PTSR; // PDC Transfer Status Register -} AT91S_SSC, *AT91PS_SSC; - -// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- -#define AT91C_SSC_RXEN (0x1u << 0) // (SSC) Receive Enable -#define AT91C_SSC_RXDIS (0x1u << 1) // (SSC) Receive Disable -#define AT91C_SSC_TXEN (0x1u << 8) // (SSC) Transmit Enable -#define AT91C_SSC_TXDIS (0x1u << 9) // (SSC) Transmit Disable -#define AT91C_SSC_SWRST (0x1u << 15) // (SSC) Software Reset -// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- -#define AT91C_SSC_CKS (0x3u << 0) // (SSC) Receive/Transmit Clock Selection -#define AT91C_SSC_CKS_DIV 0x0u // (SSC) Divided Clock -#define AT91C_SSC_CKS_TK 0x1u // (SSC) TK Clock signal -#define AT91C_SSC_CKS_RK 0x2u // (SSC) RK pin -#define AT91C_SSC_CKO (0x7u << 2) // (SSC) Receive/Transmit Clock Output Mode Selection -#define AT91C_SSC_CKO_NONE (0x0u << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only -#define AT91C_SSC_CKO_CONTINOUS (0x1u << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output -#define AT91C_SSC_CKO_DATA_TX (0x2u << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output -#define AT91C_SSC_CKI (0x1u << 5) // (SSC) Receive/Transmit Clock Inversion -#define AT91C_SSC_CKG (0x3u << 6) // (SSC) Receive/Transmit Clock Gating Selection -#define AT91C_SSC_CKG_NONE (0x0u << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock -#define AT91C_SSC_CKG_LOW (0x1u << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low -#define AT91C_SSC_CKG_HIGH (0x2u << 6) // (SSC) Receive/Transmit Clock enabled only if RF High -#define AT91C_SSC_START (0xFu << 8) // (SSC) Receive/Transmit Start Selection -#define AT91C_SSC_START_CONTINOUS (0x0u << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. -#define AT91C_SSC_START_TX (0x1u << 8) // (SSC) Transmit/Receive start -#define AT91C_SSC_START_LOW_RF (0x2u << 8) // (SSC) Detection of a low level on RF input -#define AT91C_SSC_START_HIGH_RF (0x3u << 8) // (SSC) Detection of a high level on RF input -#define AT91C_SSC_START_FALL_RF (0x4u << 8) // (SSC) Detection of a falling edge on RF input -#define AT91C_SSC_START_RISE_RF (0x5u << 8) // (SSC) Detection of a rising edge on RF input -#define AT91C_SSC_START_LEVEL_RF (0x6u << 8) // (SSC) Detection of any level change on RF input -#define AT91C_SSC_START_EDGE_RF (0x7u << 8) // (SSC) Detection of any edge on RF input -#define AT91C_SSC_START_0 (0x8u << 8) // (SSC) Compare 0 -#define AT91C_SSC_STOP (0x1u << 12) // (SSC) Receive Stop Selection -#define AT91C_SSC_STTOUT (0x1u << 15) // (SSC) Receive/Transmit Start Output Selection -#define AT91C_SSC_STTDLY (0xFFu << 16) // (SSC) Receive/Transmit Start Delay -#define AT91C_SSC_PERIOD (0xFFu << 24) // (SSC) Receive/Transmit Period Divider Selection -// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- -#define AT91C_SSC_DATLEN (0x1Fu << 0) // (SSC) Data Length -#define AT91C_SSC_LOOP (0x1u << 5) // (SSC) Loop Mode -#define AT91C_SSC_MSBF (0x1u << 7) // (SSC) Most Significant Bit First -#define AT91C_SSC_DATNB (0xFu << 8) // (SSC) Data Number per Frame -#define AT91C_SSC_FSLEN (0xFu << 16) // (SSC) Receive/Transmit Frame Sync length -#define AT91C_SSC_FSOS (0x7u << 20) // (SSC) Receive/Transmit Frame Sync Output Selection -#define AT91C_SSC_FSOS_NONE (0x0u << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only -#define AT91C_SSC_FSOS_NEGATIVE (0x1u << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse -#define AT91C_SSC_FSOS_POSITIVE (0x2u << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse -#define AT91C_SSC_FSOS_LOW (0x3u << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer -#define AT91C_SSC_FSOS_HIGH (0x4u << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer -#define AT91C_SSC_FSOS_TOGGLE (0x5u << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer -#define AT91C_SSC_FSEDGE (0x1u << 24) // (SSC) Frame Sync Edge Detection -// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- -// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- -#define AT91C_SSC_DATDEF (0x1u << 5) // (SSC) Data Default Value -#define AT91C_SSC_FSDEN (0x1u << 23) // (SSC) Frame Sync Data Enable -// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- -#define AT91C_SSC_TXRDY (0x1u << 0) // (SSC) Transmit Ready -#define AT91C_SSC_TXEMPTY (0x1u << 1) // (SSC) Transmit Empty -#define AT91C_SSC_ENDTX (0x1u << 2) // (SSC) End Of Transmission -#define AT91C_SSC_TXBUFE (0x1u << 3) // (SSC) Transmit Buffer Empty -#define AT91C_SSC_RXRDY (0x1u << 4) // (SSC) Receive Ready -#define AT91C_SSC_OVRUN (0x1u << 5) // (SSC) Receive Overrun -#define AT91C_SSC_ENDRX (0x1u << 6) // (SSC) End of Reception -#define AT91C_SSC_RXBUFF (0x1u << 7) // (SSC) Receive Buffer Full -#define AT91C_SSC_CP0 (0x1u << 8) // (SSC) Compare 0 -#define AT91C_SSC_CP1 (0x1u << 9) // (SSC) Compare 1 -#define AT91C_SSC_TXSYN (0x1u << 10) // (SSC) Transmit Sync -#define AT91C_SSC_RXSYN (0x1u << 11) // (SSC) Receive Sync -#define AT91C_SSC_TXENA (0x1u << 16) // (SSC) Transmit Enable -#define AT91C_SSC_RXENA (0x1u << 17) // (SSC) Receive Enable -// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- -// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- -// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Usart -// ***************************************************************************** -typedef struct _AT91S_USART { - AT91_REG US_CR; // Control Register - AT91_REG US_MR; // Mode Register - AT91_REG US_IER; // Interrupt Enable Register - AT91_REG US_IDR; // Interrupt Disable Register - AT91_REG US_IMR; // Interrupt Mask Register - AT91_REG US_CSR; // Channel Status Register - AT91_REG US_RHR; // Receiver Holding Register - AT91_REG US_THR; // Transmitter Holding Register - AT91_REG US_BRGR; // Baud Rate Generator Register - AT91_REG US_RTOR; // Receiver Time-out Register - AT91_REG US_TTGR; // Transmitter Time-guard Register - AT91_REG Reserved0[5]; // - AT91_REG US_FIDI; // FI_DI_Ratio Register - AT91_REG US_NER; // Nb Errors Register - AT91_REG US_XXR; // XON_XOFF Register - AT91_REG US_IF; // IRDA_FILTER Register - AT91_REG Reserved1[44]; // - AT91_REG US_RPR; // Receive Pointer Register - AT91_REG US_RCR; // Receive Counter Register - AT91_REG US_TPR; // Transmit Pointer Register - AT91_REG US_TCR; // Transmit Counter Register - AT91_REG US_RNPR; // Receive Next Pointer Register - AT91_REG US_RNCR; // Receive Next Counter Register - AT91_REG US_TNPR; // Transmit Next Pointer Register - AT91_REG US_TNCR; // Transmit Next Counter Register - AT91_REG US_PTCR; // PDC Transfer Control Register - AT91_REG US_PTSR; // PDC Transfer Status Register -} AT91S_USART, *AT91PS_USART; - -// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_RSTSTA (0x1u << 8) // (USART) Reset Status Bits -#define AT91C_US_STTBRK (0x1u << 9) // (USART) Start Break -#define AT91C_US_STPBRK (0x1u << 10) // (USART) Stop Break -#define AT91C_US_STTTO (0x1u << 11) // (USART) Start Time-out -#define AT91C_US_SENDA (0x1u << 12) // (USART) Send Address -#define AT91C_US_RSTIT (0x1u << 13) // (USART) Reset Iterations -#define AT91C_US_RSTNACK (0x1u << 14) // (USART) Reset Non Acknowledge -#define AT91C_US_RETTO (0x1u << 15) // (USART) Rearm Time-out -#define AT91C_US_DTREN (0x1u << 16) // (USART) Data Terminal ready Enable -#define AT91C_US_DTRDIS (0x1u << 17) // (USART) Data Terminal ready Disable -#define AT91C_US_RTSEN (0x1u << 18) // (USART) Request to Send enable -#define AT91C_US_RTSDIS (0x1u << 19) // (USART) Request to Send Disable -// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_USMODE (0xFu << 0) // (USART) Usart mode -#define AT91C_US_USMODE_NORMAL 0x0u // (USART) Normal -#define AT91C_US_USMODE_RS485 0x1u // (USART) RS485 -#define AT91C_US_USMODE_HWHSH 0x2u // (USART) Hardware Handshaking -#define AT91C_US_USMODE_MODEM 0x3u // (USART) Modem -#define AT91C_US_USMODE_ISO7816_0 0x4u // (USART) ISO7816 protocol: T = 0 -#define AT91C_US_USMODE_ISO7816_1 0x6u // (USART) ISO7816 protocol: T = 1 -#define AT91C_US_USMODE_IRDA 0x8u // (USART) IrDA -#define AT91C_US_USMODE_SWHSH 0xCu // (USART) Software Handshaking -#define AT91C_US_CLKS (0x3u << 4) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CLKS_CLOCK (0x0u << 4) // (USART) Clock -#define AT91C_US_CLKS_FDIV1 (0x1u << 4) // (USART) fdiv1 -#define AT91C_US_CLKS_SLOW (0x2u << 4) // (USART) slow_clock (ARM) -#define AT91C_US_CLKS_EXT (0x3u << 4) // (USART) External (SCK) -#define AT91C_US_CHRL (0x3u << 6) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CHRL_5_BITS (0x0u << 6) // (USART) Character Length: 5 bits -#define AT91C_US_CHRL_6_BITS (0x1u << 6) // (USART) Character Length: 6 bits -#define AT91C_US_CHRL_7_BITS (0x2u << 6) // (USART) Character Length: 7 bits -#define AT91C_US_CHRL_8_BITS (0x3u << 6) // (USART) Character Length: 8 bits -#define AT91C_US_SYNC (0x1u << 8) // (USART) Synchronous Mode Select -#define AT91C_US_NBSTOP (0x3u << 12) // (USART) Number of Stop bits -#define AT91C_US_NBSTOP_1_BIT (0x0u << 12) // (USART) 1 stop bit -#define AT91C_US_NBSTOP_15_BIT (0x1u << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits -#define AT91C_US_NBSTOP_2_BIT (0x2u << 12) // (USART) 2 stop bits -#define AT91C_US_MSBF (0x1u << 16) // (USART) Bit Order -#define AT91C_US_MODE9 (0x1u << 17) // (USART) 9-bit Character length -#define AT91C_US_CKLO (0x1u << 18) // (USART) Clock Output Select -#define AT91C_US_OVER (0x1u << 19) // (USART) Over Sampling Mode -#define AT91C_US_INACK (0x1u << 20) // (USART) Inhibit Non Acknowledge -#define AT91C_US_DSNACK (0x1u << 21) // (USART) Disable Successive NACK -#define AT91C_US_MAX_ITER (0x1u << 24) // (USART) Number of Repetitions -#define AT91C_US_FILTER (0x1u << 28) // (USART) Receive Line Filter -// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXBRK (0x1u << 2) // (USART) Break Received/End of Break -#define AT91C_US_TIMEOUT (0x1u << 8) // (USART) Receiver Time-out -#define AT91C_US_ITERATION (0x1u << 10) // (USART) Max number of Repetitions Reached -#define AT91C_US_NACK (0x1u << 13) // (USART) Non Acknowledge -#define AT91C_US_RIIC (0x1u << 16) // (USART) Ring INdicator Input Change Flag -#define AT91C_US_DSRIC (0x1u << 17) // (USART) Data Set Ready Input Change Flag -#define AT91C_US_DCDIC (0x1u << 18) // (USART) Data Carrier Flag -#define AT91C_US_CTSIC (0x1u << 19) // (USART) Clear To Send Input Change Flag -// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- -#define AT91C_US_RI (0x1u << 20) // (USART) Image of RI Input -#define AT91C_US_DSR (0x1u << 21) // (USART) Image of DSR Input -#define AT91C_US_DCD (0x1u << 22) // (USART) Image of DCD Input -#define AT91C_US_CTS (0x1u << 23) // (USART) Image of CTS Input - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Two-wire Interface -// ***************************************************************************** -typedef struct _AT91S_TWI { - AT91_REG TWI_CR; // Control Register - AT91_REG TWI_MMR; // Master Mode Register - AT91_REG TWI_SMR; // Slave Mode Register - AT91_REG TWI_IADR; // Internal Address Register - AT91_REG TWI_CWGR; // Clock Waveform Generator Register - AT91_REG Reserved0[3]; // - AT91_REG TWI_SR; // Status Register - AT91_REG TWI_IER; // Interrupt Enable Register - AT91_REG TWI_IDR; // Interrupt Disable Register - AT91_REG TWI_IMR; // Interrupt Mask Register - AT91_REG TWI_RHR; // Receive Holding Register - AT91_REG TWI_THR; // Transmit Holding Register -} AT91S_TWI, *AT91PS_TWI; - -// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- -#define AT91C_TWI_START (0x1u << 0) // (TWI) Send a START Condition -#define AT91C_TWI_STOP (0x1u << 1) // (TWI) Send a STOP Condition -#define AT91C_TWI_MSEN (0x1u << 2) // (TWI) TWI Master Transfer Enabled -#define AT91C_TWI_MSDIS (0x1u << 3) // (TWI) TWI Master Transfer Disabled -#define AT91C_TWI_SVEN (0x1u << 4) // (TWI) TWI Slave Transfer Enabled -#define AT91C_TWI_SVDIS (0x1u << 5) // (TWI) TWI Slave Transfer Disabled -#define AT91C_TWI_SWRST (0x1u << 7) // (TWI) Software Reset -// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- -#define AT91C_TWI_IADRSZ (0x3u << 8) // (TWI) Internal Device Address Size -#define AT91C_TWI_IADRSZ_NO (0x0u << 8) // (TWI) No internal device address -#define AT91C_TWI_IADRSZ_1_BYTE (0x1u << 8) // (TWI) One-byte internal device address -#define AT91C_TWI_IADRSZ_2_BYTE (0x2u << 8) // (TWI) Two-byte internal device address -#define AT91C_TWI_IADRSZ_3_BYTE (0x3u << 8) // (TWI) Three-byte internal device address -#define AT91C_TWI_MREAD (0x1u << 12) // (TWI) Master Read Direction -#define AT91C_TWI_DADR (0x7Fu << 16) // (TWI) Device Address -// -------- TWI_SMR : (TWI Offset: 0x8) TWI Slave Mode Register -------- -#define AT91C_TWI_SADR (0x7Fu << 16) // (TWI) Slave Device Address -// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- -#define AT91C_TWI_CLDIV (0xFFu << 0) // (TWI) Clock Low Divider -#define AT91C_TWI_CHDIV (0xFFu << 8) // (TWI) Clock High Divider -#define AT91C_TWI_CKDIV (0x7u << 16) // (TWI) Clock Divider -// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- -#define AT91C_TWI_TXCOMP (0x1u << 0) // (TWI) Transmission Completed -#define AT91C_TWI_RXRDY (0x1u << 1) // (TWI) Receive holding register ReaDY -#define AT91C_TWI_TXRDY (0x1u << 2) // (TWI) Transmit holding register ReaDY -#define AT91C_TWI_SVREAD (0x1u << 3) // (TWI) Slave Read -#define AT91C_TWI_SVACC (0x1u << 4) // (TWI) Slave Access -#define AT91C_TWI_GCACC (0x1u << 5) // (TWI) General Call Access -#define AT91C_TWI_OVRE (0x1u << 6) // (TWI) Overrun Error -#define AT91C_TWI_UNRE (0x1u << 7) // (TWI) Underrun Error -#define AT91C_TWI_NACK (0x1u << 8) // (TWI) Not Acknowledged -#define AT91C_TWI_ARBLST (0x1u << 9) // (TWI) Arbitration Lost -// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- -// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- -// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Multimedia Card Interface -// ***************************************************************************** -typedef struct _AT91S_MCI { - AT91_REG MCI_CR; // MCI Control Register - AT91_REG MCI_MR; // MCI Mode Register - AT91_REG MCI_DTOR; // MCI Data Timeout Register - AT91_REG MCI_SDCR; // MCI SD Card Register - AT91_REG MCI_ARGR; // MCI Argument Register - AT91_REG MCI_CMDR; // MCI Command Register - AT91_REG Reserved0[2]; // - AT91_REG MCI_RSPR[4]; // MCI Response Register - AT91_REG MCI_RDR; // MCI Receive Data Register - AT91_REG MCI_TDR; // MCI Transmit Data Register - AT91_REG Reserved1[2]; // - AT91_REG MCI_SR; // MCI Status Register - AT91_REG MCI_IER; // MCI Interrupt Enable Register - AT91_REG MCI_IDR; // MCI Interrupt Disable Register - AT91_REG MCI_IMR; // MCI Interrupt Mask Register - AT91_REG Reserved2[44]; // - AT91_REG MCI_RPR; // Receive Pointer Register - AT91_REG MCI_RCR; // Receive Counter Register - AT91_REG MCI_TPR; // Transmit Pointer Register - AT91_REG MCI_TCR; // Transmit Counter Register - AT91_REG MCI_RNPR; // Receive Next Pointer Register - AT91_REG MCI_RNCR; // Receive Next Counter Register - AT91_REG MCI_TNPR; // Transmit Next Pointer Register - AT91_REG MCI_TNCR; // Transmit Next Counter Register - AT91_REG MCI_PTCR; // PDC Transfer Control Register - AT91_REG MCI_PTSR; // PDC Transfer Status Register -} AT91S_MCI, *AT91PS_MCI; - -// -------- MCI_CR : (MCI Offset: 0x0) MCI Control Register -------- -#define AT91C_MCI_MCIEN (0x1u << 0) // (MCI) Multimedia Interface Enable -#define AT91C_MCI_MCIDIS (0x1u << 1) // (MCI) Multimedia Interface Disable -#define AT91C_MCI_PWSEN (0x1u << 2) // (MCI) Power Save Mode Enable -#define AT91C_MCI_PWSDIS (0x1u << 3) // (MCI) Power Save Mode Disable -// -------- MCI_MR : (MCI Offset: 0x4) MCI Mode Register -------- -#define AT91C_MCI_CLKDIV (0x1u << 0) // (MCI) Clock Divider -#define AT91C_MCI_PWSDIV (0x1u << 8) // (MCI) Power Saving Divider -#define AT91C_MCI_PDCPADV (0x1u << 14) // (MCI) PDC Padding Value -#define AT91C_MCI_PDCMODE (0x1u << 15) // (MCI) PDC Oriented Mode -#define AT91C_MCI_BLKLEN (0x1u << 18) // (MCI) Data Block Length -// -------- MCI_DTOR : (MCI Offset: 0x8) MCI Data Timeout Register -------- -#define AT91C_MCI_DTOCYC (0x1u << 0) // (MCI) Data Timeout Cycle Number -#define AT91C_MCI_DTOMUL (0x7u << 4) // (MCI) Data Timeout Multiplier -#define AT91C_MCI_DTOMUL_1 (0x0u << 4) // (MCI) DTOCYC x 1 -#define AT91C_MCI_DTOMUL_16 (0x1u << 4) // (MCI) DTOCYC x 16 -#define AT91C_MCI_DTOMUL_128 (0x2u << 4) // (MCI) DTOCYC x 128 -#define AT91C_MCI_DTOMUL_256 (0x3u << 4) // (MCI) DTOCYC x 256 -#define AT91C_MCI_DTOMUL_1024 (0x4u << 4) // (MCI) DTOCYC x 1024 -#define AT91C_MCI_DTOMUL_4096 (0x5u << 4) // (MCI) DTOCYC x 4096 -#define AT91C_MCI_DTOMUL_65536 (0x6u << 4) // (MCI) DTOCYC x 65536 -#define AT91C_MCI_DTOMUL_1048576 (0x7u << 4) // (MCI) DTOCYC x 1048576 -// -------- MCI_SDCR : (MCI Offset: 0xc) MCI SD Card Register -------- -#define AT91C_MCI_SCDSEL (0x1u << 0) // (MCI) SD Card Selector -#define AT91C_MCI_SCDBUS (0x1u << 7) // (MCI) SD Card Bus Width -// -------- MCI_CMDR : (MCI Offset: 0x14) MCI Command Register -------- -// -------- MCI_SR : (MCI Offset: 0x40) MCI Status Register -------- -#define AT91C_MCI_CMDRDY (0x1u << 0) // (MCI) Command Ready flag -#define AT91C_MCI_RXRDY (0x1u << 1) // (MCI) RX Ready flag -#define AT91C_MCI_TXRDY (0x1u << 2) // (MCI) TX Ready flag -#define AT91C_MCI_BLKE (0x1u << 3) // (MCI) Data Block Transfer Ended flag -#define AT91C_MCI_DTIP (0x1u << 4) // (MCI) Data Transfer in Progress flag -#define AT91C_MCI_NOTBUSY (0x1u << 5) // (MCI) Data Line Not Busy flag -#define AT91C_MCI_ENDRX (0x1u << 6) // (MCI) End of RX Buffer flag -#define AT91C_MCI_ENDTX (0x1u << 7) // (MCI) End of TX Buffer flag -#define AT91C_MCI_RXBUFF (0x1u << 14) // (MCI) RX Buffer Full flag -#define AT91C_MCI_TXBUFE (0x1u << 15) // (MCI) TX Buffer Empty flag -#define AT91C_MCI_RINDE (0x1u << 16) // (MCI) Response Index Error flag -#define AT91C_MCI_RDIRE (0x1u << 17) // (MCI) Response Direction Error flag -#define AT91C_MCI_RCRCE (0x1u << 18) // (MCI) Response CRC Error flag -#define AT91C_MCI_RENDE (0x1u << 19) // (MCI) Response End Bit Error flag -#define AT91C_MCI_RTOE (0x1u << 20) // (MCI) Response Time-out Error flag -#define AT91C_MCI_DCRCE (0x1u << 21) // (MCI) data CRC Error flag -#define AT91C_MCI_DTOE (0x1u << 22) // (MCI) Data timeout Error flag -#define AT91C_MCI_OVRE (0x1u << 30) // (MCI) Overrun flag -#define AT91C_MCI_UNRE (0x1u << 31) // (MCI) Underrun flag -// -------- MCI_IER : (MCI Offset: 0x44) MCI Interrupt Enable Register -------- -// -------- MCI_IDR : (MCI Offset: 0x48) MCI Interrupt Disable Register -------- -// -------- MCI_IMR : (MCI Offset: 0x4c) MCI Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR USB Device Interface -// ***************************************************************************** -typedef struct _AT91S_UDP { - AT91_REG UDP_NUM; // Frame Number Register - AT91_REG UDP_GLBSTATE; // Global State Register - AT91_REG UDP_FADDR; // Function Address Register - AT91_REG Reserved0[1]; // - AT91_REG UDP_IER; // Interrupt Enable Register - AT91_REG UDP_IDR; // Interrupt Disable Register - AT91_REG UDP_IMR; // Interrupt Mask Register - AT91_REG UDP_ISR; // Interrupt Status Register - AT91_REG UDP_ICR; // Interrupt Clear Register - AT91_REG Reserved1[1]; // - AT91_REG UDP_RSTEP; // Reset Endpoint Register - AT91_REG Reserved2[1]; // - AT91_REG UDP_CSR[8]; // Endpoint Control and Status Register - AT91_REG UDP_FDR[8]; // Endpoint FIFO Data Register -} AT91S_UDP, *AT91PS_UDP; - -// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- -#define AT91C_UDP_FRM_NUM (0x7FFu << 0) // (UDP) Frame Number as Defined in the Packet Field Formats -#define AT91C_UDP_FRM_ERR (0x1u << 16) // (UDP) Frame Error -#define AT91C_UDP_FRM_OK (0x1u << 17) // (UDP) Frame OK -// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- -#define AT91C_UDP_FADDEN (0x1u << 0) // (UDP) Function Address Enable -#define AT91C_UDP_CONFG (0x1u << 1) // (UDP) Configured -#define AT91C_UDP_RMWUPE (0x1u << 2) // (UDP) Remote Wake Up Enable -#define AT91C_UDP_RSMINPR (0x1u << 3) // (UDP) A Resume Has Been Sent to the Host -// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- -#define AT91C_UDP_FADD (0xFFu << 0) // (UDP) Function Address Value -#define AT91C_UDP_FEN (0x1u << 8) // (UDP) Function Enable -// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- -#define AT91C_UDP_EPINT0 (0x1u << 0) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT1 (0x1u << 1) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT2 (0x1u << 2) // (UDP) Endpoint 2 Interrupt -#define AT91C_UDP_EPINT3 (0x1u << 3) // (UDP) Endpoint 3 Interrupt -#define AT91C_UDP_EPINT4 (0x1u << 4) // (UDP) Endpoint 4 Interrupt -#define AT91C_UDP_EPINT5 (0x1u << 5) // (UDP) Endpoint 5 Interrupt -#define AT91C_UDP_EPINT6 (0x1u << 6) // (UDP) Endpoint 6 Interrupt -#define AT91C_UDP_EPINT7 (0x1u << 7) // (UDP) Endpoint 7 Interrupt -#define AT91C_UDP_RXSUSP (0x1u << 8) // (UDP) USB Suspend Interrupt -#define AT91C_UDP_RXRSM (0x1u << 9) // (UDP) USB Resume Interrupt -#define AT91C_UDP_EXTRSM (0x1u << 10) // (UDP) USB External Resume Interrupt -#define AT91C_UDP_SOFINT (0x1u << 11) // (UDP) USB Start Of frame Interrupt -#define AT91C_UDP_WAKEUP (0x1u << 13) // (UDP) USB Resume Interrupt -// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- -// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- -// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- -#define AT91C_UDP_ENDBUSRES (0x1u << 12) // (UDP) USB End Of Bus Reset Interrupt -// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- -// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- -#define AT91C_UDP_EP0 (0x1u << 0) // (UDP) Reset Endpoint 0 -#define AT91C_UDP_EP1 (0x1u << 1) // (UDP) Reset Endpoint 1 -#define AT91C_UDP_EP2 (0x1u << 2) // (UDP) Reset Endpoint 2 -#define AT91C_UDP_EP3 (0x1u << 3) // (UDP) Reset Endpoint 3 -#define AT91C_UDP_EP4 (0x1u << 4) // (UDP) Reset Endpoint 4 -#define AT91C_UDP_EP5 (0x1u << 5) // (UDP) Reset Endpoint 5 -#define AT91C_UDP_EP6 (0x1u << 6) // (UDP) Reset Endpoint 6 -#define AT91C_UDP_EP7 (0x1u << 7) // (UDP) Reset Endpoint 7 -// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- -#define AT91C_UDP_TXCOMP (0x1u << 0) // (UDP) Generates an IN packet with data previously written in the DPR -#define AT91C_UDP_RX_DATA_BK0 (0x1u << 1) // (UDP) Receive Data Bank 0 -#define AT91C_UDP_RXSETUP (0x1u << 2) // (UDP) Sends STALL to the Host (Control endpoints) -#define AT91C_UDP_ISOERROR (0x1u << 3) // (UDP) Isochronous error (Isochronous endpoints) -#define AT91C_UDP_TXPKTRDY (0x1u << 4) // (UDP) Transmit Packet Ready -#define AT91C_UDP_FORCESTALL (0x1u << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). -#define AT91C_UDP_RX_DATA_BK1 (0x1u << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). -#define AT91C_UDP_DIR (0x1u << 7) // (UDP) Transfer Direction -#define AT91C_UDP_EPTYPE (0x7u << 8) // (UDP) Endpoint type -#define AT91C_UDP_EPTYPE_CTRL (0x0u << 8) // (UDP) Control -#define AT91C_UDP_EPTYPE_ISO_OUT (0x1u << 8) // (UDP) Isochronous OUT -#define AT91C_UDP_EPTYPE_BULK_OUT (0x2u << 8) // (UDP) Bulk OUT -#define AT91C_UDP_EPTYPE_INT_OUT (0x3u << 8) // (UDP) Interrupt OUT -#define AT91C_UDP_EPTYPE_ISO_IN (0x5u << 8) // (UDP) Isochronous IN -#define AT91C_UDP_EPTYPE_BULK_IN (0x6u << 8) // (UDP) Bulk IN -#define AT91C_UDP_EPTYPE_INT_IN (0x7u << 8) // (UDP) Interrupt IN -#define AT91C_UDP_DTGLE (0x1u << 11) // (UDP) Data Toggle -#define AT91C_UDP_EPEDS (0x1u << 15) // (UDP) Endpoint Enable Disable -#define AT91C_UDP_RXBYTECNT (0x7FFu << 16) // (UDP) Number Of Bytes Available in the FIFO - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface -// ***************************************************************************** -typedef struct _AT91S_TC { - AT91_REG TC_CCR; // Channel Control Register - AT91_REG TC_CMR; // Channel Mode Register - AT91_REG Reserved0[2]; // - AT91_REG TC_CV; // Counter Value - AT91_REG TC_RA; // Register A - AT91_REG TC_RB; // Register B - AT91_REG TC_RC; // Register C - AT91_REG TC_SR; // Status Register - AT91_REG TC_IER; // Interrupt Enable Register - AT91_REG TC_IDR; // Interrupt Disable Register - AT91_REG TC_IMR; // Interrupt Mask Register -} AT91S_TC, *AT91PS_TC; - -// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- -#define AT91C_TC_CLKEN (0x1u << 0) // (TC) Counter Clock Enable Command -#define AT91C_TC_CLKDIS (0x1u << 1) // (TC) Counter Clock Disable Command -#define AT91C_TC_SWTRG (0x1u << 2) // (TC) Software Trigger Command -// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- -#define AT91C_TC_CPCSTOP (0x1u << 6) // (TC) Counter Clock Stopped with RC Compare -#define AT91C_TC_CPCDIS (0x1u << 7) // (TC) Counter Clock Disable with RC Compare -#define AT91C_TC_EEVTEDG (0x3u << 8) // (TC) External Event Edge Selection -#define AT91C_TC_EEVTEDG_NONE (0x0u << 8) // (TC) Edge: None -#define AT91C_TC_EEVTEDG_RISING (0x1u << 8) // (TC) Edge: rising edge -#define AT91C_TC_EEVTEDG_FALLING (0x2u << 8) // (TC) Edge: falling edge -#define AT91C_TC_EEVTEDG_BOTH (0x3u << 8) // (TC) Edge: each edge -#define AT91C_TC_EEVT (0x3u << 10) // (TC) External Event Selection -#define AT91C_TC_EEVT_NONE (0x0u << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input -#define AT91C_TC_EEVT_RISING (0x1u << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output -#define AT91C_TC_EEVT_FALLING (0x2u << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output -#define AT91C_TC_EEVT_BOTH (0x3u << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output -#define AT91C_TC_ENETRG (0x1u << 12) // (TC) External Event Trigger enable -#define AT91C_TC_WAVESEL (0x3u << 13) // (TC) Waveform Selection -#define AT91C_TC_WAVESEL_UP (0x0u << 13) // (TC) UP mode without atomatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UP_AUTO (0x1u << 13) // (TC) UP mode with automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN (0x2u << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN_AUTO (0x3u << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare -#define AT91C_TC_CPCTRG (0x1u << 14) // (TC) RC Compare Trigger Enable -#define AT91C_TC_WAVE (0x1u << 15) // (TC) -#define AT91C_TC_ACPA (0x3u << 16) // (TC) RA Compare Effect on TIOA -#define AT91C_TC_ACPA_NONE (0x0u << 16) // (TC) Effect: none -#define AT91C_TC_ACPA_SET (0x1u << 16) // (TC) Effect: set -#define AT91C_TC_ACPA_CLEAR (0x2u << 16) // (TC) Effect: clear -#define AT91C_TC_ACPA_TOGGLE (0x3u << 16) // (TC) Effect: toggle -#define AT91C_TC_ACPC (0x3u << 18) // (TC) RC Compare Effect on TIOA -#define AT91C_TC_ACPC_NONE (0x0u << 18) // (TC) Effect: none -#define AT91C_TC_ACPC_SET (0x1u << 18) // (TC) Effect: set -#define AT91C_TC_ACPC_CLEAR (0x2u << 18) // (TC) Effect: clear -#define AT91C_TC_ACPC_TOGGLE (0x3u << 18) // (TC) Effect: toggle -#define AT91C_TC_AEEVT (0x3u << 20) // (TC) External Event Effect on TIOA -#define AT91C_TC_AEEVT_NONE (0x0u << 20) // (TC) Effect: none -#define AT91C_TC_AEEVT_SET (0x1u << 20) // (TC) Effect: set -#define AT91C_TC_AEEVT_CLEAR (0x2u << 20) // (TC) Effect: clear -#define AT91C_TC_AEEVT_TOGGLE (0x3u << 20) // (TC) Effect: toggle -#define AT91C_TC_ASWTRG (0x3u << 22) // (TC) Software Trigger Effect on TIOA -#define AT91C_TC_ASWTRG_NONE (0x0u << 22) // (TC) Effect: none -#define AT91C_TC_ASWTRG_SET (0x1u << 22) // (TC) Effect: set -#define AT91C_TC_ASWTRG_CLEAR (0x2u << 22) // (TC) Effect: clear -#define AT91C_TC_ASWTRG_TOGGLE (0x3u << 22) // (TC) Effect: toggle -#define AT91C_TC_BCPB (0x3u << 24) // (TC) RB Compare Effect on TIOB -#define AT91C_TC_BCPB_NONE (0x0u << 24) // (TC) Effect: none -#define AT91C_TC_BCPB_SET (0x1u << 24) // (TC) Effect: set -#define AT91C_TC_BCPB_CLEAR (0x2u << 24) // (TC) Effect: clear -#define AT91C_TC_BCPB_TOGGLE (0x3u << 24) // (TC) Effect: toggle -#define AT91C_TC_BCPC (0x3u << 26) // (TC) RC Compare Effect on TIOB -#define AT91C_TC_BCPC_NONE (0x0u << 26) // (TC) Effect: none -#define AT91C_TC_BCPC_SET (0x1u << 26) // (TC) Effect: set -#define AT91C_TC_BCPC_CLEAR (0x2u << 26) // (TC) Effect: clear -#define AT91C_TC_BCPC_TOGGLE (0x3u << 26) // (TC) Effect: toggle -#define AT91C_TC_BEEVT (0x3u << 28) // (TC) External Event Effect on TIOB -#define AT91C_TC_BEEVT_NONE (0x0u << 28) // (TC) Effect: none -#define AT91C_TC_BEEVT_SET (0x1u << 28) // (TC) Effect: set -#define AT91C_TC_BEEVT_CLEAR (0x2u << 28) // (TC) Effect: clear -#define AT91C_TC_BEEVT_TOGGLE (0x3u << 28) // (TC) Effect: toggle -#define AT91C_TC_BSWTRG (0x3u << 30) // (TC) Software Trigger Effect on TIOB -#define AT91C_TC_BSWTRG_NONE (0x0u << 30) // (TC) Effect: none -#define AT91C_TC_BSWTRG_SET (0x1u << 30) // (TC) Effect: set -#define AT91C_TC_BSWTRG_CLEAR (0x2u << 30) // (TC) Effect: clear -#define AT91C_TC_BSWTRG_TOGGLE (0x3u << 30) // (TC) Effect: toggle -// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- -#define AT91C_TC_COVFS (0x1u << 0) // (TC) Counter Overflow -#define AT91C_TC_LOVRS (0x1u << 1) // (TC) Load Overrun -#define AT91C_TC_CPAS (0x1u << 2) // (TC) RA Compare -#define AT91C_TC_CPBS (0x1u << 3) // (TC) RB Compare -#define AT91C_TC_CPCS (0x1u << 4) // (TC) RC Compare -#define AT91C_TC_LDRAS (0x1u << 5) // (TC) RA Loading -#define AT91C_TC_LDRBS (0x1u << 6) // (TC) RB Loading -#define AT91C_TC_ETRCS (0x1u << 7) // (TC) External Trigger -#define AT91C_TC_ETRGS (0x1u << 16) // (TC) Clock Enabling -#define AT91C_TC_MTIOA (0x1u << 17) // (TC) TIOA Mirror -#define AT91C_TC_MTIOB (0x1u << 18) // (TC) TIOA Mirror -// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- -// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- -// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Interface -// ***************************************************************************** -typedef struct _AT91S_TCB { - AT91S_TC TCB_TC0; // TC Channel 0 - AT91_REG Reserved0[4]; // - AT91S_TC TCB_TC1; // TC Channel 1 - AT91_REG Reserved1[4]; // - AT91S_TC TCB_TC2; // TC Channel 2 - AT91_REG Reserved2[4]; // - AT91_REG TCB_BCR; // TC Block Control Register - AT91_REG TCB_BMR; // TC Block Mode Register -} AT91S_TCB, *AT91PS_TCB; - -// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- -#define AT91C_TCB_SYNC (0x1u << 0) // (TCB) Synchro Command -// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- -#define AT91C_TCB_TC0XC0S (0x1u << 0) // (TCB) External Clock Signal 0 Selection -#define AT91C_TCB_TC0XC0S_TCLK0 0x0u // (TCB) TCLK0 connected to XC0 -#define AT91C_TCB_TC0XC0S_NONE 0x1u // (TCB) None signal connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA1 0x2u // (TCB) TIOA1 connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA2 0x3u // (TCB) TIOA2 connected to XC0 -#define AT91C_TCB_TC1XC1S (0x1u << 2) // (TCB) External Clock Signal 1 Selection -#define AT91C_TCB_TC1XC1S_TCLK1 (0x0u << 2) // (TCB) TCLK1 connected to XC1 -#define AT91C_TCB_TC1XC1S_NONE (0x1u << 2) // (TCB) None signal connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA0 (0x2u << 2) // (TCB) TIOA0 connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA2 (0x3u << 2) // (TCB) TIOA2 connected to XC1 -#define AT91C_TCB_TC2XC2S (0x1u << 4) // (TCB) External Clock Signal 2 Selection -#define AT91C_TCB_TC2XC2S_TCLK2 (0x0u << 4) // (TCB) TCLK2 connected to XC2 -#define AT91C_TCB_TC2XC2S_NONE (0x1u << 4) // (TCB) None signal connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA0 (0x2u << 4) // (TCB) TIOA0 connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA2 (0x3u << 4) // (TCB) TIOA2 connected to XC2 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR USB Host Interface -// ***************************************************************************** -typedef struct _AT91S_UHP { - AT91_REG UHP_HcRevision; // Revision - AT91_REG UHP_HcControl; // Operating modes for the Host Controller - AT91_REG UHP_HcCommandStatus; // Command & status Register - AT91_REG UHP_HcInterruptStatus; // Interrupt Status Register - AT91_REG UHP_HcInterruptEnable; // Interrupt Enable Register - AT91_REG UHP_HcInterruptDisable; // Interrupt Disable Register - AT91_REG UHP_HcHCCA; // Pointer to the Host Controller Communication Area - AT91_REG UHP_HcPeriodCurrentED; // Current Isochronous or Interrupt Endpoint Descriptor - AT91_REG UHP_HcControlHeadED; // First Endpoint Descriptor of the Control list - AT91_REG UHP_HcControlCurrentED; // Endpoint Control and Status Register - AT91_REG UHP_HcBulkHeadED; // First endpoint register of the Bulk list - AT91_REG UHP_HcBulkCurrentED; // Current endpoint of the Bulk list - AT91_REG UHP_HcBulkDoneHead; // Last completed transfer descriptor - AT91_REG UHP_HcFmInterval; // Bit time between 2 consecutive SOFs - AT91_REG UHP_HcFmRemaining; // Bit time remaining in the current Frame - AT91_REG UHP_HcFmNumber; // Frame number - AT91_REG UHP_HcPeriodicStart; // Periodic Start - AT91_REG UHP_HcLSThreshold; // LS Threshold - AT91_REG UHP_HcRhDescriptorA; // Root Hub characteristics A - AT91_REG UHP_HcRhDescriptorB; // Root Hub characteristics B - AT91_REG UHP_HcRhStatus; // Root Hub Status register - AT91_REG UHP_HcRhPortStatus[2]; // Root Hub Port Status Register -} AT91S_UHP, *AT91PS_UHP; - - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Ethernet MAC -// ***************************************************************************** -typedef struct _AT91S_EMAC { - AT91_REG EMAC_CTL; // Network Control Register - AT91_REG EMAC_CFG; // Network Configuration Register - AT91_REG EMAC_SR; // Network Status Register - AT91_REG EMAC_TAR; // Transmit Address Register - AT91_REG EMAC_TCR; // Transmit Control Register - AT91_REG EMAC_TSR; // Transmit Status Register - AT91_REG EMAC_RBQP; // Receive Buffer Queue Pointer - AT91_REG Reserved0[1]; // - AT91_REG EMAC_RSR; // Receive Status Register - AT91_REG EMAC_ISR; // Interrupt Status Register - AT91_REG EMAC_IER; // Interrupt Enable Register - AT91_REG EMAC_IDR; // Interrupt Disable Register - AT91_REG EMAC_IMR; // Interrupt Mask Register - AT91_REG EMAC_MAN; // PHY Maintenance Register - AT91_REG Reserved1[2]; // - AT91_REG EMAC_FRA; // Frames Transmitted OK Register - AT91_REG EMAC_SCOL; // Single Collision Frame Register - AT91_REG EMAC_MCOL; // Multiple Collision Frame Register - AT91_REG EMAC_OK; // Frames Received OK Register - AT91_REG EMAC_SEQE; // Frame Check Sequence Error Register - AT91_REG EMAC_ALE; // Alignment Error Register - AT91_REG EMAC_DTE; // Deferred Transmission Frame Register - AT91_REG EMAC_LCOL; // Late Collision Register - AT91_REG EMAC_ECOL; // Excessive Collision Register - AT91_REG EMAC_CSE; // Carrier Sense Error Register - AT91_REG EMAC_TUE; // Transmit Underrun Error Register - AT91_REG EMAC_CDE; // Code Error Register - AT91_REG EMAC_ELR; // Excessive Length Error Register - AT91_REG EMAC_RJB; // Receive Jabber Register - AT91_REG EMAC_USF; // Undersize Frame Register - AT91_REG EMAC_SQEE; // SQE Test Error Register - AT91_REG EMAC_DRFC; // Discarded RX Frame Register - AT91_REG Reserved2[3]; // - AT91_REG EMAC_HSH; // Hash Address High[63:32] - AT91_REG EMAC_HSL; // Hash Address Low[31:0] - AT91_REG EMAC_SA1L; // Specific Address 1 Low, First 4 bytes - AT91_REG EMAC_SA1H; // Specific Address 1 High, Last 2 bytes - AT91_REG EMAC_SA2L; // Specific Address 2 Low, First 4 bytes - AT91_REG EMAC_SA2H; // Specific Address 2 High, Last 2 bytes - AT91_REG EMAC_SA3L; // Specific Address 3 Low, First 4 bytes - AT91_REG EMAC_SA3H; // Specific Address 3 High, Last 2 bytes - AT91_REG EMAC_SA4L; // Specific Address 4 Low, First 4 bytes - AT91_REG EMAC_SA4H; // Specific Address 4 High, Last 2 bytesr -} AT91S_EMAC, *AT91PS_EMAC; - -// -------- EMAC_CTL : (EMAC Offset: 0x0) -------- -#define AT91C_EMAC_LB (0x1u << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. -#define AT91C_EMAC_LBL (0x1u << 1) // (EMAC) Loopback local. -#define AT91C_EMAC_RE (0x1u << 2) // (EMAC) Receive enable. -#define AT91C_EMAC_TE (0x1u << 3) // (EMAC) Transmit enable. -#define AT91C_EMAC_MPE (0x1u << 4) // (EMAC) Management port enable. -#define AT91C_EMAC_CSR (0x1u << 5) // (EMAC) Clear statistics registers. -#define AT91C_EMAC_ISR (0x1u << 6) // (EMAC) Increment statistics registers. -#define AT91C_EMAC_WES (0x1u << 7) // (EMAC) Write enable for statistics registers. -#define AT91C_EMAC_BP (0x1u << 8) // (EMAC) Back pressure. -// -------- EMAC_CFG : (EMAC Offset: 0x4) Network Configuration Register -------- -#define AT91C_EMAC_SPD (0x1u << 0) // (EMAC) Speed. -#define AT91C_EMAC_FD (0x1u << 1) // (EMAC) Full duplex. -#define AT91C_EMAC_BR (0x1u << 2) // (EMAC) Bit rate. -#define AT91C_EMAC_CAF (0x1u << 4) // (EMAC) Copy all frames. -#define AT91C_EMAC_NBC (0x1u << 5) // (EMAC) No broadcast. -#define AT91C_EMAC_MTI (0x1u << 6) // (EMAC) Multicast hash enable -#define AT91C_EMAC_UNI (0x1u << 7) // (EMAC) Unicast hash enable. -#define AT91C_EMAC_BIG (0x1u << 8) // (EMAC) Receive 1522 bytes. -#define AT91C_EMAC_EAE (0x1u << 9) // (EMAC) External address match enable. -#define AT91C_EMAC_CLK (0x3u << 10) // (EMAC) -#define AT91C_EMAC_CLK_HCLK_8 (0x0u << 10) // (EMAC) HCLK divided by 8 -#define AT91C_EMAC_CLK_HCLK_16 (0x1u << 10) // (EMAC) HCLK divided by 16 -#define AT91C_EMAC_CLK_HCLK_32 (0x2u << 10) // (EMAC) HCLK divided by 32 -#define AT91C_EMAC_CLK_HCLK_64 (0x3u << 10) // (EMAC) HCLK divided by 64 -#define AT91C_EMAC_RTY (0x1u << 12) // (EMAC) -#define AT91C_EMAC_RMII (0x1u << 13) // (EMAC) -// -------- EMAC_SR : (EMAC Offset: 0x8) Network Status Register -------- -#define AT91C_EMAC_MDIO (0x1u << 1) // (EMAC) -#define AT91C_EMAC_IDLE (0x1u << 2) // (EMAC) -// -------- EMAC_TCR : (EMAC Offset: 0x10) Transmit Control Register -------- -#define AT91C_EMAC_LEN (0x7FFu << 0) // (EMAC) -#define AT91C_EMAC_NCRC (0x1u << 15) // (EMAC) -// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Control Register -------- -#define AT91C_EMAC_OVR (0x1u << 0) // (EMAC) -#define AT91C_EMAC_COL (0x1u << 1) // (EMAC) -#define AT91C_EMAC_RLE (0x1u << 2) // (EMAC) -#define AT91C_EMAC_TXIDLE (0x1u << 3) // (EMAC) -#define AT91C_EMAC_BNQ (0x1u << 4) // (EMAC) -#define AT91C_EMAC_COMP (0x1u << 5) // (EMAC) -#define AT91C_EMAC_UND (0x1u << 6) // (EMAC) -// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- -#define AT91C_EMAC_BNA (0x1u << 0) // (EMAC) -#define AT91C_EMAC_REC (0x1u << 1) // (EMAC) -// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- -#define AT91C_EMAC_DONE (0x1u << 0) // (EMAC) -#define AT91C_EMAC_RCOM (0x1u << 1) // (EMAC) -#define AT91C_EMAC_RBNA (0x1u << 2) // (EMAC) -#define AT91C_EMAC_TOVR (0x1u << 3) // (EMAC) -#define AT91C_EMAC_TUND (0x1u << 4) // (EMAC) -#define AT91C_EMAC_RTRY (0x1u << 5) // (EMAC) -#define AT91C_EMAC_TBRE (0x1u << 6) // (EMAC) -#define AT91C_EMAC_TCOM (0x1u << 7) // (EMAC) -#define AT91C_EMAC_TIDLE (0x1u << 8) // (EMAC) -#define AT91C_EMAC_LINK (0x1u << 9) // (EMAC) -#define AT91C_EMAC_ROVR (0x1u << 10) // (EMAC) -#define AT91C_EMAC_HRESP (0x1u << 11) // (EMAC) -// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- -// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- -// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- -// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- -#define AT91C_EMAC_DATA (0xFFFFu << 0) // (EMAC) -#define AT91C_EMAC_CODE (0x3u << 16) // (EMAC) -#define AT91C_EMAC_REGA (0x1Fu << 18) // (EMAC) -#define AT91C_EMAC_PHYA (0x1Fu << 23) // (EMAC) -#define AT91C_EMAC_RW (0x3u << 28) // (EMAC) -#define AT91C_EMAC_HIGH (0x1u << 30) // (EMAC) -#define AT91C_EMAC_LOW (0x1u << 31) // (EMAC) - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR External Bus Interface -// ***************************************************************************** -typedef struct _AT91S_EBI { - AT91_REG EBI_CSA; // Chip Select Assignment Register - AT91_REG EBI_CFGR; // Configuration Register -} AT91S_EBI, *AT91PS_EBI; - -// -------- EBI_CSA : (EBI Offset: 0x0) Chip Select Assignment Register -------- -#define AT91C_EBI_CS0A (0x1u << 0) // (EBI) Chip Select 0 Assignment -#define AT91C_EBI_CS0A_SMC 0x0u // (EBI) Chip Select 0 is assigned to the Static Memory Controller. -#define AT91C_EBI_CS0A_BFC 0x1u // (EBI) Chip Select 0 is assigned to the Burst Flash Controller. -#define AT91C_EBI_CS1A (0x1u << 1) // (EBI) Chip Select 1 Assignment -#define AT91C_EBI_CS1A_SMC (0x0u << 1) // (EBI) Chip Select 1 is assigned to the Static Memory Controller. -#define AT91C_EBI_CS1A_SDRAMC (0x1u << 1) // (EBI) Chip Select 1 is assigned to the SDRAM Controller. -#define AT91C_EBI_CS3A (0x1u << 3) // (EBI) Chip Select 3 Assignment -#define AT91C_EBI_CS3A_SMC (0x0u << 3) // (EBI) Chip Select 3 is only assigned to the Static Memory Controller and NCS3 behaves as defined by the SMC2. -#define AT91C_EBI_CS3A_SMC_SmartMedia (0x1u << 3) // (EBI) Chip Select 3 is assigned to the Static Memory Controller and the SmartMedia Logic is activated. -#define AT91C_EBI_CS4A (0x1u << 4) // (EBI) Chip Select 4 Assignment -#define AT91C_EBI_CS4A_SMC (0x0u << 4) // (EBI) Chip Select 4 is assigned to the Static Memory Controller and NCS4,NCS5 and NCS6 behave as defined by the SMC2. -#define AT91C_EBI_CS4A_SMC_CompactFlash (0x1u << 4) // (EBI) Chip Select 4 is assigned to the Static Memory Controller and the CompactFlash Logic is activated. -// -------- EBI_CFGR : (EBI Offset: 0x4) Configuration Register -------- -#define AT91C_EBI_DBPUC (0x1u << 0) // (EBI) Data Bus Pull-Up Configuration -#define AT91C_EBI_EBSEN (0x1u << 1) // (EBI) Bus Sharing Enable - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Static Memory Controller 2 Interface -// ***************************************************************************** -typedef struct _AT91S_SMC2 { - AT91_REG SMC2_CSR[8]; // SMC2 Chip Select Register -} AT91S_SMC2, *AT91PS_SMC2; - -// -------- SMC2_CSR : (SMC2 Offset: 0x0) SMC2 Chip Select Register -------- -#define AT91C_SMC2_NWS (0x7Fu << 0) // (SMC2) Number of Wait States -#define AT91C_SMC2_WSEN (0x1u << 7) // (SMC2) Wait State Enable -#define AT91C_SMC2_TDF (0xFu << 8) // (SMC2) Data Float Time -#define AT91C_SMC2_BAT (0x1u << 12) // (SMC2) Byte Access Type -#define AT91C_SMC2_DBW (0x1u << 13) // (SMC2) Data Bus Width -#define AT91C_SMC2_DBW_16 (0x1u << 13) // (SMC2) 16-bit. -#define AT91C_SMC2_DBW_8 (0x2u << 13) // (SMC2) 8-bit. -#define AT91C_SMC2_DRP (0x1u << 15) // (SMC2) Data Read Protocol -#define AT91C_SMC2_ACSS (0x3u << 16) // (SMC2) Address to Chip Select Setup -#define AT91C_SMC2_ACSS_STANDARD (0x0u << 16) // (SMC2) Standard, asserted at the beginning of the access and deasserted at the end. -#define AT91C_SMC2_ACSS_1_CYCLE (0x1u << 16) // (SMC2) One cycle less at the beginning and the end of the access. -#define AT91C_SMC2_ACSS_2_CYCLES (0x2u << 16) // (SMC2) Two cycles less at the beginning and the end of the access. -#define AT91C_SMC2_ACSS_3_CYCLES (0x3u << 16) // (SMC2) Three cycles less at the beginning and the end of the access. -#define AT91C_SMC2_RWSETUP (0x7u << 24) // (SMC2) Read and Write Signal Setup Time -#define AT91C_SMC2_RWHOLD (0x7u << 29) // (SMC2) Read and Write Signal Hold Time - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR SDRAM Controller Interface -// ***************************************************************************** -typedef struct _AT91S_SDRC { - AT91_REG SDRC_MR; // SDRAM Controller Mode Register - AT91_REG SDRC_TR; // SDRAM Controller Refresh Timer Register - AT91_REG SDRC_CR; // SDRAM Controller Configuration Register - AT91_REG SDRC_SRR; // SDRAM Controller Self Refresh Register - AT91_REG SDRC_LPR; // SDRAM Controller Low Power Register - AT91_REG SDRC_IER; // SDRAM Controller Interrupt Enable Register - AT91_REG SDRC_IDR; // SDRAM Controller Interrupt Disable Register - AT91_REG SDRC_IMR; // SDRAM Controller Interrupt Mask Register - AT91_REG SDRC_ISR; // SDRAM Controller Interrupt Mask Register -} AT91S_SDRC, *AT91PS_SDRC; - -// -------- SDRC_MR : (SDRC Offset: 0x0) SDRAM Controller Mode Register -------- -#define AT91C_SDRC_MODE (0xFu << 0) // (SDRC) Mode -#define AT91C_SDRC_MODE_NORMAL_CMD 0x0u // (SDRC) Normal Mode -#define AT91C_SDRC_MODE_NOP_CMD 0x1u // (SDRC) NOP Command -#define AT91C_SDRC_MODE_PRCGALL_CMD 0x2u // (SDRC) All Banks Precharge Command -#define AT91C_SDRC_MODE_LMR_CMD 0x3u // (SDRC) Load Mode Register Command -#define AT91C_SDRC_MODE_RFSH_CMD 0x4u // (SDRC) Refresh Command -#define AT91C_SDRC_DBW (0x1u << 4) // (SDRC) Data Bus Width -#define AT91C_SDRC_DBW_32_BITS (0x0u << 4) // (SDRC) 32 Bits datas bus -#define AT91C_SDRC_DBW_16_BITS (0x1u << 4) // (SDRC) 16 Bits datas bus -// -------- SDRC_TR : (SDRC Offset: 0x4) SDRC Refresh Timer Register -------- -#define AT91C_SDRC_COUNT (0xFFFu << 0) // (SDRC) Refresh Counter -// -------- SDRC_CR : (SDRC Offset: 0x8) SDRAM Configuration Register -------- -#define AT91C_SDRC_NC (0x3u << 0) // (SDRC) Number of Column Bits -#define AT91C_SDRC_NC_8 0x0u // (SDRC) 8 Bits -#define AT91C_SDRC_NC_9 0x1u // (SDRC) 9 Bits -#define AT91C_SDRC_NC_10 0x2u // (SDRC) 10 Bits -#define AT91C_SDRC_NC_11 0x3u // (SDRC) 11 Bits -#define AT91C_SDRC_NR (0x3u << 2) // (SDRC) Number of Row Bits -#define AT91C_SDRC_NR_11 (0x0u << 2) // (SDRC) 11 Bits -#define AT91C_SDRC_NR_12 (0x1u << 2) // (SDRC) 12 Bits -#define AT91C_SDRC_NR_13 (0x2u << 2) // (SDRC) 13 Bits -#define AT91C_SDRC_NB (0x1u << 4) // (SDRC) Number of Banks -#define AT91C_SDRC_NB_2_BANKS (0x0u << 4) // (SDRC) 2 banks -#define AT91C_SDRC_NB_4_BANKS (0x1u << 4) // (SDRC) 4 banks -#define AT91C_SDRC_CAS (0x3u << 5) // (SDRC) CAS Latency -#define AT91C_SDRC_CAS_2 (0x2u << 5) // (SDRC) 2 cycles -#define AT91C_SDRC_TWR (0xFu << 7) // (SDRC) Number of Write Recovery Time Cycles -#define AT91C_SDRC_TRC (0xFu << 11) // (SDRC) Number of RAS Cycle Time Cycles -#define AT91C_SDRC_TRP (0xFu << 15) // (SDRC) Number of RAS Precharge Time Cycles -#define AT91C_SDRC_TRCD (0xFu << 19) // (SDRC) Number of RAS to CAS Delay Cycles -#define AT91C_SDRC_TRAS (0xFu << 23) // (SDRC) Number of RAS Active Time Cycles -#define AT91C_SDRC_TXSR (0xFu << 27) // (SDRC) Number of Command Recovery Time Cycles -// -------- SDRC_SRR : (SDRC Offset: 0xc) SDRAM Controller Self-refresh Register -------- -#define AT91C_SDRC_SRCB (0x1u << 0) // (SDRC) Self-refresh Command Bit -// -------- SDRC_LPR : (SDRC Offset: 0x10) SDRAM Controller Low-power Register -------- -#define AT91C_SDRC_LPCB (0x1u << 0) // (SDRC) Low-power Command Bit -// -------- SDRC_IER : (SDRC Offset: 0x14) SDRAM Controller Interrupt Enable Register -------- -#define AT91C_SDRC_RES (0x1u << 0) // (SDRC) Refresh Error Status -// -------- SDRC_IDR : (SDRC Offset: 0x18) SDRAM Controller Interrupt Disable Register -------- -// -------- SDRC_IMR : (SDRC Offset: 0x1c) SDRAM Controller Interrupt Mask Register -------- -// -------- SDRC_ISR : (SDRC Offset: 0x20) SDRAM Controller Interrupt Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Burst Flash Controller Interface -// ***************************************************************************** -typedef struct _AT91S_BFC { - AT91_REG BFC_MR; // BFC Mode Register -} AT91S_BFC, *AT91PS_BFC; - -// -------- BFC_MR : (BFC Offset: 0x0) BFC Mode Register -------- -#define AT91C_BFC_BFCOM (0x3u << 0) // (BFC) Burst Flash Controller Operating Mode -#define AT91C_BFC_BFCOM_DISABLED 0x0u // (BFC) NPCS0 is driven by the SMC or remains high. -#define AT91C_BFC_BFCOM_ASYNC 0x1u // (BFC) Asynchronous -#define AT91C_BFC_BFCOM_BURST_READ 0x2u // (BFC) Burst Read -#define AT91C_BFC_BFCC (0x3u << 2) // (BFC) Burst Flash Controller Operating Mode -#define AT91C_BFC_BFCC_MCK (0x1u << 2) // (BFC) Master Clock. -#define AT91C_BFC_BFCC_MCK_DIV_2 (0x2u << 2) // (BFC) Master Clock divided by 2. -#define AT91C_BFC_BFCC_MCK_DIV_4 (0x3u << 2) // (BFC) Master Clock divided by 4. -#define AT91C_BFC_AVL (0xFu << 4) // (BFC) Address Valid Latency -#define AT91C_BFC_PAGES (0x7u << 8) // (BFC) Page Size -#define AT91C_BFC_PAGES_NO_PAGE (0x0u << 8) // (BFC) No page handling. -#define AT91C_BFC_PAGES_16 (0x1u << 8) // (BFC) 16 bytes page size. -#define AT91C_BFC_PAGES_32 (0x2u << 8) // (BFC) 32 bytes page size. -#define AT91C_BFC_PAGES_64 (0x3u << 8) // (BFC) 64 bytes page size. -#define AT91C_BFC_PAGES_128 (0x4u << 8) // (BFC) 128 bytes page size. -#define AT91C_BFC_PAGES_256 (0x5u << 8) // (BFC) 256 bytes page size. -#define AT91C_BFC_PAGES_512 (0x6u << 8) // (BFC) 512 bytes page size. -#define AT91C_BFC_PAGES_1024 (0x7u << 8) // (BFC) 1024 bytes page size. -#define AT91C_BFC_OEL (0x3u << 12) // (BFC) Output Enable Latency -#define AT91C_BFC_BAAEN (0x1u << 16) // (BFC) Burst Address Advance Enable -#define AT91C_BFC_BFOEH (0x1u << 17) // (BFC) Burst Flash Output Enable Handling -#define AT91C_BFC_MUXEN (0x1u << 18) // (BFC) Multiplexed Bus Enable -#define AT91C_BFC_RDYEN (0x1u << 19) // (BFC) Ready Enable Mode - -// ***************************************************************************** -// REGISTER ADDRESS DEFINITION FOR AT91RM9200 -// ***************************************************************************** -// ========== Register definition for SYS peripheral ========== -// ========== Register definition for MC peripheral ========== -#define AT91C_MC_PUER ((AT91_REG *) 0xFFFFFF54) // (MC) MC Protection Unit Enable Register -#define AT91C_MC_ASR ((AT91_REG *) 0xFFFFFF04) // (MC) MC Abort Status Register -#define AT91C_MC_PUP ((AT91_REG *) 0xFFFFFF50) // (MC) MC Protection Unit Peripherals -#define AT91C_MC_PUIA ((AT91_REG *) 0xFFFFFF10) // (MC) MC Protection Unit Area -#define AT91C_MC_AASR ((AT91_REG *) 0xFFFFFF08) // (MC) MC Abort Address Status Register -#define AT91C_MC_RCR ((AT91_REG *) 0xFFFFFF00) // (MC) MC Remap Control Register -// ========== Register definition for RTC peripheral ========== -#define AT91C_RTC_IMR ((AT91_REG *) 0xFFFFFE28) // (RTC) Interrupt Mask Register -#define AT91C_RTC_IER ((AT91_REG *) 0xFFFFFE20) // (RTC) Interrupt Enable Register -#define AT91C_RTC_SR ((AT91_REG *) 0xFFFFFE18) // (RTC) Status Register -#define AT91C_RTC_TIMALR ((AT91_REG *) 0xFFFFFE10) // (RTC) Time Alarm Register -#define AT91C_RTC_TIMR ((AT91_REG *) 0xFFFFFE08) // (RTC) Time Register -#define AT91C_RTC_CR ((AT91_REG *) 0xFFFFFE00) // (RTC) Control Register -#define AT91C_RTC_VER ((AT91_REG *) 0xFFFFFE2C) // (RTC) Valid Entry Register -#define AT91C_RTC_IDR ((AT91_REG *) 0xFFFFFE24) // (RTC) Interrupt Disable Register -#define AT91C_RTC_SCCR ((AT91_REG *) 0xFFFFFE1C) // (RTC) Status Clear Command Register -#define AT91C_RTC_CALALR ((AT91_REG *) 0xFFFFFE14) // (RTC) Calendar Alarm Register -#define AT91C_RTC_CALR ((AT91_REG *) 0xFFFFFE0C) // (RTC) Calendar Register -#define AT91C_RTC_MR ((AT91_REG *) 0xFFFFFE04) // (RTC) Mode Register -// ========== Register definition for ST peripheral ========== -#define AT91C_ST_CRTR ((AT91_REG *) 0xFFFFFD24) // (ST) Current Real-time Register -#define AT91C_ST_IMR ((AT91_REG *) 0xFFFFFD1C) // (ST) Interrupt Mask Register -#define AT91C_ST_IER ((AT91_REG *) 0xFFFFFD14) // (ST) Interrupt Enable Register -#define AT91C_ST_RTMR ((AT91_REG *) 0xFFFFFD0C) // (ST) Real-time Mode Register -#define AT91C_ST_PIMR ((AT91_REG *) 0xFFFFFD04) // (ST) Period Interval Mode Register -#define AT91C_ST_RTAR ((AT91_REG *) 0xFFFFFD20) // (ST) Real-time Alarm Register -#define AT91C_ST_IDR ((AT91_REG *) 0xFFFFFD18) // (ST) Interrupt Disable Register -#define AT91C_ST_SR ((AT91_REG *) 0xFFFFFD10) // (ST) Status Register -#define AT91C_ST_WDMR ((AT91_REG *) 0xFFFFFD08) // (ST) Watchdog Mode Register -#define AT91C_ST_CR ((AT91_REG *) 0xFFFFFD00) // (ST) Control Register -// ========== Register definition for PMC peripheral ========== -#define AT91C_PMC_SCSR ((AT91_REG *) 0xFFFFFC08) // (PMC) System Clock Status Register -#define AT91C_PMC_SCER ((AT91_REG *) 0xFFFFFC00) // (PMC) System Clock Enable Register -#define AT91C_PMC_IMR ((AT91_REG *) 0xFFFFFC6C) // (PMC) Interrupt Mask Register -#define AT91C_PMC_IDR ((AT91_REG *) 0xFFFFFC64) // (PMC) Interrupt Disable Register -#define AT91C_PMC_PCDR ((AT91_REG *) 0xFFFFFC14) // (PMC) Peripheral Clock Disable Register -#define AT91C_PMC_SCDR ((AT91_REG *) 0xFFFFFC04) // (PMC) System Clock Disable Register -#define AT91C_PMC_SR ((AT91_REG *) 0xFFFFFC68) // (PMC) Status Register -#define AT91C_PMC_IER ((AT91_REG *) 0xFFFFFC60) // (PMC) Interrupt Enable Register -#define AT91C_PMC_MCKR ((AT91_REG *) 0xFFFFFC30) // (PMC) Master Clock Register -#define AT91C_PMC_PCER ((AT91_REG *) 0xFFFFFC10) // (PMC) Peripheral Clock Enable Register -#define AT91C_PMC_PCSR ((AT91_REG *) 0xFFFFFC18) // (PMC) Peripheral Clock Status Register -#define AT91C_PMC_PCKR ((AT91_REG *) 0xFFFFFC40) // (PMC) Programmable Clock Register -// ========== Register definition for CKGR peripheral ========== -#define AT91C_CKGR_PLLBR ((AT91_REG *) 0xFFFFFC2C) // (CKGR) PLL B Register -#define AT91C_CKGR_MCFR ((AT91_REG *) 0xFFFFFC24) // (CKGR) Main Clock Frequency Register -#define AT91C_CKGR_PLLAR ((AT91_REG *) 0xFFFFFC28) // (CKGR) PLL A Register -#define AT91C_CKGR_MOR ((AT91_REG *) 0xFFFFFC20) // (CKGR) Main Oscillator Register -// ========== Register definition for PIOD peripheral ========== -#define AT91C_PIOD_PDSR ((AT91_REG *) 0xFFFFFA3C) // (PIOD) Pin Data Status Register -#define AT91C_PIOD_CODR ((AT91_REG *) 0xFFFFFA34) // (PIOD) Clear Output Data Register -#define AT91C_PIOD_OWER ((AT91_REG *) 0xFFFFFAA0) // (PIOD) Output Write Enable Register -#define AT91C_PIOD_MDER ((AT91_REG *) 0xFFFFFA50) // (PIOD) Multi-driver Enable Register -#define AT91C_PIOD_IMR ((AT91_REG *) 0xFFFFFA48) // (PIOD) Interrupt Mask Register -#define AT91C_PIOD_IER ((AT91_REG *) 0xFFFFFA40) // (PIOD) Interrupt Enable Register -#define AT91C_PIOD_ODSR ((AT91_REG *) 0xFFFFFA38) // (PIOD) Output Data Status Register -#define AT91C_PIOD_SODR ((AT91_REG *) 0xFFFFFA30) // (PIOD) Set Output Data Register -#define AT91C_PIOD_PER ((AT91_REG *) 0xFFFFFA00) // (PIOD) PIO Enable Register -#define AT91C_PIOD_OWDR ((AT91_REG *) 0xFFFFFAA4) // (PIOD) Output Write Disable Register -#define AT91C_PIOD_PPUER ((AT91_REG *) 0xFFFFFA64) // (PIOD) Pull-up Enable Register -#define AT91C_PIOD_MDDR ((AT91_REG *) 0xFFFFFA54) // (PIOD) Multi-driver Disable Register -#define AT91C_PIOD_ISR ((AT91_REG *) 0xFFFFFA4C) // (PIOD) Interrupt Status Register -#define AT91C_PIOD_IDR ((AT91_REG *) 0xFFFFFA44) // (PIOD) Interrupt Disable Register -#define AT91C_PIOD_PDR ((AT91_REG *) 0xFFFFFA04) // (PIOD) PIO Disable Register -#define AT91C_PIOD_ODR ((AT91_REG *) 0xFFFFFA14) // (PIOD) Output Disable Registerr -#define AT91C_PIOD_OWSR ((AT91_REG *) 0xFFFFFAA8) // (PIOD) Output Write Status Register -#define AT91C_PIOD_ABSR ((AT91_REG *) 0xFFFFFA78) // (PIOD) AB Select Status Register -#define AT91C_PIOD_ASR ((AT91_REG *) 0xFFFFFA70) // (PIOD) Select A Register -#define AT91C_PIOD_PPUSR ((AT91_REG *) 0xFFFFFA68) // (PIOD) Pad Pull-up Status Register -#define AT91C_PIOD_PPUDR ((AT91_REG *) 0xFFFFFA60) // (PIOD) Pull-up Disable Register -#define AT91C_PIOD_MDSR ((AT91_REG *) 0xFFFFFA58) // (PIOD) Multi-driver Status Register -#define AT91C_PIOD_PSR ((AT91_REG *) 0xFFFFFA08) // (PIOD) PIO Status Register -#define AT91C_PIOD_OER ((AT91_REG *) 0xFFFFFA10) // (PIOD) Output Enable Register -#define AT91C_PIOD_OSR ((AT91_REG *) 0xFFFFFA18) // (PIOD) Output Status Register -#define AT91C_PIOD_IFER ((AT91_REG *) 0xFFFFFA20) // (PIOD) Input Filter Enable Register -#define AT91C_PIOD_BSR ((AT91_REG *) 0xFFFFFA74) // (PIOD) Select B Register -#define AT91C_PIOD_IFDR ((AT91_REG *) 0xFFFFFA24) // (PIOD) Input Filter Disable Register -#define AT91C_PIOD_IFSR ((AT91_REG *) 0xFFFFFA28) // (PIOD) Input Filter Status Register -// ========== Register definition for PIOC peripheral ========== -#define AT91C_PIOC_IFDR ((AT91_REG *) 0xFFFFF824) // (PIOC) Input Filter Disable Register -#define AT91C_PIOC_ODR ((AT91_REG *) 0xFFFFF814) // (PIOC) Output Disable Registerr -#define AT91C_PIOC_ABSR ((AT91_REG *) 0xFFFFF878) // (PIOC) AB Select Status Register -#define AT91C_PIOC_SODR ((AT91_REG *) 0xFFFFF830) // (PIOC) Set Output Data Register -#define AT91C_PIOC_IFSR ((AT91_REG *) 0xFFFFF828) // (PIOC) Input Filter Status Register -#define AT91C_PIOC_CODR ((AT91_REG *) 0xFFFFF834) // (PIOC) Clear Output Data Register -#define AT91C_PIOC_ODSR ((AT91_REG *) 0xFFFFF838) // (PIOC) Output Data Status Register -#define AT91C_PIOC_IER ((AT91_REG *) 0xFFFFF840) // (PIOC) Interrupt Enable Register -#define AT91C_PIOC_IMR ((AT91_REG *) 0xFFFFF848) // (PIOC) Interrupt Mask Register -#define AT91C_PIOC_OWDR ((AT91_REG *) 0xFFFFF8A4) // (PIOC) Output Write Disable Register -#define AT91C_PIOC_MDDR ((AT91_REG *) 0xFFFFF854) // (PIOC) Multi-driver Disable Register -#define AT91C_PIOC_PDSR ((AT91_REG *) 0xFFFFF83C) // (PIOC) Pin Data Status Register -#define AT91C_PIOC_IDR ((AT91_REG *) 0xFFFFF844) // (PIOC) Interrupt Disable Register -#define AT91C_PIOC_ISR ((AT91_REG *) 0xFFFFF84C) // (PIOC) Interrupt Status Register -#define AT91C_PIOC_PDR ((AT91_REG *) 0xFFFFF804) // (PIOC) PIO Disable Register -#define AT91C_PIOC_OWSR ((AT91_REG *) 0xFFFFF8A8) // (PIOC) Output Write Status Register -#define AT91C_PIOC_OWER ((AT91_REG *) 0xFFFFF8A0) // (PIOC) Output Write Enable Register -#define AT91C_PIOC_ASR ((AT91_REG *) 0xFFFFF870) // (PIOC) Select A Register -#define AT91C_PIOC_PPUSR ((AT91_REG *) 0xFFFFF868) // (PIOC) Pad Pull-up Status Register -#define AT91C_PIOC_PPUDR ((AT91_REG *) 0xFFFFF860) // (PIOC) Pull-up Disable Register -#define AT91C_PIOC_MDSR ((AT91_REG *) 0xFFFFF858) // (PIOC) Multi-driver Status Register -#define AT91C_PIOC_MDER ((AT91_REG *) 0xFFFFF850) // (PIOC) Multi-driver Enable Register -#define AT91C_PIOC_IFER ((AT91_REG *) 0xFFFFF820) // (PIOC) Input Filter Enable Register -#define AT91C_PIOC_OSR ((AT91_REG *) 0xFFFFF818) // (PIOC) Output Status Register -#define AT91C_PIOC_OER ((AT91_REG *) 0xFFFFF810) // (PIOC) Output Enable Register -#define AT91C_PIOC_PSR ((AT91_REG *) 0xFFFFF808) // (PIOC) PIO Status Register -#define AT91C_PIOC_PER ((AT91_REG *) 0xFFFFF800) // (PIOC) PIO Enable Register -#define AT91C_PIOC_BSR ((AT91_REG *) 0xFFFFF874) // (PIOC) Select B Register -#define AT91C_PIOC_PPUER ((AT91_REG *) 0xFFFFF864) // (PIOC) Pull-up Enable Register -// ========== Register definition for PIOB peripheral ========== -#define AT91C_PIOB_OWSR ((AT91_REG *) 0xFFFFF6A8) // (PIOB) Output Write Status Register -#define AT91C_PIOB_PPUSR ((AT91_REG *) 0xFFFFF668) // (PIOB) Pad Pull-up Status Register -#define AT91C_PIOB_PPUDR ((AT91_REG *) 0xFFFFF660) // (PIOB) Pull-up Disable Register -#define AT91C_PIOB_MDSR ((AT91_REG *) 0xFFFFF658) // (PIOB) Multi-driver Status Register -#define AT91C_PIOB_MDER ((AT91_REG *) 0xFFFFF650) // (PIOB) Multi-driver Enable Register -#define AT91C_PIOB_IMR ((AT91_REG *) 0xFFFFF648) // (PIOB) Interrupt Mask Register -#define AT91C_PIOB_OSR ((AT91_REG *) 0xFFFFF618) // (PIOB) Output Status Register -#define AT91C_PIOB_OER ((AT91_REG *) 0xFFFFF610) // (PIOB) Output Enable Register -#define AT91C_PIOB_PSR ((AT91_REG *) 0xFFFFF608) // (PIOB) PIO Status Register -#define AT91C_PIOB_PER ((AT91_REG *) 0xFFFFF600) // (PIOB) PIO Enable Register -#define AT91C_PIOB_BSR ((AT91_REG *) 0xFFFFF674) // (PIOB) Select B Register -#define AT91C_PIOB_PPUER ((AT91_REG *) 0xFFFFF664) // (PIOB) Pull-up Enable Register -#define AT91C_PIOB_IFDR ((AT91_REG *) 0xFFFFF624) // (PIOB) Input Filter Disable Register -#define AT91C_PIOB_ODR ((AT91_REG *) 0xFFFFF614) // (PIOB) Output Disable Registerr -#define AT91C_PIOB_ABSR ((AT91_REG *) 0xFFFFF678) // (PIOB) AB Select Status Register -#define AT91C_PIOB_ASR ((AT91_REG *) 0xFFFFF670) // (PIOB) Select A Register -#define AT91C_PIOB_IFER ((AT91_REG *) 0xFFFFF620) // (PIOB) Input Filter Enable Register -#define AT91C_PIOB_IFSR ((AT91_REG *) 0xFFFFF628) // (PIOB) Input Filter Status Register -#define AT91C_PIOB_SODR ((AT91_REG *) 0xFFFFF630) // (PIOB) Set Output Data Register -#define AT91C_PIOB_ODSR ((AT91_REG *) 0xFFFFF638) // (PIOB) Output Data Status Register -#define AT91C_PIOB_CODR ((AT91_REG *) 0xFFFFF634) // (PIOB) Clear Output Data Register -#define AT91C_PIOB_PDSR ((AT91_REG *) 0xFFFFF63C) // (PIOB) Pin Data Status Register -#define AT91C_PIOB_OWER ((AT91_REG *) 0xFFFFF6A0) // (PIOB) Output Write Enable Register -#define AT91C_PIOB_IER ((AT91_REG *) 0xFFFFF640) // (PIOB) Interrupt Enable Register -#define AT91C_PIOB_OWDR ((AT91_REG *) 0xFFFFF6A4) // (PIOB) Output Write Disable Register -#define AT91C_PIOB_MDDR ((AT91_REG *) 0xFFFFF654) // (PIOB) Multi-driver Disable Register -#define AT91C_PIOB_ISR ((AT91_REG *) 0xFFFFF64C) // (PIOB) Interrupt Status Register -#define AT91C_PIOB_IDR ((AT91_REG *) 0xFFFFF644) // (PIOB) Interrupt Disable Register -#define AT91C_PIOB_PDR ((AT91_REG *) 0xFFFFF604) // (PIOB) PIO Disable Register -// ========== Register definition for PIOA peripheral ========== -#define AT91C_PIOA_IMR ((AT91_REG *) 0xFFFFF448) // (PIOA) Interrupt Mask Register -#define AT91C_PIOA_IER ((AT91_REG *) 0xFFFFF440) // (PIOA) Interrupt Enable Register -#define AT91C_PIOA_OWDR ((AT91_REG *) 0xFFFFF4A4) // (PIOA) Output Write Disable Register -#define AT91C_PIOA_ISR ((AT91_REG *) 0xFFFFF44C) // (PIOA) Interrupt Status Register -#define AT91C_PIOA_PPUDR ((AT91_REG *) 0xFFFFF460) // (PIOA) Pull-up Disable Register -#define AT91C_PIOA_MDSR ((AT91_REG *) 0xFFFFF458) // (PIOA) Multi-driver Status Register -#define AT91C_PIOA_MDER ((AT91_REG *) 0xFFFFF450) // (PIOA) Multi-driver Enable Register -#define AT91C_PIOA_PER ((AT91_REG *) 0xFFFFF400) // (PIOA) PIO Enable Register -#define AT91C_PIOA_PSR ((AT91_REG *) 0xFFFFF408) // (PIOA) PIO Status Register -#define AT91C_PIOA_OER ((AT91_REG *) 0xFFFFF410) // (PIOA) Output Enable Register -#define AT91C_PIOA_BSR ((AT91_REG *) 0xFFFFF474) // (PIOA) Select B Register -#define AT91C_PIOA_PPUER ((AT91_REG *) 0xFFFFF464) // (PIOA) Pull-up Enable Register -#define AT91C_PIOA_MDDR ((AT91_REG *) 0xFFFFF454) // (PIOA) Multi-driver Disable Register -#define AT91C_PIOA_PDR ((AT91_REG *) 0xFFFFF404) // (PIOA) PIO Disable Register -#define AT91C_PIOA_ODR ((AT91_REG *) 0xFFFFF414) // (PIOA) Output Disable Registerr -#define AT91C_PIOA_IFDR ((AT91_REG *) 0xFFFFF424) // (PIOA) Input Filter Disable Register -#define AT91C_PIOA_ABSR ((AT91_REG *) 0xFFFFF478) // (PIOA) AB Select Status Register -#define AT91C_PIOA_ASR ((AT91_REG *) 0xFFFFF470) // (PIOA) Select A Register -#define AT91C_PIOA_PPUSR ((AT91_REG *) 0xFFFFF468) // (PIOA) Pad Pull-up Status Register -#define AT91C_PIOA_ODSR ((AT91_REG *) 0xFFFFF438) // (PIOA) Output Data Status Register -#define AT91C_PIOA_SODR ((AT91_REG *) 0xFFFFF430) // (PIOA) Set Output Data Register -#define AT91C_PIOA_IFSR ((AT91_REG *) 0xFFFFF428) // (PIOA) Input Filter Status Register -#define AT91C_PIOA_IFER ((AT91_REG *) 0xFFFFF420) // (PIOA) Input Filter Enable Register -#define AT91C_PIOA_OSR ((AT91_REG *) 0xFFFFF418) // (PIOA) Output Status Register -#define AT91C_PIOA_IDR ((AT91_REG *) 0xFFFFF444) // (PIOA) Interrupt Disable Register -#define AT91C_PIOA_PDSR ((AT91_REG *) 0xFFFFF43C) // (PIOA) Pin Data Status Register -#define AT91C_PIOA_CODR ((AT91_REG *) 0xFFFFF434) // (PIOA) Clear Output Data Register -#define AT91C_PIOA_OWSR ((AT91_REG *) 0xFFFFF4A8) // (PIOA) Output Write Status Register -#define AT91C_PIOA_OWER ((AT91_REG *) 0xFFFFF4A0) // (PIOA) Output Write Enable Register -// ========== Register definition for DBGU peripheral ========== -#define AT91C_DBGU_C2R ((AT91_REG *) 0xFFFFF244) // (DBGU) Chip ID2 Register -#define AT91C_DBGU_THR ((AT91_REG *) 0xFFFFF21C) // (DBGU) Transmitter Holding Register -#define AT91C_DBGU_CSR ((AT91_REG *) 0xFFFFF214) // (DBGU) Channel Status Register -#define AT91C_DBGU_IDR ((AT91_REG *) 0xFFFFF20C) // (DBGU) Interrupt Disable Register -#define AT91C_DBGU_MR ((AT91_REG *) 0xFFFFF204) // (DBGU) Mode Register -#define AT91C_DBGU_FNTR ((AT91_REG *) 0xFFFFF248) // (DBGU) Force NTRST Register -#define AT91C_DBGU_C1R ((AT91_REG *) 0xFFFFF240) // (DBGU) Chip ID1 Register -#define AT91C_DBGU_BRGR ((AT91_REG *) 0xFFFFF220) // (DBGU) Baud Rate Generator Register -#define AT91C_DBGU_RHR ((AT91_REG *) 0xFFFFF218) // (DBGU) Receiver Holding Register -#define AT91C_DBGU_IMR ((AT91_REG *) 0xFFFFF210) // (DBGU) Interrupt Mask Register -#define AT91C_DBGU_IER ((AT91_REG *) 0xFFFFF208) // (DBGU) Interrupt Enable Register -#define AT91C_DBGU_CR ((AT91_REG *) 0xFFFFF200) // (DBGU) Control Register -// ========== Register definition for PDC_DBGU peripheral ========== -#define AT91C_DBGU_TNCR ((AT91_REG *) 0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register -#define AT91C_DBGU_RNCR ((AT91_REG *) 0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register -#define AT91C_DBGU_PTCR ((AT91_REG *) 0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register -#define AT91C_DBGU_PTSR ((AT91_REG *) 0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register -#define AT91C_DBGU_RCR ((AT91_REG *) 0xFFFFF304) // (PDC_DBGU) Receive Counter Register -#define AT91C_DBGU_TCR ((AT91_REG *) 0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register -#define AT91C_DBGU_RPR ((AT91_REG *) 0xFFFFF300) // (PDC_DBGU) Receive Pointer Register -#define AT91C_DBGU_TPR ((AT91_REG *) 0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register -#define AT91C_DBGU_RNPR ((AT91_REG *) 0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register -#define AT91C_DBGU_TNPR ((AT91_REG *) 0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register -// ========== Register definition for AIC peripheral ========== -#define AT91C_AIC_ICCR ((AT91_REG *) 0xFFFFF128) // (AIC) Interrupt Clear Command Register -#define AT91C_AIC_IECR ((AT91_REG *) 0xFFFFF120) // (AIC) Interrupt Enable Command Register -#define AT91C_AIC_SMR ((AT91_REG *) 0xFFFFF000) // (AIC) Source Mode Register -#define AT91C_AIC_ISCR ((AT91_REG *) 0xFFFFF12C) // (AIC) Interrupt Set Command Register -#define AT91C_AIC_EOICR ((AT91_REG *) 0xFFFFF130) // (AIC) End of Interrupt Command Register -#define AT91C_AIC_DCR ((AT91_REG *) 0xFFFFF138) // (AIC) Debug Control Register (Protect) -#define AT91C_AIC_FFER ((AT91_REG *) 0xFFFFF140) // (AIC) Fast Forcing Enable Register -#define AT91C_AIC_SVR ((AT91_REG *) 0xFFFFF080) // (AIC) Source Vector Register -#define AT91C_AIC_SPU ((AT91_REG *) 0xFFFFF134) // (AIC) Spurious Vector Register -#define AT91C_AIC_FFDR ((AT91_REG *) 0xFFFFF144) // (AIC) Fast Forcing Disable Register -#define AT91C_AIC_FVR ((AT91_REG *) 0xFFFFF104) // (AIC) FIQ Vector Register -#define AT91C_AIC_FFSR ((AT91_REG *) 0xFFFFF148) // (AIC) Fast Forcing Status Register -#define AT91C_AIC_IMR ((AT91_REG *) 0xFFFFF110) // (AIC) Interrupt Mask Register -#define AT91C_AIC_ISR ((AT91_REG *) 0xFFFFF108) // (AIC) Interrupt Status Register -#define AT91C_AIC_IVR ((AT91_REG *) 0xFFFFF100) // (AIC) IRQ Vector Register -#define AT91C_AIC_IDCR ((AT91_REG *) 0xFFFFF124) // (AIC) Interrupt Disable Command Register -#define AT91C_AIC_CISR ((AT91_REG *) 0xFFFFF114) // (AIC) Core Interrupt Status Register -#define AT91C_AIC_IPR ((AT91_REG *) 0xFFFFF10C) // (AIC) Interrupt Pending Register -// ========== Register definition for PDC_SPI peripheral ========== -#define AT91C_SPI_PTCR ((AT91_REG *) 0xFFFE0120) // (PDC_SPI) PDC Transfer Control Register -#define AT91C_SPI_TNPR ((AT91_REG *) 0xFFFE0118) // (PDC_SPI) Transmit Next Pointer Register -#define AT91C_SPI_RNPR ((AT91_REG *) 0xFFFE0110) // (PDC_SPI) Receive Next Pointer Register -#define AT91C_SPI_TPR ((AT91_REG *) 0xFFFE0108) // (PDC_SPI) Transmit Pointer Register -#define AT91C_SPI_RPR ((AT91_REG *) 0xFFFE0100) // (PDC_SPI) Receive Pointer Register -#define AT91C_SPI_PTSR ((AT91_REG *) 0xFFFE0124) // (PDC_SPI) PDC Transfer Status Register -#define AT91C_SPI_TNCR ((AT91_REG *) 0xFFFE011C) // (PDC_SPI) Transmit Next Counter Register -#define AT91C_SPI_RNCR ((AT91_REG *) 0xFFFE0114) // (PDC_SPI) Receive Next Counter Register -#define AT91C_SPI_TCR ((AT91_REG *) 0xFFFE010C) // (PDC_SPI) Transmit Counter Register -#define AT91C_SPI_RCR ((AT91_REG *) 0xFFFE0104) // (PDC_SPI) Receive Counter Register -// ========== Register definition for SPI peripheral ========== -#define AT91C_SPI_CSR ((AT91_REG *) 0xFFFE0030) // (SPI) Chip Select Register -#define AT91C_SPI_IDR ((AT91_REG *) 0xFFFE0018) // (SPI) Interrupt Disable Register -#define AT91C_SPI_SR ((AT91_REG *) 0xFFFE0010) // (SPI) Status Register -#define AT91C_SPI_RDR ((AT91_REG *) 0xFFFE0008) // (SPI) Receive Data Register -#define AT91C_SPI_CR ((AT91_REG *) 0xFFFE0000) // (SPI) Control Register -#define AT91C_SPI_IMR ((AT91_REG *) 0xFFFE001C) // (SPI) Interrupt Mask Register -#define AT91C_SPI_IER ((AT91_REG *) 0xFFFE0014) // (SPI) Interrupt Enable Register -#define AT91C_SPI_TDR ((AT91_REG *) 0xFFFE000C) // (SPI) Transmit Data Register -#define AT91C_SPI_MR ((AT91_REG *) 0xFFFE0004) // (SPI) Mode Register -// ========== Register definition for PDC_SSC2 peripheral ========== -#define AT91C_SSC2_PTCR ((AT91_REG *) 0xFFFD8120) // (PDC_SSC2) PDC Transfer Control Register -#define AT91C_SSC2_TNPR ((AT91_REG *) 0xFFFD8118) // (PDC_SSC2) Transmit Next Pointer Register -#define AT91C_SSC2_RNPR ((AT91_REG *) 0xFFFD8110) // (PDC_SSC2) Receive Next Pointer Register -#define AT91C_SSC2_TPR ((AT91_REG *) 0xFFFD8108) // (PDC_SSC2) Transmit Pointer Register -#define AT91C_SSC2_RPR ((AT91_REG *) 0xFFFD8100) // (PDC_SSC2) Receive Pointer Register -#define AT91C_SSC2_PTSR ((AT91_REG *) 0xFFFD8124) // (PDC_SSC2) PDC Transfer Status Register -#define AT91C_SSC2_TNCR ((AT91_REG *) 0xFFFD811C) // (PDC_SSC2) Transmit Next Counter Register -#define AT91C_SSC2_RNCR ((AT91_REG *) 0xFFFD8114) // (PDC_SSC2) Receive Next Counter Register -#define AT91C_SSC2_TCR ((AT91_REG *) 0xFFFD810C) // (PDC_SSC2) Transmit Counter Register -#define AT91C_SSC2_RCR ((AT91_REG *) 0xFFFD8104) // (PDC_SSC2) Receive Counter Register -// ========== Register definition for SSC2 peripheral ========== -#define AT91C_SSC2_IMR ((AT91_REG *) 0xFFFD804C) // (SSC2) Interrupt Mask Register -#define AT91C_SSC2_IER ((AT91_REG *) 0xFFFD8044) // (SSC2) Interrupt Enable Register -#define AT91C_SSC2_RC1R ((AT91_REG *) 0xFFFD803C) // (SSC2) Receive Compare 1 Register -#define AT91C_SSC2_TSHR ((AT91_REG *) 0xFFFD8034) // (SSC2) Transmit Sync Holding Register -#define AT91C_SSC2_CMR ((AT91_REG *) 0xFFFD8004) // (SSC2) Clock Mode Register -#define AT91C_SSC2_IDR ((AT91_REG *) 0xFFFD8048) // (SSC2) Interrupt Disable Register -#define AT91C_SSC2_TCMR ((AT91_REG *) 0xFFFD8018) // (SSC2) Transmit Clock Mode Register -#define AT91C_SSC2_RCMR ((AT91_REG *) 0xFFFD8010) // (SSC2) Receive Clock ModeRegister -#define AT91C_SSC2_CR ((AT91_REG *) 0xFFFD8000) // (SSC2) Control Register -#define AT91C_SSC2_RFMR ((AT91_REG *) 0xFFFD8014) // (SSC2) Receive Frame Mode Register -#define AT91C_SSC2_TFMR ((AT91_REG *) 0xFFFD801C) // (SSC2) Transmit Frame Mode Register -#define AT91C_SSC2_THR ((AT91_REG *) 0xFFFD8024) // (SSC2) Transmit Holding Register -#define AT91C_SSC2_SR ((AT91_REG *) 0xFFFD8040) // (SSC2) Status Register -#define AT91C_SSC2_RC0R ((AT91_REG *) 0xFFFD8038) // (SSC2) Receive Compare 0 Register -#define AT91C_SSC2_RSHR ((AT91_REG *) 0xFFFD8030) // (SSC2) Receive Sync Holding Register -#define AT91C_SSC2_RHR ((AT91_REG *) 0xFFFD8020) // (SSC2) Receive Holding Register -// ========== Register definition for PDC_SSC1 peripheral ========== -#define AT91C_SSC1_PTCR ((AT91_REG *) 0xFFFD4120) // (PDC_SSC1) PDC Transfer Control Register -#define AT91C_SSC1_TNPR ((AT91_REG *) 0xFFFD4118) // (PDC_SSC1) Transmit Next Pointer Register -#define AT91C_SSC1_RNPR ((AT91_REG *) 0xFFFD4110) // (PDC_SSC1) Receive Next Pointer Register -#define AT91C_SSC1_TPR ((AT91_REG *) 0xFFFD4108) // (PDC_SSC1) Transmit Pointer Register -#define AT91C_SSC1_RPR ((AT91_REG *) 0xFFFD4100) // (PDC_SSC1) Receive Pointer Register -#define AT91C_SSC1_PTSR ((AT91_REG *) 0xFFFD4124) // (PDC_SSC1) PDC Transfer Status Register -#define AT91C_SSC1_TNCR ((AT91_REG *) 0xFFFD411C) // (PDC_SSC1) Transmit Next Counter Register -#define AT91C_SSC1_RNCR ((AT91_REG *) 0xFFFD4114) // (PDC_SSC1) Receive Next Counter Register -#define AT91C_SSC1_TCR ((AT91_REG *) 0xFFFD410C) // (PDC_SSC1) Transmit Counter Register -#define AT91C_SSC1_RCR ((AT91_REG *) 0xFFFD4104) // (PDC_SSC1) Receive Counter Register -// ========== Register definition for SSC1 peripheral ========== -#define AT91C_SSC1_RFMR ((AT91_REG *) 0xFFFD4014) // (SSC1) Receive Frame Mode Register -#define AT91C_SSC1_CMR ((AT91_REG *) 0xFFFD4004) // (SSC1) Clock Mode Register -#define AT91C_SSC1_IDR ((AT91_REG *) 0xFFFD4048) // (SSC1) Interrupt Disable Register -#define AT91C_SSC1_SR ((AT91_REG *) 0xFFFD4040) // (SSC1) Status Register -#define AT91C_SSC1_RC0R ((AT91_REG *) 0xFFFD4038) // (SSC1) Receive Compare 0 Register -#define AT91C_SSC1_RSHR ((AT91_REG *) 0xFFFD4030) // (SSC1) Receive Sync Holding Register -#define AT91C_SSC1_RHR ((AT91_REG *) 0xFFFD4020) // (SSC1) Receive Holding Register -#define AT91C_SSC1_TCMR ((AT91_REG *) 0xFFFD4018) // (SSC1) Transmit Clock Mode Register -#define AT91C_SSC1_RCMR ((AT91_REG *) 0xFFFD4010) // (SSC1) Receive Clock ModeRegister -#define AT91C_SSC1_CR ((AT91_REG *) 0xFFFD4000) // (SSC1) Control Register -#define AT91C_SSC1_IMR ((AT91_REG *) 0xFFFD404C) // (SSC1) Interrupt Mask Register -#define AT91C_SSC1_IER ((AT91_REG *) 0xFFFD4044) // (SSC1) Interrupt Enable Register -#define AT91C_SSC1_RC1R ((AT91_REG *) 0xFFFD403C) // (SSC1) Receive Compare 1 Register -#define AT91C_SSC1_TSHR ((AT91_REG *) 0xFFFD4034) // (SSC1) Transmit Sync Holding Register -#define AT91C_SSC1_THR ((AT91_REG *) 0xFFFD4024) // (SSC1) Transmit Holding Register -#define AT91C_SSC1_TFMR ((AT91_REG *) 0xFFFD401C) // (SSC1) Transmit Frame Mode Register -// ========== Register definition for PDC_SSC0 peripheral ========== -#define AT91C_SSC0_PTCR ((AT91_REG *) 0xFFFD0120) // (PDC_SSC0) PDC Transfer Control Register -#define AT91C_SSC0_TNPR ((AT91_REG *) 0xFFFD0118) // (PDC_SSC0) Transmit Next Pointer Register -#define AT91C_SSC0_RNPR ((AT91_REG *) 0xFFFD0110) // (PDC_SSC0) Receive Next Pointer Register -#define AT91C_SSC0_TPR ((AT91_REG *) 0xFFFD0108) // (PDC_SSC0) Transmit Pointer Register -#define AT91C_SSC0_RPR ((AT91_REG *) 0xFFFD0100) // (PDC_SSC0) Receive Pointer Register -#define AT91C_SSC0_PTSR ((AT91_REG *) 0xFFFD0124) // (PDC_SSC0) PDC Transfer Status Register -#define AT91C_SSC0_TNCR ((AT91_REG *) 0xFFFD011C) // (PDC_SSC0) Transmit Next Counter Register -#define AT91C_SSC0_RNCR ((AT91_REG *) 0xFFFD0114) // (PDC_SSC0) Receive Next Counter Register -#define AT91C_SSC0_TCR ((AT91_REG *) 0xFFFD010C) // (PDC_SSC0) Transmit Counter Register -#define AT91C_SSC0_RCR ((AT91_REG *) 0xFFFD0104) // (PDC_SSC0) Receive Counter Register -// ========== Register definition for SSC0 peripheral ========== -#define AT91C_SSC0_IMR ((AT91_REG *) 0xFFFD004C) // (SSC0) Interrupt Mask Register -#define AT91C_SSC0_IER ((AT91_REG *) 0xFFFD0044) // (SSC0) Interrupt Enable Register -#define AT91C_SSC0_RC1R ((AT91_REG *) 0xFFFD003C) // (SSC0) Receive Compare 1 Register -#define AT91C_SSC0_TSHR ((AT91_REG *) 0xFFFD0034) // (SSC0) Transmit Sync Holding Register -#define AT91C_SSC0_THR ((AT91_REG *) 0xFFFD0024) // (SSC0) Transmit Holding Register -#define AT91C_SSC0_TFMR ((AT91_REG *) 0xFFFD001C) // (SSC0) Transmit Frame Mode Register -#define AT91C_SSC0_RFMR ((AT91_REG *) 0xFFFD0014) // (SSC0) Receive Frame Mode Register -#define AT91C_SSC0_CMR ((AT91_REG *) 0xFFFD0004) // (SSC0) Clock Mode Register -#define AT91C_SSC0_IDR ((AT91_REG *) 0xFFFD0048) // (SSC0) Interrupt Disable Register -#define AT91C_SSC0_SR ((AT91_REG *) 0xFFFD0040) // (SSC0) Status Register -#define AT91C_SSC0_RC0R ((AT91_REG *) 0xFFFD0038) // (SSC0) Receive Compare 0 Register -#define AT91C_SSC0_RSHR ((AT91_REG *) 0xFFFD0030) // (SSC0) Receive Sync Holding Register -#define AT91C_SSC0_RHR ((AT91_REG *) 0xFFFD0020) // (SSC0) Receive Holding Register -#define AT91C_SSC0_TCMR ((AT91_REG *) 0xFFFD0018) // (SSC0) Transmit Clock Mode Register -#define AT91C_SSC0_RCMR ((AT91_REG *) 0xFFFD0010) // (SSC0) Receive Clock ModeRegister -#define AT91C_SSC0_CR ((AT91_REG *) 0xFFFD0000) // (SSC0) Control Register -// ========== Register definition for PDC_US3 peripheral ========== -#define AT91C_US3_PTSR ((AT91_REG *) 0xFFFCC124) // (PDC_US3) PDC Transfer Status Register -#define AT91C_US3_TNCR ((AT91_REG *) 0xFFFCC11C) // (PDC_US3) Transmit Next Counter Register -#define AT91C_US3_RNCR ((AT91_REG *) 0xFFFCC114) // (PDC_US3) Receive Next Counter Register -#define AT91C_US3_TCR ((AT91_REG *) 0xFFFCC10C) // (PDC_US3) Transmit Counter Register -#define AT91C_US3_RCR ((AT91_REG *) 0xFFFCC104) // (PDC_US3) Receive Counter Register -#define AT91C_US3_PTCR ((AT91_REG *) 0xFFFCC120) // (PDC_US3) PDC Transfer Control Register -#define AT91C_US3_TNPR ((AT91_REG *) 0xFFFCC118) // (PDC_US3) Transmit Next Pointer Register -#define AT91C_US3_RNPR ((AT91_REG *) 0xFFFCC110) // (PDC_US3) Receive Next Pointer Register -#define AT91C_US3_TPR ((AT91_REG *) 0xFFFCC108) // (PDC_US3) Transmit Pointer Register -#define AT91C_US3_RPR ((AT91_REG *) 0xFFFCC100) // (PDC_US3) Receive Pointer Register -// ========== Register definition for US3 peripheral ========== -#define AT91C_US3_IF ((AT91_REG *) 0xFFFCC04C) // (US3) IRDA_FILTER Register -#define AT91C_US3_NER ((AT91_REG *) 0xFFFCC044) // (US3) Nb Errors Register -#define AT91C_US3_RTOR ((AT91_REG *) 0xFFFCC024) // (US3) Receiver Time-out Register -#define AT91C_US3_THR ((AT91_REG *) 0xFFFCC01C) // (US3) Transmitter Holding Register -#define AT91C_US3_CSR ((AT91_REG *) 0xFFFCC014) // (US3) Channel Status Register -#define AT91C_US3_IDR ((AT91_REG *) 0xFFFCC00C) // (US3) Interrupt Disable Register -#define AT91C_US3_MR ((AT91_REG *) 0xFFFCC004) // (US3) Mode Register -#define AT91C_US3_XXR ((AT91_REG *) 0xFFFCC048) // (US3) XON_XOFF Register -#define AT91C_US3_FIDI ((AT91_REG *) 0xFFFCC040) // (US3) FI_DI_Ratio Register -#define AT91C_US3_TTGR ((AT91_REG *) 0xFFFCC028) // (US3) Transmitter Time-guard Register -#define AT91C_US3_BRGR ((AT91_REG *) 0xFFFCC020) // (US3) Baud Rate Generator Register -#define AT91C_US3_RHR ((AT91_REG *) 0xFFFCC018) // (US3) Receiver Holding Register -#define AT91C_US3_IMR ((AT91_REG *) 0xFFFCC010) // (US3) Interrupt Mask Register -#define AT91C_US3_IER ((AT91_REG *) 0xFFFCC008) // (US3) Interrupt Enable Register -#define AT91C_US3_CR ((AT91_REG *) 0xFFFCC000) // (US3) Control Register -// ========== Register definition for PDC_US2 peripheral ========== -#define AT91C_US2_PTSR ((AT91_REG *) 0xFFFC8124) // (PDC_US2) PDC Transfer Status Register -#define AT91C_US2_TNCR ((AT91_REG *) 0xFFFC811C) // (PDC_US2) Transmit Next Counter Register -#define AT91C_US2_RNCR ((AT91_REG *) 0xFFFC8114) // (PDC_US2) Receive Next Counter Register -#define AT91C_US2_TCR ((AT91_REG *) 0xFFFC810C) // (PDC_US2) Transmit Counter Register -#define AT91C_US2_PTCR ((AT91_REG *) 0xFFFC8120) // (PDC_US2) PDC Transfer Control Register -#define AT91C_US2_RCR ((AT91_REG *) 0xFFFC8104) // (PDC_US2) Receive Counter Register -#define AT91C_US2_TNPR ((AT91_REG *) 0xFFFC8118) // (PDC_US2) Transmit Next Pointer Register -#define AT91C_US2_RPR ((AT91_REG *) 0xFFFC8100) // (PDC_US2) Receive Pointer Register -#define AT91C_US2_TPR ((AT91_REG *) 0xFFFC8108) // (PDC_US2) Transmit Pointer Register -#define AT91C_US2_RNPR ((AT91_REG *) 0xFFFC8110) // (PDC_US2) Receive Next Pointer Register -// ========== Register definition for US2 peripheral ========== -#define AT91C_US2_XXR ((AT91_REG *) 0xFFFC8048) // (US2) XON_XOFF Register -#define AT91C_US2_FIDI ((AT91_REG *) 0xFFFC8040) // (US2) FI_DI_Ratio Register -#define AT91C_US2_TTGR ((AT91_REG *) 0xFFFC8028) // (US2) Transmitter Time-guard Register -#define AT91C_US2_BRGR ((AT91_REG *) 0xFFFC8020) // (US2) Baud Rate Generator Register -#define AT91C_US2_RHR ((AT91_REG *) 0xFFFC8018) // (US2) Receiver Holding Register -#define AT91C_US2_IMR ((AT91_REG *) 0xFFFC8010) // (US2) Interrupt Mask Register -#define AT91C_US2_IER ((AT91_REG *) 0xFFFC8008) // (US2) Interrupt Enable Register -#define AT91C_US2_CR ((AT91_REG *) 0xFFFC8000) // (US2) Control Register -#define AT91C_US2_IF ((AT91_REG *) 0xFFFC804C) // (US2) IRDA_FILTER Register -#define AT91C_US2_NER ((AT91_REG *) 0xFFFC8044) // (US2) Nb Errors Register -#define AT91C_US2_RTOR ((AT91_REG *) 0xFFFC8024) // (US2) Receiver Time-out Register -#define AT91C_US2_THR ((AT91_REG *) 0xFFFC801C) // (US2) Transmitter Holding Register -#define AT91C_US2_CSR ((AT91_REG *) 0xFFFC8014) // (US2) Channel Status Register -#define AT91C_US2_IDR ((AT91_REG *) 0xFFFC800C) // (US2) Interrupt Disable Register -#define AT91C_US2_MR ((AT91_REG *) 0xFFFC8004) // (US2) Mode Register -// ========== Register definition for PDC_US1 peripheral ========== -#define AT91C_US1_PTSR ((AT91_REG *) 0xFFFC4124) // (PDC_US1) PDC Transfer Status Register -#define AT91C_US1_TNCR ((AT91_REG *) 0xFFFC411C) // (PDC_US1) Transmit Next Counter Register -#define AT91C_US1_RNCR ((AT91_REG *) 0xFFFC4114) // (PDC_US1) Receive Next Counter Register -#define AT91C_US1_TCR ((AT91_REG *) 0xFFFC410C) // (PDC_US1) Transmit Counter Register -#define AT91C_US1_RCR ((AT91_REG *) 0xFFFC4104) // (PDC_US1) Receive Counter Register -#define AT91C_US1_PTCR ((AT91_REG *) 0xFFFC4120) // (PDC_US1) PDC Transfer Control Register -#define AT91C_US1_TNPR ((AT91_REG *) 0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register -#define AT91C_US1_RNPR ((AT91_REG *) 0xFFFC4110) // (PDC_US1) Receive Next Pointer Register -#define AT91C_US1_TPR ((AT91_REG *) 0xFFFC4108) // (PDC_US1) Transmit Pointer Register -#define AT91C_US1_RPR ((AT91_REG *) 0xFFFC4100) // (PDC_US1) Receive Pointer Register -// ========== Register definition for US1 peripheral ========== -#define AT91C_US1_XXR ((AT91_REG *) 0xFFFC4048) // (US1) XON_XOFF Register -#define AT91C_US1_RHR ((AT91_REG *) 0xFFFC4018) // (US1) Receiver Holding Register -#define AT91C_US1_IMR ((AT91_REG *) 0xFFFC4010) // (US1) Interrupt Mask Register -#define AT91C_US1_IER ((AT91_REG *) 0xFFFC4008) // (US1) Interrupt Enable Register -#define AT91C_US1_CR ((AT91_REG *) 0xFFFC4000) // (US1) Control Register -#define AT91C_US1_RTOR ((AT91_REG *) 0xFFFC4024) // (US1) Receiver Time-out Register -#define AT91C_US1_THR ((AT91_REG *) 0xFFFC401C) // (US1) Transmitter Holding Register -#define AT91C_US1_CSR ((AT91_REG *) 0xFFFC4014) // (US1) Channel Status Register -#define AT91C_US1_IDR ((AT91_REG *) 0xFFFC400C) // (US1) Interrupt Disable Register -#define AT91C_US1_FIDI ((AT91_REG *) 0xFFFC4040) // (US1) FI_DI_Ratio Register -#define AT91C_US1_BRGR ((AT91_REG *) 0xFFFC4020) // (US1) Baud Rate Generator Register -#define AT91C_US1_TTGR ((AT91_REG *) 0xFFFC4028) // (US1) Transmitter Time-guard Register -#define AT91C_US1_IF ((AT91_REG *) 0xFFFC404C) // (US1) IRDA_FILTER Register -#define AT91C_US1_NER ((AT91_REG *) 0xFFFC4044) // (US1) Nb Errors Register -#define AT91C_US1_MR ((AT91_REG *) 0xFFFC4004) // (US1) Mode Register -// ========== Register definition for PDC_US0 peripheral ========== -#define AT91C_US0_PTCR ((AT91_REG *) 0xFFFC0120) // (PDC_US0) PDC Transfer Control Register -#define AT91C_US0_TNPR ((AT91_REG *) 0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register -#define AT91C_US0_RNPR ((AT91_REG *) 0xFFFC0110) // (PDC_US0) Receive Next Pointer Register -#define AT91C_US0_TPR ((AT91_REG *) 0xFFFC0108) // (PDC_US0) Transmit Pointer Register -#define AT91C_US0_RPR ((AT91_REG *) 0xFFFC0100) // (PDC_US0) Receive Pointer Register -#define AT91C_US0_PTSR ((AT91_REG *) 0xFFFC0124) // (PDC_US0) PDC Transfer Status Register -#define AT91C_US0_TNCR ((AT91_REG *) 0xFFFC011C) // (PDC_US0) Transmit Next Counter Register -#define AT91C_US0_RNCR ((AT91_REG *) 0xFFFC0114) // (PDC_US0) Receive Next Counter Register -#define AT91C_US0_TCR ((AT91_REG *) 0xFFFC010C) // (PDC_US0) Transmit Counter Register -#define AT91C_US0_RCR ((AT91_REG *) 0xFFFC0104) // (PDC_US0) Receive Counter Register -// ========== Register definition for US0 peripheral ========== -#define AT91C_US0_TTGR ((AT91_REG *) 0xFFFC0028) // (US0) Transmitter Time-guard Register -#define AT91C_US0_BRGR ((AT91_REG *) 0xFFFC0020) // (US0) Baud Rate Generator Register -#define AT91C_US0_RHR ((AT91_REG *) 0xFFFC0018) // (US0) Receiver Holding Register -#define AT91C_US0_IMR ((AT91_REG *) 0xFFFC0010) // (US0) Interrupt Mask Register -#define AT91C_US0_NER ((AT91_REG *) 0xFFFC0044) // (US0) Nb Errors Register -#define AT91C_US0_RTOR ((AT91_REG *) 0xFFFC0024) // (US0) Receiver Time-out Register -#define AT91C_US0_XXR ((AT91_REG *) 0xFFFC0048) // (US0) XON_XOFF Register -#define AT91C_US0_FIDI ((AT91_REG *) 0xFFFC0040) // (US0) FI_DI_Ratio Register -#define AT91C_US0_CR ((AT91_REG *) 0xFFFC0000) // (US0) Control Register -#define AT91C_US0_IER ((AT91_REG *) 0xFFFC0008) // (US0) Interrupt Enable Register -#define AT91C_US0_IF ((AT91_REG *) 0xFFFC004C) // (US0) IRDA_FILTER Register -#define AT91C_US0_MR ((AT91_REG *) 0xFFFC0004) // (US0) Mode Register -#define AT91C_US0_IDR ((AT91_REG *) 0xFFFC000C) // (US0) Interrupt Disable Register -#define AT91C_US0_CSR ((AT91_REG *) 0xFFFC0014) // (US0) Channel Status Register -#define AT91C_US0_THR ((AT91_REG *) 0xFFFC001C) // (US0) Transmitter Holding Register -// ========== Register definition for TWI peripheral ========== -#define AT91C_TWI_RHR ((AT91_REG *) 0xFFFB8030) // (TWI) Receive Holding Register -#define AT91C_TWI_IDR ((AT91_REG *) 0xFFFB8028) // (TWI) Interrupt Disable Register -#define AT91C_TWI_SR ((AT91_REG *) 0xFFFB8020) // (TWI) Status Register -#define AT91C_TWI_CWGR ((AT91_REG *) 0xFFFB8010) // (TWI) Clock Waveform Generator Register -#define AT91C_TWI_SMR ((AT91_REG *) 0xFFFB8008) // (TWI) Slave Mode Register -#define AT91C_TWI_CR ((AT91_REG *) 0xFFFB8000) // (TWI) Control Register -#define AT91C_TWI_THR ((AT91_REG *) 0xFFFB8034) // (TWI) Transmit Holding Register -#define AT91C_TWI_IMR ((AT91_REG *) 0xFFFB802C) // (TWI) Interrupt Mask Register -#define AT91C_TWI_IER ((AT91_REG *) 0xFFFB8024) // (TWI) Interrupt Enable Register -#define AT91C_TWI_IADR ((AT91_REG *) 0xFFFB800C) // (TWI) Internal Address Register -#define AT91C_TWI_MMR ((AT91_REG *) 0xFFFB8004) // (TWI) Master Mode Register -// ========== Register definition for PDC_MCI peripheral ========== -#define AT91C_MCI_PTCR ((AT91_REG *) 0xFFFB4120) // (PDC_MCI) PDC Transfer Control Register -#define AT91C_MCI_TNPR ((AT91_REG *) 0xFFFB4118) // (PDC_MCI) Transmit Next Pointer Register -#define AT91C_MCI_RNPR ((AT91_REG *) 0xFFFB4110) // (PDC_MCI) Receive Next Pointer Register -#define AT91C_MCI_TPR ((AT91_REG *) 0xFFFB4108) // (PDC_MCI) Transmit Pointer Register -#define AT91C_MCI_RPR ((AT91_REG *) 0xFFFB4100) // (PDC_MCI) Receive Pointer Register -#define AT91C_MCI_PTSR ((AT91_REG *) 0xFFFB4124) // (PDC_MCI) PDC Transfer Status Register -#define AT91C_MCI_TNCR ((AT91_REG *) 0xFFFB411C) // (PDC_MCI) Transmit Next Counter Register -#define AT91C_MCI_RNCR ((AT91_REG *) 0xFFFB4114) // (PDC_MCI) Receive Next Counter Register -#define AT91C_MCI_TCR ((AT91_REG *) 0xFFFB410C) // (PDC_MCI) Transmit Counter Register -#define AT91C_MCI_RCR ((AT91_REG *) 0xFFFB4104) // (PDC_MCI) Receive Counter Register -// ========== Register definition for MCI peripheral ========== -#define AT91C_MCI_IDR ((AT91_REG *) 0xFFFB4048) // (MCI) MCI Interrupt Disable Register -#define AT91C_MCI_SR ((AT91_REG *) 0xFFFB4040) // (MCI) MCI Status Register -#define AT91C_MCI_RDR ((AT91_REG *) 0xFFFB4030) // (MCI) MCI Receive Data Register -#define AT91C_MCI_RSPR ((AT91_REG *) 0xFFFB4020) // (MCI) MCI Response Register -#define AT91C_MCI_ARGR ((AT91_REG *) 0xFFFB4010) // (MCI) MCI Argument Register -#define AT91C_MCI_DTOR ((AT91_REG *) 0xFFFB4008) // (MCI) MCI Data Timeout Register -#define AT91C_MCI_CR ((AT91_REG *) 0xFFFB4000) // (MCI) MCI Control Register -#define AT91C_MCI_IMR ((AT91_REG *) 0xFFFB404C) // (MCI) MCI Interrupt Mask Register -#define AT91C_MCI_IER ((AT91_REG *) 0xFFFB4044) // (MCI) MCI Interrupt Enable Register -#define AT91C_MCI_TDR ((AT91_REG *) 0xFFFB4034) // (MCI) MCI Transmit Data Register -#define AT91C_MCI_CMDR ((AT91_REG *) 0xFFFB4014) // (MCI) MCI Command Register -#define AT91C_MCI_SDCR ((AT91_REG *) 0xFFFB400C) // (MCI) MCI SD Card Register -#define AT91C_MCI_MR ((AT91_REG *) 0xFFFB4004) // (MCI) MCI Mode Register -// ========== Register definition for UDP peripheral ========== -#define AT91C_UDP_ISR ((AT91_REG *) 0xFFFB001C) // (UDP) Interrupt Status Register -#define AT91C_UDP_IDR ((AT91_REG *) 0xFFFB0014) // (UDP) Interrupt Disable Register -#define AT91C_UDP_GLBSTATE ((AT91_REG *) 0xFFFB0004) // (UDP) Global State Register -#define AT91C_UDP_FDR ((AT91_REG *) 0xFFFB0050) // (UDP) Endpoint FIFO Data Register -#define AT91C_UDP_CSR ((AT91_REG *) 0xFFFB0030) // (UDP) Endpoint Control and Status Register -#define AT91C_UDP_RSTEP ((AT91_REG *) 0xFFFB0028) // (UDP) Reset Endpoint Register -#define AT91C_UDP_ICR ((AT91_REG *) 0xFFFB0020) // (UDP) Interrupt Clear Register -#define AT91C_UDP_IMR ((AT91_REG *) 0xFFFB0018) // (UDP) Interrupt Mask Register -#define AT91C_UDP_IER ((AT91_REG *) 0xFFFB0010) // (UDP) Interrupt Enable Register -#define AT91C_UDP_FADDR ((AT91_REG *) 0xFFFB0008) // (UDP) Function Address Register -#define AT91C_UDP_NUM ((AT91_REG *) 0xFFFB0000) // (UDP) Frame Number Register -// ========== Register definition for TC5 peripheral ========== -#define AT91C_TC5_CMR ((AT91_REG *) 0xFFFA4084) // (TC5) Channel Mode Register -#define AT91C_TC5_IDR ((AT91_REG *) 0xFFFA40A8) // (TC5) Interrupt Disable Register -#define AT91C_TC5_SR ((AT91_REG *) 0xFFFA40A0) // (TC5) Status Register -#define AT91C_TC5_RB ((AT91_REG *) 0xFFFA4098) // (TC5) Register B -#define AT91C_TC5_CV ((AT91_REG *) 0xFFFA4090) // (TC5) Counter Value -#define AT91C_TC5_CCR ((AT91_REG *) 0xFFFA4080) // (TC5) Channel Control Register -#define AT91C_TC5_IMR ((AT91_REG *) 0xFFFA40AC) // (TC5) Interrupt Mask Register -#define AT91C_TC5_IER ((AT91_REG *) 0xFFFA40A4) // (TC5) Interrupt Enable Register -#define AT91C_TC5_RC ((AT91_REG *) 0xFFFA409C) // (TC5) Register C -#define AT91C_TC5_RA ((AT91_REG *) 0xFFFA4094) // (TC5) Register A -// ========== Register definition for TC4 peripheral ========== -#define AT91C_TC4_IMR ((AT91_REG *) 0xFFFA406C) // (TC4) Interrupt Mask Register -#define AT91C_TC4_IER ((AT91_REG *) 0xFFFA4064) // (TC4) Interrupt Enable Register -#define AT91C_TC4_RC ((AT91_REG *) 0xFFFA405C) // (TC4) Register C -#define AT91C_TC4_RA ((AT91_REG *) 0xFFFA4054) // (TC4) Register A -#define AT91C_TC4_CMR ((AT91_REG *) 0xFFFA4044) // (TC4) Channel Mode Register -#define AT91C_TC4_IDR ((AT91_REG *) 0xFFFA4068) // (TC4) Interrupt Disable Register -#define AT91C_TC4_SR ((AT91_REG *) 0xFFFA4060) // (TC4) Status Register -#define AT91C_TC4_RB ((AT91_REG *) 0xFFFA4058) // (TC4) Register B -#define AT91C_TC4_CV ((AT91_REG *) 0xFFFA4050) // (TC4) Counter Value -#define AT91C_TC4_CCR ((AT91_REG *) 0xFFFA4040) // (TC4) Channel Control Register -// ========== Register definition for TC3 peripheral ========== -#define AT91C_TC3_IMR ((AT91_REG *) 0xFFFA402C) // (TC3) Interrupt Mask Register -#define AT91C_TC3_CV ((AT91_REG *) 0xFFFA4010) // (TC3) Counter Value -#define AT91C_TC3_CCR ((AT91_REG *) 0xFFFA4000) // (TC3) Channel Control Register -#define AT91C_TC3_IER ((AT91_REG *) 0xFFFA4024) // (TC3) Interrupt Enable Register -#define AT91C_TC3_CMR ((AT91_REG *) 0xFFFA4004) // (TC3) Channel Mode Register -#define AT91C_TC3_RA ((AT91_REG *) 0xFFFA4014) // (TC3) Register A -#define AT91C_TC3_RC ((AT91_REG *) 0xFFFA401C) // (TC3) Register C -#define AT91C_TC3_IDR ((AT91_REG *) 0xFFFA4028) // (TC3) Interrupt Disable Register -#define AT91C_TC3_RB ((AT91_REG *) 0xFFFA4018) // (TC3) Register B -#define AT91C_TC3_SR ((AT91_REG *) 0xFFFA4020) // (TC3) Status Register -// ========== Register definition for TCB1 peripheral ========== -#define AT91C_TCB1_BCR ((AT91_REG *) 0xFFFA4140) // (TCB1) TC Block Control Register -#define AT91C_TCB1_BMR ((AT91_REG *) 0xFFFA4144) // (TCB1) TC Block Mode Register -// ========== Register definition for TC2 peripheral ========== -#define AT91C_TC2_IMR ((AT91_REG *) 0xFFFA00AC) // (TC2) Interrupt Mask Register -#define AT91C_TC2_IER ((AT91_REG *) 0xFFFA00A4) // (TC2) Interrupt Enable Register -#define AT91C_TC2_RC ((AT91_REG *) 0xFFFA009C) // (TC2) Register C -#define AT91C_TC2_RA ((AT91_REG *) 0xFFFA0094) // (TC2) Register A -#define AT91C_TC2_CMR ((AT91_REG *) 0xFFFA0084) // (TC2) Channel Mode Register -#define AT91C_TC2_IDR ((AT91_REG *) 0xFFFA00A8) // (TC2) Interrupt Disable Register -#define AT91C_TC2_SR ((AT91_REG *) 0xFFFA00A0) // (TC2) Status Register -#define AT91C_TC2_RB ((AT91_REG *) 0xFFFA0098) // (TC2) Register B -#define AT91C_TC2_CV ((AT91_REG *) 0xFFFA0090) // (TC2) Counter Value -#define AT91C_TC2_CCR ((AT91_REG *) 0xFFFA0080) // (TC2) Channel Control Register -// ========== Register definition for TC1 peripheral ========== -#define AT91C_TC1_IMR ((AT91_REG *) 0xFFFA006C) // (TC1) Interrupt Mask Register -#define AT91C_TC1_IER ((AT91_REG *) 0xFFFA0064) // (TC1) Interrupt Enable Register -#define AT91C_TC1_RC ((AT91_REG *) 0xFFFA005C) // (TC1) Register C -#define AT91C_TC1_RA ((AT91_REG *) 0xFFFA0054) // (TC1) Register A -#define AT91C_TC1_CMR ((AT91_REG *) 0xFFFA0044) // (TC1) Channel Mode Register -#define AT91C_TC1_IDR ((AT91_REG *) 0xFFFA0068) // (TC1) Interrupt Disable Register -#define AT91C_TC1_SR ((AT91_REG *) 0xFFFA0060) // (TC1) Status Register -#define AT91C_TC1_RB ((AT91_REG *) 0xFFFA0058) // (TC1) Register B -#define AT91C_TC1_CV ((AT91_REG *) 0xFFFA0050) // (TC1) Counter Value -#define AT91C_TC1_CCR ((AT91_REG *) 0xFFFA0040) // (TC1) Channel Control Register -// ========== Register definition for TC0 peripheral ========== -#define AT91C_TC0_IMR ((AT91_REG *) 0xFFFA002C) // (TC0) Interrupt Mask Register -#define AT91C_TC0_IER ((AT91_REG *) 0xFFFA0024) // (TC0) Interrupt Enable Register -#define AT91C_TC0_RC ((AT91_REG *) 0xFFFA001C) // (TC0) Register C -#define AT91C_TC0_RA ((AT91_REG *) 0xFFFA0014) // (TC0) Register A -#define AT91C_TC0_CMR ((AT91_REG *) 0xFFFA0004) // (TC0) Channel Mode Register -#define AT91C_TC0_IDR ((AT91_REG *) 0xFFFA0028) // (TC0) Interrupt Disable Register -#define AT91C_TC0_SR ((AT91_REG *) 0xFFFA0020) // (TC0) Status Register -#define AT91C_TC0_RB ((AT91_REG *) 0xFFFA0018) // (TC0) Register B -#define AT91C_TC0_CV ((AT91_REG *) 0xFFFA0010) // (TC0) Counter Value -#define AT91C_TC0_CCR ((AT91_REG *) 0xFFFA0000) // (TC0) Channel Control Register -// ========== Register definition for TCB0 peripheral ========== -#define AT91C_TCB0_BMR ((AT91_REG *) 0xFFFA00C4) // (TCB0) TC Block Mode Register -#define AT91C_TCB0_BCR ((AT91_REG *) 0xFFFA00C0) // (TCB0) TC Block Control Register -// ========== Register definition for UHP peripheral ========== -#define AT91C_UHP_HcRhDescriptorA ((AT91_REG *) 0x00300048) // (UHP) Root Hub characteristics A -#define AT91C_UHP_HcRhPortStatus ((AT91_REG *) 0x00300054) // (UHP) Root Hub Port Status Register -#define AT91C_UHP_HcRhDescriptorB ((AT91_REG *) 0x0030004C) // (UHP) Root Hub characteristics B -#define AT91C_UHP_HcControl ((AT91_REG *) 0x00300004) // (UHP) Operating modes for the Host Controller -#define AT91C_UHP_HcInterruptStatus ((AT91_REG *) 0x0030000C) // (UHP) Interrupt Status Register -#define AT91C_UHP_HcRhStatus ((AT91_REG *) 0x00300050) // (UHP) Root Hub Status register -#define AT91C_UHP_HcRevision ((AT91_REG *) 0x00300000) // (UHP) Revision -#define AT91C_UHP_HcCommandStatus ((AT91_REG *) 0x00300008) // (UHP) Command & status Register -#define AT91C_UHP_HcInterruptEnable ((AT91_REG *) 0x00300010) // (UHP) Interrupt Enable Register -#define AT91C_UHP_HcHCCA ((AT91_REG *) 0x00300018) // (UHP) Pointer to the Host Controller Communication Area -#define AT91C_UHP_HcControlHeadED ((AT91_REG *) 0x00300020) // (UHP) First Endpoint Descriptor of the Control list -#define AT91C_UHP_HcInterruptDisable ((AT91_REG *) 0x00300014) // (UHP) Interrupt Disable Register -#define AT91C_UHP_HcPeriodCurrentED ((AT91_REG *) 0x0030001C) // (UHP) Current Isochronous or Interrupt Endpoint Descriptor -#define AT91C_UHP_HcControlCurrentED ((AT91_REG *) 0x00300024) // (UHP) Endpoint Control and Status Register -#define AT91C_UHP_HcBulkCurrentED ((AT91_REG *) 0x0030002C) // (UHP) Current endpoint of the Bulk list -#define AT91C_UHP_HcFmInterval ((AT91_REG *) 0x00300034) // (UHP) Bit time between 2 consecutive SOFs -#define AT91C_UHP_HcBulkHeadED ((AT91_REG *) 0x00300028) // (UHP) First endpoint register of the Bulk list -#define AT91C_UHP_HcBulkDoneHead ((AT91_REG *) 0x00300030) // (UHP) Last completed transfer descriptor -#define AT91C_UHP_HcFmRemaining ((AT91_REG *) 0x00300038) // (UHP) Bit time remaining in the current Frame -#define AT91C_UHP_HcPeriodicStart ((AT91_REG *) 0x00300040) // (UHP) Periodic Start -#define AT91C_UHP_HcLSThreshold ((AT91_REG *) 0x00300044) // (UHP) LS Threshold -#define AT91C_UHP_HcFmNumber ((AT91_REG *) 0x0030003C) // (UHP) Frame number -// ========== Register definition for EMAC peripheral ========== -#define AT91C_EMAC_RSR ((AT91_REG *) 0xFFFBC020) // (EMAC) Receive Status Register -#define AT91C_EMAC_MAN ((AT91_REG *) 0xFFFBC034) // (EMAC) PHY Maintenance Register -#define AT91C_EMAC_HSH ((AT91_REG *) 0xFFFBC090) // (EMAC) Hash Address High[63:32] -#define AT91C_EMAC_MCOL ((AT91_REG *) 0xFFFBC048) // (EMAC) Multiple Collision Frame Register -#define AT91C_EMAC_IER ((AT91_REG *) 0xFFFBC028) // (EMAC) Interrupt Enable Register -#define AT91C_EMAC_SA2H ((AT91_REG *) 0xFFFBC0A4) // (EMAC) Specific Address 2 High, Last 2 bytes -#define AT91C_EMAC_HSL ((AT91_REG *) 0xFFFBC094) // (EMAC) Hash Address Low[31:0] -#define AT91C_EMAC_LCOL ((AT91_REG *) 0xFFFBC05C) // (EMAC) Late Collision Register -#define AT91C_EMAC_OK ((AT91_REG *) 0xFFFBC04C) // (EMAC) Frames Received OK Register -#define AT91C_EMAC_CFG ((AT91_REG *) 0xFFFBC004) // (EMAC) Network Configuration Register -#define AT91C_EMAC_SA3L ((AT91_REG *) 0xFFFBC0A8) // (EMAC) Specific Address 3 Low, First 4 bytes -#define AT91C_EMAC_SEQE ((AT91_REG *) 0xFFFBC050) // (EMAC) Frame Check Sequence Error Register -#define AT91C_EMAC_ECOL ((AT91_REG *) 0xFFFBC060) // (EMAC) Excessive Collision Register -#define AT91C_EMAC_ELR ((AT91_REG *) 0xFFFBC070) // (EMAC) Excessive Length Error Register -#define AT91C_EMAC_SR ((AT91_REG *) 0xFFFBC008) // (EMAC) Network Status Register -#define AT91C_EMAC_RBQP ((AT91_REG *) 0xFFFBC018) // (EMAC) Receive Buffer Queue Pointer -#define AT91C_EMAC_CSE ((AT91_REG *) 0xFFFBC064) // (EMAC) Carrier Sense Error Register -#define AT91C_EMAC_RJB ((AT91_REG *) 0xFFFBC074) // (EMAC) Receive Jabber Register -#define AT91C_EMAC_USF ((AT91_REG *) 0xFFFBC078) // (EMAC) Undersize Frame Register -#define AT91C_EMAC_IDR ((AT91_REG *) 0xFFFBC02C) // (EMAC) Interrupt Disable Register -#define AT91C_EMAC_SA1L ((AT91_REG *) 0xFFFBC098) // (EMAC) Specific Address 1 Low, First 4 bytes -#define AT91C_EMAC_IMR ((AT91_REG *) 0xFFFBC030) // (EMAC) Interrupt Mask Register -#define AT91C_EMAC_FRA ((AT91_REG *) 0xFFFBC040) // (EMAC) Frames Transmitted OK Register -#define AT91C_EMAC_SA3H ((AT91_REG *) 0xFFFBC0AC) // (EMAC) Specific Address 3 High, Last 2 bytes -#define AT91C_EMAC_SA1H ((AT91_REG *) 0xFFFBC09C) // (EMAC) Specific Address 1 High, Last 2 bytes -#define AT91C_EMAC_SCOL ((AT91_REG *) 0xFFFBC044) // (EMAC) Single Collision Frame Register -#define AT91C_EMAC_ALE ((AT91_REG *) 0xFFFBC054) // (EMAC) Alignment Error Register -#define AT91C_EMAC_TAR ((AT91_REG *) 0xFFFBC00C) // (EMAC) Transmit Address Register -#define AT91C_EMAC_SA4L ((AT91_REG *) 0xFFFBC0B0) // (EMAC) Specific Address 4 Low, First 4 bytes -#define AT91C_EMAC_SA2L ((AT91_REG *) 0xFFFBC0A0) // (EMAC) Specific Address 2 Low, First 4 bytes -#define AT91C_EMAC_TUE ((AT91_REG *) 0xFFFBC068) // (EMAC) Transmit Underrun Error Register -#define AT91C_EMAC_DTE ((AT91_REG *) 0xFFFBC058) // (EMAC) Deferred Transmission Frame Register -#define AT91C_EMAC_TCR ((AT91_REG *) 0xFFFBC010) // (EMAC) Transmit Control Register -#define AT91C_EMAC_CTL ((AT91_REG *) 0xFFFBC000) // (EMAC) Network Control Register -#define AT91C_EMAC_SA4H ((AT91_REG *) 0xFFFBC0B4) // (EMAC) Specific Address 4 High, Last 2 bytesr -#define AT91C_EMAC_CDE ((AT91_REG *) 0xFFFBC06C) // (EMAC) Code Error Register -#define AT91C_EMAC_SQEE ((AT91_REG *) 0xFFFBC07C) // (EMAC) SQE Test Error Register -#define AT91C_EMAC_TSR ((AT91_REG *) 0xFFFBC014) // (EMAC) Transmit Status Register -#define AT91C_EMAC_DRFC ((AT91_REG *) 0xFFFBC080) // (EMAC) Discarded RX Frame Register -// ========== Register definition for EBI peripheral ========== -#define AT91C_EBI_CFGR ((AT91_REG *) 0xFFFFFF64) // (EBI) Configuration Register -#define AT91C_EBI_CSA ((AT91_REG *) 0xFFFFFF60) // (EBI) Chip Select Assignment Register -// ========== Register definition for SMC2 peripheral ========== -#define AT91C_SMC2_CSR ((AT91_REG *) 0xFFFFFF70) // (SMC2) SMC2 Chip Select Register -// ========== Register definition for SDRC peripheral ========== -#define AT91C_SDRC_IMR ((AT91_REG *) 0xFFFFFFAC) // (SDRC) SDRAM Controller Interrupt Mask Register -#define AT91C_SDRC_IER ((AT91_REG *) 0xFFFFFFA4) // (SDRC) SDRAM Controller Interrupt Enable Register -#define AT91C_SDRC_SRR ((AT91_REG *) 0xFFFFFF9C) // (SDRC) SDRAM Controller Self Refresh Register -#define AT91C_SDRC_TR ((AT91_REG *) 0xFFFFFF94) // (SDRC) SDRAM Controller Refresh Timer Register -#define AT91C_SDRC_ISR ((AT91_REG *) 0xFFFFFFB0) // (SDRC) SDRAM Controller Interrupt Mask Register -#define AT91C_SDRC_IDR ((AT91_REG *) 0xFFFFFFA8) // (SDRC) SDRAM Controller Interrupt Disable Register -#define AT91C_SDRC_LPR ((AT91_REG *) 0xFFFFFFA0) // (SDRC) SDRAM Controller Low Power Register -#define AT91C_SDRC_CR ((AT91_REG *) 0xFFFFFF98) // (SDRC) SDRAM Controller Configuration Register -#define AT91C_SDRC_MR ((AT91_REG *) 0xFFFFFF90) // (SDRC) SDRAM Controller Mode Register -// ========== Register definition for BFC peripheral ========== -#define AT91C_BFC_MR ((AT91_REG *) 0xFFFFFFC0) // (BFC) BFC Mode Register - -#include <at91/at91_pioreg.h> - -// ***************************************************************************** -// PERIPHERAL ID DEFINITIONS FOR AT91RM9200 -// ***************************************************************************** -#define AT91C_ID_FIQ 0u // Advanced Interrupt Controller (FIQ) -#define AT91C_ID_SYS 1u // System Peripheral -#define AT91C_ID_PIOA 2u // Parallel IO Controller A -#define AT91C_ID_PIOB 3u // Parallel IO Controller B -#define AT91C_ID_PIOC 4u // Parallel IO Controller C -#define AT91C_ID_PIOD 5u // Parallel IO Controller D -#define AT91C_ID_US0 6u // USART 0 -#define AT91C_ID_US1 7u // USART 1 -#define AT91C_ID_US2 8u // USART 2 -#define AT91C_ID_US3 9u // USART 3 -#define AT91C_ID_MCI 10u // Multimedia Card Interface -#define AT91C_ID_UDP 11u // USB Device Port -#define AT91C_ID_TWI 12u // Two-Wire Interface -#define AT91C_ID_SPI 13u // Serial Peripheral Interface -#define AT91C_ID_SSC0 14u // Serial Synchronous Controller 0 -#define AT91C_ID_SSC1 15u // Serial Synchronous Controller 1 -#define AT91C_ID_SSC2 16u // Serial Synchronous Controller 2 -#define AT91C_ID_TC0 17u // Timer Counter 0 -#define AT91C_ID_TC1 18u // Timer Counter 1 -#define AT91C_ID_TC2 19u // Timer Counter 2 -#define AT91C_ID_TC3 20u // Timer Counter 3 -#define AT91C_ID_TC4 21u // Timer Counter 4 -#define AT91C_ID_TC5 22u // Timer Counter 5 -#define AT91C_ID_UHP 23u // USB Host port -#define AT91C_ID_EMAC 24u // Ethernet MAC -#define AT91C_ID_IRQ0 25u // Advanced Interrupt Controller (IRQ0) -#define AT91C_ID_IRQ1 26u // Advanced Interrupt Controller (IRQ1) -#define AT91C_ID_IRQ2 27u // Advanced Interrupt Controller (IRQ2) -#define AT91C_ID_IRQ3 28u // Advanced Interrupt Controller (IRQ3) -#define AT91C_ID_IRQ4 29u // Advanced Interrupt Controller (IRQ4) -#define AT91C_ID_IRQ5 30u // Advanced Interrupt Controller (IRQ5) -#define AT91C_ID_IRQ6 31u // Advanced Interrupt Controller (IRQ6) - -// ***************************************************************************** -// BASE ADDRESS DEFINITIONS FOR AT91RM9200 -// ***************************************************************************** -#define AT91C_BASE_SYS ((AT91PS_SYS) 0xFFFFF000) // (SYS) Base Address -#define AT91C_BASE_MC ((AT91PS_MC) 0xFFFFFF00) // (MC) Base Address -#define AT91C_BASE_RTC ((AT91PS_RTC) 0xFFFFFE00) // (RTC) Base Address -#define AT91C_BASE_ST ((AT91PS_ST) 0xFFFFFD00) // (ST) Base Address -#define AT91C_BASE_PMC ((AT91PS_PMC) 0xFFFFFC00) // (PMC) Base Address -#define AT91C_BASE_CKGR ((AT91PS_CKGR) 0xFFFFFC20) // (CKGR) Base Address -#define AT91C_BASE_PIOD ((AT91PS_PIO) 0xFFFFFA00) // (PIOD) Base Address -#define AT91C_BASE_PIOC ((AT91PS_PIO) 0xFFFFF800) // (PIOC) Base Address -#define AT91C_BASE_PIOB ((AT91PS_PIO) 0xFFFFF600) // (PIOB) Base Address -#define AT91C_BASE_PIOA ((AT91PS_PIO) 0xFFFFF400) // (PIOA) Base Address -#define AT91C_BASE_DBGU ((AT91PS_DBGU) 0xFFFFF200) // (DBGU) Base Address -#define AT91C_BASE_PDC_DBGU ((AT91PS_PDC) 0xFFFFF300) // (PDC_DBGU) Base Address -#define AT91C_BASE_AIC ((AT91PS_AIC) 0xFFFFF000) // (AIC) Base Address -#define AT91C_BASE_PDC_SPI ((AT91PS_PDC) 0xFFFE0100) // (PDC_SPI) Base Address -#define AT91C_BASE_SPI ((AT91PS_SPI) 0xFFFE0000) // (SPI) Base Address -#define AT91C_BASE_PDC_SSC2 ((AT91PS_PDC) 0xFFFD8100) // (PDC_SSC2) Base Address -#define AT91C_BASE_SSC2 ((AT91PS_SSC) 0xFFFD8000) // (SSC2) Base Address -#define AT91C_BASE_PDC_SSC1 ((AT91PS_PDC) 0xFFFD4100) // (PDC_SSC1) Base Address -#define AT91C_BASE_SSC1 ((AT91PS_SSC) 0xFFFD4000) // (SSC1) Base Address -#define AT91C_BASE_PDC_SSC0 ((AT91PS_PDC) 0xFFFD0100) // (PDC_SSC0) Base Address -#define AT91C_BASE_SSC0 ((AT91PS_SSC) 0xFFFD0000) // (SSC0) Base Address -#define AT91C_BASE_PDC_US3 ((AT91PS_PDC) 0xFFFCC100) // (PDC_US3) Base Address -#define AT91C_BASE_US3 ((AT91PS_USART) 0xFFFCC000) // (US3) Base Address -#define AT91C_BASE_PDC_US2 ((AT91PS_PDC) 0xFFFC8100) // (PDC_US2) Base Address -#define AT91C_BASE_US2 ((AT91PS_USART) 0xFFFC8000) // (US2) Base Address -#define AT91C_BASE_PDC_US1 ((AT91PS_PDC) 0xFFFC4100) // (PDC_US1) Base Address -#define AT91C_BASE_US1 ((AT91PS_USART) 0xFFFC4000) // (US1) Base Address -#define AT91C_BASE_PDC_US0 ((AT91PS_PDC) 0xFFFC0100) // (PDC_US0) Base Address -#define AT91C_BASE_US0 ((AT91PS_USART) 0xFFFC0000) // (US0) Base Address -#define AT91C_BASE_TWI ((AT91PS_TWI) 0xFFFB8000) // (TWI) Base Address -#define AT91C_BASE_PDC_MCI ((AT91PS_PDC) 0xFFFB4100) // (PDC_MCI) Base Address -#define AT91C_BASE_MCI ((AT91PS_MCI) 0xFFFB4000) // (MCI) Base Address -#define AT91C_BASE_UDP ((AT91PS_UDP) 0xFFFB0000) // (UDP) Base Address -#define AT91C_BASE_TC5 ((AT91PS_TC) 0xFFFA4080) // (TC5) Base Address -#define AT91C_BASE_TC4 ((AT91PS_TC) 0xFFFA4040) // (TC4) Base Address -#define AT91C_BASE_TC3 ((AT91PS_TC) 0xFFFA4000) // (TC3) Base Address -#define AT91C_BASE_TCB1 ((AT91PS_TCB) 0xFFFA4080) // (TCB1) Base Address -#define AT91C_BASE_TC2 ((AT91PS_TC) 0xFFFA0080) // (TC2) Base Address -#define AT91C_BASE_TC1 ((AT91PS_TC) 0xFFFA0040) // (TC1) Base Address -#define AT91C_BASE_TC0 ((AT91PS_TC) 0xFFFA0000) // (TC0) Base Address -#define AT91C_BASE_TCB0 ((AT91PS_TCB) 0xFFFA0000) // (TCB0) Base Address -#define AT91C_BASE_UHP ((AT91PS_UHP) 0x00300000) // (UHP) Base Address -#define AT91C_BASE_EMAC ((AT91PS_EMAC) 0xFFFBC000) // (EMAC) Base Address -#define AT91C_BASE_EBI ((AT91PS_EBI) 0xFFFFFF60) // (EBI) Base Address -#define AT91C_BASE_SMC2 ((AT91PS_SMC2) 0xFFFFFF70) // (SMC2) Base Address -#define AT91C_BASE_SDRC ((AT91PS_SDRC) 0xFFFFFF90) // (SDRC) Base Address -#define AT91C_BASE_BFC ((AT91PS_BFC) 0xFFFFFFC0) // (BFC) Base Address - -// ***************************************************************************** -// MEMORY MAPPING DEFINITIONS FOR AT91RM9200 -// ***************************************************************************** -#define AT91C_ISRAM ((char *) 0x00200000) // Internal SRAM base address -#define AT91C_ISRAM_SIZE 0x00004000u // Internal SRAM size in byte (16 Kbyte) -#define AT91C_IROM ((char *) 0x00100000) // Internal ROM base address -#define AT91C_IROM_SIZE 0x00020000u // Internal ROM size in byte (128 Kbyte) - -#endif diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c b/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c deleted file mode 100644 index 1d54cfdad4..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c +++ /dev/null @@ -1,223 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provide by Kwikbyte who specifically - * disclaimed copyright on the code. - * - * $FreeBSD$ - */ - -#include "at91rm9200.h" -#include "at91rm9200_lowlevel.h" - -extern int __bss_start__[]; -extern int __bss_end__[]; - -#define BAUD 115200 -#define AT91C_US_ASYNC_MODE (AT91C_US_USMODE_NORMAL | AT91C_US_NBSTOP_1_BIT | \ - AT91C_US_PAR_NONE | AT91C_US_CHRL_8_BITS | AT91C_US_CLKS_CLOCK) - -/* - * void DefaultSystemInit(void) - * Load the system with sane values based on how the system is configured. - * at91rm9200_lowlevel.h is expected to define the necessary parameters. - */ -void -_init(void) -{ - int *i; - - AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU; - AT91PS_PDC pPDC = (AT91PS_PDC)&(pUSART->US_RPR); - - register unsigned value; - volatile sdram_size_t *p = (sdram_size_t *)SDRAM_BASE; - - AT91C_BASE_ST->ST_RTMR = 1; -#ifdef BOOT_TSC - // For the TSC board, we turn ON the one LED we have while - // early in boot. - AT91C_BASE_PIOC->PIO_PER = AT91C_PIO_PC10; - AT91C_BASE_PIOC->PIO_OER = AT91C_PIO_PC10; - AT91C_BASE_PIOC->PIO_CODR = AT91C_PIO_PC10; -#endif - -#if defined(BOOT_KB920X) - AT91C_BASE_PIOC->PIO_PER = AT91C_PIO_PC18 | AT91C_PIO_PC19 | - AT91C_PIO_PC20; - AT91C_BASE_PIOC->PIO_OER = AT91C_PIO_PC18 | AT91C_PIO_PC19 | - AT91C_PIO_PC20; - AT91C_BASE_PIOC->PIO_SODR = AT91C_PIO_PC18 | AT91C_PIO_PC19 | - AT91C_PIO_PC20; - AT91C_BASE_PIOC->PIO_CODR = AT91C_PIO_PC18; -#endif - - // configure clocks - // assume: - // main osc = 10Mhz - // PLLB configured for 96MHz (48MHz after div) - // CSS = PLLB - // set PLLA = 180MHz - // assume main osc = 10Mhz - // div = 5 , out = 2 (150MHz = 240MHz) - value = AT91C_BASE_CKGR->CKGR_PLLAR; - value &= ~(AT91C_CKGR_DIVA | AT91C_CKGR_OUTA | AT91C_CKGR_MULA); - value |= OSC_MAIN_FREQ_DIV | AT91C_CKGR_OUTA_2 | AT91C_CKGR_SRCA | - ((OSC_MAIN_MULT - 1) << 16); - AT91C_BASE_CKGR->CKGR_PLLAR = value; - - // wait for lock - while (!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_LOCKA)) - continue; - - // change divider = 3, pres = 1 - value = AT91C_BASE_PMC->PMC_MCKR; - value &= ~(AT91C_PMC_MDIV | AT91C_PMC_PRES); - value |= AT91C_PMC_MDIV_3 | AT91C_PMC_PRES_CLK; - AT91C_BASE_PMC->PMC_MCKR = value; - - // wait for update - while (!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY)) - continue; - - // change CSS = PLLA - value &= ~AT91C_PMC_CSS; - value |= AT91C_PMC_CSS_PLLA_CLK; - AT91C_BASE_PMC->PMC_MCKR = value; - - // wait for update - while (!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY)) - continue; - -#ifdef BOOT_KB920X - // setup flash access (allow ample margin) - // 9 wait states, 1 setup, 1 hold, 1 float for 8-bit device - ((AT91PS_SMC2)AT91C_BASE_SMC2)->SMC2_CSR[0] = - AT91C_SMC2_WSEN | - (9 & AT91C_SMC2_NWS) | - ((1 << 8) & AT91C_SMC2_TDF) | - AT91C_SMC2_DBW_8 | - ((1 << 24) & AT91C_SMC2_RWSETUP) | - ((1 << 29) & AT91C_SMC2_RWHOLD); -#endif - - // setup SDRAM access - // EBI chip-select register (CS1 = SDRAM controller) - // 9 col, 13row, 4 bank, CAS2 - // write recovery = 2 (Twr) - // row cycle = 5 (Trc) - // precharge delay = 2 (Trp) - // row to col delay 2 (Trcd) - // active to precharge = 4 (Tras) - // exit self refresh to active = 6 (Txsr) - value = ((AT91PS_EBI)AT91C_BASE_EBI)->EBI_CSA; - value &= ~AT91C_EBI_CS1A; - value |= AT91C_EBI_CS1A_SDRAMC; - AT91C_BASE_EBI->EBI_CSA = value; - - AT91C_BASE_SDRC->SDRC_CR = -#if defined(KB9202_B) || defined(SDRAM_128M) - AT91C_SDRC_NC_10 | -#else - AT91C_SDRC_NC_9 | -#endif - AT91C_SDRC_NR_13 | - AT91C_SDRC_NB_4_BANKS | - AT91C_SDRC_CAS_2 | - ((2 << 7) & AT91C_SDRC_TWR) | - ((5 << 11) & AT91C_SDRC_TRC) | - ((2 << 15) & AT91C_SDRC_TRP) | - ((2 << 19) & AT91C_SDRC_TRCD) | - ((4 << 23) & AT91C_SDRC_TRAS) | - ((6 << 27) & AT91C_SDRC_TXSR); - - // Step 1: We assume 200us of idle time. - // Step 2: Issue an all banks precharge command - AT91C_BASE_SDRC->SDRC_MR = SDRAM_WIDTH | AT91C_SDRC_MODE_PRCGALL_CMD; - *p = 0; - - // Step 3: Issue 8 Auto-refresh (CBR) cycles - AT91C_BASE_SDRC->SDRC_MR = SDRAM_WIDTH | AT91C_SDRC_MODE_RFSH_CMD; - *p = 0; - *p = 0; - *p = 0; - *p = 0; - *p = 0; - *p = 0; - *p = 0; - *p = 0; - - // Step 4: Issue an Mode Set Register (MRS) cycle to program in - // the parameters that we setup in the SDRC_CR register above. - AT91C_BASE_SDRC->SDRC_MR = SDRAM_WIDTH | AT91C_SDRC_MODE_LMR_CMD; - *p = 0; - - // Step 5: set the refresh timer and access memory to start it - // running. We have to wait 3 clocks after the LMR_CMD above, - // and this fits the bill nicely. - AT91C_BASE_SDRC->SDRC_TR = 7 * AT91C_MASTER_CLOCK / 1000000; - *p = 0; - - // Step 6: Set normal mode. - AT91C_BASE_SDRC->SDRC_MR = SDRAM_WIDTH | AT91C_SDRC_MODE_NORMAL_CMD; - *p = 0; - -#if SDRAM_WIDTH == AT91C_SDRC_DBW_32_BITS - // Turn on the upper 16 bits on the SDRAM bus. - AT91C_BASE_PIOC->PIO_ASR = 0xffff0000; - AT91C_BASE_PIOC->PIO_PDR = 0xffff0000; -#endif - // Configure DBGU -use local routine optimized for space - AT91C_BASE_PIOA->PIO_ASR = AT91C_PIO_PA31 | AT91C_PIO_PA30; - AT91C_BASE_PIOA->PIO_PDR = AT91C_PIO_PA31 | AT91C_PIO_PA30; - pUSART->US_IDR = (unsigned int) -1; - pUSART->US_CR = - AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS; - pUSART->US_BRGR = ((((AT91C_MASTER_CLOCK*10)/(BAUD*16))+5)/10); - pUSART->US_TTGR = 0; - pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; - pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; - pPDC->PDC_TNPR = 0; - pPDC->PDC_TNCR = 0; - - pPDC->PDC_RNPR = 0; - pPDC->PDC_RNCR = 0; - - pPDC->PDC_TPR = 0; - pPDC->PDC_TCR = 0; - - pPDC->PDC_RPR = 0; - pPDC->PDC_RCR = 0; - - pPDC->PDC_PTCR = AT91C_PDC_RXTEN; - pPDC->PDC_PTCR = AT91C_PDC_TXTEN; - - pUSART->US_MR = AT91C_US_ASYNC_MODE; - pUSART->US_CR = AT91C_US_TXEN; - pUSART->US_CR = AT91C_US_RXEN; - - /* Zero BSS now that we have memory setup */ - i = (int *)__bss_start__; - while (i < (int *)__bss_end__) - *i++ = 0; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h b/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h deleted file mode 100644 index 9d9b12736f..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _AT91RM9200_LOWLEVEL_H_ -#define _AT91RM9200_LOWLEVEL_H_ - -/* default system config parameters */ - -#define SDRAM_BASE 0x20000000 - -#ifdef BOOT_KB920X -/* The following divisor sets PLLA frequency: e.g. 10/5 * 90 = 180MHz */ -#define OSC_MAIN_FREQ_DIV 5 /* for 10MHz osc */ -#define SDRAM_WIDTH AT91C_SDRC_DBW_16_BITS -typedef unsigned short sdram_size_t; -#define OSC_MAIN_MULT 90 -#endif - -#ifdef BOOT_CENTIPAD -/* The following divisor sets PLLA frequency: e.g. 10/5 * 90 = 180MHz */ -#define OSC_MAIN_FREQ_DIV 5 /* for 10MHz osc */ -#define SDRAM_WIDTH AT91C_SDRC_DBW_16_BITS -typedef unsigned short sdram_size_t; -#define OSC_MAIN_MULT 90 -#endif - -#ifdef BOOT_BWCT -/* The following divisor sets PLLA frequency: e.g. 16/4 * 45 = 180MHz */ -#define OSC_MAIN_FREQ_DIV 4 /* for 16MHz osc */ -#define SDRAM_WIDTH AT91C_SDRC_DBW_32_BITS -typedef unsigned int sdram_size_t; -#define OSC_MAIN_MULT 45 -#endif - -#ifdef BOOT_TSC -/* The following divisor sets PLLA frequency: e.g. 16/4 * 45 = 180MHz */ -#define OSC_MAIN_FREQ_DIV 4 /* for 16MHz osc */ -#define SDRAM_WIDTH AT91C_SDRC_DBW_32_BITS -typedef unsigned int sdram_size_t; -#define OSC_MAIN_MULT 45 -#endif - -/* Master clock frequency at power-up */ -#define AT91C_MASTER_CLOCK 60000000 - -/* #define GetSeconds() (AT91C_BASE_RTC->RTC_TIMR & AT91C_RTC_SEC) */ -#define GetSeconds() (AT91C_BASE_ST->ST_CRTR >> 15) - -extern void _init(void); - -#endif /* _AT91RM9200_LOWLEVEL_H_ */ diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/delay.c b/usr/src/boot/sys/boot/arm/at91/libat91/delay.c deleted file mode 100644 index 390e06790c..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/delay.c +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provide by Kwikbyte who specifically - * disclaimed copyright on the code. - * - * $FreeBSD$ - */ - -#include "at91rm9200.h" -#include "spi_flash.h" -#include "lib.h" - -void -Delay(int us) -{ - unsigned later, now; - - now = AT91C_BASE_ST->ST_CRTR; - later = (now + us / 25 + 1) & AT91C_ST_CRTV; - while (later != AT91C_BASE_ST->ST_CRTR) - continue; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/eeprom.c b/usr/src/boot/sys/boot/arm/at91/libat91/eeprom.c deleted file mode 100644 index e08996bed8..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/eeprom.c +++ /dev/null @@ -1,185 +0,0 @@ -/****************************************************************************** - * - * Filename: eeprom.c - * - * Instantiation of eeprom routines - * - * Revision information: - * - * 28AUG2004 kb_admin initial creation - adapted from Atmel sources - * 12JAN2005 kb_admin fixed clock generation, write polling, init - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#include "at91rm9200_lowlevel.h" -#include "at91rm9200.h" -#include "lib.h" - -/******************************* GLOBALS *************************************/ - - -/*********************** PRIVATE FUNCTIONS/DATA ******************************/ - - -/* Use a macro to calculate the TWI clock generator value to save code space. */ -#define AT91C_TWSI_CLOCK 100000 -#define TWSI_EEPROM_ADDRESS 0x50 - -#define TWI_CLK_BASE_DIV ((AT91C_MASTER_CLOCK/(4*AT91C_TWSI_CLOCK)) - 2) -#define SET_TWI_CLOCK ((0x00010000) | (TWI_CLK_BASE_DIV) | (TWI_CLK_BASE_DIV << 8)) - - -/*************************** GLOBAL FUNCTIONS ********************************/ - - -/* - * .KB_C_FN_DEFINITION_START - * void InitEEPROM(void) - * This global function initializes the EEPROM interface (TWI). Intended - * to be called a single time. - * .KB_C_FN_DEFINITION_END - */ -void -InitEEPROM(void) -{ - - AT91PS_TWI twiPtr = (AT91PS_TWI)AT91C_BASE_TWI; - - AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - - pPio->PIO_ASR = AT91C_PIO_PA25 | AT91C_PIO_PA26; - pPio->PIO_PDR = AT91C_PIO_PA25 | AT91C_PIO_PA26; - - pPio->PIO_MDDR = ~AT91C_PIO_PA25; - pPio->PIO_MDER = AT91C_PIO_PA25; - - pPMC->PMC_PCER = 1u << AT91C_ID_TWI; - - twiPtr->TWI_IDR = 0xffffffffu; - twiPtr->TWI_CR = AT91C_TWI_SWRST; - twiPtr->TWI_CR = AT91C_TWI_MSEN | AT91C_TWI_SVDIS; - - twiPtr->TWI_CWGR = SET_TWI_CLOCK; -} - - -/* - * .KB_C_FN_DEFINITION_START - * void ReadEEPROM(unsigned ee_addr, char *data_addr, unsigned size) - * This global function reads data from the eeprom at ee_addr storing data - * to data_addr for size bytes. Assume the TWI has been initialized. - * This function does not utilize the page read mode to simplify the code. - * .KB_C_FN_DEFINITION_END - */ -int -ReadEEPROM(unsigned ee_off, unsigned char *data_addr, unsigned size) -{ - const AT91PS_TWI twiPtr = AT91C_BASE_TWI; - unsigned int status; - unsigned int count; - - status = twiPtr->TWI_SR; - status = twiPtr->TWI_RHR; - - // Set the TWI Master Mode Register - twiPtr->TWI_MMR = (TWSI_EEPROM_ADDRESS << 16) | - AT91C_TWI_IADRSZ_2_BYTE | AT91C_TWI_MREAD; - - // Set TWI Internal Address Register - twiPtr->TWI_IADR = ee_off; - - // Start transfer - twiPtr->TWI_CR = AT91C_TWI_START; - - status = twiPtr->TWI_SR; - - while (size-- > 1){ - // Wait RHR Holding register is full - count = 1000000; - while (!(twiPtr->TWI_SR & AT91C_TWI_RXRDY) && --count > 0) - continue; - if (count <= 0) - return -1; - - // Read byte - *(data_addr++) = twiPtr->TWI_RHR; - } - - twiPtr->TWI_CR = AT91C_TWI_STOP; - - status = twiPtr->TWI_SR; - - // Wait transfer is finished - while (!(twiPtr->TWI_SR & AT91C_TWI_TXCOMP)) - continue; - - // Read last byte - *data_addr = twiPtr->TWI_RHR; - return 0; -} - - -/* - * .KB_C_FN_DEFINITION_START - * void WriteEEPROM(unsigned ee_off, char *data_addr, unsigned size) - * This global function writes data to the eeprom at ee_off using data - * from data_addr for size bytes. Assume the TWI has been initialized. - * This function does not utilize the page write mode as the write time is - * much greater than the time required to access the device for byte-write - * functionality. This allows the function to be much simpler. - * .KB_C_FN_DEFINITION_END - */ -void -WriteEEPROM(unsigned ee_off, char *data_addr, unsigned size) -{ - const AT91PS_TWI twiPtr = AT91C_BASE_TWI; - unsigned status; - unsigned char test_data; - - while (size--) { - if (!(ee_off & 0x3f)) - putchar('.'); - - // Set the TWI Master Mode Register - twiPtr->TWI_MMR = ((TWSI_EEPROM_ADDRESS << 16) | - AT91C_TWI_IADRSZ_2_BYTE) & ~AT91C_TWI_MREAD; - - // Set TWI Internal Address Register - twiPtr->TWI_IADR = ee_off++; - - status = twiPtr->TWI_SR; - - twiPtr->TWI_THR = *(data_addr++); - - twiPtr->TWI_CR = AT91C_TWI_START; - - // Wait transfer is finished - while (!(twiPtr->TWI_SR & AT91C_TWI_TXRDY)) - continue; - - twiPtr->TWI_CR = AT91C_TWI_STOP; - - status = twiPtr->TWI_SR; - - // Wait transfer is finished - while (!(twiPtr->TWI_SR & AT91C_TWI_TXCOMP)) - continue; - - // wait for write operation to complete - ReadEEPROM(ee_off, &test_data, 1); - } - - putchar('\r'); - putchar('\n'); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/emac.c b/usr/src/boot/sys/boot/arm/at91/libat91/emac.c deleted file mode 100644 index 509d535ed9..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/emac.c +++ /dev/null @@ -1,575 +0,0 @@ -/******************************************************************************* - * - * Filename: emac.c - * - * Instantiation of routines for MAC/ethernet functions supporting tftp. - * - * Revision information: - * - * 28AUG2004 kb_admin initial creation - * 08JAN2005 kb_admin added tftp download - * also adapted from external sources - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - ******************************************************************************/ - -#include "at91rm9200.h" -#include "at91rm9200_lowlevel.h" -#include "emac.h" -#include "lib.h" - -/* ****************************** GLOBALS *************************************/ - -/* ********************** PRIVATE FUNCTIONS/DATA ******************************/ - -static receive_descriptor_t *p_rxBD; -static unsigned short localPort; -static unsigned short serverPort; -static unsigned serverMACSet; -static unsigned localIPSet, serverIPSet; -static unsigned lastSize; -static unsigned char serverMACAddr[6]; -static unsigned char localIPAddr[4], serverIPAddr[4]; -static int ackBlock; -static char *dlAddress; - -static unsigned transmitBuffer[1024 / sizeof(unsigned)]; -static unsigned tftpSendPacket[256 / sizeof(unsigned)]; - -/* - * .KB_C_FN_DEFINITION_START - * unsigned short IP_checksum(unsigned short *p, int len) - * This private function calculates the IP checksum for various headers. - * .KB_C_FN_DEFINITION_END - */ -static unsigned short -IP_checksum(unsigned short *p, int len) -{ - unsigned i, t; - - len &= ~1; - - for (i=0,t=0; i<len; i+=2, ++p) - t += SWAP16(*p); - - t = (t & 0xffff) + (t >> 16); - return (~t); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void GetServerAddress(void) - * This private function sends an ARP request to determine the server MAC. - * .KB_C_FN_DEFINITION_END - */ -static void -GetServerAddress(void) -{ - arp_header_t *p_ARP; - - p_ARP = (arp_header_t*)transmitBuffer; - - p_memset((char*)p_ARP->dest_mac, 0xFF, 6); - - memcpy(p_ARP->src_mac, localMACAddr, 6); - - p_ARP->frame_type = SWAP16(PROTOCOL_ARP); - p_ARP->hard_type = SWAP16(1); - p_ARP->prot_type = SWAP16(PROTOCOL_IP); - p_ARP->hard_size = 6; - p_ARP->prot_size = 4; - p_ARP->operation = SWAP16(ARP_REQUEST); - - memcpy(p_ARP->sender_mac, localMACAddr, 6); - memcpy(p_ARP->sender_ip, localIPAddr, 4); - p_memset((char*)p_ARP->target_mac, 0, 6); - memcpy(p_ARP->target_ip, serverIPAddr, 4); - - // wait until transmit is available - while (!(*AT91C_EMAC_TSR & AT91C_EMAC_BNQ)) - continue; - - *AT91C_EMAC_TSR |= AT91C_EMAC_COMP; - *AT91C_EMAC_TAR = (unsigned)transmitBuffer; - *AT91C_EMAC_TCR = 0x40; -} - - -/* - * .KB_C_FN_DEFINITION_START - * void Send_TFTP_Packet(char *tftpData, unsigned tftpLength) - * This private function initializes and send a TFTP packet. - * .KB_C_FN_DEFINITION_END - */ -static void -Send_TFTP_Packet(char *tftpData, unsigned tftpLength) -{ - transmit_header_t *macHdr = (transmit_header_t*)tftpSendPacket; - ip_header_t *ipHdr; - udp_header_t *udpHdr; - unsigned t_checksum; - - memcpy(macHdr->dest_mac, serverMACAddr, 6); - memcpy(macHdr->src_mac, localMACAddr, 6); - macHdr->proto_mac = SWAP16(PROTOCOL_IP); - - ipHdr = (ip_header_t*)&macHdr->packet_length; - - ipHdr->ip_v_hl = 0x45; - ipHdr->ip_tos = 0; - ipHdr->ip_len = SWAP16(28 + tftpLength); - ipHdr->ip_id = 0; - ipHdr->ip_off = SWAP16(0x4000); - ipHdr->ip_ttl = 64; - ipHdr->ip_p = PROTOCOL_UDP; - ipHdr->ip_sum = 0; - - memcpy(ipHdr->ip_src, localIPAddr, 4); - memcpy(ipHdr->ip_dst, serverIPAddr, 4); - - ipHdr->ip_sum = SWAP16(IP_checksum((unsigned short*)ipHdr, 20)); - - udpHdr = (udp_header_t*)(ipHdr + 1); - - udpHdr->src_port = localPort; - udpHdr->dst_port = serverPort; - udpHdr->udp_len = SWAP16(8 + tftpLength); - udpHdr->udp_cksum = 0; - - memcpy((char *)udpHdr+8, tftpData, tftpLength); - - t_checksum = IP_checksum((unsigned short*)ipHdr + 6, (16 + tftpLength)); - - t_checksum = (~t_checksum) & 0xFFFF; - t_checksum += 25 + tftpLength; - - t_checksum = (t_checksum & 0xffff) + (t_checksum >> 16); - t_checksum = (~t_checksum) & 0xFFFF; - - udpHdr->udp_cksum = SWAP16(t_checksum); - - while (!(*AT91C_EMAC_TSR & AT91C_EMAC_BNQ)) - continue; - - *AT91C_EMAC_TSR |= AT91C_EMAC_COMP; - *AT91C_EMAC_TAR = (unsigned)tftpSendPacket; - *AT91C_EMAC_TCR = 42 + tftpLength; -} - - -/* - * .KB_C_FN_DEFINITION_START - * void TFTP_RequestFile(char *filename) - * This private function sends a RRQ packet to the server. - * .KB_C_FN_DEFINITION_END - */ -static void -TFTP_RequestFile(char *filename) -{ - tftp_header_t tftpHeader; - char *cPtr, *ePtr, *mPtr; - unsigned length; - - tftpHeader.opcode = TFTP_RRQ_OPCODE; - - cPtr = (char*)&(tftpHeader.block_num); - - ePtr = strcpy(cPtr, filename); - mPtr = strcpy(ePtr, "octet"); - - length = mPtr - cPtr; - length += 2; - - Send_TFTP_Packet((char*)&tftpHeader, length); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void TFTP_ACK_Data(char *data, unsigned short block_num, unsigned short len) - * This private function sends an ACK packet to the server. - * .KB_C_FN_DEFINITION_END - */ -static void -TFTP_ACK_Data(unsigned char *data, unsigned short block_num, unsigned short len) -{ - tftp_header_t tftpHeader; - - if (block_num == (ackBlock + 1)) { - ++ackBlock; - memcpy(dlAddress, data, len); - dlAddress += len; - lastSize += len; - if (ackBlock % 128 == 0) - printf("tftp: %u kB\r", lastSize / 1024); - } - tftpHeader.opcode = TFTP_ACK_OPCODE; - tftpHeader.block_num = SWAP16(ackBlock); - Send_TFTP_Packet((char*)&tftpHeader, 4); - if (len < 512) { - ackBlock = -2; - printf("tftp: %u byte\n", lastSize); - } -} - - -/* - * .KB_C_FN_DEFINITION_START - * void CheckForNewPacket(ip_header_t *pHeader) - * This private function polls for received ethernet packets and handles - * any here. - * .KB_C_FN_DEFINITION_END - */ -static int -CheckForNewPacket(ip_header_t *pHeader) -{ - unsigned short *pFrameType; - unsigned i; - char *pData; - ip_header_t *pIpHeader; - arp_header_t *p_ARP; - int process = 0; - - process = 0; - for (i = 0; i < MAX_RX_PACKETS; ++i) { - if(p_rxBD[i].address & 0x1) { - process = 1; - (*AT91C_EMAC_RSR) |= (*AT91C_EMAC_RSR); - break; - } - } - - if (!process) - return (0); - process = i; - - pFrameType = (unsigned short *)((p_rxBD[i].address & 0xFFFFFFFC) + 12); - pData = (char *)(p_rxBD[i].address & 0xFFFFFFFC); - - switch (*pFrameType) { - - case SWAP16(PROTOCOL_ARP): - p_ARP = (arp_header_t*)pData; - if (p_ARP->operation == SWAP16(ARP_REPLY)) { - // check if new server info is available - if ((!serverMACSet) && - (!(p_memcmp((char*)p_ARP->sender_ip, - (char*)serverIPAddr, 4)))) { - - serverMACSet = 1; - memcpy(serverMACAddr, p_ARP->sender_mac, 6); - } - } else if (p_ARP->operation == SWAP16(ARP_REQUEST)) { - // ARP REPLY operation - p_ARP->operation = SWAP16(ARP_REPLY); - - // Fill the dest address and src address - for (i = 0; i <6; i++) { - // swap ethernet dest address and ethernet src address - pData[i] = pData[i+6]; - pData[i+6] = localMACAddr[i]; - // swap sender ethernet address and target ethernet address - pData[i+22] = localMACAddr[i]; - pData[i+32] = pData[i+6]; - } - - // swap sender IP address and target IP address - for (i = 0; i<4; i++) { - pData[i+38] = pData[i+28]; - pData[i+28] = localIPAddr[i]; - } - - if (!(*AT91C_EMAC_TSR & AT91C_EMAC_BNQ)) break; - - *AT91C_EMAC_TSR |= AT91C_EMAC_COMP; - *AT91C_EMAC_TAR = (unsigned)pData; - *AT91C_EMAC_TCR = 0x40; - } - break; - case SWAP16(PROTOCOL_IP): - pIpHeader = (ip_header_t*)(pData + 14); - memcpy(pHeader, pIpHeader, sizeof(ip_header_t)); - - if (pIpHeader->ip_p == PROTOCOL_UDP) { - udp_header_t *udpHdr; - tftp_header_t *tftpHdr; - - udpHdr = (udp_header_t*)((char*)pIpHeader+20); - tftpHdr = (tftp_header_t*)((char*)udpHdr + 8); - - if (udpHdr->dst_port != localPort) - break; - - if (tftpHdr->opcode != TFTP_DATA_OPCODE) - break; - - if (ackBlock == -1) { - if (tftpHdr->block_num != SWAP16(1)) - break; - serverPort = udpHdr->src_port; - ackBlock = 0; - } - - if (serverPort != udpHdr->src_port) - break; - - TFTP_ACK_Data(tftpHdr->data, - SWAP16(tftpHdr->block_num), - SWAP16(udpHdr->udp_len) - 12); - } - } - p_rxBD[process].address &= ~0x01; - return (1); -} - - -/* - * .KB_C_FN_DEFINITION_START - * unsigned short AT91F_MII_ReadPhy (AT91PS_EMAC pEmac, unsigned char addr) - * This private function reads the PHY device. - * .KB_C_FN_DEFINITION_END - */ -#ifndef BOOT_BWCT -static unsigned short -AT91F_MII_ReadPhy (AT91PS_EMAC pEmac, unsigned char addr) -{ - unsigned value = 0x60020000 | (addr << 18); - - pEmac->EMAC_CTL |= AT91C_EMAC_MPE; - pEmac->EMAC_MAN = value; - while(!((pEmac->EMAC_SR) & AT91C_EMAC_IDLE)); - pEmac->EMAC_CTL &= ~AT91C_EMAC_MPE; - return (pEmac->EMAC_MAN & 0x0000ffff); -} -#endif - -/* - * .KB_C_FN_DEFINITION_START - * unsigned short AT91F_MII_WritePhy (AT91PS_EMAC pEmac, unsigned char addr, unsigned short s) - * This private function writes the PHY device. - * .KB_C_FN_DEFINITION_END - */ -#ifdef BOOT_TSC -static unsigned short -AT91F_MII_WritePhy (AT91PS_EMAC pEmac, unsigned char addr, unsigned short s) -{ - unsigned value = 0x50020000 | (addr << 18) | s; - - pEmac->EMAC_CTL |= AT91C_EMAC_MPE; - pEmac->EMAC_MAN = value; - while(!((pEmac->EMAC_SR) & AT91C_EMAC_IDLE)); - pEmac->EMAC_CTL &= ~AT91C_EMAC_MPE; - return (pEmac->EMAC_MAN & 0x0000ffff); -} -#endif - -/* - * .KB_C_FN_DEFINITION_START - * void MII_GetLinkSpeed(AT91PS_EMAC pEmac) - * This private function determines the link speed set by the PHY. - * .KB_C_FN_DEFINITION_END - */ -static void -MII_GetLinkSpeed(AT91PS_EMAC pEmac) -{ -#if defined(BOOT_TSC) || defined(BOOT_KB920X) || defined(BOOT_CENTIPAD) - unsigned short stat2; -#endif - unsigned update; -#ifdef BOOT_TSC - unsigned sec; - int i; -#endif -#ifdef BOOT_BWCT - /* hardcoded link speed since we connect a switch via MII */ - update = pEmac->EMAC_CFG & ~(AT91C_EMAC_SPD | AT91C_EMAC_FD); - update |= AT91C_EMAC_SPD; - update |= AT91C_EMAC_FD; -#endif -#if defined(BOOT_KB920X) || defined(BOOT_CENTIPAD) - stat2 = AT91F_MII_ReadPhy(pEmac, MII_STS2_REG); - if (!(stat2 & MII_STS2_LINK)) - return ; - update = pEmac->EMAC_CFG & ~(AT91C_EMAC_SPD | AT91C_EMAC_FD); - if (stat2 & MII_STS2_100TX) - update |= AT91C_EMAC_SPD; - if (stat2 & MII_STS2_FDX) - update |= AT91C_EMAC_FD; -#endif -#ifdef BOOT_TSC - while (1) { - for (i = 0; i < 10; i++) { - stat2 = AT91F_MII_ReadPhy(pEmac, MII_STS_REG); - if (stat2 & MII_STS_LINK_STAT) - break; - printf("."); - sec = GetSeconds(); - while (GetSeconds() == sec) - continue; - } - if (stat2 & MII_STS_LINK_STAT) - break; - printf("Resetting MII..."); - AT91F_MII_WritePhy(pEmac, 0x0, 0x8000); - while (AT91F_MII_ReadPhy(pEmac, 0x0) & 0x8000) continue; - } - printf("emac: link"); - stat2 = AT91F_MII_ReadPhy(pEmac, MII_SPEC_STS_REG); - update = pEmac->EMAC_CFG & ~(AT91C_EMAC_SPD | AT91C_EMAC_FD); - if (stat2 & (MII_SSTS_100FDX | MII_SSTS_100HDX)) { - printf(" 100TX"); - update |= AT91C_EMAC_SPD; - } - if (stat2 & (MII_SSTS_100FDX | MII_SSTS_10FDX)) { - printf(" FDX"); - update |= AT91C_EMAC_FD; - } - printf("\n"); -#endif - pEmac->EMAC_CFG = update; -} - - -/* - * .KB_C_FN_DEFINITION_START - * void AT91F_EmacEntry(void) - * This private function initializes the EMAC on the chip. - * .KB_C_FN_DEFINITION_END - */ -static void -AT91F_EmacEntry(void) -{ - unsigned i; - char *pRxPacket = (char*)RX_DATA_START; - AT91PS_EMAC pEmac = AT91C_BASE_EMAC; - - p_rxBD = (receive_descriptor_t*)RX_BUFFER_START; - localPort = SWAP16(0x8002); - - for (i = 0; i < MAX_RX_PACKETS; ++i) { - - p_rxBD[i].address = (unsigned)pRxPacket; - p_rxBD[i].size = 0; - pRxPacket += RX_PACKET_SIZE; - } - - // Set the WRAP bit at the end of the list descriptor - p_rxBD[MAX_RX_PACKETS-1].address |= 0x02; - - if (!(pEmac->EMAC_SR & AT91C_EMAC_LINK)) - MII_GetLinkSpeed(pEmac); - - pEmac->EMAC_RBQP = (unsigned) p_rxBD; - pEmac->EMAC_RSR |= (AT91C_EMAC_OVR | AT91C_EMAC_REC | AT91C_EMAC_BNA); - pEmac->EMAC_CTL = AT91C_EMAC_TE | AT91C_EMAC_RE; - - pEmac->EMAC_TAR = (unsigned)transmitBuffer; -} - - -/* ************************** GLOBAL FUNCTIONS ********************************/ - -/* - * .KB_C_FN_DEFINITION_START - * void SetServerIPAddress(unsigned address) - * This global function sets the IP of the TFTP download server. - * .KB_C_FN_DEFINITION_END - */ -void -SetServerIPAddress(unsigned address) -{ - // force update in case the IP has changed - serverMACSet = 0; - - serverIPAddr[0] = (address >> 24) & 0xFF; - serverIPAddr[1] = (address >> 16) & 0xFF; - serverIPAddr[2] = (address >> 8) & 0xFF; - serverIPAddr[3] = (address >> 0) & 0xFF; - - serverIPSet = 1; -} - - -/* - * .KB_C_FN_DEFINITION_START - * void SetLocalIPAddress(unsigned address) - * This global function sets the IP of this module. - * .KB_C_FN_DEFINITION_END - */ -void -SetLocalIPAddress(unsigned address) -{ - // force update in case the IP has changed - serverMACSet = 0; - - localIPAddr[0] = (address >> 24) & 0xFF; - localIPAddr[1] = (address >> 16) & 0xFF; - localIPAddr[2] = (address >> 8) & 0xFF; - localIPAddr[3] = (address >> 0) & 0xFF; - - localIPSet = 1; -} - - -/* - * .KB_C_FN_DEFINITION_START - * void TFTP_Download(unsigned address, char *filename) - * This global function initiates and processes a tftp download request. - * The server IP, local IP, local MAC must be set before this function is - * executed. - * .KB_C_FN_DEFINITION_END - */ -void -TFTP_Download(unsigned address, char *filename) -{ - ip_header_t IpHeader; - unsigned thisSeconds; - int timeout; - - if ((!localMACSet) || (!localIPSet) || (!serverIPSet)) - return ; - - AT91F_EmacEntry(); - GetServerAddress(); - dlAddress = (char*)address; - lastSize = 0; - timeout = 10; - thisSeconds = (GetSeconds() + 2) % 32; - serverPort = SWAP16(69); - ++localPort; - ackBlock = -1; - - while (timeout) { - if (CheckForNewPacket(&IpHeader)) { - if (ackBlock == -2) - break; - timeout = 10; - thisSeconds = (GetSeconds() + 2) % 32; - } else if (GetSeconds() == thisSeconds) { - --timeout; - thisSeconds = (GetSeconds() + 2) % 32; - if (!serverMACSet) - GetServerAddress(); - else if (ackBlock == -1) - TFTP_RequestFile(filename); - else { - // Be sure to send a NAK, which is done by - // ACKing the last block we got. - TFTP_ACK_Data(0, ackBlock, 512); - printf("\nNAK %u\n", ackBlock); - } - } - } - if (timeout == 0) - printf("TFTP TIMEOUT!\n"); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/emac.h b/usr/src/boot/sys/boot/arm/at91/libat91/emac.h deleted file mode 100644 index fea08f8efc..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/emac.h +++ /dev/null @@ -1,135 +0,0 @@ -/****************************************************************************** - * - * Filename: emac.h - * - * Definition of routine to set the MAC address. - * - * Revision information: - * - * 28AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - - -#ifndef _EMAC_H_ -#define _EMAC_H_ - -extern void EMAC_SetMACAddress(unsigned char addr[6]); -extern void SetServerIPAddress(unsigned address); -extern void SetLocalIPAddress(unsigned address); -extern void EMAC_Init(void); -extern void TFTP_Download(unsigned address, char *filename); - -#define MAX_RX_PACKETS 8 -#define RX_PACKET_SIZE 1536 -#define RX_BUFFER_START 0x21000000 -#define RX_DATA_START (RX_BUFFER_START + (8 * MAX_RX_PACKETS)) - -#define ARP_REQUEST 0x0001 -#define ARP_REPLY 0x0002 -#define PROTOCOL_ARP 0x0806 -#define PROTOCOL_IP 0x0800 -#define PROTOCOL_UDP 0x11 - -#define SWAP16(x) ((((x) & 0xff) << 8) | ((x) >> 8)) - -typedef struct { - unsigned address; - unsigned size; -} receive_descriptor_t; - -typedef struct { - - unsigned char dest_mac[6]; - - unsigned char src_mac[6]; - - unsigned short frame_type; - unsigned short hard_type; - unsigned short prot_type; - unsigned char hard_size; - unsigned char prot_size; - - unsigned short operation; - - unsigned char sender_mac[6]; - unsigned char sender_ip[4]; - - unsigned char target_mac[6]; - unsigned char target_ip[4]; - -} __attribute__((__packed__)) arp_header_t; - -typedef struct { - unsigned char ip_v_hl; - unsigned char ip_tos; - unsigned short ip_len; - unsigned short ip_id; - unsigned short ip_off; - unsigned char ip_ttl; - unsigned char ip_p; - unsigned short ip_sum; - unsigned char ip_src[4]; - unsigned char ip_dst[4]; -} __attribute__((__packed__)) ip_header_t; - -typedef struct { - unsigned char dest_mac[6]; - unsigned char src_mac[6]; - unsigned short proto_mac; - unsigned short packet_length; - ip_header_t iphdr; -} __attribute__((__packed__)) transmit_header_t; - -typedef struct { - unsigned short src_port; - unsigned short dst_port; - unsigned short udp_len; - unsigned short udp_cksum; -} __attribute__((__packed__)) udp_header_t; - -typedef struct { - unsigned short opcode; - unsigned short block_num; - unsigned char data[512]; -} __attribute__((__packed__)) tftp_header_t; - -// Preswap bytes -#define TFTP_RRQ_OPCODE 0x0100 -#define TFTP_WRQ_OPCODE 0x0200 -#define TFTP_DATA_OPCODE 0x0300 -#define TFTP_ACK_OPCODE 0x0400 -#define TFTP_ERROR_OPCODE 0x0500 - -/* MII registers definition */ -#define MII_STS_REG 0x01 -#define MII_STS_LINK_STAT 0x04 -#if defined(BOOT_KB920X) || defined(BOOT_CENTIPAD) -#define MII_STS2_REG 0x11 -#define MII_STS2_LINK 0x400 -#define MII_STS2_100TX 0x4000 -#define MII_STS2_FDX 0x200 -#else -#define MII_SPEC_STS_REG 0x11 -#define MII_SSTS_100FDX 0x8000 -#define MII_SSTS_100HDX 0x4000 -#define MII_SSTS_10FDX 0x2000 -#define MII_SSTS_10HDX 0x1000 -#endif - -extern unsigned char localMACAddr[6]; -extern unsigned localMAClow, localMAChigh; -extern unsigned localMACSet; -#define EMAC_Init() - -#endif /* _EMAC_H_ */ diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/emac_init.c b/usr/src/boot/sys/boot/arm/at91/libat91/emac_init.c deleted file mode 100644 index a3869b67de..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/emac_init.c +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provide by Kwikbyte who specifically - * disclaimed copyright on the code. - * - * $FreeBSD$ - */ - -/****************************************************************************** - * - * Filename: emac.c - * - * Instantiation of routines for MAC/ethernet functions supporting tftp. - * - * Revision information: - * - * 28AUG2004 kb_admin initial creation - * 08JAN2005 kb_admin added tftp download - * also adapted from external sources - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - ******************************************************************************/ - -#include "at91rm9200.h" -#include "at91rm9200_lowlevel.h" -#include "emac.h" -#include "lib.h" - -/* ****************************** GLOBALS *************************************/ - -unsigned localMACSet; -unsigned char localMACAddr[6]; -unsigned localMAClow, localMAChigh; - -/* ********************** PRIVATE FUNCTIONS/DATA ******************************/ - -/* - * .KB_C_FN_DEFINITION_START - * void EMAC_SetMACAddress(unsigned low_address, unsigned high_address) - * This global function sets the MAC address. low_address is the first - * four bytes while high_address is the last 2 bytes of the 48-bit value. - * .KB_C_FN_DEFINITION_END - */ -void -EMAC_SetMACAddress(unsigned char mac[6]) -{ - AT91PS_PMC pPMC = AT91C_BASE_PMC; - AT91PS_EMAC pEmac = AT91C_BASE_EMAC; - - /* enable the peripheral clock before using EMAC */ - pPMC->PMC_PCER = ((unsigned) 1 << AT91C_ID_EMAC); - - memcpy(localMACAddr, mac, 6); - localMAClow = (mac[3] << 24) | (mac[2] << 16) | (mac[1] << 8) | mac[0]; - localMAChigh = (mac[5] << 8) | mac[4]; - localMACSet = 1; - - AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_EMAC; - AT91C_BASE_PIOA->PIO_ASR = - AT91C_PIO_PA14 | AT91C_PIO_PA12 | AT91C_PIO_PA13 | - AT91C_PIO_PA8 | AT91C_PIO_PA16 | AT91C_PIO_PA9 | - AT91C_PIO_PA10 | AT91C_PIO_PA11 | AT91C_PIO_PA15 | - AT91C_PIO_PA7; - AT91C_BASE_PIOA->PIO_PDR = - AT91C_PIO_PA14 | AT91C_PIO_PA12 | AT91C_PIO_PA13 | - AT91C_PIO_PA8 | AT91C_PIO_PA16 | AT91C_PIO_PA9 | - AT91C_PIO_PA10 | AT91C_PIO_PA11 | AT91C_PIO_PA15 | - AT91C_PIO_PA7; -#if defined(BOOT_KB920X) | defined(BOOT_BWCT) /* Really !RMII */ - AT91C_BASE_PIOB->PIO_BSR = - AT91C_PIO_PB12 | AT91C_PIO_PB13 | AT91C_PIO_PB14 | - AT91C_PIO_PB15 | AT91C_PIO_PB16 | AT91C_PIO_PB17 | - AT91C_PIO_PB18 | AT91C_PIO_PB19; - AT91C_BASE_PIOB->PIO_PDR = - AT91C_PIO_PB12 | AT91C_PIO_PB13 | AT91C_PIO_PB14 | - AT91C_PIO_PB15 | AT91C_PIO_PB16 | AT91C_PIO_PB17 | - AT91C_PIO_PB18 | AT91C_PIO_PB19; -#endif - pEmac->EMAC_CTL = 0; - - pEmac->EMAC_CFG = (pEmac->EMAC_CFG & ~(AT91C_EMAC_CLK)) | -#ifdef BOOT_TSC - AT91C_EMAC_RMII | -#endif - AT91C_EMAC_CLK_HCLK_32 | AT91C_EMAC_CAF; - // the sequence write EMAC_SA1L and write EMAC_SA1H must be respected - pEmac->EMAC_SA1L = localMAClow; - pEmac->EMAC_SA1H = localMAChigh; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/getc.c b/usr/src/boot/sys/boot/arm/at91/libat91/getc.c deleted file mode 100644 index 59e27a40e8..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/getc.c +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provided by kwikbyte without - * copyright as follows: - * - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * - * $FreeBSD$ - */ - -#include "at91rm9200.h" -#include "at91rm9200_lowlevel.h" -#include "lib.h" - -/* - * int getc(int seconds) - * - * Reads a character from the DBGU port, if one is available within about - * seconds seconds. It assumes that DBGU has already been initialized. - */ -int -getc(int seconds) -{ - AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU; - unsigned thisSecond; - - // Clamp to 20s - if (seconds > 20) - seconds = 20; - thisSecond = GetSeconds(); - seconds = thisSecond + seconds; - do { - if ((pUSART->US_CSR & AT91C_US_RXRDY)) - return (pUSART->US_RHR & 0xFF); - thisSecond = GetSeconds(); - } while (thisSecond != seconds); - return (-1); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/lib.h b/usr/src/boot/sys/boot/arm/at91/libat91/lib.h deleted file mode 100644 index 24ac49fd32..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/lib.h +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef ARM_BOOT_LIB_H -#define ARM_BOOT_LIB_H - -int getc(int); -void putchar(int); -void xputchar(int); -void printf(const char *fmt,...); - -/* The following function write eeprom at ee_addr using data */ -/* from data_add for size bytes. */ -int ReadEEPROM(unsigned eeoff, unsigned char *data_addr, unsigned size); -void WriteEEPROM(unsigned eeoff, char *data_addr, unsigned size); -void InitEEPROM(void); - -/* XMODEM protocol */ -int xmodem_rx(char *dst); - -/* */ -void start_wdog(int n); -void reset(void); - -/* Delay us */ -void Delay(int us); - -#define ToASCII(x) ((x > 9) ? (x + 'A' - 0xa) : (x + '0')) - -int p_IsWhiteSpace(char cValue); -unsigned p_HexCharValue(char cValue); -unsigned p_ASCIIToHex(const char *buf); -unsigned p_ASCIIToDec(const char *buf); - -void p_memset(char *buffer, char value, int size); -int p_strlen(const char *buffer); -char *strcpy(char *to, const char *from); -void memcpy(void *to, const void *from, unsigned size); -int p_memcmp(const char *to, const char *from, unsigned size); -int strcmp(const char *to, const char *from); - -#endif diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/lib_AT91RM9200.h b/usr/src/boot/sys/boot/arm/at91/libat91/lib_AT91RM9200.h deleted file mode 100644 index c87512f9b0..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/lib_AT91RM9200.h +++ /dev/null @@ -1,277 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provide by Kwikbyte who specifically - * disclaimed copyright on the code. - * - * $FreeBSD$ - */ - -#ifndef __LIBAT91RM9200_H -#define __LIBAT91RM9200_H - -#include "at91rm9200.h" - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_EnablePeriphClock -//* \brief Enable peripheral clock -//*---------------------------------------------------------------------------- -static inline void -AT91F_PMC_EnablePeriphClock ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int periphIds) // \arg IDs of peripherals to enable -{ - pPMC->PMC_PCER = periphIds; -} - -/* ***************************************************************************** - SOFTWARE API FOR PIO - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgPeriph -//* \brief Enable pins to be drived by peripheral -//*---------------------------------------------------------------------------- -static inline -void AT91F_PIO_CfgPeriph( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int periphAEnable, // \arg PERIPH A to enable - unsigned int periphBEnable) // \arg PERIPH B to enable - -{ - if (periphAEnable) - pPio->PIO_ASR = periphAEnable; - if (periphBEnable) - pPio->PIO_BSR = periphBEnable; - pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode -} - -/* ***************************************************************************** - SOFTWARE API FOR MCI - ***************************************************************************** */ -//* Classic MCI Data Timeout Register Configuration with 1048576 MCK cycles between 2 data transfer -#define AT91C_MCI_DTOR_1MEGA_CYCLES (AT91C_MCI_DTOCYC | AT91C_MCI_DTOMUL) - -//* Classic MCI SDCard Register Configuration with 1-bit data bus on slot A -#define AT91C_MCI_MMC_SLOTA (AT91C_MCI_SCDSEL & 0x0) - -//* Classic MCI SDCard Register Configuration with 1-bit data bus on slot B -#define AT91C_MCI_MMC_SLOTB (AT91C_MCI_SCDSEL) - -//* Classic MCI SDCard Register Configuration with 4-bit data bus on slot A -#define AT91C_MCI_SDCARD_4BITS_SLOTA ( (AT91C_MCI_SCDSEL & 0x0) | AT91C_MCI_SCDBUS ) - -//* Classic MCI SDCard Register Configuration with 4-bit data bus on slot B -#define AT91C_MCI_SDCARD_4BITS_SLOTB (AT91C_MCI_SCDSEL | AT91C_MCI_SCDBUS) - - - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MCI_Configure -//* \brief Configure the MCI -//*---------------------------------------------------------------------------- -static inline -void AT91F_MCI_Configure( - AT91PS_MCI pMCI, // \arg pointer to a MCI controller - unsigned int DTOR_register, // \arg Data Timeout Register to be programmed - unsigned int MR_register, // \arg Mode Register to be programmed - unsigned int SDCR_register) // \arg SDCard Register to be programmed -{ - //* Reset the MCI - pMCI->MCI_CR = AT91C_MCI_MCIEN | AT91C_MCI_PWSEN; - - //* Disable all the interrupts - pMCI->MCI_IDR = 0xFFFFFFFF; - - //* Set the Data Timeout Register - pMCI->MCI_DTOR = DTOR_register; - - //* Set the Mode Register - pMCI->MCI_MR = MR_register; - - //* Set the SDCard Register - pMCI->MCI_SDCR = SDCR_register; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MCI_CfgPMC -//* \brief Enable Peripheral clock in PMC for MCI -//*---------------------------------------------------------------------------- -static inline void -AT91F_MCI_CfgPMC(void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_MCI)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MCI_CfgPIO -//* \brief Configure PIO controllers to drive MCI signals -//*---------------------------------------------------------------------------- -static inline void -AT91F_MCI_CfgPIO(void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PIO_PA28 ) | - ((unsigned int) AT91C_PIO_PA29 ) | - ((unsigned int) AT91C_PIO_PA27 ), // Peripheral A - 0); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PIO_PB5 ) | - ((unsigned int) AT91C_PIO_PB3 ) | - ((unsigned int) AT91C_PIO_PB4 )); // Peripheral B -} - - -/* ***************************************************************************** - SOFTWARE API FOR PDC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetNextRx -//* \brief Set the next receive transfer descriptor -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_SetNextRx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be received - unsigned int bytes) // \arg number of bytes to be received -{ - pPDC->PDC_RNPR = (unsigned int) address; - pPDC->PDC_RNCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetNextTx -//* \brief Set the next transmit transfer descriptor -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_SetNextTx( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be transmitted - unsigned int bytes) // \arg number of bytes to be transmitted -{ - pPDC->PDC_TNPR = (unsigned int) address; - pPDC->PDC_TNCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetRx -//* \brief Set the receive transfer descriptor -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_SetRx( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be received - unsigned int bytes) // \arg number of bytes to be received -{ - pPDC->PDC_RPR = (unsigned int) address; - pPDC->PDC_RCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetTx -//* \brief Set the transmit transfer descriptor -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_SetTx( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be transmitted - unsigned int bytes) // \arg number of bytes to be transmitted -{ - pPDC->PDC_TPR = (unsigned int) address; - pPDC->PDC_TCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_EnableTx -//* \brief Enable transmit -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_EnableTx( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_TXTEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_EnableRx -//* \brief Enable receive -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_EnableRx( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_RXTEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_DisableTx -//* \brief Disable transmit -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_DisableTx( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_DisableRx -//* \brief Disable receive -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_DisableRx( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_Open -//* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX -//*---------------------------------------------------------------------------- -static inline void -AT91F_PDC_Open( - AT91PS_PDC pPDC) // \arg pointer to a PDC controller -{ - //* Disable the RX and TX PDC transfer requests - AT91F_PDC_DisableRx(pPDC); - AT91F_PDC_DisableTx(pPDC); - - //* Reset all Counter register Next buffer first - AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); - AT91F_PDC_SetTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetRx(pPDC, (char *) 0, 0); - - //* Enable the RX and TX PDC transfer requests - AT91F_PDC_EnableRx(pPDC); - AT91F_PDC_EnableTx(pPDC); -} - -#endif diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/mci_device.h b/usr/src/boot/sys/boot/arm/at91/libat91/mci_device.h deleted file mode 100644 index 27e5d36223..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/mci_device.h +++ /dev/null @@ -1,434 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provide by Kwikbyte who specifically - * disclaimed copyright on the code. - * - * $FreeBSD$ - */ - -//*--------------------------------------------------------------------------- -//* ATMEL Microcontroller Software Support - ROUSSET - -//*--------------------------------------------------------------------------- -//* The software is delivered "AS IS" without warranty or condition of any -//* kind, either express, implied or statutory. This includes without -//* limitation any warranty or condition with respect to merchantability or -//* fitness for any particular purpose, or against the infringements of -//* intellectual property rights of others. -//*--------------------------------------------------------------------------- -//* File Name : AT91C_MCI_Device.h -//* Object : Data Flash Atmel Description File -//* Translator : -//* -//* 1.0 26/11/02 FB : Creation -//*--------------------------------------------------------------------------- - -#ifndef __MCI_Device_h -#define __MCI_Device_h - -#include <sys/types.h> - -typedef unsigned int AT91S_MCIDeviceStatus; - -/////////////////////////////////////////////////////////////////////////////// - -#define AT91C_CARD_REMOVED 0 -#define AT91C_MMC_CARD_INSERTED 1 -#define AT91C_SD_CARD_INSERTED 2 - -#define AT91C_NO_ARGUMENT 0x0 - -#define AT91C_FIRST_RCA 0xCAFE -#define AT91C_MAX_MCI_CARDS 10 - -#define AT91C_BUS_WIDTH_1BIT 0x00 -#define AT91C_BUS_WIDTH_4BITS 0x02 - -/* Driver State */ -#define AT91C_MCI_IDLE 0x0 -#define AT91C_MCI_TIMEOUT_ERROR 0x1 -#define AT91C_MCI_RX_SINGLE_BLOCK 0x2 -#define AT91C_MCI_RX_MULTIPLE_BLOCK 0x3 -#define AT91C_MCI_RX_STREAM 0x4 -#define AT91C_MCI_TX_SINGLE_BLOCK 0x5 -#define AT91C_MCI_TX_MULTIPLE_BLOCK 0x6 -#define AT91C_MCI_TX_STREAM 0x7 - -/* TimeOut */ -#define AT91C_TIMEOUT_CMDRDY 30 - - - -/////////////////////////////////////////////////////////////////////////////// -// MMC & SDCard Structures -/////////////////////////////////////////////////////////////////////////////// - -/*---------------------------------------------*/ -/* MCI Device Structure Definition */ -/*---------------------------------------------*/ -typedef struct _AT91S_MciDevice -{ - volatile unsigned char state; - unsigned char SDCard_bus_width; - unsigned char IsSDv2; - unsigned char IsSDHC; - unsigned int RCA; // RCA - unsigned int READ_BL_LEN; -#ifdef REPORT_SIZE - unsigned int Memory_Capacity; -#endif -} AT91S_MciDevice; - -#include <dev/mmc/mmcreg.h> - -/////////////////////////////////////////////////////////////////////////////// -// Functions returnals -/////////////////////////////////////////////////////////////////////////////// -#define AT91C_CMD_SEND_OK 0 // Command ok -#define AT91C_CMD_SEND_ERROR -1 // Command failed -#define AT91C_INIT_OK 2 // Init Successful -#define AT91C_INIT_ERROR 3 // Init Failed -#define AT91C_READ_OK 4 // Read Successful -#define AT91C_READ_ERROR 5 // Read Failed -#define AT91C_WRITE_OK 6 // Write Successful -#define AT91C_WRITE_ERROR 7 // Write Failed -#define AT91C_ERASE_OK 8 // Erase Successful -#define AT91C_ERASE_ERROR 9 // Erase Failed -#define AT91C_CARD_SELECTED_OK 10 // Card Selection Successful -#define AT91C_CARD_SELECTED_ERROR 11 // Card Selection Failed - -#define AT91C_MCI_SR_ERROR (AT91C_MCI_UNRE | AT91C_MCI_OVRE | AT91C_MCI_DTOE | \ - AT91C_MCI_DCRCE | AT91C_MCI_RTOE | AT91C_MCI_RENDE | AT91C_MCI_RCRCE | \ - AT91C_MCI_RDIRE | AT91C_MCI_RINDE) - -#define MMC_CMDNB (0x1Fu << 0) // Command Number -#define MMC_RSPTYP (0x3u << 6) // Response Type -#define MMC_RSPTYP_NO (0x0u << 6) // No response -#define MMC_RSPTYP_48 (0x1u << 6) // 48-bit response -#define MMC_RSPTYP_136 (0x2u << 6) // 136-bit response -#define MMC_SPCMD (0x7u << 8) // Special CMD -#define MMC_SPCMD_NONE (0x0u << 8) // Not a special CMD -#define MMC_SPCMD_INIT (0x1u << 8) // Initialization CMD -#define MMC_SPCMD_SYNC (0x2u << 8) // Synchronized CMD -#define MMC_SPCMD_IT_CMD (0x4u << 8) // Interrupt command -#define MMC_SPCMD_IT_REP (0x5u << 8) // Interrupt response -#define MMC_OPDCMD (0x1u << 11) // Open Drain Command -#define MMC_MAXLAT (0x1u << 12) // Maximum Latency for Command to respond -#define MMC_TRCMD (0x3u << 16) // Transfer CMD -#define MMC_TRCMD_NO (0x0u << 16) // No transfer -#define MMC_TRCMD_START (0x1u << 16) // Start transfer -#define MMC_TRCMD_STOP (0x2u << 16) // Stop transfer -#define MMC_TRDIR (0x1u << 18) // Transfer Direction -#define MMC_TRTYP (0x3u << 19) // Transfer Type -#define MMC_TRTYP_BLOCK (0x0u << 19) // Block Transfer type -#define MMC_TRTYP_MULTIPLE (0x1u << 19) // Multiple Block transfer type -#define MMC_TRTYP_STREAM (0x2u << 19) // Stream transfer type - -/////////////////////////////////////////////////////////////////////////////// -// MCI_CMD Register Value -/////////////////////////////////////////////////////////////////////////////// -#define POWER_ON_INIT \ - (0 | MMC_TRCMD_NO | MMC_SPCMD_INIT | MMC_OPDCMD) - -///////////////////////////////////////////////////////////////// -// Class 0 & 1 commands: Basic commands and Read Stream commands -///////////////////////////////////////////////////////////////// - -#define GO_IDLE_STATE_CMD \ - (0 | MMC_TRCMD_NO | MMC_SPCMD_NONE ) -#define MMC_GO_IDLE_STATE_CMD \ - (0 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_OPDCMD) -#define MMC_SEND_OP_COND_CMD \ - (1 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ - MMC_OPDCMD) - -#define ALL_SEND_CID_CMD \ - (2 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136) -#define MMC_ALL_SEND_CID_CMD \ - (2 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ - MMC_OPDCMD) - -#define SET_RELATIVE_ADDR_CMD \ - (3 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ - MMC_MAXLAT) -#define MMC_SET_RELATIVE_ADDR_CMD \ - (3 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ - MMC_MAXLAT | MMC_OPDCMD) - -#define SET_DSR_CMD \ - (4 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_NO | \ - MMC_MAXLAT) // no tested - -#define SEL_DESEL_CARD_CMD \ - (7 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ - MMC_MAXLAT) -#define SEND_CSD_CMD \ - (9 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ - MMC_MAXLAT) -#define SEND_CID_CMD \ - (10 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ - MMC_MAXLAT) -#define MMC_READ_DAT_UNTIL_STOP_CMD \ - (11 | MMC_TRTYP_STREAM | MMC_SPCMD_NONE | \ - MMC_RSPTYP_48 | MMC_TRDIR | MMC_TRCMD_START | \ - MMC_MAXLAT) - -#define STOP_TRANSMISSION_CMD \ - (12 | MMC_TRCMD_STOP | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ - MMC_MAXLAT) -#define STOP_TRANSMISSION_SYNC_CMD \ - (12 | MMC_TRCMD_STOP | MMC_SPCMD_SYNC | MMC_RSPTYP_48 | \ - MMC_MAXLAT) -#define SEND_STATUS_CMD \ - (13 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ - MMC_MAXLAT) -#define GO_INACTIVE_STATE_CMD \ - (15 | MMC_RSPTYP_NO) -#define SD_SEND_IF_COND_CMD \ - (8 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ - MMC_MAXLAT) -//*------------------------------------------------ -//* Class 2 commands: Block oriented Read commands -//*------------------------------------------------ - -#define SET_BLOCKLEN_CMD (16 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_MAXLAT ) -#define READ_SINGLE_BLOCK_CMD (17 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | MMC_TRTYP_BLOCK | MMC_TRDIR | MMC_MAXLAT) -#define READ_MULTIPLE_BLOCK_CMD (18 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | MMC_TRTYP_MULTIPLE | MMC_TRDIR | MMC_MAXLAT) - -//*-------------------------------------------- -//* Class 3 commands: Sequential write commands -//*-------------------------------------------- - -#define MMC_WRITE_DAT_UNTIL_STOP_CMD (20 | MMC_TRTYP_STREAM| MMC_SPCMD_NONE | MMC_RSPTYP_48 & ~(MMC_TRDIR) | MMC_TRCMD_START | MMC_MAXLAT ) // MMC - -//*------------------------------------------------ -//* Class 4 commands: Block oriented write commands -//*------------------------------------------------ - -#define WRITE_BLOCK_CMD (24 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | (MMC_TRTYP_BLOCK & ~(MMC_TRDIR)) | MMC_MAXLAT) -#define WRITE_MULTIPLE_BLOCK_CMD (25 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | (MMC_TRTYP_MULTIPLE & ~(MMC_TRDIR)) | MMC_MAXLAT) -#define PROGRAM_CSD_CMD (27 | MMC_RSPTYP_48 ) - - -//*---------------------------------------- -//* Class 6 commands: Group Write protect -//*---------------------------------------- - -#define SET_WRITE_PROT_CMD (28 | MMC_RSPTYP_48 ) -#define CLR_WRITE_PROT_CMD (29 | MMC_RSPTYP_48 ) -#define SEND_WRITE_PROT_CMD (30 | MMC_RSPTYP_48 ) - - -//*---------------------------------------- -//* Class 5 commands: Erase commands -//*---------------------------------------- - -#define TAG_SECTOR_START_CMD (32 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define TAG_SECTOR_END_CMD (33 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define MMC_UNTAG_SECTOR_CMD (34 | MMC_RSPTYP_48 ) -#define MMC_TAG_ERASE_GROUP_START_CMD (35 | MMC_RSPTYP_48 ) -#define MMC_TAG_ERASE_GROUP_END_CMD (36 | MMC_RSPTYP_48 ) -#define MMC_UNTAG_ERASE_GROUP_CMD (37 | MMC_RSPTYP_48 ) -#define ERASE_CMD (38 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT ) - -//*---------------------------------------- -//* Class 7 commands: Lock commands -//*---------------------------------------- - -#define LOCK_UNLOCK (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) // no tested - -//*----------------------------------------------- -// Class 8 commands: Application specific commands -//*----------------------------------------------- - -#define APP_CMD (55 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define GEN_CMD (56 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) // no tested - -#define SDCARD_SET_BUS_WIDTH_CMD (6 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define SDCARD_STATUS_CMD (13 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define SDCARD_SEND_NUM_WR_BLOCKS_CMD (22 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define SDCARD_SET_WR_BLK_ERASE_COUNT_CMD (23 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define SDCARD_APP_OP_COND_CMD (41 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define SDCARD_SET_CLR_CARD_DETECT_CMD (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define SDCARD_SEND_SCR_CMD (51 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) - -#define SDCARD_APP_ALL_CMD (SDCARD_SET_BUS_WIDTH_CMD +\ - SDCARD_STATUS_CMD +\ - SDCARD_SEND_NUM_WR_BLOCKS_CMD +\ - SDCARD_SET_WR_BLK_ERASE_COUNT_CMD +\ - SDCARD_APP_OP_COND_CMD +\ - SDCARD_SET_CLR_CARD_DETECT_CMD +\ - SDCARD_SEND_SCR_CMD) - -//*---------------------------------------- -//* Class 9 commands: IO Mode commands -//*---------------------------------------- - -#define MMC_FAST_IO_CMD (39 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_MAXLAT) -#define MMC_GO_IRQ_STATE_CMD (40 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) - -/////////////////////////////////////////////////////////////////////////////// -// OCR Register -/////////////////////////////////////////////////////////////////////////////// -#define AT91C_VDD_16_17 (1 << 4) -#define AT91C_VDD_17_18 (1 << 5) -#define AT91C_VDD_18_19 (1 << 6) -#define AT91C_VDD_19_20 (1 << 7) -#define AT91C_VDD_20_21 (1 << 8) -#define AT91C_VDD_21_22 (1 << 9) -#define AT91C_VDD_22_23 (1 << 10) -#define AT91C_VDD_23_24 (1 << 11) -#define AT91C_VDD_24_25 (1 << 12) -#define AT91C_VDD_25_26 (1 << 13) -#define AT91C_VDD_26_27 (1 << 14) -#define AT91C_VDD_27_28 (1 << 15) -#define AT91C_VDD_28_29 (1 << 16) -#define AT91C_VDD_29_30 (1 << 17) -#define AT91C_VDD_30_31 (1 << 18) -#define AT91C_VDD_31_32 (1 << 19) -#define AT91C_VDD_32_33 (1 << 20) -#define AT91C_VDD_33_34 (1 << 21) -#define AT91C_VDD_34_35 (1 << 22) -#define AT91C_VDD_35_36 (1 << 23) -#define AT91C_CCS (1 << 30) -#define AT91C_CARD_POWER_UP_DONE (1U << 31) - -#define AT91C_MMC_HOST_VOLTAGE_RANGE (AT91C_VDD_27_28 | AT91C_VDD_28_29 | \ - AT91C_VDD_29_30 | AT91C_VDD_30_31 | AT91C_VDD_31_32 | AT91C_VDD_32_33) - -/////////////////////////////////////////////////////////////////////////////// -// CURRENT_STATE & READY_FOR_DATA in SDCard Status Register definition (response type R1) -/////////////////////////////////////////////////////////////////////////////// -#define AT91C_SR_READY_FOR_DATA (1 << 8) // corresponds to buffer empty signalling on the bus -#define AT91C_SR_IDLE (0 << 9) -#define AT91C_SR_READY (1 << 9) -#define AT91C_SR_IDENT (2 << 9) -#define AT91C_SR_STBY (3 << 9) -#define AT91C_SR_TRAN (4 << 9) -#define AT91C_SR_DATA (5 << 9) -#define AT91C_SR_RCV (6 << 9) -#define AT91C_SR_PRG (7 << 9) -#define AT91C_SR_DIS (8 << 9) - -#define AT91C_SR_CARD_SELECTED (AT91C_SR_READY_FOR_DATA + AT91C_SR_TRAN) - -#define MMC_FIRST_RCA 0xCAFE - -/////////////////////////////////////////////////////////////////////////////// -// MMC CSD register header File -// CSD_x_xxx_S for shift value for word x -// CSD_x_xxx_M for mask value for word x -/////////////////////////////////////////////////////////////////////////////// - -// First Response INT <=> CSD[3] : bits 0 to 31 -#define CSD_3_BIT0_S 0 // [0:0] -#define CSD_3_BIT0_M 0x01 -#define CSD_3_CRC_S 1 // [7:1] -#define CSD_3_CRC_M 0x7F -#define CSD_3_MMC_ECC_S 8 // [9:8] reserved for MMC compatibility -#define CSD_3_MMC_ECC_M 0x03 -#define CSD_3_FILE_FMT_S 10 // [11:10] -#define CSD_3_FILE_FMT_M 0x03 -#define CSD_3_TMP_WP_S 12 // [12:12] -#define CSD_3_TMP_WP_M 0x01 -#define CSD_3_PERM_WP_S 13 // [13:13] -#define CSD_3_PERM_WP_M 0x01 -#define CSD_3_COPY_S 14 // [14:14] -#define CSD_3_COPY_M 0x01 -#define CSD_3_FILE_FMT_GRP_S 15 // [15:15] -#define CSD_3_FILE_FMT_GRP_M 0x01 -// reserved 16 // [20:16] -// reserved 0x1F -#define CSD_3_WBLOCK_P_S 21 // [21:21] -#define CSD_3_WBLOCK_P_M 0x01 -#define CSD_3_WBLEN_S 22 // [25:22] -#define CSD_3_WBLEN_M 0x0F -#define CSD_3_R2W_F_S 26 // [28:26] -#define CSD_3_R2W_F_M 0x07 -#define CSD_3_MMC_DEF_ECC_S 29 // [30:29] reserved for MMC compatibility -#define CSD_3_MMC_DEF_ECC_M 0x03 -#define CSD_3_WP_GRP_EN_S 31 // [31:31] -#define CSD_3_WP_GRP_EN_M 0x01 - -// Seconde Response INT <=> CSD[2] : bits 32 to 63 -#define CSD_2_v21_WP_GRP_SIZE_S 0 // [38:32] -#define CSD_2_v21_WP_GRP_SIZE_M 0x7F -#define CSD_2_v21_SECT_SIZE_S 7 // [45:39] -#define CSD_2_v21_SECT_SIZE_M 0x7F -#define CSD_2_v21_ER_BLEN_EN_S 14 // [46:46] -#define CSD_2_v21_ER_BLEN_EN_M 0x01 - -#define CSD_2_v22_WP_GRP_SIZE_S 0 // [36:32] -#define CSD_2_v22_WP_GRP_SIZE_M 0x1F -#define CSD_2_v22_ER_GRP_SIZE_S 5 // [41:37] -#define CSD_2_v22_ER_GRP_SIZE_M 0x1F -#define CSD_2_v22_SECT_SIZE_S 10 // [46:42] -#define CSD_2_v22_SECT_SIZE_M 0x1F - -#define CSD_2_C_SIZE_M_S 15 // [49:47] -#define CSD_2_C_SIZE_M_M 0x07 -#define CSD_2_VDD_WMAX_S 18 // [52:50] -#define CSD_2_VDD_WMAX_M 0x07 -#define CSD_2_VDD_WMIN_S 21 // [55:53] -#define CSD_2_VDD_WMIN_M 0x07 -#define CSD_2_RCUR_MAX_S 24 // [58:56] -#define CSD_2_RCUR_MAX_M 0x07 -#define CSD_2_RCUR_MIN_S 27 // [61:59] -#define CSD_2_RCUR_MIN_M 0x07 -#define CSD_2_CSIZE_L_S 30 // [63:62] <=> 2 LSB of CSIZE -#define CSD_2_CSIZE_L_M 0x03 - -// Third Response INT <=> CSD[1] : bits 64 to 95 -#define CSD_1_CSIZE_H_S 0 // [73:64] <=> 10 MSB of CSIZE -#define CSD_1_CSIZE_H_M 0x03FF -// reserved 10 // [75:74] -// reserved 0x03 -#define CSD_1_DSR_I_S 12 // [76:76] -#define CSD_1_DSR_I_M 0x01 -#define CSD_1_RD_B_MIS_S 13 // [77:77] -#define CSD_1_RD_B_MIS_M 0x01 -#define CSD_1_WR_B_MIS_S 14 // [78:78] -#define CSD_1_WR_B_MIS_M 0x01 -#define CSD_1_RD_B_PAR_S 15 // [79:79] -#define CSD_1_RD_B_PAR_M 0x01 -#define CSD_1_RD_B_LEN_S 16 // [83:80] -#define CSD_1_RD_B_LEN_M 0x0F -#define CSD_1_CCC_S 20 // [95:84] -#define CSD_1_CCC_M 0x0FFF - -// Fourth Response INT <=> CSD[0] : bits 96 to 127 -#define CSD_0_TRANS_SPEED_S 0 // [103:96] -#define CSD_0_TRANS_SPEED_M 0xFF -#define CSD_0_NSAC_S 8 // [111:104] -#define CSD_0_NSAC_M 0xFF -#define CSD_0_TAAC_S 16 // [119:112] -#define CSD_0_TAAC_M 0xFF -// reserved 24 // [121:120] -// reserved 0x03 -#define CSD_0_MMC_SPEC_VERS_S 26 // [125:122] reserved for MMC compatibility -#define CSD_0_MMC_SPEC_VERS_M 0x0F -#define CSD_0_STRUCT_S 30 // [127:126] -#define CSD_0_STRUCT_M 0x03 - -/////////////////////////////////////////////////////////////////////////////// -#endif diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/memcmp.c b/usr/src/boot/sys/boot/arm/at91/libat91/memcmp.c deleted file mode 100644 index 322042f23c..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/memcmp.c +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "lib.h" - -int -p_memcmp(const char *to, const char *from, unsigned size) -{ - while ((--size) && (*to++ == *from++)) - continue; - - return (size || (*to != *from)); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/memcpy.c b/usr/src/boot/sys/boot/arm/at91/libat91/memcpy.c deleted file mode 100644 index f7544fee64..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/memcpy.c +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "lib.h" - -void -memcpy(void *dst, const void *src, unsigned len) -{ - const char *s = src; - char *d = dst; - - while (len--) - *d++ = *s++; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/memset.c b/usr/src/boot/sys/boot/arm/at91/libat91/memset.c deleted file mode 100644 index 3432e640cd..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/memset.c +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "lib.h" - -void -p_memset(char *buffer, char value, int size) -{ - while (size--) - *buffer++ = value; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/p_string.c b/usr/src/boot/sys/boot/arm/at91/libat91/p_string.c deleted file mode 100644 index 8e7bbabb8c..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/p_string.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** - * - * Filename: p_string.c - * - * Instantiation of basic string operations to prevent inclusion of full - * string library. These are simple implementations not necessarily optimized - * for speed, but rather to show intent. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin minor updates - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#include "lib.h" - -/* - * .KB_C_FN_DEFINITION_START - * void p_memset(char *buffer, char value, int size) - * This global function sets memory at the pointer for the specified - * number of bytes to value. - * .KB_C_FN_DEFINITION_END - */ -void -p_memset(char *buffer, char value, int size) -{ - while (size--) - *buffer++ = value; -} - -/* - * .KB_C_FN_DEFINITION_START - * int p_memcmp(char *to, char *from, unsigned size) - * This global function compares data at to against data at from for - * size bytes. Returns 0 if the locations are equal. size must be - * greater than 0. - * .KB_C_FN_DEFINITION_END - */ -int -p_memcmp(const char *to, const char *from, unsigned size) -{ - while ((--size) && (*to++ == *from++)) - continue; - - return (*to != *from); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/printf.c b/usr/src/boot/sys/boot/arm/at91/libat91/printf.c deleted file mode 100644 index f2622b8590..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/printf.c +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * Copyright (c) 1998 Robert Nordier - * All rights reserved. - * Copyright (c) 2006 M. Warner Losh - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - * - * $FreeBSD$ - */ - -#include <stdarg.h> -#include "lib.h" - -void -printf(const char *fmt,...) -{ - va_list ap; - const char *hex = "0123456789abcdef"; - char buf[10]; - char *s; - unsigned u; - int c; - - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - c = *fmt++; - switch (c) { - case 'c': - xputchar(va_arg(ap, int)); - continue; - case 's': - for (s = va_arg(ap, char *); *s; s++) - xputchar(*s); - continue; - case 'd': /* A lie, always prints unsigned */ - case 'u': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - dumpbuf:; - while (--s >= buf) - xputchar(*s); - continue; - case 'x': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = hex[u & 0xfu]; - while (u >>= 4); - goto dumpbuf; - } - } - xputchar(c); - } - va_end(ap); - - return; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/putchar.c b/usr/src/boot/sys/boot/arm/at91/libat91/putchar.c deleted file mode 100644 index 2b805c98c2..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/putchar.c +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provided by kwikbyte without - * copyright as follows: - * - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * - * $FreeBSD$ - */ - -#include "at91rm9200.h" -#include "at91rm9200_lowlevel.h" -#include "lib.h" - -/* - * void putchar(int ch) - * Writes a character to the DBGU port. It assumes that DBGU has - * already been initialized. - */ -void -putchar(int ch) -{ - AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU; - - while (!(pUSART->US_CSR & AT91C_US_TXRDY)) - continue; - pUSART->US_THR = (ch & 0xFF); -} - -void -xputchar(int ch) -{ - if (ch == '\n') - putchar('\r'); - putchar(ch); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/reset.c b/usr/src/boot/sys/boot/arm/at91/libat91/reset.c deleted file mode 100644 index b1f083a6e7..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/reset.c +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "at91rm9200.h" -#include "lib.h" - -/* - * void reset() - * - * Forces a reset of the system. Uses watchdog timer of '1', which - * corresponds to 128 / SLCK seconds (SLCK is 32,768 Hz, so 128/32768 is - * 1 / 256 ~= 5.4ms - */ -void -reset(void) -{ - // The following should effect a reset. - AT91C_BASE_ST->ST_WDMR = 1 | AT91C_ST_RSTEN; - AT91C_BASE_ST->ST_CR = AT91C_ST_WDRST; -} - -/* - * void start_wdog() - * - * Starts a watchdog timer. We force the boot process to get to the point - * it can kick the watch dog part of the ST part for the OS's driver. - */ -void -start_wdog(int n) -{ - // The following should effect a reset after N seconds. - AT91C_BASE_ST->ST_WDMR = (n * (32768 / 128)) | AT91C_ST_RSTEN; - AT91C_BASE_ST->ST_CR = AT91C_ST_WDRST; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/sd-card.c b/usr/src/boot/sys/boot/arm/at91/libat91/sd-card.c deleted file mode 100644 index 803d782d97..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/sd-card.c +++ /dev/null @@ -1,517 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provide by Kwikbyte who specifically - * disclaimed copyright on the code. - * - * $FreeBSD$ - */ - -//*---------------------------------------------------------------------------- -//* ATMEL Microcontroller Software Support - ROUSSET - -//*---------------------------------------------------------------------------- -//* The software is delivered "AS IS" without warranty or condition of any -//* kind, either express, implied or statutory. This includes without -//* limitation any warranty or condition with respect to merchantability or -//* fitness for any particular purpose, or against the infringements of -//* intellectual property rights of others. -//*---------------------------------------------------------------------------- -//* File Name : main.c -//* Object : main application written in C -//* Creation : FB 21/11/2002 -//* -//*---------------------------------------------------------------------------- -#include "at91rm9200.h" -#include "lib_AT91RM9200.h" -#include "mci_device.h" -#include "lib.h" -#include "sd-card.h" - -#define AT91C_MCI_TIMEOUT 1000000 /* For AT91F_MCIDeviceWaitReady */ -#define SD_BLOCK_SIZE 512 - -//* Global Variables -static AT91S_MciDevice MCI_Device; - -/****************************************************************************** -**Error return codes -******************************************************************************/ -#define MCI_UNSUPP_SIZE_ERROR 5 -#define MCI_UNSUPP_OFFSET_ERROR 6 - -//*---------------------------------------------------------------------------- -//* \fn MCIDeviceWaitReady -//* \brief Wait for MCI Device ready -//*---------------------------------------------------------------------------- -static unsigned int -MCIDeviceWaitReady(unsigned int timeout) -{ - volatile unsigned int status; - int waitfor; - - if (MCI_Device.state == AT91C_MCI_RX_SINGLE_BLOCK) - waitfor = AT91C_MCI_RXBUFF; - else - waitfor = AT91C_MCI_NOTBUSY; - do - { - status = AT91C_BASE_MCI->MCI_SR; - timeout--; - } - while( !(status & waitfor) && (timeout>0) ); - - status = AT91C_BASE_MCI->MCI_SR; - - // If End of Tx Buffer Empty interrupt occurred - if (MCI_Device.state == AT91C_MCI_TX_SINGLE_BLOCK && status & AT91C_MCI_TXBUFE) { - AT91C_BASE_MCI->MCI_IDR = AT91C_MCI_TXBUFE; - AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_TXTDIS; - MCI_Device.state = AT91C_MCI_IDLE; - } // End of if AT91C_MCI_TXBUFF - - // If End of Rx Buffer Full interrupt occurred - if (MCI_Device.state == AT91C_MCI_RX_SINGLE_BLOCK && status & AT91C_MCI_RXBUFF) { - AT91C_BASE_MCI->MCI_IDR = AT91C_MCI_RXBUFF; - AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_RXTDIS; - MCI_Device.state = AT91C_MCI_IDLE; - } // End of if AT91C_MCI_RXBUFF - - //printf("WaitReady returning status %x\n", status); - - return status; -} - -static inline unsigned int -swap(unsigned int v) -{ - unsigned int t1; - - __asm __volatile("eor %1, %0, %0, ror #16\n" - "bic %1, %1, #0x00ff0000\n" - "mov %0, %0, ror #8\n" - "eor %0, %0, %1, lsr #8\n" - : "+r" (v), "=r" (t1)); - - return (v); -} - -inline static unsigned int -wait_ready() -{ - int status; - int timeout = AT91C_MCI_TIMEOUT; - - // wait for CMDRDY Status flag to read the response - do - { - status = AT91C_BASE_MCI->MCI_SR; - } while( !(status & AT91C_MCI_CMDRDY) && (--timeout > 0) ); - - return status; -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_SendCommand -//* \brief Generic function to send a command to the MMC or SDCard -//*---------------------------------------------------------------------------- -static int -MCI_SendCommand( - unsigned int Cmd, - unsigned int Arg) -{ - unsigned int error; - unsigned int errorMask = AT91C_MCI_SR_ERROR; - unsigned int opcode = Cmd & 0x3F; - - //printf("SendCmd %d (%x) arg %x\n", opcode, Cmd, Arg); - - // Don't check response CRC on ACMD41 (R3 response type). - - if (opcode == 41) - errorMask &= ~AT91C_MCI_RCRCE; - - AT91C_BASE_MCI->MCI_ARGR = Arg; - AT91C_BASE_MCI->MCI_CMDR = Cmd; - - error = wait_ready(); - - if ((error & errorMask) != 0) { - return (1); - } - return 0; -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_GetStatus -//* \brief Addressed card sends its status register -//*---------------------------------------------------------------------------- -static unsigned int -MCI_GetStatus() -{ - if (MCI_SendCommand(SEND_STATUS_CMD, MCI_Device.RCA << 16)) - return 0; - return (AT91C_BASE_MCI->MCI_RSPR[0]); - -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_ReadBlock -//* \brief Start the read for a single 512-byte block -//*---------------------------------------------------------------------------- -static int -MCI_StartReadBlock(unsigned blknum, void *dataBuffer) -{ - // Init Mode Register - AT91C_BASE_MCI->MCI_MR |= ((SD_BLOCK_SIZE << 16) | AT91C_MCI_PDCMODE); - - // (PDC) Receiver Transfer Enable - AT91C_BASE_PDC_MCI->PDC_PTCR = (AT91C_PDC_TXTDIS | AT91C_PDC_RXTDIS); - AT91C_BASE_PDC_MCI->PDC_RPR = (unsigned int)dataBuffer; - AT91C_BASE_PDC_MCI->PDC_RCR = SD_BLOCK_SIZE / 4;; - AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_RXTEN; - - // SDHC wants block offset, non-HC wants byte offset. - if (!MCI_Device.IsSDHC) - blknum *= SD_BLOCK_SIZE; - - // Send the Read single block command - if (MCI_SendCommand(READ_SINGLE_BLOCK_CMD, blknum)) { - return AT91C_READ_ERROR; - } - MCI_Device.state = AT91C_MCI_RX_SINGLE_BLOCK; - - return 0; -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_readblocks -//* \brief Read one or more blocks -//*---------------------------------------------------------------------------- -int -MCI_readblocks(char* dest, unsigned blknum, unsigned blkcount) -{ - unsigned int status; - unsigned int *walker; - - if (MCI_Device.state != AT91C_MCI_IDLE) { - return 1; - } - - if ((MCI_GetStatus() & AT91C_SR_READY_FOR_DATA) == 0) { - return 1; - } - - // As long as there is data to read - while (blkcount) - { - //Do the reading - if (MCI_StartReadBlock(blknum, dest)) - return -1; - - // Wait MCI Device Ready - status = MCIDeviceWaitReady(AT91C_MCI_TIMEOUT); - if (status & AT91C_MCI_SR_ERROR) - return 1; - - // Fix erratum in MCI part - endian-swap all data. - for (walker = (unsigned int *)dest; - walker < (unsigned int *)(dest + SD_BLOCK_SIZE); walker++) - *walker = swap(*walker); - - // Update counters & pointers - ++blknum; - --blkcount; - dest += SD_BLOCK_SIZE; - } - - - return 0; -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_read -//* \brief Legacy read function, takes byte offset and length but was always -//* used to read full blocks; interface preserved for existing boot code. -//*---------------------------------------------------------------------------- -int -MCI_read(char* dest, unsigned byteoffset, unsigned length) -{ - return MCI_readblocks(dest, - byteoffset/SD_BLOCK_SIZE, length/SD_BLOCK_SIZE); -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_SDCard_SendAppCommand -//* \brief Specific function to send a specific command to the SDCard -//*---------------------------------------------------------------------------- -static int -MCI_SDCard_SendAppCommand( - unsigned int Cmd_App, - unsigned int Arg) -{ - int status; - - if ((status = MCI_SendCommand(APP_CMD, (MCI_Device.RCA << 16))) == 0) - status = MCI_SendCommand(Cmd_App,Arg); - return status; -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_GetCSD -//* \brief Asks to the specified card to send its CSD -//*---------------------------------------------------------------------------- -static int -MCI_GetCSD(unsigned int rca, unsigned int *response) -{ - if (MCI_SendCommand(SEND_CSD_CMD, (rca << 16))) - return 1; - - response[0] = AT91C_BASE_MCI->MCI_RSPR[0]; - response[1] = AT91C_BASE_MCI->MCI_RSPR[1]; - response[2] = AT91C_BASE_MCI->MCI_RSPR[2]; - response[3] = AT91C_BASE_MCI->MCI_RSPR[3]; - - return 0; -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_SDCard_GetOCR -//* \brief Wait for card to power up and determine whether it's SDHC or not. -//*---------------------------------------------------------------------------- -static int -MCI_SDCard_GetOCR() -{ - unsigned int response; - unsigned int arg = AT91C_MMC_HOST_VOLTAGE_RANGE; - int timeout = AT91C_MCI_TIMEOUT; - - // Force card to idle state. - - MCI_SendCommand(GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); - - // Begin probe for SDHC by sending CMD8; only v2.0 cards respond to it. - // - // Arg is vvpp where vv is voltage range and pp is an arbitrary bit - // pattern that gets echoed back in the response. The only voltage - // ranges defined are: - // 0x01 = 2.7 - 3.6 - // 0x02 = "reserved for low voltage" whatever that means. - // - // If the card fails to respond then it's not v2.0. If it responds by - // echoing back exactly the arg we sent, then it's a v2.0 card and can - // run at our voltage. That means that when we send the ACMD41 (in - // MCI_SDCard_GetOCR) we can include the HCS bit to inquire about SDHC. - - if (MCI_SendCommand(SD_SEND_IF_COND_CMD, 0x01AA) == 0) { - MCI_Device.IsSDv2 = (AT91C_BASE_MCI->MCI_RSPR[0] == 0x01AA); - } - - // If we've determined the card supports v2.0 functionality, set the - // HCS/CCS bit to indicate that we support SDHC. This will cause a - // v2.0 card to report whether it is SDHC in the ACMD41 response. - - if (MCI_Device.IsSDv2) { - arg |= AT91C_CCS; - } - - // The RCA to be used for CMD55 in Idle state shall be the card's - // default RCA=0x0000. - - MCI_Device.RCA = 0x0; - - // Repeat ACMD41 until the card comes out of power-up-busy state. - - do { - if (MCI_SDCard_SendAppCommand(SDCARD_APP_OP_COND_CMD, arg)) { - return 1; - } - response = AT91C_BASE_MCI->MCI_RSPR[0]; - } while (!(response & AT91C_CARD_POWER_UP_DONE) && (--timeout > 0)); - - // A v2.0 card sets CCS (card capacity status) in the response if it's SDHC. - - if (MCI_Device.IsSDv2) { - MCI_Device.IsSDHC = ((response & AT91C_CCS) == AT91C_CCS); - } - - return (0); -} - -//*---------------------------------------------------------------------------- -//* \fn MCI_SDCard_GetCID -//* \brief Asks to the SDCard on the chosen slot to send its CID -//*---------------------------------------------------------------------------- -static int -MCI_SDCard_GetCID(unsigned int *response) -{ - if (MCI_SendCommand(ALL_SEND_CID_CMD, AT91C_NO_ARGUMENT)) - return 1; - - response[0] = AT91C_BASE_MCI->MCI_RSPR[0]; - response[1] = AT91C_BASE_MCI->MCI_RSPR[1]; - response[2] = AT91C_BASE_MCI->MCI_RSPR[2]; - response[3] = AT91C_BASE_MCI->MCI_RSPR[3]; - - return 0; -} - -//*---------------------------------------------------------------------------- -//* \fn sdcard_4wire -//* \brief Set bus width to 1-bit or 4-bit according to the parm. -//* -//* Unlike most functions in this file, the return value from this one is -//* bool-ish; returns 0 on failure, 1 on success. -//*---------------------------------------------------------------------------- -int -sdcard_use4wire(int use4wire) -{ - volatile int ret_value; - - do { - ret_value=MCI_GetStatus(); - } - while((ret_value > 0) && ((ret_value & AT91C_SR_READY_FOR_DATA) == 0)); - - // If going to 4-wire mode, ask the card to turn off the DAT3 card detect - // pullup resistor, if going to 1-wire ask it to turn it back on. - - ret_value = MCI_SDCard_SendAppCommand(SDCARD_SET_CLR_CARD_DETECT_CMD, - use4wire ? 0 : 1); - if (ret_value != AT91C_CMD_SEND_OK) - return 0; - - // Ask the card to go into the requested mode. - - ret_value = MCI_SDCard_SendAppCommand(SDCARD_SET_BUS_WIDTH_CMD, - use4wire ? AT91C_BUS_WIDTH_4BITS : - AT91C_BUS_WIDTH_1BIT); - if (ret_value != AT91C_CMD_SEND_OK) - return 0; - - // Set the MCI device to match the mode we set in the card. - - if (use4wire) { - MCI_Device.SDCard_bus_width = AT91C_BUS_WIDTH_4BITS; - AT91C_BASE_MCI->MCI_SDCR |= AT91C_MCI_SCDBUS; - } else { - MCI_Device.SDCard_bus_width = AT91C_BUS_WIDTH_1BIT; - AT91C_BASE_MCI->MCI_SDCR &= ~AT91C_MCI_SCDBUS; - } - - return 1; -} - -//*---------------------------------------------------------------------------- -//* \fn sdcard_init -//* \brief get the mci device ready to read from an SD or SDHC card. -//* -//* Unlike most functions in this file, the return value from this one is -//* bool-ish; returns 0 on failure, 1 on success. -//*---------------------------------------------------------------------------- -int -sdcard_init(void) -{ - unsigned int tab_response[4]; - int i; - - // Init MCI for MMC and SDCard interface - AT91F_MCI_CfgPIO(); - AT91F_MCI_CfgPMC(); - AT91F_PDC_Open(AT91C_BASE_PDC_MCI); - - // Init Device Structure - MCI_Device.state = AT91C_MCI_IDLE; - MCI_Device.SDCard_bus_width = 0; - MCI_Device.IsSDv2 = 0; - MCI_Device.IsSDHC = 0; - - // Reset the MCI and set the bus speed. - // Using MCK/230 gives a legal (under 400khz) bus speed for the card id - // sequence for all reasonable master clock speeds. - - AT91C_BASE_MCI->MCI_CR = AT91C_MCI_MCIDIS | 0x80; - AT91C_BASE_MCI->MCI_IDR = 0xFFFFFFFF; - AT91C_BASE_MCI->MCI_DTOR = AT91C_MCI_DTOR_1MEGA_CYCLES; - AT91C_BASE_MCI->MCI_MR = AT91C_MCI_PDCMODE | 114; /* clkdiv 114 = MCK/230 */ - AT91C_BASE_MCI->MCI_SDCR = AT91C_MCI_MMC_SLOTA; - AT91C_BASE_MCI->MCI_CR = AT91C_MCI_MCIEN|AT91C_MCI_PWSEN; - - // Wait for the card to come out of power-up-busy state by repeatedly - // sending ACMD41. This also probes for SDHC versus standard cards. - - for (i = 0; i < 100; i++) { - if (MCI_SDCard_GetOCR() == 0) - break; - if ((i & 0x01) == 0) { - printf("."); - } - } - if (i >= 100) - return 0; - - if (MCI_SDCard_GetCID(tab_response)) - return 0; - - // Tell the card to set its address, and remember the result. - - if (MCI_SendCommand(SET_RELATIVE_ADDR_CMD, 0)) - return 0; - MCI_Device.RCA = (AT91C_BASE_MCI->MCI_RSPR[0] >> 16); - - // After sending CMD3 (set addr) we can increase the clock to full speed. - // Using MCK/4 gives a legal (under 25mhz) bus speed for all reasonable - // master clock speeds. - - AT91C_BASE_MCI->MCI_MR = AT91C_MCI_PDCMODE | 1; /* clkdiv 1 = MCK/4 */ - - if (MCI_GetCSD(MCI_Device.RCA,tab_response)) - return 0; - MCI_Device.READ_BL_LEN = (tab_response[1] >> CSD_1_RD_B_LEN_S) & - CSD_1_RD_B_LEN_M; - -#ifdef REPORT_SIZE - { - unsigned int mult,blocknr; - // compute MULT - mult = 1 << ( ((tab_response[2] >> CSD_2_C_SIZE_M_S) & - CSD_2_C_SIZE_M_M) + 2 ); - // compute MSB of C_SIZE - blocknr = ((tab_response[1] >> CSD_1_CSIZE_H_S) & - CSD_1_CSIZE_H_M) << 2; - // compute MULT * (LSB of C-SIZE + MSB already computed + 1) = BLOCKNR - blocknr = mult * ((blocknr + ((tab_response[2] >> CSD_2_CSIZE_L_S) & - CSD_2_CSIZE_L_M)) + 1); - MCI_Device.Memory_Capacity = (1 << MCI_Device.READ_BL_LEN) * blocknr; - printf("Found SD card %u bytes\n", MCI_Device.Memory_Capacity); - } -#endif - - // Select card and set block length for following transfers. - - if (MCI_SendCommand(SEL_DESEL_CARD_CMD, (MCI_Device.RCA)<<16)) - return 0; - if (MCI_SendCommand(SET_BLOCKLEN_CMD, SD_BLOCK_SIZE)) - return 0; - - return 1; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/sd-card.h b/usr/src/boot/sys/boot/arm/at91/libat91/sd-card.h deleted file mode 100644 index 378ad01789..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/sd-card.h +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provide by Kwikbyte who specifically - * disclaimed copyright on the code. - * - * $FreeBSD$ - */ - -#ifndef __SD_CARD_H -#define __SD_CARD_H - -/* MCI_read() is the original read function, taking a byte offset and byte - * count. It is preserved to support existing customized boot code that still - * refers to it; it will work fine even on SDHC cards as long as the kernel and - * the metadata for locating it all exist within the first 4GB of the card. - * - * MCI_readblocks() is the new read function, taking offset and length in terms - * of block counts (where the SD spec defines a block as 512 bytes), allowing - * the kernel and filesystem metadata to be located anywhere on an SDHC card. - * - * Returns 0 on success, non-zero on failure. - */ - -int MCI_read (char* dest, unsigned bytenum, unsigned length); -int MCI_readblocks (char* dest, unsigned blknum, unsigned blkcount); - -/* sdcard_init() - get things set up to read from an SD or SDHC card. - * - * Returns 0 on failure, non-zero on success. - */ - -int sdcard_init(void); - -/* By default sdcard_init() sets things up for a 1-wire interface to the - * SD card. Calling sdcard_4wire(true) after sdcard_init() allows customized - * boot code to change to 4-bit transfers when the hardware supports it. - * - * Returns 0 on failure, non-zero on success. - */ -int sdcard_use4wire(int use4wire); - -#endif - diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/spi_flash.c b/usr/src/boot/sys/boot/arm/at91/libat91/spi_flash.c deleted file mode 100644 index 388e64e202..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/spi_flash.c +++ /dev/null @@ -1,267 +0,0 @@ -/****************************************************************************** - * - * Filename: spi_flash.c - * - * Instantiation of SPI flash control routines supporting AT45DB161B - * - * Revision information: - * - * 17JAN2005 kb_admin initial creation - * adapted from external sources - * tested for basic operation only!!! - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -#include "at91rm9200.h" -#include "spi_flash.h" -#include "lib.h" - -/*********************** PRIVATE FUNCTIONS/DATA ******************************/ - - -static spiCommand_t spi_command; -static char tx_commandBuffer[8], rx_commandBuffer[8]; - -/* - * .KB_C_FN_DEFINITION_START - * void SendCommand(spiCommand_t *pCommand) - * Private function sends 8-bit value to the device and returns the 8-bit - * value in response. - * .KB_C_FN_DEFINITION_END - */ -static void -SendCommand(spiCommand_t *pCommand) -{ - AT91PS_SPI pSPI = AT91C_BASE_SPI; - - pSPI->SPI_PTCR = AT91C_PDC_TXTDIS | AT91C_PDC_RXTDIS; - - pSPI->SPI_RPR = (unsigned)pCommand->rx_cmd; - pSPI->SPI_RCR = pCommand->rx_cmd_size; - pSPI->SPI_TPR = (unsigned)pCommand->tx_cmd; - pSPI->SPI_TCR = pCommand->tx_cmd_size; - - pSPI->SPI_TNPR = (unsigned)pCommand->tx_data; - pSPI->SPI_TNCR = pCommand->tx_data_size; - pSPI->SPI_RNPR = (unsigned)pCommand->rx_data; - pSPI->SPI_RNCR = pCommand->rx_data_size; - - pSPI->SPI_PTCR = AT91C_PDC_TXTEN | AT91C_PDC_RXTEN; - - // wait for completion - while (!(pSPI->SPI_SR & AT91C_SPI_SPENDRX)) - Delay(700); -} - - -/* - * .KB_C_FN_DEFINITION_START - * char GetFlashStatus(void) - * Private function to return device status. - * .KB_C_FN_DEFINITION_END - */ -static char -GetFlashStatus(void) -{ - p_memset((char *)&spi_command, 0, sizeof(spi_command)); - p_memset(tx_commandBuffer, 0, 8); - tx_commandBuffer[0] = STATUS_REGISTER_READ; - p_memset(rx_commandBuffer, 0, 8); - spi_command.tx_cmd = tx_commandBuffer; - spi_command.rx_cmd = rx_commandBuffer; - spi_command.rx_cmd_size = 2; - spi_command.tx_cmd_size = 2; - SendCommand(&spi_command); - return (rx_commandBuffer[1]); -} - -/* - * .KB_C_FN_DEFINITION_START - * void WaitForDeviceReady(void) - * Private function to poll until the device is ready for next operation. - * .KB_C_FN_DEFINITION_END - */ -static void -WaitForDeviceReady(void) -{ - while (!(GetFlashStatus() & 0x80)) ; -} - -/*************************** GLOBAL FUNCTIONS ********************************/ - - -/* - * .KB_C_FN_DEFINITION_START - * void SPI_ReadFlash(unsigned flash_addr, unsigned dest_addr, unsigned size) - * Global function to read the SPI flash device using the continuous read - * array command. - * .KB_C_FN_DEFINITION_END - */ -void -SPI_ReadFlash(unsigned flash_addr, char *dest_addr, unsigned size) -{ - unsigned pageAddress, byteAddress; - - // determine page address - pageAddress = flash_addr / FLASH_PAGE_SIZE; - - // determine byte address - byteAddress = flash_addr % FLASH_PAGE_SIZE; - - p_memset(tx_commandBuffer, 0, 8); -#ifdef BOOT_BWCT - tx_commandBuffer[0] = 0xd2; - tx_commandBuffer[1] = ((pageAddress >> 6) & 0xFF); - tx_commandBuffer[2] = ((pageAddress << 2) & 0xFC) | - ((byteAddress >> 8) & 0x3); - tx_commandBuffer[3] = byteAddress & 0xFF; - spi_command.tx_cmd = tx_commandBuffer; - spi_command.tx_cmd_size = 8; - spi_command.tx_data_size = size; - spi_command.tx_data = dest_addr; - - p_memset(rx_commandBuffer, 0, 8); - spi_command.rx_cmd = rx_commandBuffer; - spi_command.rx_cmd_size = 8; - spi_command.rx_data_size = size; - spi_command.rx_data = dest_addr; -#else - tx_commandBuffer[0] = CONTINUOUS_ARRAY_READ_HF; - tx_commandBuffer[1] = ((pageAddress >> 5) & 0xFF); - tx_commandBuffer[2] = ((pageAddress << 3) & 0xF8) | - ((byteAddress >> 8) & 0x7); - tx_commandBuffer[3] = byteAddress & 0xFF; - spi_command.tx_cmd = tx_commandBuffer; - spi_command.tx_cmd_size = 5; - spi_command.tx_data_size = size; - spi_command.tx_data = dest_addr; - - p_memset(rx_commandBuffer, 0, 8); - spi_command.rx_cmd = rx_commandBuffer; - spi_command.rx_cmd_size = 5; - spi_command.rx_data_size = size; - spi_command.rx_data = dest_addr; -#endif - - SendCommand(&spi_command); -} - - -/* - * .KB_C_FN_DEFINITION_START - * void SPI_WriteFlash(unsigned flash_addr, unsigned src_addr, unsigned size) - * Global function to program the SPI flash device. Notice the warning - * provided in lower-level functions regarding corruption of data in non- - * page aligned write operations. - * .KB_C_FN_DEFINITION_END - */ -void -SPI_WriteFlash(unsigned flash_addr, char *src_addr, unsigned size) -{ - unsigned pageAddress, byteAddress; - - // determine page address - pageAddress = flash_addr / FLASH_PAGE_SIZE; - - // determine byte address - byteAddress = flash_addr % FLASH_PAGE_SIZE; - - p_memset(tx_commandBuffer, 0, 8); -#ifdef BOOT_BWCT - tx_commandBuffer[0] = 0x82; - tx_commandBuffer[1] = ((pageAddress >> 6) & 0xFF); - tx_commandBuffer[2] = ((pageAddress << 2) & 0xFC) | - ((byteAddress >> 8) & 0x3); - tx_commandBuffer[3] = (byteAddress & 0xFF); -#else - tx_commandBuffer[0] = PROGRAM_THROUGH_BUFFER; - tx_commandBuffer[1] = ((pageAddress >> 5) & 0xFF); - tx_commandBuffer[2] = ((pageAddress << 3) & 0xF8) | - ((byteAddress >> 8) & 0x7); - tx_commandBuffer[3] = (byteAddress & 0xFF); -#endif - - p_memset(rx_commandBuffer, 0, 8); - - spi_command.tx_cmd = tx_commandBuffer; - spi_command.rx_cmd = rx_commandBuffer; - spi_command.rx_cmd_size = 4; - spi_command.tx_cmd_size = 4; - - spi_command.tx_data_size = size; - spi_command.tx_data = src_addr; - spi_command.rx_data_size = size; - spi_command.rx_data = src_addr; - - SendCommand(&spi_command); - - WaitForDeviceReady(); -} - -/* - * .KB_C_FN_DEFINITION_START - * void SPI_InitFlash(void) - * Global function to initialize the SPI flash device/accessor functions. - * .KB_C_FN_DEFINITION_END - */ -void -SPI_InitFlash(void) -{ - AT91PS_PIO pPio; - AT91PS_SPI pSPI = AT91C_BASE_SPI; - unsigned value; - - // enable CS0, CLK, MOSI, MISO - pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - pPio->PIO_ASR = AT91C_PIO_PA3 | AT91C_PIO_PA1 | AT91C_PIO_PA0 | - AT91C_PIO_PA2; - pPio->PIO_PDR = AT91C_PIO_PA3 | AT91C_PIO_PA1 | AT91C_PIO_PA0 | - AT91C_PIO_PA2; - - // enable clocks to SPI - AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_SPI; - - // reset the SPI - pSPI->SPI_CR = AT91C_SPI_SWRST; - - pSPI->SPI_MR = (0xf << 24) | AT91C_SPI_MSTR | AT91C_SPI_MODFDIS | - (0xE << 16); - - pSPI->SPI_CSR[0] = AT91C_SPI_CPOL | (4 << 16) | (2 << 8); - pSPI->SPI_CR = AT91C_SPI_SPIEN; - - pSPI->SPI_PTCR = AT91C_PDC_TXTDIS; - pSPI->SPI_PTCR = AT91C_PDC_RXTDIS; - pSPI->SPI_RNPR = 0; - pSPI->SPI_RNCR = 0; - pSPI->SPI_TNPR = 0; - pSPI->SPI_TNCR = 0; - pSPI->SPI_RPR = 0; - pSPI->SPI_RCR = 0; - pSPI->SPI_TPR = 0; - pSPI->SPI_TCR = 0; - pSPI->SPI_PTCR = AT91C_PDC_RXTEN; - pSPI->SPI_PTCR = AT91C_PDC_TXTEN; - - value = pSPI->SPI_RDR; - value = pSPI->SPI_SR; - - value = GetFlashStatus() & 0xFC; -#ifdef BOOT_BWCT - if (value != 0xB4 && value != 0xAC) - printf(" Bad SPI status: 0x%x\n", value); -#else - if (value != 0xBC) - printf(" Bad SPI status: 0x%x\n", value); -#endif -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/spi_flash.h b/usr/src/boot/sys/boot/arm/at91/libat91/spi_flash.h deleted file mode 100644 index 90247e1577..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/spi_flash.h +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * - * Filename: spi_flash.h - * - * Definition of flash control routines supporting AT45DB161B - * - * Revision information: - * - * 17JAN2005 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - ******************************************************************************/ - -#ifndef _SPI_FLASH_H_ -#define _SPI_FLASH_H_ - -typedef struct { - char *tx_cmd; - unsigned tx_cmd_size; - char *rx_cmd; - unsigned rx_cmd_size; - char *tx_data; - unsigned tx_data_size; - char *rx_data; - unsigned rx_data_size; -} spiCommand_t; - -void SPI_ReadFlash(unsigned flash_addr, char *dest_addr, unsigned size); -void SPI_WriteFlash(unsigned flash_addr, char *dest_addr, unsigned size); -void SPI_InitFlash(void); - -void SPI_GetId(unsigned *id); - -#ifdef BOOT_BWCT -#define FLASH_PAGE_SIZE 528 -#else -#define FLASH_PAGE_SIZE 1056 -#endif - -// Flash commands - -#define CONTINUOUS_ARRAY_READ 0xE8 -#define CONTINUOUS_ARRAY_READ_HF 0x0B -#define CONTINUOUS_ARRAY_READ_LF 0x03 -#define STATUS_REGISTER_READ 0xD7 -#define PROGRAM_THROUGH_BUFFER 0x82 -#define MANUFACTURER_ID 0x9F - -#endif diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/strcmp.c b/usr/src/boot/sys/boot/arm/at91/libat91/strcmp.c deleted file mode 100644 index de1d9e0c1e..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/strcmp.c +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "lib.h" - -int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/strcpy.c b/usr/src/boot/sys/boot/arm/at91/libat91/strcpy.c deleted file mode 100644 index 0bdd3a596d..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/strcpy.c +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "lib.h" - -char * -strcpy(char *to, const char *from) -{ - while (*from) - *to++ = *from++; - *to++ = '\0'; - return (to); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/strcvt.c b/usr/src/boot/sys/boot/arm/at91/libat91/strcvt.c deleted file mode 100644 index 64442cc91b..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/strcvt.c +++ /dev/null @@ -1,132 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/****************************************************************************** - * - * Filename: p_string.c - * - * Instantiation of basic string operations to prevent inclusion of full - * string library. These are simple implementations not necessarily optimized - * for speed, but rather to show intent. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin minor updates - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - *****************************************************************************/ - -#include "lib.h" - -/* - * .KB_C_FN_DEFINITION_START - * int p_IsWhiteSpace(char) - * This global function returns true if the character is not considered - * a non-space character. - * .KB_C_FN_DEFINITION_END - */ -int -p_IsWhiteSpace(char cValue) -{ - return ((cValue == ' ') || - (cValue == '\t') || - (cValue == 0) || - (cValue == '\r') || - (cValue == '\n')); -} - - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_HexCharValue(char) - * This global function returns the decimal value of the validated hex char. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_HexCharValue(char cValue) -{ - if (cValue < ('9' + 1)) - return (cValue - '0'); - if (cValue < ('F' + 1)) - return (cValue - 'A' + 10); - return (cValue - 'a' + 10); -} - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_ASCIIToHex(char *) - * This global function set the unsigned value equal to the converted - * hex number passed as a string. No error checking is performed; the - * string must be valid hex value, point at the start of string, and be - * NULL-terminated. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_ASCIIToHex(const char *buf) -{ - unsigned lValue = 0; - - if ((*buf == '0') && ((buf[1] == 'x') || (buf[1] == 'X'))) - buf += 2; - - while (*buf) { - lValue <<= 4; - lValue += p_HexCharValue(*buf++); - } - return (lValue); -} - - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_ASCIIToDec(char *) - * This global function set the unsigned value equal to the converted - * decimal number passed as a string. No error checking is performed; the - * string must be valid decimal value, point at the start of string, and be - * NULL-terminated. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_ASCIIToDec(const char *buf) -{ - unsigned v = 0; - - while (*buf) { - v *= 10; - v += (*buf++) - '0'; - } - return (v); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/strlen.c b/usr/src/boot/sys/boot/arm/at91/libat91/strlen.c deleted file mode 100644 index 35de89262a..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/strlen.c +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/****************************************************************************** - * - * Filename: p_string.c - * - * Instantiation of basic string operations to prevent inclusion of full - * string library. These are simple implementations not necessarily optimized - * for speed, but rather to show intent. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin minor updates - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - *****************************************************************************/ - -#include "lib.h" - -/* - * .KB_C_FN_DEFINITION_START - * int p_strlen(char *) - * This global function returns the number of bytes starting at the pointer - * before (not including) the string termination character ('/0'). - * .KB_C_FN_DEFINITION_END - */ -int -p_strlen(const char *buffer) -{ - const char *ptr = buffer; - while (*ptr++) - continue; - return (ptr - buffer - 1); -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/tag_list.c b/usr/src/boot/sys/boot/arm/at91/libat91/tag_list.c deleted file mode 100644 index c6a9bba823..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/tag_list.c +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** - * - * Filename: tag_list.c - * - * Instantiation of basic routines that create linux-boot tag list. - * - * Revision information: - * - * 22AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - *****************************************************************************/ - -/******************************* GLOBALS *************************************/ - -/********************** PRIVATE FUNCTIONS/DATA/DEFINES ***********************/ - -#define u32 unsigned -#define u16 unsigned short -#define u8 unsigned char - -// #include "/usr/src/arm/linux/include/asm/setup.h" -#include <linux/asm/setup.h> -#include "tag_list.h" - -#define PAGE_SIZE 0x1000 -#define MEM_SIZE 0x2000000 -#define PHYS_OFFSET 0x20000000 - -/*************************** GLOBAL FUNCTIONS ********************************/ - -/* - * .KB_C_FN_DEFINITION_START - * void InitTagList(char*, void *) - * This global function populates a linux-boot style tag list from the - * string passed in the pointer at the location specified. - * .KB_C_FN_DEFINITION_END - */ -void InitTagList(char *parms, void *output) { - - char *src, *dst; - struct tag *tagList = (struct tag*)output; - - tagList->hdr.size = tag_size(tag_core); - tagList->hdr.tag = ATAG_CORE; - tagList->u.core.flags = 1; - tagList->u.core.pagesize = PAGE_SIZE; - tagList->u.core.rootdev = 0xff; - tagList = tag_next(tagList); - - tagList->hdr.size = tag_size(tag_mem32); - tagList->hdr.tag = ATAG_MEM; - tagList->u.mem.size = MEM_SIZE; - tagList->u.mem.start = PHYS_OFFSET; - tagList = tag_next(tagList); - - tagList->hdr.size = tag_size(tag_cmdline); - tagList->hdr.tag = ATAG_CMDLINE; - - src = parms; - dst = tagList->u.cmdline.cmdline; - while (*src) { - *dst++ = *src++; - } - *dst = 0; - - tagList->hdr.size += ((unsigned)(src - parms) + 1) / sizeof(unsigned); - tagList = tag_next(tagList); - - tagList->hdr.size = 0; - tagList->hdr.tag = ATAG_NONE; -} diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/tag_list.h b/usr/src/boot/sys/boot/arm/at91/libat91/tag_list.h deleted file mode 100644 index f98016510d..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/tag_list.h +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * - * Filename: tag_list.h - * - * Definition of basic routines that create linux-boot tag list. - * - * Revision information: - * - * 22AUG2004 kb_admin initial creation - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - ****************************************************************************/ - -#ifndef _TAG_LIST_H_ -#define _TAG_LIST_H_ - -extern void InitTagList(char *parms, void*); - -#endif /* _TAG_LIST_H_ */ diff --git a/usr/src/boot/sys/boot/arm/at91/libat91/xmodem.c b/usr/src/boot/sys/boot/arm/at91/libat91/xmodem.c deleted file mode 100644 index 0c4b1387dc..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/libat91/xmodem.c +++ /dev/null @@ -1,128 +0,0 @@ -/*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software is derived from software provide by Kwikbyte who specifically - * disclaimed copyright on the code. This version of xmodem has been nearly - * completely rewritten, but the CRC is from the original. - * - * $FreeBSD$ - */ - -#include "lib.h" - -#define PACKET_SIZE 128 - -/* Line control codes */ -#define SOH 0x01 /* start of header */ -#define ACK 0x06 /* Acknowledge */ -#define NAK 0x15 /* Negative acknowledge */ -#define CAN 0x18 /* Cancel */ -#define EOT 0x04 /* end of text */ - -#define TO 10 -/* - * int GetRecord(char , char *) - * This private function receives a x-modem record to the pointer and - * returns non-zero on success. - */ -static int -GetRecord(char blocknum, char *dest) -{ - int size; - int ch; - unsigned chk, j; - - chk = 0; - - if ((ch = getc(TO)) == -1) - goto err; - if (ch != blocknum) - goto err; - if ((ch = getc(TO)) == -1) - goto err; - if (ch != (~blocknum & 0xff)) - goto err; - - for (size = 0; size < PACKET_SIZE; ++size) { - if ((ch = getc(TO)) == -1) - goto err; - chk = chk ^ ch << 8; - for (j = 0; j < 8; ++j) { - if (chk & 0x8000) - chk = chk << 1 ^ 0x1021; - else - chk = chk << 1; - } - *dest++ = ch; - } - - chk &= 0xFFFF; - - if (((ch = getc(TO)) == -1) || ((ch & 0xff) != ((chk >> 8) & 0xFF))) - goto err; - if (((ch = getc(TO)) == -1) || ((ch & 0xff) != (chk & 0xFF))) - goto err; - putchar(ACK); - - return (1); -err:; - putchar(CAN); - // We should allow for resend, but we don't. - return (0); -} - -/* - * int xmodem_rx(char *) - * This global function receives a x-modem transmission consisting of - * (potentially) several blocks. Returns the number of bytes received or - * -1 on error. - */ -int -xmodem_rx(char *dest) -{ - int starting, ch; - char packetNumber, *startAddress = dest; - - packetNumber = 1; - starting = 1; - - while (1) { - if (starting) - putchar('C'); - if (((ch = getc(1)) == -1) || (ch != SOH && ch != EOT)) - continue; - if (ch == EOT) { - putchar(ACK); - return (dest - startAddress); - } - starting = 0; - // Xmodem packets: SOH PKT# ~PKT# 128-bytes CRC16 - if (!GetRecord(packetNumber, dest)) - return (-1); - dest += PACKET_SIZE; - packetNumber++; - } - - // the loop above should return in all cases - return (-1); -} diff --git a/usr/src/boot/sys/boot/arm/at91/linker.cfg b/usr/src/boot/sys/boot/arm/at91/linker.cfg deleted file mode 100644 index 2065ed7193..0000000000 --- a/usr/src/boot/sys/boot/arm/at91/linker.cfg +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * - * Filename: linker.cfg - * - * linker config file used for internal RAM or eeprom images at address 0. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin move data to SDRAM - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD$ - ******************************************************************************/ -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", - "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(start) -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = 0; - .text : - { - *(.text) - } - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - .data : - { - __data_start = . ; - *(.data) - } - _edata = .; - PROVIDE (edata = .); - __bss_start = .; - __bss_start__ = .; - .bss : - { - *(.bss) - . = ALIGN(32 / 8); - } - . = ALIGN(32 / 8); - _end = .; - _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; - PROVIDE (end = .); -} diff --git a/usr/src/boot/sys/boot/arm/ixp425/Makefile.inc b/usr/src/boot/sys/boot/arm/ixp425/Makefile.inc deleted file mode 100644 index 031b7afa61..0000000000 --- a/usr/src/boot/sys/boot/arm/ixp425/Makefile.inc +++ /dev/null @@ -1,42 +0,0 @@ -# $FreeBSD$ - -.if !target(__ixp425_boot_Makefile.inc__) -.PATH: ${.CURDIR}/../../../../libkern ${.CURDIR}/../../../../libkern/arm - -__ixp425_boot_Makefile.inc__: - -# Both Avila and Pronghorn Metro are supported by ixp425 -BOOT_FLAVOR=ixp425 - -CFLAGS+=-Os -ffreestanding \ - -I${.CURDIR}/../../../.. \ - -I${.CURDIR}/../../../../arm \ - -DCPU_XSCALE_IXP425 \ - -Wall -Waggregate-return \ - -Werror \ - -Wnested-externs \ - -Wpointer-arith -Wshadow -Wwrite-strings \ - -Wmissing-prototypes \ - -Wmissing-declarations - -# -Wstrict-prototypes - -CFLAGS+=-DBOOT_${BOOT_FLAVOR:tu} - -LD ?= ld -OBJCOPY ?= objcopy - -.if defined(P) -${P}: ${OBJS} - ${LD} ${LDFLAGS} -o ${.TARGET} ${OBJS} - -CLEANFILES+= ${P} -.endif - -.if defined(WITH_TAG_LIST) -MK_TAG_LIST:=yes -.else -MK_TAG_LIST:=no -.endif - -.endif diff --git a/usr/src/boot/sys/boot/arm/ixp425/boot2/Makefile b/usr/src/boot/sys/boot/arm/ixp425/boot2/Makefile deleted file mode 100644 index fe1068faef..0000000000 --- a/usr/src/boot/sys/boot/arm/ixp425/boot2/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> - -# We get a lot of the std lib functions from here. -.PATH: ${.CURDIR}/../../at91/libat91 - -# Enable to get debug msgs -#DEBUG=yes - -# Hack to search through the kernel for ufs:ad0s1a and replace it with -# the correct one for the active slice/partition. -FIXUP_BOOT_DRV=yes - -P=boot2 -FILES=${P} -SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c -SRCS+=memchr.c memcmp.c memcpy.c memmem.c memset.c printf.c strcmp.c strcpy.c -SRCS+=strlen.c ashldi3.c divsi3.S muldi3.c -SRCS+=aeabi_unwind.c -MAN= - -KERNPHYSADDR=0x180000 -KERNVIRTADDR=${KERNPHYSADDR} -BOOT_STACK=0x200000-4 -M=${MACHINE} -LDFLAGS=-e ${KERNPHYSADDR} -EB -T ldscript.${M} -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -S=${.CURDIR}/../../../.. - -CFLAGS+= \ - -DBOOT_STACK=${BOOT_STACK} \ - -I${.CURDIR}/../../../common \ - -I${.CURDIR} - -.if defined(FIXUP_BOOT_DRV) -CFLAGS+=-DFIXUP_BOOT_DRV -.endif -.if defined(DEBUG) -CFLAGS+=-DDEBUG -.endif - -ldscript.$M: $S/conf/ldscript.$M - cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \ - sed s/KERNVIRTADDR/${KERNVIRTADDR}/g | \ - sed s/" + SIZEOF_HEADERS"// > ldscript.$M - -${P}: ldscript.$M - -CLEANFILES+=ldscript.$M - -memchr.c: $S/../lib/libc/string/memchr.c - sed -e 's/string\.h/lib.h/' < $S/../lib/libc/string/memchr.c > \ - ${.TARGET} - -memmem.c: $S/../lib/libc/string/memmem.c - sed -e 's/string\.h/lib.h/' < $S/../lib/libc/string/memmem.c > \ - ${.TARGET} - -CLEANFILES+=memchr.c memmem.c - -ashldi3.o: $S/libkern/ashldi3.c - ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC} - -divsi3.o: $S/libkern/${M}/divsi3.S - ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC} - -muldi3.o: $S/libkern/${M}/muldi3.c - ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC} - -inflate.c: $S/kern/inflate.c - sed -e 's/extern void putstr (char/extern void putstr (const char/' < \ - $S/kern/inflate.c > ${.TARGET} - -CLEANFILES+=inflate.c - -.include <bsd.prog.mk> - diff --git a/usr/src/boot/sys/boot/arm/ixp425/boot2/arm_init.S b/usr/src/boot/sys/boot/arm/ixp425/boot2/arm_init.S deleted file mode 100644 index 15e1e6c87e..0000000000 --- a/usr/src/boot/sys/boot/arm/ixp425/boot2/arm_init.S +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * Copyright (c) 2008 John Hay. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <machine/asm.h> - -ASENTRY_NP(start) -/* Initialise bss and sp */ - nop - adr r1, .Lstart - ldmia r1, {r1, r2, sp} /* Set initial stack and */ - sub r2, r2, r1 /* get zero init data */ - mov r3, #0 -.L1: - str r3, [r1], #0x0004 /* get zero init data */ - subs r2, r2, #4 - bgt .L1 - - .extern main - bl main -/* main should not return. If it does, spin forever */ -infiniteLoop: - b infiniteLoop -END(start) - -.Lstart: - .word _edata - .word _end - .word BOOT_STACK - -ENTRY(cpu_id) - mrc p15, 0, r0, c0, c0, 0 - RET -END(cpu_id) - -/* End */ diff --git a/usr/src/boot/sys/boot/arm/ixp425/boot2/boot2.c b/usr/src/boot/sys/boot/arm/ixp425/boot2/boot2.c deleted file mode 100644 index 93c4fe1aff..0000000000 --- a/usr/src/boot/sys/boot/arm/ixp425/boot2/boot2.c +++ /dev/null @@ -1,446 +0,0 @@ -/*- - * Copyright (c) 2008 John Hay - * Copyright (c) 1998 Robert Nordier - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/disklabel.h> -#include <sys/diskmbr.h> -#include <sys/dirent.h> -#include <sys/reboot.h> - -#include <machine/elf.h> - -#include <stdarg.h> - -#include "lib.h" -#include "paths.h" -#include "rbx.h" - -extern uint32_t _end; - -#define NOPT 6 - -static const char optstr[NOPT] = "agnrsv"; -static const unsigned char flags[NOPT] = { - RBX_ASKNAME, - RBX_GDB, - RBX_NOINTR, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE -}; - -static unsigned dsk_start; -static char cmd[512]; -static char kname[1024]; -static uint32_t opts; -static uint8_t dsk_meta; -static int bootslice; -static int bootpart; -static int disk_layout; -#define DL_UNKNOWN 0 -#define DL_RAW 1 /* Dangerously dedicated */ -#define DL_SLICE 2 /* Use only slices (DOS partitions) */ -#define DL_SLICEPART 3 /* Use slices and partitions */ - -static void load(void); -static int parse(void); -static int dskread(void *, unsigned, unsigned); -static int drvread(void *, unsigned, unsigned); -#ifdef FIXUP_BOOT_DRV -static void fixup_boot_drv(caddr_t, int, int, int); -#endif - -#include "ufsread.c" - -#ifdef DEBUG -#define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__) -#else -#define DPRINTF(fmt, ...) -#endif - -static inline int -xfsread(ufs_ino_t inode, void *buf, size_t nbyte) -{ - if ((size_t)fsread(inode, buf, nbyte) != nbyte) - return -1; - return 0; -} - -static inline void -getstr(int c) -{ - char *s; - - s = cmd; - if (c == 0) - c = getc(10000); - for (;;) { - switch (c) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - xputchar(c); - } - c = getc(10000); - } -} - -int -main(void) -{ - const char *bt; - int autoboot, c = 0; - ufs_ino_t ino; - - dmadat = (void *)(0x1c0000); - p_memset((char *)dmadat, 0, 32 * 1024); - bt = board_init(); - - printf("FreeBSD ARM (%s) boot2 v%d.%d\n", bt, 0, 4); - - autoboot = 1; - - /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); - - if (*cmd) { - if (parse()) - autoboot = 0; - printf("%s: %s\n", PATH_CONFIG, cmd); - /* Do not process this command twice */ - *cmd = 0; - } - - if (*kname == '\0') - strcpy(kname, PATH_KERNEL); - - /* Present the user with the boot2 prompt. */ - for (;;) { - printf("\nDefault: %s\nboot: ", kname); - if (!autoboot || - (OPT_CHECK(RBX_NOINTR) == 0 && (c = getc(2)) != 0)) - getstr(c); - xputchar('\n'); - autoboot = 0; - c = 0; - DPRINTF("cmd is '%s'\n", cmd); - if (parse()) - xputchar('\a'); - else - load(); - } -} - -static void -load(void) -{ - Elf32_Ehdr eh; - static Elf32_Phdr ep[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr; - int i, j; -#ifdef FIXUP_BOOT_DRV - caddr_t staddr; - int klen; - - staddr = (caddr_t)0xffffffff; - klen = 0; -#endif - if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); - return; - } - DPRINTF("Found %s\n", kname); - if (xfsread(ino, &eh, sizeof(eh))) - return; - if (!IS_ELF(eh)) { - printf("Invalid %s\n", "format"); - return; - } - fs_off = eh.e_phoff; - for (j = i = 0; i < eh.e_phnum && j < 2; i++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) - return; - if (ep[j].p_type == PT_LOAD) - j++; - } - for (i = 0; i < 2; i++) { - p = (caddr_t)(ep[i].p_paddr & 0x0fffffff); - fs_off = ep[i].p_offset; -#ifdef FIXUP_BOOT_DRV - if (staddr == (caddr_t)0xffffffff) - staddr = p; - klen += ep[i].p_filesz; -#endif - if (xfsread(ino, p, ep[i].p_filesz)) - return; - } - addr = eh.e_entry & 0x0fffffff; - DPRINTF("Entry point %x for %s\n", addr, kname); - clr_board(); -#ifdef FIXUP_BOOT_DRV - fixup_boot_drv(staddr, klen, bootslice, bootpart); -#endif - ((void(*)(int))addr)(RB_BOOTINFO /* XXX | (opts & RBX_MASK) */); -} - -static int -parse() -{ - char *arg = cmd; - char *ep, *p; - int c, i; - - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return -1; - opts ^= OPT_SET(flags[i]); - } - } else { - arg--; - /* look for ad0s1a:... | ad0s1:... */ - if (strlen(arg) > 6 && arg[0] == 'a' && - arg[1] == 'd' && arg[3] == 's' && - (arg[5] == ':' || arg[6] == ':')) { - /* XXX Should also handle disk. */ - bootslice = arg[4] - '0'; - if (bootslice < 1 || bootslice > 4) - return (-1); - bootpart = 0; - if (arg[5] != ':') - bootpart = arg[5] - 'a'; - if (bootpart < 0 || bootpart > 7) - return (-1); - dsk_meta = 0; - if (arg[5] == ':') - arg += 6; - else - arg += 7; - /* look for ad0a:... */ - } else if (strlen(arg) > 4 && arg[0] == 'a' && - arg[1] == 'd' && arg[2] == '0' && arg[4] == ':') { - bootslice = 0; - bootpart = arg[3] - 'a'; - if (bootpart < 0 || bootpart > 7) - return (-1); - dsk_meta = 0; - arg += 5; - } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } - } - arg = p; - } - return 0; -} - -/* - * dskread() will try to handle the disk layouts that are typically - * encountered. - * - raw or "Dangerously Dedicated" mode. No real slice table, just the - * default one that is included with bsdlabel -B. Typically this is - * used with ROOTDEVNAME=\"ufs:ad0a\". - * - slice only. Only a slice table is installed with no bsd label or - * bsd partition table. This is typically used with - * ROOTDEVNAME=\"ufs:ad0s1\". - * - slice + bsd label + partition table. This is typically done with - * with fdisk + bsdlabel and is used with ROOTDEVNAME=\"ufs:ad0s1a\". - */ -static int -dskread(void *buf, unsigned lba, unsigned nblk) -{ - struct dos_partition *dp; - struct disklabel *d; - char *sec; - int i; - - if (!dsk_meta) { - sec = dmadat->secbuf; - dsk_start = 0; - if (drvread(sec, DOSBBSECTOR, 1)) - return -1; - dp = (void *)(sec + DOSPARTOFF); - if (bootslice != 0) { - i = bootslice - 1; - if (dp[i].dp_typ != DOSPTYP_386BSD) - return -1; - } else { - for (i = 0; i < NDOSPART; i++) { - if ((dp[i].dp_typ == DOSPTYP_386BSD) && - (dp[i].dp_flag == 0x80)) - break; - } - } - if (i != NDOSPART) { - bootslice = i + 1; - DPRINTF("Found an active fbsd slice. (%d)\n", i + 1); - /* - * Although dp_start is aligned within the disk - * partition structure, DOSPARTOFF is 446, which - * is only word (2) aligned, not longword (4) - * aligned. Cope by using memcpy to fetch the - * start of this partition. - */ - memcpy(&dsk_start, &dp[i].dp_start, 4); - dsk_start = swap32(dsk_start); - DPRINTF("dsk_start %x\n", dsk_start); - if ((bootslice == 4) && (dsk_start == 0)) { - disk_layout = DL_RAW; - bootslice = 0; - } - } - if (drvread(sec, dsk_start + LABELSECTOR, 1)) - return -1; - d = (void *)(sec + LABELOFFSET); - if ((d->d_magic == DISKMAGIC && d->d_magic2 == DISKMAGIC) || - (swap32(d->d_magic) == DISKMAGIC && - swap32(d->d_magic2) == DISKMAGIC)) { - DPRINTF("p_size = %x\n", - !d->d_partitions[bootpart].p_size); - if (!d->d_partitions[bootpart].p_size) { - printf("Invalid partition\n"); - return -1; - } - DPRINTF("p_offset %x, RAW %x\n", - swap32(d->d_partitions[bootpart].p_offset), - swap32(d->d_partitions[RAW_PART].p_offset)); - dsk_start += swap32(d->d_partitions[bootpart].p_offset); - dsk_start -= swap32(d->d_partitions[RAW_PART].p_offset); - if ((disk_layout == DL_UNKNOWN) && (bootslice == 0)) - disk_layout = DL_RAW; - else if (disk_layout == DL_UNKNOWN) - disk_layout = DL_SLICEPART; - } else { - disk_layout = DL_SLICE; - DPRINTF("Invalid %s\n", "label"); - } - DPRINTF("bootslice %d, bootpart %d, dsk_start %u\n", bootslice, - bootpart, dsk_start); - dsk_meta++; - } - return drvread(buf, dsk_start + lba, nblk); -} - -static int -drvread(void *buf, unsigned lba, unsigned nblk) -{ - static unsigned c = 0x2d5c7c2f; - - printf("%c\b", c = c << 8 | c >> 24); - return (avila_read((char *)buf, lba, nblk)); -} - -#ifdef FIXUP_BOOT_DRV -/* - * fixup_boot_drv() will try to find the ROOTDEVNAME spec in the kernel - * and change it to what was specified on the comandline or /boot.conf - * file or to what was encountered on the disk. It will try to handle 3 - * different disk layouts, raw (dangerously dedicated), slice only and - * slice + partition. It will look for the following strings in the - * kernel, but if it is one of the first three, the string in the kernel - * must use the correct form to match the actual disk layout: - * - ufs:ad0a - * - ufs:ad0s1 - * - ufs:ad0s1a - * - ufs:ROOTDEVNAME - * In the case of the first three strings, only the "a" at the end and - * the "1" after the "s" will be modified, if they exist. The string - * length will not be changed. In the case of the last string, the - * whole string will be built up and nul, '\0' terminated. - */ -static void -fixup_boot_drv(caddr_t addr, int klen, int bs, int bp) -{ - const u_int8_t op[] = "ufs:ROOTDEVNAME"; - const u_int8_t op2[] = "ufs:ad0"; - u_int8_t *p, *ps; - - DPRINTF("fixup_boot_drv: 0x%x, %d, slice %d, partition %d\n", - (int)addr, klen, bs, bp); - if (bs > 4) - return; - if (bp > 7) - return; - ps = memmem(addr, klen, op, sizeof(op)); - if (ps != NULL) { - p = ps + 4; /* past ufs: */ - DPRINTF("Found it at 0x%x\n", (int)ps); - p[0] = 'a'; p[1] = 'd'; p[2] = '0'; /* ad0 */ - p += 3; - if (bs > 0) { - /* append slice */ - *p++ = 's'; - *p++ = bs + '0'; - } - if (disk_layout != DL_SLICE) { - /* append partition */ - *p++ = bp + 'a'; - } - *p = '\0'; - } else { - ps = memmem(addr, klen, op2, sizeof(op2) - 1); - if (ps != NULL) { - p = ps + sizeof(op2) - 1; - DPRINTF("Found it at 0x%x\n", (int)ps); - if (*p == 's') { - /* fix slice */ - p++; - *p++ = bs + '0'; - } - if (*p == 'a') - *p = bp + 'a'; - } - } - if (ps == NULL) { - printf("Could not locate \"%s\" to fix kernel boot device, " - "check ROOTDEVNAME is set\n", op); - return; - } - DPRINTF("Changed boot device to %s\n", ps); -} -#endif diff --git a/usr/src/boot/sys/boot/arm/ixp425/boot2/cf_ata.h b/usr/src/boot/sys/boot/arm/ixp425/boot2/cf_ata.h deleted file mode 100644 index 3c9e9e5fac..0000000000 --- a/usr/src/boot/sys/boot/arm/ixp425/boot2/cf_ata.h +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * Copyright (c) 2008 John Hay. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef ARM_BOOT_CF_ATA_H -#define ARM_BOOT_CF_ATA_H - -#define CF_DATA 0x00 -#define CF_ERROR 0x01 -#define CF_FEATURE 0x01 -#define CF_SECT_CNT 0x02 -#define CF_SECT_NUM 0x03 -#define CF_CYL_L 0x04 -#define CF_CYL_H 0x05 -#define CF_DRV_HEAD 0x06 -#define CF_D_MASTER 0x00 -#define CF_D_LBA 0x40 -#define CF_D_IBM 0xa0 -#define CF_STATUS 0x07 -#define CF_S_ERROR 0x01 -#define CF_S_INDEX 0x02 -#define CF_S_CORR 0x04 -#define CF_S_DRQ 0x08 -#define CF_S_DSC 0x10 -#define CF_S_DWF 0x20 -#define CF_S_READY 0x40 -#define CF_S_BUSY 0x80 -#define CF_COMMAND 0x07 - -/* This is according to the appnote, but Sam use 0x1e in avila_ata.c */ -#define CF_ALT_STATUS 0x16 -#define CF_ALT_DEV_CTR 0x16 -#define CF_ALT_DEV_CTR2 0x1e -#define CF_A_IDS 0x02 -#define CF_A_RESET 0x04 -#define CF_A_4BIT 0x08 - -#define AVILA_IDE_GPIN 12 - -#endif /* !ARM_BOOT_CF_ATA_H */ diff --git a/usr/src/boot/sys/boot/arm/ixp425/boot2/ixp425_board.c b/usr/src/boot/sys/boot/arm/ixp425/boot2/ixp425_board.c deleted file mode 100644 index c13f8ed526..0000000000 --- a/usr/src/boot/sys/boot/arm/ixp425/boot2/ixp425_board.c +++ /dev/null @@ -1,771 +0,0 @@ -/*- - * Copyright (c) 2008 John Hay. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); -#include <sys/param.h> -#include <sys/ata.h> -#include <sys/linker_set.h> - -#include <stdarg.h> - -#include "lib.h" -#include "cf_ata.h" - -#include <machine/armreg.h> -#include <arm/xscale/ixp425/ixp425reg.h> -#include <dev/ic/ns16550.h> - -struct board_config { - const char *desc; - int (*probe)(int boardtype_hint); - void (*init)(void); -}; -/* set of registered boards */ -SET_DECLARE(boards, struct board_config); -#define BOARD_CONFIG(name, _desc) \ -static struct board_config name##config = { \ - .desc = _desc, \ - .probe = name##_probe, \ - .init = name##_init, \ -}; \ -DATA_SET(boards, name##config) - -static u_int cputype; -#define cpu_is_ixp43x() (cputype == CPU_ID_IXP435) -static u_int8_t *ubase; - -static u_int8_t uart_getreg(u_int8_t *, int); -static void uart_setreg(u_int8_t *, int, u_int8_t); - -static void cf_init(void); -static void cf_clr(void); - -#ifdef DEBUG -#define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__) -#else -#define DPRINTF(fmt, ...) -#endif - -const char * -board_init(void) -{ - struct board_config **pbp; - - cputype = cpu_id() & CPU_ID_CPU_MASK; - - SET_FOREACH(pbp, boards) - /* XXX pass down redboot board type */ - if ((*pbp)->probe(0)) { - (*pbp)->init(); - return (*pbp)->desc; - } - /* XXX panic, unknown board type */ - return "???"; -} - -/* - * This should be called just before starting the kernel. This is so - * that one can undo incompatible hardware settings. - */ -void -clr_board(void) -{ - cf_clr(); -} - -/* - * General support functions. - */ - -/* - * DELAY should delay for the number of microseconds. - * The idea is that the inner loop should take 1us, so val is the - * number of usecs to delay. - */ -void -DELAY(int val) -{ - volatile int sub; - volatile int subsub; - - sub = val; - while(sub) { - subsub = 3; - while(subsub) - subsub--; - sub--; - } -} - -u_int32_t -swap32(u_int32_t a) -{ - return (((a & 0xff) << 24) | ((a & 0xff00) << 8) | - ((a & 0xff0000) >> 8) | ((a & 0xff000000) >> 24)); -} - -u_int16_t -swap16(u_int16_t val) -{ - return (val << 8) | (val >> 8); -} - -/* - * uart related funcs - */ -static u_int8_t -uart_getreg(u_int8_t *bas, int off) -{ - return *((volatile u_int32_t *)(bas + (off << 2))) & 0xff; -} - -static void -uart_setreg(u_int8_t *bas, int off, u_int8_t val) -{ - *((volatile u_int32_t *)(bas + (off << 2))) = (u_int32_t)val; -} - -int -getc(int seconds) -{ - int c, delay, limit; - - c = 0; - delay = 10000; - limit = seconds * 1000000/10000; - while ((uart_getreg(ubase, REG_LSR) & LSR_RXRDY) == 0 && --limit) - DELAY(delay); - - if ((uart_getreg(ubase, REG_LSR) & LSR_RXRDY) == LSR_RXRDY) - c = uart_getreg(ubase, REG_DATA); - - return c; -} - -void -putchar(int ch) -{ - int delay, limit; - - delay = 500; - limit = 20; - while ((uart_getreg(ubase, REG_LSR) & LSR_THRE) == 0 && --limit) - DELAY(delay); - uart_setreg(ubase, REG_DATA, ch); - - limit = 40; - while ((uart_getreg(ubase, REG_LSR) & LSR_TEMT) == 0 && --limit) - DELAY(delay); -} - -void -xputchar(int ch) -{ - if (ch == '\n') - putchar('\r'); - putchar(ch); -} - -void -putstr(const char *str) -{ - while(*str) - xputchar(*str++); -} - -void -puthex8(u_int8_t ch) -{ - const char *hex = "0123456789abcdef"; - - putchar(hex[ch >> 4]); - putchar(hex[ch & 0xf]); -} - -void -puthexlist(const u_int8_t *str, int length) -{ - while(length) { - puthex8(*str); - putchar(' '); - str++; - length--; - } -} - -/* - * - * CF/IDE functions. - * - */ - -struct { - u_int64_t dsize; - u_int64_t total_secs; - u_int8_t heads; - u_int8_t sectors; - u_int32_t cylinders; - - u_int32_t *cs1to; - u_int32_t *cs2to; - - u_int8_t *cs1; - u_int8_t *cs2; - - u_int32_t use_lba; - u_int32_t use_stream8; - u_int32_t debug; - - u_int8_t status; - u_int8_t error; -} dskinf; - -static void cfenable16(void); -static void cfdisable16(void); -static u_int8_t cfread8(u_int32_t off); -static u_int16_t cfread16(u_int32_t off); -static void cfreadstream8(void *buf, int length); -static void cfreadstream16(void *buf, int length); -static void cfwrite8(u_int32_t off, u_int8_t val); -static u_int8_t cfaltread8(u_int32_t off); -static void cfaltwrite8(u_int32_t off, u_int8_t val); -static int cfwait(u_int8_t mask); -static int cfaltwait(u_int8_t mask); -static int cfcmd(u_int32_t cmd, u_int32_t cylinder, u_int32_t head, - u_int32_t sector, u_int32_t count, u_int32_t feature); -static void cfreset(void); -#ifdef DEBUG -static int cfgetparams(void); -#endif -static void cfprintregs(void); - -static void -cf_init(void) -{ - u_int8_t status; -#ifdef DEBUG - int rval; -#endif - - /* NB: board init routines setup other parts of dskinf */ - dskinf.use_stream8 = 0; - dskinf.use_lba = 0; - dskinf.debug = 1; - - DPRINTF("cs1 %x, cs2 %x\n", dskinf.cs1, dskinf.cs2); - - /* Setup the CF window */ - *dskinf.cs1to |= (EXP_BYTE_EN | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN); - DPRINTF("t1 %x, ", *dskinf.cs1to); - - *dskinf.cs2to |= (EXP_BYTE_EN | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN); - DPRINTF("t2 %x\n", *dskinf.cs2to); - - /* Detect if there is a disk. */ - cfwrite8(CF_DRV_HEAD, CF_D_IBM); - DELAY(1000); - status = cfread8(CF_STATUS); - if (status != 0x50) - printf("cf-ata0 %x\n", (u_int32_t)status); - if (status == 0xff) { - printf("cf_ata0: No disk!\n"); - return; - } - - cfreset(); - - if (dskinf.use_stream8) { - DPRINTF("setting %d bit mode.\n", 8); - cfwrite8(CF_FEATURE, 0x01); /* Enable 8 bit transfers */ - cfwrite8(CF_COMMAND, ATA_SETFEATURES); - cfaltwait(CF_S_READY); - } - -#ifdef DEBUG - rval = cfgetparams(); - if (rval) - return; -#endif - dskinf.use_lba = 1; - dskinf.debug = 0; -} - -static void -cf_clr(void) -{ - cfwrite8(CF_DRV_HEAD, CF_D_IBM); - cfaltwait(CF_S_READY); - cfwrite8(CF_FEATURE, 0x81); /* Enable 8 bit transfers */ - cfwrite8(CF_COMMAND, ATA_SETFEATURES); - cfaltwait(CF_S_READY); -} - -static void -cfenable16(void) -{ - u_int32_t val; - - val = *dskinf.cs1to; - *dskinf.cs1to = val &~ EXP_BYTE_EN; - DELAY(100); -#if 0 - DPRINTF("%s: cs1 timing reg %x\n", *dskinf.cs1to, __func__); -#endif -} - -static void -cfdisable16(void) -{ - u_int32_t val; - - DELAY(100); - val = *dskinf.cs1to; - *dskinf.cs1to = val | EXP_BYTE_EN; -#if 0 - DPRINTF("%s: cs1 timing reg %x\n", *dskinf.cs1to, __func__); -#endif -} - -static u_int8_t -cfread8(u_int32_t off) -{ - volatile u_int8_t *vp; - - vp = (volatile u_int8_t *)(dskinf.cs1 + off); - return *vp; -} - -static void -cfreadstream8(void *buf, int length) -{ - u_int8_t *lbuf; - u_int8_t tmp; - - lbuf = buf; - while (length) { - tmp = cfread8(CF_DATA); - *lbuf = tmp; -#ifdef DEBUG - if (dskinf.debug && (length > (512 - 32))) { - if ((length % 16) == 0) - xputchar('\n'); - puthex8(tmp); - putchar(' '); - } -#endif - lbuf++; - length--; - } -#ifdef DEBUG - if (dskinf.debug) - xputchar('\n'); -#endif -} - -static u_int16_t -cfread16(u_int32_t off) -{ - volatile u_int16_t *vp; - - vp = (volatile u_int16_t *)(dskinf.cs1 + off); - return swap16(*vp); -} - -static void -cfreadstream16(void *buf, int length) -{ - u_int16_t *lbuf; - - length = length / 2; - cfenable16(); - lbuf = buf; - while (length--) { - *lbuf = cfread16(CF_DATA); - lbuf++; - } - cfdisable16(); -} - -static void -cfwrite8(u_int32_t off, u_int8_t val) -{ - volatile u_int8_t *vp; - - vp = (volatile u_int8_t *)(dskinf.cs1 + off); - *vp = val; -} - -#if 0 -static void -cfwrite16(u_int32_t off, u_int16_t val) -{ - volatile u_int16_t *vp; - - vp = (volatile u_int16_t *)(dskinf.cs1 + off); - *vp = val; -} -#endif - -static u_int8_t -cfaltread8(u_int32_t off) -{ - volatile u_int8_t *vp; - - off &= 0x0f; - vp = (volatile u_int8_t *)(dskinf.cs2 + off); - return *vp; -} - -static void -cfaltwrite8(u_int32_t off, u_int8_t val) -{ - volatile u_int8_t *vp; - - /* - * This is documented in the Intel appnote 302456. - */ - off &= 0x0f; - vp = (volatile u_int8_t *)(dskinf.cs2 + off); - *vp = val; -} - -static int -cfwait(u_int8_t mask) -{ - u_int8_t status; - u_int32_t tout; - - tout = 0; - while (tout <= 5000000) { - status = cfread8(CF_STATUS); - if (status == 0xff) { - printf("%s: master: no status, reselecting\n", - __func__); - cfwrite8(CF_DRV_HEAD, CF_D_IBM); - DELAY(1); - status = cfread8(CF_STATUS); - } - if (status == 0xff) - return -1; - dskinf.status = status; - if (!(status & CF_S_BUSY)) { - if (status & CF_S_ERROR) { - dskinf.error = cfread8(CF_ERROR); - printf("%s: error, status 0x%x error 0x%x\n", - __func__, status, dskinf.error); - } - if ((status & mask) == mask) { - DPRINTF("%s: status 0x%x mask 0x%x tout %u\n", - __func__, status, mask, tout); - return (status & CF_S_ERROR); - } - } - if (tout > 1000) { - tout += 1000; - DELAY(1000); - } else { - tout += 10; - DELAY(10); - } - } - return -1; -} - -static int -cfaltwait(u_int8_t mask) -{ - u_int8_t status; - u_int32_t tout; - - tout = 0; - while (tout <= 5000000) { - status = cfaltread8(CF_ALT_STATUS); - if (status == 0xff) { - printf("cfaltwait: master: no status, reselecting\n"); - cfwrite8(CF_DRV_HEAD, CF_D_IBM); - DELAY(1); - status = cfread8(CF_STATUS); - } - if (status == 0xff) - return -1; - dskinf.status = status; - if (!(status & CF_S_BUSY)) { - if (status & CF_S_ERROR) - dskinf.error = cfread8(CF_ERROR); - if ((status & mask) == mask) { - DPRINTF("cfaltwait: tout %u\n", tout); - return (status & CF_S_ERROR); - } - } - if (tout > 1000) { - tout += 1000; - DELAY(1000); - } else { - tout += 10; - DELAY(10); - } - } - return -1; -} - -static int -cfcmd(u_int32_t cmd, u_int32_t cylinder, u_int32_t head, u_int32_t sector, - u_int32_t count, u_int32_t feature) -{ - if (cfwait(0) < 0) { - printf("cfcmd: timeout\n"); - return -1; - } - cfwrite8(CF_FEATURE, feature); - cfwrite8(CF_CYL_L, cylinder); - cfwrite8(CF_CYL_H, cylinder >> 8); - if (dskinf.use_lba) - cfwrite8(CF_DRV_HEAD, CF_D_IBM | CF_D_LBA | head); - else - cfwrite8(CF_DRV_HEAD, CF_D_IBM | head); - cfwrite8(CF_SECT_NUM, sector); - cfwrite8(CF_SECT_CNT, count); - cfwrite8(CF_COMMAND, cmd); - return 0; -} - -static void -cfreset(void) -{ - u_int8_t status; - u_int32_t tout; - - cfwrite8(CF_DRV_HEAD, CF_D_IBM); - DELAY(1); -#ifdef DEBUG - cfprintregs(); -#endif - cfread8(CF_STATUS); - cfaltwrite8(CF_ALT_DEV_CTR, CF_A_IDS | CF_A_RESET); - DELAY(10000); - cfaltwrite8(CF_ALT_DEV_CTR, CF_A_IDS); - DELAY(10000); - cfread8(CF_ERROR); - DELAY(3000); - - for (tout = 0; tout < 310000; tout++) { - cfwrite8(CF_DRV_HEAD, CF_D_IBM); - DELAY(1); - status = cfread8(CF_STATUS); - if (!(status & CF_S_BUSY)) - break; - DELAY(100); - } - DELAY(1); - if (status & CF_S_BUSY) { - cfprintregs(); - printf("cfreset: Status stayed busy after reset.\n"); - } - DPRINTF("cfreset: finished, tout %u\n", tout); -} - -#ifdef DEBUG -static int -cfgetparams(void) -{ - u_int8_t *buf; - - buf = (u_int8_t *)(0x170000); - p_memset((char *)buf, 0, 1024); - /* Select the drive. */ - cfwrite8(CF_DRV_HEAD, CF_D_IBM); - DELAY(1); - cfcmd(ATA_ATA_IDENTIFY, 0, 0, 0, 0, 0); - if (cfaltwait(CF_S_READY | CF_S_DSC | CF_S_DRQ)) { - printf("cfgetparams: ATA_IDENTIFY failed.\n"); - return -1; - } - if (dskinf.use_stream8) - cfreadstream8(buf, 512); - else - cfreadstream16(buf, 512); - if (dskinf.debug) - cfprintregs(); -#if 0 - memcpy(&dskinf.ata_params, buf, sizeof(struct ata_params)); - dskinf.cylinders = dskinf.ata_params.cylinders; - dskinf.heads = dskinf.ata_params.heads; - dskinf.sectors = dskinf.ata_params.sectors; - printf("dsk0: sec %x, hd %x, cyl %x, stat %x, err %x\n", - (u_int32_t)dskinf.ata_params.sectors, - (u_int32_t)dskinf.ata_params.heads, - (u_int32_t)dskinf.ata_params.cylinders, - (u_int32_t)dskinf.status, - (u_int32_t)dskinf.error); -#endif - dskinf.status = cfread8(CF_STATUS); - if (dskinf.debug) - printf("cfgetparams: ata_params * %x, stat %x\n", - (u_int32_t)buf, (u_int32_t)dskinf.status); - return 0; -} -#endif /* DEBUG */ - -static void -cfprintregs(void) -{ - u_int8_t rv; - - putstr("cfprintregs: regs error "); - rv = cfread8(CF_ERROR); - puthex8(rv); - putstr(", count "); - rv = cfread8(CF_SECT_CNT); - puthex8(rv); - putstr(", sect "); - rv = cfread8(CF_SECT_NUM); - puthex8(rv); - putstr(", cyl low "); - rv = cfread8(CF_CYL_L); - puthex8(rv); - putstr(", cyl high "); - rv = cfread8(CF_CYL_H); - puthex8(rv); - putstr(", drv head "); - rv = cfread8(CF_DRV_HEAD); - puthex8(rv); - putstr(", status "); - rv = cfread8(CF_STATUS); - puthex8(rv); - putstr("\n"); -} - -int -avila_read(char *dest, unsigned source, unsigned length) -{ - if (dskinf.use_lba == 0 && source == 0) - source++; - if (dskinf.debug) - printf("avila_read: 0x%x, sect %d num secs %d\n", - (u_int32_t)dest, source, length); - while (length) { - cfwait(CF_S_READY); - /* cmd, cyl, head, sect, count, feature */ - cfcmd(ATA_READ, (source >> 8) & 0xffff, source >> 24, - source & 0xff, 1, 0); - - cfwait(CF_S_READY | CF_S_DRQ | CF_S_DSC); - if (dskinf.use_stream8) - cfreadstream8(dest, 512); - else - cfreadstream16(dest, 512); - length--; - source++; - dest += 512; - } - return 0; -} - -/* - * Gateworks Avila Support. - */ -static int -avila_probe(int boardtype_hint) -{ - volatile u_int32_t *cs; - /* - * Redboot only configure the chip selects that are needed, so - * use that to figure out if it is an Avila or ADI board. The - * Avila boards use CS2 and ADI does not. - */ - cs = (u_int32_t *)(IXP425_EXP_HWBASE + EXP_TIMING_CS2_OFFSET); - return (*cs != 0); -} - -static void -avila_init(void) -{ - /* Config the serial port. RedBoot should do the rest. */ - ubase = (u_int8_t *)(IXP425_UART0_HWBASE); - - dskinf.cs1to = (u_int32_t *)(IXP425_EXP_HWBASE + EXP_TIMING_CS1_OFFSET); - dskinf.cs2to = (u_int32_t *)(IXP425_EXP_HWBASE + EXP_TIMING_CS2_OFFSET); - dskinf.cs1 = (u_int8_t *)IXP425_EXP_BUS_CS1_HWBASE; - dskinf.cs2 = (u_int8_t *)IXP425_EXP_BUS_CS2_HWBASE; - - cf_init(); -} -BOARD_CONFIG(avila, "Gateworks Avila"); - -/* - * Gateworks Cambria Support. - */ -static int -cambria_probe(int boardtype_hint) -{ - return cpu_is_ixp43x(); -} - -static void -cambria_init(void) -{ - /* Config the serial port. RedBoot should do the rest. */ - ubase = (u_int8_t *)(IXP425_UART0_HWBASE); - - dskinf.cs1to = (u_int32_t *)(IXP425_EXP_HWBASE + EXP_TIMING_CS3_OFFSET); - dskinf.cs2to = (u_int32_t *)(IXP425_EXP_HWBASE + EXP_TIMING_CS4_OFFSET); - dskinf.cs1 = (u_int8_t *)CAMBRIA_CFSEL0_HWBASE; - dskinf.cs2 = (u_int8_t *)CAMBRIA_CFSEL1_HWBASE; - - cf_init(); -} -BOARD_CONFIG(cambria, "Gateworks Cambria"); - -/* - * Pronghorn Metro Support. - */ -static int -pronghorn_probe(int boardtype_hint) -{ - volatile u_int32_t *cs; - /* - * Redboot only configure the chip selects that are needed, so - * use that to figure out if it is an Avila or ADI board. The - * Avila boards use CS2 and ADI does not. - */ - cs = (u_int32_t *)(IXP425_EXP_HWBASE + EXP_TIMING_CS2_OFFSET); - return (*cs == 0); -} - -static void -pronghorn_init(void) -{ - /* Config the serial port. RedBoot should do the rest. */ - ubase = (u_int8_t *)(IXP425_UART1_HWBASE); - - dskinf.cs1to = (u_int32_t *)(IXP425_EXP_HWBASE + EXP_TIMING_CS3_OFFSET); - dskinf.cs2to = (u_int32_t *)(IXP425_EXP_HWBASE + EXP_TIMING_CS4_OFFSET); - dskinf.cs1 = (u_int8_t *)IXP425_EXP_BUS_CS3_HWBASE; - dskinf.cs2 = (u_int8_t *)IXP425_EXP_BUS_CS4_HWBASE; - - cf_init(); -} -BOARD_CONFIG(pronghorn, "Pronghorn Metro"); diff --git a/usr/src/boot/sys/boot/arm/ixp425/boot2/lib.h b/usr/src/boot/sys/boot/arm/ixp425/boot2/lib.h deleted file mode 100644 index 9c88030c25..0000000000 --- a/usr/src/boot/sys/boot/arm/ixp425/boot2/lib.h +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * Copyright (c) 2008 John Hay. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef ARM_BOOT_LIB_H -#define ARM_BOOT_LIB_H - -#include <sys/cdefs.h> -#include <sys/param.h> - -int main(void); - -void DELAY(int); - -int getc(int); -void putchar(int); -void xputchar(int); -void putstr(const char *); -void puthex8(u_int8_t); -void puthexlist(const u_int8_t *, int); -void printf(const char *fmt,...); - -void bzero(void *, size_t); -char *strcpy(char *to, const char *from); -int strcmp(const char *to, const char *from); -int p_strlen(const char *); -int p_memcmp(const char *, const char *, unsigned); -void *memchr(const void *, int, size_t); -void memcpy(void *to, const void *from, unsigned size); -void *memmem(const void *, size_t, const void *, size_t); -void p_memset(char *buffer, char value, int size); - -#define strlen p_strlen -#define memcmp p_memcmp -#define memset p_memset - -u_int16_t swap16(u_int16_t); -u_int32_t swap32(u_int32_t); - -const char *board_init(void); -void clr_board(void); -int avila_read(char*, unsigned, unsigned); -u_int cpu_id(void); - -#endif /* !ARM_BOOT_LIB_H */ diff --git a/usr/src/boot/sys/boot/arm/uboot/Makefile b/usr/src/boot/sys/boot/arm/uboot/Makefile deleted file mode 100644 index 8b4b8caea5..0000000000 --- a/usr/src/boot/sys/boot/arm/uboot/Makefile +++ /dev/null @@ -1,157 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> - -FILES= ubldr ubldr.bin - -NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} -BINDIR?= /boot -INSTALLFLAGS= -b -WARNS?= 1 -# Address at which ubldr will be loaded. -# This varies for different boards and SOCs. -UBLDR_LOADADDR?= 0x1000000 - -# Architecture-specific loader code -SRCS= start.S conf.c self_reloc.c vers.c - -.if !defined(LOADER_NO_DISK_SUPPORT) -LOADER_DISK_SUPPORT?= yes -.else -LOADER_DISK_SUPPORT= no -.endif -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -.if ${MK_NAND} != "no" -LOADER_NANDFS_SUPPORT?= yes -.else -LOADER_NANDFS_SUPPORT?= no -.endif -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no -.if ${MK_FDT} != "no" -LOADER_FDT_SUPPORT= yes -.else -LOADER_FDT_SUPPORT= no -.endif - -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -.if ${LOADER_EXT2FS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_NANDFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NANDFS_SUPPORT -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${.CURDIR}/../../fdt -CFLAGS+= -I${.OBJDIR}/../../fdt -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a -LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a -.endif - -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/arm -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - -# Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -CFLAGS+= -I. - -CLEANFILES+= vers.c loader.help - -CFLAGS+= -ffreestanding -msoft-float - -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} - -# Pull in common loader code -.PATH: ${.CURDIR}/../../uboot/common -.include "${.CURDIR}/../../uboot/common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../uboot/common - -# U-Boot standalone support library -LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a -CFLAGS+= -I${.CURDIR}/../../uboot/lib -CFLAGS+= -I${.OBJDIR}/../../uboot/lib - -# where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ - -# clang doesn't understand %D as a specifier to printf -NO_WERROR.clang= - -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand - -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - -loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} - -ldscript.abs: - echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} - -ldscript.pie: - echo "UBLDR_LOADADDR = 0;" >${.TARGET} - -ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} - ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ - -o ${.TARGET} ${OBJS} ${LDADD} - -ubldr.pie: ${OBJS} ldscript.pie ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} - ${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \ - -o ${.TARGET} ${OBJS} ${LDADD} - -ubldr.bin: ubldr.pie - ${OBJCOPY} -S -O binary ubldr.pie ${.TARGET} - -CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin - -.if !defined(LOADER_ONLY) -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" - -# Install loader.rc. -FILES+= loader.rc -# Put sample menu.rc on disk but don't enable it by default. -FILES+= menu.rc -FILESNAME_menu.rc= menu.rc.sample -.endif - -.include <bsd.prog.mk> diff --git a/usr/src/boot/sys/boot/arm/uboot/conf.c b/usr/src/boot/sys/boot/arm/uboot/conf.c deleted file mode 100644 index 03dc64125e..0000000000 --- a/usr/src/boot/sys/boot/arm/uboot/conf.c +++ /dev/null @@ -1,94 +0,0 @@ -/*- - * Copyright (c) 2008 Semihalf, Rafal Jaworowski - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include "bootstrap.h" -#include "libuboot.h" - -#if defined(LOADER_NET_SUPPORT) -#include "dev_net.h" -#endif - -struct devsw *devsw[] = { -#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) - &uboot_storage, -#endif -#if defined(LOADER_NET_SUPPORT) - &netdev, -#endif - NULL -}; - -struct fs_ops *file_system[] = { -#if defined(LOADER_UFS_SUPPORT) - &ufs_fsops, -#endif -#if defined(LOADER_CD9660_SUPPORT) - &cd9660_fsops, -#endif -#if defined(LOADER_EXT2FS_SUPPORT) - &ext2fs_fsops, -#endif -#if defined(LOADER_NANDFS_SUPPORT) - &nandfs_fsops, -#endif -#if defined(LOADER_NFS_SUPPORT) - &nfs_fsops, -#endif -#if defined(LOADER_TFTP_SUPPORT) - &tftp_fsops, -#endif -#if defined(LOADER_GZIP_SUPPORT) - &gzipfs_fsops, -#endif -#if defined(LOADER_BZIP2_SUPPORT) - &bzipfs_fsops, -#endif - NULL -}; - -struct netif_driver *netif_drivers[] = { -#if defined(LOADER_NET_SUPPORT) - &uboot_net, -#endif - NULL, -}; - -struct file_format *file_formats[] = { - &uboot_elf, - NULL -}; - -extern struct console uboot_console; - -struct console *consoles[] = { - &uboot_console, - NULL -}; diff --git a/usr/src/boot/sys/boot/arm/uboot/help.uboot b/usr/src/boot/sys/boot/arm/uboot/help.uboot deleted file mode 100644 index c1574af927..0000000000 --- a/usr/src/boot/sys/boot/arm/uboot/help.uboot +++ /dev/null @@ -1,27 +0,0 @@ -$FreeBSD$ - -############################################################################### -# Tubenv DShow or import U-Boot environment variables - - ubenv <import | show> [varname ...] - - Display U-Boot environment variables, or import them into the - loader environment (which makes them available in the kernel). - -############################################################################### -# Tubenv Simport DImport U-Boot env vars - - ubenv import [varname ...] - - If no variable names are specified, all U-Boot environment - variables are imported. Each variable is prefixed with "uboot." - to avoid any possible conflicts with loader or kernel variables. - -############################################################################### -# Tubenv Sshow DShow U-Boot env vars - - ubenv show [varname ...] - - If no variable names are specified, all U-Boot environment - variables are shown. - diff --git a/usr/src/boot/sys/boot/arm/uboot/ldscript.arm b/usr/src/boot/sys/boot/arm/uboot/ldscript.arm deleted file mode 100644 index 1eb10a8ee1..0000000000 --- a/usr/src/boot/sys/boot/arm/uboot/ldscript.arm +++ /dev/null @@ -1,133 +0,0 @@ -/* $FreeBSD$ */ - -OUTPUT_ARCH(arm) -ENTRY(_start) -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = UBLDR_LOADADDR + SIZEOF_HEADERS; - .text : - { - *(.text) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - } =0 - _etext = .; - PROVIDE (etext = .); - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rela.text : - { *(.rela.text) *(.rela.gnu.linkonce.t*) } - .rela.data : - { *(.rela.data) *(.rela.gnu.linkonce.d*) } - .rela.rodata : - { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } - .rela.got : { *(.rela.got) } - .rela.got1 : { *(.rela.got1) } - .rela.got2 : { *(.rela.got2) } - .rela.ctors : { *(.rela.ctors) } - .rela.dtors : { *(.rela.dtors) } - .rela.init : { *(.rela.init) } - .rela.fini : { *(.rela.fini) } - .rela.bss : { *(.rela.bss) } - .rela.plt : { *(.rela.plt) } - .rela.sdata : { *(.rela.sdata) } - .rela.sbss : { *(.rela.sbss) } - .rela.sdata2 : { *(.rela.sdata2) } - .rela.sbss2 : { *(.rela.sbss2) } - .init : { *(.init) } =0 - .fini : { *(.fini) } =0 - .rodata : { *(.rodata) *(.gnu.linkonce.r*) } - .rodata1 : { *(.rodata1) } - .sdata2 : { *(.sdata2) } - .sbss2 : { *(.sbss2) } - /* Adjust the address for the data segment to the next page up. */ - . = ((. + 0x1000) & ~(0x1000 - 1)); - .data : - { - *(.data) - *(.gnu.linkonce.d*) - CONSTRUCTORS - } - .data1 : { *(.data1) } - .got1 : { *(.got1) } - .dynamic : { *(.dynamic) } - /* Put .ctors and .dtors next to the .got2 section, so that the pointers - get relocated with -mrelocatable. Also put in the .fixup pointers. - The current compiler no longer needs this, but keep it around for 2.7.2 */ - PROVIDE (_GOT2_START_ = .); - .got2 : { *(.got2) } - PROVIDE (__CTOR_LIST__ = .); - .ctors : { *(.ctors) } - PROVIDE (__CTOR_END__ = .); - PROVIDE (__DTOR_LIST__ = .); - .dtors : { *(.dtors) } - PROVIDE (__DTOR_END__ = .); - PROVIDE (_FIXUP_START_ = .); - .fixup : { *(.fixup) } - PROVIDE (_FIXUP_END_ = .); - PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - .got : { *(.got) } - .got.plt : { *(.got.plt) } - PROVIDE (_GOT_END_ = .); - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : { *(.sdata) } - _edata = .; - PROVIDE (edata = .); - .sbss : - { - PROVIDE (__sbss_start = .); - *(.sbss) - *(.scommon) - *(.dynsbss) - PROVIDE (__sbss_end = .); - } - .plt : { *(.plt) } - .bss : - { - PROVIDE (__bss_start = .); - *(.dynbss) - *(.bss) - *(COMMON) - } - _end = . ; - PROVIDE (end = .); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* These must appear regardless of . */ -} diff --git a/usr/src/boot/sys/boot/arm/uboot/loader.conf b/usr/src/boot/sys/boot/arm/uboot/loader.conf deleted file mode 100644 index 4154ab7bcc..0000000000 --- a/usr/src/boot/sys/boot/arm/uboot/loader.conf +++ /dev/null @@ -1,13 +0,0 @@ -# This is defaults/loader.conf for ARM, containing defaults for loader(8). -# Do not modify the contents of this file, instead put your customizations -# into /boot/loader.conf or /boot/loader.conf.local -# $FreeBSD$ - -autoboot_delay=10 -bootfile="kernel" # Kernel name (possibly absolute path) -kernel="kernel" # /boot sub-directory containing kernel and modules -loader_conf_files="/boot/loader.conf /boot/loader.conf.local" -module_path="/boot/kernel;/boot/modules;/boot/dtb" -nextboot_conf="/boot/nextboot.conf" -nextboot_enable="NO" -verbose_loading="NO" diff --git a/usr/src/boot/sys/boot/arm/uboot/start.S b/usr/src/boot/sys/boot/arm/uboot/start.S deleted file mode 100644 index 1ef21f3671..0000000000 --- a/usr/src/boot/sys/boot/arm/uboot/start.S +++ /dev/null @@ -1,130 +0,0 @@ -/*- - * Copyright (c) 2008 Semihalf, Rafal Czubak - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <machine/asm.h> -#include <machine/armreg.h> - - .text - .extern _C_LABEL(self_reloc), _C_LABEL(main) - .weak _DYNAMIC - -/* - * Entry point to the loader that U-Boot passes control to. - */ - .globl _start -_start: - -#ifdef _ARM_ARCH_6 - mrc p15, 0, ip, c1, c0, 0 - orr ip, ip, #(CPU_CONTROL_UNAL_ENABLE) - orr ip, ip, #(CPU_CONTROL_AFLT_ENABLE) - mcr p15, 0, ip, c1, c0, 0 -#endif - /* - * Do self-relocation when the weak external symbol _DYNAMIC is non-NULL. - * When linked as a dynamic relocatable file, the linker automatically - * defines _DYNAMIC with a value that is the offset of the dynamic - * relocation info section. - * Note that we're still on u-boot's stack here, but the self_reloc - * code uses only a couple dozen bytes of stack space. - */ - adr ip, .here_off /* .here_off is a symbol whose value */ - ldr r0, [ip] /* is its own offset in the text seg. */ - sub r0, ip, r0 /* Get its pc-relative address and */ - ldr r1, .dynamic_off /* subtract its value and we get */ - teq r1, #0 /* r0 = physaddr we were loaded at. */ - addne r1, r1, r0 /* r1 = dynamic section physaddr. */ - blne _C_LABEL(self_reloc) /* Do reloc if _DYNAMIC is non-NULL. */ - - /* Hint where to look for the API signature */ - ldr ip, =uboot_address - str sp, [ip] - - /* Save U-Boot's r8 and r9 */ - ldr ip, =saved_regs - str r8, [ip, #0] - str r9, [ip, #4] - - /* - * Start loader. This is basically a tail-recursion call; if main() - * returns, it returns to u-boot (which reports the value returned r0). - */ - b main - - /* - * Data for self-relocation, in the text segment for pc-rel access. - */ -.here_off: - .word . -.dynamic_off: - .word _DYNAMIC - -/* - * syscall() - */ -ENTRY(syscall) - /* Save caller's lr, r8 and r9 */ - ldr ip, =saved_regs - str r8, [ip, #8] - str r9, [ip, #12] - str lr, [ip, #16] - /* Restore U-Boot's r8 and r9 */ - ldr r8, [ip, #0] - ldr r9, [ip, #4] - /* Call into U-Boot */ - ldr lr, =return_from_syscall - ldr ip, =syscall_ptr - ldr pc, [ip] -return_from_syscall: - /* Restore loader's r8, r9 and lr */ - ldr ip, =saved_regs - ldr lr, [ip, #16] - ldr r9, [ip, #12] - ldr r8, [ip, #8] - /* Return to caller */ - mov pc, lr - -/* - * Data section - */ - .data - .align 4 - .globl syscall_ptr -syscall_ptr: - .long 0 - - .globl uboot_address -uboot_address: - .long 0 - -saved_regs: - .long 0 /* U-Boot's r8 */ - .long 0 /* U-Boot's r9 */ - .long 0 /* Loader's r8 */ - .long 0 /* Loader's r9 */ - .long 0 /* Loader's lr */ diff --git a/usr/src/boot/sys/boot/arm/uboot/version b/usr/src/boot/sys/boot/arm/uboot/version deleted file mode 100644 index 486c4125cc..0000000000 --- a/usr/src/boot/sys/boot/arm/uboot/version +++ /dev/null @@ -1,9 +0,0 @@ -$FreeBSD$ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - -1.2: Extended with NAND FS support. -1.1: Flattened Device Tree blob support. -1.0: Added storage support. Booting from HDD, USB, etc. is now possible. -0.5: Initial U-Boot/arm version (netbooting only). diff --git a/usr/src/boot/sys/boot/arm64/Makefile b/usr/src/boot/sys/boot/arm64/Makefile deleted file mode 100644 index 3ecb5825dc..0000000000 --- a/usr/src/boot/sys/boot/arm64/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -.include <bsd.subdir.mk> diff --git a/usr/src/boot/sys/boot/arm64/libarm64/cache.c b/usr/src/boot/sys/boot/arm64/libarm64/cache.c deleted file mode 100644 index 25766ef564..0000000000 --- a/usr/src/boot/sys/boot/arm64/libarm64/cache.c +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * Copyright (c) 2014 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under - * the sponsorship of the FreeBSD Foundation. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> - -#include <machine/armreg.h> - -#include <stand.h> -#include <efi.h> - -#include "cache.h" - -static unsigned int -get_dcache_line_size(void) -{ - uint64_t ctr; - unsigned int dcl_size; - - /* Accessible from all security levels */ - ctr = READ_SPECIALREG(ctr_el0); - - /* - * Relevant field [19:16] is LOG2 - * of the number of words in DCache line - */ - dcl_size = CTR_DLINE_SIZE(ctr); - - /* Size of word shifted by cache line size */ - return (sizeof(int) << dcl_size); -} - -void -cpu_flush_dcache(const void *ptr, size_t len) -{ - - uint64_t cl_size; - vm_offset_t addr, end; - - cl_size = get_dcache_line_size(); - - /* Calculate end address to clean */ - end = (vm_offset_t)ptr + (vm_offset_t)len; - /* Align start address to cache line */ - addr = (vm_offset_t)ptr; - addr = rounddown2(addr, cl_size); - - for (; addr < end; addr += cl_size) - __asm __volatile("dc civac, %0" : : "r" (addr) : "memory"); - /* Full system DSB */ - __asm __volatile("dsb sy" : : : "memory"); -} - -void -cpu_inval_icache(const void *ptr, size_t len) -{ - - /* NULL ptr or 0 len means all */ - if (ptr == NULL || len == 0) { - __asm __volatile( - "ic ialluis \n" - "dsb ish \n" - : : : "memory"); - return; - } - - /* TODO: Other cache ranges if necessary */ -} diff --git a/usr/src/boot/sys/boot/arm64/libarm64/cache.h b/usr/src/boot/sys/boot/arm64/libarm64/cache.h deleted file mode 100644 index 89b094b19c..0000000000 --- a/usr/src/boot/sys/boot/arm64/libarm64/cache.h +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * Copyright (c) 2014 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under - * the sponsorship of the FreeBSD Foundation. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _CACHE_H_ -#define _CACHE_H_ - -/* cache.c */ -void cpu_flush_dcache(const void *, size_t); -void cpu_inval_icache(const void *, size_t); - -#endif /* _CACHE_H_ */ diff --git a/usr/src/boot/sys/boot/efi/fdt/Makefile b/usr/src/boot/sys/boot/efi/fdt/Makefile deleted file mode 100644 index 15862dc295..0000000000 --- a/usr/src/boot/sys/boot/efi/fdt/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> - -.PATH: ${.CURDIR}/../../common - -LIB= efi_fdt -INTERNALLIB= -WARNS?= 6 - -SRCS= efi_fdt.c - -CFLAGS+= -ffreestanding -msoft-float -.if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.endif - -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ - -# EFI library headers -CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE} - -# libfdt headers -CFLAGS+= -I${.CURDIR}/../../fdt - -# Pick up the bootstrap header for some interface items -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. - -machine: - ln -sf ${.CURDIR}/../../../${MACHINE}/include machine - -CLEANFILES+= machine - -.include <bsd.lib.mk> - -beforedepend ${OBJS}: machine diff --git a/usr/src/boot/sys/boot/efi/fdt/efi_fdt.c b/usr/src/boot/sys/boot/efi/fdt/efi_fdt.c deleted file mode 100644 index d6757689c8..0000000000 --- a/usr/src/boot/sys/boot/efi/fdt/efi_fdt.c +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * Copyright (c) 2014 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Andrew Turner under - * sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <stand.h> -#include <efi.h> -#include <efilib.h> -#include <fdt_platform.h> - -#include "bootstrap.h" - -static EFI_GUID fdtdtb = FDT_TABLE_GUID; - -int -fdt_platform_load_dtb(void) -{ - struct fdt_header *hdr; - - hdr = efi_get_table(&fdtdtb); - if (hdr != NULL) { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by EFI at %p.\n", hdr); - return (0); - } - } - - return (1); -} - -void -fdt_platform_fixups(void) -{ -} diff --git a/usr/src/boot/sys/boot/fdt/Makefile b/usr/src/boot/sys/boot/fdt/Makefile deleted file mode 100644 index 22d8da5965..0000000000 --- a/usr/src/boot/sys/boot/fdt/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../contrib/libfdt/ - -LIB= fdt -INTERNALLIB= - -# Vendor sources of libfdt. -SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c \ - fdt_empty_tree.c - -# Loader's fdt commands extension sources. -SRCS+= fdt_loader_cmd.c - -CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ - -CFLAGS+= -ffreestanding - -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -msoft-float -.endif - -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -.endif - -CFLAGS+= -Wformat -Wall - -.include <bsd.stand.mk> -.include <bsd.lib.mk> diff --git a/usr/src/boot/sys/boot/fdt/dts/Makefile b/usr/src/boot/sys/boot/fdt/dts/Makefile deleted file mode 100644 index 66f65a712f..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -SUBDIR=arm mips powerpc - -.include <bsd.subdir.mk> diff --git a/usr/src/boot/sys/boot/fdt/dts/Makefile.inc b/usr/src/boot/sys/boot/fdt/dts/Makefile.inc deleted file mode 100644 index 4454755dc8..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/Makefile.inc +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -SYSDIR?=${.CURDIR}/../../../.. - -test-dts: -.for dts in ${DTS} - @env MACHINE=`basename ${.CURDIR}` ${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${dts} /tmp - -.endfor - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/Makefile b/usr/src/boot/sys/boot/fdt/dts/arm/Makefile deleted file mode 100644 index 03d156d947..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -DTS!=ls *.dts - -all: test-dts - -.include <bsd.init.mk> diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/am335x-evm.dts b/usr/src/boot/sys/boot/fdt/dts/arm/am335x-evm.dts deleted file mode 100644 index 3e1c4c0caa..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/am335x-evm.dts +++ /dev/null @@ -1,29 +0,0 @@ -/*- - * Copyright (c) 2015 Oleksandr Tymoshenko - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "am335x-evm.dts" diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/am335x.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/am335x.dtsi deleted file mode 100644 index fea57e98b0..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/am335x.dtsi +++ /dev/null @@ -1,349 +0,0 @@ -/*- - * Copyright (c) 2012 Damjan Marion <dmarion@Freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&AINTC>; - - SOC: am335x { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - AINTC: interrupt-controller@48200000 { - compatible = "ti,aintc"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = < 0x48200000 0x1000 >; - }; - - pmu { - compatible = "arm,cortex-a8-pmu"; - interrupts = <3>; - }; - - scm@44e10000 { - compatible = "ti,scm"; - reg = < 0x44e10000 0x2000 >; - }; - - prcm@44E00000 { - compatible = "am335x,prcm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x44E00000 0x1300 >; - }; - - dmtimers@44E05000 { - compatible = "ti,am335x-dmtimer"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x44E05000 0x1000 - 0x44E31000 0x1000 - 0x48040000 0x1000 - 0x48042000 0x1000 - 0x48044000 0x1000 - 0x48046000 0x1000 - 0x48048000 0x1000 - 0x4804A000 0x1000 >; - interrupts = < 66 67 68 69 92 93 94 95 >; - interrupt-parent = <&AINTC>; - }; - - rtc: rtc@44E3E000 { - compatible = "ti,da830-rtc"; - reg = <0x44E3E000 0x1000>; - interrupts = < 75 76 >; - interrupt-parent = <&AINTC>; - }; - - adc0: adc@44E0D000 { - compatible = "ti,adc"; - reg = <0x44E0D000 0x2000>; - interrupts = < 16 >; - interrupt-parent = <&AINTC>; - }; - - wdt1@44E35000 { - compatible = "ti,omap3-wdt"; - reg = <0x44E35000 0x1000>; - interrupts = <91>; - interrupt-parent = <&AINTC>; - }; - - GPIO: gpio { - #gpio-cells = <3>; - compatible = "ti,gpio"; - gpio-controller; - reg =< 0x44E07000 0x1000 - 0x4804C000 0x1000 - 0x481AC000 0x1000 - 0x481AE000 0x1000 >; - interrupts = < 96 97 98 99 32 33 62 63 >; - interrupt-parent = <&AINTC>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - uart0: serial@44E09000 { - compatible = "ti,ns16550"; - reg = <0x44E09000 0x1000>; - reg-shift = <2>; - interrupts = < 72 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 48000000 >; - uart-device-id = < 0 >; - }; - - uart1: serial@48022000 { - compatible = "ti,ns16550"; - reg = <0x48022000 0x1000>; - reg-shift = <2>; - interrupts = < 73 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 48000000 >; - uart-device-id = < 1 >; - status = "disabled"; - }; - - uart2: serial@48024000 { - compatible = "ti,ns16550"; - reg = <0x48024000 0x1000>; - reg-shift = <2>; - interrupts = < 74 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 48000000 >; - uart-device-id = < 2 >; - status = "disabled"; - }; - - uart3: serial@481a6000 { - compatible = "ti,ns16550"; - reg = <0x481A6000 0x1000>; - reg-shift = <2>; - interrupts = < 44 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 48000000 >; - uart-device-id = < 3 >; - status = "disabled"; - }; - - uart4: serial@481a8000 { - compatible = "ti,ns16550"; - reg = <0x481A8000 0x1000>; - reg-shift = <2>; - interrupts = < 45 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 48000000 >; - uart-device-id = < 4 >; - status = "disabled"; - }; - - uart5: serial@481aa000 { - compatible = "ti,ns16550"; - reg = <0x481AA000 0x1000>; - reg-shift = <2>; - interrupts = < 46 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 48000000 >; - uart-device-id = < 5 >; - status = "disabled"; - }; - - edma3@49000000 { - compatible = "ti,edma3"; - reg =< 0x49000000 0x100000 /* Channel Controller Regs */ - 0x49800000 0x100000 /* Transfer Controller 0 Regs */ - 0x49900000 0x100000 /* Transfer Controller 1 Regs */ - 0x49a00000 0x100000 >; /* Transfer Controller 2 Regs */ - interrupts = <12 13 14>; - interrupt-parent = <&AINTC>; - }; - - mmchs0@48060000 { - compatible = "ti,omap3-hsmmc", "ti,mmchs"; - reg =<0x48060000 0x1000 >; - interrupts = <64>; - interrupt-parent = <&AINTC>; - mmchs-device-id = <0>; - mmchs-wp-gpio-pin = <0xffffffff>; - ti,dual-volt; - }; - - mmchs1@481D8000 { - compatible = "ti,omap3-hsmmc", "ti,mmchs"; - reg =<0x481D8000 0x1000 >; - interrupts = <28>; - interrupt-parent = <&AINTC>; - mmchs-device-id = <1>; - mmchs-wp-gpio-pin = <0xffffffff>; - status = "disabled"; - }; - - enet0: ethernet@4A100000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "ti,cpsw"; - reg = <0x4A100000 0x4000>; - interrupts = <40 41 42 43>; - interrupt-parent = <&AINTC>; - phy-handle = <&phy0>; - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,cpsw-mdio"; - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - }; - }; - - i2c0: i2c@44e0b000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,i2c"; - reg =< 0x44e0b000 0x1000 >; - interrupts = <70>; - interrupt-parent = <&AINTC>; - i2c-device-id = <0>; - }; - - i2c1: i2c@4802a000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,i2c"; - reg =< 0x4802a000 0x1000 >; - interrupts = <71>; - interrupt-parent = <&AINTC>; - i2c-device-id = <1>; - }; - - i2c2: i2c@4819c000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,i2c"; - reg =< 0x4819c000 0x1000 >; - interrupts = <30>; - interrupt-parent = <&AINTC>; - i2c-device-id = <2>; - }; - - pwm@48300000 { - compatible = "ti,am335x-pwm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x48300000 0x100 /* PWMSS0 */ - 0x48300100 0x80 /* eCAP0 */ - 0x48300180 0x80 /* eQEP0 */ - 0x48300200 0x60 /* ePWM0 */ - >; - interrupts = <86 58>; /* ePWM0INT, ePWM0_TZINT */ - interrupt-parent = <&AINTC>; - pwm-device-id = <0>; - }; - - pwm@48302000 { - compatible = "ti,am335x-pwm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x48302000 0x100 /* PWMSS1 */ - 0x48302100 0x80 /* eCAP1 */ - 0x48302180 0x80 /* eQEP1 */ - 0x48302200 0x60 /* ePWM1 */ - >; - interrupts = <87 59>; /* ePWM1INT, ePWM1_TZINT */ - interrupt-parent = <&AINTC>; - pwm-device-id = <1>; - }; - - pwm@48304000 { - compatible = "ti,am335x-pwm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x48304000 0x100 /* PWMSS2 */ - 0x48304100 0x80 /* eCAP2 */ - 0x48304180 0x80 /* eQEP2 */ - 0x48304200 0x60 /* ePWM2 */ - >; - interrupts = <88 60>; /* ePWM2INT, ePWM2_TZINT */ - interrupt-parent = <&AINTC>; - pwm-device-id = <2>; - }; - - lcd: lcd@4830e000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,am335x-lcd"; - reg =< 0x4830e000 0x1000 >; - interrupts = <36>; - interrupt-parent = <&AINTC>; - }; - - usb@47400000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,musb-am33xx"; - reg =< 0x47400000 0x1000 /* USBSS */ - 0x47401000 0x300 /* USB0 */ - 0x47401300 0x100 /* USB0_PHY */ - 0x47401400 0x400 /* USB0_CORE */ - 0x47401800 0x300 /* USB1 */ - 0x47401B00 0x100 /* USB1_PHY */ - 0x47401C00 0x400 /* USB1_CORE */ - >; - interrupts = <17 18 19>; - interrupt-parent = <&AINTC>; - /* 1 - Host Mode, 0 - Device Mode */ - modemask = <2>; - }; - - mbox0@480C8000 { - compatible = "am335x,system-mbox"; - reg = < 0x480C8000 0x1000 >; - interrupts = <77>; - interrupt-parent = <&AINTC>; - }; - - spinlock0@480CA000 { - compatible = "am335x,spinlock"; - reg = < 0x480CA000 0x1000 >; - }; - - pruss@4A300000 { - compatible = "ti,pruss-v2"; - reg = <0x4A300000 0x80000>; - interrupt-parent = <&AINTC>; - interrupts = <20 21 22 23 24 25 26 27>; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/annapurna-alpine.dts b/usr/src/boot/sys/boot/fdt/dts/arm/annapurna-alpine.dts deleted file mode 100644 index 100d2d046f..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/annapurna-alpine.dts +++ /dev/null @@ -1,244 +0,0 @@ -/*- - * Copyright (c) 2013 Ruslan Bukin <br@bsdpad.com> - * Copyright (c) 2015 Semihalf - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "annapurna,alpine"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - serial0 = &serial0; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a15"; - reg = <0x0>; - d-cache-line-size = <64>; // 64 bytes - i-cache-line-size = <64>; // 64 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <375000000>; - clock-frequency = <0>; - }; - - cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a15"; - reg = <0x0>; - d-cache-line-size = <64>; // 64 bytes - i-cache-line-size = <64>; // 64 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <375000000>; - clock-frequency = <0>; - }; - - cpu@2 { - device_type = "cpu"; - compatible = "arm,cortex-a15"; - reg = <0x0>; - d-cache-line-size = <64>; // 64 bytes - i-cache-line-size = <64>; // 64 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <375000000>; - clock-frequency = <0>; - }; - - cpu@3 { - device_type = "cpu"; - compatible = "arm,cortex-a15"; - reg = <0x0>; - d-cache-line-size = <64>; // 64 bytes - i-cache-line-size = <64>; // 64 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <375000000>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x00100000 0x7ff00000>; // 2047MB at 1MB - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xfb000000 0x03000000>; - bus-frequency = <0>; - - MPIC: interrupt-controller { - compatible = "arm,gic"; - reg = < 0x1000 0x1000 >, /* Distributor Registers */ - < 0x2000 0x2000 >; /* CPU Interface Registers */ - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <3>; - - // In intr[2], bits[3:0] are trigger type and level flags. - // 1 = low-to-high edge triggered - // 2 = high-to-low edge triggered - // 4 = active high level-sensitive - // 8 = active low level-sensitive - // The hardware only supports active-high-level or rising-edge. - - }; - - generic_timer { - compatible = "arm,sp804"; - reg = <0x02890000 0x1000>; - interrupts = <0 9 4>; - interrupt-parent = <&MPIC>; - clock-frequency = <375000000>; - }; - - cpu_resume { - compatible = "annapurna-labs,al-cpu-resume"; - reg = <0x00ff5ec0 0x30>; - }; - - nb_service { - compatible = "annapurna-labs,al-nb-service"; - reg = <0x00070000 0x10000>; - interrupts = <0 32 4>, - <0 33 4>, - <0 34 4>, - <0 35 4>; - interrupt-parent = <&MPIC>; - }; - - wdt0 { - compatible = "arm,sp805", "arm,primecell"; - reg = <0x288c000 0x1000>; - interrupt-parent = <&MPIC>; - }; - - serial0: serial@2883000 { - compatible = "ns16550"; - reg = <0x2883000 0x20>; - reg-shift = <2>; - current-speed = <115200>; - clock-frequency = <375000000>; - interrupts = <0 17 4>; - interrupt-parent = <&MPIC>; - }; - }; - - pcie-internal { - compatible = "annapurna-labs,al-internal-pcie"; - device_type = "pci"; - #size-cells = <2>; - #address-cells = <3>; - interrupt-parent = <&MPIC>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = <0x3000 0 0 1 &MPIC 0 32 4>, // USB adapter - <0x3800 0 0 1 &MPIC 0 36 4>, - <0x4000 0 0 1 &MPIC 0 43 4>, // SATA 0 (PCIe expander) - <0x4800 0 0 1 &MPIC 0 44 1>; // SATA 1 (onboard) - - // ranges: - // - ECAM - non prefetchable config space - // - 32 bit non prefetchable memory space - ranges = <0x00000000 0x0 0xfbc00000 0xfbc00000 0x0 0x100000 - 0x02000000 0x0 0xfe000000 0xfe000000 0x0 0x1000000>; - - bus-range = <0x00 0x00>; - }; - -// WORKAROUND: enabling PCIe controller when no card is plugged in -// leads to kernel panic because u-boot disables PCIe controller if no link -// is detected. Just be kind and compatible with Linux -/* // External PCIe Controller 0 - pcie-external0 { - compatible = "annapurna-labs,al-external-pcie"; - reg = <0xfd800000 0x00020000>; - device_type = "pci"; - #size-cells = <2>; - #address-cells = <3>; - interrupt-parent = <&MPIC>; - interrupt-map-mask = <0x00 0 0 7>; - interrupt-map = <0x0000 0 0 1 &MPIC 0 40 4>; - - // ranges: - // Controller 0: - // - ECAM - non prefetchable config space: 2MB - // - IO - IO port space 64KB, reserve 64KB from target memory windows - // real IO address on the pci bus starts at 0x10000 - // - 32 bit non prefetchable memory space: 128MB - 64KB - - ranges = <0x00000000 0x0 0xfb600000 0xfb600000 0x0 0x00200000 - 0x01000000 0x0 0x00010000 0xe0000000 0x0 0x00010000 - 0x02000000 0x0 0xe1000000 0xe1000000 0x0 0x06f00000>; - - bus-range = <0x00 0xff>; - }; - - // External PCIe Controllers 1 - pcie-external1 { - compatible = "annapurna-labs,al-external-pcie"; - reg = <0xfd820000 0x00020000>; - device_type = "pci"; - #size-cells = <2>; - #address-cells = <3>; - interrupt-parent = <&MPIC>; - interrupt-map-mask = <0x0 0 0 7>; - interrupt-map = <0x0000 0 0 1 &MPIC 0 41 4>; - - // ranges: - // - ECAM - non prefetchable config space: 2MB - // - IO - IO port space 64KB, reserve 64KB from target memory windows - // real IO address on the pci bus starts at 0x20000 - // - 32 bit non prefetchable memory space: 64MB - 64KB - ranges = <0x00000000 0x0 0xfb800000 0xfb800000 0x0 0x00200000 - 0x01000000 0x0 0x00020000 0xe8000000 0x0 0x00010000 - 0x02000000 0x0 0xe8100000 0xe8100000 0x0 0x02ff0000>; - - bus-range = <0x00 0xff>; - }; */ - - chosen { - stdin = "serial0"; - stdout = "serial0"; - stddbg = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/apalis-imx6.dts b/usr/src/boot/sys/boot/fdt/dts/arm/apalis-imx6.dts deleted file mode 100644 index b6440603c5..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/apalis-imx6.dts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2014-2015 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "imx6q-pinfunc.h" - -/dts-v1/; -/include/ "imx6.dtsi" - -/ { - #address-cells = <1>; - #size-cells = <1>; - - model = "Toradex Apalis i.MX6"; - compatible = "toradex,imx6q-apalis", "fsl,imx6q"; - - memory { - reg = <0x10000000 0x40000000>; /* RAM 1GB */ - }; - - SOC: soc@00000000 { - aips@02000000 { /* AIPS1 */ - iomux@020e0000 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&pins_ssi>; - pins_ssi: ssi { - fsl,pins = < - MX6QDL_PAD_DISP0_DAT16__AUD5_TXC 0x130b0 - MX6QDL_PAD_DISP0_DAT17__AUD5_TXD 0x110b0 - MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS 0x130b0 - MX6QDL_PAD_DISP0_DAT19__AUD5_RXD 0x130b0 - MX6QDL_PAD_GPIO_19__CCM_CLKO1 0x130b0 - >; - }; - }; - gpio@0209c000 { status = "okay"; }; - gpio@020a0000 { status = "okay"; }; - gpio@020a4000 { status = "okay"; }; - gpio@020a8000 { status = "okay"; }; - gpio@020ac000 { status = "okay"; }; - gpio@020b0000 { status = "okay"; }; - gpio@020b4000 { status = "okay"; }; - console:serial@02020000 { status = "okay"; }; - serial@021e8000 { status = "disabled"; }; - serial@021ec000 { status = "disabled"; }; - serial@021f0000 { status = "disabled"; }; - serial@021f4000 { status = "disabled"; }; - usbphy@020c9000 { status = "okay"; }; - usbphy@020ca000 { status = "okay"; }; - ecspi@02008000 { status = "okay"; }; - ssi@02028000 { status = "okay"; }; - sdma@020ec000 { status = "okay"; }; - }; - aips@02100000 { /* AIPS2 */ - ethernet@02188000 { - status = "okay"; - phy-mode = "rgmii"; - phy-disable-preamble; - }; - usb@02184000 { status = "okay"; }; - usb@02184200 { status = "okay"; }; - usb@02184400 { status = "disabled"; }; - usb@02184600 { status = "disabled"; }; - usdhc@02190000 { status = "disabled"; }; - usdhc@02194000 { status = "okay"; }; - usdhc@02198000 { status = "disabled"; }; - usdhc@0219c000 { status = "disabled"; }; - audmux@021d8000 { status = "okay"; }; - i2c@021a0000 { status = "okay"; }; - }; - }; - - chosen { - stdin = &console; - stdout = &console; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/armada-380.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/armada-380.dtsi deleted file mode 100644 index 876bae4a4b..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/armada-380.dtsi +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Device Tree Include file for Marvell Armada 380 SoC. - * - * Copyright (C) 2014 Marvell - * - * Lior Amsalem <alior@marvell.com> - * Gregory CLEMENT <gregory.clement@free-electrons.com> - * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file 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 2 of the - * License, or (at your option) any later version. - * - * This file 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. - * - * Or, alternatively - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -#include "armada-38x.dtsi" - -/ { - model = "Marvell Armada 380 family SoC"; - compatible = "marvell,armada380"; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - enable-method = "marvell,armada-380-smp"; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - reg = <0>; - }; - }; - - soc { - internal-regs { - pinctrl@18000 { - compatible = "marvell,mv88f6810-pinctrl"; - }; - }; - - pcie-controller { - compatible = "marvell,armada-370-pcie"; - status = "disabled"; - device_type = "pci"; - - #address-cells = <3>; - #size-cells = <2>; - - msi-parent = <&mpic>; - bus-range = <0x00 0xff>; - - ranges = - <0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 - 0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 - 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 - 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 - 0x82000000 0x1 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 0 MEM */ - 0x81000000 0x1 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 0 IO */ - 0x82000000 0x2 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 1 MEM */ - 0x81000000 0x2 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 1 IO */ - 0x82000000 0x3 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 2 MEM */ - 0x81000000 0x3 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 2 IO */>; - - /* x1 port */ - pcie@1,0 { - device_type = "pci"; - assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; - reg = <0x0800 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - #interrupt-cells = <1>; - ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 - 0x81000000 0 0 0x81000000 0x1 0 1 0>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; - marvell,pcie-port = <0>; - marvell,pcie-lane = <0>; - clocks = <&gateclk 8>; - status = "disabled"; - }; - - /* x1 port */ - pcie@2,0 { - device_type = "pci"; - assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; - reg = <0x1000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - #interrupt-cells = <1>; - ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 - 0x81000000 0 0 0x81000000 0x2 0 1 0>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; - marvell,pcie-port = <1>; - marvell,pcie-lane = <0>; - clocks = <&gateclk 5>; - status = "disabled"; - }; - - /* x1 port */ - pcie@3,0 { - device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; - reg = <0x1800 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - #interrupt-cells = <1>; - ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 - 0x81000000 0 0 0x81000000 0x3 0 1 0>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; - marvell,pcie-port = <2>; - marvell,pcie-lane = <0>; - clocks = <&gateclk 6>; - status = "disabled"; - }; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/armada-385.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/armada-385.dtsi deleted file mode 100644 index 8dc6202280..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/armada-385.dtsi +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Device Tree Include file for Marvell Armada 385 SoC. - * - * Copyright (C) 2014 Marvell - * - * Lior Amsalem <alior@marvell.com> - * Gregory CLEMENT <gregory.clement@free-electrons.com> - * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file 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 2 of the - * License, or (at your option) any later version. - * - * This file 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. - * - * Or, alternatively - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -#include "armada-38x.dtsi" - -/ { - model = "Marvell Armada 385 family SoC"; - compatible = "marvell,armada385", "marvell,armada380"; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - enable-method = "marvell,armada-380-smp"; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - reg = <0>; - }; - cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - reg = <1>; - }; - }; - - soc { - internal-regs { - pinctrl@18000 { - compatible = "marvell,mv88f6820-pinctrl"; - }; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/armada-388-gp.dts b/usr/src/boot/sys/boot/fdt/dts/arm/armada-388-gp.dts deleted file mode 100644 index 8a211f644d..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/armada-388-gp.dts +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Device Tree file for Marvell Armada 385 development board - * (RD-88F6820-GP) - * - * Copyright (C) 2014 Marvell - * - * Gregory CLEMENT <gregory.clement@free-electrons.com> - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -/dts-v1/; -#include "armada-388.dtsi" -#include <dt-bindings/gpio/gpio.h> - -/ { - model = "Marvell Armada 385 GP"; - compatible = "marvell,a385-gp", "marvell,armada388", "marvell,armada380"; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - memory { - device_type = "memory"; - reg = <0x00000000 0x80000000>; /* 2 GB */ - }; - - soc { - ranges = <0 0 0xf1000000 0x100000>; - - internal-regs { - spi@10600 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_pins>; - status = "okay"; - - spi-flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "st,m25p128", "jedec,spi-nor"; - reg = <0>; /* Chip select 0 */ - spi-max-frequency = <50000000>; - m25p,fast-read; - }; - }; - - i2c@11000 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c0_pins>; - status = "okay"; - clock-frequency = <100000>; - /* - * The EEPROM located at adresse 54 is needed - * for the boot - DO NOT ERASE IT - - */ - - expander0: pca9555@20 { - compatible = "nxp,pca9555"; - pinctrl-names = "default"; - pinctrl-0 = <&pca0_pins>; - interrupt-parent = <&gpio0>; - interrupts = <18 IRQ_TYPE_EDGE_FALLING>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x20>; - }; - - expander1: pca9555@21 { - compatible = "nxp,pca9555"; - pinctrl-names = "default"; - interrupt-parent = <&gpio0>; - interrupts = <18 IRQ_TYPE_EDGE_FALLING>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x21>; - }; - - }; - - serial@12000 { - /* - * Exported on the micro USB connector CON16 - * through an FTDI - */ - - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins>; - status = "okay"; - }; - - /* GE1 CON15 */ - ethernet@30000 { - pinctrl-names = "default"; - pinctrl-0 = <&ge1_rgmii_pins>; - status = "okay"; - phy = <&phy1>; - phy-mode = "rgmii-id"; - }; - - /* CON4 */ - usb@58000 { - vcc-supply = <®_usb2_0_vbus>; - status = "okay"; - }; - - /* GE0 CON1 */ - ethernet@70000 { - pinctrl-names = "default"; - /* - * The Reference Clock 0 is used to provide a - * clock to the PHY - */ - pinctrl-0 = <&ge0_rgmii_pins>, <&ref_clk0_pins>; - status = "okay"; - phy = <&phy0>; - phy-mode = "rgmii-id"; - }; - - - mdio@72004 { - pinctrl-names = "default"; - pinctrl-0 = <&mdio_pins>; - - phy0: ethernet-phy@1 { - reg = <1>; - }; - - phy1: ethernet-phy@0 { - reg = <0>; - }; - }; - - sata@a8000 { - pinctrl-names = "default"; - pinctrl-0 = <&sata0_pins>, <&sata1_pins>; - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - - sata0: sata-port@0 { - reg = <0>; - target-supply = <®_5v_sata0>; - }; - - sata1: sata-port@1 { - reg = <1>; - target-supply = <®_5v_sata1>; - }; - }; - - sata@e0000 { - pinctrl-names = "default"; - pinctrl-0 = <&sata2_pins>, <&sata3_pins>; - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - - sata2: sata-port@0 { - reg = <0>; - target-supply = <®_5v_sata2>; - }; - - sata3: sata-port@1 { - reg = <1>; - target-supply = <®_5v_sata3>; - }; - }; - - sdhci@d8000 { - pinctrl-names = "default"; - pinctrl-0 = <&sdhci_pins>; - cd-gpios = <&expander0 5 GPIO_ACTIVE_LOW>; - no-1-8-v; - wp-inverted; - bus-width = <8>; - status = "okay"; - }; - - /* CON5 */ - usb3@f0000 { - vcc-supply = <®_usb2_1_vbus>; - status = "okay"; - }; - - /* CON7 */ - usb3@f8000 { - vcc-supply = <®_usb3_vbus>; - status = "okay"; - }; - }; - - gpio-fan { - compatible = "gpio-fan"; - gpios = <&expander1 3 GPIO_ACTIVE_HIGH>; - gpio-fan,speed-map = < 0 0 - 3000 1>; - }; - }; - - pci0: pcie@f1080000 { - status = "okay"; - }; - - reg_usb3_vbus: usb3-vbus { - compatible = "regulator-fixed"; - regulator-name = "usb3-vbus"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - enable-active-high; - regulator-always-on; - gpio = <&expander1 15 GPIO_ACTIVE_HIGH>; - }; - - reg_usb2_0_vbus: v5-vbus0 { - compatible = "regulator-fixed"; - regulator-name = "v5.0-vbus0"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - enable-active-high; - regulator-always-on; - gpio = <&expander1 14 GPIO_ACTIVE_HIGH>; - }; - - reg_usb2_1_vbus: v5-vbus1 { - compatible = "regulator-fixed"; - regulator-name = "v5.0-vbus1"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - enable-active-high; - regulator-always-on; - gpio = <&expander0 4 GPIO_ACTIVE_HIGH>; - }; - - reg_usb2_1_vbus: v5-vbus1 { - compatible = "regulator-fixed"; - regulator-name = "v5.0-vbus1"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - enable-active-high; - regulator-always-on; - gpio = <&expander0 4 GPIO_ACTIVE_HIGH>; - }; - - reg_sata0: pwr-sata0 { - compatible = "regulator-fixed"; - regulator-name = "pwr_en_sata0"; - enable-active-high; - regulator-always-on; - - }; - - reg_5v_sata0: v5-sata0 { - compatible = "regulator-fixed"; - regulator-name = "v5.0-sata0"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on; - vin-supply = <®_sata0>; - }; - - reg_12v_sata0: v12-sata0 { - compatible = "regulator-fixed"; - regulator-name = "v12.0-sata0"; - regulator-min-microvolt = <12000000>; - regulator-max-microvolt = <12000000>; - regulator-always-on; - vin-supply = <®_sata0>; - }; - - reg_sata1: pwr-sata1 { - regulator-name = "pwr_en_sata1"; - compatible = "regulator-fixed"; - regulator-min-microvolt = <12000000>; - regulator-max-microvolt = <12000000>; - enable-active-high; - regulator-always-on; - gpio = <&expander0 3 GPIO_ACTIVE_HIGH>; - }; - - reg_5v_sata1: v5-sata1 { - compatible = "regulator-fixed"; - regulator-name = "v5.0-sata1"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on; - vin-supply = <®_sata1>; - }; - - reg_12v_sata1: v12-sata1 { - compatible = "regulator-fixed"; - regulator-name = "v12.0-sata1"; - regulator-min-microvolt = <12000000>; - regulator-max-microvolt = <12000000>; - regulator-always-on; - vin-supply = <®_sata1>; - }; - - reg_sata2: pwr-sata2 { - compatible = "regulator-fixed"; - regulator-name = "pwr_en_sata2"; - enable-active-high; - regulator-always-on; - gpio = <&expander0 11 GPIO_ACTIVE_HIGH>; - }; - - reg_5v_sata2: v5-sata2 { - compatible = "regulator-fixed"; - regulator-name = "v5.0-sata2"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on; - vin-supply = <®_sata2>; - }; - - reg_12v_sata2: v12-sata2 { - compatible = "regulator-fixed"; - regulator-name = "v12.0-sata2"; - regulator-min-microvolt = <12000000>; - regulator-max-microvolt = <12000000>; - regulator-always-on; - vin-supply = <®_sata2>; - }; - - reg_sata3: pwr-sata3 { - compatible = "regulator-fixed"; - regulator-name = "pwr_en_sata3"; - enable-active-high; - regulator-always-on; - gpio = <&expander0 12 GPIO_ACTIVE_HIGH>; - }; - - reg_5v_sata3: v5-sata3 { - compatible = "regulator-fixed"; - regulator-name = "v5.0-sata3"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on; - vin-supply = <®_sata3>; - }; - - reg_12v_sata3: v12-sata3 { - compatible = "regulator-fixed"; - regulator-name = "v12.0-sata3"; - regulator-min-microvolt = <12000000>; - regulator-max-microvolt = <12000000>; - regulator-always-on; - vin-supply = <®_sata3>; - }; -}; - -&pinctrl { - pca0_pins: pca0_pins { - marvell,pins = "mpp18"; - marvell,function = "gpio"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/armada-388.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/armada-388.dtsi deleted file mode 100644 index 7be5f78478..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/armada-388.dtsi +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Device Tree Include file for Marvell Armada 388 SoC. - * - * Copyright (C) 2015 Marvell - * - * Gregory CLEMENT <gregory.clement@free-electrons.com> - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * - * The main difference with the Armada 385 is that the 388 can handle two more - * SATA ports. So we can reuse the dtsi of the Armada 385, override the pinctrl - * property and the name of the SoC, and add the second SATA host which control - * the 2 other ports. - * - * $FreeBSD$ - */ - -#include "armada-385.dtsi" - -/ { - model = "Marvell Armada 388 family SoC"; - compatible = "marvell,armada388", "marvell,armada385", - "marvell,armada380"; - - soc { - internal-regs { - pinctrl@18000 { - compatible = "marvell,mv88f6828-pinctrl"; - }; - - sata@e0000 { - compatible = "marvell,armada-380-ahci"; - reg = <0xe0000 0x2000>; - interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&gateclk 30>; - status = "disabled"; - }; - - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/armada-38x.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/armada-38x.dtsi deleted file mode 100644 index d93dab28c4..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/armada-38x.dtsi +++ /dev/null @@ -1,630 +0,0 @@ -/* - * Device Tree Include file for Marvell Armada 38x family of SoCs. - * - * Copyright (C) 2014 Marvell - * - * Lior Amsalem <alior@marvell.com> - * Gregory CLEMENT <gregory.clement@free-electrons.com> - * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file 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 2 of the - * License, or (at your option) any later version. - * - * This file 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. - * - * Or, alternatively - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -#include "skeleton.dtsi" -#include <dt-bindings/interrupt-controller/arm-gic.h> -#include <dt-bindings/interrupt-controller/irq.h> - -#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16)) - -/ { - model = "Marvell Armada 38x family SoC"; - compatible = "marvell,armada380"; - - aliases { - gpio0 = &gpio0; - gpio1 = &gpio1; - serial0 = &uart0; - serial1 = &uart1; - }; - - pmu { - compatible = "arm,cortex-a9-pmu"; - interrupts-extended = <&mpic 3>; - }; - - soc { - compatible = "marvell,armada380-mbus", "simple-bus"; - #address-cells = <2>; - #size-cells = <1>; - controller = <&mbusc>; - interrupt-parent = <&gic>; - pcie-mem-aperture = <0xe0000000 0x8000000>; - pcie-io-aperture = <0xe8000000 0x100000>; - - bootrom { - compatible = "marvell,bootrom"; - reg = <MBUS_ID(0x01, 0x1d) 0 0x200000>; - }; - - devbus-bootcs { - compatible = "marvell,mvebu-devbus"; - reg = <MBUS_ID(0xf0, 0x01) 0x10400 0x8>; - ranges = <0 MBUS_ID(0x01, 0x2f) 0 0xffffffff>; - #address-cells = <1>; - #size-cells = <1>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - devbus-cs0 { - compatible = "marvell,mvebu-devbus"; - reg = <MBUS_ID(0xf0, 0x01) 0x10408 0x8>; - ranges = <0 MBUS_ID(0x01, 0x3e) 0 0xffffffff>; - #address-cells = <1>; - #size-cells = <1>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - devbus-cs1 { - compatible = "marvell,mvebu-devbus"; - reg = <MBUS_ID(0xf0, 0x01) 0x10410 0x8>; - ranges = <0 MBUS_ID(0x01, 0x3d) 0 0xffffffff>; - #address-cells = <1>; - #size-cells = <1>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - devbus-cs2 { - compatible = "marvell,mvebu-devbus"; - reg = <MBUS_ID(0xf0, 0x01) 0x10418 0x8>; - ranges = <0 MBUS_ID(0x01, 0x3b) 0 0xffffffff>; - #address-cells = <1>; - #size-cells = <1>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - devbus-cs3 { - compatible = "marvell,mvebu-devbus"; - reg = <MBUS_ID(0xf0, 0x01) 0x10420 0x8>; - ranges = <0 MBUS_ID(0x01, 0x37) 0 0xffffffff>; - #address-cells = <1>; - #size-cells = <1>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - internal-regs { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>; - - L2: cache-controller@8000 { - compatible = "arm,pl310-cache"; - reg = <0x8000 0x1000>; - cache-unified; - cache-level = <2>; - }; - - scu@c000 { - compatible = "arm,cortex-a9-scu"; - reg = <0xc000 0x58>; - }; - - timer@c200 { - compatible = "arm,cortex-a9-global-timer"; - reg = <0xc200 0x20>; - interrupts = <GIC_PPI 11 (IRQ_TYPE_EDGE_RISING | GIC_CPU_MASK_SIMPLE(2))>; - clock-frequency = <800000000>; - clocks = <&coreclk 2>; - }; - - timer@c600 { - compatible = "arm,cortex-a9-twd-timer"; - reg = <0xc600 0x20>; - interrupts = <GIC_PPI 13 (IRQ_TYPE_EDGE_RISING | GIC_CPU_MASK_SIMPLE(2))>; - clock-frequency = <800000000>; - clocks = <&coreclk 2>; - }; - - gic: interrupt-controller@d000 { - compatible = "arm,cortex-a9-gic"; - #interrupt-cells = <3>; - #size-cells = <0>; - interrupt-controller; - reg = <0xd000 0x1000>, - <0xc100 0x100>; - }; - - spi0: spi@10600 { - compatible = "marvell,armada-380-spi", - "marvell,orion-spi"; - reg = <0x10600 0x50>; - #address-cells = <1>; - #size-cells = <0>; - cell-index = <0>; - interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - spi1: spi@10680 { - compatible = "marvell,armada-380-spi", - "marvell,orion-spi"; - reg = <0x10680 0x50>; - #address-cells = <1>; - #size-cells = <0>; - cell-index = <1>; - interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - i2c0: i2c@11000 { - compatible = "marvell,mv64xxx-i2c"; - reg = <0x11000 0x20>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; - timeout-ms = <1000>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - i2c1: i2c@11100 { - compatible = "marvell,mv64xxx-i2c"; - reg = <0x11100 0x20>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; - timeout-ms = <1000>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - uart0: serial@12000 { - compatible = "snps,dw-apb-uart"; - reg = <0x12000 0x100>; - reg-shift = <2>; - interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; - reg-io-width = <1>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - uart1: serial@12100 { - compatible = "snps,dw-apb-uart"; - reg = <0x12100 0x100>; - reg-shift = <2>; - interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; - reg-io-width = <1>; - clocks = <&coreclk 0>; - status = "disabled"; - }; - - pinctrl: pinctrl@18000 { - reg = <0x18000 0x20>; - - ge0_rgmii_pins: ge-rgmii-pins-0 { - marvell,pins = "mpp6", "mpp7", "mpp8", - "mpp9", "mpp10", "mpp11", - "mpp12", "mpp13", "mpp14", - "mpp15", "mpp16", "mpp17"; - marvell,function = "ge0"; - }; - - ge1_rgmii_pins: ge-rgmii-pins-1 { - marvell,pins = "mpp21", "mpp27", "mpp28", - "mpp29", "mpp30", "mpp31", - "mpp32", "mpp37", "mpp38", - "mpp39", "mpp40", "mpp41"; - marvell,function = "ge1"; - }; - - i2c0_pins: i2c-pins-0 { - marvell,pins = "mpp2", "mpp3"; - marvell,function = "i2c0"; - }; - - mdio_pins: mdio-pins { - marvell,pins = "mpp4", "mpp5"; - marvell,function = "ge"; - }; - - ref_clk0_pins: ref-clk-pins-0 { - marvell,pins = "mpp45"; - marvell,function = "ref"; - }; - - ref_clk1_pins: ref-clk-pins-1 { - marvell,pins = "mpp46"; - marvell,function = "ref"; - }; - - spi0_pins: spi-pins-0 { - marvell,pins = "mpp22", "mpp23", "mpp24", - "mpp25"; - marvell,function = "spi0"; - }; - - spi1_pins: spi-pins-1 { - marvell,pins = "mpp56", "mpp57", "mpp58", - "mpp59"; - marvell,function = "spi1"; - }; - - uart0_pins: uart-pins-0 { - marvell,pins = "mpp0", "mpp1"; - marvell,function = "ua0"; - }; - - uart1_pins: uart-pins-1 { - marvell,pins = "mpp19", "mpp20"; - marvell,function = "ua1"; - }; - - sdhci_pins: sdhci-pins { - marvell,pins = "mpp48", "mpp49", "mpp50", - "mpp52", "mpp53", "mpp54", - "mpp55", "mpp57", "mpp58", - "mpp59"; - marvell,function = "sd0"; - }; - - sata0_pins: sata-pins-0 { - marvell,pins = "mpp20"; - marvell,function = "sata0"; - }; - - sata1_pins: sata-pins-1 { - marvell,pins = "mpp19"; - marvell,function = "sata1"; - }; - - sata2_pins: sata-pins-2 { - marvell,pins = "mpp47"; - marvell,function = "sata2"; - }; - - sata3_pins: sata-pins-3 { - marvell,pins = "mpp44"; - marvell,function = "sata3"; - }; - }; - - gpio0: gpio@18100 { - compatible = "marvell,orion-gpio"; - reg = <0x18100 0x40>; - ngpios = <32>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; - }; - - gpio1: gpio@18140 { - compatible = "marvell,orion-gpio"; - reg = <0x18140 0x40>; - ngpios = <28>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>; - }; - - system-controller@18200 { - compatible = "marvell,armada-380-system-controller", - "marvell,armada-370-xp-system-controller"; - reg = <0x18200 0x100>; - }; - - gateclk: clock-gating-control@18220 { - compatible = "marvell,armada-380-gating-clock"; - reg = <0x18220 0x4>; - clocks = <&coreclk 0>; - #clock-cells = <1>; - }; - - coreclk: mvebu-sar@18600 { - compatible = "marvell,armada-380-core-clock"; - reg = <0x18600 0x04>; - #clock-cells = <1>; - }; - - mbusc: mbus-controller@20000 { - compatible = "marvell,mbus-controller"; - reg = <0x20000 0x100>, <0x20180 0x20>; - }; - - mpic: interrupt-controller@20a00 { - compatible = "marvell,mpic"; - reg = <0x20a00 0x2d0>, <0x21070 0x58>; - #interrupt-cells = <1>; - #size-cells = <1>; - interrupt-controller; - msi-controller; - interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>; - }; - - timer@20300 { - compatible = "marvell,armada-380-timer", - "marvell,armada-xp-timer"; - reg = <0x20300 0x30>, <0x21040 0x30>; - interrupts-extended = <&gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, - <&gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, - <&gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, - <&gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, - <&mpic 5>, - <&mpic 6>; - clocks = <&coreclk 2>, <&refclk>; - clock-names = "nbclk", "fixed"; - }; - - watchdog@20300 { - compatible = "marvell,armada-380-wdt"; - reg = <0x20300 0x34>, <0x20704 0x4>, <0x18260 0x4>; - clocks = <&coreclk 2>, <&refclk>; - clock-names = "nbclk", "fixed"; - }; - - cpurst@20800 { - compatible = "marvell,armada-370-cpu-reset"; - reg = <0x20800 0x10>; - }; - - mpcore-soc-ctrl@20d20 { - compatible = "marvell,armada-380-mpcore-soc-ctrl"; - reg = <0x20d20 0x6c>; - }; - - coherency-fabric@21010 { - compatible = "marvell,armada-380-coherency-fabric"; - reg = <0x21010 0x1c>; - }; - - pmsu@22000 { - compatible = "marvell,armada-380-pmsu"; - reg = <0x22000 0x1000>; - }; - - eth1: ethernet@30000 { - compatible = "marvell,armada-370-neta"; - reg = <0x30000 0x4000>; - interrupts-extended = <&mpic 10>; - clocks = <&gateclk 3>; - status = "disabled"; - }; - - eth2: ethernet@34000 { - compatible = "marvell,armada-370-neta"; - reg = <0x34000 0x4000>; - interrupts-extended = <&mpic 12>; - clocks = <&gateclk 2>; - status = "disabled"; - }; - - usb@58000 { - compatible = "marvell,orion-ehci"; - reg = <0x58000 0x500>; - interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&gateclk 18>; - status = "disabled"; - }; - - xor@60800 { - compatible = "marvell,orion-xor"; - reg = <0x60800 0x100 - 0x60a00 0x100>; - clocks = <&gateclk 22>; - status = "okay"; - - xor00 { - interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; - dmacap,memcpy; - dmacap,xor; - }; - xor01 { - interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; - dmacap,memcpy; - dmacap,xor; - dmacap,memset; - }; - }; - - xor@60900 { - compatible = "marvell,orion-xor"; - reg = <0x60900 0x100 - 0x60b00 0x100>; - clocks = <&gateclk 28>; - status = "okay"; - - xor10 { - interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>; - dmacap,memcpy; - dmacap,xor; - }; - xor11 { - interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>; - dmacap,memcpy; - dmacap,xor; - dmacap,memset; - }; - }; - - eth0: ethernet@70000 { - compatible = "marvell,armada-370-neta"; - reg = <0x70000 0x4000>; - interrupts-extended = <&mpic 8>; - clocks = <&gateclk 4>; - status = "disabled"; - }; - - mdio: mdio@72004 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "marvell,orion-mdio"; - reg = <0x72004 0x4>; - clocks = <&gateclk 4>; - }; - - rtc@a3800 { - compatible = "marvell,armada-380-rtc"; - reg = <0xa3800 0x20>, <0x184a0 0x0c>; - reg-names = "rtc", "rtc-soc"; - interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; - }; - - sata@a8000 { - compatible = "marvell,armada-380-ahci"; - reg = <0xa8000 0x2000>; - interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&gateclk 15>; - status = "disabled"; - }; - - sata@e0000 { - compatible = "marvell,armada-380-ahci"; - reg = <0xe0000 0x2000>; - interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&gateclk 30>; - status = "disabled"; - }; - - coredivclk: clock@e4250 { - compatible = "marvell,armada-380-corediv-clock"; - reg = <0xe4250 0xc>; - #clock-cells = <1>; - clocks = <&mainpll>; - clock-output-names = "nand"; - }; - - thermal@e8078 { - compatible = "marvell,armada380-thermal"; - reg = <0xe4078 0x4>, <0xe4074 0x4>; - status = "okay"; - }; - - flash@d0000 { - compatible = "marvell,armada370-nand"; - reg = <0xd0000 0x54>; - #address-cells = <1>; - #size-cells = <1>; - interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&coredivclk 0>; - status = "disabled"; - }; - - sdhci@d8000 { - compatible = "marvell,armada-380-sdhci"; - reg-names = "sdhci", "mbus", "conf-sdio3"; - reg = <0xd8000 0x1000>, - <0xdc000 0x100>, - <0x18454 0x4>; - interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&gateclk 17>; - mrvl,clk-delay-cycles = <0x1F>; - status = "disabled"; - }; - - usb3@f0000 { - compatible = "marvell,armada-380-xhci"; - reg = <0xf0000 0x4000>,<0xf4000 0x4000>; - interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&gateclk 9>; - status = "disabled"; - }; - - usb3@f8000 { - compatible = "marvell,armada-380-xhci"; - reg = <0xf8000 0x4000>,<0xfc000 0x4000>; - interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&gateclk 10>; - status = "disabled"; - }; - }; - }; - - pci0: pcie@f1080000 { - compatible = "mrvl,pcie"; - status = "disabled"; - device_type = "pci"; - #interrupt-cells = <3>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0xf1080000 0x2000>; - bus-range = <0 255>; - ranges = <0x42000000 0x0 0xf1200000 0xf1200000 0x0 0x00100000 - 0x41000000 0x0 0x00000000 0xf1300000 0x0 0x00100000>; - interrupt-parent = <&gic>; - interrupts = <GIC_SPI 91 0>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - 0x0000 0x0 0x0 0x1 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH - >; - }; - - clocks { - /* 2 GHz fixed main PLL */ - mainpll: mainpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <1000000000>; - }; - - /* 25 MHz reference crystal */ - refclk: oscillator { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <25000000>; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/bananapi.dts b/usr/src/boot/sys/boot/fdt/dts/arm/bananapi.dts deleted file mode 100644 index 0bd1b38394..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/bananapi.dts +++ /dev/null @@ -1,93 +0,0 @@ -/*- - * Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -#include "sun7i-a20.dtsi" - -#include <dt-bindings/gpio/gpio.h> - -/ { - model = "LeMaker Banana Pi"; - compatible = "lemaker,bananapi", "allwinner,sun7i-a20"; - - memory { - device_type = "memory"; - reg = < 0x40000000 0x40000000 >; /* 1GB RAM */ - }; - - aliases { - soc = &SOC; - UART0 = &UART0; - }; - - SOC: a20 { - - usb1: usb@01c14000 { - status = "okay"; - }; - - usb2: usb@01c1c000 { - status = "okay"; - }; - - UART0: serial@01c28000 { - status = "okay"; - }; - - mmc0: mmc@01c0f000 { - status = "okay"; - }; - - gmac@01c50000 { - phy-mode = "rgmii-bpi"; - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&gmac_pins_rgmii>; - }; - - ahci: sata@01c18000 { - status = "okay"; - }; - }; - - leds { - compatible = "gpio-leds"; - - green { - label = "bananapi:green:usr"; - gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "UART0"; - stdout = "UART0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/bcm2835.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/bcm2835.dtsi deleted file mode 100644 index 0b73401e4a..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/bcm2835.dtsi +++ /dev/null @@ -1,497 +0,0 @@ -/* - * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@bluezbox.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - cpu@0 { - compatible = "arm,1176jzf-s"; - }; - }; - - - SOC: axi { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x20000000 0x01000000>; - ranges = <0 0x20000000 0x01000000>; - - intc: interrupt-controller { - compatible = "broadcom,bcm2835-armctrl-ic", - "broadcom,bcm2708-armctrl-ic"; - reg = <0xB200 0x200>; - - interrupt-controller; - #interrupt-cells = <1>; - - /* Bank 0 - * 0: ARM_TIMER - * 1: ARM_MAILBOX - * 2: ARM_DOORBELL_0 - * 3: ARM_DOORBELL_1 - * 4: VPU0_HALTED - * 5: VPU1_HALTED - * 6: ILLEGAL_TYPE0 - * 7: ILLEGAL_TYPE1 - */ - - /* Bank 1 - * 0: TIMER0 16: DMA0 - * 1: TIMER1 17: DMA1 - * 2: TIMER2 18: VC_DMA2 - * 3: TIMER3 19: VC_DMA3 - * 4: CODEC0 20: DMA4 - * 5: CODEC1 21: DMA5 - * 6: CODEC2 22: DMA6 - * 7: VC_JPEG 23: DMA7 - * 8: ISP 24: DMA8 - * 9: VC_USB 25: DMA9 - * 10: VC_3D 26: DMA10 - * 11: TRANSPOSER 27: DMA11 - * 12: MULTICORESYNC0 28: DMA12 - * 13: MULTICORESYNC1 29: AUX - * 14: MULTICORESYNC2 30: ARM - * 15: MULTICORESYNC3 31: VPUDMA - */ - - /* Bank 2 - * 0: HOSTPORT 16: SMI - * 1: VIDEOSCALER 17: GPIO0 - * 2: CCP2TX 18: GPIO1 - * 3: SDC 19: GPIO2 - * 4: DSI0 20: GPIO3 - * 5: AVE 21: VC_I2C - * 6: CAM0 22: VC_SPI - * 7: CAM1 23: VC_I2SPCM - * 8: HDMI0 24: VC_SDIO - * 9: HDMI1 25: VC_UART - * 10: PIXELVALVE1 26: SLIMBUS - * 11: I2CSPISLV 27: VEC - * 12: DSI1 28: CPG - * 13: PWA0 29: RNG - * 14: PWA1 30: VC_ARASANSDIO - * 15: CPR 31: AVSPMON - */ - }; - - timer { - compatible = "broadcom,bcm2835-system-timer", - "broadcom,bcm2708-system-timer"; - reg = <0x3000 0x1000>; - interrupts = <8 9 10 11>; - interrupt-parent = <&intc>; - - clock-frequency = <1000000>; - }; - - armtimer { - /* Not AMBA compatible */ - compatible = "broadcom,bcm2835-sp804", "arm,sp804"; - reg = <0xB400 0x24>; - interrupts = <0>; - interrupt-parent = <&intc>; - }; - - watchdog0 { - compatible = "broadcom,bcm2835-wdt", - "broadcom,bcm2708-wdt"; - reg = <0x10001c 0x0c>; /* 0x1c, 0x20, 0x24 */ - }; - - gpio: gpio { - compatible = "broadcom,bcm2835-gpio", - "broadcom,bcm2708-gpio"; - reg = <0x200000 0xb0>; - - /* Unusual arrangement of interrupts - * (determined by testing) - * 17: Bank 0 (GPIOs 0-31) - * 19: Bank 1 (GPIOs 32-53) - * 18: Bank 2 - * 20: All banks (GPIOs 0-53) - */ - interrupts = <57 59 58 60>; - interrupt-parent = <&intc>; - - gpio-controller; - #gpio-cells = <2>; - - interrupt-controller; - #interrupt-cells = <1>; - - pinctrl-names = "default"; - pinctrl-0 = <&pins_reserved>; - - /* Pins that can short 3.3V to GND in output mode: 46-47 - * Pins used by VideoCore: 48-53 - */ - broadcom,read-only = <46>, <47>, <48>, <49>, <50>, - <51>, <52>, <53>; - - /* BSC0 */ - pins_bsc0_a: bsc0_a { - broadcom,pins = <0>, <1>; - }; - - pins_bsc0_b: bsc0_b { - broadcom,pins = <28>, <29>; - }; - - pins_bsc0_c: bsc0_c { - broadcom,pins = <44>, <45>; - }; - - /* BSC1 */ - pins_bsc1_a: bsc1_a { - broadcom,pins = <2>, <3>; - }; - - pins_bsc1_b: bsc1_b { - broadcom,pins = <44>, <45>; - }; - - /* GPCLK0 */ - pins_gpclk0_a: gpclk0_a { - broadcom,pins = <4>; - }; - - pins_gpclk0_b: gpclk0_b { - broadcom,pins = <20>; - }; - - pins_gpclk0_c: gpclk0_c { - broadcom,pins = <32>; - }; - - pins_gpclk0_d: gpclk0_d { - broadcom,pins = <34>; - }; - - /* GPCLK1 */ - pins_gpclk1_a: gpclk1_a { - broadcom,pins = <5>; - }; - - pins_gpclk1_b: gpclk1_b { - broadcom,pins = <21>; - }; - - pins_gpclk1_c: gpclk1_c { - broadcom,pins = <42>; - }; - - pins_gpclk1_d: gpclk1_d { - broadcom,pins = <44>; - }; - - /* GPCLK2 */ - pins_gpclk2_a: gpclk2_a { - broadcom,pins = <6>; - }; - - pins_gpclk2_b: gpclk2_b { - broadcom,pins = <43>; - }; - - /* SPI0 */ - pins_spi0_a: spi0_a { - broadcom,pins = <7>, <8>, <9>, <10>, <11>; - }; - - pins_spi0_b: spi0_b { - broadcom,pins = <35>, <36>, <37>, <38>, <39>; - }; - - /* PWM */ - pins_pwm0_a: pwm0_a { - broadcom,pins = <12>; - }; - - pins_pwm0_b: pwm0_b { - broadcom,pins = <18>; - }; - - pins_pwm0_c: pwm0_c { - broadcom,pins = <40>; - }; - - pins_pwm1_a: pwm1_a { - broadcom,pins = <13>; - }; - - pins_pwm1_b: pwm1_b { - broadcom,pins = <19>; - }; - - pins_pwm1_c: pwm1_c { - broadcom,pins = <41>; - }; - - pins_pwm1_d: pwm1_d { - broadcom,pins = <45>; - }; - - /* UART0 */ - pins_uart0_a: uart0_a { - broadcom,pins = <14>, <15>; - }; - - pins_uart0_b: uart0_b { - broadcom,pins = <32>, <33>; - }; - - pins_uart0_c: uart0_c { - broadcom,pins = <36>, <37>; - }; - - pins_uart0_fc_a: uart0_fc_a { - broadcom,pins = <16>, <17>; - }; - - pins_uart0_fc_b: uart0_fc_b { - broadcom,pins = <30>, <31>; - }; - - pins_uart0_fc_c: uart0_fc_c { - broadcom,pins = <39>, <38>; - }; - - /* PCM */ - pins_pcm_a: pcm_a { - broadcom,pins = <18>, <19>, <20>, <21>; - }; - - pins_pcm_b: pcm_b { - broadcom,pins = <28>, <29>, <30>, <31>; - }; - - /* Secondary Address Bus */ - pins_sm_addr_a: sm_addr_a { - broadcom,pins = <5>, <4>, <3>, <2>, <1>, <0>; - }; - - pins_sm_addr_b: sm_addr_b { - broadcom,pins = <33>, <32>, <31>, <30>, <29>, - <28>; - }; - - pins_sm_ctl_a: sm_ctl_a { - broadcom,pins = <6>, <7>; - }; - - pins_sm_ctl_b: sm_ctl_b { - broadcom,pins = <34>, <35>; - }; - - pins_sm_data_8bit_a: sm_data_8bit_a { - broadcom,pins = <8>, <9>, <10>, <11>, <12>, - <13>, <14>, <15>; - }; - - pins_sm_data_8bit_b: sm_data_8bit_b { - broadcom,pins = <36>, <37>, <38>, <39>, <40>, - <41>, <42>, <43>; - }; - - pins_sm_data_16bit: sm_data_16bit { - broadcom,pins = <16>, <17>, <18>, <19>, <20>, - <21>, <22>, <23>; - }; - - pins_sm_data_18bit: sm_data_18bit { - broadcom,pins = <24>, <25>; - }; - - /* BSCSL */ - pins_bscsl: bscsl { - broadcom,pins = <18>, <19>; - }; - - /* SPISL */ - pins_spisl: spisl { - broadcom,pins = <18>, <19>, <20>, <21>; - }; - - /* SPI1 */ - pins_spi1: spi1 { - broadcom,pins = <16>, <17>, <18>, <19>, <20>, - <21>; - }; - - /* UART1 */ - pins_uart1_a: uart1_a { - broadcom,pins = <14>, <15>; - }; - - pins_uart1_b: uart1_b { - broadcom,pins = <32>, <33>; - }; - - pins_uart1_c: uart1_c { - broadcom,pins = <40>, <41>; - }; - - pins_uart1_fc_a: uart1_fc_a { - broadcom,pins = <16>, <17>; - }; - - pins_uart1_fc_b: uart1_fc_b { - broadcom,pins = <30>, <31>; - }; - - pins_uart1_fc_c: uart1_fc_c { - broadcom,pins = <43>, <42>; - }; - - /* SPI2 */ - pins_spi2: spi2 { - broadcom,pins = <40>, <41>, <42>, <43>, <44>, - <45>; - }; - - /* ARM JTAG */ - pins_arm_jtag_trst: arm_jtag_trst { - broadcom,pins = <22>; - }; - - pins_arm_jtag_a: arm_jtag_a { - broadcom,pins = <4>, <5>, <6>, <12>, <13>; - }; - - pins_arm_jtag_b: arm_jtag_b { - broadcom,pins = <23>, <24>, <25>, <26>, <27>; - }; - - /* Reserved */ - pins_reserved: reserved { - broadcom,pins = <48>, <49>, <50>, <51>, <52>, - <53>; - }; - }; - - bsc0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "broadcom,bcm2835-bsc", - "broadcom,bcm2708-bsc"; - reg = <0x205000 0x20>; - interrupts = <61>; - interrupt-parent = <&intc>; - }; - - bsc1 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "broadcom,bcm2835-bsc", - "broadcom,bcm2708-bsc"; - reg = <0x804000 0x20>; - interrupts = <61>; - interrupt-parent = <&intc>; - }; - - spi0 { - compatible = "broadcom,bcm2835-spi", - "broadcom,bcm2708-spi"; - reg = <0x204000 0x20>; - interrupts = <62>; - interrupt-parent = <&intc>; - }; - - dma: dma { - compatible = "broadcom,bcm2835-dma", - "broadcom,bcm2708-dma"; - reg = <0x7000 0x1000>, <0xE05000 0x1000>; - interrupts = <24 25 26 27 28 29 30 31 32 33 34 35 36>; - interrupt-parent = <&intc>; - - broadcom,channels = <0>; /* Set by VideoCore */ - }; - - vc_mbox: mbox { - compatible = "broadcom,bcm2835-mbox", - "broadcom,bcm2708-mbox"; - reg = <0xB880 0x40>; - interrupts = <1>; - interrupt-parent = <&intc>; - - /* Channels - * 0: Power - * 1: Frame buffer - * 2: Virtual UART - * 3: VCHIQ - * 4: LEDs - * 5: Buttons - * 6: Touch screen - */ - }; - - sdhci { - compatible = "broadcom,bcm2835-sdhci", - "broadcom,bcm2708-sdhci"; - reg = <0x300000 0x100>; - interrupts = <70>; - interrupt-parent = <&intc>; - - clock-frequency = <50000000>; /* Set by VideoCore */ - }; - - uart0: uart0 { - compatible = "broadcom,bcm2835-uart", - "broadcom,bcm2708-uart", "arm,pl011", - "arm,primecell"; - reg = <0x201000 0x1000>; - interrupts = <65>; - interrupt-parent = <&intc>; - - clock-frequency = <3000000>; /* Set by VideoCore */ - reg-shift = <2>; - }; - - vchiq: vchiq { - compatible = "broadcom,bcm2835-vchiq"; - reg = <0xB800 0x50>; - interrupts = <2>; - interrupt-parent = <&intc>; - cache-line-size = <32>; - }; - - usb { - compatible = "broadcom,bcm2835-usb", - "broadcom,bcm2708-usb", - "synopsys,designware-hs-otg2"; - reg = <0x980000 0x20000>; - interrupts = <17>; - interrupt-parent = <&intc>; - #address-cells = <1>; - #size-cells = <0>; - }; - - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/bcm2836.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/bcm2836.dtsi deleted file mode 100644 index ce967df7ea..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/bcm2836.dtsi +++ /dev/null @@ -1,479 +0,0 @@ -/* - * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@bluezbox.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - #address-cells = <1>; - #size-cells = <1>; - - timer { - compatible = "arm,armv7-timer"; - clock-frequency = <19200000>; - interrupts = <72 73 75 74>; - interrupt-parent = <&intc>; - }; - - SOC: axi { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x3f000000 0x01000000>; - ranges = <0 0x3f000000 0x01000000>; - - intc: interrupt-controller { - compatible = "broadcom,bcm2835-armctrl-ic", - "broadcom,bcm2708-armctrl-ic"; - reg = <0xB200 0x200>; - - interrupt-controller; - #interrupt-cells = <1>; - - /* Bank 0 - * 0: ARM_TIMER - * 1: ARM_MAILBOX - * 2: ARM_DOORBELL_0 - * 3: ARM_DOORBELL_1 - * 4: VPU0_HALTED - * 5: VPU1_HALTED - * 6: ILLEGAL_TYPE0 - * 7: ILLEGAL_TYPE1 - */ - - /* Bank 1 - * 0: TIMER0 16: DMA0 - * 1: TIMER1 17: DMA1 - * 2: TIMER2 18: VC_DMA2 - * 3: TIMER3 19: VC_DMA3 - * 4: CODEC0 20: DMA4 - * 5: CODEC1 21: DMA5 - * 6: CODEC2 22: DMA6 - * 7: VC_JPEG 23: DMA7 - * 8: ISP 24: DMA8 - * 9: VC_USB 25: DMA9 - * 10: VC_3D 26: DMA10 - * 11: TRANSPOSER 27: DMA11 - * 12: MULTICORESYNC0 28: DMA12 - * 13: MULTICORESYNC1 29: AUX - * 14: MULTICORESYNC2 30: ARM - * 15: MULTICORESYNC3 31: VPUDMA - */ - - /* Bank 2 - * 0: HOSTPORT 16: SMI - * 1: VIDEOSCALER 17: GPIO0 - * 2: CCP2TX 18: GPIO1 - * 3: SDC 19: GPIO2 - * 4: DSI0 20: GPIO3 - * 5: AVE 21: VC_I2C - * 6: CAM0 22: VC_SPI - * 7: CAM1 23: VC_I2SPCM - * 8: HDMI0 24: VC_SDIO - * 9: HDMI1 25: VC_UART - * 10: PIXELVALVE1 26: SLIMBUS - * 11: I2CSPISLV 27: VEC - * 12: DSI1 28: CPG - * 13: PWA0 29: RNG - * 14: PWA1 30: VC_ARASANSDIO - * 15: CPR 31: AVSPMON - */ - }; - - watchdog0 { - compatible = "broadcom,bcm2835-wdt", - "broadcom,bcm2708-wdt"; - reg = <0x10001c 0x0c>; /* 0x1c, 0x20, 0x24 */ - }; - - gpio: gpio { - compatible = "broadcom,bcm2835-gpio", - "broadcom,bcm2708-gpio"; - reg = <0x200000 0xb0>; - - /* Unusual arrangement of interrupts - * (determined by testing) - * 17: Bank 0 (GPIOs 0-31) - * 19: Bank 1 (GPIOs 32-53) - * 18: Bank 2 - * 20: All banks (GPIOs 0-53) - */ - interrupts = <57 59 58 60>; - interrupt-parent = <&intc>; - - gpio-controller; - #gpio-cells = <2>; - - interrupt-controller; - #interrupt-cells = <1>; - - pinctrl-names = "default"; - pinctrl-0 = <&pins_reserved>; - - /* Pins that can short 3.3V to GND in output mode: 46 - * Pins used by VideoCore: 48-53 - */ - broadcom,read-only = <46>, <48>, <49>, <50>, - <51>, <52>, <53>; - - /* BSC0 */ - pins_bsc0_a: bsc0_a { - broadcom,pins = <0>, <1>; - }; - - pins_bsc0_b: bsc0_b { - broadcom,pins = <28>, <29>; - }; - - pins_bsc0_c: bsc0_c { - broadcom,pins = <44>, <45>; - }; - - /* BSC1 */ - pins_bsc1_a: bsc1_a { - broadcom,pins = <2>, <3>; - }; - - pins_bsc1_b: bsc1_b { - broadcom,pins = <44>, <45>; - }; - - /* GPCLK0 */ - pins_gpclk0_a: gpclk0_a { - broadcom,pins = <4>; - }; - - pins_gpclk0_b: gpclk0_b { - broadcom,pins = <20>; - }; - - pins_gpclk0_c: gpclk0_c { - broadcom,pins = <32>; - }; - - pins_gpclk0_d: gpclk0_d { - broadcom,pins = <34>; - }; - - /* GPCLK1 */ - pins_gpclk1_a: gpclk1_a { - broadcom,pins = <5>; - }; - - pins_gpclk1_b: gpclk1_b { - broadcom,pins = <21>; - }; - - pins_gpclk1_c: gpclk1_c { - broadcom,pins = <42>; - }; - - pins_gpclk1_d: gpclk1_d { - broadcom,pins = <44>; - }; - - /* GPCLK2 */ - pins_gpclk2_a: gpclk2_a { - broadcom,pins = <6>; - }; - - pins_gpclk2_b: gpclk2_b { - broadcom,pins = <43>; - }; - - /* SPI0 */ - pins_spi0_a: spi0_a { - broadcom,pins = <7>, <8>, <9>, <10>, <11>; - }; - - pins_spi0_b: spi0_b { - broadcom,pins = <35>, <36>, <37>, <38>, <39>; - }; - - /* PWM */ - pins_pwm0_a: pwm0_a { - broadcom,pins = <12>; - }; - - pins_pwm0_b: pwm0_b { - broadcom,pins = <18>; - }; - - pins_pwm0_c: pwm0_c { - broadcom,pins = <40>; - }; - - pins_pwm1_a: pwm1_a { - broadcom,pins = <13>; - }; - - pins_pwm1_b: pwm1_b { - broadcom,pins = <19>; - }; - - pins_pwm1_c: pwm1_c { - broadcom,pins = <41>; - }; - - pins_pwm1_d: pwm1_d { - broadcom,pins = <45>; - }; - - /* UART0 */ - pins_uart0_a: uart0_a { - broadcom,pins = <14>, <15>; - }; - - pins_uart0_b: uart0_b { - broadcom,pins = <32>, <33>; - }; - - pins_uart0_c: uart0_c { - broadcom,pins = <36>, <37>; - }; - - pins_uart0_fc_a: uart0_fc_a { - broadcom,pins = <16>, <17>; - }; - - pins_uart0_fc_b: uart0_fc_b { - broadcom,pins = <30>, <31>; - }; - - pins_uart0_fc_c: uart0_fc_c { - broadcom,pins = <39>, <38>; - }; - - /* PCM */ - pins_pcm_a: pcm_a { - broadcom,pins = <18>, <19>, <20>, <21>; - }; - - pins_pcm_b: pcm_b { - broadcom,pins = <28>, <29>, <30>, <31>; - }; - - /* Secondary Address Bus */ - pins_sm_addr_a: sm_addr_a { - broadcom,pins = <5>, <4>, <3>, <2>, <1>, <0>; - }; - - pins_sm_addr_b: sm_addr_b { - broadcom,pins = <33>, <32>, <31>, <30>, <29>, - <28>; - }; - - pins_sm_ctl_a: sm_ctl_a { - broadcom,pins = <6>, <7>; - }; - - pins_sm_ctl_b: sm_ctl_b { - broadcom,pins = <34>, <35>; - }; - - pins_sm_data_8bit_a: sm_data_8bit_a { - broadcom,pins = <8>, <9>, <10>, <11>, <12>, - <13>, <14>, <15>; - }; - - pins_sm_data_8bit_b: sm_data_8bit_b { - broadcom,pins = <36>, <37>, <38>, <39>, <40>, - <41>, <42>, <43>; - }; - - pins_sm_data_16bit: sm_data_16bit { - broadcom,pins = <16>, <17>, <18>, <19>, <20>, - <21>, <22>, <23>; - }; - - pins_sm_data_18bit: sm_data_18bit { - broadcom,pins = <24>, <25>; - }; - - /* BSCSL */ - pins_bscsl: bscsl { - broadcom,pins = <18>, <19>; - }; - - /* SPISL */ - pins_spisl: spisl { - broadcom,pins = <18>, <19>, <20>, <21>; - }; - - /* SPI1 */ - pins_spi1: spi1 { - broadcom,pins = <16>, <17>, <18>, <19>, <20>, - <21>; - }; - - /* UART1 */ - pins_uart1_a: uart1_a { - broadcom,pins = <14>, <15>; - }; - - pins_uart1_b: uart1_b { - broadcom,pins = <32>, <33>; - }; - - pins_uart1_c: uart1_c { - broadcom,pins = <40>, <41>; - }; - - pins_uart1_fc_a: uart1_fc_a { - broadcom,pins = <16>, <17>; - }; - - pins_uart1_fc_b: uart1_fc_b { - broadcom,pins = <30>, <31>; - }; - - pins_uart1_fc_c: uart1_fc_c { - broadcom,pins = <43>, <42>; - }; - - /* SPI2 */ - pins_spi2: spi2 { - broadcom,pins = <40>, <41>, <42>, <43>, <44>, - <45>; - }; - - /* ARM JTAG */ - pins_arm_jtag_trst: arm_jtag_trst { - broadcom,pins = <22>; - }; - - pins_arm_jtag_a: arm_jtag_a { - broadcom,pins = <4>, <5>, <6>, <12>, <13>; - }; - - pins_arm_jtag_b: arm_jtag_b { - broadcom,pins = <23>, <24>, <25>, <26>, <27>; - }; - - /* Reserved */ - pins_reserved: reserved { - broadcom,pins = <48>, <49>, <50>, <51>, <52>, - <53>; - }; - }; - - bsc0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "broadcom,bcm2835-bsc", - "broadcom,bcm2708-bsc"; - reg = <0x205000 0x20>; - interrupts = <61>; - interrupt-parent = <&intc>; - }; - - bsc1 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "broadcom,bcm2835-bsc", - "broadcom,bcm2708-bsc"; - reg = <0x804000 0x20>; - interrupts = <61>; - interrupt-parent = <&intc>; - }; - - spi0 { - compatible = "broadcom,bcm2835-spi", - "broadcom,bcm2708-spi"; - reg = <0x204000 0x20>; - interrupts = <62>; - interrupt-parent = <&intc>; - }; - - dma: dma { - compatible = "broadcom,bcm2835-dma", - "broadcom,bcm2708-dma"; - reg = <0x7000 0x1000>, <0xE05000 0x1000>; - interrupts = <24 25 26 27 28 29 30 31 32 33 34 35 36>; - interrupt-parent = <&intc>; - - broadcom,channels = <0>; /* Set by VideoCore */ - }; - - vc_mbox: mbox { - compatible = "broadcom,bcm2835-mbox", - "broadcom,bcm2708-mbox"; - reg = <0xB880 0x40>; - interrupts = <1>; - interrupt-parent = <&intc>; - - /* Channels - * 0: Power - * 1: Frame buffer - * 2: Virtual UART - * 3: VCHIQ - * 4: LEDs - * 5: Buttons - * 6: Touch screen - */ - }; - - sdhci { - compatible = "broadcom,bcm2835-sdhci", - "broadcom,bcm2708-sdhci"; - reg = <0x300000 0x100>; - interrupts = <70>; - interrupt-parent = <&intc>; - - clock-frequency = <250000000>; /* Set by VideoCore */ - }; - - uart0: uart0 { - compatible = "broadcom,bcm2835-uart", - "broadcom,bcm2708-uart", "arm,pl011", - "arm,primecell"; - reg = <0x201000 0x1000>; - interrupts = <65>; - interrupt-parent = <&intc>; - - clock-frequency = <3000000>; /* Set by VideoCore */ - reg-shift = <2>; - }; - - vchiq: vchiq { - compatible = "broadcom,bcm2835-vchiq"; - reg = <0xB800 0x50>; - interrupts = <2>; - interrupt-parent = <&intc>; - cache-line-size = <32>; - }; - - usb { - compatible = "broadcom,bcm2835-usb", - "broadcom,bcm2708-usb", - "synopsys,designware-hs-otg2"; - reg = <0x980000 0x20000>; - interrupts = <17>; - interrupt-parent = <&intc>; - #address-cells = <1>; - #size-cells = <0>; - }; - - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone-black.dts b/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone-black.dts deleted file mode 100644 index d4f19b260c..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone-black.dts +++ /dev/null @@ -1,83 +0,0 @@ -/*- - * Copyright (c) 2015 Oleksandr Tymoshenko <gonzo@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - - -#include "am335x-boneblack.dts" -#include "beaglebone-common.dtsi" - -&am33xx_pinmux { - i2c1_pins: pinmux_i2c1_pins { - pinctrl-single,pins = < - 0x158 (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */ - 0x15c (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */ - >; - }; - - i2c2_pins: pinmux_i2c2_pins { - pinctrl-single,pins = < - 0x178 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_ctsn.i2c2_sda */ - 0x17c (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.i2c2_scl */ - >; - }; -}; - -&i2c0 { - tda998x: hdmi-encoder { - compatible = "nxp,tda998x"; - reg = <0x70>; - - pinctrl-names = "default", "off"; - pinctrl-0 = <&nxp_hdmi_bonelt_pins>; - pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; - status = "okay"; - }; -}; - -&i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; - - status = "okay"; -}; - -&i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins>; - - status = "okay"; -}; - -&lcdc { - hdmi = <&tda998x>; -}; - -/ { - hdmi { - status = "disabled"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone-common.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone-common.dtsi deleted file mode 100644 index ec69d97c2c..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone-common.dtsi +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * Copyright (c) 2015 Oleksandr Tymoshenko <gonzo@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - ocp { - pruss@4A300000 { - compatible = "ti,pruss-v2"; - reg = <0x4A300000 0x80000>; - interrupt-parent = <&intc>; - interrupts = <20 21 22 23 24 25 26 27>; - }; - - }; - -}; - -&tps { - interrupt-parent = <&intc>; - interrupts = <7>; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone.dts b/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone.dts deleted file mode 100644 index 18e849dab2..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/beaglebone.dts +++ /dev/null @@ -1,30 +0,0 @@ -/*- - * Copyright (c) 2015 Oleksandr Tymoshenko <gonzo@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "am335x-bone.dts" -#include "beaglebone-common.dtsi" diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/cubieboard.dts b/usr/src/boot/sys/boot/fdt/dts/arm/cubieboard.dts deleted file mode 100644 index a21ea4d746..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/cubieboard.dts +++ /dev/null @@ -1,81 +0,0 @@ -/*- - * Copyright (c) 2012 Ganbold Tsagaankhuu <ganbold@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -#include "sun4i-a10.dtsi" - -/ { - model = "Cubietech Cubieboard"; - - memory { - device_type = "memory"; - reg = < 0x40000000 0x40000000 >; /* 1GB RAM */ - }; - - aliases { - soc = &SOC; - UART0 = &UART0; - }; - - SOC: a10 { - - usb1: usb@01c14000 { - status = "okay"; - }; - - usb2: usb@01c1c000 { - status = "okay"; - }; - - UART0: serial@01c28000 { - status = "okay"; - }; - - mmc0: mmc@01c0f000 { - status = "okay"; - }; - - emac@01c0b000 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&emac_pins>; - }; - - ahci: sata@01c18000 { - status = "okay"; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "UART0"; - stdout = "UART0"; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/cubieboard2.dts b/usr/src/boot/sys/boot/fdt/dts/arm/cubieboard2.dts deleted file mode 100644 index f9e1eb8e77..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/cubieboard2.dts +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@freebsd.org> - * Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "sun7i-a20-cubieboard2.dts" -#include "sun7i-a20-hdmi.dtsi" - -/ { - soc@01c00000 { - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - - hdmi@01c16000 { - status = "okay"; - }; - - hdmiaudio { - status = "okay"; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/db78100.dts b/usr/src/boot/sys/boot/fdt/dts/arm/db78100.dts deleted file mode 100644 index 8a9e91c020..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/db78100.dts +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Marvell DB-78100 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-78100"; - compatible = "DB-78100-BP", "DB-78100-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - serial0 = &serial0; - serial1 = &serial1; - mpp = &MPP; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR571"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x20000000>; // 512M at 0x0 - }; - - localbus@0 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - bank-count = <5>; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x2f 0xf9300000 0x00100000 - 0x1 0x3e 0xf9400000 0x00100000 - 0x2 0x3d 0xf9500000 0x02000000 - 0x3 0x3b 0xfb500000 0x00100000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00100000>; - }; - - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - }; - - nand@3,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "mrvl,nfc"; - reg = <0x3 0x0 0x00100000>; - }; - }; - - soc78100@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <8>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count = <50>; - pin-map = < - 0 2 /* MPP[0]: GE1_TXCLK */ - 1 2 /* MPP[1]: GE1_TXCTL */ - 2 2 /* MPP[2]: GE1_RXCTL */ - 3 2 /* MPP[3]: GE1_RXCLK */ - 4 2 /* MPP[4]: GE1_TXD[0] */ - 5 2 /* MPP[5]: GE1_TXD[1] */ - 6 2 /* MPP[6]: GE1_TXD[2] */ - 7 2 /* MPP[7]: GE1_TXD[3] */ - 8 2 /* MPP[8]: GE1_RXD[0] */ - 9 2 /* MPP[9]: GE1_RXD[1] */ - 10 2 /* MPP[10]: GE1_RXD[2] */ - 11 2 /* MPP[11]: GE1_RXD[3] */ - 13 3 /* MPP[13]: SYSRST_OUTn */ - 14 3 /* MPP[14]: SATA1_ACTn */ - 15 3 /* MPP[15]: SATA0_ACTn */ - 16 4 /* MPP[16]: UA2_TXD */ - 17 4 /* MPP[17]: UA2_RXD */ - 18 3 /* MPP[18]: <UNKNOWN> */ - 19 3 /* MPP[19]: <UNKNOWN> */ - 20 3 /* MPP[20]: <UNKNOWN> */ - 21 3 /* MPP[21]: <UNKNOWN> */ - 22 4 /* MPP[22]: UA3_TXD */ - 23 4 >; /* MPP[21]: UA3_RXD */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <56 57 58 59>; - interrupt-parent = <&PIC>; - }; - - rtc@10300 { - compatible = "mrvl,rtc"; - reg = <0x10300 0x08>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <2>; - interrupt-parent = <&PIC>; - }; - - twsi@11100 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11100 0x20>; - interrupts = <3>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <41 42 43 40 70>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x8>; - }; - phy1: ethernet-phy@1 { - reg = <0x9>; - }; - }; - }; - - enet1: ethernet@76000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x76000 0x2000>; - ranges = <0x0 0x76000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <45 46 47 44 70>; - interrupt-parent = <&PIC>; - phy-handle = <&phy1>; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <12>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <13>; - interrupt-parent = <&PIC>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <72 16>; - interrupt-parent = <&PIC>; - }; - - usb@51000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x51000 0x1000>; - interrupts = <72 17>; - interrupt-parent = <&PIC>; - }; - - usb@52000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x52000 0x1000>; - interrupts = <72 18>; - interrupt-parent = <&PIC>; - }; - - xor@60000 { - compatible = "mrvl,xor"; - reg = <0x60000 0x1000>; - interrupts = <22 23>; - interrupt-parent = <&PIC>; - }; - - crypto@90000 { - compatible = "mrvl,cesa"; - reg = <0x90000 0x10000>; - interrupts = <19>; - interrupt-parent = <&PIC>; - }; - - sata@a0000 { - compatible = "mrvl,sata"; - reg = <0xa0000 0x6000>; - interrupts = <26>; - interrupt-parent = <&PIC>; - }; - }; - - pci0: pcie@f1040000 { - compatible = "mrvl,pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0xf1040000 0x2000>; - bus-range = <0 255>; - ranges = <0x02000000 0x0 0xf2000000 0xf2000000 0x0 0x04000000 - 0x01000000 0x0 0x00000000 0xf1100000 0x0 0x00100000>; - clock-frequency = <33333333>; - interrupt-parent = <&PIC>; - interrupts = <68>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - /* IDSEL 0x1 */ - 0x0800 0x0 0x0 0x1 &PIC 0x20 - 0x0800 0x0 0x0 0x2 &PIC 0x21 - 0x0800 0x0 0x0 0x3 &PIC 0x22 - 0x0800 0x0 0x0 0x4 &PIC 0x23 - >; - }; - - sram@fd000000 { - compatible = "mrvl,cesa-sram"; - reg = <0xfd000000 0x00100000>; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/db78460.dts b/usr/src/boot/sys/boot/fdt/dts/arm/db78460.dts deleted file mode 100644 index 8bc04f8dfa..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/db78460.dts +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * Copyright (c) 2010-2011 Semihalf - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Marvell DB-78460 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-78460"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - serial0 = &serial0; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88VS584"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <200000000>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x80000000>; // 2G at 0x0 - }; - - soc78460@d0000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xd0000000 0x00100000>; - bus-frequency = <0>; - - - MPIC: mpic@20a00 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20a00 0x500 0x21000 0x800 0x20400 0x100>; - compatible = "mrvl,mpic"; - }; - - rtc@10300 { - compatible = "mrvl,rtc"; - reg = <0x10300 0x08>; - }; - - timer@21840 { - compatible = "mrvl,timer"; - reg = <0x21840 0x30>; - interrupts = <5>; - interrupt-parent = <&MPIC>; - mrvl,has-wdt; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <31>; - interrupt-parent = <&MPIC>; - }; - - twsi@11100 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11100 0x20>; - interrupts = <32>; - interrupt-parent = <&MPIC>; - }; - - serial0: serial@12000 { - compatible = "snps,dw-apb-uart"; - reg = <0x12000 0x20>; - reg-shift = <2>; - current-speed = <115200>; - clock-frequency = <0>; - interrupts = <41>; - interrupt-parent = <&MPIC>; - }; - - serial1: serial@12100 { - compatible = "snps,dw-apb-uart"; - reg = <0x12100 0x20>; - reg-shift = <2>; - current-speed = <115200>; - clock-frequency = <0>; - interrupts = <42>; - interrupt-parent = <&MPIC>; - }; - - serial2: serial@12200 { - compatible = "snps,dw-apb-uart"; - reg = <0x12200 0x20>; - reg-shift = <2>; - current-speed = <115200>; - clock-frequency = <0>; - interrupts = <43>; - interrupt-parent = <&MPIC>; - }; - - serial3: serial@12300 { - compatible = "snps,dw-apb-uart"; - reg = <0x12300 0x20>; - reg-shift = <2>; - current-speed = <115200>; - clock-frequency = <0>; - interrupts = <44>; - interrupt-parent = <&MPIC>; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x18000 0x34>; - pin-count = <68>; - pin-map = < - 0 1 /* MPP[0]: GE1_TXCLK */ - 1 1 /* MPP[1]: GE1_TXCTL */ - 2 1 /* MPP[2]: GE1_RXCTL */ - 3 1 /* MPP[3]: GE1_RXCLK */ - 4 1 /* MPP[4]: GE1_TXD[0] */ - 5 1 /* MPP[5]: GE1_TXD[1] */ - 6 1 /* MPP[6]: GE1_TXD[2] */ - 7 1 /* MPP[7]: GE1_TXD[3] */ - 8 1 /* MPP[8]: GE1_RXD[0] */ - 9 1 /* MPP[9]: GE1_RXD[1] */ - 10 1 /* MPP[10]: GE1_RXD[2] */ - 11 1 /* MPP[11]: GE1_RXD[3] */ - 12 2 /* MPP[13]: SYSRST_OUTn */ - 13 2 /* MPP[13]: SYSRST_OUTn */ - 14 2 /* MPP[14]: SATA1_ACTn */ - 15 2 /* MPP[15]: SATA0_ACTn */ - 16 2 /* MPP[16]: UA2_TXD */ - 17 2 /* MPP[17]: UA2_RXD */ - 18 2 /* MPP[18]: <UNKNOWN> */ - 19 2 /* MPP[19]: <UNKNOWN> */ - 20 2 /* MPP[20]: <UNKNOWN> */ - 21 2 /* MPP[21]: <UNKNOWN> */ - 22 2 /* MPP[22]: UA3_TXD */ - 23 2 - 24 0 - 25 0 - 26 0 - 27 0 - 28 4 - 29 0 - 30 1 - 31 1 - 32 1 - 33 1 - 34 1 - 35 1 - 36 1 - 37 1 - 38 1 - 39 1 - 40 0 - 41 3 - 42 1 - 43 1 - 44 2 - 45 2 - 46 4 - 47 3 - 48 0 - 49 1 - 50 1 - 51 1 - 52 1 - 53 1 - 54 1 - 55 1 - 56 1 - 57 0 - 58 1 - 59 1 - 60 1 - 61 1 - 62 1 - 63 1 - 64 1 - 65 1 - 66 1 - 67 2 >; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <124 45>; - interrupt-parent = <&MPIC>; - }; - - usb@51000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x51000 0x1000>; - interrupts = <124 46>; - interrupt-parent = <&MPIC>; - }; - - usb@52000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x52000 0x1000>; - interrupts = <124 47>; - interrupt-parent = <&MPIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 04 01 07 84 60 ]; - interrupts = <67 68 122 >; - interrupt-parent = <&MPIC>; - phy-handle = <&phy0>; - has-neta; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - phy1: ethernet-phy@1 { - reg = <0x1>; - }; - phy2: ethernet-phy@2 { - reg = <0x19>; - }; - phy3: ethernet-phy@3 { - reg = <0x1b>; - }; - }; - }; - - sata@A0000 { - compatible = "mrvl,sata"; - reg = <0xA0000 0x6000>; - interrupts = <55>; - interrupt-parent = <&MPIC>; - }; - }; - - pci0: pcie@d0040000 { - compatible = "mrvl,pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0xd0040000 0x2000>; - bus-range = <0 255>; - ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x20000000 - 0x01000000 0x0 0x00000000 0xa0000000 0x0 0x08000000>; - clock-frequency = <33333333>; - interrupt-parent = <&MPIC>; - interrupts = <120>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - 0x0800 0x0 0x0 0x1 &MPIC 0x3A - 0x0800 0x0 0x0 0x2 &MPIC 0x3A - 0x0800 0x0 0x0 0x3 &MPIC 0x3A - 0x0800 0x0 0x0 0x4 &MPIC 0x3A - >; - }; - - sram@ffff0000 { - compatible = "mrvl,cesa-sram"; - reg = <0xffff0000 0x00010000>; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - stddbg = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/db88f5182.dts b/usr/src/boot/sys/boot/fdt/dts/arm/db88f5182.dts deleted file mode 100644 index 6ce7b6580d..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/db88f5182.dts +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Marvell DB-88F5182 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-88F5182"; - compatible = "DB-88F5182-BP", "DB-88F5182-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - serial0 = &serial0; - serial1 = &serial1; - mpp = &MPP; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR531"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x08000000>; // 128M at 0x0 - }; - - localbus@f1000000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - }; - - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - bank-width = <2>; - device-width = <1>; - }; - }; - - soc88f5182@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <0>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x54>; - pin-count = <20>; - pin-map = < - 0 3 /* MPP[0]: GPIO[0] */ - 2 2 /* MPP[2]: PCI_REQn[3] */ - 3 2 /* MPP[3]: PCI_GNTn[3] */ - 4 2 /* MPP[4]: PCI_REQn[4] */ - 5 2 /* MPP[5]: PCI_GNTn[4] */ - 6 5 /* MPP[6]: SATA0_ACT */ - 7 5 /* MPP[7]: SATA1_ACT */ - 12 5 /* MPP[12]: SATA0_PRESENT */ - 13 5 /* MPP[13]: SATA1_PRESENT */ - 14 4 /* MPP[14]: NAND Flash REn[2] */ - 15 4 /* MPP[15]: NAND Flash WEn[2] */ - 16 0 /* MPP[16]: UA1_RXD */ - 17 0 /* MPP[17]: UA1_TXD */ - 18 0 /* MPP[18]: UA1_CTS */ - 19 0 >; /* MPP[19]: UA1_RTS */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <6 7 8 9>; - interrupt-parent = <&PIC>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V1"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <18 19 20 21 22>; - interrupt-parent = <&PIC>; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <3>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <4>; - interrupt-parent = <&PIC>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <17 16>; - interrupt-parent = <&PIC>; - }; - - idma@60000 { - compatible = "mrvl,idma"; - reg = <0x60000 0x1000>; - interrupts = <24 25 26 27 23>; - interrupt-parent = <&PIC>; - }; - - sata@80000 { - compatible = "mrvl,sata"; - reg = <0x80000 0x6000>; - interrupts = <29>; - interrupt-parent = <&PIC>; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/db88f5281.dts b/usr/src/boot/sys/boot/fdt/dts/arm/db88f5281.dts deleted file mode 100644 index 61212eb4db..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/db88f5281.dts +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Marvell DB-88F5281 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-88F5281"; - compatible = "DB-88F5281-BP", "DB-88F5281-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - serial0 = &serial0; - serial1 = &serial1; - mpp = &MPP; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR531"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x08000000>; // 128M at 0x0 - }; - - localbus@f1000000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - }; - - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - bank-width = <2>; - device-width = <1>; - }; - }; - - soc88f5281@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <0>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x54>; - pin-count = <20>; - pin-map = < - 0 3 /* MPP[0]: GPIO[0] */ - 2 2 /* MPP[2]: PCI_REQn[3] */ - 3 2 /* MPP[3]: PCI_GNTn[3] */ - 4 2 /* MPP[4]: PCI_REQn[4] */ - 5 2 /* MPP[5]: PCI_GNTn[4] */ - 6 3 /* MPP[6]: <UNKNOWN> */ - 7 3 /* MPP[7]: <UNKNOWN> */ - 8 3 /* MPP[8]: <UNKNOWN> */ - 9 3 /* MPP[9]: <UNKNOWN> */ - 14 4 /* MPP[14]: NAND Flash REn[2] */ - 15 4 /* MPP[15]: NAND Flash WEn[2] */ - 16 0 /* MPP[16]: UA1_RXD */ - 17 0 /* MPP[17]: UA1_TXD */ - 18 0 /* MPP[18]: UA1_CTS */ - 19 0 >; /* MPP[19]: UA1_RTS */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <6 7 8 9>; - interrupt-parent = <&PIC>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V1"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <18 19 20 21 22>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x8>; - }; - }; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <3>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <4>; - interrupt-parent = <&PIC>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <17 16>; - interrupt-parent = <&PIC>; - }; - - idma@60000 { - compatible = "mrvl,idma"; - reg = <0x60000 0x1000>; - interrupts = <24 25 26 27 23>; - interrupt-parent = <&PIC>; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/db88f6281.dts b/usr/src/boot/sys/boot/fdt/dts/arm/db88f6281.dts deleted file mode 100644 index 55a27fc303..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/db88f6281.dts +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Marvell DB-88F6281 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,DB-88F6281"; - compatible = "DB-88F6281-BP", "DB-88F6281-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - mpp = &MPP; - pci0 = &pci0; - serial0 = &serial0; - serial1 = &serial1; - soc = &SOC; - sram = &SRAM; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR131"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x20000000>; // 512M at 0x0 - }; - - localbus@0 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - bank-count = <3>; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x2f 0xf9300000 0x00100000>; - - nand@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "mrvl,nfc"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - - slice@0 { - reg = <0x0 0x200000>; - label = "u-boot"; - read-only; - }; - - slice@200000 { - reg = <0x200000 0x7e00000>; - label = "root"; - }; - }; - }; - - SOC: soc88f6281@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <1>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count = <50>; - pin-map = < - 0 1 /* MPP[0]: NF_IO[2] */ - 1 1 /* MPP[1]: NF_IO[3] */ - 2 1 /* MPP[2]: NF_IO[4] */ - 3 1 /* MPP[3]: NF_IO[5] */ - 4 1 /* MPP[4]: NF_IO[6] */ - 5 1 /* MPP[5]: NF_IO[7] */ - 6 1 /* MPP[6]: SYSRST_OUTn */ - 7 2 /* MPP[7]: SPI_SCn */ - 8 1 /* MPP[8]: TW_SDA */ - 9 1 /* MPP[9]: TW_SCK */ - 10 3 /* MPP[10]: UA0_TXD */ - 11 3 /* MPP[11]: UA0_RXD */ - 12 1 /* MPP[12]: SD_CLK */ - 13 1 /* MPP[13]: SD_CMD */ - 14 1 /* MPP[14]: SD_D[0] */ - 15 1 /* MPP[15]: SD_D[1] */ - 16 1 /* MPP[16]: SD_D[2] */ - 17 1 /* MPP[17]: SD_D[3] */ - 18 1 /* MPP[18]: NF_IO[0] */ - 19 1 /* MPP[19]: NF_IO[1] */ - 20 5 /* MPP[20]: SATA1_AC */ - 21 5 >; /* MPP[21]: SATA0_AC */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <35 36 37 38 39 40 41>; - interrupt-parent = <&PIC>; - }; - - rtc@10300 { - compatible = "mrvl,rtc"; - reg = <0x10300 0x08>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <12 13 14 11 46>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x8>; - }; - }; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <33>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <34>; - interrupt-parent = <&PIC>; - }; - - crypto@30000 { - compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; - interrupts = <22>; - interrupt-parent = <&PIC>; - - sram-handle = <&SRAM>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <48 19>; - interrupt-parent = <&PIC>; - }; - - xor@60000 { - compatible = "mrvl,xor"; - reg = <0x60000 0x1000>; - interrupts = <5 6 7 8>; - interrupt-parent = <&PIC>; - }; - - sata@80000 { - compatible = "mrvl,sata"; - reg = <0x80000 0x6000>; - interrupts = <21>; - interrupt-parent = <&PIC>; - }; - }; - - SRAM: sram@fd000000 { - compatible = "mrvl,cesa-sram"; - reg = <0xfd000000 0x00100000>; - }; - - pci0: pcie@f1040000 { - compatible = "mrvl,pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0xf1040000 0x2000>; - bus-range = <0 255>; - ranges = <0x02000000 0x0 0xf1300000 0xf1300000 0x0 0x04000000 - 0x01000000 0x0 0x00000000 0xf1100000 0x0 0x00100000>; - clock-frequency = <33333333>; - interrupt-parent = <&PIC>; - interrupts = <44>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - /* IDSEL 0x1 */ - 0x0800 0x0 0x0 0x1 &PIC 0x9 - 0x0800 0x0 0x0 0x2 &PIC 0x9 - 0x0800 0x0 0x0 0x3 &PIC 0x9 - 0x0800 0x0 0x0 0x4 &PIC 0x9 - >; - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x02000000 0x0 0xf1300000 - 0x02000000 0x0 0xf1300000 - 0x0 0x04000000 - - 0x01000000 0x0 0x0 - 0x01000000 0x0 0x0 - 0x0 0x00100000>; - }; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/digi-ccwmx53.dts b/usr/src/boot/sys/boot/fdt/dts/arm/digi-ccwmx53.dts deleted file mode 100644 index f101c5a27d..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/digi-ccwmx53.dts +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2012 The FreeBSD Foundation - * Copyright (c) 2013 Rui Paulo - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Digi ConnectCore Wi-i.MX53 - * - * $FreeBSD$ - */ - -/dts-v1/; -/include/ "imx53x.dtsi" - -/ { - model = "Digi ConnectCore Wi-i.MX53"; - compatible = "digi,imx53-ccwm53", "fsl,imx53"; - - memory { - /* RAM 512M */ - reg = <0x70000000 0x10000000 - 0xB0000000 0x10000000>; - }; - - localbus@10000000 { - sata@10000000 { - status = "okay"; - }; - ipu3@1E000000 { - status = "okay"; - }; - }; - - soc@50000000 { - aips@50000000 { - spba@50000000 { - esdhc@50004000 { - clock-frequency = <216000000>; - status = "okay"; - }; - esdhc@50008000 { - clock-frequency = <216000000>; - status = "okay"; - }; - SSI2: ssi@50014000 { - status = "okay"; - }; - }; - timer@53fa0000 { - status = "okay"; - }; - /* UART1, console */ - console: serial@53fbc000 { - status = "okay"; - clock-frequency = <0>; /* won't load w/o this */ - }; - serial@53fc0000 { - status = "okay"; - clock-frequency = <0>; /* won't load w/o this */ - }; - serial@53ff0000 { - status = "okay"; - clock-frequency = <0>; /* won't load w/o this */ - }; - clock@53fd4000 { - status = "okay"; - }; - gpio@53f84000 { - status = "okay"; - }; - gpio@53f88000 { - status = "okay"; - }; - gpio@53f8c000 { - status = "okay"; - }; - gpio@53f90000 { - status = "okay"; - }; - usb@53f80000 /* OTG */ { - status = "okay"; - }; - usb@53f80200 /* Host 1 */ { - status = "okay"; - }; - wdog@53f98000 { - status = "okay"; - }; - i2c@53fec000 { - status = "okay"; - rtc@68 { - compatible = "dialog,ds9052"; - reg = <0x48>; - interrupts = <0x1 0x1 0 0>; - }; - }; - }; - aips@60000000 { - ethernet@63fec000 { - status = "okay"; - phy-mode = "rmii"; - }; - i2c@63fc4000 { - status = "okay"; - }; - i2c@63fc8000 { - status = "okay"; - }; - audmux@63fd4000 { - status = "okay"; - }; - ide@63fe0000 { - status = "okay"; - }; - serial@63f90000 { - status = "okay"; - }; - }; - }; - - aliases { - SSI2 = &SSI2; - }; - - chosen { - bootargs = "-v"; - stdin = &console; - stdout = &console; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/dockstar.dts b/usr/src/boot/sys/boot/fdt/dts/arm/dockstar.dts deleted file mode 100644 index 595894a7c8..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/dockstar.dts +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Seagate DockStar (Marvell SheevaPlug based) Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "seagate,DockStar"; - compatible = "DockStar"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - mpp = &MPP; - serial0 = &serial0; - serial1 = &serial1; - soc = &SOC; - sram = &SRAM; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR131"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x8000000>; // 128M at 0x0 - }; - - localbus@f1000000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - - /* This reflects CPU decode windows setup for NAND access. */ - ranges = <0x0 0x2f 0xf9300000 0x00100000>; - - nand@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "mrvl,nfc"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - }; - }; - - SOC: soc88f6281@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <1>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count = <50>; - pin-map = < - 0 1 /* MPP[0]: NF_IO[2] */ - 1 1 /* MPP[1]: NF_IO[3] */ - 2 1 /* MPP[2]: NF_IO[4] */ - 3 1 /* MPP[3]: NF_IO[5] */ - 4 1 /* MPP[4]: NF_IO[6] */ - 5 1 /* MPP[5]: NF_IO[7] */ - 6 1 /* MPP[6]: SYSRST_OUTn */ - 8 2 /* MPP[8]: UA0_RTS */ - 9 2 /* MPP[9]: UA0_CTS */ - 10 3 /* MPP[10]: UA0_TXD */ - 11 3 /* MPP[11]: UA0_RXD */ - 12 1 /* MPP[12]: SD_CLK */ - 13 1 /* MPP[13]: SD_CMD */ - 14 1 /* MPP[14]: SD_D[0] */ - 15 1 /* MPP[15]: SD_D[1] */ - 16 1 /* MPP[16]: SD_D[2] */ - 17 1 /* MPP[17]: SD_D[3] */ - 18 1 /* MPP[18]: NF_IO[0] */ - 19 1 /* MPP[19]: NF_IO[1] */ - 29 1 >; /* MPP[29]: TSMP[9] */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <35 36 37 38 39 40 41>; - interrupt-parent = <&PIC>; - }; - - rtc@10300 { - compatible = "mrvl,rtc"; - reg = <0x10300 0x08>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <12 13 14 11 46>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - }; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <33>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <34>; - interrupt-parent = <&PIC>; - }; - - crypto@30000 { - compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; - interrupts = <22>; - interrupt-parent = <&PIC>; - - sram-handle = <&SRAM>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <48 19>; - interrupt-parent = <&PIC>; - }; - - xor@60000 { - compatible = "mrvl,xor"; - reg = <0x60000 0x1000>; - interrupts = <5 6 7 8>; - interrupt-parent = <&PIC>; - }; - }; - - SRAM: sram@fd000000 { - compatible = "mrvl,cesa-sram"; - reg = <0xfd000000 0x00100000>; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/dreamplug-1001.dts b/usr/src/boot/sys/boot/fdt/dts/arm/dreamplug-1001.dts deleted file mode 100644 index 92ca1b0ec8..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/dreamplug-1001.dts +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (c) 2013 Ian Lepore - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software substantially based on work developed by Semihalf - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * GlobalScale Technologies DreamPlug Device Tree Source. - * - * This source is for version 10 revision 01 units with NOR SPI flash. - * These units are marked "1001" on the serial number label. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "GlobalScale Technologies Dreamplug v1001"; - compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - ethernet1 = &enet1; - mpp = &MPP; - serial0 = &serial0; - serial1 = &serial1; - soc = &SOC; - sram = &SRAM; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR131"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - - }; - - memory { - device_type = "memory"; - reg = <0x0 0x20000000>; // 512M at 0x0 - }; - - localbus@0 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - bank-count = <1>; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x1e 0xfa000000 0x00100000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - }; - }; - - SOC: soc88f6281@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <1>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count = <50>; - pin-map = < - 0 2 /* MPP[ 0]: SPI_SCn */ - 1 2 /* MPP[ 1]: SPI_MOSI */ - 2 2 /* MPP[ 2]: SPI_SCK */ - 3 2 /* MPP[ 3]: SPI_MISO */ - 4 1 /* MPP[ 4]: NF_IO[6] */ - 5 1 /* MPP[ 5]: NF_IO[7] */ - 6 1 /* MPP[ 6]: SYSRST_OUTn */ - 7 0 /* MPP[ 7]: GPO[7] */ - 8 1 /* MPP[ 8]: TW_SDA */ - 9 1 /* MPP[ 9]: TW_SCK */ - 10 3 /* MPP[10]: UA0_TXD */ - 11 3 /* MPP[11]: US0_RXD */ - 12 1 /* MPP[12]: SD_CLK */ - 13 1 /* MPP[13]: SD_CMD */ - 14 1 /* MPP[14]: SD_D[0] */ - 15 1 /* MPP[15]: SD_D[1] */ - 16 1 /* MPP[16]: SD_D[2] */ - 17 1 /* MPP[17]: SD_D[3] */ - 18 1 /* MPP[18]: NF_IO[0] */ - 19 1 /* MPP[19]: NF_IO[1] */ - 20 3 /* MPP[20]: GE1[ 0] */ - 21 3 /* MPP[21]: GE1[ 1] */ - 22 3 /* MPP[22]: GE1[ 2] */ - 23 3 /* MPP[23]: GE1[ 3] */ - 24 3 /* MPP[24]: GE1[ 4] */ - 25 3 /* MPP[25]: GE1[ 5] */ - 26 3 /* MPP[26]: GE1[ 6] */ - 27 3 /* MPP[27]: GE1[ 7] */ - 28 3 /* MPP[28]: GE1[ 8] */ - 29 3 /* MPP[29]: GE1[ 9] */ - 30 3 /* MPP[30]: GE1[10] */ - 31 3 /* MPP[31]: GE1[11] */ - 32 3 /* MPP[32]: GE1[12] */ - 33 3 /* MPP[33]: GE1[13] */ - 34 3 /* MPP[34]: GE1[14] */ - 35 3 /* MPP[35]: GE1[15] */ - 36 0 /* MPP[36]: GPIO[36] */ - 37 0 /* MPP[37]: GPIO[37] */ - 38 0 /* MPP[38]: GPIO[38] */ - 39 0 /* MPP[39]: GPIO[39] */ - 40 2 /* MPP[40]: TDM_SPI_SCK */ - 41 2 /* MPP[41]: TDM_SPI_MISO */ - 42 2 /* MPP[42]: TDM_SPI_MOSI */ - 43 0 /* MPP[43]: GPIO[43] */ - 44 0 /* MPP[44]: GPIO[44] */ - 45 0 /* MPP[45]: GPIO[45] */ - 46 0 /* MPP[46]: GPIO[46] */ - 47 0 /* MPP[47]: GPIO[47] */ - 48 0 /* MPP[48]: GPIO[48] */ - 49 0 /* MPP[49]: GPIO[49] */ - >; - }; - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <35 36 37 38 39 40 41>; - interrupt-parent = <&PIC>; - pin-count = <50>; - }; - - gpioled@0 { - compatible = "mrvl,gpioled"; - - gpios = <&GPIO 47 2 0 /* GPIO[47] BT LED: OUT */ - &GPIO 48 2 0 /* GPIO[48] WLAN LED: OUT */ - &GPIO 49 2 0>; /* GPIO[49] WLAN AP LED: OUT */ - }; - - rtc@10300 { - compatible = "mrvl,rtc"; - reg = <0x10300 0x08>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <12 13 14 11 46>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - - phy1: ethernet-phy@1 { - reg = <0x1>; - }; - }; - }; - - enet1: ethernet@76000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x76000 0x02000>; - ranges = <0x0 0x76000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <16 17 18 15 47>; - interrupt-parent = <&PIC>; - phy-handle = <&phy1>; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <33>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <34>; - interrupt-parent = <&PIC>; - }; - - crypto@30000 { - compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; - interrupts = <22>; - interrupt-parent = <&PIC>; - - sram-handle = <&SRAM>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <48 19>; - interrupt-parent = <&PIC>; - }; - - xor@60000 { - compatible = "mrvl,xor"; - reg = <0x60000 0x1000>; - interrupts = <5 6 7 8>; - interrupt-parent = <&PIC>; - }; - - sata@80000 { - compatible = "mrvl,sata"; - reg = <0x80000 0x6000>; - interrupts = <21>; - interrupt-parent = <&PIC>; - }; - - sdio@90000 { - compatible = "mrvl,sdio"; - reg = <0x90000 0x134>; - interrupts = <28>; - interrupt-parent = <&PIC>; - }; - }; - - SRAM: sram@fd000000 { - compatible = "mrvl,cesa-sram"; - reg = <0xfd000000 0x00100000>; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; - -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/dreamplug-1001N.dts b/usr/src/boot/sys/boot/fdt/dts/arm/dreamplug-1001N.dts deleted file mode 100644 index 230a65f486..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/dreamplug-1001N.dts +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright (c) 2013 Ian Lepore - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software substantially based on work developed by Semihalf - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * GlobalScale Technologies DreamPlug Device Tree Source. - * - * This source is for version 10 revision 01 units with NAND flash. - * These units are marked "1001N" on the serial number label. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "GlobalScale Technologies Dreamplug v1001N"; - compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - ethernet1 = &enet1; - mpp = &MPP; - serial0 = &serial0; - serial1 = &serial1; - soc = &SOC; - sram = &SRAM; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR131"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - - }; - - memory { - device_type = "memory"; - reg = <0x0 0x20000000>; // 512M at 0x0 - }; - - localbus@0 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - bank-count = <1>; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x2f 0xf9300000 0x00100000>; - - nand@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "mrvl,nfc"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - - // Slice info reported by builtin linux when it boots... - //[ 11.161328] 0x00000000-0x00100000 : "u-boot" - //[ 11.167431] 0x00100000-0x00500000 : "uImage" - //[ 11.173471] 0x00500000-0x20000000 : "root" - - slice@0 { - reg = <0x0 0x100000>; - label = "u-boot"; - read-only; - }; - - slice@200000 { - reg = <0x100000 0x40000>; - label = "uImage"; - }; - - slice@500000 { - reg = <0x500000 0x1FB00000>; - label = "root"; - }; - }; - }; - - SOC: soc88f6281@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <1>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count = <50>; - pin-map = < - 0 1 /* MPP[ 0]: NF_IO[2] */ - 1 1 /* MPP[ 1]: NF_IO[3] */ - 2 1 /* MPP[ 2]: NF_IO[4] */ - 3 1 /* MPP[ 3]: NF_IO[5] */ - 4 1 /* MPP[ 4]: NF_IO[6] */ - 5 1 /* MPP[ 5]: NF_IO[7] */ - 6 1 /* MPP[ 6]: SYSRST_OUTn */ - 7 0 /* MPP[ 7]: GPO[7] */ - 8 1 /* MPP[ 8]: TW_SDA */ - 9 1 /* MPP[ 9]: TW_SCK */ - 10 3 /* MPP[10]: UA0_TXD */ - 11 3 /* MPP[11]: US0_RXD */ - 12 1 /* MPP[12]: SD_CLK */ - 13 1 /* MPP[13]: SD_CMD */ - 14 1 /* MPP[14]: SD_D[0] */ - 15 1 /* MPP[15]: SD_D[1] */ - 16 1 /* MPP[16]: SD_D[2] */ - 17 1 /* MPP[17]: SD_D[3] */ - 18 1 /* MPP[18]: NF_IO[0] */ - 19 1 /* MPP[19]: NF_IO[1] */ - 20 3 /* MPP[20]: GE1[ 0] */ - 21 3 /* MPP[21]: GE1[ 1] */ - 22 3 /* MPP[22]: GE1[ 2] */ - 23 3 /* MPP[23]: GE1[ 3] */ - 24 3 /* MPP[24]: GE1[ 4] */ - 25 3 /* MPP[25]: GE1[ 5] */ - 26 3 /* MPP[26]: GE1[ 6] */ - 27 3 /* MPP[27]: GE1[ 7] */ - 28 3 /* MPP[28]: GE1[ 8] */ - 29 3 /* MPP[29]: GE1[ 9] */ - 30 3 /* MPP[30]: GE1[10] */ - 31 3 /* MPP[31]: GE1[11] */ - 32 3 /* MPP[32]: GE1[12] */ - 33 3 /* MPP[33]: GE1[13] */ - 34 3 /* MPP[34]: GE1[14] */ - 35 3 /* MPP[35]: GE1[15] */ - 36 0 /* MPP[36]: GPIO[36] */ - 37 0 /* MPP[37]: GPIO[37] */ - 38 0 /* MPP[38]: GPIO[38] */ - 39 0 /* MPP[39]: GPIO[39] */ - 40 2 /* MPP[40]: TDM_SPI_SCK */ - 41 2 /* MPP[41]: TDM_SPI_MISO */ - 42 2 /* MPP[42]: TDM_SPI_MOSI */ - 43 0 /* MPP[43]: GPIO[43] */ - 44 0 /* MPP[44]: GPIO[44] */ - 45 0 /* MPP[45]: GPIO[45] */ - 46 0 /* MPP[46]: GPIO[46] */ - 47 0 /* MPP[47]: GPIO[47] */ - 48 0 /* MPP[48]: GPIO[48] */ - 49 0 /* MPP[49]: GPIO[49] */ - >; - }; - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <35 36 37 38 39 40 41>; - interrupt-parent = <&PIC>; - pin-count = <50>; - }; - - gpioled@0 { - compatible = "mrvl,gpioled"; - - gpios = <&GPIO 47 2 0 /* GPIO[47] BT LED: OUT */ - &GPIO 48 2 0 /* GPIO[48] WLAN LED: OUT */ - &GPIO 49 2 0>; /* GPIO[49] WLAN AP LED: OUT */ - }; - - rtc@10300 { - compatible = "mrvl,rtc"; - reg = <0x10300 0x08>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <12 13 14 11 46>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - - phy1: ethernet-phy@1 { - reg = <0x1>; - }; - }; - }; - - enet1: ethernet@76000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x76000 0x02000>; - ranges = <0x0 0x76000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <16 17 18 15 47>; - interrupt-parent = <&PIC>; - phy-handle = <&phy1>; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <33>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <34>; - interrupt-parent = <&PIC>; - }; - - crypto@30000 { - compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; - interrupts = <22>; - interrupt-parent = <&PIC>; - - sram-handle = <&SRAM>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <48 19>; - interrupt-parent = <&PIC>; - }; - - xor@60000 { - compatible = "mrvl,xor"; - reg = <0x60000 0x1000>; - interrupts = <5 6 7 8>; - interrupt-parent = <&PIC>; - }; - - sata@80000 { - compatible = "mrvl,sata"; - reg = <0x80000 0x6000>; - interrupts = <21>; - interrupt-parent = <&PIC>; - }; - - sdio@90000 { - compatible = "mrvl,sdio"; - reg = <0x90000 0x134>; - interrupts = <28>; - interrupt-parent = <&PIC>; - }; - }; - - SRAM: sram@fd000000 { - compatible = "mrvl,cesa-sram"; - reg = <0xfd000000 0x00100000>; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; - -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/ea3250.dts b/usr/src/boot/sys/boot/fdt/dts/arm/ea3250.dts deleted file mode 100644 index 2c466e3637..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/ea3250.dts +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (c) 2011 Jakub Klama <jceel@FreeBSD.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Embedded Artists LPC3250-Kit Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "ea,LPC3250-KIT"; - compatible = "LPC3250-KIT"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - soc = &soc; - serial4 = &serial4; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,926EJ-S"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x80000000 0x4000000>; // 64M at 0x80000000 - }; - - soc: ahb7@40000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0x40000000 0x10000000>; - bus-frequency = <13000000>; - - pwr@4000 { - compatible = "lpc,pwr"; - reg = <0x4000 0x4000>; - }; - - PIC: pic@8000 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x8000 0xc000>; - compatible = "lpc,pic"; - }; - - timer@44000 { - compatible = "lpc,timer"; - reg = <0x44000 0x4000 - 0x4c000 0x4000>; - interrupts = <16 17>; - interrupt-parent = <&PIC>; - }; - - rtc@24000 { - compatible = "lpc,rtc"; - reg = <0x24000 0x4000>; - interrupts = <52>; - interrupt-parent = <&PIC>; - }; - - serial0: serial@14000 { - compatible = "lpc,hsuart"; - status = "disabled"; - reg = <0x14000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <26>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@18000 { - compatible = "lpc,hsuart"; - status = "disabled"; - reg = <0x18000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <25>; - interrupt-parent = <&PIC>; - }; - - serial2: serial@80000 { - compatible = "lpc,uart"; - status = "disabled"; - reg = <0x80000 0x20>; - reg-shift = <2>; - clock-frequency = <13000000>; - interrupts = <7>; - interrupt-parent = <&PIC>; - }; - - serial3: serial@88000 { - compatible = "lpc,uart"; - status = "disabled"; - reg = <0x88000 0x20>; - reg-shift = <2>; - clock-frequency = <13000000>; - interrupts = <8>; - interrupt-parent = <&PIC>; - }; - - serial4: serial@90000 { - compatible = "lpc,uart"; - reg = <0x90000 0x20>; - reg-shift = <2>; - clock-frequency = <13000000>; - current-speed = <115200>; - interrupts = <9>; - interrupt-parent = <&PIC>; - }; - - serial5: serial@98000 { - compatible = "lpc,uart"; - status = "disabled"; - reg = <0x98000 0x20>; - reg-shift = <2>; - clock-frequency = <13000000>; - interrupts = <10>; - interrupt-parent = <&PIC>; - }; - - serial6: serial@1c000 { - compatible = "lpc,uart"; - status = "disabled"; - reg = <0x1c000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <24>; - interrupt-parent = <&PIC>; - }; - - gpio@28000 { - compatible = "lpc,gpio"; - reg = <0x28000 0x4000>; - }; - }; - - ahb6@30000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0x30000000 0x10000000>; - - dmac@1000000 { - compatible = "lpc,dmac"; - reg = <0x1000000 0x20000>; - interrupts = <28>; - interrupt-parent = <&PIC>; - }; - - usb@1020000 { - compatible = "lpc,usb-ohci", "usb-ohci"; - reg = <0x1020000 0x20000>; - interrupts = <59>; - interrupt-parent = <&PIC>; - }; - - lpcfb@1040000 { - compatible = "lpc,fb"; - reg = <0x1040000 0x20000>; - interrupts = <14>; - interrupt-parent = <&PIC>; - - /* Screen parameters: */ - is-tft = <1>; - horizontal-resolution = <240>; - vertical-resolution = <320>; - bits-per-pixel = <16>; - pixel-clock = <121654>; - left-margin = <28>; - right-margin = <10>; - upper-margin = <2>; - lower-margin = <2>; - hsync-len = <3>; - vsync-len = <2>; - }; - - lpe@1060000 { - compatible = "lpc,ethernet"; - reg = <0x1060000 0x20000>; - interrupts = <29>; - interrupt-parent = <&PIC>; - local-mac-address = [ 00 1a f1 01 1f 23 ]; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "lpc,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - }; - - }; - }; - - ahb5@20000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0x20000000 0x10000000>; - - spi0@84000 { - compatible = "lpc,spi"; - reg = <0x84000 0x4000>; - interrupts = <20>; - interrupt-parent = <&PIC>; - }; - - spi1@8c000 { - compatible = "lpc,spi"; - status = "disabled"; - reg = <0x8c000 0x4000>; - interrupts = <21>; - interrupt-parent = <&PIC>; - }; - - lpcmmc@98000 { - compatible = "lpc,mmc"; - reg = <0x98000 0x4000>; - interrupts = <15 13>; - interrupt-parent = <&PIC>; - }; - }; - - chosen { - stdin = "serial4"; - stdout = "serial4"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/efikamx.dts b/usr/src/boot/sys/boot/fdt/dts/arm/efikamx.dts deleted file mode 100644 index e077fb78ad..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/efikamx.dts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Freescale i.MX515 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; -/include/ "imx51x.dtsi" - -/ { - model = "Genesi Efika MX"; - compatible = "genesi,imx51-efikamx", "fsl,imx51"; - - memory { - /* RAM 512M */ - reg = <0x90000000 0x20000000>; - }; - - localbus@5e000000 { - ipu3@5e000000 { - status = "okay"; - }; - }; - - soc@70000000 { - aips@70000000 { - spba@70000000 { - esdhc@70004000 { - clock-frequency = <216000000>; - status = "okay"; - }; - esdhc@70008000 { - clock-frequency = <216000000>; - status = "okay"; - }; - SSI2: ssi@70014000 { - status = "okay"; - }; - }; - timer@73fa0000 { - status = "okay"; - }; - - /* UART1, console */ - UART1: serial@73fbc000 { - status = "okay"; - clock-frequency = <3000000>; /* XXX */ - }; - - clock@73fd4000 { - status = "okay"; - }; - gpio@73f84000 { - status = "okay"; - }; - gpio@73f88000 { - status = "okay"; - }; - gpio@73f8c000 { - status = "okay"; - }; - gpio@73f90000 { - status = "okay"; - }; - usb@73f80000 /* OTG */ { - status = "okay"; - }; - usb@73f80200 /* Host 1 */ { - status = "okay"; - }; - wdog@73f98000 { - status = "okay"; - }; - }; - aips@80000000 { - i2c@83fc4000 { - status = "okay"; - }; - i2c@83fc8000 { - status = "okay"; - }; - audmux@83fd4000 { - status = "okay"; - }; - ide@83fe0000 { - status = "okay"; - }; - }; - }; - - aliases { - UART1 = &UART1; - SSI2 = &SSI2; - }; - - chosen { - bootargs = "-v"; - stdin = "UART1"; - stdout = "UART1"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/exynos5.dtsi deleted file mode 100644 index 87d8fdb019..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5.dtsi +++ /dev/null @@ -1,337 +0,0 @@ -/*- - * Copyright (c) 2013-2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - compatible = "samsung,exynos5"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&GIC>; - - aliases { - soc = &SOC; - serial0 = &serial0; - serial1 = &serial1; - serial2 = &serial2; - serial3 = &serial3; - clk0 = &clk0; - dp0 = &dp0; - fimd0 = &fimd0; - }; - - SOC: Exynos5@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - pmu_system_controller: system-controller@10040000 { - reg = <0x10040000 0x5000>; - status = "disabled"; - }; - - GIC: interrupt-controller@10481000 { - compatible = "arm,gic"; - reg = < 0x10481000 0x1000 >, /* Distributor Registers */ - < 0x10482000 0x2000 >; /* CPU Interface Registers */ - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - }; - - combiner: interrupt-controller@10440000 { - compatible = "exynos,combiner"; - reg = <0x10440000 0x1000>; - interrupts = < 32 33 34 35 36 37 38 39 - 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 - 56 57 58 59 60 61 62 63 >; - interrupt-parent = <&GIC>; - }; - - clk0: clk@10010000 { - compatible = "exynos,clk"; - reg = < 0x10020000 0x20000 >; - }; - - mct { - compatible = "exynos,mct"; - reg = < 0x101C0000 0x1000 >; - clock-frequency = <24000000>; - }; - - generic_timer { - compatible = "arm,armv7-timer"; - clock-frequency = <24000000>; - interrupts = < 29 30 27 26 >; - interrupt-parent = <&GIC>; - }; - - pwm { - compatible = "samsung,s3c24x0-timer"; - reg = <0x12DD0000 0x1000>; - interrupts = < 71 >; - interrupt-parent = <&GIC>; - clock-frequency = <24000000>; - }; - - pad0: pad@11400000 { - status = "disabled"; - }; - - usbdrd_phy0: phy@12100000 { - compatible = "samsung,exynos5420-usbdrd-phy"; - status = "disabled"; - reg = <0x12100000 0x100>; - samsung,pmu-syscon = <&pmu_system_controller>; - }; - - usbdrd_phy1: phy@12500000 { - compatible = "samsung,exynos5420-usbdrd-phy"; - status = "disabled"; - reg = <0x12500000 0x100>; - samsung,pmu-syscon = <&pmu_system_controller>; - }; - - xhci@12000000 { - compatible = "samsung,exynos5250-dwusb3"; - status = "disabled"; - reg = <0x12000000 0x1000>, - <0x1200c100 0x1000>; - interrupts = < 104 >; - interrupt-parent = <&GIC>; - }; - - xhci@12400000 { - compatible = "samsung,exynos5250-dwusb3"; - status = "disabled"; - reg = <0x12400000 0x1000>, - <0x1240c100 0x1000>; - interrupts = < 105 >; - interrupt-parent = <&GIC>; - }; - - usb@12110000 { - compatible = "exynos,usb-ehci", "usb-ehci"; - status = "disabled"; - reg = <0x12110000 0x1000>, /* EHCI */ - <0x12130000 0x1000>, /* EHCI host ctrl */ - <0x10050230 0x10>; /* Sysreg */ - interrupts = < 103 >; - interrupt-parent = <&GIC>; - }; - - usb@12120000 { - compatible = "exynos,usb-ohci", "usb-ohci"; - status = "disabled"; - reg = <0x12120000 0x10000>; - interrupts = < 103 >; - interrupt-parent = <&GIC>; - }; - - sdhci@12200000 { - compatible = "sdhci_generic"; - status = "disabled"; - reg = <0x12200000 0x1000>; - interrupts = <107>; - interrupt-parent = <&GIC>; - max-frequency = <24000000>; /* TODO: verify freq */ - }; - - sdhci@12210000 { - compatible = "sdhci_generic"; - status = "disabled"; - reg = <0x12210000 0x1000>; - interrupts = <108>; - interrupt-parent = <&GIC>; - max-frequency = <24000000>; - }; - - sdhci@12220000 { - compatible = "sdhci_generic"; - status = "disabled"; - reg = <0x12220000 0x1000>; - interrupts = <109>; - interrupt-parent = <&GIC>; - max-frequency = <24000000>; - }; - - sdhci@12230000 { - compatible = "sdhci_generic"; - status = "disabled"; - reg = <0x12230000 0x1000>; - interrupts = <110>; - interrupt-parent = <&GIC>; - max-frequency = <24000000>; - }; - - serial0: serial@12C00000 { - compatible = "exynos"; - status = "disabled"; - reg = <0x12C00000 0x100>; - interrupts = < 83 >; - interrupt-parent = <&GIC>; - clock-frequency = < 100000000 >; - current-speed = <115200>; - }; - - serial1: serial@12C10000 { - compatible = "exynos"; - status = "disabled"; - reg = <0x12C10000 0x100>; - interrupts = < 84 >; - interrupt-parent = <&GIC>; - clock-frequency = < 100000000 >; - current-speed = <115200>; - }; - - serial2: serial@12C20000 { - compatible = "exynos"; - status = "disabled"; - reg = <0x12C20000 0x100>; - interrupts = < 85 >; - interrupt-parent = <&GIC>; - clock-frequency = < 100000000 >; - current-speed = <115200>; - }; - - serial3: serial@12C30000 { - compatible = "exynos"; - status = "disabled"; - reg = <0x12C30000 0x100>; - interrupts = < 86 >; - interrupt-parent = <&GIC>; - clock-frequency = < 100000000 >; - current-speed = <115200>; - }; - - spi0: spi@12d20000 { - compatible = "samsung,exynos5-spi"; - status = "disabled"; - reg = <0x12d20000 0x100>; - interrupts = < 100 >; - interrupt-parent = <&GIC>; - }; - - spi1: spi@12d30000 { - compatible = "samsung,exynos5-spi"; - status = "disabled"; - reg = <0x12d30000 0x100>; - interrupts = < 101 >; - interrupt-parent = <&GIC>; - }; - - spi2: spi@12d40000 { - compatible = "samsung,exynos5-spi"; - status = "disabled"; - reg = <0x12d40000 0x100>; - interrupts = < 102 >; - interrupt-parent = <&GIC>; - }; - - i2c0: i2c@12C60000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12C60000 0x10000>; - interrupts = < 88 >; - interrupt-parent = <&GIC>; - }; - - i2c1: i2c@12C70000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12C70000 0x10000>; - interrupts = < 89 >; - interrupt-parent = <&GIC>; - }; - - i2c2: i2c@12C80000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12C80000 0x10000>; - interrupts = < 90 >; - interrupt-parent = <&GIC>; - }; - - i2c3: i2c@12C90000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12C90000 0x10000>; - interrupts = < 91 >; - interrupt-parent = <&GIC>; - }; - - i2c4: i2c@12CA0000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12CA0000 0x10000>; - interrupts = < 92 >; - interrupt-parent = <&GIC>; - }; - - i2c5: i2c@12CB0000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12CB0000 0x10000>; - interrupts = < 93 >; - interrupt-parent = <&GIC>; - }; - - i2c6: i2c@12CC0000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12CC0000 0x10000>; - interrupts = < 94 >; - interrupt-parent = <&GIC>; - }; - - i2c7: i2c@12CD0000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12CD0000 0x10000>; - interrupts = < 95 >; - interrupt-parent = <&GIC>; - }; - - fimd0: fimd@14400000 { - compatible = "exynos,fimd"; - status = "disabled"; - reg = < 0x14400000 0x10000 >, /* fimd */ - < 0x14420000 0x10000 >, /* disp */ - < 0x10050000 0x220 >; /* sysreg */ - interrupt-parent = <&GIC>; - }; - - dp0: dp@145B0000 { - compatible = "exynos,dp"; - status = "disabled"; - reg = < 0x145B0000 0x10000 >; - interrupt-parent = <&GIC>; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-arndale.dts b/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-arndale.dts deleted file mode 100644 index 81d1817fc8..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-arndale.dts +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * Copyright (c) 2013 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "exynos5250.dtsi" - -/ { - model = "Arndale Board"; - - memory { - device_type = "memory"; - reg = < 0x40000000 0x80000000 >; /* 2G */ - }; - - SOC: Exynos5@0 { - - pad0: pad@11400000 { - status = "okay"; - }; - - serial2: serial@12C20000 { - status = "okay"; - }; - - }; - - chosen { - stdin = &serial2; - stdout = &serial2; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-snow.dts b/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-snow.dts deleted file mode 100644 index cb40ec5b0b..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-snow.dts +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "exynos5250.dtsi" - -/ { - model = "Samsung Chromebook"; - - memory { - device_type = "memory"; - reg = < 0x40000000 0x80000000 >; /* 2G */ - }; - - SOC: Exynos5@0 { - - pad0: pad@11400000 { - status = "okay"; - }; - - fimd0: fimd@14400000 { - status = "okay"; - - panel-size = < 1366 768 >; - panel-hsync = < 80 32 48 >; - panel-vsync = < 14 5 3 >; - panel-clk-div = < 17 >; - panel-backlight-pin = < 25 >; - }; - - i2c4: i2c@12CA0000 { - status = "okay"; - }; - - keyboard-controller { - compatible = "google,mkbp-keyb"; - google,key-rows = <8>; - google,key-columns = <13>; - freebsd,intr-gpio = <146>; - }; - - usbdrd_phy0: phy@12100000 { - vbus-supply = < 155 >; - }; - }; - - i2c-arbitrator { - freebsd,our-gpio = <177>; - freebsd,ec-gpio = <168>; - }; - - chosen { - stdin = &serial2; - stdout = &serial2; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-spring.dts b/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-spring.dts deleted file mode 100644 index c0e4285806..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250-spring.dts +++ /dev/null @@ -1,78 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "exynos5250.dtsi" - -/ { - model = "HP Chromebook 11"; - - memory { - device_type = "memory"; - reg = < 0x40000000 0x80000000 >; /* 2G */ - }; - - SOC: Exynos5@0 { - - pad0: pad@11400000 { - status = "okay"; - }; - - fimd0: fimd@14400000 { - status = "okay"; - - panel-size = < 1366 768 >; - panel-hsync = < 80 32 48 >; - panel-vsync = < 14 5 3 >; - panel-clk-div = < 17 >; - panel-backlight-pin = < 25 >; - }; - - i2c4: i2c@12CA0000 { - status = "okay"; - }; - - keyboard-controller { - compatible = "google,mkbp-keyb"; - google,key-rows = <8>; - google,key-columns = <13>; - freebsd,intr-gpio = <146>; - }; - }; - - chosen { - stdin = &serial2; - stdout = &serial2; - }; - - hsichub@13400000 { - compatible = "smsc,usb3503"; - freebsd,reset-gpio = <172>; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250.dtsi deleted file mode 100644 index a8f74f498b..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5250.dtsi +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * Copyright (c) 2013-2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/include/ "exynos5.dtsi" - -/ { - compatible = "samsung,exynos5250", "samsung,exynos5"; - - SOC: Exynos5@0 { - - pmu_system_controller: system-controller@10040000 { - compatible = "samsung,exynos5250-pmu"; - status = "okay"; - }; - - pad0: pad@11400000 { - compatible = "samsung,exynos5250-padctrl"; - reg = <0x11400000 0x1000>, - <0x13400000 0x1000>, - <0x10D10000 0x1000>, - <0x03860000 0x1000>; - interrupts = < 78 77 82 79 >; - interrupt-parent = <&GIC>; - }; - - serial0: serial@12C00000 { - clock-frequency = < 100000000 >; - }; - - serial1: serial@12C10000 { - clock-frequency = < 100000000 >; - }; - - serial2: serial@12C20000 { - clock-frequency = < 100000000 >; - }; - - serial3: serial@12C30000 { - clock-frequency = < 100000000 >; - }; - - usb@12110000 { - status = "okay"; - }; - - usbdrd_phy0: phy@12100000 { - status = "okay"; - }; - - xhci@12000000 { - status = "okay"; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts b/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts deleted file mode 100644 index 8f090651c3..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "exynos5420.dtsi" - -/ { - model = "Arndale Octa Board"; - - memory { - device_type = "memory"; - reg = < 0x20000000 0x7f200000 >; /* 2G */ - }; - - SOC: Exynos5@0 { - serial3: serial@12C30000 { - status = "okay"; - }; - - usb@12110000 { - status = "okay"; - }; - - mmc2: dwmmc@12220000 { - status = "okay"; - num-slots = <1>; - supports-highspeed; - samsung,dw-mshc-ciu-div = <3>; - samsung,dw-mshc-sdr-timing = <2 3>; - samsung,dw-mshc-ddr-timing = <1 2>; - bus-frequency = <50000000>; - - slot@0 { - reg = <0>; - bus-width = <4>; - }; - }; - }; - - chosen { - stdin = &serial3; - stdout = &serial3; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420-peach-pit.dts b/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420-peach-pit.dts deleted file mode 100644 index 80aca895d7..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420-peach-pit.dts +++ /dev/null @@ -1,87 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "exynos5420.dtsi" - -/ { - model = "Chromebook Peach Pit"; - - memory { - device_type = "memory"; - reg = < 0x20000000 0xdf000000 >; /* 3.5G */ - }; - - SOC: Exynos5@0 { - - fimd0: fimd@14400000 { - status = "okay"; - - panel-size = < 1366 768 >; - panel-hsync = < 80 32 48 >; - panel-vsync = < 14 5 3 >; - panel-clk-div = < 17 >; - panel-backlight-pin = < 25 >; - }; - - spi2: spi@12d40000 { - status = "okay"; - }; - - keyboard-controller { - compatible = "google,mkbp-keyb"; - google,key-rows = <8>; - google,key-columns = <13>; - freebsd,intr-gpio = < 21 >; - }; - - usbdrd_phy0: phy@12100000 { - vbus-supply = < 217 >; - }; - - usbdrd_phy1: phy@12500000 { - vbus-supply = < 218 >; - }; - - mmc2: dwmmc@12220000 { - status = "okay"; - num-slots = <1>; - supports-highspeed; - samsung,dw-mshc-ciu-div = <3>; - samsung,dw-mshc-sdr-timing = <2 3>; - samsung,dw-mshc-ddr-timing = <1 2>; - bus-frequency = <50000000>; - - slot@0 { - reg = <0>; - bus-width = <4>; - }; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420.dtsi deleted file mode 100644 index 38a5a88794..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/exynos5420.dtsi +++ /dev/null @@ -1,112 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/include/ "exynos5.dtsi" - -/ { - compatible = "samsung,exynos5420", "samsung,exynos5"; - - SOC: Exynos5@0 { - - pmu_system_controller: system-controller@10040000 { - compatible = "samsung,exynos5420-pmu"; - status = "okay"; - }; - - pad0: pad@11400000 { - compatible = "samsung,exynos5420-padctrl"; - status = "okay"; - reg = <0x13400000 0x1000>, - <0x13410000 0x1000>, - <0x14000000 0x1000>, - <0x14010000 0x1000>, - <0x03860000 0x1000>; - interrupts = < 77 110 78 82 79 >; - interrupt-parent = <&GIC>; - }; - - serial0: serial@12C00000 { - clock-frequency = < 50000000 >; - }; - - serial1: serial@12C10000 { - clock-frequency = < 50000000 >; - }; - - serial2: serial@12C20000 { - clock-frequency = < 50000000 >; - }; - - serial3: serial@12C30000 { - clock-frequency = < 50000000 >; - }; - - usbdrd_phy0: phy@12100000 { - status = "okay"; - }; - - usbdrd_phy1: phy@12500000 { - status = "okay"; - }; - - xhci@12000000 { - status = "okay"; - }; - - xhci@12400000 { - status = "okay"; - }; - - mmc0: dwmmc@12200000 { - compatible = "samsung,exynos5420-dw-mshc-smu"; - reg = <0x12200000 0x10000>; - interrupts = <107>; - interrupt-parent = <&GIC>; - fifo-depth = <0x40>; - status = "disabled"; - }; - - mmc1: dwmmc@12210000 { - compatible = "samsung,exynos5420-dw-mshc-smu"; - reg = <0x12210000 0x10000>; - interrupts = <108>; - interrupt-parent = <&GIC>; - fifo-depth = <0x40>; - status = "disabled"; - }; - - mmc2: dwmmc@12220000 { - compatible = "samsung,exynos5420-dw-mshc"; - reg = <0x12220000 0x10000>; - interrupts = <109>; - interrupt-parent = <&GIC>; - fifo-depth = <0x40>; - status = "disabled"; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/hl201.dts b/usr/src/boot/sys/boot/fdt/dts/arm/hl201.dts deleted file mode 100644 index 1566b30f8f..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/hl201.dts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Hot-e HL-201 - Warner Losh public domain - * - * $FreeBSD$ - */ -/dts-v1/; - -/* - * The following is a white lie. The HL-201 is a stripped down version of - * the SAM9G20EK board with a video output chip. - */ -#include "at91sam9g20ek_common.dtsi" - -/ { - model = "Thinlinx HL201"; - compatible = "thinlinx,hl201", "atmel,at91sam9g20ek", "atmel,at91sam9g20", "atmel,at91sam9"; - - leds { - compatible = "gpio-leds"; - - ds1 { - label = "ds1"; - gpios = <&pioA 9 0>; - linux,default-trigger = "heartbeat"; - }; - - ds5 { - label = "ds5"; - gpios = <&pioA 6 1>; - }; - }; - - /* Missing: one wire serial number, video chip */ - - aliases { - dbgu = &dbgu; - }; - - - chosen { - stdin = "dbgu"; - stdout = "dbgu"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/imx51x.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/imx51x.dtsi deleted file mode 100644 index cc06f0f355..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/imx51x.dtsi +++ /dev/null @@ -1,622 +0,0 @@ -/* - * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Freescale i.MX515 Device Tree Source. - * - * $FreeBSD$ - */ - -/ { - #address-cells = <1>; - #size-cells = <1>; - - aliases { - soc = &SOC; - }; - - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,MCIMX515"; - reg = <0x0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x8000>; - i-cache-size = <0x8000>; - /* TODO: describe L2 cache also */ - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - localbus@e0000000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - - /* This reflects CPU decode windows setup. */ - ranges; - - tzic: tz-interrupt-controller@e0000000 { - compatible = "fsl,imx51-tzic", "fsl,tzic"; - interrupt-controller; - #interrupt-cells = <1>; - reg = <0xe0000000 0x00004000>; - }; - /* - * 60000000 60000FFF 4K Debug ROM - * 60001000 60001FFF 4K ETB - * 60002000 60002FFF 4K ETM - * 60003000 60003FFF 4K TPIU - * 60004000 60004FFF 4K CTI0 - * 60005000 60005FFF 4K CTI1 - * 60006000 60006FFF 4K CTI2 - * 60007000 60007FFF 4K CTI3 - * 60008000 60008FFF 4K Cortex Debug Unit - * - * E0000000 E0003FFF 0x4000 TZIC - */ - }; - - SOC: soc@70000000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&tzic>; - ranges = <0x70000000 0x70000000 0x14000000>; - - aips@70000000 { /* AIPS1 */ - compatible = "fsl,aips-bus", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&tzic>; - ranges; - - /* Required by many devices, so better to stay first */ - /* 73FD4000 0x4000 CCM */ - clock@73fd4000 { - compatible = "fsl,imx51-ccm"; - /* 83F80000 0x4000 DPLLIP1 */ - /* 83F84000 0x4000 DPLLIP2 */ - /* 83F88000 0x4000 DPLLIP3 */ - reg = <0x73fd4000 0x4000 - 0x83F80000 0x4000 - 0x83F84000 0x4000 - 0x83F88000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <71 72>; - status = "disabled"; - }; - - /* - * GPIO modules moved up - to have it attached for - * drivers which rely on GPIO - */ - /* 73F84000 0x4000 GPIO1 */ - gpio1: gpio@73f84000 { - compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; - reg = <0x73f84000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <50 51 42 43 44 45 46 47 48 49>; - /* TODO: use <> also */ - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 73F88000 0x4000 GPIO2 */ - gpio2: gpio@73f88000 { - compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; - reg = <0x73f88000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <52 53>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 73F8C000 0x4000 GPIO3 */ - gpio3: gpio@73f8c000 { - compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; - reg = <0x73f8c000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <54 55>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 73F90000 0x4000 GPIO4 */ - gpio4: gpio@73f90000 { - compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; - reg = <0x73f90000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <56 57>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - spba@70000000 { - compatible = "fsl,spba-bus", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&tzic>; - ranges; - - /* 70004000 0x4000 ESDHC 1 */ - esdhc@70004000 { - compatible = "fsl,imx51-esdhc"; - reg = <0x70004000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <1>; - status = "disabled"; - }; - - /* 70008000 0x4000 ESDHC 2 */ - esdhc@70008000 { - compatible = "fsl,imx51-esdhc"; - reg = <0x70008000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <2>; - status = "disabled"; - }; - - /* 7000C000 0x4000 UART 3 */ - uart3: serial@7000c000 { - compatible = "fsl,imx51-uart", "fsl,imx-uart"; - reg = <0x7000c000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <33>; - status = "disabled"; - }; - - /* 70010000 0x4000 eCSPI1 */ - ecspi@70010000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx51-ecspi"; - reg = <0x70010000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <36>; - status = "disabled"; - }; - - /* 70014000 0x4000 SSI2 irq30 */ - SSI2: ssi@70014000 { - compatible = "fsl,imx51-ssi"; - reg = <0x70014000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <30>; - status = "disabled"; - }; - - /* 70020000 0x4000 ESDHC 3 */ - esdhc@70020000 { - compatible = "fsl,imx51-esdhc"; - reg = <0x70020000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <3>; - status = "disabled"; - }; - - /* 70024000 0x4000 ESDHC 4 */ - esdhc@70024000 { - compatible = "fsl,imx51-esdhc"; - reg = <0x70024000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <4>; - status = "disabled"; - }; - - /* 70028000 0x4000 SPDIF */ - /* 91 SPDIF */ - - /* 70030000 0x4000 PATA (PORT UDMA) irq70 */ - - /* 70034000 0x4000 SLM */ - /* 70038000 0x4000 HSI2C */ /* 64 HS-I2C */ - /* 7003C000 0x4000 SPBA */ - }; - - usbphy0: usbphy@0 { - compatible = "usb-nop-xceiv"; - status = "okay"; - }; - - usbotg: usb@73f80000 { - compatible = "fsl,imx51-usb", "fsl,imx27-usb"; - reg = <0x73f80000 0x0200>; - interrupts = <18>; - fsl,usbmisc = <&usbmisc 0>; - fsl,usbphy = <&usbphy0>; - status = "disabled"; - }; - - usbh1: usb@73f80200 { - compatible = "fsl,imx51-usb", "fsl,imx27-usb"; - reg = <0x73f80200 0x0200>; - interrupts = <14>; - fsl,usbmisc = <&usbmisc 1>; - status = "disabled"; - }; - - usbh2: usb@73f80400 { - compatible = "fsl,imx51-usb", "fsl,imx27-usb"; - reg = <0x73f80400 0x0200>; - interrupts = <16>; - fsl,usbmisc = <&usbmisc 2>; - status = "disabled"; - }; - - usbh3: usb@73f80600 { - compatible = "fsl,imx51-usb", "fsl,imx27-usb"; - reg = <0x73f80600 0x0200>; - interrupts = <17>; - fsl,usbmisc = <&usbmisc 3>; - status = "disabled"; - }; - - usbmisc: usbmisc@73f80800 { - #index-cells = <1>; - compatible = "fsl,imx51-usbmisc"; - reg = <0x73f80800 0x200>; - }; - - /* 73F98000 0x4000 WDOG1 */ - wdog@73f98000 { - compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; - reg = <0x73f98000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <58>; - status = "disabled"; - }; - - /* 73F9C000 0x4000 WDOG2 (TZ) */ - wdog@73f9c000 { - compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; - reg = <0x73f9c000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <59>; - status = "disabled"; - }; - - /* 73F94000 0x4000 KPP */ - keyboard@73f94000 { - compatible = "fsl,imx51-kpp"; - reg = <0x73f94000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <60>; - status = "disabled"; - }; - - /* 73FA0000 0x4000 GPT */ - timer@73fa0000 { - compatible = "fsl,imx51-gpt"; - reg = <0x73fa0000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <39>; - status = "disabled"; - }; - - /* 73FA4000 0x4000 SRTC */ - - rtc@73fa4000 { - compatible = "fsl,imx51-srtc"; - reg = <0x73fa4000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <24 25>; - status = "disabled"; - }; - - /* 73FA8000 0x4000 IOMUXC */ - iomux@73fa8000 { - compatible = "fsl,imx51-iomux"; - reg = <0x73fa8000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <7>; - }; - - /* 73FAC000 0x4000 EPIT1 */ - epit1: timer@73fac000 { - compatible = "fsl,imx51-epit"; - reg = <0x73fac000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <40>; - status = "disabled"; - }; - - /* 73FB0000 0x4000 EPIT2 */ - epit2: timer@73fb0000 { - compatible = "fsl,imx51-epit"; - reg = <0x73fb0000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <41>; - status = "disabled"; - }; - - /* 73FB4000 0x4000 PWM1 */ - pwm@73fb4000 { - compatible = "fsl,imx51-pwm"; - reg = <0x73fb4000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <61>; - status = "disabled"; - }; - - /* 73FB8000 0x4000 PWM2 */ - pwm@73fb8000 { - compatible = "fsl,imx51-pwm"; - reg = <0x73fb8000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <94>; - status = "disabled"; - }; - - /* 73FBC000 0x4000 UART 1 */ - uart1: serial@73fbc000 { - compatible = "fsl,imx51-uart", "fsl,imx-uart"; - reg = <0x73fbc000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <31>; - status = "disabled"; - }; - - /* 73FC0000 0x4000 UART 2 */ - uart2: serial@73fc0000 { - compatible = "fsl,imx51-uart", "fsl,imx-uart"; - reg = <0x73fc0000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <32>; - status = "disabled"; - }; - - /* 73FC4000 0x4000 USBOH3 */ - /* NOTYET - usb@73fc4000 { - compatible = "fsl,imx51-otg"; - reg = <0x73fc4000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <>; - status = "disabled"; - }; - */ - /* 73FD0000 0x4000 SRC */ - reset@73fd0000 { - compatible = "fsl,imx51-src"; - reg = <0x73fd0000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <75>; - status = "disabled"; - }; - /* 73FD8000 0x4000 GPC */ - power@73fd8000 { - compatible = "fsl,imx51-gpc"; - reg = <0x73fd8000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <73 74>; - status = "disabled"; - }; - - }; - - aips@80000000 { /* AIPS2 */ - compatible = "fsl,aips-bus", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&tzic>; - ranges; - - /* 83F94000 0x4000 AHBMAX */ - /* 83F98000 0x4000 IIM */ - /* - * 69 IIM Interrupt request to the processor. - * Indicates to the processor that program or - * explicit. - */ - /* 83F9C000 0x4000 CSU */ - /* - * 27 CSU Interrupt Request 1. Indicates to the - * processor that one or more alarm inputs were. - */ - - /* 83FA0000 0x4000 TIGERP_PLATFORM_NE_32K_256K */ - /* irq76 Neon Monitor Interrupt */ - /* irq77 Performance Unit Interrupt */ - /* irq78 CTI IRQ */ - /* irq79 Debug Interrupt, Cross-Trigger Interface 1 */ - /* irq80 Debug Interrupt, Cross-Trigger Interface 1 */ - /* irq89 Debug Interrupt, Cross-Trigger Interface 2 */ - /* irq98 Debug Interrupt, Cross-Trigger Interface 3 */ - - /* 83FA4000 0x4000 OWIRE irq88 */ - /* 83FA8000 0x4000 FIRI irq93 */ - /* 83FAC000 0x4000 eCSPI2 */ - ecspi@83fac000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx51-ecspi"; - reg = <0x83fac000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <37>; - status = "disabled"; - }; - - /* 83FB0000 0x4000 SDMA */ - sdma@83fb0000 { - compatible = "fsl,imx51-sdma", "fsl,imx35-sdma"; - reg = <0x83fb0000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <6>; - }; - - /* 83FB4000 0x4000 SCC */ - /* 21 SCC Security Monitor High Priority Interrupt. */ - /* 22 SCC Secure (TrustZone) Interrupt. */ - /* 23 SCC Regular (Non-Secure) Interrupt. */ - - /* 83FB8000 0x4000 ROMCP */ - /* 83FBC000 0x4000 RTIC */ - /* - * 26 RTIC RTIC (Trust Zone) Interrupt Request. - * Indicates that the RTIC has completed hashing the - */ - - /* 83FC0000 0x4000 CSPI */ - cspi@83fc0000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx51-cspi", "fsl,imx35-cspi"; - reg = <0x83fc0000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <38>; - status = "disabled"; - }; - - /* 83FC4000 0x4000 I2C2 */ - i2c@83fc4000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx51-i2c", "fsl,imx1-i2c", "fsl,imx-i2c"; - reg = <0x83fc4000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <63>; - status = "disabled"; - }; - - /* 83FC8000 0x4000 I2C1 */ - i2c@83fc8000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx51-i2c", "fsl,imx1-i2c", "fsl,imx-i2c"; - reg = <0x83fc8000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <62>; - status = "disabled"; - }; - - /* 83FCC000 0x4000 SSI1 */ - /* 29 SSI1 SSI-1 Interrupt Request */ - SSI1: ssi@83fcc000 { - compatible = "fsl,imx51-ssi"; - reg = <0x83fcc000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <29>; - status = "disabled"; - }; - - /* 83FD0000 0x4000 AUDMUX */ - audmux@83fd4000 { - compatible = "fsl,imx51-audmux"; - reg = <0x83fd4000 0x4000>; - status = "disabled"; - }; - - /* 83FD8000 0x4000 EMI1 */ - /* 8 EMI (NFC) */ - /* 15 EMI */ - /* 97 EMI Boot sequence completed interrupt */ - /* - * 101 EMI Indicates all pages have been transferred - * to NFC during an auto program operation. - */ - - /* 83FE0000 0x4000 PATA (PORT PIO) */ - /* 70 PATA Parallel ATA host controller interrupt */ - ide@83fe0000 { - compatible = "fsl,imx51-ata"; - reg = <0x83fe0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <70>; - status = "disabled"; - }; - - /* 83FE4000 0x4000 SIM */ - /* 67 SIM intr composed of oef, xte, sdi1, and sdi0 */ - /* 68 SIM intr composed of tc, etc, tfe, and rdrf */ - - /* 83FE8000 0x4000 SSI3 */ - /* 96 SSI3 SSI-3 Interrupt Request */ - SSI3: ssi@83fe8000 { - compatible = "fsl,imx51-ssi"; - reg = <0x83fe8000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <96>; - status = "disabled"; - }; - - /* 83FEC000 0x4000 FEC */ - ethernet@83fec000 { - compatible = "fsl,imx51-fec"; - reg = <0x83fec000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <87>; - status = "disabled"; - }; - - /* 83FF0000 0x4000 TVE */ - /* 92 TVE */ - /* 83FF4000 0x4000 VPU */ - /* 9 VPU */ - /* 100 VPU Idle interrupt from VPU */ - - /* 83FF8000 0x4000 SAHARA Lite */ - /* 19 SAHARA SAHARA host 0 (TrustZone) Intr Lite */ - /* 20 SAHARA SAHARA host 1 (non-TrustZone) Intr Lite */ - }; - }; - - localbus@5e000000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - - ranges; - - vga: ipu3@5e000000 { - compatible = "fsl,ipu3"; - reg = < - 0x5e000000 0x08000 /* CM */ - 0x5e008000 0x08000 /* IDMAC */ - 0x5e018000 0x08000 /* DP */ - 0x5e020000 0x08000 /* IC */ - 0x5e028000 0x08000 /* IRT */ - 0x5e030000 0x08000 /* CSI0 */ - 0x5e038000 0x08000 /* CSI1 */ - 0x5e040000 0x08000 /* DI0 */ - 0x5e048000 0x08000 /* DI1 */ - 0x5e050000 0x08000 /* SMFC */ - 0x5e058000 0x08000 /* DC */ - 0x5e060000 0x08000 /* DMFC */ - 0x5e068000 0x08000 /* VDI */ - 0x5f000000 0x20000 /* CPMEM */ - 0x5f020000 0x20000 /* LUT */ - 0x5f040000 0x20000 /* SRM */ - 0x5f060000 0x20000 /* TPM */ - 0x5f080000 0x20000 /* DCTMPL */ - >; - interrupt-parent = <&tzic>; - interrupts = < - 10 /* IPUEX Error */ - 11 /* IPUEX Sync */ - >; - status = "disabled"; - }; - }; -}; - -/* - -TODO: Not mapped interrupts - -5 DAP -84 GPU2D (OpenVG) general interrupt -85 GPU2D (OpenVG) busy signal (for S/W power gating feasibility) -12 GPU3D -102 GPU3D Idle interrupt from GPU3D (for S/W power gating) -90 SJC -*/ diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/imx53-qsb.dts b/usr/src/boot/sys/boot/fdt/dts/arm/imx53-qsb.dts deleted file mode 100644 index f22b540318..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/imx53-qsb.dts +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2012 The FreeBSD Foundation - * Copyright (c) 2013 Rui Paulo - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Freescale i.MX53 Quick Start Board - * In u-boot, this board is known as "MX53LOCO" for some reason. - * - * $FreeBSD$ - */ - -/dts-v1/; -/include/ "imx53x.dtsi" - -/ { - model = "Freescale i.MX53 Quick Start Board"; - compatible = "fsl,imx53-qsb", "fsl,imx53"; - - memory { - /* RAM is 2 banks of 512M each. */ - reg = <0x70000000 0x20000000 - 0xb0000000 0x20000000>; - }; - - localbus@18000000 { - ipu3@1E000000 { - status = "okay"; - }; - }; - - soc@50000000 { - aips@50000000 { - spba@50000000 { - esdhc@50004000 { - clock-frequency = <216000000>; - status = "okay"; - }; - esdhc@50008000 { - clock-frequency = <216000000>; - status = "okay"; - }; - SSI2: ssi@50014000 { - status = "okay"; - }; - }; - timer@53fa0000 { - status = "okay"; - }; - - /* UART1, console */ - console: serial@53fbc000 { - status = "okay"; - clock-frequency = <0>; /* won't load w/o this */ - }; - - clock@53fd4000 { - status = "okay"; - }; - gpio@53f84000 { - status = "okay"; - }; - gpio@53f88000 { - status = "okay"; - }; - gpio@53f8c000 { - status = "okay"; - }; - gpio@53f90000 { - status = "okay"; - }; - usb@53f80000 /* OTG */ { - status = "okay"; - }; - usb@53f80200 /* Host 1 */ { - status = "okay"; - }; - wdog@53f98000 { - status = "okay"; - }; - }; - aips@60000000 { - ethernet@63fec000 { - status = "okay"; - phy-mode = "rmii"; - }; - i2c@63fc4000 { - status = "okay"; - }; - i2c@63fc8000 { - status = "okay"; - }; - audmux@63fd4000 { - status = "okay"; - }; - ide@63fe0000 { - status = "okay"; - }; - }; - }; - - aliases { - SSI2 = &SSI2; - }; - - chosen { - bootargs = "-v"; - stdin = &console; - stdout = &console; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/imx53x.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/imx53x.dtsi deleted file mode 100644 index c6a696ede7..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/imx53x.dtsi +++ /dev/null @@ -1,714 +0,0 @@ -/* - * Copyright (c) 2012 The FreeBSD Foundation - * Copyright (c) 2013 Rui Paulo - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Freescale i.MX535 Device Tree Source. - * - * $FreeBSD$ - */ - -/ { - #address-cells = <1>; - #size-cells = <1>; - - aliases { - soc = &SOC; - }; - - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,MCIMX535"; - reg = <0x0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x8000>; - i-cache-size = <0x8000>; - l2-cache-line-size = <32>; - l2-cache-line = <0x40000>; - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - localbus@0fffc000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - - /* This reflects CPU decode windows setup. */ - ranges; - - tzic: tz-interrupt-controller@0fffc000 { - compatible = "fsl,imx53-tzic", "fsl,tzic"; - interrupt-controller; - #interrupt-cells = <1>; - reg = <0x0fffc000 0x00004000>; - }; - /* - * 40000000 40000FFF 4K Debug ROM - * 40001000 40001FFF 4K ETB - * 40002000 40002FFF 4K ETM - * 40003000 40003FFF 4K TPIU - * 40004000 40004FFF 4K CTI0 - * 40005000 40005FFF 4K CTI1 - * 40006000 40006FFF 4K CTI2 - * 40007000 40007FFF 4K CTI3 - * 40008000 40008FFF 4K ARM Debug Unit - * - * 0FFFC000 0FFFCFFF 0x4000 TZIC - */ - }; - - SOC: soc@50000000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&tzic>; - ranges; - - aips@50000000 { /* AIPS1 */ - compatible = "fsl,aips-bus", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&tzic>; - ranges; - - /* Required by many devices, so better to stay first */ - /* 53FD4000 0x4000 CCM */ - clock@53fd4000 { - compatible = "fsl,imx53-ccm"; - /* 63F80000 0x4000 DPLLIP1 */ - /* 63F84000 0x4000 DPLLIP2 */ - /* 63F88000 0x4000 DPLLIP3 */ - reg = <0x53fd4000 0x4000 - 0x63F80000 0x4000 - 0x63F84000 0x4000 - 0x63F88000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <71 72>; - status = "disabled"; - }; - - /* - * GPIO modules moved up - to have it attached for - * drivers which rely on GPIO - */ - /* 53F84000 0x4000 GPIO1 */ - gpio1: gpio@53f84000 { - compatible = "fsl,imx53-gpio"; - reg = <0x53f84000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <50 51 42 43 44 45 46 47 48 49>; - /* TODO: use <> also */ - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 53F88000 0x4000 GPIO2 */ - gpio2: gpio@53f88000 { - compatible = "fsl,imx53-gpio"; - reg = <0x53f88000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <52 53>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 53F8C000 0x4000 GPIO3 */ - gpio3: gpio@53f8c000 { - compatible = "fsl,imx53-gpio"; - reg = <0x53f8c000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <54 55>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 53F90000 0x4000 GPIO4 */ - gpio4: gpio@53f90000 { - compatible = "fsl,imx53-gpio"; - reg = <0x53f90000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <56 57>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 53FDC000 0x4000 GPIO5 */ - gpio5: gpio@53fdc000 { - compatible = "fsl,imx53-gpio"; - reg = <0x53fdc000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <103 104>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 53FE0000 0x4000 GPIO6 */ - gpio6: gpio@53fe0000 { - compatible = "fsl,imx53-gpio"; - reg = <0x53fe0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <105 106>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - /* 53FE4000 0x4000 GPIO5 */ - gpio7: gpio@53fe4000 { - compatible = "fsl,imx53-gpio"; - reg = <0x53fe4000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <107 108>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <1>; - }; - - spba@50000000 { - compatible = "fsl,spba-bus", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&tzic>; - ranges; - - /* 50004000 0x4000 ESDHC 1 */ - esdhc@50004000 { - compatible = "fsl,imx53-esdhc"; - reg = <0x50004000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <1>; - status = "disabled"; - }; - - /* 50008000 0x4000 ESDHC 2 */ - esdhc@50008000 { - compatible = "fsl,imx53-esdhc"; - reg = <0x50008000 0x4000>; - interrupt-parent = <&tzic>; interrupts = <2>; - status = "disabled"; - }; - - /* 5000C000 0x4000 UART 3 */ - uart3: serial@5000c000 { - compatible = "fsl,imx53-uart", "fsl,imx-uart"; - reg = <0x5000c000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <33>; - status = "disabled"; - }; - - /* 50010000 0x4000 eCSPI1 */ - ecspi@50010000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx53-ecspi"; - reg = <0x50010000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <36>; - status = "disabled"; - }; - - /* 50014000 0x4000 SSI2 irq30 */ - SSI2: ssi@50014000 { - compatible = "fsl,imx53-ssi"; - reg = <0x50014000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <30>; - status = "disabled"; - }; - - /* 50020000 0x4000 ESDHC 3 */ - esdhc@50020000 { - compatible = "fsl,imx53-esdhc"; - reg = <0x50020000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <3>; - status = "disabled"; - }; - - /* 50024000 0x4000 ESDHC 4 */ - esdhc@50024000 { - compatible = "fsl,imx53-esdhc"; - reg = <0x50024000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <4>; - status = "disabled"; - }; - - /* 50028000 0x4000 SPDIF */ - /* 91 SPDIF */ - - pata@50030000 { - compatible = "fsl,imx53-ata"; - reg = <0x50030000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <70>; - status = "disabled"; - }; - - /* 50034000 0x4000 SLM */ - /* 50038000 0x4000 HSI2C */ - /* 64 HS-I2C */ - /* 5003C000 0x4000 SPBA */ - }; - - usbphy0: usbphy@0 { - compatible = "usb-nop-xceiv"; - status = "okay"; - }; - - usbphy1: usbphy@1 { - compatible = "usb-nop-xceiv"; - status = "okay"; - }; - - usbotg: usb@53f80000 { - compatible = "fsl,imx53-usb", "fsl,imx27-usb"; - reg = <0x53f80000 0x0200>; - interrupts = <18>; - fsl,usbphy = <&usbphy0>; - status = "disabled"; - }; - - usbh1: usb@53f80200 { - compatible = "fsl,imx53-usb", "fsl,imx27-usb"; - reg = <0x53f80200 0x0200>; - interrupts = <14>; - fsl,usbphy = <&usbphy1>; - status = "disabled"; - }; - - usbh2: usb@53f80400 { - compatible = "fsl,imx53-usb", "fsl,imx27-usb"; - reg = <0x53f80400 0x0200>; - interrupts = <16>; - status = "disabled"; - }; - - usbh3: usb@53f80600 { - compatible = "fsl,imx53-usb", "fsl,imx27-usb"; - reg = <0x53f80600 0x0200>; - interrupts = <17>; - status = "disabled"; - }; - - usbmisc: usbmisc@53f80800 { - #index-cells = <1>; - compatible = "fsl,imx53-usbmisc"; - reg = <0x53f80800 0x200>; - }; - - /* 53F98000 0x4000 WDOG1 */ - wdog@53f98000 { - compatible = "fsl,imx53-wdt"; - reg = <0x53f98000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <58>; - status = "disabled"; - }; - - /* 53F9C000 0x4000 WDOG2 (TZ) */ - wdog@53f9c000 { - compatible = "fsl,imx53-wdt"; - reg = <0x53f9c000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <59>; - status = "disabled"; - }; - - /* 53F94000 0x4000 KPP */ - keyboard@53f94000 { - compatible = "fsl,imx53-kpp"; - reg = <0x53f94000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <60>; - status = "disabled"; - }; - - /* 53FA0000 0x4000 GPT */ - timer@53fa0000 { - compatible = "fsl,imx53-gpt"; - reg = <0x53fa0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <39>; - status = "disabled"; - }; - - /* 53FA4000 0x4000 SRTC */ - - rtc@53fa4000 { - compatible = "fsl,imx53-srtc"; - reg = <0x53fa4000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <24 25>; - status = "disabled"; - }; - - /* 53FA8000 0x4000 IOMUXC */ - iomux@53fa8000 { - compatible = "fsl,imx53-iomux"; - reg = <0x53fa8000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <7>; - }; - - /* 53FAC000 0x4000 EPIT1 */ - epit1: timer@53fac000 { - compatible = "fsl,imx53-epit"; - reg = <0x53fac000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <40>; - status = "disabled"; - }; - - /* 53FB0000 0x4000 EPIT2 */ - epit2: timer@53fb0000 { - compatible = "fsl,imx53-epit"; - reg = <0x53fb0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <41>; - status = "disabled"; - }; - - /* 53FB4000 0x4000 PWM1 */ - pwm@53fb4000 { - compatible = "fsl,imx53-pwm"; - reg = <0x53fb4000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <61>; - status = "disabled"; - }; - - /* 53FB8000 0x4000 PWM2 */ - pwm@53fb8000 { - compatible = "fsl,imx53-pwm"; - reg = <0x53fb8000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <94>; - status = "disabled"; - }; - - /* 53FBC000 0x4000 UART 1 */ - uart1: serial@53fbc000 { - compatible = "fsl,imx53-uart", "fsl,imx-uart"; - reg = <0x53fbc000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <31>; - status = "disabled"; - }; - - /* 53FC0000 0x4000 UART 2 */ - uart2: serial@53fc0000 { - compatible = "fsl,imx53-uart", "fsl,imx-uart"; - reg = <0x53fc0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <32>; - status = "disabled"; - }; - - /* 53FF0000 0x4000 UART 4 */ - uart4: serial@53ff0000 { - compatible = "fsl,imx53-uart", "fsl,imx-uart"; - reg = <0x53ff0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <13>; - status = "disabled"; - }; - - /* 53FD0000 0x4000 SRC */ - reset@53fd0000 { - compatible = "fsl,imx53-src"; - reg = <0x53fd0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <75>; - status = "disabled"; - }; - /* 53FD8000 0x4000 GPC */ - power@53fd8000 { - compatible = "fsl,imx53-gpc"; - reg = <0x53fd8000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <73 74>; - status = "disabled"; - }; - i2c@53fec000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx53-i2c", "fsl,imx1-i2c", - "fsl,imx-i2c"; - reg = <0x53fec000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <64>; - status = "disabled"; - }; - }; - - aips@60000000 { /* AIPS2 */ - compatible = "fsl,aips-bus", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&tzic>; - ranges; - - /* 63F90000 0x4000 UART 5 */ - uart5: serial@63f90000 { - compatible = "fsl,imx53-uart", "fsl,imx-uart"; - reg = <0x63f90000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <32>; - status = "disabled"; - }; - - /* 63F94000 0x4000 AHBMAX */ - /* 63F98000 0x4000 IIM */ - /* - * 69 IIM Interrupt request to the processor. - * Indicates to the processor that program or - * explicit. - */ - /* 63F9C000 0x4000 CSU */ - /* - * 27 CSU Interrupt Request 1. Indicates to the - * processor that one or more alarm inputs were. - */ - - /* 63FA0000 0x4000 TIGERP_PLATFORM_NE_32K_256K */ - /* irq76 Neon Monitor Interrupt */ - /* irq77 Performance Unit Interrupt */ - /* irq78 CTI IRQ */ - /* irq79 Debug Interrupt, Cross-Trigger Interface 1 */ - /* irq80 Debug Interrupt, Cross-Trigger Interface 1 */ - /* irq89 Debug Interrupt, Cross-Trigger Interface 2 */ - /* irq98 Debug Interrupt, Cross-Trigger Interface 3 */ - - /* 63FA4000 0x4000 OWIRE irq88 */ - /* 63FA8000 0x4000 FIRI irq93 */ - /* 63FAC000 0x4000 eCSPI2 */ - ecspi@63fac000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx53-ecspi"; - reg = <0x63fac000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <37>; - status = "disabled"; - }; - - /* 63FB0000 0x4000 SDMA */ - sdma@63fb0000 { - compatible = "fsl,imx53-sdma"; - reg = <0x63fb0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <6>; - }; - - /* 63FB4000 0x4000 SCC */ - /* 21 SCC Security Monitor High Priority Interrupt. */ - /* 22 SCC Secure (TrustZone) Interrupt. */ - /* 23 SCC Regular (Non-Secure) Interrupt. */ - - /* 63FB8000 0x4000 ROMCP */ - /* 63FBC000 0x4000 RTIC */ - /* - * 26 RTIC RTIC (Trust Zone) Interrupt Request. - * Indicates that the RTIC has completed hashing the - */ - - /* 63FC0000 0x4000 CSPI */ - cspi@63fc0000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx53-cspi"; - reg = <0x63fc0000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <38>; - status = "disabled"; - }; - - /* 63FC4000 0x4000 I2C2 */ - i2c@63fc4000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx53-i2c", "fsl,imx1-i2c", "fsl,imx-i2c"; - reg = <0x63fc4000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <63>; - status = "disabled"; - }; - - /* 63FC8000 0x4000 I2C1 */ - i2c@63fc8000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,imx53-i2c", "fsl,imx1-i2c", "fsl,imx-i2c"; - reg = <0x63fc8000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <62>; - status = "disabled"; - }; - - /* 63FCC000 0x4000 SSI1 */ - /* 29 SSI1 SSI-1 Interrupt Request */ - SSI1: ssi@63fcc000 { - compatible = "fsl,imx53-ssi"; - reg = <0x63fcc000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <29>; - status = "disabled"; - }; - - /* 63FD0000 0x4000 AUDMUX */ - audmux@63fd4000 { - compatible = "fsl,imx53-audmux"; - reg = <0x63fd4000 0x4000>; - status = "disabled"; - }; - - /* 63FD8000 0x4000 EXTMC */ - /* 8 EXTMC (NFC) */ - /* 15 EXTMC */ - /* 97 EXTMC Boot sequence completed interrupt */ - /* - * 101 EMI Indicates all pages have been transferred - * to NFC during an auto program operation. - */ - - /* 83FE4000 0x4000 SIM */ - /* 67 SIM intr composed of oef, xte, sdi1, and sdi0 */ - /* 68 SIM intr composed of tc, etc, tfe, and rdrf */ - - /* 63FD_C000 0x4000 apb2ip_pl301_2x2 */ - /* 63FE_0000 0x4000 apb2ip_pl301_4x1 */ - /* 63FE4000 0x4000 MLB */ - /* 63FE8000 0x4000 SSI3 */ - /* 96 SSI3 SSI-3 Interrupt Request */ - SSI3: ssi@63fe8000 { - compatible = "fsl,imx51-ssi"; - reg = <0x63fe8000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <96>; - status = "disabled"; - }; - - /* 63FEC000 0x4000 FEC */ - ethernet@63fec000 { - compatible = "fsl,imx53-fec"; - reg = <0x63fec000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <87>; - status = "disabled"; - }; - - /* 63FF0000 0x4000 TVE */ - /* 92 TVE */ - /* 63FF4000 0x4000 VPU */ - /* 9 VPU */ - /* 100 VPU Idle interrupt from VPU */ - - /* 63FF8000 0x4000 SAHARA */ - /* 19 SAHARA SAHARA host 0 (TrustZone) Intr */ - /* 20 SAHARA SAHARA host 1 (non-TrustZone) Intr */ - }; - }; - - localbus@10000000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - sata@10000000 { - compatible = "fsl,imx53-ata"; - reg = <0x10000000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <28>; - status = "disabled"; - }; - - vga: ipu3@1E000000 { - compatible = "fsl,ipu3"; - reg = < - 0x1E000000 0x08000 /* CM */ - 0x1E008000 0x08000 /* IDMAC */ - 0x1E018000 0x08000 /* DP */ - 0x1E020000 0x08000 /* IC */ - 0x1E028000 0x08000 /* IRT */ - 0x1E030000 0x08000 /* CSI0 */ - 0x1E038000 0x08000 /* CSI1 */ - 0x1E040000 0x08000 /* DI0 */ - 0x1E048000 0x08000 /* DI1 */ - 0x1E050000 0x08000 /* SMFC */ - 0x1E058000 0x08000 /* DC */ - 0x1E060000 0x08000 /* DMFC */ - 0x1E068000 0x08000 /* VDI */ - 0x1F000000 0x20000 /* CPMEM */ - 0x1F020000 0x20000 /* LUT */ - 0x1F040000 0x20000 /* SRM */ - 0x1F060000 0x20000 /* TPM */ - 0x1F080000 0x20000 /* DCTMPL */ - >; - interrupt-parent = <&tzic>; - interrupts = < - 10 /* IPUEX Error */ - 11 /* IPUEX Sync */ - >; - status = "disabled"; - }; - }; -}; - -/* - -TODO: Not mapped interrupts - -5 DAP -84 GPU2D (OpenVG) general interrupt -85 GPU2D (OpenVG) busy signal (for S/W power gating feasibility) -12 GPU3D -102 GPU3D Idle interrupt from GPU3D (for S/W power gating) -90 SJC -*/ diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/imx6.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/imx6.dtsi deleted file mode 100644 index db8b44e53b..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/imx6.dtsi +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright (c) 2013 Ian Lepore - * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Freescale i.MX6 Common Device Tree Source. - * There are enough differences between the Solo, Dual, Quad, and *-lite - * flavors of this SoC that eventually we will need a finer-grained breakdown - * of some of this stuff. For now this file works for all of them. I think. - * - * $FreeBSD$ - */ - -/ { - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,MCIMX6"; - reg = <0x0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x8000>; - i-cache-size = <0x8000>; - /* TODO: describe L2 cache also */ - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - aliases { - soc = &SOC; - }; - - SOC: soc@00000000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&gic>; - ranges = <0x00000000 0x00000000 0x10000000>; - - gic: generic-interrupt-controller@00a00100 { - compatible = "arm,gic"; - interrupt-controller; - #interrupt-cells = <1>; - reg = <0x00a01000 0x00001000 - 0x00a00100 0x00000100>; - }; - - mp_tmr0@00a00200 { - compatible = "arm,mpcore-timers"; - reg = <0x00a00200 0x100 - 0x00a00600 0x100>; - interrupts = <27 29>; - interrupt-parent = <&gic>; - }; - - l2-cache@00a02000 { - compatible = "arm,pl310-cache", "arm,pl310"; - reg = <0xa02000 0x1000>; - interrupts = <124>; - cache-level = <0x2>; - interrupt-parent = < &gic >; - }; - - aips@02000000 { /* AIPS1 */ - compatible = "fsl,aips-bus", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&gic>; - reg = <0x02000000 0x00100000>; - ranges; - - /* Required by many devices, so better to stay first */ - clks: ccm@020c4000 { - compatible = "fsl,imx6q-ccm"; - reg = <0x020c4000 0x4000>; - interrupts = <119 120>; - }; - - /* System Reset Controller */ - src: src@4006E000 { - compatible = "fsl,imx6-src"; - reg = <0x020D8000 0x100>; - }; - - sdma: sdma@020ec000 { - compatible = "fsl,imx6q-sdma"; - reg = <0x020ec000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <34>; - status = "disabled"; - }; - - anatop: anatop@020c8000 { - compatible = "fsl,imx6q-anatop"; - reg = <0x020c8000 0x1000>; - interrupt-parent = <&gic>; - interrupts = <49>; - }; - - gpt: timer@02098000 { - compatible = "fsl,imx6q-gpt", "fsl,imx51-gpt"; - reg = <0x02098000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <87>; - }; - - iomux@020e0000 { - compatible = "fsl,imx6q-iomuxc"; - reg = <0x020e0000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <32>; - }; - - gpio1: gpio@0209c000 { - compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; - reg = <0x0209c000 0x4000>; - interrupts = < 98 99 >; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - status = "disabled"; - }; - - gpio2: gpio@020a0000 { - compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; - reg = <0x020a0000 0x4000>; - interrupts = < 100 101 >; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - status = "disabled"; - }; - - gpio3: gpio@020a4000 { - compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; - reg = <0x020a4000 0x4000>; - interrupts = < 102 103 >; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - status = "disabled"; - }; - - gpio4: gpio@020a8000 { - compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; - reg = <0x020a8000 0x4000>; - interrupts = < 104 105 >; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - status = "disabled"; - }; - - gpio5: gpio@020ac000 { - compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; - reg = <0x020ac000 0x4000>; - interrupts = < 106 107 >; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - status = "disabled"; - }; - - gpio6: gpio@020b0000 { - compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; - reg = <0x020b0000 0x4000>; - interrupts = < 108 109 >; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - status = "disabled"; - }; - - gpio7: gpio@020b4000 { - compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; - reg = <0x020b4000 0x4000>; - interrupts = < 110 111 >; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - status = "disabled"; - }; - - uart1: serial@02020000 { - compatible = "fsl,imx6q-uart"; - reg = <0x02020000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <58>; - clock-frequency = <80000000>; - status = "disabled"; - }; - - uart2: serial@021e8000 { - compatible = "fsl,imx6q-uart"; - reg = <0x021e8000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <59>; - clock-frequency = <80000000>; - status = "disabled"; - }; - - uart3: serial@021ec000 { - compatible = "fsl,imx6q-uart"; - reg = <0x021ec000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <60>; - clock-frequency = <80000000>; - status = "disabled"; - }; - - uart4: serial@021f0000 { - compatible = "fsl,imx6q-uart"; - reg = <0x021f0000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <61>; - clock-frequency = <80000000>; - status = "disabled"; - }; - - uart5: serial@021f4000 { - compatible = "fsl,imx6q-uart"; - reg = <0x021f4000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <62>; - clock-frequency = <80000000>; - status = "disabled"; - }; - - usbphy1: usbphy@020c9000 { - compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; - reg = <0x020c9000 0x1000>; - interrupts = <44>; - status = "disabled"; - }; - - usbphy2: usbphy@020ca000 { - compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; - reg = <0x020ca000 0x1000>; - interrupts = <45>; - status = "disabled"; - }; - - ecspi1: ecspi@02008000 { - compatible = "fsl,imx6q-ecspi"; - reg = <0x02008000 0x4000>; - interrupts = < 63 >; - status = "disabled"; - }; - - ecspi2: ecspi@0200C000 { - compatible = "fsl,imx6q-ecspi"; - reg = <0x0200C000 0x4000>; - interrupts = < 64 >; - status = "disabled"; - }; - - ecspi3: ecspi@02010000 { - compatible = "fsl,imx6q-ecspi"; - reg = <0x02010000 0x4000>; - interrupts = < 65 >; - status = "disabled"; - }; - - ecspi4: ecspi@02014000 { - compatible = "fsl,imx6q-ecspi"; - reg = <0x02014000 0x4000>; - interrupts = < 66 >; - status = "disabled"; - }; - - ecspi5: ecspi@02018000 { - compatible = "fsl,imx6q-ecspi"; - reg = <0x02018000 0x4000>; - interrupts = < 67 >; - status = "disabled"; - }; - - ssi1: ssi@02028000 { - compatible = "fsl,imx6q-ssi"; - reg = <0x02028000 0x4000>; - interrupts = < 78 >; - dmas = <&sdma 37 1 0>, - <&sdma 38 1 0>; - dma-names = "rx", "tx"; - status = "disabled"; - }; - - ssi2: ssi@0202C000 { - compatible = "fsl,imx6q-ssi"; - reg = <0x0202C000 0x4000>; - interrupts = < 79 >; - status = "disabled"; - }; - - ssi3: ssi@02030000 { - compatible = "fsl,imx6q-ssi"; - reg = <0x02030000 0x4000>; - interrupts = < 80 >; - status = "disabled"; - }; - }; - - aips@02100000 { /* AIPS2 */ - compatible = "fsl,aips-bus", "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&gic>; - reg = <0x02100000 0x00100000>; - ranges; - - i2c1: i2c@021a0000 { - compatible = "fsl,imx6q-i2c"; - reg = <0x021a0000 0x4000>; - interrupts = < 68 >; - status = "disabled"; - }; - - i2c2: i2c@021a4000 { - compatible = "fsl,imx6q-i2c"; - reg = <0x021a4000 0x4000>; - interrupts = < 69 >; - status = "disabled"; - }; - - i2c3: i2c@021ac000 { - compatible = "fsl,imx6q-i2c"; - reg = <0x021a8000 0x4000>; - interrupts = < 70 >; - status = "disabled"; - }; - - fec1: ethernet@02188000 { - compatible = "fsl,imx6q-fec"; - reg = <0x02188000 0x4000>; - interrupts = <150 151>; - status = "disabled"; - }; - - usbotg1: usb@02184000 { - compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; - reg = <0x02184000 0x200>; - interrupts = <75>; - fsl,usbphy = <&usbphy1>; - fsl,usbmisc = <&usbmisc 0>; - status = "disabled"; - }; - - usbh1: usb@02184200 { - compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; - reg = <0x02184200 0x200>; - interrupts = <72>; - fsl,usbphy = <&usbphy2>; - fsl,usbmisc = <&usbmisc 1>; - status = "disabled"; - }; - - usbh2: usb@02184400 { - compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; - reg = <0x02184400 0x200>; - interrupts = <73>; - fsl,usbmisc = <&usbmisc 2>; - status = "disabled"; - }; - - usbh3: usb@02184600 { - compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; - reg = <0x02184600 0x200>; - interrupts = <74>; - fsl,usbmisc = <&usbmisc 3>; - status = "disabled"; - }; - - usbmisc: usbmisc@02184800 { - #index-cells = <1>; - compatible = "fsl,imx6q-usbmisc"; - reg = <0x02184800 0x200>; - // Not disabled on purpose. - }; - - usdhc1: usdhc@02190000 { - compatible = "fsl,imx6q-usdhc"; - reg = <0x02190000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <54>; - cd-gpios = <&gpio1 2 0>; - bus-width = <0x4>; - status ="disabled"; - }; - - usdhc2: usdhc@02194000 { - compatible = "fsl,imx6q-usdhc"; - reg = <0x02194000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <55>; - non-removable; - bus-width = <0x4>; - status ="disabled"; - }; - - usdhc3: usdhc@02198000 { - compatible = "fsl,imx6q-usdhc"; - reg = <0x02198000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <56>; - cd-gpios = <&gpio3 9 0>; - bus-width = <0x4>; - status ="disabled"; - }; - - usdhc4: usdhc@0219c000 { - compatible = "fsl,imx6q-usdhc"; - reg = <0x0219c000 0x4000>; - interrupt-parent = <&gic>; - interrupts = <57>; - bus-width = <0x4>; - status ="disabled"; - }; - - ocotp0: ocotp@021bc000 { - compatible = "fsl,imx6q-ocotp"; - reg = <0x021bc000 0x4000>; - }; - - audmux: audmux@021d8000 { - compatible = "fsl,imx6q-audmux"; - reg = <0x021d8000 0x4000>; - status = "disabled"; - }; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/meson3.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/meson3.dtsi deleted file mode 100644 index 444e3cf62e..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/meson3.dtsi +++ /dev/null @@ -1,77 +0,0 @@ -/*- - * Copyright (c) 2015 John Wehle <john@feith.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * The basic single core aml8726 (aka meson) uses an Amlogic interrupt - * controller, however meson.dtsi specifies GIC (which is present on - * the multicore aml8726) so we need to override things here. - */ - -/include/ "meson.dtsi" - -/ { - model = "Amlogic Meson3 SoC"; - compatible = "amlogic,meson3"; - - interrupt-parent = <&pic>; - - pic: pic@c1109a40 { - device_type = "interrupt-controller"; - compatible = "amlogic,aml8726-pic"; - reg = <0xc1109a40 128>; /* cbus 0x2690 */ - - interrupt-controller; - #interrupt-cells = <3>; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@200 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - next-level-cache = <&L2>; - reg = <0x200>; - }; - }; - - clk81: clk@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <0>; - }; -}; - -&gic { - status = "disabled"; -}; - -&L2 { - interrupts = <0 61 1>; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/meson8b.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/meson8b.dtsi deleted file mode 100644 index c76a01a4fa..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/meson8b.dtsi +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * Copyright (c) 2015 John Wehle <john@feith.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/include/ "meson.dtsi" - -/ { - model = "Amlogic Meson8b SoC"; - compatible = "amlogic,meson8b"; - - interrupt-parent = <&gic>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@200 { - device_type = "cpu"; - compatible = "arm,cortex-a5"; - next-level-cache = <&L2>; - reg = <0x200>; - }; - - cpu@201 { - device_type = "cpu"; - compatible = "arm,cortex-a5"; - next-level-cache = <&L2>; - reg = <0x201>; - }; - - cpu@202 { - device_type = "cpu"; - compatible = "arm,cortex-a5"; - next-level-cache = <&L2>; - reg = <0x202>; - }; - - cpu@203 { - device_type = "cpu"; - compatible = "arm,cortex-a5"; - next-level-cache = <&L2>; - reg = <0x203>; - }; - }; - - clk81: clk@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <0>; - }; -}; - -&L2 { - interrupts = <0 143 1>; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/odroidc1.dts b/usr/src/boot/sys/boot/fdt/dts/arm/odroidc1.dts deleted file mode 100644 index 2d15a0900e..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/odroidc1.dts +++ /dev/null @@ -1,396 +0,0 @@ -/*- - * Copyright (c) 2015 John Wehle <john@feith.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * The ordering of certain devices is significant (e.g. usb depends on - * usb-phy which depends on gpio, also the timer should appear early on - * to provide a reasonably accurate DELAY implementation). - * - * Both usb-phys devices must be configured to prevent the usb controller - * from hanging during initialization. - */ - -/dts-v1/; - -/memreserve/ 0x7900000 0x00600000; /* 6MB frame buffer */ - -#include "meson8b.dtsi" - -/ { - model = "hardkernel,odroid-c1"; - compatible = "hardkernel,odroid-c1", "amlogic,s805"; - - #address-cells = <1>; - #size-cells = <1>; - - aliases { - soc = &soc; - screen = &screen; - uart0 = &uart_AO; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x40000000>; /* 1GB RAM */ - }; - - soc: soc { - device_type = "soc"; - bus-frequency = <0>; - - scu: scu@c4300000 { - compatible = "arm,cortex-a5-scu"; - reg = <0xc4300000 0x1000>; - }; - - cpuconfig: cpuconfig@d901ff80 { - compatible = "amlogic,aml8726-cpuconfig"; - reg = <0xd901ff80 16>; - }; - - ccm@c1104140 { - compatible = "amlogic,aml8726-ccm"; - reg = <0xc1104140 20>; /* cbus 0x1050 */ - - functions = "ethernet", "i2c", "rng", "sdio", "sdxc", - "uart-a", "uart-b", "uart-c", - "usb-a", "usb-b"; - }; - - pinctrl@c11080b0 { - compatible = "amlogic,aml8726-pinctrl"; - reg = <0xc11080b0 40>, /* mux */ - <0xc11080e8 24>, /* pu/pd */ - <0xc1108120 24>, /* pull enable */ - <0xc8100014 4>, /* ao mux */ - <0xc810002c 4>, /* ao pu/pd */ - <0xc810002c 4>; /* ao pull enable */ - - /* - * Currently only pin muxing that deviates - * from the power on default of gpio is - * specified here. - */ - - pinctrl-names = "default"; - pinctrl-0 = <&pins_uartao &pins_ethernet &pins_hdmi>; - - pins_ethernet: ethernet { - amlogic,pins = "ref_clk", - "tx_clk", "tx_en", - "tx_d0", "tx_d1", - "tx_d2", "tx_d3", - "rx_clk", "rx_dv", - "rx_d0", "rx_d1", - "rx_d2", "rx_d3", - "mdc", "mdio"; - amlogic,function = "ethernet"; - }; - - pins_hdmi: hdmi { - amlogic,pins = "cec", "hpd", - "scl", "sda"; - amlogic,function = "hdmi"; - }; - - pins_sdio_b: sdio_b { - amlogic,pins = "clk", "cmd", - "d0", "d1", - "d2", "d3"; - amlogic,function = "sdio-b"; - amlogic,pull = "up"; - }; - - pins_sdxc_b: sdxc_b { - amlogic,pins = "clk", "cmd", - "d0", "d1", - "d2", "d3"; - amlogic,function = "sdxc-b"; - amlogic,pull = "up"; - }; - - pins_sdio_c: sdio_c { - amlogic,pins = "clk", "cmd", - "d0", "d1", - "d2", "d3"; - amlogic,function = "sdio-c"; - amlogic,pull = "up"; - }; - - pins_sdxc_c: sdxc_c { - amlogic,pins = "clk", "cmd", - "d0", "d1", - "d2", "d3", - "d4", "d5", - "d6", "d7"; - amlogic,function = "sdxc-c"; - amlogic,pull = "up"; - }; - - pins_i2c_a: i2c_a { - amlogic,pins = "scl", "sda"; - amlogic,function = "i2c-a"; - }; - - pins_i2c_b: i2c_b { - amlogic,pins = "scl", "sda"; - amlogic,function = "i2c-b"; - }; - - pins_uarta: uarta { - amlogic,pins = "tx", "rx", "cts", "rts"; - amlogic,function = "uart-a"; - }; - - pins_uartb: uartb { - - /* - * gpiox18 appears to have special - * meaning to the bootloader making - * hardware handshaking unavailable. - */ - - amlogic,pins = "tx", "rx"; - amlogic,function = "uart-b"; - }; - - pins_uartc: uartc { - amlogic,pins = "tx", "rx", "cts", "rts"; - amlogic,function = "uart-c"; - }; - - pins_uartao: uartao { - amlogic,pins = "tx", "rx"; - amlogic,function = "uart-ao"; - }; - }; - - rtc@c8100740 { - compatible = "amlogic,aml8726-rtc"; - reg = <0xc8100740 20>; /* aobus 0x1d0 */ - interrupts = <0 72 1>; - }; - - clkmsr: clkmsr@c1108758 { - compatible = "amlogic,aml8726-clkmsr"; - reg = <0xc1108758 16>; /* cbus 0x21d6 */ - - clocks = <&clk81>; - }; - - gpioao: gpio@c8100024 { - /* gpio unit 7 */ - compatible = "amlogic,aml8726-gpio"; - reg = <0xc8100024 4>, /* oen aobus 0x9 */ - <0xc8100024 4>, /* out */ - <0xc8100028 4>; /* in */ - - gpio-controller; - #gpio-cells = <1>; - pin-count = <14>; - }; - - gpio3: gpio@c1108054 { - compatible = "amlogic,aml8726-gpio"; - reg = <0xc1108054 4>, /* oen cbus 0x2015 */ - <0xc1108058 4>, /* out */ - <0xc110805c 4>; /* in */ - - gpio-controller; - #gpio-cells = <1>; - pin-count = <32>; - }; - - gpio5: gpio@c110806c { - compatible = "amlogic,aml8726-gpio"; - reg = <0xc110806c 4>, /* oen cbus 0x201b */ - <0xc1108070 4>, /* out */ - <0xc1108074 4>; /* in */ - - gpio-controller; - #gpio-cells = <1>; - pin-count = <32>; - }; - - mmc@c1108c20 { - compatible = "amlogic,aml8726-mmc"; - reg = <0xc1108c20 32>; /* cbus 0x2308 */ - interrupts = <0 28 1>; - - clocks = <&clk81>; - - pinctrl-names = "default"; - pinctrl-0 = <&pins_sdio_b>; - - /* - * Ordering is significant. - * - * mmc-vselect low sets first voltage - * mmc-vselect high sets second voltage - * - * If mmc-vselect is not present, then - * only one voltage should be specified. - */ - mmc-voltages = "3.3", "1.8"; - mmc-vselect = <&gpioao 3>; /* gpioao_3 */ - - mmc-pwr-en = <&gpio5 31 0>; /* card_8 */ - ins-detect = <&gpio5 29 0>; /* card_6 */ - }; - - sdxc@c1108e00 { - compatible = "amlogic,aml8726-sdxc-m8"; - clock-frequency = <1275000000>; - reg = <0xc1108e00 60>; /* cbus 0x2380 */ - interrupts = <0 78 1>; - - pinctrl-names = "default"; - pinctrl-0 = <&pins_sdxc_c>; - - mmc-voltages = "1.8"; - - mmc-rst = <&gpio3 9 0>; /* boot_9 emmc-rst */ - }; - - rng@c1108100 { - compatible = "amlogic,aml8726-rng"; - reg = <0xc1108100 8>; /* cbus 0x2040 */ - }; - - usb-phy@c1108800 { - /* usb-a phy */ - compatible = "amlogic,aml8726-m8-usb-phy"; - reg = <0xc1108800 32>; /* cbus 0x2200 */ - - usb-pwr-en = <&gpioao 5 1>; /* gpioao_5 vbus */ - }; - - usb-phy@c1108820 { - /* usb-b phy */ - compatible = "amlogic,aml8726-m8-usb-phy"; - reg = <0xc1108820 32>; /* cbus 0x2208 */ - - force-aca = "true"; - usb-hub-rst = <&gpioao 4 0>; /* gpioao_4 hub-rst */ - }; - - usb@c9040000 { - /* usb-a */ - compatible = "synopsys,designware-hs-otg2"; - reg = <0xc9040000 0x40000>; /* ahbbus 0x40000*/ - interrupts = <0 30 4>; - #address-cells = <1>; - #size-cells = <0>; - - dr_mode = "host"; - }; - - usb@c90c0000 { - /* usb-b */ - compatible = "synopsys,designware-hs-otg2"; - reg = <0xc90c0000 0x40000>; /* ahbbus 0xc0000 */ - interrupts = <0 31 4>; - #address-cells = <1>; - #size-cells = <0>; - - dr_mode = "host"; - }; - - eth@c9410000 { - /* ethernet */ - compatible = "amlogic,meson6-dwmac"; - reg = <0xc9410000 0x2000>; /* ahbbus 0x410000 */ - interrupts = <0 8 1>; - #address-cells = <1>; - #size-cells = <0>; - - eth-phy-rst = <&gpio3 23 0>; /* gpioh_4 phy-rst */ - }; - - screen: fb@c8006020 { - device_type = "display"; - compatible = "amlogic,aml8726-fb"; - reg = <0xc8006048 12>, /* CANVAS */ - <0xc1106800 1024>, /* VIU */ - <0xc1107400 1024>; /* VPP */ - interrupts = <0 2 1>, - <0 3 1>, - <0 12 1>, - <0 13 1>; - - address = <0x7900000>; /* match memreserve */ - width = <720>; - height = <480>; - depth = <24>; - linebytes = <2160>; - }; - }; - - leds { - compatible = "gpio-leds"; - - sys_led { - gpios = <&gpioao 13>; /* gpioao_13 sys_led */ - label = "sys_led"; - }; - }; - - chosen { - stdin = "uart0"; - stdout = "uart0"; - }; -}; - -&clk81 { - clock-frequency = <0>; -}; - -&uart_AO { - status = "okay"; - current-speed = <115200>; -}; - -&uart_A { - status = "okay"; -}; - -&uart_B { - status = "okay"; -}; - -&uart_C { - status = "okay"; -}; - -&i2c_A { - status = "okay"; -}; - -&i2c_B { - status = "okay"; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts b/usr/src/boot/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts deleted file mode 100644 index ffe0777b5c..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * Copyright (c) 2015 Emmanuel Vadot <manu@bidouilliste.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "sun7i-a20-olimex-som-evb.dts" - -/ { - soc@01c00000 { - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/olinuxino-lime.dts b/usr/src/boot/sys/boot/fdt/dts/arm/olinuxino-lime.dts deleted file mode 100644 index b965788991..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/olinuxino-lime.dts +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * Copyright (c) 2015 Emmanuel Vadot <manu@bidouilliste.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "sun4i-a10-olinuxino-lime.dts" - -/ { - soc@01c00000 { - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard-common.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard-common.dtsi deleted file mode 100644 index f8d2a0814b..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard-common.dtsi +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * Copyright (c) 2015 Oleksandr Tymoshenko <gonzo@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -&mmc1 { - non-removable; /* XXX need real solution */ -}; - -&mmc5 { - status = "disabled"; -}; - -/ { - ocp { - global-timer@48240600 { - compatible = "arm,cortex-a9-global-timer"; - reg = <0x48240200 0x20>; - interrupts = <GIC_PPI 11 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_HIGH)>; - }; - - elm: elm@48078000 { - interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; - }; - }; - chosen { - stdin = "serial2"; - stdout = "serial2"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard-es.dts b/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard-es.dts deleted file mode 100644 index 6c3f4b58e4..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard-es.dts +++ /dev/null @@ -1,31 +0,0 @@ -/*- - * Copyright (c) 2015 Oleksandr Tymoshenko <gonzo@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - - -#include "omap4-panda-es.dts" -#include "pandaboard-common.dtsi" diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard.dts b/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard.dts deleted file mode 100644 index b25ca634e2..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/pandaboard.dts +++ /dev/null @@ -1,31 +0,0 @@ -/*- - * Copyright (c) 2015 Oleksandr Tymoshenko <gonzo@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - - -#include "omap4-panda.dts" -#include "pandaboard-common.dtsi" diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts b/usr/src/boot/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts deleted file mode 100644 index 643f5d0ea8..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * Copyright (c) 2014 Ganbold Tsagaankhuu <ganbold@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "rk3188.dtsi" - -/ { - model = "Radxa RadxaRock Lite"; - - memory { - device_type = "memory"; - reg = < 0x60000000 0x40000000 >; /* 1GB RAM */ - }; - - aliases { - soc = &SOC; - }; - - SOC: rk3188 { - - uart2: serial@20064000 { - status = "okay"; - }; - - mmc@10214000 { - status = "okay"; - }; - - }; - - chosen { - bootargs = "-v"; - stdin = &uart2; - stdout = &uart2; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/rk3188-radxa.dts b/usr/src/boot/sys/boot/fdt/dts/arm/rk3188-radxa.dts deleted file mode 100644 index c3740a0a5a..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/rk3188-radxa.dts +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "rk3188.dtsi" - -/ { - model = "Radxa RadxaRock"; - - memory { - device_type = "memory"; - reg = < 0x60000000 0x80000000 >; /* 2GB RAM */ - }; - - aliases { - soc = &SOC; - }; - - SOC: rk3188 { - - uart2: serial@20064000 { - status = "okay"; - }; - - mmc@10214000 { - status = "okay"; - }; - - }; - - chosen { - bootargs = "-v"; - stdin = &uart2; - stdout = &uart2; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/rk3188.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/rk3188.dtsi deleted file mode 100644 index 66284aa184..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/rk3188.dtsi +++ /dev/null @@ -1,254 +0,0 @@ -/*- - * Copyright (c) 2013 Ganbold Tsagaankhuu <ganbold@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - compatible = "rockchip,rk3188"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&GIC>; - - aliases { - soc = &SOC; - }; - - SOC: rk3188 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - GIC: interrupt-controller@1013d000 { - compatible = "arm,gic"; - reg = <0x1013d000 0x1000>, /* Distributor Registers */ - <0x1013c100 0x0100>; /* CPU Interface Registers */ - interrupt-controller; - #interrupt-cells = <1>; - }; - - pmu@20004000 { - compatible = "rockchip,rk30xx-pmu"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x20004000 0x100>; - }; - - grf@20008000 { - compatible = "rockchip,rk30xx-grf"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x20008000 0x2000 >; - }; - - mp_tmr@1013c600 { - compatible = "arm,mpcore-timers"; - #address-cells = <1>; - #size-cells = <0>; - clock-frequency = < 148500000 >; - reg = <0x1013c200 0x100>, /* Global Timer Regs */ - <0x1013c600 0x20>; /* Private Timer Regs */ - interrupts = < 27 29 >; - interrupt-parent = <&GIC>; - }; - - timer@20038000 { - compatible = "rockchip,rk30xx-timer"; - reg = <0x20038000 0x20>; - interrupts = <76>; - clock-frequency = <24000000>; - status = "disabled"; - }; - - timer@20038020 { - compatible = "rockchip,rk30xx-timer"; - reg = <0x20038020 0x20>; - interrupts = <77>; - clock-frequency = <24000000>; - status = "disabled"; - }; - - timer@20038060 { - compatible = "rockchip,rk30xx-timer"; - reg = <0x20038060 0x20>; - interrupts = <91>; - clock-frequency = <24000000>; - status = "disabled"; - }; - - timer@20038080 { - compatible = "rockchip,rk30xx-timer"; - reg = <0x20038080 0x20>; - interrupts = <92>; - clock-frequency = <24000000>; - status = "disabled"; - }; - - timer@200380a0 { - compatible = "rockchip,rk30xx-timer"; - reg = <0x200380a0 0x20>; - interrupts = <96>; - clock-frequency = <24000000>; - status = "disabled"; - }; - - watchdog@2004c000 { - compatible = "rockchip,rk30xx-wdt"; - reg = <0x2004c000 0x100>; - clock-frequency = < 66000000 >; - }; - - gpio0: gpio@2000a000 { - compatible = "rockchip,rk30xx-gpio"; - gpio-controller; - #gpio-cells = <2>; - reg = <0x2000a000 0x100>; - interrupts = <86>; - interrupt-parent = <&GIC>; - }; - - gpio1: gpio@2003c000 { - compatible = "rockchip,rk30xx-gpio"; - gpio-controller; - #gpio-cells = <2>; - reg = <0x2003c000 0x100>; - interrupts = <87>; - interrupt-parent = <&GIC>; - }; - - gpio2: gpio@2003e000 { - compatible = "rockchip,rk30xx-gpio"; - gpio-controller; - #gpio-cells = <2>; - reg = <0x2003e000 0x100>; - interrupts = <88>; - interrupt-parent = <&GIC>; - }; - - gpio3: gpio@20080000 { - compatible = "rockchip,rk30xx-gpio"; - gpio-controller; - #gpio-cells = <2>; - reg = <0x20080000 0x100>; - interrupts = <89>; - interrupt-parent = <&GIC>; - }; - - usb0: usb@10180000 { - compatible = "synopsys,designware-hs-otg2"; - reg = <0x10180000 0x40000>; - interrupts = <48>; - interrupt-parent = <&GIC>; - #address-cells = <1>; - #size-cells = <0>; - }; - - usb1: usb@101c0000 { - compatible = "synopsys,designware-hs-otg2"; - reg = <0x101c0000 0x40000>; - interrupts = < 49 >; - interrupt-parent = <&GIC>; - #address-cells = <1>; - #size-cells = <0>; - gpios = <&gpio0 3 2 2>; - }; - - uart0: serial@10124000 { - compatible = "snps,dw-apb-uart"; - reg = <0x10124000 0x400>; - reg-shift = <2>; - interrupts = <66>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - broken-txfifo = <1>; - status = "disabled"; - }; - - uart1: serial@10126000 { - compatible = "snps,dw-apb-uart"; - reg = <0x10126000 0x400>; - reg-shift = <2>; - interrupts = <67>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - broken-txfifo = <1>; - status = "disabled"; - }; - - uart2: serial@20064000 { - compatible = "snps,dw-apb-uart"; - reg = <0x20064000 0x400>; - reg-shift = <2>; - interrupts = <68>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - broken-txfifo = <1>; - status = "disabled"; - }; - - uart3: serial@20068000 { - compatible = "snps,dw-apb-uart"; - reg = <0x20068000 0x400>; - reg-shift = <2>; - interrupts = <69>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - broken-txfifo = <1>; - status = "disabled"; - }; - - mmc@10214000 { - compatible = "rockchip,rk2928-dw-mshc"; - reg = <0x10214000 0x1000>; - interrupts = <55>; - #address-cells = <1>; - #size-cells = <0>; - bus-frequency = <48000000>; /* TODO: verify freq */ - fifo-depth = <0x40>; - num-slots = <1>; - status = "disabled"; - }; - - mmc@10218000 { - compatible = "rockchip,rk2928-dw-mshc"; - reg = <0x10218000 0x1000>; - interrupts = <56>; - #address-cells = <1>; - #size-cells = <0>; - bus-frequency = <48000000>; /* TODO: verify freq */ - fifo-depth = <0x40>; - num-slots = <1>; - status = "disabled"; - }; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/rpi.dts b/usr/src/boot/sys/boot/fdt/dts/arm/rpi.dts deleted file mode 100644 index 548f888b2b..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/rpi.dts +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@bluezbox.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ -/dts-v1/; - -/include/ "bcm2835.dtsi" - -/ { - model = "Raspberry Pi (BCM2835)"; - compatible = "raspberrypi,model-a", "raspberrypi,model-b", - "broadcom,bcm2835-vc", "broadcom,bcm2708-vc"; - - memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ - - cpus { - #address-cells = <1>; - #size-cells = <0>; - cpu@0 { - compatible = "arm,1176jzf-s"; - device_type = "cpu"; - reg = <0>; /* CPU ID=0 */ - clock-frequency = <700000000>; /* 700MHz */ - }; - }; - - memory { - device_type = "memory"; - reg = <0 0x8000000>; /* 128MB, Set by VideoCore */ - - }; - - system { - revision = <0>; /* Set by VideoCore */ - serial = <0 0>; /* Set by VideoCore */ - }; - - axi { - gpio: gpio { - /* BSC0 */ - pins_bsc0_a: bsc0_a { - broadcom,function = "ALT0"; - }; - - pins_bsc0_b: bsc0_b { - broadcom,function = "ALT0"; - }; - - pins_bsc0_c: bsc0_c { - broadcom,function = "ALT1"; - }; - - /* BSC1 */ - pins_bsc1_a: bsc1_a { - broadcom,function = "ALT0"; - }; - - pins_bsc1_b: bsc1_b { - broadcom,function = "ALT2"; - }; - - /* GPCLK0 */ - pins_gpclk0_a: gpclk0_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk0_b: gpclk0_b { - broadcom,function = "ALT5"; - }; - - pins_gpclk0_c: gpclk0_c { - broadcom,function = "ALT0"; - }; - - pins_gpclk0_d: gpclk0_d { - broadcom,function = "ALT0"; - }; - - /* GPCLK1 */ - pins_gpclk1_a: gpclk1_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk1_b: gpclk1_b { - broadcom,function = "ALT5"; - }; - - pins_gpclk1_c: gpclk1_c { - broadcom,function = "ALT0"; - }; - - pins_gpclk1_d: gpclk1_d { - broadcom,function = "ALT0"; - }; - - /* GPCLK2 */ - pins_gpclk2_a: gpclk2_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk2_b: gpclk2_b { - broadcom,function = "ALT0"; - }; - - /* SPI0 */ - pins_spi0_a: spi0_a { - broadcom,function = "ALT0"; - }; - - pins_spi0_b: spi0_b { - broadcom,function = "ALT0"; - }; - - /* PWM */ - pins_pwm0_a: pwm0_a { - broadcom,function = "ALT0"; - }; - - pins_pwm0_b: pwm0_b { - broadcom,function = "ALT5"; - }; - - pins_pwm0_c: pwm0_c { - broadcom,function = "ALT0"; - }; - - pins_pwm1_a: pwm1_a { - broadcom,function = "ALT0"; - }; - - pins_pwm1_b: pwm1_b { - broadcom,function = "ALT5"; - }; - - pins_pwm1_c: pwm1_c { - broadcom,function = "ALT0"; - }; - - pins_pwm1_d: pwm1_d { - broadcom,function = "ALT0"; - }; - - /* UART0 */ - pins_uart0_a: uart0_a { - broadcom,function = "ALT0"; - }; - - pins_uart0_b: uart0_b { - broadcom,function = "ALT3"; - }; - - pins_uart0_c: uart0_c { - broadcom,function = "ALT2"; - }; - - pins_uart0_fc_a: uart0_fc_a { - broadcom,function = "ALT3"; - }; - - pins_uart0_fc_b: uart0_fc_b { - broadcom,function = "ALT3"; - }; - - pins_uart0_fc_c: uart0_fc_c { - broadcom,function = "ALT2"; - }; - - /* PCM */ - pins_pcm_a: pcm_a { - broadcom,function = "ALT0"; - }; - - pins_pcm_b: pcm_b { - broadcom,function = "ALT2"; - }; - - /* Secondary Address Bus */ - pins_sm_addr_a: sm_addr_a { - broadcom,function = "ALT1"; - }; - - pins_sm_addr_b: sm_addr_b { - broadcom,function = "ALT1"; - }; - - pins_sm_ctl_a: sm_ctl_a { - broadcom,function = "ALT1"; - }; - - pins_sm_ctl_b: sm_ctl_b { - broadcom,function = "ALT1"; - }; - - pins_sm_data_8bit_a: sm_data_8bit_a { - broadcom,function = "ALT1"; - }; - - pins_sm_data_8bit_b: sm_data_8bit_b { - broadcom,function = "ALT1"; - }; - - pins_sm_data_16bit: sm_data_16bit { - broadcom,function = "ALT1"; - }; - - pins_sm_data_18bit: sm_data_18bit { - broadcom,function = "ALT1"; - }; - - /* BSCSL */ - pins_bscsl: bscsl { - broadcom,function = "ALT3"; - }; - - /* SPISL */ - pins_spisl: spisl { - broadcom,function = "ALT3"; - }; - - /* SPI1 */ - pins_spi1: spi1 { - broadcom,function = "ALT4"; - }; - - /* UART1 */ - pins_uart1_a: uart1_a { - broadcom,function = "ALT5"; - }; - - pins_uart1_b: uart1_b { - broadcom,function = "ALT5"; - }; - - pins_uart1_c: uart1_c { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_a: uart1_fc_a { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_b: uart1_fc_b { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_c: uart1_fc_c { - broadcom,function = "ALT5"; - }; - - /* SPI2 */ - pins_spi2: spi2 { - broadcom,function = "ALT4"; - }; - - /* ARM JTAG */ - pins_arm_jtag_trst: arm_jtag_trst { - broadcom,function = "ALT4"; - }; - - pins_arm_jtag_a: arm_jtag_a { - broadcom,function = "ALT5"; - }; - - pins_arm_jtag_b: arm_jtag_b { - broadcom,function = "ALT4"; - }; - - /* Reserved */ - pins_reserved: reserved { - broadcom,function = "ALT3"; - }; - }; - usb { - hub { - compatible = "usb,hub", "usb,device"; - reg = <0x00000001>; - #address-cells = <1>; - #size-cells = <0>; - ethernet { - compatible = "net,ethernet", - "usb,device"; - reg = <0x00000001>; - mac-address = [00 00 00 00 00 00]; - }; - }; - - }; - - - }; - - display { - compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; - - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <1>; - - broadcom,width = <0>; /* Set by VideoCore */ - broadcom,height = <0>; /* Set by VideoCore */ - broadcom,depth = <0>; /* Set by VideoCore */ - }; - - leds { - compatible = "gpio-leds"; - - ok { - label = "ok"; - gpios = <&gpio 16 1>; - - /* Don't change this - it configures - * how the led driver determines if - * the led is on or off when it loads. - */ - default-state = "keep"; - - /* This is the real default state. */ - linux,default-trigger = "default-on"; - }; - }; - - power: regulator { - compatible = "broadcom,bcm2835-power-mgr", - "broadcom,bcm2708-power-mgr", - "simple-bus"; - #address-cells = <1>; - #size-cells = <0>; - - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <0>; - - regulator-name = "VideoCore"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on = <1>; - - sd_card_power: regulator@0 { - compatible = "broadcom,bcm2835-power-dev", - "broadcom,bcm2708-power-dev"; - reg = <0>; - - vin-supply = <&power>; - regulator-name = "SD Card"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - }; - - /* This is for the controller itself, not the root port */ - usb_hcd_power: regulator@3 { - compatible = "broadcom,bcm2835-power-dev", - "broadcom,bcm2708-power-dev"; - reg = <3>; - - vin-supply = <&power>; - regulator-name = "USB HCD"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - }; - }; - - aliases { - uart0 = &uart0; - }; - - chosen { - bootargs = ""; /* Set by VideoCore */ - stdin = "uart0"; - stdout = "uart0"; - }; - - __overrides__ { - cache_line_size = <&vchiq>, "cache-line-size:0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/rpi2.dts b/usr/src/boot/sys/boot/fdt/dts/arm/rpi2.dts deleted file mode 100644 index 951bca3b47..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/rpi2.dts +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@bluezbox.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ -/dts-v1/; - -/include/ "bcm2836.dtsi" - -/ { - model = "Raspberry Pi 2 Model B"; - compatible = "brcm,bcm2709"; - - memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ - - cpus { - #address-cells = <1>; - #size-cells = <0>; - cpu@0 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0xf00>; /* CPU ID=0xf00 */ - clock-frequency = <800000000>; /* 800MHz */ - }; - cpu@1 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0xf01>; /* CPU ID=0xf01 */ - clock-frequency = <800000000>; /* 800MHz */ - }; - cpu@2 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0xf02>; /* CPU ID=0xf02 */ - clock-frequency = <800000000>; /* 800MHz */ - }; - cpu@3 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0xf03>; /* CPU ID=0xf03 */ - clock-frequency = <800000000>; /* 800MHz */ - }; - }; - - memory { - device_type = "memory"; - reg = <0 0x8000000>; /* 128MB, Set by VideoCore */ - - }; - - system { - revision = <0>; /* Set by VideoCore */ - serial = <0 0>; /* Set by VideoCore */ - }; - - axi { - gpio: gpio { - /* BSC0 */ - pins_bsc0_a: bsc0_a { - broadcom,function = "ALT0"; - }; - - pins_bsc0_b: bsc0_b { - broadcom,function = "ALT0"; - }; - - pins_bsc0_c: bsc0_c { - broadcom,function = "ALT1"; - }; - - /* BSC1 */ - pins_bsc1_a: bsc1_a { - broadcom,function = "ALT0"; - }; - - pins_bsc1_b: bsc1_b { - broadcom,function = "ALT2"; - }; - - /* GPCLK0 */ - pins_gpclk0_a: gpclk0_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk0_b: gpclk0_b { - broadcom,function = "ALT5"; - }; - - pins_gpclk0_c: gpclk0_c { - broadcom,function = "ALT0"; - }; - - pins_gpclk0_d: gpclk0_d { - broadcom,function = "ALT0"; - }; - - /* GPCLK1 */ - pins_gpclk1_a: gpclk1_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk1_b: gpclk1_b { - broadcom,function = "ALT5"; - }; - - pins_gpclk1_c: gpclk1_c { - broadcom,function = "ALT0"; - }; - - pins_gpclk1_d: gpclk1_d { - broadcom,function = "ALT0"; - }; - - /* GPCLK2 */ - pins_gpclk2_a: gpclk2_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk2_b: gpclk2_b { - broadcom,function = "ALT0"; - }; - - /* SPI0 */ - pins_spi0_a: spi0_a { - broadcom,function = "ALT0"; - }; - - pins_spi0_b: spi0_b { - broadcom,function = "ALT0"; - }; - - /* PWM */ - pins_pwm0_a: pwm0_a { - broadcom,function = "ALT0"; - }; - - pins_pwm0_b: pwm0_b { - broadcom,function = "ALT5"; - }; - - pins_pwm0_c: pwm0_c { - broadcom,function = "ALT0"; - }; - - pins_pwm1_a: pwm1_a { - broadcom,function = "ALT0"; - }; - - pins_pwm1_b: pwm1_b { - broadcom,function = "ALT5"; - }; - - pins_pwm1_c: pwm1_c { - broadcom,function = "ALT0"; - }; - - pins_pwm1_d: pwm1_d { - broadcom,function = "ALT0"; - }; - - /* UART0 */ - pins_uart0_a: uart0_a { - broadcom,function = "ALT0"; - }; - - pins_uart0_b: uart0_b { - broadcom,function = "ALT3"; - }; - - pins_uart0_c: uart0_c { - broadcom,function = "ALT2"; - }; - - pins_uart0_fc_a: uart0_fc_a { - broadcom,function = "ALT3"; - }; - - pins_uart0_fc_b: uart0_fc_b { - broadcom,function = "ALT3"; - }; - - pins_uart0_fc_c: uart0_fc_c { - broadcom,function = "ALT2"; - }; - - /* PCM */ - pins_pcm_a: pcm_a { - broadcom,function = "ALT0"; - }; - - pins_pcm_b: pcm_b { - broadcom,function = "ALT2"; - }; - - /* Secondary Address Bus */ - pins_sm_addr_a: sm_addr_a { - broadcom,function = "ALT1"; - }; - - pins_sm_addr_b: sm_addr_b { - broadcom,function = "ALT1"; - }; - - pins_sm_ctl_a: sm_ctl_a { - broadcom,function = "ALT1"; - }; - - pins_sm_ctl_b: sm_ctl_b { - broadcom,function = "ALT1"; - }; - - pins_sm_data_8bit_a: sm_data_8bit_a { - broadcom,function = "ALT1"; - }; - - pins_sm_data_8bit_b: sm_data_8bit_b { - broadcom,function = "ALT1"; - }; - - pins_sm_data_16bit: sm_data_16bit { - broadcom,function = "ALT1"; - }; - - pins_sm_data_18bit: sm_data_18bit { - broadcom,function = "ALT1"; - }; - - /* BSCSL */ - pins_bscsl: bscsl { - broadcom,function = "ALT3"; - }; - - /* SPISL */ - pins_spisl: spisl { - broadcom,function = "ALT3"; - }; - - /* SPI1 */ - pins_spi1: spi1 { - broadcom,function = "ALT4"; - }; - - /* UART1 */ - pins_uart1_a: uart1_a { - broadcom,function = "ALT5"; - }; - - pins_uart1_b: uart1_b { - broadcom,function = "ALT5"; - }; - - pins_uart1_c: uart1_c { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_a: uart1_fc_a { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_b: uart1_fc_b { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_c: uart1_fc_c { - broadcom,function = "ALT5"; - }; - - /* SPI2 */ - pins_spi2: spi2 { - broadcom,function = "ALT4"; - }; - - /* ARM JTAG */ - pins_arm_jtag_trst: arm_jtag_trst { - broadcom,function = "ALT4"; - }; - - pins_arm_jtag_a: arm_jtag_a { - broadcom,function = "ALT5"; - }; - - pins_arm_jtag_b: arm_jtag_b { - broadcom,function = "ALT4"; - }; - - /* Reserved */ - pins_reserved: reserved { - broadcom,function = "ALT3"; - }; - }; - usb { - hub { - compatible = "usb,hub", "usb,device"; - reg = <0x00000001>; - #address-cells = <1>; - #size-cells = <0>; - ethernet { - compatible = "net,ethernet", - "usb,device"; - reg = <0x00000001>; - mac-address = [00 00 00 00 00 00]; - }; - }; - - }; - }; - - display { - compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; - - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <1>; - - broadcom,width = <0>; /* Set by VideoCore */ - broadcom,height = <0>; /* Set by VideoCore */ - broadcom,depth = <0>; /* Set by VideoCore */ - }; - - leds { - compatible = "gpio-leds"; - - pwr { - label = "pwr"; - gpios = <&gpio 35 0>; - }; - - act { - label = "act"; - gpios = <&gpio 47 0>; - }; - }; - - power: regulator { - compatible = "broadcom,bcm2835-power-mgr", - "broadcom,bcm2708-power-mgr", - "simple-bus"; - #address-cells = <1>; - #size-cells = <0>; - - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <0>; - - regulator-name = "VideoCore"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on = <1>; - - sd_card_power: regulator@0 { - compatible = "broadcom,bcm2835-power-dev", - "broadcom,bcm2708-power-dev"; - reg = <0>; - - vin-supply = <&power>; - regulator-name = "SD Card"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - }; - - /* This is for the controller itself, not the root port */ - usb_hcd_power: regulator@3 { - compatible = "broadcom,bcm2835-power-dev", - "broadcom,bcm2708-power-dev"; - reg = <3>; - - vin-supply = <&power>; - regulator-name = "USB HCD"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - }; - }; - - aliases { - uart0 = &uart0; - }; - - chosen { - bootargs = ""; /* Set by VideoCore */ - stdin = "uart0"; - stdout = "uart0"; - }; - - __overrides__ { - cache_line_size = <&vchiq>, "cache-line-size:0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/sam9260ek.dts b/usr/src/boot/sys/boot/fdt/dts/arm/sam9260ek.dts deleted file mode 100644 index 8e4d7530ea..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/sam9260ek.dts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SAM9260EK eval board - Warner Losh public domain - * - * $FreeBSD$ - */ -/dts-v1/; -#include "sam9260ek_common.dtsi" - -/ { - model = "Atmel at91sam9260ek"; - compatible = "atmel,at91sam9260ek", "atmel,at91sam9260", "atmel,at91sam9"; - - leds { - compatible = "gpio-leds"; - - ds1 { - label = "ds1"; - gpios = <&pioA 9 0>; - linux,default-trigger = "heartbeat"; - }; - - ds5 { - label = "ds5"; - gpios = <&pioA 6 1>; - }; - }; - - aliases { - dbgu = &dbgu; - }; - - - chosen { - stdin = "dbgu"; - stdout = "dbgu"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/sheevaplug.dts b/usr/src/boot/sys/boot/fdt/dts/arm/sheevaplug.dts deleted file mode 100644 index 3d347da19d..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/sheevaplug.dts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Marvell SheevaPlug Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,SheevaPlug"; - compatible = "SheevaPlug"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - mpp = &MPP; - serial0 = &serial0; - serial1 = &serial1; - soc = &SOC; - sram = &SRAM; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR131"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x20000000>; // 512M at 0x0 - }; - - localbus@0 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - bank-count = <3>; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x2f 0xf9300000 0x00100000>; - - nand@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "mrvl,nfc"; - reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - - slice@0 { - reg = <0x0 0x200000>; - label = "u-boot"; - read-only; - }; - - slice@200000 { - reg = <0x200000 0x1fe00000>; - label = "root"; - }; - }; - }; - - SOC: soc88f6281@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <1>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count = <50>; - pin-map = < - 0 1 /* MPP[0]: NF_IO[2] */ - 1 1 /* MPP[1]: NF_IO[3] */ - 2 1 /* MPP[2]: NF_IO[4] */ - 3 1 /* MPP[3]: NF_IO[5] */ - 4 1 /* MPP[4]: NF_IO[6] */ - 5 1 /* MPP[5]: NF_IO[7] */ - 6 1 /* MPP[6]: SYSRST_OUTn */ - 8 2 /* MPP[8]: UA0_RTS */ - 9 2 /* MPP[9]: UA0_CTS */ - 10 3 /* MPP[10]: UA0_TXD */ - 11 3 /* MPP[11]: UA0_RXD */ - 12 1 /* MPP[12]: SD_CLK */ - 13 1 /* MPP[13]: SD_CMD */ - 14 1 /* MPP[14]: SD_D[0] */ - 15 1 /* MPP[15]: SD_D[1] */ - 16 1 /* MPP[16]: SD_D[2] */ - 17 1 /* MPP[17]: SD_D[3] */ - 18 1 /* MPP[18]: NF_IO[0] */ - 19 1 /* MPP[19]: NF_IO[1] */ - 29 1 >; /* MPP[29]: TSMP[9] */ - }; - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <35 36 37 38 39 40 41>; - interrupt-parent = <&PIC>; - }; - - rtc@10300 { - compatible = "mrvl,rtc"; - reg = <0x10300 0x08>; - }; - - twsi@11000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,twsi"; - reg = <0x11000 0x20>; - interrupts = <43>; - interrupt-parent = <&PIC>; - }; - - enet0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V2"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <12 13 14 11 46>; - interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - }; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <33>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <34>; - interrupt-parent = <&PIC>; - }; - - crypto@30000 { - compatible = "mrvl,cesa"; - reg = <0x30000 0x10000>; - interrupts = <22>; - interrupt-parent = <&PIC>; - - sram-handle = <&SRAM>; - }; - - usb@50000 { - compatible = "mrvl,usb-ehci", "usb-ehci"; - reg = <0x50000 0x1000>; - interrupts = <48 19>; - interrupt-parent = <&PIC>; - }; - - xor@60000 { - compatible = "mrvl,xor"; - reg = <0x60000 0x1000>; - interrupts = <5 6 7 8>; - interrupt-parent = <&PIC>; - }; - }; - - SRAM: sram@fd000000 { - compatible = "mrvl,cesa-sram"; - reg = <0xfd000000 0x00100000>; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/socfpga-sockit-beri.dts b/usr/src/boot/sys/boot/fdt/dts/arm/socfpga-sockit-beri.dts deleted file mode 100644 index c7dcde3826..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/socfpga-sockit-beri.dts +++ /dev/null @@ -1,177 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "socfpga.dtsi" - -/ { - model = "Terasic SoCKit"; - compatible = "altr,socfpga-cyclone5", "altr,socfpga"; - - memreserve = < 0x00000000 0x1000 >, /* SMP trampoline */ - < 0x00001000 0x1000 >, /* virtio block */ - < 0x00002000 0x1000 >; /* virtio net */ - - memory { - device_type = "memory"; - reg = < 0x00000000 0x40000000 >; /* 1G RAM */ - }; - - SOC: socfpga { - serial0: serial@ffc02000 { - status = "okay"; - }; - - usb1: usb@ffb40000 { - status = "okay"; - }; - - gmac1: ethernet@ff702000 { - status = "okay"; - - rxd0-skew-ps = <0>; - rxd1-skew-ps = <0>; - rxd2-skew-ps = <0>; - rxd3-skew-ps = <0>; - txen-skew-ps = <0>; - txc-skew-ps = <2600>; - rxdv-skew-ps = <0>; - rxc-skew-ps = <2000>; - }; - - mmc: dwmmc@ff704000 { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - num-slots = <1>; - supports-highspeed; - broken-cd; - bus-frequency = <25000000>; - - slot@0 { - reg = <0>; - bus-width = <4>; - }; - }; - - beri_mem0: mem@d0000000 { - compatible = "sri-cambridge,beri-mem"; - reg = <0xd0000000 0x10000000>; /* 256mb */ - status = "okay"; - }; - - pio0: pio@c0020000 { - compatible = "altr,pio"; - reg = <0xc0020000 0x1000>; /* recv */ - interrupts = < 76 >; - interrupt-parent = <&GIC>; - status = "okay"; - }; - - pio1: pio@c0021000 { - compatible = "altr,pio"; - reg = <0xc0021000 0x1000>; /* send */ - interrupts = < 82 >; /* not in use on arm side */ - interrupt-parent = <&GIC>; - status = "okay"; - }; - - pio2: pio@c0022000 { - compatible = "altr,pio"; - reg = <0xc0022000 0x1000>; /* recv */ - interrupts = < 77 >; - interrupt-parent = <&GIC>; - status = "okay"; - }; - - pio3: pio@c0023000 { - compatible = "altr,pio"; - reg = <0xc0023000 0x1000>; /* send */ - interrupts = < 83 >; /* not in use on arm side */ - interrupt-parent = <&GIC>; - status = "okay"; - }; - - beri_vtblk: vtblk@00001000 { - compatible = "sri-cambridge,beri-vtblk"; - reg = <0x00001000 0x1000>; - pio-recv = <&pio0>; - pio-send = <&pio1>; - beri-mem = <&beri_mem0>; - status = "okay"; - }; - - beri_vtnet: vtnet@00002000 { - compatible = "sri-cambridge,beri-vtnet"; - reg = <0x00002000 0x1000>; - pio-recv = <&pio2>; - pio-send = <&pio3>; - beri-mem = <&beri_mem0>; - status = "okay"; - }; - - beri_debug: ring@c0000000 { - compatible = "sri-cambridge,beri-ring"; - reg = <0xc0000000 0x3000>; - interrupts = < 72 73 >; - interrupt-parent = <&GIC>; - device_name = "beri_debug"; - data_size = <0x1000>; - data_read = <0x0>; - data_write = <0x1000>; - control_read = <0x2000>; - control_write = <0x2010>; - status = "okay"; - }; - - beri_console: ring@c0004000 { - compatible = "sri-cambridge,beri-ring"; - reg = <0xc0004000 0x3000>; - interrupts = < 74 75 >; - interrupt-parent = <&GIC>; - device_name = "beri_console"; - data_size = <0x1000>; - data_read = <0x0>; - data_write = <0x1000>; - control_read = <0x2000>; - control_write = <0x2010>; - status = "okay"; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/socfpga-sockit.dts b/usr/src/boot/sys/boot/fdt/dts/arm/socfpga-sockit.dts deleted file mode 100644 index ad1902d07d..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/socfpga-sockit.dts +++ /dev/null @@ -1,90 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "socfpga.dtsi" - -/ { - model = "Terasic SoCKit"; - compatible = "altr,socfpga-cyclone5", "altr,socfpga"; - - /* Reserve first page for secondary CPU trampoline code */ - memreserve = < 0x00000000 0x1000 >; - - memory { - device_type = "memory"; - reg = < 0x00000000 0x40000000 >; /* 1G RAM */ - }; - - SOC: socfpga { - serial0: serial@ffc02000 { - status = "okay"; - }; - - usb1: usb@ffb40000 { - status = "okay"; - }; - - gmac1: ethernet@ff702000 { - status = "okay"; - - rxd0-skew-ps = <0>; - rxd1-skew-ps = <0>; - rxd2-skew-ps = <0>; - rxd3-skew-ps = <0>; - txen-skew-ps = <0>; - txc-skew-ps = <2600>; - rxdv-skew-ps = <0>; - rxc-skew-ps = <2000>; - }; - - mmc: dwmmc@ff704000 { - status = "okay"; - num-slots = <1>; - supports-highspeed; - broken-cd; - bus-frequency = <25000000>; - - slot@0 { - reg = <0>; - bus-width = <4>; - }; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/socfpga.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/socfpga.dtsi deleted file mode 100644 index baecbf843e..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/socfpga.dtsi +++ /dev/null @@ -1,200 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - compatible = "altr,socfpga"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&GIC>; - - aliases { - soc = &SOC; - rstmgr = &rstmgr; - l3regs = &l3regs; - serial0 = &serial0; - serial1 = &serial1; - }; - - SOC: socfpga { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - GIC: interrupt-controller@fffed000 { - compatible = "arm,gic"; - reg = < 0xfffed000 0x1000 >, /* Distributor */ - < 0xfffec100 0x100 >; /* CPU Interface */ - interrupt-controller; - #interrupt-cells = <1>; - }; - - mp_tmr@40002100 { - compatible = "arm,mpcore-timers"; - clock-frequency = <200000000>; - #address-cells = <1>; - #size-cells = <0>; - reg = < 0xfffec200 0x100 >, /* Global Timer */ - < 0xfffec600 0x100 >; /* Private Timer */ - interrupts = < 27 29 >; - interrupt-parent = < &GIC >; - }; - - sysmgr: sysmgr@ffd08000 { - compatible = "altr,sys-mgr"; - reg = <0xffd08000 0x1000>; - }; - - clkmgr: clkmgr@ffd04000 { - compatible = "altr,clk-mgr"; - reg = <0xffd04000 0x1000>; - }; - - rstmgr: rstmgr@ffd05000 { - compatible = "altr,rst-mgr"; - reg = <0xffd05000 0x1000>; - }; - - l3regs: l3regs@ff800000 { - compatible = "altr,l3regs"; - reg = <0xff800000 0x1000>; - }; - - fpgamgr: fpgamgr@ff706000 { - compatible = "altr,fpga-mgr"; - reg = <0xff706000 0x1000>, /* FPGAMGRREGS */ - <0xffb90000 0x1000>; /* FPGAMGRDATA */ - interrupts = < 207 >; - interrupt-parent = <&GIC>; - }; - - gpio0: gpio@ff708000 { - compatible = "snps,dw-apb-gpio"; - reg = <0xff708000 0x1000>; - porta: gpio-controller@0 { - compatible = "snps,dw-apb-gpio-port"; - gpio-controller; - snps,nr-gpios = <29>; - }; - }; - - gpio1: gpio@ff709000 { - compatible = "snps,dw-apb-gpio"; - reg = <0xff709000 0x1000>; - portb: gpio-controller@0 { - compatible = "snps,dw-apb-gpio-port"; - gpio-controller; - snps,nr-gpios = <29>; - }; - }; - - gpio2: gpio@ff70a000 { - compatible = "snps,dw-apb-gpio"; - reg = <0xff70a000 0x1000>; - portc: gpio-controller@0 { - compatible = "snps,dw-apb-gpio-port"; - gpio-controller; - snps,nr-gpios = <27>; - }; - }; - - serial0: serial@ffc02000 { - compatible = "ns16550"; - reg = <0xffc02000 0x1000>; - reg-shift = <2>; - interrupts = <194>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 100000000 >; - status = "disabled"; - }; - - serial1: serial@ffc03000 { - compatible = "ns16550"; - reg = <0xffc03000 0x1000>; - reg-shift = <2>; - interrupts = <195>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 100000000 >; - status = "disabled"; - }; - - usb0: usb@ffb00000 { - compatible = "synopsys,designware-hs-otg2"; - reg = <0xffb00000 0xffff>; - interrupts = <157>; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - usb1: usb@ffb40000 { - compatible = "synopsys,designware-hs-otg2"; - reg = <0xffb40000 0xffff>; - interrupts = <160>; - interrupt-parent = <&GIC>; - dr_mode = "host"; - status = "disabled"; - }; - - gmac0: ethernet@ff700000 { - compatible = "altr,socfpga-stmmac", - "snps,dwmac-3.70a", "snps,dwmac"; - reg = <0xff700000 0x2000>; - interrupts = <147>; - interrupt-parent = <&GIC>; - phy-mode = "rgmii"; - status = "disabled"; - }; - - gmac1: ethernet@ff702000 { - compatible = "altr,socfpga-stmmac", - "snps,dwmac-3.70a", "snps,dwmac"; - reg = <0xff702000 0x2000>; - interrupts = <152>; - interrupt-parent = <&GIC>; - phy-mode = "rgmii"; - status = "disabled"; - }; - - mmc: dwmmc@ff704000 { - compatible = "altr,socfpga-dw-mshc"; - reg = <0xff704000 0x1000>; - interrupts = <171>; - interrupt-parent = <&GIC>; - fifo-depth = <0x400>; - status = "disabled"; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/sun4i-a10.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/sun4i-a10.dtsi deleted file mode 100644 index 417ea229c9..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/sun4i-a10.dtsi +++ /dev/null @@ -1,153 +0,0 @@ -/*- - * Copyright (c) 2014 Ganbold Tsagaankhuu <ganbold@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <dt-bindings/pinctrl/sun4i-a10.h> - -/ { - compatible = "allwinner,sun4i-a10"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&AINTC>; - - aliases { - soc = &SOC; - }; - - SOC: a10 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - AINTC: interrupt-controller@01c20400 { - compatible = "allwinner,sun4i-a10-ic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = < 0x01c20400 0x400 >; - }; - - sramc@01c00000 { - compatible = "allwinner,sun4i-sramc"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c00000 0x1000 >; - }; - - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - - timer@01c20c00 { - compatible = "allwinner,sun4i-a10-timer"; - reg = <0x01c20c00 0x90>; - interrupts = < 22 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 24000000 >; - }; - - watchdog@01c20c90 { - compatible = "allwinner,sun4i-wdt"; - reg = <0x01c20c90 0x08>; - }; - - - GPIO: gpio@01c20800 { - #gpio-cells = <3>; - compatible = "allwinner,sun4i-a10-pinctrl"; - gpio-controller; - reg =< 0x01c20800 0x400 >; - interrupts = < 28 >; - interrupt-parent = <&AINTC>; - - emac_pins: emac@0 { - allwinner,pins = "PA0", "PA1", "PA2", - "PA3", "PA4", "PA5", "PA6", - "PA7", "PA8", "PA9", "PA10", - "PA11", "PA12", "PA13", "PA14", - "PA15", "PA16"; - allwinner,function = "emac"; - allwinner,drive = <SUN4I_PINCTRL_10_MA>; - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; - }; - }; - - usb1: usb@01c14000 { - compatible = "allwinner,sun4i-a10-ehci", "generic-ehci"; - reg = <0x01c14000 0x1000>; - interrupts = < 39 >; - interrupt-parent = <&AINTC>; - }; - - usb2: usb@01c1c000 { - compatible = "allwinner,sun4i-a10-ehci", "generic-ehci"; - reg = <0x01c1c000 0x1000>; - interrupts = < 40 >; - interrupt-parent = <&AINTC>; - }; - - mmc0: mmc@01c0f000 { - compatible = "allwinner,sun4i-a10-mmc"; - reg = <0x01c0f000 0x1000>; - interrupts = <32>; - interrupt-parent = <&AINTC>; - status = "disabled"; - }; - - sata@01c18000 { - compatible = "allwinner,sun4i-a10-ahci"; - reg = <0x01c18000 0x1000>; - interrupts = <56>; - interrupt-parent = <&AINTC>; - status = "disabled"; - }; - - UART0: serial@01c28000 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28000 0x400>; - reg-shift = <2>; - interrupts = <1>; - interrupt-parent = <&AINTC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - }; - - emac@01c0b000 { - compatible = "allwinner,sun4i-a10-emac"; - reg = <0x01c0b000 0x1000>; - interrupts = <55>; - interrupt-parent = <&AINTC>; - }; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/sun7i-a20-hdmi.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/sun7i-a20-hdmi.dtsi deleted file mode 100644 index 4d4a3c5ec4..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/sun7i-a20-hdmi.dtsi +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill <jmcneill@invisible.ca> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - soc@01c00000 { - hdmi: hdmi@01c16000 { - compatible = "allwinner,sun7i-a20-hdmi"; - reg = <0x01c16000 0x1000>; - status = "disabled"; - }; - - hdmiaudio { - compatible = "allwinner,sun7i-a20-hdmiaudio"; - status = "disabled"; - }; - - fb: fb@01e60000 { - compatible = "allwinner,sun7i-a20-fb"; - reg = <0x01e60000 0x10000>, /* DEBE0 */ - <0x01c0c000 0x1000>; /* LCD0 */ - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/sun7i-a20.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/sun7i-a20.dtsi deleted file mode 100644 index 43c6e4bd7f..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/sun7i-a20.dtsi +++ /dev/null @@ -1,217 +0,0 @@ -/*- - * Copyright (c) 2014 Ganbold Tsagaankhuu <ganbold@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <dt-bindings/interrupt-controller/arm-gic.h> -#include <dt-bindings/pinctrl/sun4i-a10.h> - -/ { - compatible = "allwinner,sun7i-a20"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&GIC>; - - aliases { - soc = &SOC; - }; - - timer { - compatible = "arm,armv7-timer"; - interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, - <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, - <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, - <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; - }; - - SOC: a20 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - GIC: interrupt-controller@01c81000 { - compatible = "arm,gic"; - reg = <0x01c81000 0x1000>, /* Distributor Registers */ - <0x01c82000 0x0100>, /* CPU Interface Registers */ - <0x01c84000 0x2000>, - <0x01c86000 0x2000>; - interrupt-controller; - #interrupt-cells = <3>; - interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; - }; - - sramc@01c00000 { - compatible = "allwinner,sun4i-sramc"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c00000 0x1000 >; - }; - - cpu-cfg@01c25c00 { - compatible = "allwinner,sun7i-cpu-cfg"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c25c00 0x400 >; - }; - - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - - timer@01c20c00 { - compatible = "allwinner,sun4i-a10-timer"; - reg = <0x01c20c00 0x90>; - interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&GIC>; - clock-frequency = < 24000000 >; - }; - - watchdog@01c20c90 { - compatible = "allwinner,sun4i-a10-wdt"; - reg = <0x01c20c90 0x10>; - }; - - pio: gpio@01c20800 { - #gpio-cells = <3>; - compatible = "allwinner,sun7i-a20-pinctrl"; - gpio-controller; - reg =< 0x01c20800 0x400 >; - interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; - interrupt-controller; - #interrupt-cells = <2>; - interrupt-parent = <&GIC>; - - gmac_pins_mii: gmac_mii@0 { - allwinner,pins = "PA0", "PA1", "PA2", - "PA3", "PA4", "PA5", "PA6", - "PA7", "PA8", "PA9", "PA10", - "PA11", "PA12", "PA13", "PA14", - "PA15", "PA16"; - allwinner,function = "gmac"; - allwinner,drive = <SUN4I_PINCTRL_10_MA>; - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; - }; - - gmac_pins_rgmii: gmac_rgmii@0 { - allwinner,pins = "PA0", "PA1", "PA2", - "PA3", "PA4", "PA5", "PA6", - "PA7", "PA8", "PA10", - "PA11", "PA12", "PA13", - "PA15", "PA16"; - allwinner,function = "gmac"; - allwinner,drive = <SUN4I_PINCTRL_40_MA>; - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; - }; - - }; - - usb1: usb@01c14000 { - compatible = "allwinner,sun7i-a20-ehci", "generic-ehci"; - reg = <0x01c14000 0x1000>; - interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&GIC>; - }; - - usb2: usb@01c1c000 { - compatible = "allwinner,sun7i-a20-ehci", "generic-ehci"; - reg = <0x01c1c000 0x1000>; - interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&GIC>; - }; - - mmc0: mmc@01c0f000 { - compatible = "allwinner,sun5i-a13-mmc"; - reg = <0x01c0f000 0x1000>; - interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; - status = "disabled"; - }; - - sata@01c18000 { - compatible = "allwinner,sun4i-a10-ahci"; - reg = <0x01c18000 0x1000>; - interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - UART0: serial@01c28000 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28000 0x400>; - reg-shift = <2>; - interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - }; - - emac@01c0b000 { - compatible = "allwinner,sun4i-a10-emac"; - reg = <0x01c0b000 0x1000>; - interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - gmac@01c50000 { - compatible = "allwinner,sun7i-a20-gmac"; - reg = <0x01c50000 0x10000>; - interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&GIC>; - snps,pbl = <2>; - snps,fixed-burst; - snps,force_sf_dma_mode; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - dma: dma-controller@01c02000 { - compatible = "allwinner,sun4i-a10-dma"; - reg = <0x01c02000 0x1000>; - interrupts = <27>; - interrupt-parent = <&GIC>; - }; - - codec: codec@01c22c00 { - compatible = "allwinner,sun7i-a20-codec"; - reg = <0x01c22c00 0x40>; - interrupts = <30>; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/tegra20-paz00.dts b/usr/src/boot/sys/boot/fdt/dts/arm/tegra20-paz00.dts deleted file mode 100644 index 912a8f9c63..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/tegra20-paz00.dts +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * Copyright (c) 2011 The FreeBSD Foundation - * Copyright (c) 2012 Andrew Turner - * All rights reserved. - * - * Developed by Damjan Marion <damjan.marion@gmail.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ -/dts-v1/; - -/include/ "tegra20.dtsi" - -/ { - model = "Toshiba AC100 / Dynabook AZ"; - - aliases { - serial0 = &serial0; - soc = &SOC; - }; - - memory { - device_type = "memory"; - reg = < 0x00000000 0x20000000 >; /* 512MB RAM at 0x0 */ - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; - - SOC: tegra20@0 { - serial0: serial@70006000 { - }; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/tegra20.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/tegra20.dtsi deleted file mode 100644 index d7107fdc31..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/tegra20.dtsi +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * Copyright (c) 2011 The FreeBSD Foundation - * Copyright (c) 2012 Andrew Turner - * All rights reserved. - * - * Developed by Damjan Marion <damjan.marion@gmail.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - compatible = "compal,paz00", "nvidia,tegra20"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&GIC>; - - SOC: tegra20@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - GIC: interrupt-controller@50041000 { - compatible = "arm,gic"; - reg = < 0x50041000 0x1000 >, /* Distributor Registers */ - < 0x50040100 0x0100 >; /* CPU Interface Registers */ - interrupt-controller; - #interrupt-cells = <1>; - }; - - mp_tmr@50040200 { - compatible = "arm,mpcore-timers"; - clock-frequency = < 50040200 >; - #address-cells = <1>; - #size-cells = <0>; - reg = < 0x50040200 0x100 >, /* Global Timer Registers */ - < 0x50040600 0x100 >; /* Private Timer Registers */ - interrupts = < 27 29 >; - interrupt-parent = <&GIC>; - }; - - serial@70006000 { - compatible = "ns16550"; - reg = <0x70006000 0x40>; - reg-shift = <2>; - interrupts = < 68 >; - interrupt-parent = <&GIC>; - clock-frequency = < 215654400 >; - }; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/trimslice.dts b/usr/src/boot/sys/boot/fdt/dts/arm/trimslice.dts deleted file mode 100644 index ac7017fc59..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/trimslice.dts +++ /dev/null @@ -1,143 +0,0 @@ -/*- - * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. - * - * Developed by Damjan Marion <damjan.marion@gmail.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "CompuLab TrimSlice"; - compatible = "compulab,trimslice", "nvidia,tegra20"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&GIC>; - - aliases { - serial0 = &serial0; - soc = &SOC; - }; - - memory { - device_type = "memory"; - reg = < 0x00000000 0x40000000 >; /* 1GB RAM at 0x0 */ - }; - - - SOC: tegra20@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - GIC: interrupt-controller@50041000 { - compatible = "arm,gic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = < 0x50041000 0x1000 >, /* Distributor Registers */ - < 0x50040100 0x0100 >; /* CPU Interface Registers */ - }; - mp_tmr@50040200 { - compatible = "arm,mpcore-timers"; - clock-frequency = < 50040200 >; - #address-cells = <1>; - #size-cells = <0>; - reg = < 0x50040200 0x100 >, /* Global Timer Registers */ - < 0x50040600 0x100 >; /* Private Timer Registers */ - interrupts = < 27 29 >; - interrupt-parent = < &GIC >; - }; - - tmr1@60005000 { - compatible = "nvidia,tegra2-timer"; - reg = <0x60005000 0x8>; - interrupts = < 32 >; - interrupt-parent = <&GIC>; - }; - - tmr2@60005008 { - compatible = "nvidia,tegra2-timer"; - reg = <0x60005008 0x8>; - interrupts = < 33 >; - interrupt-parent = <&GIC>; - }; - - tmrus@60005010 { - compatible = "nvidia,tegra2-timestamp"; - reg = <0x60005010 0x8>; - }; - - tmr3@60005050 { - compatible = "nvidia,tegra2-timer"; - reg = <0x60005050 0x8>; - interrupts = < 73 >; - interrupt-parent = <&GIC>; - }; - - tmr4@60005058 { - compatible = "nvidia,tegra2-timer"; - reg = <0x60005058 0x8>; - interrupts = < 74 >; - interrupt-parent = <&GIC>; - }; - - serial0: serial@70006000 { - compatible = "ns16550"; - reg = <0x70006000 0x40>; - reg-shift = <2>; - interrupts = < 68 >; - interrupt-parent = <&GIC>; - clock-frequency = < 215654400 >; - }; - - serial1: serial@70006040 { - compatible = "ns16550"; - reg = <0x70006040 0x40>; - reg-shift = <2>; - interrupts = < 69 >; - interrupt-parent = <&GIC>; - clock-frequency = < 215654400 >; - }; - - serial2: serial@70006200 { - compatible = "ns16550"; - reg = <0x70006200 0x100>; - reg-shift = <2>; - interrupts = < 78 >; - interrupt-parent = <&GIC>; - clock-frequency = < 215654400 >; - }; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/ts7800.dts b/usr/src/boot/sys/boot/fdt/dts/arm/ts7800.dts deleted file mode 100644 index 547a2d7551..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/ts7800.dts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Technologic Systems TS-7800 Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "mrvl,TS-7800"; - compatible = "DB-88F5182-BP", "DB-88F5182-BP-A"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &mge0; - serial0 = &serial0; - serial1 = &serial1; - mpp = &MPP; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "ARM,88FR531"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x08000000>; // 128M at 0x0 - }; - - localbus@f1000000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000>; - }; - - soc88f5182@f1000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0xf1000000 0x00100000>; - bus-frequency = <0>; - - PIC: pic@20200 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x20200 0x3c>; - compatible = "mrvl,pic"; - }; - - timer@20300 { - compatible = "mrvl,timer"; - reg = <0x20300 0x30>; - interrupts = <0>; - interrupt-parent = <&PIC>; - mrvl,has-wdt; - }; - - MPP: mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x54>; - pin-count = <20>; - pin-map = < - 16 0 /* MPP[16]: UA1_RXD */ - 17 0 /* MPP[17]: UA1_TXD */ - 19 0 >; /* MPP[19]: UA1_RTS */ - }; - - mge0: ethernet@72000 { - #address-cells = <1>; - #size-cells = <1>; - model = "V1"; - compatible = "mrvl,ge"; - reg = <0x72000 0x2000>; - ranges = <0x0 0x72000 0x2000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <18 19 20 21 22>; - interrupt-parent = <&PIC>; - - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x0>; - }; - }; - }; - - serial0: serial@12000 { - compatible = "ns16550"; - reg = <0x12000 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <3>; - interrupt-parent = <&PIC>; - }; - - serial1: serial@12100 { - compatible = "ns16550"; - reg = <0x12100 0x20>; - reg-shift = <2>; - clock-frequency = <0>; - interrupts = <4>; - interrupt-parent = <&PIC>; - }; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/versatilepb.dts b/usr/src/boot/sys/boot/fdt/dts/arm/versatilepb.dts deleted file mode 100644 index ca58e8859c..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/versatilepb.dts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $FreeBSD$ - */ -/dts-v1/; - -/ { - model = "ARM Versatile PB"; - #address-cells = <1>; - #size-cells = <1>; - compatible = "arm,versatile-pb"; - - amba { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - intc: interrupt-controller { - compatible = "arm,versatile-vic"; - reg = <0x10140000 0x1000>; - - interrupt-controller; - #interrupt-cells = <1>; - }; - - sic: secondary-interrupt-controller { - compatible = "arm,versatile-sic"; - reg = <0x10003000 0x28>; - - interrupt-controller; - #interrupt-cells = <1>; - }; - - uart0: uart0 { - compatible = "arm,pl011", "arm,primecell"; - reg = <0x101f1000 0x1000>; - interrupts = <12>; - interrupt-parent = <&intc>; - clock-frequency = <3000000>; - reg-shift = <2>; - }; - - uart1: uart1 { - compatible = "arm,pl011", "arm,primecell"; - reg = <0x101f2000 0x1000>; - interrupts = <13>; - interrupt-parent = <&intc>; - clock-frequency = <3000000>; - reg-shift = <2>; - }; - - uart2: uart2 { - compatible = "arm,pl011", "arm,primecell"; - reg = <0x101f3000 0x1000>; - interrupts = <14>; - interrupt-parent = <&intc>; - clock-frequency = <3000000>; - reg-shift = <2>; - }; - - timer0 { - compatible = "arm,sp804", "arm,primecell"; - reg = <0x101e2000 0x40>; - interrupts = <4>; - interrupt-parent = <&intc>; - }; - - pci0 { - - compatible = "versatile,pci"; - reg = <0x10000044 0x4 - 0x10001000 0x1000 - 0x41000000 0x01000000 - 0x42000000 0x02000000>; - }; - - net { - compatible = "smsc,lan91c111"; - reg = <0x10010000 0x10000>; - interrupts = <25>; - interrupt-parent = <&intc>; - }; - - display { - compatible = "arm,pl110", "arm,primecell"; - reg = <0x10000050 4 - 0x10120000 0x1000>; - interrupts = <16>; - interrupt-parent = <&intc>; - }; - - /* - * Cut corner here: we do not have proper interrupt - * controllers cascading so just hardwire SIC IRQ 3 - * to VIC IRQ31 - */ - kmi { - compatible = "arm,pl050", "arm,primecell"; - reg = <0x10006000 0x1000>; - interrupt-parent = <&intc>; - interrupts = <31>; - }; - }; - - memory { - device_type = "memory"; - reg = <0 0x08000000>; /* 128MB */ - }; - - aliases { - uart0 = &uart0; - }; - - chosen { - stdin = "uart0"; - stdout = "uart0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/vsatv102-m6.dts b/usr/src/boot/sys/boot/fdt/dts/arm/vsatv102-m6.dts deleted file mode 100644 index 468d5f0096..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/vsatv102-m6.dts +++ /dev/null @@ -1,309 +0,0 @@ -/*- - * Copyright (c) 2013-2015 John Wehle <john@feith.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * The ordering of certain devices is significant (e.g. usb depends on - * usb-phy which depends on gpio, also the timer should appear early on - * to provide a reasonably accurate DELAY implementation). - * - * Both usb-phys devices must be configured to prevent the usb controller - * from hanging during initialization. - */ - -/dts-v1/; - -/memreserve/ 0x84900000 0x00600000; /* 6MB frame buffer */ - -#include "meson6.dtsi" - -/ { - /* - * My development unit visually appears to be a Visson ATV-102 - * and the specs for both my unit and the Visson ATV-102 say - * the SoC is an aml8726-m3. However the uboot prompt says - * m6_mbx_v1, the RTC is located on SECBUS2 instead of AOBUS, - * and there are two cores so it seems my unit is a newer - * version using the later processor. - */ - - model = "visson,atv-102"; - compatible = "visson,atv-102", "amlogic,meson6"; - - #address-cells = <1>; - #size-cells = <1>; - - aliases { - soc = &soc; - screen = &screen; - uart0 = &uart_AO; - }; - - memory { - device_type = "memory"; - reg = <0x80000000 0x40000000>; /* 1GB RAM */ - }; - - soc: soc { - device_type = "soc"; - bus-frequency = <0>; - - pic: pic@c1109a40 { - device_type = "interrupt-controller"; - compatible = "amlogic,aml8726-pic"; - reg = <0xc1109a40 128>; /* cbus 0x2690 */ - - interrupt-controller; - #interrupt-cells = <3>; - }; - - scu: scu@c4300000 { - compatible = "arm,cortex-a9-scu"; - reg = <0xc4300000 0x1000>; - }; - - cpuconfig: cpuconfig@d901ff80 { - compatible = "amlogic,aml8726-cpuconfig"; - reg = <0xd901ff80 8>; - }; - - ccm@c1104140 { - compatible = "amlogic,aml8726-ccm"; - reg = <0xc1104140 20>; /* cbus 0x1050 */ - - functions = "ethernet", "i2c", "rng", "sdio", - "uart-a", "uart-b", "uart-c", - "usb-a", "usb-b"; - }; - - pinctrl: pinctrl@c11080b0 { - compatible = "amlogic,aml8726-pinctrl"; - reg = <0xc11080b0 40>, /* mux */ - <0xc11080e8 24>, /* pu/pd */ - <0xc11080e8 24>, /* pull enable */ - <0xc8100014 4>, /* ao mux */ - <0xc810002c 4>, /* ao pu/pd */ - <0xc810002c 4>; /* ao pull enable */ - - /* - * Currently only pin muxing that deviates - * from the power on default of gpio is - * specified here. - */ - - pinctrl-names = "default"; - pinctrl-0 = <&pins_uartao &pins_ethernet &pins_hdmi>; - - pins_ethernet: ethernet { - amlogic,pins = "ref_clk_in", - "tx_clk", "tx_en", - "tx_d0", "tx_d1", - "tx_d2", "tx_d3", - "rx_clk", "rx_dv", - "rx_d0", "rx_d1", - "rx_d2", "rx_d3", - "mdc", "mdio"; - amlogic,function = "ethernet"; - }; - - pins_hdmi: hdmi { - amlogic,pins = "cec", "hpd", - "scl", "sda"; - amlogic,function = "hdmi"; - }; - - pins_sdio_b: sdio_b { - amlogic,pins = "clk", "cmd", - "d0", "d1", - "d2", "d3"; - amlogic,function = "sdio-b"; - }; - - pins_uartao: uartao { - amlogic,pins = "tx", "rx"; - amlogic,function = "uart-ao"; - }; - }; - - rtc@da004340 { - compatible = "amlogic,aml8726-rtc"; - reg = <0xda004340 20>; /* secbus2 0xd0 */ - interrupts = <0 72 1>; /* AM_IRQ2(8) */ - }; - - clkmsr: clkmsr@c1108758 { - compatible = "amlogic,aml8726-clkmsr"; - reg = <0xc1108758 16>; /* cbus 0x21d6 */ - - clocks = <&clk81>; - }; - - gpioao: gpio@c8100024 { - /* gpio unit 7 */ - compatible = "amlogic,aml8726-gpio"; - reg = <0xc8100024 4>, /* oen aobus 0x9 */ - <0xc8100024 4>, /* out */ - <0xc8100028 4>; /* in */ - - gpio-controller; - #gpio-cells = <1>; - pin-count = <12>; - }; - - gpio5: gpio@c110806c { - compatible = "amlogic,aml8726-gpio"; - reg = <0xc110806c 4>, /* oen cbus 0x201b */ - <0xc1108070 4>, /* out */ - <0xc1108074 4>; /* in */ - - gpio-controller; - #gpio-cells = <1>; - pin-count = <32>; - }; - - gpio6: gpio@c1108020 { - compatible = "amlogic,aml8726-gpio"; - reg = <0xc1108020 4>, /* oen cbus 0x2008 */ - <0xc1108024 4>, /* out */ - <0xc1108028 4>; /* in */ - - gpio-controller; - #gpio-cells = <1>; - pin-count = <29>; - }; - - mmc@c1108c20 { - compatible = "amlogic,aml8726-mmc"; - reg = <0xc1108c20 32>; /* cbus 0x2308 */ - interrupts = <0 28 1>; /* AM_IRQ0(28) */ - - clocks = <&clk81>; - - pinctrl-names = "default"; - pinctrl-0 = <&pins_sdio_b>; - - mmc-voltages = "3.3"; - - mmc-pwr-en = <&gpio5 31 0>; /* card_8 */ - ins-detect = <&gpio5 29 0>; /* card_6 */ - }; - - rng@c1108100 { - compatible = "amlogic,aml8726-rng"; - reg = <0xc1108100 8>; /* cbus 0x2040 */ - }; - - usb-phy@c1108400 { - /* usb-a phy */ - compatible = "amlogic,aml8726-m6-usb-phy"; - reg = <0xc1108400 32>; /* cbus 0x2100 */ - }; - - usb-phy@c1108420 { - /* usb-b phy */ - compatible = "amlogic,aml8726-m6-usb-phy"; - reg = <0xc1108420 32>; /* cbus 0x2108 */ - - usb-pwr-en = <&gpioao 3 1>, /* gpioao_3 vbus */ - <&gpio6 11 0>; /* gpioe_11 wifi */ - }; - - usb@c9040000 { - /* usb-a */ - compatible = "synopsys,designware-hs-otg2"; - reg = <0xc9040000 0x40000>; /* ahbbus 0x40000*/ - interrupts = <0 30 4>; /* AM_IRQ0(30) */ - #address-cells = <1>; - #size-cells = <0>; - }; - - usb@c90c0000 { - /* usb-b */ - compatible = "synopsys,designware-hs-otg2"; - reg = <0xc90c0000 0x40000>; /* ahbbus 0xc0000 */ - interrupts = <0 31 4>; /* AM_IRQ0(31) */ - #address-cells = <1>; - #size-cells = <0>; - - dr_mode = "host"; - }; - - eth@c9410000 { - /* ethernet */ - compatible = "snps,dwmac"; - reg = <0xc9410000 0x2000>; /* ahbbus 0x410000 */ - interrupts = <0 8 1>; /* AM_IRQ0(8) */ - #address-cells = <1>; - #size-cells = <0>; - - eth-phy-rst = <&gpio5 15 0>; /* gpioy_15 phy-rst */ - }; - - screen: fb@c8006324 { - device_type = "display"; - compatible = "amlogic,aml8726-fb"; - reg = <0xc8006324 12>, /* CANVAS */ - <0xc1106800 1024>, /* VIU */ - <0xc1107400 1024>; /* VPP */ - interrupts = <0 2 1>, /* AM_IRQ0(2) */ - <0 3 1>, /* AM_IRQ0(3) */ - <0 12 1>, /* AM_IRQ0(12) */ - <0 13 1>; /* AM_IRQ0(13) */ - - address = <0x84900000>; /* match memreserve */ - width = <720>; - height = <480>; - depth = <24>; - linebytes = <2160>; - }; - }; - - leds { - compatible = "gpio-leds"; - - sys_led { - gpios = <&gpioao 2>; /* gpioao_2 sys_led */ - label = "sys_led"; - - default-state = "on"; - }; - }; - - chosen { - stdin = "uart0"; - stdout = "uart0"; - }; -}; - -&clk81 { - clock-frequency = <0>; -}; - -&uart_AO { - status = "okay"; - current-speed = <115200>; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-colibri-vf50.dts b/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-colibri-vf50.dts deleted file mode 100644 index 6d4d934b3d..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-colibri-vf50.dts +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "vybrid.dtsi" - -/ { - model = "Toradex Colibri VF50"; - - memory { - device_type = "memory"; - reg = < 0x80000000 0x08000000 >; /* 128MB RAM */ - }; - - SOC: vybrid { - serial0: serial@40027000 { - status = "okay"; - }; - - fec1: ethernet@400D1000 { - status = "okay"; - iomux_config = < 54 0x103192 - 55 0x103193 - 56 0x103191 - 57 0x103191 - 58 0x103191 - 59 0x103191 - 60 0x103192 - 61 0x103192 - 62 0x103192 - 0 0x103191 >; - }; - - sai3: sai@40032000 { - status = "okay"; - }; - - i2c0: i2c@40066000 { - status = "okay"; - }; - - adc0: adc@4003B000 { - status = "okay"; - }; - - edma1: edma@40098000 { - status = "okay"; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-cosmic.dts b/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-cosmic.dts deleted file mode 100644 index c98c093257..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-cosmic.dts +++ /dev/null @@ -1,86 +0,0 @@ -/*- - * Copyright (c) 2013-2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "vybrid.dtsi" - -/ { - model = "Cosmic Board"; - - memory { - device_type = "memory"; - reg = < 0x80000000 0x10000000 >; /* 256MB RAM */ - }; - - SOC: vybrid { - serial1: serial@40028000 { - status = "okay"; - }; - - fec1: ethernet@400D1000 { - status = "okay"; - iomux_config = < 54 0x103192 - 55 0x103193 - 56 0x103191 - 57 0x103191 - 58 0x103191 - 59 0x103191 - 60 0x103192 - 61 0x103192 - 62 0x103192 - 0 0x203191 >; - }; - - esai: esai@40062000 { - status = "okay"; - }; - - edma1: edma@40098000 { - status = "okay"; - }; - - tcon0: tcon@4003D000 { - status = "okay"; - }; - - dcu0: dcu4@40058000 { - status = "okay"; - }; - - adc0: adc@4003B000 { - status = "okay"; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "serial1"; - stdout = "serial1"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-quartz.dts b/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-quartz.dts deleted file mode 100644 index 48cc1b5f90..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/vybrid-quartz.dts +++ /dev/null @@ -1,115 +0,0 @@ -/*- - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/include/ "vybrid.dtsi" - -/ { - model = "Device Solutions Quartz Module"; - - memory { - device_type = "memory"; - reg = < 0x80000000 0x10000000 >; /* 256MB RAM */ - }; - - SOC: vybrid { - serial0: serial@40027000 { - status = "okay"; - }; - - fec1: ethernet@400D1000 { - status = "okay"; - iomux_config = < 54 0x103192 - 55 0x103193 - 56 0x103191 - 57 0x103191 - 58 0x103191 - 59 0x103191 - 60 0x103192 - 61 0x103192 - 62 0x103192 - 0 0x203191 >; - }; - - edma1: edma@40098000 { - status = "okay"; - }; - - dcu0: dcu4@40058000 { - status = "okay"; - - panel-size = < 800 480 >; - panel-hsync = < 40 48 40 >; - panel-vsync = < 29 3 13 >; - panel-clk-div = < 17 >; - panel-backlight-pin = < 25 >; - - iomux_config = < 105 0x1001c4 /* hsync */ - 106 0x1001c4 /* vsync */ - 107 0x1001e0 /* pclk */ - 108 0x1001e0 - 109 0x1001be /* de */ - 110 0x1001e0 /* r0 */ - 111 0x1001e0 - 112 0x1001e0 - 113 0x1001e0 - 114 0x1001e0 - 115 0x1001e0 - 116 0x1001e0 - 117 0x1001e0 - 118 0x1001e0 /* g0 */ - 119 0x1001e0 - 120 0x1001e0 - 121 0x1001e0 - 122 0x1001e0 - 123 0x1001e0 - 124 0x1001e0 - 125 0x1001e0 - 126 0x1001e0 /* b0 */ - 127 0x1001e0 - 128 0x1001e0 - 129 0x1001e0 - 130 0x1001e0 - 131 0x1001e0 - 132 0x1001e0 - 133 0x1001e0 - 25 0x0001be >; /* led */ - }; - - tcon0: tcon@4003D000 { - status = "okay"; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/vybrid.dtsi b/usr/src/boot/sys/boot/fdt/dts/arm/vybrid.dtsi deleted file mode 100644 index 1386c70f4b..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/vybrid.dtsi +++ /dev/null @@ -1,497 +0,0 @@ -/*- - * Copyright (c) 2013-2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - model = "Freescale Vybrid Family"; - compatible = "freescale,vybrid", "fsl,mvf"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&GIC>; - - aliases { - soc = &SOC; - serial0 = &serial0; - serial1 = &serial1; - sai0 = &sai0; - sai1 = &sai1; - sai2 = &sai2; - sai3 = &sai3; - esai = &esai; - adc0 = &adc0; - adc1 = &adc1; - edma0 = &edma0; - edma1 = &edma1; - src = &SRC; - }; - - SOC: vybrid { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - SRC: src@4006E000 { - compatible = "fsl,mvf600-src"; - reg = <0x4006E000 0x100>; - }; - - mscm@40001000 { - compatible = "fsl,mvf600-mscm"; - reg = <0x40001000 0x1000>; - }; - - GIC: interrupt-controller@01c81000 { - compatible = "arm,gic"; - reg = <0x40003000 0x1000>, /* Distributor Registers */ - <0x40002100 0x100>; /* CPU Interface Registers */ - interrupt-controller; - #interrupt-cells = <1>; - }; - - anadig@40050000 { - compatible = "fsl,mvf600-anadig"; - reg = <0x40050000 0x300>; - }; - - ccm@4006b000 { - compatible = "fsl,mvf600-ccm"; - reg = <0x4006b000 0x1000>; - clock_names = "pll4"; - }; - - mp_tmr@40002100 { - compatible = "arm,mpcore-timers"; - clock-frequency = <133000000>; - #address-cells = <1>; - #size-cells = <0>; - reg = < 0x40002200 0x100 >, /* Global Timer Registers */ - < 0x40002600 0x100 >; /* Private Timer Registers */ - interrupts = < 27 29 >; - interrupt-parent = < &GIC >; - }; - - dmamux@40024000 { - compatible = "fsl,mvf600-dmamux"; - reg = <0x40024000 0x100>, - <0x40025000 0x100>, - <0x400A1000 0x100>, - <0x400A2000 0x100>; - }; - - edma0: edma@40018000 { - compatible = "fsl,mvf600-edma"; - reg = <0x40018000 0x1000>, - <0x40019000 0x1000>; /* TCD */ - interrupts = < 40 41 >; - interrupt-parent = <&GIC>; - device-id = < 0 >; - status = "disabled"; - }; - - edma1: edma@40098000 { - compatible = "fsl,mvf600-edma"; - reg = <0x40098000 0x1000>, - <0x40099000 0x1000>; /* TCD */ - interrupts = < 42 43 >; - interrupt-parent = <&GIC>; - device-id = < 1 >; - status = "disabled"; - }; - - pit@40037000 { - compatible = "fsl,mvf600-pit"; - reg = <0x40037000 0x1000>; - interrupts = < 71 >; - interrupt-parent = <&GIC>; - clock-frequency = < 24000000 >; - }; - - lptmr@40040000 { - compatible = "fsl,mvf600-lptmr"; - reg = <0x40040000 0x1000>; - interrupts = < 72 >; - interrupt-parent = <&GIC>; - clock-frequency = < 24000000 >; - }; - - iomuxc@40048000 { - compatible = "fsl,mvf600-iomuxc"; - reg = <0x40048000 0x1000>; - }; - - port@40049000 { - compatible = "fsl,mvf600-port"; - reg = <0x40049000 0x5000>; - interrupts = < 139 140 141 142 143 >; - interrupt-parent = <&GIC>; - }; - - gpio@400FF000 { - compatible = "fsl,mvf600-gpio"; - reg = <0x400FF000 0x200>; - #gpio-cells = <3>; - gpio-controller; - }; - - nand@400E0000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,mvf600-nand"; - reg = <0x400E0000 0x10000>; - interrupts = < 115 >; - interrupt-parent = <&GIC>; - clock_names = "nand"; - status = "disabled"; - - partition@40000 { - reg = <0x40000 0x200000>; /* 2MB */ - label = "u-boot"; - read-only; - }; - - partition@240000 { - reg = <0x240000 0x200000>; /* 2MB */ - label = "test"; - }; - - partition@440000 { - reg = <0x440000 0xa00000>; /* 10MB */ - label = "kernel"; - }; - - partition@e40000 { - reg = <0xe40000 0x1e000000>; /* 480MB */ - label = "root"; - }; - }; - - sdhci0: sdhci@400B1000 { - compatible = "fsl,mvf600-sdhci"; - reg = <0x400B1000 0x1000>; - interrupts = < 59 >; - interrupt-parent = <&GIC>; - clock-frequency = <50000000>; - status = "disabled"; - clock_names = "esdhc0"; - }; - - sdhci1: sdhci@400B2000 { - compatible = "fsl,mvf600-sdhci"; - reg = <0x400B2000 0x1000>; - interrupts = < 60 >; - interrupt-parent = <&GIC>; - clock-frequency = <50000000>; - status = "disabled"; - clock_names = "esdhc1"; - iomux_config = < 14 0x500060 - 15 0x500060 - 16 0x500060 - 17 0x500060 - 18 0x500060 - 19 0x500060 >; - }; - - serial0: serial@40027000 { - compatible = "fsl,mvf600-uart"; - reg = <0x40027000 0x1000>; - interrupts = <93>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - status = "disabled"; - }; - - serial1: serial@40028000 { - compatible = "fsl,mvf600-uart"; - reg = <0x40028000 0x1000>; - interrupts = <94>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - status = "disabled"; - }; - - usb@40034000 { - compatible = "fsl,mvf600-usb-ehci", "usb-ehci"; - reg = < 0x40034000 0x1000 >, /* ehci */ - < 0x40035000 0x1000 >, /* usbc */ - < 0x40050800 0x100 >; /* phy */ - interrupts = < 107 >; - interrupt-parent = <&GIC>; - iomux_config = < 134 0x0001be - 7 0x200060 >; - }; - - usb@400b4000 { - compatible = "fsl,mvf600-usb-ehci", "usb-ehci"; - reg = < 0x400b4000 0x1000 >, /* ehci */ - < 0x400b5000 0x1000 >, /* usbc */ - < 0x40050C00 0x100 >; /* phy */ - interrupts = < 108 >; - interrupt-parent = <&GIC>; - iomux_config = < 134 0x0001be - 7 0x200060 >; - }; - - fec0: ethernet@400D0000 { - compatible = "fsl,mvf600-fec"; - reg = <0x400D0000 0x1000>; - interrupts = < 110 >; - interrupt-parent = <&GIC>; - phy-mode = "rmii"; - phy-disable-preamble; - status = "disabled"; - clock_names = "enet"; - iomux_config = < 45 0x100061 - 46 0x100061 - 47 0x100061 - 48 0x100060 - 49 0x100060 - 50 0x100060 - 51 0x100060 - 52 0x100060 - 53 0x100060 >; - }; - - fec1: ethernet@400D1000 { - compatible = "fsl,mvf600-fec"; - reg = <0x400D1000 0x1000>; - interrupts = < 111 >; - interrupt-parent = <&GIC>; - phy-mode = "rmii"; - phy-disable-preamble; - status = "disabled"; - clock_names = "enet"; - iomux_config = < 54 0x103192 - 55 0x103193 - 56 0x103191 - 57 0x103191 - 58 0x103191 - 59 0x103191 - 60 0x103192 - 61 0x103192 - 62 0x103192 >; - }; - - sai0: sai@4002F000 { - compatible = "fsl,mvf600-sai"; - reg = <0x4002F000 0x1000>; - interrupts = < 116 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - sai1: sai@40030000 { - compatible = "fsl,mvf600-sai"; - reg = <0x40030000 0x1000>; - interrupts = < 117 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - sai2: sai@40031000 { - compatible = "fsl,mvf600-sai"; - reg = <0x40031000 0x1000>; - interrupts = < 118 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - sai3: sai@40032000 { - compatible = "fsl,mvf600-sai"; - reg = <0x40032000 0x1000>; - interrupts = < 119 >; - interrupt-parent = <&GIC>; - status = "disabled"; - edma-controller = <&edma1>; - edma-src-receive = < 8 >; - edma-src-transmit = < 9 >; - edma-mux-group = < 1 >; - clock_names = "sai3", "cko1"; - iomux_config = < 16 0x200060 - 19 0x200060 - 21 0x200060 - 40 0x400061 >; /* CKO1 */ - }; - - esai: esai@40062000 { - compatible = "fsl,mvf600-esai"; - reg = <0x40062000 0x1000>; - interrupts = < 120 >; - interrupt-parent = <&GIC>; - status = "disabled"; - clock_names = "esai"; - iomux_config = < 45 0x400061 - 46 0x400061 - 47 0x400061 - 48 0x400060 - 49 0x400060 - 50 0x400060 - 51 0x400060 - 52 0x400060 - 78 0x3038df - 40 0x400061 >; - }; - - spi0: spi@4002C000 { - compatible = "fsl,mvf600-spi"; - reg = <0x4002C000 0x1000>; - interrupts = < 99 >; - interrupt-parent = <&GIC>; - status = "disabled"; - iomux_config = < 40 0x100061 - 41 0x100061 - 42 0x100060 - 43 0x100060 - 44 0x100061 >; - }; - - spi1: spi@4002D000 { - compatible = "fsl,mvf600-spi"; - reg = <0x4002D000 0x1000>; - interrupts = < 100 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - spi2: spi@400AC000 { - compatible = "fsl,mvf600-spi"; - reg = <0x400AC000 0x1000>; - interrupts = < 101 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - spi3: spi@400AD000 { - compatible = "fsl,mvf600-spi"; - reg = <0x400AD000 0x1000>; - interrupts = < 102 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - i2c0: i2c@40066000 { - compatible = "fsl,mvf600-i2c"; - reg = <0x40066000 0x1000>; - interrupts = < 103 >; - interrupt-parent = <&GIC>; - status = "disabled"; - clock_names = "ipg"; - iomux_config = < 36 0x2034d3 - 37 0x2034d3 - 207 0x1 - 208 0x1 >; - }; - - i2c1: i2c@40067000 { - compatible = "fsl,mvf600-i2c"; - reg = <0x40067000 0x1000>; - interrupts = < 104 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - i2c2: i2c@400E6000 { - compatible = "fsl,mvf600-i2c"; - reg = <0x400E6000 0x1000>; - interrupts = < 105 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - i2c3: i2c@400E7000 { - compatible = "fsl,mvf600-i2c"; - reg = <0x400E7000 0x1000>; - interrupts = < 106 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - adc0: adc@4003B000 { - compatible = "fsl,mvf600-adc"; - reg = <0x4003B000 0x1000>; - interrupts = < 85 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - adc1: adc@400BB000 { - compatible = "fsl,mvf600-adc"; - reg = <0x400BB000 0x1000>; - interrupts = < 86 >; - interrupt-parent = <&GIC>; - status = "disabled"; - }; - - tcon0: tcon@4003D000 { - compatible = "fsl,mvf600-tcon"; - reg = <0x4003D000 0x1000>; - status = "disabled"; - }; - - dcu0: dcu4@40058000 { - compatible = "fsl,mvf600-dcu4"; - reg = <0x40058000 0x7000>; - interrupts = < 62 >; - interrupt-parent = <&GIC>; - status = "disabled"; - clock_names = "dcu0"; - iomux_config = < 105 0x100044 - 106 0x100044 - 107 0x100060 - 108 0x100060 - 109 0x100060 - 110 0x100060 - 111 0x100060 - 112 0x100060 - 113 0x100060 - 114 0x100060 - 115 0x100060 - 116 0x100060 - 117 0x100060 - 118 0x100060 - 119 0x100060 - 120 0x100060 - 121 0x100060 - 122 0x100060 - 123 0x100060 - 124 0x100060 - 125 0x100060 - 126 0x100060 - 127 0x100060 - 128 0x100060 - 129 0x100060 - 130 0x100060 - 131 0x100060 - 132 0x100060 - 133 0x100060 >; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-dual.dts b/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-dual.dts deleted file mode 100644 index 89c9d30827..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-dual.dts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2013 Ian Lepore - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Wandboard Dual. - * - * $FreeBSD$ - */ - -/dts-v1/; -/include/ "imx6.dtsi" - -/ { - #address-cells = <1>; - #size-cells = <1>; - - model = "Wandboard Dual"; - compatible = "wand,imx6d-wandboard", "fsl,imx6d"; - - memory { - reg = <0x10000000 0x40000000>; /* RAM 1GB */ - }; - - SOC: soc@00000000 { - aips@02000000 { /* AIPS1 */ - gpio@0209c000 { status = "okay"; }; - gpio@020a0000 { status = "okay"; }; - gpio@020a4000 { status = "okay"; }; - gpio@020a8000 { status = "okay"; }; - gpio@020ac000 { status = "okay"; }; - gpio@020b0000 { status = "okay"; }; - gpio@020b4000 { status = "okay"; }; - console:serial@02020000 { status = "okay"; }; - serial@021e8000 { status = "disabled"; }; - serial@021ec000 { status = "disabled"; }; - serial@021f0000 { status = "disabled"; }; - serial@021f4000 { status = "disabled"; }; - usbphy@020c9000 { status = "okay"; }; - usbphy@020ca000 { status = "okay"; }; - }; - aips@02100000 { /* AIPS2 */ - ethernet@02188000 { - status = "okay"; - phy-mode = "rgmii"; - phy-disable-preamble; - }; - usb@02184000 { status = "okay"; }; - usb@02184200 { status = "okay"; }; - usb@02184400 { status = "disabled"; }; - usb@02184600 { status = "disabled"; }; - usdhc@02190000 { status = "okay"; }; - usdhc@02194000 { status = "disabled"; }; - usdhc@02198000 { status = "okay"; }; - usdhc@0219c000 { status = "disabled"; }; - }; - }; - - chosen { - stdin = &console; - stdout = &console; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-quad.dts b/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-quad.dts deleted file mode 100644 index fd7b9b41ed..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-quad.dts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2013 Ian Lepore - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Wandboard Quad. - * - * $FreeBSD$ - */ - -/dts-v1/; -/include/ "imx6.dtsi" - -/ { - #address-cells = <1>; - #size-cells = <1>; - - model = "Wandboard Quad"; - compatible = "wand,imx6q-wandboard", "fsl,imx6q"; - - memory { - reg = <0x10000000 0x80000000>; /* RAM 2GB */ - }; - - SOC: soc@00000000 { - aips@02000000 { /* AIPS1 */ - gpio@0209c000 { status = "okay"; }; - gpio@020a0000 { status = "okay"; }; - gpio@020a4000 { status = "okay"; }; - gpio@020a8000 { status = "okay"; }; - gpio@020ac000 { status = "okay"; }; - gpio@020b0000 { status = "okay"; }; - gpio@020b4000 { status = "okay"; }; - console:serial@02020000 { status = "okay"; }; - serial@021e8000 { status = "disabled"; }; - serial@021ec000 { status = "disabled"; }; - serial@021f0000 { status = "disabled"; }; - serial@021f4000 { status = "disabled"; }; - usbphy@020c9000 { status = "okay"; }; - usbphy@020ca000 { status = "okay"; }; - }; - aips@02100000 { /* AIPS2 */ - ethernet@02188000 { - status = "okay"; - phy-mode = "rgmii"; - phy-disable-preamble; - }; - usb@02184000 { status = "okay"; }; - usb@02184200 { status = "okay"; }; - usb@02184400 { status = "disabled"; }; - usb@02184600 { status = "disabled"; }; - usdhc@02190000 { status = "okay"; }; - usdhc@02194000 { status = "disabled"; }; - usdhc@02198000 { status = "okay"; }; - usdhc@0219c000 { status = "disabled"; }; - }; - }; - - chosen { - stdin = &console; - stdout = &console; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-solo.dts b/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-solo.dts deleted file mode 100644 index 5d67f2b8b9..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/wandboard-solo.dts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2013 Ian Lepore - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Wandboard Solo. - * - * $FreeBSD$ - */ - -/dts-v1/; -/include/ "imx6.dtsi" - -/ { - #address-cells = <1>; - #size-cells = <1>; - - model = "Wandboard Solo"; - compatible = "wand,imx6s-wandboard", "fsl,imx6s"; - - memory { - reg = <0x10000000 0x20000000>; /* RAM 512M */ - }; - - SOC: soc@00000000 { - aips@02000000 { /* AIPS1 */ - gpio@0209c000 { status = "okay"; }; - gpio@020a0000 { status = "okay"; }; - gpio@020a4000 { status = "okay"; }; - gpio@020a8000 { status = "okay"; }; - gpio@020ac000 { status = "okay"; }; - gpio@020b0000 { status = "okay"; }; - gpio@020b4000 { status = "okay"; }; - console:serial@02020000 { status = "okay"; }; - serial@021e8000 { status = "disabled"; }; - serial@021ec000 { status = "disabled"; }; - serial@021f0000 { status = "disabled"; }; - serial@021f4000 { status = "disabled"; }; - usbphy@020c9000 { status = "okay"; }; - usbphy@020ca000 { status = "okay"; }; - }; - aips@02100000 { /* AIPS2 */ - ethernet@02188000 { - status = "okay"; - phy-mode = "rgmii"; - phy-disable-preamble; - }; - usb@02184000 { status = "okay"; }; - usb@02184200 { status = "okay"; }; - usb@02184400 { status = "disabled"; }; - usb@02184600 { status = "disabled"; }; - usdhc@02190000 { status = "okay"; }; - usdhc@02194000 { status = "disabled"; }; - usdhc@02198000 { status = "okay"; }; - usdhc@0219c000 { status = "disabled"; }; - }; - }; - - chosen { - stdin = &console; - stdout = &console; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/yyhd18-m3.dts b/usr/src/boot/sys/boot/fdt/dts/arm/yyhd18-m3.dts deleted file mode 100644 index bdb425d034..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/yyhd18-m3.dts +++ /dev/null @@ -1,237 +0,0 @@ -/*- - * Copyright (c) 2015 John Wehle <john@feith.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * The ordering of certain devices is significant (e.g. usb depends on - * usb-phy which depends on gpio, also the timer should appear early on - * to provide a reasonably accurate DELAY implementation). - */ - -/dts-v1/; - -/memreserve/ 0x84900000 0x00600000; /* 6MB frame buffer */ - -#include "meson3.dtsi" - -/ { - /* - * My development unit is a Yiyate Android TV Box containing - * a HD18 motherboard and an aml8726-m3 SoC ... later versions - * shipped with an aml8726-m6. Printenv in uboot shows m3-oplay - * as the boardname supplied as part of mmcargs. - */ - - model = "yiyate,hd18-m3"; - compatible = "yiyate,hd18-m3", "amlogic,meson3"; - - #address-cells = <1>; - #size-cells = <1>; - - aliases { - soc = &soc; - screen = &screen; - uart0 = &uart_AO; - }; - - memory { - device_type = "memory"; - reg = <0x80000000 0x40000000>; /* 1GB RAM */ - }; - - soc: soc { - device_type = "soc"; - bus-frequency = <0>; - - ccm@c1104140 { - compatible = "amlogic,aml8726-ccm"; - reg = <0xc1104140 20>; /* cbus 0x1050 */ - - functions = "ethernet", "i2c", "rng", "sdio", - "uart-a", "uart-b", "uart-c", - "usb-a", "usb-b"; - }; - - pinctrl: pinctrl@c11080b0 { - compatible = "amlogic,aml8726-pinctrl"; - reg = <0xc11080b0 40>, /* mux */ - <0xc11080e8 24>, /* pu/pd */ - <0xc11080e8 24>, /* pull enable */ - <0xc8100014 4>, /* ao mux */ - <0xc810002c 4>, /* ao pu/pd */ - <0xc810002c 4>; /* ao pull enable */ - - /* - * Currently only pin muxing that deviates - * from the power on default of gpio is - * specified here. - */ - - pinctrl-names = "default"; - pinctrl-0 = <&pins_uartao &pins_ethernet &pins_hdmi>; - - pins_ethernet: ethernet { - amlogic,pins = "clk_out", "tx_en", - "tx_d0", "tx_d1", - "crs_dv", "rx_err", - "rx_d0", "rx_d1", - "mdc", "mdio"; - amlogic,function = "ethernet"; - }; - - pins_hdmi: hdmi { - amlogic,pins = "cec", "hpd", - "scl", "sda"; - amlogic,function = "hdmi"; - }; - - pins_sdio_b: sdio_b { - amlogic,pins = "clk", "cmd", - "d0", "d1", - "d2", "d3"; - amlogic,function = "sdio-b"; - }; - - pins_uartao: uartao { - amlogic,pins = "tx", "rx"; - amlogic,function = "uart-ao"; - }; - }; - - rtc@c8100740 { - compatible = "amlogic,aml8726-rtc"; - reg = <0xc8100740 20>; /* aobus 0x1d0 */ - interrupts = <0 72 1>; /* AM_IRQ2(8) */ - }; - - clkmsr: clkmsr@c1108758 { - compatible = "amlogic,aml8726-clkmsr"; - reg = <0xc1108758 16>; /* cbus 0x21d6 */ - - clocks = <&clk81>; - }; - - gpio5: gpio@c110806c { - compatible = "amlogic,aml8726-gpio"; - reg = <0xc110806c 4>, /* oen cbus 0x201b */ - <0xc1108070 4>, /* out */ - <0xc1108074 4>; /* in */ - - gpio-controller; - #gpio-cells = <1>; - pin-count = <32>; - }; - - mmc@c1108c20 { - compatible = "amlogic,aml8726-mmc"; - reg = <0xc1108c20 32>; /* cbus 0x2308 */ - interrupts = <0 28 1>; /* AM_IRQ0(28) */ - - clocks = <&clk81>; - - pinctrl-names = "default"; - pinctrl-0 = <&pins_sdio_b>; - - mmc-voltages = "3.3"; - - mmc-pwr-en = <&gpio5 31 0>; /* card_8 */ - ins-detect = <&gpio5 29 0>; /* card_6 */ - }; - - rng@c1108100 { - compatible = "amlogic,aml8726-rng"; - reg = <0xc1108100 8>; /* cbus 0x2040 */ - }; - - usb-phy@c1108400 { - /* usb-a and usb-b phy */ - compatible = "amlogic,aml8726-m3-usb-phy"; - reg = <0xc1108400 32>; /* cbus 0x2100 */ - }; - - usb@c9040000 { - /* usb-a */ - compatible = "synopsys,designware-hs-otg2"; - reg = <0xc9040000 0x40000>; /* ahbbus 0x40000*/ - interrupts = <0 30 4>; /* AM_IRQ0(30) */ - #address-cells = <1>; - #size-cells = <0>; - }; - - usb@c90c0000 { - /* usb-b */ - compatible = "synopsys,designware-hs-otg2"; - reg = <0xc90c0000 0x40000>; /* ahbbus 0xc0000 */ - interrupts = <0 31 4>; /* AM_IRQ0(31) */ - #address-cells = <1>; - #size-cells = <0>; - - dr_mode = "host"; - }; - - eth@c9410000 { - /* ethernet */ - compatible = "snps,dwmac"; - reg = <0xc9410000 0x2000>; /* ahbbus 0x410000 */ - interrupts = <0 8 1>; /* AM_IRQ0(8) */ - #address-cells = <1>; - #size-cells = <0>; - }; - - screen: fb@c8001324 { - device_type = "display"; - compatible = "amlogic,aml8726-fb"; - reg = <0xc8001324 12>, /* CANVAS */ - <0xc1106800 1024>, /* VIU */ - <0xc1107400 1024>; /* VPP */ - interrupts = <0 2 1>, /* AM_IRQ0(2) */ - <0 3 1>, /* AM_IRQ0(3) */ - <0 12 1>, /* AM_IRQ0(12) */ - <0 13 1>; /* AM_IRQ0(13) */ - - address = <0x84900000>; /* match memreserve */ - width = <720>; - height = <480>; - depth = <24>; - linebytes = <2160>; - }; - }; - - chosen { - stdin = "uart0"; - stdout = "uart0"; - }; -}; - -&clk81 { - clock-frequency = <0>; -}; - -&uart_AO { - status = "okay"; - current-speed = <115200>; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/zedboard.dts b/usr/src/boot/sys/boot/fdt/dts/arm/zedboard.dts deleted file mode 100644 index 7277308c87..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/zedboard.dts +++ /dev/null @@ -1,217 +0,0 @@ -/*- - * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "zedboard"; - compatible = "digilent,zedboard"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&GIC>; - - // cpus { - // #address-cells = <1>; - // #size-cells = <0>; - // cpu@0 { - // device-type = "cpu"; - // model = "ARM Cortex-A9"; - // }; - // }; - - memory { - // First megabyte isn't accessible by all interconnect masters. - device_type = "memory"; - reg = <0x100000 0x1ff00000>; /* 511MB RAM at 0x100000 */ - }; - - // Zynq PS System registers. - // - ps7sys@f8000000 { - device_type = "soc"; - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xf8000000 0xf10000>; - - // SLCR block - slcr: slcr@7000 { - compatible = "xlnx,zy7_slcr"; - reg = <0x0 0x1000>; - clock-frequency = <33333333>; // 33Mhz PS_CLK - }; - - // Interrupt controller - GIC: gic { - compatible = "arm,gic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0xf01000 0x1000>, // distributer registers - <0xf00100 0x0100>; // CPU if registers - }; - - // L2 cache controller - pl310@f02000 { - compatible = "arm,pl310"; - reg = <0xf02000 0x1000>; - interrupts = <34>; - interrupt-parent = <&GIC>; - }; - - // Device Config - devcfg: devcfg@7000 { - compatible = "xlnx,zy7_devcfg"; - reg = <0x7000 0x1000>; - interrupts = <40>; - interrupt-parent = <&GIC>; - }; - - // triple timer counters0,1 - ttc0: ttc@1000 { - compatible = "xlnx,ttc"; - reg = <0x1000 0x1000>; - }; - ttc1: ttc@2000 { - compatible = "xlnx,ttc"; - reg = <0x2000 0x1000>; - }; - - // ARM Cortex A9 TWD Timer - timer@f00600 { - compatible = "arm,mpcore-timers"; - clock-frequency = <333333333>; // 333Mhz - #address-cells = <1>; - #size-cells = <0>; - reg = <0xf00200 0x100>, // Global Timer Regs - <0xf00600 0x20>; // Private Timer Regs - interrupts = < 27 29 >; - interrupt-parent = <&GIC>; - }; - - // system watch-dog timer - swdt@5000 { - device_type = "watchdog"; - compatible = "xlnx,zy7_wdt"; - reg = <0x5000 0x1000>; - interrupts = <41>; - interrupt-parent = <&GIC>; - }; - - scuwdt@f00620 { - device_type = "watchdog"; - compatible = "arm,mpcore_wdt"; - reg = <0xf00620 0x20>; - interrupts = <30>; - interrupt-parent = <&GIC>; - reset = <1>; - }; - }; // pssys@f8000000 - - // Zynq PS I/O Peripheral registers. - // - ps7io@e0000000 { - device_type = "soc"; - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xe0000000 0x300000>; - - // uart0: uart@0000 { - // device_type = "serial"; - // compatible = "cadence,uart"; - // reg = <0x0000 0x1000>; - // interrupts = <59>; - // interrupt-parent = <&GIC>; - // clock-frequency = <50000000>; - // }; - - uart1: uart@1000 { - device_type = "serial"; - compatible = "cadence,uart"; - reg = <0x1000 0x1000>; - interrupts = <82>; - interrupt-parent = <&GIC>; - clock-frequency = <50000000>; - current-speed = <115200>; - }; - - gpio: gpio@a000 { - compatible = "xlnx,zy7_gpio"; - reg = <0xa000 0x1000>; - interrupts = <52>; - interrupt-parent = <&GIC>; - }; - - // GigE - eth0: eth@b000 { - // device_type = "network"; - - compatible = "cadence,gem"; - reg = <0xb000 0x1000>; - interrupts = <54 55>; - interrupt-parent = <&GIC>; - ref-clock-num = <0>; - }; - - // SDIO - sdhci0: sdhci@100000 { - compatible = "xlnx,zy7_sdhci"; - reg = <0x100000 0x1000>; - interrupts = <56>; - interrupt-parent = <&GIC>; - max-frequency = <50000000>; - }; - - // QSPI - qspi0: qspi@d000 { - compatible = "xlnx,zy7_qspi"; - reg = <0xd000 0x1000>; - interrupts = <51>; - interrupt-parent = <&GIC>; - spi-clock = <50000000>; - ref-clock = <190476000>; - }; - - // USB - ehci0: ehci@2000 { - compatible = "xlnx,zy7_ehci"; - reg = <0x2000 0x1000>; - interrupts = <53>; - interrupt-parent = <&GIC>; - phy_vbus_ext; - }; - - }; // ps7io@e0000000 - - chosen { - stdin = &uart1; - stdout = &uart1; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/arm/zybo.dts b/usr/src/boot/sys/boot/fdt/dts/arm/zybo.dts deleted file mode 100644 index b386edbc65..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/arm/zybo.dts +++ /dev/null @@ -1,216 +0,0 @@ -/*- - * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "zybo"; - compatible = "digilent,zybo"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&GIC>; - - // cpus { - // #address-cells = <1>; - // #size-cells = <0>; - // cpu@0 { - // device-type = "cpu"; - // model = "ARM Cortex-A9"; - // }; - // }; - - memory { - // First megabyte isn't accessible by all interconnect masters. - device_type = "memory"; - reg = <0x100000 0x1ff00000>; /* 511MB RAM at 0x100000 */ - }; - - // Zynq PS System registers. - // - ps7sys@f8000000 { - device_type = "soc"; - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xf8000000 0xf10000>; - - // SLCR block - slcr: slcr@7000 { - compatible = "xlnx,zy7_slcr"; - reg = <0x0 0x1000>; - clock-frequency = <50000000>; // 50Mhz PS_CLK - }; - - // Interrupt controller - GIC: gic { - compatible = "arm,gic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0xf01000 0x1000>, // distributer registers - <0xf00100 0x0100>; // CPU if registers - }; - - // L2 cache controller - pl310@f02000 { - compatible = "arm,pl310"; - reg = <0xf02000 0x1000>; - interrupts = <34>; - interrupt-parent = <&GIC>; - }; - - // Device Config - devcfg: devcfg@7000 { - compatible = "xlnx,zy7_devcfg"; - reg = <0x7000 0x1000>; - interrupts = <40>; - interrupt-parent = <&GIC>; - }; - - // triple timer counters0,1 - ttc0: ttc@1000 { - compatible = "xlnx,ttc"; - reg = <0x1000 0x1000>; - }; - ttc1: ttc@2000 { - compatible = "xlnx,ttc"; - reg = <0x2000 0x1000>; - }; - - // ARM Cortex A9 TWD Timer - timer@f00600 { - compatible = "arm,mpcore-timers"; - clock-frequency = <325000000>; // 325Mhz - #address-cells = <1>; - #size-cells = <0>; - reg = <0xf00200 0x100>, // Global Timer Regs - <0xf00600 0x20>; // Private Timer Regs - interrupts = < 27 29 >; - interrupt-parent = <&GIC>; - }; - - // system watch-dog timer - swdt@5000 { - device_type = "watchdog"; - compatible = "xlnx,zy7_wdt"; - reg = <0x5000 0x1000>; - interrupts = <41>; - interrupt-parent = <&GIC>; - }; - - scuwdt@f00620 { - device_type = "watchdog"; - compatible = "arm,mpcore_wdt"; - reg = <0xf00620 0x20>; - interrupts = <30>; - interrupt-parent = <&GIC>; - reset = <1>; - }; - }; // pssys@f8000000 - - // Zynq PS I/O Peripheral registers. - // - ps7io@e0000000 { - device_type = "soc"; - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xe0000000 0x300000>; - - // uart0: uart@0000 { - // device_type = "serial"; - // compatible = "cadence,uart"; - // reg = <0x0000 0x1000>; - // interrupts = <59>; - // interrupt-parent = <&GIC>; - // clock-frequency = <50000000>; - // }; - - uart1: uart@1000 { - device_type = "serial"; - compatible = "cadence,uart"; - reg = <0x1000 0x1000>; - interrupts = <82>; - interrupt-parent = <&GIC>; - clock-frequency = <50000000>; - current-speed = <115200>; - }; - - gpio: gpio@a000 { - compatible = "xlnx,zy7_gpio"; - reg = <0xa000 0x1000>; - interrupts = <52>; - interrupt-parent = <&GIC>; - }; - - // GigE - eth0: eth@b000 { - // device_type = "network"; - - compatible = "cadence,gem"; - reg = <0xb000 0x1000>; - interrupts = <54 55>; - interrupt-parent = <&GIC>; - ref-clock-num = <0>; - }; - - // SDIO - sdhci0: sdhci@100000 { - compatible = "xlnx,zy7_sdhci"; - reg = <0x100000 0x1000>; - interrupts = <56>; - interrupt-parent = <&GIC>; - max-frequency = <50000000>; - }; - - // QSPI - qspi0: qspi@d000 { - compatible = "xlnx,zy7_qspi"; - reg = <0xd000 0x1000>; - interrupts = <51>; - interrupt-parent = <&GIC>; - spi-clock = <50000000>; - ref-clock = <200000000>; - }; - - // USB - ehci0: ehci@2000 { - compatible = "xlnx,zy7_ehci"; - reg = <0x2000 0x1000>; - interrupts = <53>; - interrupt-parent = <&GIC>; - }; - - }; // ps7io@e0000000 - - chosen { - stdin = &uart1; - stdout = &uart1; - }; -}; - diff --git a/usr/src/boot/sys/boot/fdt/dts/bindings-gpio.txt b/usr/src/boot/sys/boot/fdt/dts/bindings-gpio.txt deleted file mode 100644 index b13078aeb0..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/bindings-gpio.txt +++ /dev/null @@ -1,101 +0,0 @@ -$FreeBSD$ - -GPIO configuration. -=================== - -1. Properties for GPIO Controllers - -1.1 #gpio-cells - -Property: #gpio-cells - -Value type: <u32> - -Description: The #gpio-cells property defines the number of cells required - to encode a gpio specifier. - - -1.2 gpio-controller - -Property: gpio-controller - -Value type: <empty> - -Description: The presence of a gpio-controller property defines a node as a - GPIO controller node. - - -1.3 pin-count - -Property: pin-count - -Value type: <u32> - -Description: The pin-count property defines the number of GPIO pins. - - -1.4 Example - - GPIO: gpio@10100 { - #gpio-cells = <3>; - compatible = "mrvl,gpio"; - reg = <0x10100 0x20>; - gpio-controller; - interrupts = <6 7 8 9>; - interrupt-parent = <&PIC>; - pin-count = <50> - }; - -2. Properties for GPIO consumer nodes. - -2.1 gpios - -Property: gpios - -Value type: <prop-encoded-array> encoded as arbitrary number of GPIO - specifiers. - -Description: The gpios property of a device node defines the GPIO or GPIOs - that are used by the device. The value of the gpios property - consists of an arbitrary number of GPIO specifiers. - - The first cell of the GPIO specifier is phandle of the node's - parent GPIO controller and remaining cells are defined by the - binding describing the GPIO parent, typically include - information like pin number, direction and various flags. - -Example: - gpios = <&GPIO 0 1 0 /* GPIO[0]: IN, NONE */ - &GPIO 1 2 0>; /* GPIO[1]: OUT, NONE */ - - -3. "mrvl,gpio" controller GPIO specifier - - <phandle pin dir flags> - - -pin: 0-MAX GPIO pin number. - -dir: - 1 IN Input direction. - 2 OUT Output direction. - -flags: - 0x0000---- IN_NONE - 0x0001---- IN_POL_LOW Polarity low (active-low). - 0x0002---- IN_IRQ_EDGE Interrupt, edge triggered. - 0x0004---- IN_IRQ_LEVEL Interrupt, level triggered. - - 0x----0000 OUT_NONE - 0x----0001 OUT_BLINK Blink on the pin. - 0x----0002 OUT_OPEN_DRAIN Open drain output line. - 0x----0004 OUT_OPEN_SRC Open source output line. - - -Example: - gpios = <&GPIO 0 1 0x00000000 /* GPIO[0]: IN */ - &GPIO 1 2 0x00000000 /* GPIO[1]: OUT */ - &GPIO 2 1 0x00020000 /* GPIO[2]: IN, IRQ (edge) */ - &GPIO 3 1 0x00040000 /* GPIO[3]: IN, IRQ (level) */ - ... - &GPIO 10 2 0x00000001>; /* GPIO[10]: OUT, blink */ diff --git a/usr/src/boot/sys/boot/fdt/dts/bindings-localbus.txt b/usr/src/boot/sys/boot/fdt/dts/bindings-localbus.txt deleted file mode 100644 index d960fefcf7..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/bindings-localbus.txt +++ /dev/null @@ -1,83 +0,0 @@ -$FreeBSD$ - -Marvell Device bus (localbus) configuration. -============================================ - -1. Properties for localbus nodes - -1.1 ranges - -Property: ranges - -Value type: <prop-encoded-array> encoded as arbitrary number of localbus - nodes specifiers. - -Description: ranges property defines values used for mapping devices - connected to localbus, in Marvell devices it is used also for - setting decoding windows. - - a) child node address-cells: - - first cell: number of bank (chip select) - - second cell: (Marvell devices) Target ID for decoding - windows setup - - b) parent node address cells: - - address offset: used with parent's node base address to - specify base address of mapped device - - c) child node size-cells: - - size: defines amount of memory that should be reserved for - device - -1.2 bank-count - -Property: bank-count - -Value type: <u32> - -Description: The bank_count property defines maximum number of banks on - localbus node. Bank is most often interpreted as device chip - select, but may also describe another device (e.g. SPI flash). - -1.3 Example - - localbus@0 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "mrvl,lbc"; - bank-count = <5>; - - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x2f 0xb2200000 0x00100000 - 0x1 0x3e 0xb2100000 0x00100000 - 0x2 0x3d 0xb0000000 0x02000000 - 0x3 0x3b 0xb2000000 0x00100000>; - }; - -2. Properties for localbus consumer nodes: - -2.1 reg - -Property: reg - -Value type: <prop-encoded-array> - -Description: A standard property required for localbus child nodes. Defines - the device memory region. - - a) first cell: number of bank (chip select) - - b) address offset: used with address offset from parent's ranges - for corresponding bank to specify base address of - the device - - c) size: defines size of the device memory region - -2.2 Example - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00100000>; - }; diff --git a/usr/src/boot/sys/boot/fdt/dts/bindings-mpp.txt b/usr/src/boot/sys/boot/fdt/dts/bindings-mpp.txt deleted file mode 100644 index 5da776e43c..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/bindings-mpp.txt +++ /dev/null @@ -1,50 +0,0 @@ -$FreeBSD$ - -* Multi purpose pin (MPP) configuration. - -Required properties: - -- pin-map : array of pin configurations. Each pin is defined by 2 cells, - respectively: <pin> <function>. Pins not specified in the pin-map property - are assumed to have default value of <function> = 0, which means GPIO. - - - pin : pin number. - - - function : function ID of the pin according to the assignment tables in - User Manual. Each pin can have many possible functions depending on the - MPP unit incarnation. - -- pin-count: number of the physical MPP connections on the SOC (depending on - the model it can be 24-50, or possibly else in future devices). - -Example: - - mpp@10000 { - #pin-cells = <2>; - compatible = "mrvl,mpp"; - reg = <0x10000 0x34>; - pin-count= <50>; - pin-map = < - 0 1 /* MPP[0]: NF_IO[2] */ - 1 1 /* MPP[1]: NF_IO[3] */ - 2 1 /* MPP[2]: NF_IO[4] */ - 3 1 /* MPP[3]: NF_IO[5] */ - 4 1 /* MPP[4]: NF_IO[6] */ - 5 1 /* MPP[5]: NF_IO[7] */ - 6 1 /* MPP[6]: SYSRST_OUTn */ - 7 2 /* MPP[7]: SPI_SCn */ - 8 1 /* MPP[8]: TW_SDA */ - 9 1 /* MPP[9]: TW_SCK */ - 10 3 /* MPP[10]: UA0_TXD */ - 11 3 /* MPP[11]: UA0_RXD */ - 12 1 /* MPP[12]: SD_CLK */ - 13 1 /* MPP[13]: SD_CMD */ - 14 1 /* MPP[14]: SD_D[0] */ - 15 1 /* MPP[15]: SD_D[1] */ - 16 1 /* MPP[16]: SD_D[2] */ - 17 1 /* MPP[17]: SD_D[3] */ - 18 1 /* MPP[18]: NF_IO[0] */ - 19 1 /* MPP[19]: NF_IO[1] */ - 20 5 /* MPP[20]: SATA1_AC */ - 21 5 >; /* MPP[21]: SATA0_AC */ - }; diff --git a/usr/src/boot/sys/boot/fdt/dts/mips/Makefile b/usr/src/boot/sys/boot/fdt/dts/mips/Makefile deleted file mode 100644 index 03d156d947..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/mips/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -DTS!=ls *.dts - -all: test-dts - -.include <bsd.init.mk> diff --git a/usr/src/boot/sys/boot/fdt/dts/mips/beri-netfpga.dts b/usr/src/boot/sys/boot/fdt/dts/mips/beri-netfpga.dts deleted file mode 100644 index f272f9cfa5..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/mips/beri-netfpga.dts +++ /dev/null @@ -1,158 +0,0 @@ -/*- - * Copyright (c) 2012-2013 Robert N. M. Watson - * Copyright (c) 2013 SRI International - * Copyright (c) 2013-2014 Bjoern A. Zeeb - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-11-C-0249) - * ("MRC2"), as part of the DARPA MRC research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/* - * Device names here have been largely made up on the spot, especially for the - * "compatible" strings, and might want to be revised. - */ - -/ { - model = "SRI/Cambridge Beri (NetFPGA)"; - compatible = "sri-cambridge,beri-netfpga"; - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <1>; - - /* - * Secondary CPUs all start disabled and use the - * spin-table enable method. cpu-release-addr must be - * specified for each cpu other than cpu@0. Values of - * cpu-release-addr grow down from 0x100000 (kernel). - */ - status = "disabled"; - enable-method = "spin-table"; - - cpu@0 { - device-type = "cpu"; - compatible = "sri-cambridge,beri"; - - reg = <0 1>; - status = "okay"; - }; - -/* - cpu@1 { - device-type = "cpu"; - compatible = "sri-cambridge,beri"; - - reg = <1 1>; - // XXX: should we need cached prefix? - cpu-release-addr = <0xffffffff 0x800fffe0>; - }; -*/ - }; - - memory { - device_type = "memory"; - reg = <0x0 0x0FFFFFFF>; // ~256M at 0x0 - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - #interrupt-cells = <1>; - - /* - * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so - * we use mips4k coprocessor 0 interrupt management directly. - */ - compatible = "simple-bus", "mips,mips4k"; - ranges = <>; - - beripic: beripic@7f804000 { - compatible = "sri-cambridge,beri-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x7f804000 0x400 - 0x7f806000 0x10 - 0x7f806080 0x10 - 0x7f806100 0x10>; - interrupts = <0 1 2 3 4>; - hard-interrupt-sources = <64>; - soft-interrupt-sources = <64>; - }; - - serial0: serial@7f000000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f000000 0x40>; -/* - interrupts = <0>; - interrupt-parent = <&beripic>; -*/ - }; - -/* - serial0: serial@7f002100 { - compatible = "ns16550"; - reg = <0x7f002100 0x20>; - reg-shift = <2>; - clock-frequency = <100000000>; - interrupts = <8>; - interrupt-parent = <&beripic>; - }; -*/ - - ethernet@7f005000 { - compatible = "netfpag10g,nf10bmac"; - // LOOP, TX, RX, INTR - reg = <0x7f005000 0x20 - 0x7f005020 0x30 - 0x7f005050 0x30 - 0x7f005100 0x10>; - // RX - interrupts = <1>; - interrupt-parent = <&beripic>; - }; - }; - - aliases { - serial0 = &serial0; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - bootargs = "-v"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/mips/beri-sim.dts b/usr/src/boot/sys/boot/fdt/dts/mips/beri-sim.dts deleted file mode 100644 index 5e0ab1976b..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/mips/beri-sim.dts +++ /dev/null @@ -1,156 +0,0 @@ -/*- - * Copyright (c) 2012-2013 Robert N. M. Watson - * Copyright (c) 2013 SRI International - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/* - * Device names here have been largely made up on the spot, especially for the - * "compatible" strings, and might want to be revised. - * - * For now, use 32-bit addressing as our Avalon bus is 32-bit. However, in - * the future, we should likely change to 64-bit. - */ - -/ { - model = "SRI/Cambridge BERI simulation"; - compatible = "sri-cambridge,beri-sim"; - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <1>; - - /* - * Secondary CPUs all start disabled and use the - * spin-table enable method. cpu-release-addr must be - * specified for each cpu other than cpu@0. Values of - * cpu-release-addr grow down from 0x100000 (kernel). - */ - status = "disabled"; - enable-method = "spin-table"; - - cpu@0 { - device-type = "cpu"; - compatible = "sri-cambridge,beri"; - - reg = <0 1>; - status = "okay"; - }; - -/* - cpu@1 { - device-type = "cpu"; - compatible = "sri-cambridge,beri"; - - reg = <1 1>; - // XXX: should we need cached prefix? - cpu-release-addr = <0xffffffff 0x800fffe0>; - }; -*/ - }; - - memory { - device_type = "memory"; - reg = <0x0 0x4000000>; // 64M at 0x0 - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - #interrupt-cells = <1>; - - /* - * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so - * we use mips4k coprocessor 0 interrupt management directly. - */ - compatible = "simple-bus", "mips,mips4k"; - ranges = <>; - - beripic0: beripic@7f804000 { - compatible = "sri-cambridge,beri-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x7f804000 0x400 - 0x7f806000 0x10 - 0x7f806080 0x10 - 0x7f806100 0x10>; - interrupts = <0 1 2 3 4>; - hard-interrupt-sources = <64>; - soft-interrupt-sources = <64>; - }; - - serial@7f000000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f000000 0x40>; - interrupts = <0>; - interrupt-parent = <&beripic0>; - }; - - serial@7f001000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f001000 0x40>; - }; - - serial@7f002000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f002000 0x40>; - }; - - virtio_mmio_platform0: virtio_mmio_platform@0 { - compatible = "beri,virtio_mmio_platform"; - interrupts = <1>; - interrupt-parent = <&beripic0>; - }; - - virtio_block@7f020000 { - compatible = "virtio,mmio"; - reg = <0x7f020000 0x1000>; - platform = <&virtio_mmio_platform0>; - }; - - sdcard@7f008000 { - compatible = "altera,sdcard_11_2011"; - reg = <0x7f008000 0x400>; - }; - - avgen@0x7f00a000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f00a000 0x14>; - sri-cambridge,width = <4>; - sri-cambridge,fileio = "rw"; - sri-cambridge,devname = "berirom"; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/mips/beripad-de4.dts b/usr/src/boot/sys/boot/fdt/dts/mips/beripad-de4.dts deleted file mode 100644 index 287c2306d1..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/mips/beripad-de4.dts +++ /dev/null @@ -1,258 +0,0 @@ -/*- - * Copyright (c) 2012-2013 Robert N. M. Watson - * Copyright (c) 2013 SRI International - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/* - * Device names here have been largely made up on the spot, especially for the - * "compatible" strings, and might want to be revised. - * - * For now, use 32-bit addressing as our Avalon bus is 32-bit. However, in - * the future, we should likely change to 64-bit. - */ - -/ { - model = "SRI/Cambridge BeriPad (DE4)"; - compatible = "sri-cambridge,beripad-de4"; - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <1>; - - /* - * Secondary CPUs all start disabled and use the - * spin-table enable method. cpu-release-addr must be - * specified for each cpu other than cpu@0. Values of - * cpu-release-addr grow down from 0x100000 (kernel). - */ - status = "disabled"; - enable-method = "spin-table"; - - cpu@0 { - device-type = "cpu"; - compatible = "sri-cambridge,beri"; - - reg = <0 1>; - status = "okay"; - }; - -/* - cpu@1 { - device-type = "cpu"; - compatible = "sri-cambridge,beri"; - - reg = <1 1>; - // XXX: should we need cached prefix? - cpu-release-addr = <0xffffffff 0x800fffe0>; - }; -*/ - }; - - memory { - device_type = "memory"; - reg = <0x0 0x40000000>; // 1G at 0x0 - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - #interrupt-cells = <1>; - - /* - * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so - * we use mips4k coprocessor 0 interrupt management directly. - */ - compatible = "simple-bus", "mips,mips4k"; - ranges = <>; - - beripic0: beripic@7f804000 { - compatible = "sri-cambridge,beri-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x7f804000 0x400 - 0x7f806000 0x10 - 0x7f806080 0x10 - 0x7f806100 0x10>; - interrupts = <0 1 2 3 4>; - hard-interrupt-sources = <64>; - soft-interrupt-sources = <64>; - }; - - serial@7f002100 { - compatible = "ns16550"; - reg = <0x7f002100 0x20>; - reg-shift = <2>; - clock-frequency = <50000000>; - interrupts = <6>; - interrupt-parent = <&beripic0>; - }; - - serial@7f000000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f000000 0x40>; - interrupts = <0>; - interrupt-parent = <&beripic0>; - }; - - serial@7f001000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f001000 0x40>; - }; - - serial@7f002000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f002000 0x40>; - }; - - sdcard@7f008000 { - compatible = "altera,sdcard_11_2011"; - reg = <0x7f008000 0x400>; - }; - - led@7f006000 { - compatible = "sri-cambridge,de4led"; - reg = <0x7f006000 0x1>; - }; - - /* - * XXX-BZ keep flash before ethernet so that atse can read the - * Ethernet addresses for now. - */ - flash@74000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x74000000 0x4000000>; - - /* Board configuration */ - partition@0 { - reg = <0x0 0x20000>; - label = "config"; - }; - - /* Power up FPGA image */ - partition@20000 { - reg = <0x20000 0xc00000>; - label = "fpga0"; - }; - - /* Secondary FPGA image (on RE_CONFIGn button) */ - partition@C20000 { - reg = <0xc20000 0xc00000>; - label = "fpga1"; - }; - - /* Space for operating system use */ - partition@1820000 { - reg = <0x1820000 0x027c0000>; - label = "os"; - }; - - /* Second stage bootloader */ - parition@3fe0000 { - reg = <0x3fe0000 0x20000>; - label = "boot"; - }; - }; - - ethernet@7f007000 { - compatible = "altera,atse"; - // MAC, RX+RXC, TX+TXC. - reg = <0x7f007000 0x400 - 0x7f007500 0x8 - 0x7f007520 0x20 - 0x7f007400 0x8 - 0x7f007420 0x20>; - // RX, TX - interrupts = <1 2>; - interrupt-parent = <&beripic0>; - }; - - ethernet@7f005000 { - compatible = "altera,atse"; - // MAC, RX+RXC, TX+TXC. - reg = <0x7f005000 0x400 - 0x7f005500 0x8 - 0x7f005520 0x20 - 0x7f005400 0x8 - 0x7f005420 0x20>; - // RX, TX - interrupts = <11 12>; - interrupt-parent = <&beripic0>; - }; - - touchscreen@70400000 { - compatible = "sri-cambridge,mtl"; - panel-size = < 800 480 >; - reg = <0x70400000 0x1000 - 0x70000000 0x177000 - 0x70177000 0x2000>; - }; - - usb@0x7f100000 { - compatible = "nxp,usb-isp1761"; - reg = <0x7f100000 0x40000 - 0x7f140000 0x4>; - // IRQ 4 is DC, IRQ 5 is HC. - interrupts = <4 5>; - interrupt-parent = <&beripic0>; - }; - - avgen@0x7f009000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f009000 0x2>; - sri-cambridge,width = <1>; - sri-cambridge,fileio = "r"; - sri-cambridge,devname = "de4bsw"; - }; - - avgen@0x7f00a000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f00a000 0x14>; - sri-cambridge,width = <4>; - sri-cambridge,fileio = "rw"; - sri-cambridge,devname = "berirom"; - }; - - avgen@0x7f00c000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f00c000 0x8>; - sri-cambridge,width = <4>; - sri-cambridge,fileio = "rw"; - sri-cambridge,devname = "de4tempfan"; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/mips/beripad-sockit.dts b/usr/src/boot/sys/boot/fdt/dts/mips/beripad-sockit.dts deleted file mode 100644 index ad9e4acfbe..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/mips/beripad-sockit.dts +++ /dev/null @@ -1,219 +0,0 @@ -/*- - * Copyright (c) 2012-2013 Robert N. M. Watson - * Copyright (c) 2013-2014 SRI International - * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/* - * Device names here have been largely made up on the spot, especially for the - * "compatible" strings, and might want to be revised. - */ - -/ { - model = "SRI/Cambridge BeriPad (SoCKit)"; - compatible = "sri-cambridge,beripad-sockit"; - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <1>; - - /* - * Secondary CPUs all start disabled and use the - * spin-table enable method. cpu-release-addr must be - * specified for each cpu other than cpu@0. Values of - * cpu-release-addr grow down from 0x100000 (kernel). - */ - status = "disabled"; - enable-method = "spin-table"; - - cpu@0 { - device-type = "cpu"; - compatible = "sri-cambridge,beri"; - - reg = <0 1>; - status = "okay"; - }; - -/* - cpu@1 { - device-type = "cpu"; - compatible = "sri-cambridge,beri"; - - reg = <1 1>; - // XXX: should we need cached prefix? - cpu-release-addr = <0xffffffff 0x800fffe0>; - }; -*/ - }; - - memory { - device_type = "memory"; - reg = <0x0 0x10000000>; /* 256MB at 0x0 */ - }; - - soc { - #address-cells = <2>; - #size-cells = <2>; - #interrupt-cells = <1>; - - /* - * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so - * we use mips4k coprocessor 0 interrupt management directly. - */ - compatible = "simple-bus", "mips,mips4k"; - /* ranges = <>; */ - - beripic0: beripic@7f804000 { - compatible = "sri-cambridge,beri-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x0 0x7f804000 0x0 0x400 - 0x0 0x7f806000 0x0 0x10 - 0x0 0x7f806080 0x0 0x10 - 0x0 0x7f806100 0x0 0x10>; - interrupts = <0 1 2 3 4>; - hard-interrupt-sources = <64>; - soft-interrupt-sources = <64>; - }; - - pio0: pio@7f020000 { - compatible = "altr,pio"; - reg = <0x0 0x7f020000 0x0 0x1000>; /* send */ - interrupts = <4>; /* not used */ - interrupt-parent = <&beripic0>; - }; - - pio1: pio@7f021000 { - compatible = "altr,pio"; - reg = <0x0 0x7f021000 0x0 0x1000>; /* recv */ - interrupts = <10>; - interrupt-parent = <&beripic0>; - }; - - pio2: pio@7f022000 { - compatible = "altr,pio"; - reg = <0x0 0x7f022000 0x0 0x1000>; /* send */ - interrupts = <5>; /* not used */ - interrupt-parent = <&beripic0>; - }; - - pio3: pio@7f023000 { - compatible = "altr,pio"; - reg = <0x0 0x7f023000 0x0 0x1000>; /* recv */ - interrupts = <11>; - interrupt-parent = <&beripic0>; - }; - - virtio_mmio_platform0: virtio_mmio_platform@0 { - compatible = "beri,virtio_mmio_platform"; - pio-send = <&pio0>; - pio-recv = <&pio1>; - }; - - virtio_mmio_platform1: virtio_mmio_platform@1 { - compatible = "beri,virtio_mmio_platform"; - pio-send = <&pio2>; - pio-recv = <&pio3>; - }; - - virtio_block@200001000 { - compatible = "virtio,mmio"; - reg = <0x2 0x1000 0x0 0x1000>; - platform = <&virtio_mmio_platform0>; - status = "okay"; - }; - - virtio_net@200002000 { - compatible = "virtio,mmio"; - reg = <0x2 0x2000 0x0 0x1000>; - platform = <&virtio_mmio_platform1>; - status = "okay"; - }; - - serial@7f000000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x0 0x7f000000 0x0 0x40>; - interrupts = <0>; - interrupt-parent = <&beripic0>; - }; - -/* - serial@7f001000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f001000 0x40>; - }; - - serial@7f002000 { - compatible = "altera,jtag_uart-11_0"; - reg = <0x7f002000 0x40>; - }; -*/ - -/* - led@7f006000 { - compatible = "sri-cambridge,de4led"; - reg = <0x7f006000 0x1>; - }; -*/ - -/* - avgen@0x7f009000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f009000 0x2>; - sri-cambridge,width = <1>; - sri-cambridge,fileio = "r"; - sri-cambridge,devname = "de4bsw"; - }; -*/ - -/* - berirom@0x7f00a000 { - compatible = "sri-cambridge,berirom"; - reg = <0x7f00a000 0x1000>; - }; -*/ - -/* - avgen@0x7f00c000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f00c000 0x8>; - sri-cambridge,width = <4>; - sri-cambridge,fileio = "rw"; - sri-cambridge,devname = "de4tempfan"; - }; -*/ - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/mips/xlp-basic.dts b/usr/src/boot/sys/boot/fdt/dts/mips/xlp-basic.dts deleted file mode 100644 index 19f0801768..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/mips/xlp-basic.dts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Netlogic Microsystems XLP8xx Device Tree Source. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "netl,XLP8XX"; - compatible = "XLP8XX"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - serial0 = &serial0; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges = <0x0 0x18000000 0x04000000>; - bus-frequency = <0>; - - pic: pic@4000 { - compatible = "netlogic,xlp-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x4000 0x200>; - }; - - serial0: serial@30100 { - compatible = "ns16550"; - reg = <0x30100 0x200>; - reg-shift = <2>; - current-speed = <115200>; - clock-frequency = <133000000>; - interrupt-parent = <&pic>; - interrupts = <17>; - }; - - pci0: pci@18000000 { - compatible = "netlogic,xlp-pci", "pci"; - reg = <0xd0000000 0x10000000>; - }; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - cpumask = <0xffffffff>; - bootargs = "-v"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/Makefile b/usr/src/boot/sys/boot/fdt/dts/powerpc/Makefile deleted file mode 100644 index 03d156d947..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -DTS!=ls *.dts - -all: test-dts - -.include <bsd.init.mk> diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/mpc8555cds.dts b/usr/src/boot/sys/boot/fdt/dts/powerpc/mpc8555cds.dts deleted file mode 100644 index 34991baaef..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/mpc8555cds.dts +++ /dev/null @@ -1,443 +0,0 @@ -/* - * MPC8555 CDS Device Tree Source - * - * Copyright 2006, 2008 Freescale Semiconductor Inc. All rights reserved - * - * Neither the name of Freescale Semiconductor, Inc nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Freescale hereby publishes it under the following licenses: - * - * BSD License - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * GNU General Public License, version 2 - * - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * You may select the license of your choice. - *------------------------------------------------------------------ - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "MPC8555CDS"; - compatible = "MPC8555CDS", "MPC85xxCDS"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - ethernet0 = &enet0; - ethernet1 = &enet1; - serial0 = &serial0; - serial1 = &serial1; - pci0 = &pci0; - pci1 = &pci1; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - PowerPC,8555@0 { - device_type = "cpu"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; // 33 MHz, from uboot - bus-frequency = <0>; // 166 MHz - clock-frequency = <0>; // 825 MHz, from uboot - next-level-cache = <&L2>; - }; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x10000000>; // 256M at 0x0 - }; - - localbus@e0005000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "fsl,lbc", "fsl,elbc"; - reg = <0xe0005000 0x1000>; - interrupts = <19 2>; - interrupt-parent = <&mpic>; - - ranges = <0x0 0x0 0xff800000 0x00800000 - 0x1 0x0 0xff000000 0x00800000 - 0x2 0x0 0xf8000000 0x00008000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x00800000>; - bank-width = <2>; - device-width = <1>; - }; - - nor@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x1 0x0 0x00800000>; - bank-width = <2>; - device-width = <1>; - }; - - rtc@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "dallas,ds1553"; - reg = <0x2 0x0 0x00008000>; - bank-width = <1>; - device-width = <1>; - }; - }; - - soc8555@e0000000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "soc"; - compatible = "simple-bus"; - ranges = <0x0 0xe0000000 0x100000>; - bus-frequency = <0>; - - ecm-law@0 { - compatible = "fsl,ecm-law"; - reg = <0x0 0x1000>; - fsl,num-laws = <8>; - }; - - ecm@1000 { - compatible = "fsl,mpc8555-ecm", "fsl,ecm"; - reg = <0x1000 0x1000>; - interrupts = <17 2>; - interrupt-parent = <&mpic>; - }; - - memory-controller@2000 { - compatible = "fsl,8555-memory-controller"; - reg = <0x2000 0x1000>; - interrupt-parent = <&mpic>; - interrupts = <18 2>; - }; - - L2: l2-cache-controller@20000 { - compatible = "fsl,8555-l2-cache-controller"; - reg = <0x20000 0x1000>; - cache-line-size = <32>; // 32 bytes - cache-size = <0x40000>; // L2, 256K - interrupt-parent = <&mpic>; - interrupts = <16 2>; - }; - - i2c@3000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <0>; - compatible = "fsl-i2c"; - reg = <0x3000 0x100>; - interrupts = <43 2>; - interrupt-parent = <&mpic>; - dfsrr; - }; - - dma@21300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,mpc8555-dma", "fsl,eloplus-dma"; - reg = <0x21300 0x4>; - ranges = <0x0 0x21100 0x200>; - cell-index = <0>; - dma-channel@0 { - compatible = "fsl,mpc8555-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupt-parent = <&mpic>; - interrupts = <20 2>; - }; - dma-channel@80 { - compatible = "fsl,mpc8555-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupt-parent = <&mpic>; - interrupts = <21 2>; - }; - dma-channel@100 { - compatible = "fsl,mpc8555-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupt-parent = <&mpic>; - interrupts = <22 2>; - }; - dma-channel@180 { - compatible = "fsl,mpc8555-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupt-parent = <&mpic>; - interrupts = <23 2>; - }; - }; - - enet0: ethernet@24000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <0>; - device_type = "network"; - model = "TSEC"; - compatible = "gianfar"; - reg = <0x24000 0x1000>; - ranges = <0x0 0x24000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <29 2 30 2 34 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi0>; - phy-handle = <&phy0>; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-mdio"; - reg = <0x520 0x20>; - - phy0: ethernet-phy@0 { - interrupt-parent = <&mpic>; - interrupts = <5 1>; - reg = <0x0>; - device_type = "ethernet-phy"; - }; - phy1: ethernet-phy@1 { - interrupt-parent = <&mpic>; - interrupts = <5 1>; - reg = <0x1>; - device_type = "ethernet-phy"; - }; - tbi0: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - enet1: ethernet@25000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <1>; - device_type = "network"; - model = "TSEC"; - compatible = "gianfar"; - reg = <0x25000 0x1000>; - ranges = <0x0 0x25000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <35 2 36 2 40 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi1>; - phy-handle = <&phy1>; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-tbi"; - reg = <0x520 0x20>; - - tbi1: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - serial0: serial@4500 { - cell-index = <0>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x4500 0x100>; // reg base, size - clock-frequency = <0>; // should we fill in in uboot? - interrupts = <42 2>; - interrupt-parent = <&mpic>; - }; - - serial1: serial@4600 { - cell-index = <1>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x4600 0x100>; // reg base, size - clock-frequency = <0>; // should we fill in in uboot? - interrupts = <42 2>; - interrupt-parent = <&mpic>; - }; - - crypto@30000 { - compatible = "fsl,sec2.0"; - reg = <0x30000 0x10000>; - interrupts = <45 2>; - interrupt-parent = <&mpic>; - fsl,num-channels = <4>; - fsl,channel-fifo-len = <24>; - fsl,exec-units-mask = <0x7e>; - fsl,descriptor-types-mask = <0x01010ebf>; - }; - - mpic: pic@40000 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <2>; - reg = <0x40000 0x40000>; - compatible = "chrp,open-pic"; - device_type = "open-pic"; - }; - - cpm@80000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,mpc8555-cpm", "fsl,cpm2"; - reg = <0x80000 0x20000>; - interrupts = <46 2>; - interrupt-parent = <&mpic>; - }; - }; - - pci0: pci@e0008000 { - interrupt-map-mask = <0x1f800 0x0 0x0 0x7>; - interrupt-map = < - - /* IDSEL 0x10 */ - 0x8000 0x0 0x0 0x1 &mpic 0x0 0x1 - 0x8000 0x0 0x0 0x2 &mpic 0x1 0x1 - 0x8000 0x0 0x0 0x3 &mpic 0x2 0x1 - 0x8000 0x0 0x0 0x4 &mpic 0x3 0x1 - - /* IDSEL 0x11 */ - 0x8800 0x0 0x0 0x1 &mpic 0x0 0x1 - 0x8800 0x0 0x0 0x2 &mpic 0x1 0x1 - 0x8800 0x0 0x0 0x3 &mpic 0x2 0x1 - 0x8800 0x0 0x0 0x4 &mpic 0x3 0x1 - - /* IDSEL 0x12 (Slot 1) */ - 0x9000 0x0 0x0 0x1 &mpic 0x0 0x1 - 0x9000 0x0 0x0 0x2 &mpic 0x1 0x1 - 0x9000 0x0 0x0 0x3 &mpic 0x2 0x1 - 0x9000 0x0 0x0 0x4 &mpic 0x3 0x1 - - /* IDSEL 0x13 (Slot 2) */ - 0x9800 0x0 0x0 0x1 &mpic 0x1 0x1 - 0x9800 0x0 0x0 0x2 &mpic 0x2 0x1 - 0x9800 0x0 0x0 0x3 &mpic 0x3 0x1 - 0x9800 0x0 0x0 0x4 &mpic 0x0 0x1 - - /* IDSEL 0x14 (Slot 3) */ - 0xa000 0x0 0x0 0x1 &mpic 0x2 0x1 - 0xa000 0x0 0x0 0x2 &mpic 0x3 0x1 - 0xa000 0x0 0x0 0x3 &mpic 0x0 0x1 - 0xa000 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x15 (Slot 4) */ - 0xa800 0x0 0x0 0x1 &mpic 0x3 0x1 - 0xa800 0x0 0x0 0x2 &mpic 0x0 0x1 - 0xa800 0x0 0x0 0x3 &mpic 0x1 0x1 - 0xa800 0x0 0x0 0x4 &mpic 0x2 0x1 - - /* Bus 1 (Tundra Bridge) */ - /* IDSEL 0x12 (ISA bridge) */ - 0x19000 0x0 0x0 0x1 &mpic 0x0 0x1 - 0x19000 0x0 0x0 0x2 &mpic 0x1 0x1 - 0x19000 0x0 0x0 0x3 &mpic 0x2 0x1 - 0x19000 0x0 0x0 0x4 &mpic 0x3 0x1>; - interrupt-parent = <&mpic>; - interrupts = <24 2>; - bus-range = <0 0>; - ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x10000000 - 0x1000000 0x0 0x0 0xfee00000 0x0 0x00010000>; - clock-frequency = <66666666>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0xe0008000 0x1000>; - compatible = "fsl,mpc8540-pci"; - device_type = "pci"; - - i8259@19000 { - interrupt-controller; - device_type = "interrupt-controller"; - reg = <0x19000 0x0 0x0 0x0 0x1>; - #address-cells = <0>; - #interrupt-cells = <2>; - compatible = "chrp,iic"; - interrupts = <1>; - interrupt-parent = <&pci0>; - }; - }; - - pci1: pci@e0009000 { - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - - /* IDSEL 0x15 */ - 0xa800 0x0 0x0 0x1 &mpic 0xb 0x1 - 0xa800 0x0 0x0 0x2 &mpic 0xb 0x1 - 0xa800 0x0 0x0 0x3 &mpic 0xb 0x1 - 0xa800 0x0 0x0 0x4 &mpic 0xb 0x1>; - interrupt-parent = <&mpic>; - interrupts = <25 2>; - bus-range = <0 0>; - ranges = <0x2000000 0x0 0x90000000 0x90000000 0x0 0x10000000 - 0x1000000 0x0 0x0 0xfee10000 0x0 0x00010000>; - clock-frequency = <66666666>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0xe0009000 0x1000>; - compatible = "fsl,mpc8540-pci"; - device_type = "pci"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/mpc8572ds.dts b/usr/src/boot/sys/boot/fdt/dts/powerpc/mpc8572ds.dts deleted file mode 100644 index 67f0d66f86..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/mpc8572ds.dts +++ /dev/null @@ -1,895 +0,0 @@ -/* - * MPC8572 DS Device Tree Source - * - * Copyright 2007-2009 Freescale Semiconductor Inc. All rights reserved - * - * Neither the name of Freescale Semiconductor, Inc nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Freescale hereby publishes it under the following licenses: - * - * BSD License - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * GNU General Public License, version 2 - * - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * You may select the license of your choice. - *------------------------------------------------------------------ - * - * $FreeBSD$ - */ - -/dts-v1/; -/ { - model = "fsl,MPC8572DS"; - compatible = "fsl,MPC8572DS"; - #address-cells = <2>; - #size-cells = <2>; - - aliases { - ethernet0 = &enet0; - ethernet1 = &enet1; - ethernet2 = &enet2; - ethernet3 = &enet3; - serial0 = &serial0; - serial1 = &serial1; - pci0 = &pci0; - pci1 = &pci1; - pci2 = &pci2; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - PowerPC,8572@0 { - device_type = "cpu"; - reg = <0x0>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - next-level-cache = <&L2>; - }; - - PowerPC,8572@1 { - device_type = "cpu"; - reg = <0x1>; - d-cache-line-size = <32>; // 32 bytes - i-cache-line-size = <32>; // 32 bytes - d-cache-size = <0x8000>; // L1, 32K - i-cache-size = <0x8000>; // L1, 32K - timebase-frequency = <0>; - bus-frequency = <0>; - clock-frequency = <0>; - next-level-cache = <&L2>; - }; - }; - - memory { - device_type = "memory"; - }; - - localbus@ffe05000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "fsl,mpc8572-elbc", "fsl,elbc", "simple-bus"; - reg = <0 0xffe05000 0 0x1000>; - interrupts = <19 2>; - interrupt-parent = <&mpic>; - - ranges = <0x0 0x0 0x0 0xe8000000 0x08000000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x8000000>; - bank-width = <2>; - device-width = <1>; - - partition@0 { - reg = <0x0 0x03000000>; - label = "ramdisk-nor"; - read-only; - }; - - partition@3000000 { - reg = <0x03000000 0x00e00000>; - label = "diagnostic-nor"; - read-only; - }; - - partition@3e00000 { - reg = <0x03e00000 0x00200000>; - label = "dink-nor"; - read-only; - }; - - partition@4000000 { - reg = <0x04000000 0x00400000>; - label = "kernel-nor"; - read-only; - }; - - partition@4400000 { - reg = <0x04400000 0x03b00000>; - label = "jffs2-nor"; - }; - - partition@7f00000 { - reg = <0x07f00000 0x00080000>; - label = "dtb-nor"; - read-only; - }; - - partition@7f80000 { - reg = <0x07f80000 0x00080000>; - label = "u-boot-nor"; - read-only; - }; - }; - - nand@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,mpc8572-fcm-nand", - "fsl,elbc-fcm-nand"; - reg = <0x2 0x0 0x40000>; - - partition@0 { - reg = <0x0 0x02000000>; - label = "u-boot-nand"; - read-only; - }; - - partition@2000000 { - reg = <0x02000000 0x10000000>; - label = "jffs2-nand"; - }; - - partition@12000000 { - reg = <0x12000000 0x08000000>; - label = "ramdisk-nand"; - read-only; - }; - - partition@1a000000 { - reg = <0x1a000000 0x04000000>; - label = "kernel-nand"; - }; - - partition@1e000000 { - reg = <0x1e000000 0x01000000>; - label = "dtb-nand"; - read-only; - }; - - partition@1f000000 { - reg = <0x1f000000 0x21000000>; - label = "reserved-nand"; - }; - }; - - nand@4,0 { - compatible = "fsl,mpc8572-fcm-nand", - "fsl,elbc-fcm-nand"; - reg = <0x4 0x0 0x40000>; - }; - - nand@5,0 { - compatible = "fsl,mpc8572-fcm-nand", - "fsl,elbc-fcm-nand"; - reg = <0x5 0x0 0x40000>; - }; - - nand@6,0 { - compatible = "fsl,mpc8572-fcm-nand", - "fsl,elbc-fcm-nand"; - reg = <0x6 0x0 0x40000>; - }; - }; - - soc8572@ffe00000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "soc"; - compatible = "simple-bus"; - ranges = <0x0 0 0xffe00000 0x100000>; - bus-frequency = <0>; // Filled out by uboot. - - ecm-law@0 { - compatible = "fsl,ecm-law"; - reg = <0x0 0x1000>; - fsl,num-laws = <12>; - }; - - ecm@1000 { - compatible = "fsl,mpc8572-ecm", "fsl,ecm"; - reg = <0x1000 0x1000>; - interrupts = <17 2>; - interrupt-parent = <&mpic>; - }; - - memory-controller@2000 { - compatible = "fsl,mpc8572-memory-controller"; - reg = <0x2000 0x1000>; - interrupt-parent = <&mpic>; - interrupts = <18 2>; - }; - - memory-controller@6000 { - compatible = "fsl,mpc8572-memory-controller"; - reg = <0x6000 0x1000>; - interrupt-parent = <&mpic>; - interrupts = <18 2>; - }; - - L2: l2-cache-controller@20000 { - compatible = "fsl,mpc8572-l2-cache-controller"; - reg = <0x20000 0x1000>; - cache-line-size = <32>; // 32 bytes - cache-size = <0x100000>; // L2, 1M - interrupt-parent = <&mpic>; - interrupts = <16 2>; - }; - - i2c@3000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <0>; - compatible = "fsl-i2c"; - reg = <0x3000 0x100>; - interrupts = <43 2>; - interrupt-parent = <&mpic>; - dfsrr; - }; - - i2c@3100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <1>; - compatible = "fsl-i2c"; - reg = <0x3100 0x100>; - interrupts = <43 2>; - interrupt-parent = <&mpic>; - dfsrr; - }; - - dma@c300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma"; - reg = <0xc300 0x4>; - ranges = <0x0 0xc100 0x200>; - cell-index = <1>; - dma-channel@0 { - compatible = "fsl,mpc8572-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupt-parent = <&mpic>; - interrupts = <76 2>; - }; - dma-channel@80 { - compatible = "fsl,mpc8572-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupt-parent = <&mpic>; - interrupts = <77 2>; - }; - dma-channel@100 { - compatible = "fsl,mpc8572-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupt-parent = <&mpic>; - interrupts = <78 2>; - }; - dma-channel@180 { - compatible = "fsl,mpc8572-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupt-parent = <&mpic>; - interrupts = <79 2>; - }; - }; - - dma@21300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma"; - reg = <0x21300 0x4>; - ranges = <0x0 0x21100 0x200>; - cell-index = <0>; - dma-channel@0 { - compatible = "fsl,mpc8572-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupt-parent = <&mpic>; - interrupts = <20 2>; - }; - dma-channel@80 { - compatible = "fsl,mpc8572-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupt-parent = <&mpic>; - interrupts = <21 2>; - }; - dma-channel@100 { - compatible = "fsl,mpc8572-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupt-parent = <&mpic>; - interrupts = <22 2>; - }; - dma-channel@180 { - compatible = "fsl,mpc8572-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupt-parent = <&mpic>; - interrupts = <23 2>; - }; - }; - - ptp_timer: ptimer@24e00 { - compatible = "fsl,gianfar-ptp-timer"; - reg = <0x24e00 0xb0>; - }; - - enet0: ethernet@24000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <0>; - device_type = "network"; - model = "eTSEC"; - compatible = "gianfar"; - reg = <0x24000 0x1000>; - ranges = <0x0 0x24000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <29 2 30 2 34 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi0>; - phy-handle = <&phy0>; - ptimer-handle = < &ptp_timer >; - phy-connection-type = "rgmii-id"; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-mdio"; - reg = <0x520 0x20>; - - phy0: ethernet-phy@0 { - interrupt-parent = <&mpic>; - interrupts = <10 1>; - reg = <0x0>; - }; - phy1: ethernet-phy@1 { - interrupt-parent = <&mpic>; - interrupts = <10 1>; - reg = <0x1>; - }; - phy2: ethernet-phy@2 { - interrupt-parent = <&mpic>; - interrupts = <10 1>; - reg = <0x2>; - }; - phy3: ethernet-phy@3 { - interrupt-parent = <&mpic>; - interrupts = <10 1>; - reg = <0x3>; - }; - - tbi0: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - enet1: ethernet@25000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <1>; - device_type = "network"; - model = "eTSEC"; - compatible = "gianfar"; - reg = <0x25000 0x1000>; - ranges = <0x0 0x25000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <35 2 36 2 40 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi1>; - phy-handle = <&phy1>; - ptimer-handle = < &ptp_timer >; - phy-connection-type = "rgmii-id"; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-tbi"; - reg = <0x520 0x20>; - - tbi1: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - enet2: ethernet@26000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <2>; - device_type = "network"; - model = "eTSEC"; - compatible = "gianfar"; - reg = <0x26000 0x1000>; - ranges = <0x0 0x26000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <31 2 32 2 33 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi2>; - phy-handle = <&phy2>; - ptimer-handle = < &ptp_timer >; - phy-connection-type = "rgmii-id"; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-tbi"; - reg = <0x520 0x20>; - - tbi2: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - enet3: ethernet@27000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <3>; - device_type = "network"; - model = "eTSEC"; - compatible = "gianfar"; - reg = <0x27000 0x1000>; - ranges = <0x0 0x27000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <37 2 38 2 39 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi3>; - phy-handle = <&phy3>; - phy-connection-type = "rgmii-id"; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-tbi"; - reg = <0x520 0x20>; - - tbi3: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - serial0: serial@4500 { - cell-index = <0>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x4500 0x100>; - clock-frequency = <0>; - interrupts = <42 2>; - interrupt-parent = <&mpic>; - }; - - serial1: serial@4600 { - cell-index = <1>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x4600 0x100>; - clock-frequency = <0>; - interrupts = <42 2>; - interrupt-parent = <&mpic>; - }; - - global-utilities@e0000 { //global utilities block - compatible = "fsl,mpc8572-guts"; - reg = <0xe0000 0x1000>; - fsl,has-rstcr; - }; - - power@e0070{ - compatible = "fsl,mpc8548-pmc"; - reg = <0xe0070 0x14>; - }; - - timer@41100 { - compatible = "fsl,mpic-global-timer"; - reg = <0x41100 0x204>; - interrupts = <0xf7 0x2>; - interrupt-parent = <&mpic>; - }; - - msi@41600 { - compatible = "fsl,mpc8572-msi", "fsl,mpic-msi"; - reg = <0x41600 0x80>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe0 0 - 0xe1 0 - 0xe2 0 - 0xe3 0 - 0xe4 0 - 0xe5 0 - 0xe6 0 - 0xe7 0>; - interrupt-parent = <&mpic>; - }; - - crypto@30000 { - compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2", - "fsl,sec2.1", "fsl,sec2.0"; - reg = <0x30000 0x10000>; - interrupts = <45 2 58 2>; - interrupt-parent = <&mpic>; - fsl,num-channels = <4>; - fsl,channel-fifo-len = <24>; - fsl,exec-units-mask = <0x9fe>; - fsl,descriptor-types-mask = <0x3ab0ebf>; - }; - - /* PME (pattern-matcher) */ - pme@10000 { - device_type = "pme"; - compatible = "pme8572"; - reg = <0x10000 0x5000>; - interrupts = <0x39 0x2 0x40 0x2 0x41 0x2 0x42 0x2 0x43 0x2>; - interrupt-parent = <&mpic>; - }; - - mpic: pic@40000 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <2>; - reg = <0x40000 0x40000>; - compatible = "chrp,open-pic"; - device_type = "open-pic"; - }; - }; - - pci0: pcie@ffe08000 { - compatible = "fsl,mpc8548-pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0 0xffe08000 0 0x1000>; - bus-range = <0 255>; - ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x10000000 - 0x1000000 0x0 0x00000000 0 0xfee20000 0x0 0x00010000>; - clock-frequency = <33333333>; - interrupt-parent = <&mpic>; - interrupts = <24 2>; - interrupt-map-mask = <0xff00 0x0 0x0 0x7>; - interrupt-map = < - /* IDSEL 0x11 func 0 - PCI slot 1 */ - 0x8800 0x0 0x0 0x1 &mpic 0x2 0x1 - 0x8800 0x0 0x0 0x2 &mpic 0x3 0x1 - 0x8800 0x0 0x0 0x3 &mpic 0x4 0x1 - 0x8800 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x11 func 1 - PCI slot 1 */ - 0x8900 0x0 0x0 0x1 &mpic 0x2 0x1 - 0x8900 0x0 0x0 0x2 &mpic 0x3 0x1 - 0x8900 0x0 0x0 0x3 &mpic 0x4 0x1 - 0x8900 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x11 func 2 - PCI slot 1 */ - 0x8a00 0x0 0x0 0x1 &mpic 0x2 0x1 - 0x8a00 0x0 0x0 0x2 &mpic 0x3 0x1 - 0x8a00 0x0 0x0 0x3 &mpic 0x4 0x1 - 0x8a00 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x11 func 3 - PCI slot 1 */ - 0x8b00 0x0 0x0 0x1 &mpic 0x2 0x1 - 0x8b00 0x0 0x0 0x2 &mpic 0x3 0x1 - 0x8b00 0x0 0x0 0x3 &mpic 0x4 0x1 - 0x8b00 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x11 func 4 - PCI slot 1 */ - 0x8c00 0x0 0x0 0x1 &mpic 0x2 0x1 - 0x8c00 0x0 0x0 0x2 &mpic 0x3 0x1 - 0x8c00 0x0 0x0 0x3 &mpic 0x4 0x1 - 0x8c00 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x11 func 5 - PCI slot 1 */ - 0x8d00 0x0 0x0 0x1 &mpic 0x2 0x1 - 0x8d00 0x0 0x0 0x2 &mpic 0x3 0x1 - 0x8d00 0x0 0x0 0x3 &mpic 0x4 0x1 - 0x8d00 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x11 func 6 - PCI slot 1 */ - 0x8e00 0x0 0x0 0x1 &mpic 0x2 0x1 - 0x8e00 0x0 0x0 0x2 &mpic 0x3 0x1 - 0x8e00 0x0 0x0 0x3 &mpic 0x4 0x1 - 0x8e00 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x11 func 7 - PCI slot 1 */ - 0x8f00 0x0 0x0 0x1 &mpic 0x2 0x1 - 0x8f00 0x0 0x0 0x2 &mpic 0x3 0x1 - 0x8f00 0x0 0x0 0x3 &mpic 0x4 0x1 - 0x8f00 0x0 0x0 0x4 &mpic 0x1 0x1 - - /* IDSEL 0x12 func 0 - PCI slot 2 */ - 0x9000 0x0 0x0 0x1 &mpic 0x3 0x1 - 0x9000 0x0 0x0 0x2 &mpic 0x4 0x1 - 0x9000 0x0 0x0 0x3 &mpic 0x1 0x1 - 0x9000 0x0 0x0 0x4 &mpic 0x2 0x1 - - /* IDSEL 0x12 func 1 - PCI slot 2 */ - 0x9100 0x0 0x0 0x1 &mpic 0x3 0x1 - 0x9100 0x0 0x0 0x2 &mpic 0x4 0x1 - 0x9100 0x0 0x0 0x3 &mpic 0x1 0x1 - 0x9100 0x0 0x0 0x4 &mpic 0x2 0x1 - - /* IDSEL 0x12 func 2 - PCI slot 2 */ - 0x9200 0x0 0x0 0x1 &mpic 0x3 0x1 - 0x9200 0x0 0x0 0x2 &mpic 0x4 0x1 - 0x9200 0x0 0x0 0x3 &mpic 0x1 0x1 - 0x9200 0x0 0x0 0x4 &mpic 0x2 0x1 - - /* IDSEL 0x12 func 3 - PCI slot 2 */ - 0x9300 0x0 0x0 0x1 &mpic 0x3 0x1 - 0x9300 0x0 0x0 0x2 &mpic 0x4 0x1 - 0x9300 0x0 0x0 0x3 &mpic 0x1 0x1 - 0x9300 0x0 0x0 0x4 &mpic 0x2 0x1 - - /* IDSEL 0x12 func 4 - PCI slot 2 */ - 0x9400 0x0 0x0 0x1 &mpic 0x3 0x1 - 0x9400 0x0 0x0 0x2 &mpic 0x4 0x1 - 0x9400 0x0 0x0 0x3 &mpic 0x1 0x1 - 0x9400 0x0 0x0 0x4 &mpic 0x2 0x1 - - /* IDSEL 0x12 func 5 - PCI slot 2 */ - 0x9500 0x0 0x0 0x1 &mpic 0x3 0x1 - 0x9500 0x0 0x0 0x2 &mpic 0x4 0x1 - 0x9500 0x0 0x0 0x3 &mpic 0x1 0x1 - 0x9500 0x0 0x0 0x4 &mpic 0x2 0x1 - - /* IDSEL 0x12 func 6 - PCI slot 2 */ - 0x9600 0x0 0x0 0x1 &mpic 0x3 0x1 - 0x9600 0x0 0x0 0x2 &mpic 0x4 0x1 - 0x9600 0x0 0x0 0x3 &mpic 0x1 0x1 - 0x9600 0x0 0x0 0x4 &mpic 0x2 0x1 - - /* IDSEL 0x12 func 7 - PCI slot 2 */ - 0x9700 0x0 0x0 0x1 &mpic 0x3 0x1 - 0x9700 0x0 0x0 0x2 &mpic 0x4 0x1 - 0x9700 0x0 0x0 0x3 &mpic 0x1 0x1 - 0x9700 0x0 0x0 0x4 &mpic 0x2 0x1 - - // IDSEL 0x1c USB - 0xe000 0x0 0x0 0x1 &i8259 0xc 0x2 - 0xe100 0x0 0x0 0x2 &i8259 0x9 0x2 - 0xe200 0x0 0x0 0x3 &i8259 0xa 0x2 - 0xe300 0x0 0x0 0x4 &i8259 0xb 0x2 - - // IDSEL 0x1d Audio - 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2 - - // IDSEL 0x1e Legacy - 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2 - 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2 - - // IDSEL 0x1f IDE/SATA - 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2 - 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2 - - >; - - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x2000000 0x0 0xa0000000 - 0x2000000 0x0 0xa0000000 - 0x0 0x10000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x10000>; - uli1575@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - ranges = <0x2000000 0x0 0xa0000000 - 0x2000000 0x0 0xa0000000 - 0x0 0x10000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x10000>; - isa@1e { - device_type = "isa"; - #interrupt-cells = <2>; - #size-cells = <1>; - #address-cells = <2>; - reg = <0xf000 0x0 0x0 0x0 0x0>; - ranges = <0x1 0x0 0x1000000 0x0 0x0 - 0x1000>; - interrupt-parent = <&i8259>; - - i8259: interrupt-controller@20 { - reg = <0x1 0x20 0x2 - 0x1 0xa0 0x2 - 0x1 0x4d0 0x2>; - interrupt-controller; - device_type = "interrupt-controller"; - #address-cells = <0>; - #interrupt-cells = <2>; - compatible = "chrp,iic"; - interrupts = <9 2>; - interrupt-parent = <&mpic>; - }; - - i8042@60 { - #size-cells = <0>; - #address-cells = <1>; - reg = <0x1 0x60 0x1 0x1 0x64 0x1>; - interrupts = <1 3 12 3>; - interrupt-parent = - <&i8259>; - - keyboard@0 { - reg = <0x0>; - compatible = "pnpPNP,303"; - }; - - mouse@1 { - reg = <0x1>; - compatible = "pnpPNP,f03"; - }; - }; - - rtc@70 { - compatible = "pnpPNP,b00"; - reg = <0x1 0x70 0x2>; - }; - - gpio@400 { - reg = <0x1 0x400 0x80>; - }; - }; - }; - }; - - }; - - pci1: pcie@ffe09000 { - compatible = "fsl,mpc8548-pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0 0xffe09000 0 0x1000>; - bus-range = <0 255>; - ranges = <0x2000000 0x0 0x90000000 0 0x90000000 0x0 0x10000000 - 0x1000000 0x0 0x00000000 0 0xfee10000 0x0 0x00010000>; - clock-frequency = <33333333>; - interrupt-parent = <&mpic>; - interrupts = <25 2>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0x0 0x0 0x1 &mpic 0x4 0x1 - 0000 0x0 0x0 0x2 &mpic 0x5 0x1 - 0000 0x0 0x0 0x3 &mpic 0x6 0x1 - 0000 0x0 0x0 0x4 &mpic 0x7 0x1 - >; - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x2000000 0x0 0x90000000 - 0x2000000 0x0 0x90000000 - 0x0 0x10000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x10000>; - }; - }; - - pci2: pcie@ffe0a000 { - compatible = "fsl,mpc8548-pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0 0xffe0a000 0 0x1000>; - bus-range = <0 255>; - ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x10000000 - 0x1000000 0x0 0x00000000 0 0xfee00000 0x0 0x00010000>; - clock-frequency = <33333333>; - interrupt-parent = <&mpic>; - interrupts = <26 2>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0x0 0x0 0x1 &mpic 0x0 0x1 - 0000 0x0 0x0 0x2 &mpic 0x1 0x1 - 0000 0x0 0x0 0x3 &mpic 0x2 0x1 - 0000 0x0 0x0 0x4 &mpic 0x3 0x1 - >; - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x2000000 0x0 0x80000000 - 0x2000000 0x0 0x80000000 - 0x0 0x10000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x10000>; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/p1020rdb.dts b/usr/src/boot/sys/boot/fdt/dts/powerpc/p1020rdb.dts deleted file mode 100644 index ec5118ce0f..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/p1020rdb.dts +++ /dev/null @@ -1,627 +0,0 @@ -/* - * P1020 RDB Device Tree Source - * - * Copyright 2009 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* $FreeBSD$ */ - -/dts-v1/; - -/ { - model = "fsl,P1020"; - compatible = "fsl,P1020RDB"; - #address-cells = <2>; - #size-cells = <2>; - - aliases { - serial0 = &serial0; - serial1 = &serial1; - ethernet0 = &enet0; - ethernet1 = &enet1; - ethernet2 = &enet2; - pci0 = &pci0; - pci1 = &pci1; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - PowerPC,P1020@0 { - device_type = "cpu"; - reg = <0x0>; - next-level-cache = <&L2>; - }; - - PowerPC,P1020@1 { - device_type = "cpu"; - reg = <0x1>; - next-level-cache = <&L2>; - }; - }; - - memory { - device_type = "memory"; - }; - - localbus@ffe05000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "fsl,p1020-elbc", "fsl,elbc", "simple-bus"; - reg = <0 0xffe05000 0 0x1000>; - interrupts = <19 2>; - interrupt-parent = <&mpic>; - - /* NOR, NAND Flashes and Vitesse 5 port L2 switch */ - ranges = <0x0 0x0 0x0 0xef000000 0x01000000 - 0x1 0x0 0x0 0xffa00000 0x00040000 - 0x2 0x0 0x0 0xffb00000 0x00020000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x1000000>; - bank-width = <2>; - device-width = <1>; - - partition@0 { - /* This location must not be altered */ - /* 256KB for Vitesse 7385 Switch firmware */ - reg = <0x0 0x00040000>; - label = "NOR (RO) Vitesse-7385 Firmware"; - read-only; - }; - - partition@40000 { - /* 256KB for DTB Image */ - reg = <0x00040000 0x00040000>; - label = "NOR (RO) DTB Image"; - read-only; - }; - - partition@80000 { - /* 3.5 MB for Linux Kernel Image */ - reg = <0x00080000 0x00380000>; - label = "NOR (RO) Linux Kernel Image"; - read-only; - }; - - partition@400000 { - /* 11MB for JFFS2 based Root file System */ - reg = <0x00400000 0x00b00000>; - label = "NOR (RW) JFFS2 Root File System"; - }; - - partition@f00000 { - /* This location must not be altered */ - /* 512KB for u-boot Bootloader Image */ - /* 512KB for u-boot Environment Variables */ - reg = <0x00f00000 0x00100000>; - label = "NOR (RO) U-Boot Image"; - read-only; - }; - }; - - nand@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,p1020-fcm-nand", - "fsl,elbc-fcm-nand"; - reg = <0x1 0x0 0x40000>; - - partition@0 { - /* This location must not be altered */ - /* 1MB for u-boot Bootloader Image */ - reg = <0x0 0x00100000>; - label = "NAND (RO) U-Boot Image"; - read-only; - }; - - partition@100000 { - /* 1MB for DTB Image */ - reg = <0x00100000 0x00100000>; - label = "NAND (RO) DTB Image"; - read-only; - }; - - partition@200000 { - /* 4MB for Linux Kernel Image */ - reg = <0x00200000 0x00400000>; - label = "NAND (RO) Linux Kernel Image"; - read-only; - }; - - partition@600000 { - /* 4MB for Compressed Root file System Image */ - reg = <0x00600000 0x00400000>; - label = "NAND (RO) Compressed RFS Image"; - read-only; - }; - - partition@a00000 { - /* 7MB for JFFS2 based Root file System */ - reg = <0x00a00000 0x00700000>; - label = "NAND (RW) JFFS2 Root File System"; - }; - - partition@1100000 { - /* 15MB for JFFS2 based Root file System */ - reg = <0x01100000 0x00f00000>; - label = "NAND (RW) Writable User area"; - }; - }; - - L2switch@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "vitesse-7385"; - reg = <0x2 0x0 0x20000>; - }; - - }; - - soc@ffe00000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "soc"; - compatible = "fsl,p1020-immr", "simple-bus"; - ranges = <0x0 0x0 0xffe00000 0x100000>; - bus-frequency = <0>; // Filled out by uboot. - - ecm-law@0 { - compatible = "fsl,ecm-law"; - reg = <0x0 0x1000>; - fsl,num-laws = <12>; - }; - - ecm@1000 { - compatible = "fsl,p1020-ecm", "fsl,ecm"; - reg = <0x1000 0x1000>; - interrupts = <16 2>; - interrupt-parent = <&mpic>; - }; - - memory-controller@2000 { - compatible = "fsl,p1020-memory-controller"; - reg = <0x2000 0x1000>; - interrupt-parent = <&mpic>; - interrupts = <16 2>; - }; - - i2c@3000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <0>; - compatible = "fsl-i2c"; - reg = <0x3000 0x100>; - interrupts = <43 2>; - interrupt-parent = <&mpic>; - dfsrr; - rtc@68 { - compatible = "dallas,ds1339"; - reg = <0x68>; - }; - }; - - i2c@3100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <1>; - compatible = "fsl-i2c"; - reg = <0x3100 0x100>; - interrupts = <43 2>; - interrupt-parent = <&mpic>; - dfsrr; - }; - - serial0: serial@4500 { - cell-index = <0>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x4500 0x100>; - clock-frequency = <0>; - interrupts = <42 2>; - interrupt-parent = <&mpic>; - }; - - serial1: serial@4600 { - cell-index = <1>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x4600 0x100>; - clock-frequency = <0>; - interrupts = <42 2>; - interrupt-parent = <&mpic>; - }; - - spi@7000 { - cell-index = <0>; - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,espi"; - reg = <0x7000 0x1000>; - interrupts = <59 0x2>; - interrupt-parent = <&mpic>; - mode = "cpu"; - - fsl_m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,espi-flash"; - reg = <0>; - linux,modalias = "fsl_m25p80"; - modal = "s25sl128b"; - spi-max-frequency = <50000000>; - mode = <0>; - - partition@0 { - /* 512KB for u-boot Bootloader Image */ - reg = <0x0 0x00080000>; - label = "SPI (RO) U-Boot Image"; - read-only; - }; - - partition@80000 { - /* 512KB for DTB Image */ - reg = <0x00080000 0x00080000>; - label = "SPI (RO) DTB Image"; - read-only; - }; - - partition@100000 { - /* 4MB for Linux Kernel Image */ - reg = <0x00100000 0x00400000>; - label = "SPI (RO) Linux Kernel Image"; - read-only; - }; - - partition@500000 { - /* 4MB for Compressed RFS Image */ - reg = <0x00500000 0x00400000>; - label = "SPI (RO) Compressed RFS Image"; - read-only; - }; - - partition@900000 { - /* 7MB for JFFS2 based RFS */ - reg = <0x00900000 0x00700000>; - label = "SPI (RW) JFFS2 RFS"; - }; - }; - }; - - gpio: gpio-controller@f000 { - #gpio-cells = <2>; - compatible = "fsl,mpc8572-gpio"; - reg = <0xf000 0x100>; - interrupts = <47 0x2>; - interrupt-parent = <&mpic>; - gpio-controller; - }; - - L2: l2-cache-controller@20000 { - compatible = "fsl,p1020-l2-cache-controller"; - reg = <0x20000 0x1000>; - cache-line-size = <32>; // 32 bytes - cache-size = <0x40000>; // L2,256K - interrupt-parent = <&mpic>; - interrupts = <16 2>; - }; - - dma@21300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,eloplus-dma"; - reg = <0x21300 0x4>; - ranges = <0x0 0x21100 0x200>; - cell-index = <0>; - dma-channel@0 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupt-parent = <&mpic>; - interrupts = <20 2>; - }; - dma-channel@80 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupt-parent = <&mpic>; - interrupts = <21 2>; - }; - dma-channel@100 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupt-parent = <&mpic>; - interrupts = <22 2>; - }; - dma-channel@180 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupt-parent = <&mpic>; - interrupts = <23 2>; - }; - }; - - mdio@24000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,etsec2-mdio"; - reg = <0x24000 0x1000 0xb0030 0x4>; - - phy0: ethernet-phy@0 { - interrupt-parent = <&mpic>; - interrupts = <3 1>; - reg = <0x0>; - }; - - phy1: ethernet-phy@1 { - interrupt-parent = <&mpic>; - interrupts = <2 1>; - reg = <0x1>; - }; - }; - - mdio@25000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,etsec2-tbi"; - reg = <0x25000 0x1000 0xb1030 0x4>; - - tbi0: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - - enet0: ethernet@b0000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "network"; - model = "eTSEC"; - compatible = "fsl,etsec2"; - fsl,num_rx_queues = <0x8>; - fsl,num_tx_queues = <0x8>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupt-parent = <&mpic>; - fixed-link = <1 1 1000 0 0>; - phy-connection-type = "rgmii-id"; - - queue-group@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0xb0000 0x1000>; - interrupts = <29 2 30 2 34 2>; - }; - - queue-group@1 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0xb4000 0x1000>; - interrupts = <17 2 18 2 24 2>; - }; - }; - - enet1: ethernet@b1000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "network"; - model = "eTSEC"; - compatible = "fsl,etsec2"; - fsl,num_rx_queues = <0x8>; - fsl,num_tx_queues = <0x8>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupt-parent = <&mpic>; - phy-handle = <&phy0>; - tbi-handle = <&tbi0>; - phy-connection-type = "sgmii"; - - queue-group@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0xb1000 0x1000>; - interrupts = <35 2 36 2 40 2>; - }; - - queue-group@1 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0xb5000 0x1000>; - interrupts = <51 2 52 2 67 2>; - }; - }; - - enet2: ethernet@b2000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "network"; - model = "eTSEC"; - compatible = "fsl,etsec2"; - fsl,num_rx_queues = <0x8>; - fsl,num_tx_queues = <0x8>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupt-parent = <&mpic>; - phy-handle = <&phy1>; - phy-connection-type = "rgmii-id"; - - queue-group@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0xb2000 0x1000>; - interrupts = <31 2 32 2 33 2>; - }; - - queue-group@1 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0xb6000 0x1000>; - interrupts = <25 2 26 2 27 2>; - }; - }; - - usb@22000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl-usb2-dr"; - reg = <0x22000 0x1000>; - interrupt-parent = <&mpic>; - interrupts = <28 0x2>; - phy_type = "ulpi"; - }; - - /* USB2 is shared with localbus, so it must be disabled - by default. We can't put 'status = "disabled";' here - since U-Boot doesn't clear the status property when - it enables USB2. OTOH, U-Boot does create a new node - when there isn't any. So, just comment it out. - usb@23000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl-usb2-dr"; - reg = <0x23000 0x1000>; - interrupt-parent = <&mpic>; - interrupts = <46 0x2>; - phy_type = "ulpi"; - }; - */ - - sdhci@2e000 { - compatible = "fsl,p1020-esdhc", "fsl,esdhc"; - reg = <0x2e000 0x1000>; - interrupts = <72 0x2>; - interrupt-parent = <&mpic>; - /* Filled in by U-Boot */ - clock-frequency = <0>; - }; - - crypto@30000 { - compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4", - "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0"; - reg = <0x30000 0x10000>; - interrupts = <45 2 58 2>; - interrupt-parent = <&mpic>; - fsl,num-channels = <4>; - fsl,channel-fifo-len = <24>; - fsl,exec-units-mask = <0xbfe>; - fsl,descriptor-types-mask = <0x3ab0ebf>; - }; - - mpic: pic@40000 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <2>; - reg = <0x40000 0x40000>; - compatible = "chrp,open-pic"; - device_type = "open-pic"; - }; - - msi@41600 { - compatible = "fsl,p1020-msi", "fsl,mpic-msi"; - reg = <0x41600 0x80>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe0 0 - 0xe1 0 - 0xe2 0 - 0xe3 0 - 0xe4 0 - 0xe5 0 - 0xe6 0 - 0xe7 0>; - interrupt-parent = <&mpic>; - }; - - global-utilities@e0000 { //global utilities block - compatible = "fsl,p1020-guts"; - reg = <0xe0000 0x1000>; - fsl,has-rstcr; - }; - }; - - pci0: pcie@ffe09000 { - compatible = "fsl,mpc8548-pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0 0xffe09000 0 0x1000>; - bus-range = <0 255>; - ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 - 0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>; - clock-frequency = <33333333>; - interrupt-parent = <&mpic>; - interrupts = <16 2>; - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x2000000 0x0 0xa0000000 - 0x2000000 0x0 0xa0000000 - 0x0 0x20000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x100000>; - }; - }; - - pci1: pcie@ffe0a000 { - compatible = "fsl,mpc8548-pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0 0xffe0a000 0 0x1000>; - bus-range = <0 255>; - ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 - 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; - clock-frequency = <33333333>; - interrupt-parent = <&mpic>; - interrupts = <16 2>; - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x2000000 0x0 0xc0000000 - 0x2000000 0x0 0xc0000000 - 0x0 0x20000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x100000>; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/p2020ds.dts b/usr/src/boot/sys/boot/fdt/dts/powerpc/p2020ds.dts deleted file mode 100644 index 7823429dc9..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/p2020ds.dts +++ /dev/null @@ -1,754 +0,0 @@ -/* - * P2020 DS Device Tree Source - * - * Copyright 2009 Freescale Semiconductor Inc. - * - * Neither the name of Freescale Semiconductor, Inc nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Freescale hereby publishes it under the following licenses: - * - * BSD License - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * GNU General Public License, version 2 - * - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * You may select the license of your choice. - *------------------------------------------------------------------ - */ -/* $FreeBSD$ */ - -/dts-v1/; -/ { - model = "fsl,P2020"; - compatible = "fsl,P2020DS"; - #address-cells = <2>; - #size-cells = <2>; - - aliases { - ethernet0 = &enet0; - ethernet1 = &enet1; - ethernet2 = &enet2; - serial0 = &serial0; - serial1 = &serial1; - pci0 = &pci0; - pci1 = &pci1; - pci2 = &pci2; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - PowerPC,P2020@0 { - device_type = "cpu"; - reg = <0x0>; - next-level-cache = <&L2>; - }; - - PowerPC,P2020@1 { - device_type = "cpu"; - reg = <0x1>; - next-level-cache = <&L2>; - }; - }; - - memory { - device_type = "memory"; - }; - - localbus@ffe05000 { - #address-cells = <2>; - #size-cells = <1>; - compatible = "fsl,elbc", "simple-bus"; - reg = <0 0xffe05000 0 0x1000>; - interrupts = <19 2>; - interrupt-parent = <&mpic>; - - ranges = <0x0 0x0 0x0 0xe8000000 0x08000000 - 0x1 0x0 0x0 0xe0000000 0x08000000 - 0x2 0x0 0x0 0xffa00000 0x00040000 - 0x3 0x0 0x0 0xffdf0000 0x00008000 - 0x4 0x0 0x0 0xffa40000 0x00040000 - 0x5 0x0 0x0 0xffa80000 0x00040000 - 0x6 0x0 0x0 0xffac0000 0x00040000>; - - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x8000000>; - bank-width = <2>; - device-width = <1>; - - ramdisk@0 { - reg = <0x0 0x03000000>; - read-only; - }; - - diagnostic@3000000 { - reg = <0x03000000 0x00e00000>; - read-only; - }; - - dink@3e00000 { - reg = <0x03e00000 0x00200000>; - read-only; - }; - - kernel@4000000 { - reg = <0x04000000 0x00400000>; - read-only; - }; - - jffs2@4400000 { - reg = <0x04400000 0x03b00000>; - }; - - dtb@7f00000 { - reg = <0x07f00000 0x00080000>; - read-only; - }; - - u-boot@7f80000 { - reg = <0x07f80000 0x00080000>; - read-only; - }; - }; - - nand@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,elbc-fcm-nand"; - reg = <0x2 0x0 0x40000>; - - u-boot@0 { - reg = <0x0 0x02000000>; - read-only; - }; - - jffs2@2000000 { - reg = <0x02000000 0x10000000>; - }; - - ramdisk@12000000 { - reg = <0x12000000 0x08000000>; - read-only; - }; - - kernel@1a000000 { - reg = <0x1a000000 0x04000000>; - }; - - dtb@1e000000 { - reg = <0x1e000000 0x01000000>; - read-only; - }; - - empty@1f000000 { - reg = <0x1f000000 0x21000000>; - }; - }; - - nand@4,0 { - compatible = "fsl,elbc-fcm-nand"; - reg = <0x4 0x0 0x40000>; - }; - - nand@5,0 { - compatible = "fsl,elbc-fcm-nand"; - reg = <0x5 0x0 0x40000>; - }; - - nand@6,0 { - compatible = "fsl,elbc-fcm-nand"; - reg = <0x6 0x0 0x40000>; - }; - }; - - soc@ffe00000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "soc"; - compatible = "fsl,p2020-immr", "simple-bus"; - ranges = <0x0 0 0xffe00000 0x100000>; - bus-frequency = <0>; // Filled out by uboot. - - ecm-law@0 { - compatible = "fsl,ecm-law"; - reg = <0x0 0x1000>; - fsl,num-laws = <12>; - }; - - ecm@1000 { - compatible = "fsl,p2020-ecm", "fsl,ecm"; - reg = <0x1000 0x1000>; - interrupts = <17 2>; - interrupt-parent = <&mpic>; - }; - - memory-controller@2000 { - compatible = "fsl,p2020-memory-controller"; - reg = <0x2000 0x1000>; - interrupt-parent = <&mpic>; - interrupts = <18 2>; - }; - - i2c@3000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <0>; - compatible = "fsl-i2c"; - reg = <0x3000 0x100>; - interrupts = <43 2>; - interrupt-parent = <&mpic>; - dfsrr; - }; - - i2c@3100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <1>; - compatible = "fsl-i2c"; - reg = <0x3100 0x100>; - interrupts = <43 2>; - interrupt-parent = <&mpic>; - dfsrr; - }; - - serial0: serial@4500 { - cell-index = <0>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x4500 0x100>; - clock-frequency = <0>; - interrupts = <42 2>; - interrupt-parent = <&mpic>; - }; - - serial1: serial@4600 { - cell-index = <1>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x4600 0x100>; - clock-frequency = <0>; - interrupts = <42 2>; - interrupt-parent = <&mpic>; - }; - - spi@7000 { - compatible = "fsl,espi"; - reg = <0x7000 0x1000>; - interrupts = <59 0x2>; - interrupt-parent = <&mpic>; - }; - - dma@c300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,eloplus-dma"; - reg = <0xc300 0x4>; - ranges = <0x0 0xc100 0x200>; - cell-index = <1>; - dma-channel@0 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupt-parent = <&mpic>; - interrupts = <76 2>; - }; - dma-channel@80 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupt-parent = <&mpic>; - interrupts = <77 2>; - }; - dma-channel@100 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupt-parent = <&mpic>; - interrupts = <78 2>; - }; - dma-channel@180 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupt-parent = <&mpic>; - interrupts = <79 2>; - }; - }; - - gpio: gpio-controller@f000 { - #gpio-cells = <2>; - compatible = "fsl,mpc8572-gpio"; - reg = <0xf000 0x100>; - interrupts = <47 0x2>; - interrupt-parent = <&mpic>; - gpio-controller; - }; - - L2: l2-cache-controller@20000 { - compatible = "fsl,p2020-l2-cache-controller"; - reg = <0x20000 0x1000>; - cache-line-size = <32>; // 32 bytes - cache-size = <0x80000>; // L2, 512k - interrupt-parent = <&mpic>; - interrupts = <16 2>; - }; - - dma@21300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,eloplus-dma"; - reg = <0x21300 0x4>; - ranges = <0x0 0x21100 0x200>; - cell-index = <0>; - dma-channel@0 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupt-parent = <&mpic>; - interrupts = <20 2>; - }; - dma-channel@80 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupt-parent = <&mpic>; - interrupts = <21 2>; - }; - dma-channel@100 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupt-parent = <&mpic>; - interrupts = <22 2>; - }; - dma-channel@180 { - compatible = "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupt-parent = <&mpic>; - interrupts = <23 2>; - }; - }; - - usb@22000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl-usb2-dr"; - reg = <0x22000 0x1000>; - interrupt-parent = <&mpic>; - interrupts = <28 0x2>; - phy_type = "ulpi"; - }; - - enet0: ethernet@24000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <0>; - device_type = "network"; - model = "eTSEC"; - compatible = "gianfar"; - reg = <0x24000 0x1000>; - ranges = <0x0 0x24000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <29 2 30 2 34 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi0>; - phy-handle = <&phy0>; - phy-connection-type = "rgmii-id"; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-mdio"; - reg = <0x520 0x20>; - - phy0: ethernet-phy@0 { - interrupt-parent = <&mpic>; - interrupts = <3 1>; - reg = <0x0>; - }; - phy1: ethernet-phy@1 { - interrupt-parent = <&mpic>; - interrupts = <3 1>; - reg = <0x1>; - }; - phy2: ethernet-phy@2 { - interrupt-parent = <&mpic>; - interrupts = <3 1>; - reg = <0x2>; - }; - tbi0: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - enet1: ethernet@25000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <1>; - device_type = "network"; - model = "eTSEC"; - compatible = "gianfar"; - reg = <0x25000 0x1000>; - ranges = <0x0 0x25000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <35 2 36 2 40 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi1>; - phy-handle = <&phy1>; - phy-connection-type = "rgmii-id"; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-tbi"; - reg = <0x520 0x20>; - - tbi1: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - enet2: ethernet@26000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <2>; - device_type = "network"; - model = "eTSEC"; - compatible = "gianfar"; - reg = <0x26000 0x1000>; - ranges = <0x0 0x26000 0x1000>; - local-mac-address = [ 00 00 00 00 00 00 ]; - interrupts = <31 2 32 2 33 2>; - interrupt-parent = <&mpic>; - tbi-handle = <&tbi2>; - phy-handle = <&phy2>; - phy-connection-type = "rgmii-id"; - - mdio@520 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,gianfar-tbi"; - reg = <0x520 0x20>; - - tbi2: tbi-phy@11 { - reg = <0x11>; - device_type = "tbi-phy"; - }; - }; - }; - - sdhci@2e000 { - compatible = "fsl,p2020-esdhc", "fsl,esdhc"; - reg = <0x2e000 0x1000>; - interrupts = <72 0x2>; - interrupt-parent = <&mpic>; - /* Filled in by U-Boot */ - clock-frequency = <0>; - }; - - crypto@30000 { - compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4", - "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0"; - reg = <0x30000 0x10000>; - interrupts = <45 2 58 2>; - interrupt-parent = <&mpic>; - fsl,num-channels = <4>; - fsl,channel-fifo-len = <24>; - fsl,exec-units-mask = <0xbfe>; - fsl,descriptor-types-mask = <0x3ab0ebf>; - }; - - mpic: pic@40000 { - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <2>; - reg = <0x40000 0x40000>; - compatible = "chrp,open-pic"; - device_type = "open-pic"; - }; - - msi@41600 { - compatible = "fsl,mpic-msi"; - reg = <0x41600 0x80>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe0 0 - 0xe1 0 - 0xe2 0 - 0xe3 0 - 0xe4 0 - 0xe5 0 - 0xe6 0 - 0xe7 0>; - interrupt-parent = <&mpic>; - }; - - global-utilities@e0000 { //global utilities block - compatible = "fsl,p2020-guts"; - reg = <0xe0000 0x1000>; - fsl,has-rstcr; - }; - }; - - pci0: pcie@ffe08000 { - compatible = "fsl,mpc8548-pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0 0xffe08000 0 0x1000>; - bus-range = <0 255>; - ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 - 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; - clock-frequency = <33333333>; - interrupt-parent = <&mpic>; - interrupts = <24 2>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0x0 0x0 0x1 &mpic 0x8 0x1 - 0000 0x0 0x0 0x2 &mpic 0x9 0x1 - 0000 0x0 0x0 0x3 &mpic 0xa 0x1 - 0000 0x0 0x0 0x4 &mpic 0xb 0x1 - >; - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x2000000 0x0 0x80000000 - 0x2000000 0x0 0x80000000 - 0x0 0x20000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x10000>; - }; - }; - - pci1: pcie@ffe09000 { - compatible = "fsl,mpc8548-pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0 0xffe09000 0 0x1000>; - bus-range = <0 255>; - ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 - 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; - clock-frequency = <33333333>; - interrupt-parent = <&mpic>; - interrupts = <25 2>; - interrupt-map-mask = <0xff00 0x0 0x0 0x7>; - interrupt-map = < - - // IDSEL 0x11 func 0 - PCI slot 1 - 0x8800 0x0 0x0 0x1 &i8259 0x9 0x2 - 0x8800 0x0 0x0 0x2 &i8259 0xa 0x2 - - // IDSEL 0x11 func 1 - PCI slot 1 - 0x8900 0x0 0x0 0x1 &i8259 0x9 0x2 - 0x8900 0x0 0x0 0x2 &i8259 0xa 0x2 - - // IDSEL 0x11 func 2 - PCI slot 1 - 0x8a00 0x0 0x0 0x1 &i8259 0x9 0x2 - 0x8a00 0x0 0x0 0x2 &i8259 0xa 0x2 - - // IDSEL 0x11 func 3 - PCI slot 1 - 0x8b00 0x0 0x0 0x1 &i8259 0x9 0x2 - 0x8b00 0x0 0x0 0x2 &i8259 0xa 0x2 - - // IDSEL 0x11 func 4 - PCI slot 1 - 0x8c00 0x0 0x0 0x1 &i8259 0x9 0x2 - 0x8c00 0x0 0x0 0x2 &i8259 0xa 0x2 - - // IDSEL 0x11 func 5 - PCI slot 1 - 0x8d00 0x0 0x0 0x1 &i8259 0x9 0x2 - 0x8d00 0x0 0x0 0x2 &i8259 0xa 0x2 - - // IDSEL 0x11 func 6 - PCI slot 1 - 0x8e00 0x0 0x0 0x1 &i8259 0x9 0x2 - 0x8e00 0x0 0x0 0x2 &i8259 0xa 0x2 - - // IDSEL 0x11 func 7 - PCI slot 1 - 0x8f00 0x0 0x0 0x1 &i8259 0x9 0x2 - 0x8f00 0x0 0x0 0x2 &i8259 0xa 0x2 - - // IDSEL 0x1d Audio - 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2 - - // IDSEL 0x1e Legacy - 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2 - 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2 - - // IDSEL 0x1f IDE/SATA - 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2 - 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2 - >; - - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x2000000 0x0 0xa0000000 - 0x2000000 0x0 0xa0000000 - 0x0 0x20000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x10000>; - uli1575@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - ranges = <0x2000000 0x0 0xa0000000 - 0x2000000 0x0 0xa0000000 - 0x0 0x20000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x10000>; - isa@1e { - device_type = "isa"; - #interrupt-cells = <2>; - #size-cells = <1>; - #address-cells = <2>; - reg = <0xf000 0x0 0x0 0x0 0x0>; - ranges = <0x1 0x0 0x1000000 0x0 0x0 - 0x1000>; - interrupt-parent = <&i8259>; - - i8259: interrupt-controller@20 { - reg = <0x1 0x20 0x2 - 0x1 0xa0 0x2 - 0x1 0x4d0 0x2>; - interrupt-controller; - device_type = "interrupt-controller"; - #address-cells = <0>; - #interrupt-cells = <2>; - compatible = "chrp,iic"; - interrupts = <4 1>; - interrupt-parent = <&mpic>; - }; - - i8042@60 { - #size-cells = <0>; - #address-cells = <1>; - reg = <0x1 0x60 0x1 0x1 0x64 0x1>; - interrupts = <1 3 12 3>; - interrupt-parent = - <&i8259>; - - keyboard@0 { - reg = <0x0>; - compatible = "pnpPNP,303"; - }; - - mouse@1 { - reg = <0x1>; - compatible = "pnpPNP,f03"; - }; - }; - - rtc@70 { - compatible = "pnpPNP,b00"; - reg = <0x1 0x70 0x2>; - }; - - gpio@400 { - reg = <0x1 0x400 0x80>; - }; - }; - }; - }; - - }; - - pci2: pcie@ffe0a000 { - compatible = "fsl,mpc8548-pcie"; - device_type = "pci"; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - reg = <0 0xffe0a000 0 0x1000>; - bus-range = <0 255>; - ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 - 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; - clock-frequency = <33333333>; - interrupt-parent = <&mpic>; - interrupts = <26 2>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0x0 0x0 0x1 &mpic 0x0 0x1 - 0000 0x0 0x0 0x2 &mpic 0x1 0x1 - 0000 0x0 0x0 0x3 &mpic 0x2 0x1 - 0000 0x0 0x0 0x4 &mpic 0x3 0x1 - >; - pcie@0 { - reg = <0x0 0x0 0x0 0x0 0x0>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - ranges = <0x2000000 0x0 0xc0000000 - 0x2000000 0x0 0xc0000000 - 0x0 0x20000000 - - 0x1000000 0x0 0x0 - 0x1000000 0x0 0x0 - 0x0 0x10000>; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/p2041rdb.dts b/usr/src/boot/sys/boot/fdt/dts/powerpc/p2041rdb.dts deleted file mode 100644 index aa5af072e7..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/p2041rdb.dts +++ /dev/null @@ -1,490 +0,0 @@ -/* - * P2041RDB Device Tree Source - * - * Copyright 2011 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* $FreeBSD$ */ - -/include/ "p2041si.dtsi" - -/ { - model = "fsl,P2041RDB"; - compatible = "fsl,P2041RDB"; - #address-cells = <2>; - #size-cells = <2>; - interrupt-parent = <&mpic>; - - aliases { - phy_rgmii_0 = &phy_rgmii_0; - phy_rgmii_1 = &phy_rgmii_1; - phy_sgmii_2 = &phy_sgmii_2; - phy_sgmii_3 = &phy_sgmii_3; - phy_sgmii_4 = &phy_sgmii_4; - phy_sgmii_1c = &phy_sgmii_1c; - phy_sgmii_1d = &phy_sgmii_1d; - phy_sgmii_1e = &phy_sgmii_1e; - phy_sgmii_1f = &phy_sgmii_1f; - phy_xgmii_2 = &phy_xgmii_2; - }; - - memory { - device_type = "memory"; - reg = <0x00000000 0x00000000 0x00000000 0x80000000>; - }; - - dcsr: dcsr@f00000000 { - ranges = <0x00000000 0xf 0x00000000 0x01008000>; - }; - - bman-portals@ff4000000 { - bman-portal@0 { - cpu-handle = <&cpu0>; - }; - bman-portal@4000 { - cpu-handle = <&cpu1>; - }; - bman-portal@8000 { - cpu-handle = <&cpu2>; - }; - bman-portal@c000 { - cpu-handle = <&cpu3>; - }; - bman-portal@10000 { - }; - bman-portal@14000 { - }; - bman-portal@18000 { - }; - bman-portal@1c000 { - }; - bman-portal@20000 { - }; - bman-portal@24000 { - }; - - buffer-pool@0 { - compatible = "fsl,p2041-bpool", "fsl,bpool"; - fsl,bpid = <0>; - fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; - }; - }; - - qman-portals@ff4200000 { - qportal0: qman-portal@0 { - cpu-handle = <&cpu0>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal1: qman-portal@4000 { - cpu-handle = <&cpu1>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal2: qman-portal@8000 { - cpu-handle = <&cpu2>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal3: qman-portal@c000 { - cpu-handle = <&cpu3>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal4: qman-portal@10000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal5: qman-portal@14000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal6: qman-portal@18000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal7: qman-portal@1c000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal8: qman-portal@20000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal9: qman-portal@24000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - }; - - soc: soc@ffe000000 { - spi@110000 { - flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spansion,s25sl12801"; - reg = <0>; - spi-max-frequency = <40000000>; /* input clock */ - partition@u-boot { - label = "u-boot"; - reg = <0x00000000 0x00100000>; - read-only; - }; - partition@kernel { - label = "kernel"; - reg = <0x00100000 0x00500000>; - read-only; - }; - partition@dtb { - label = "dtb"; - reg = <0x00600000 0x00100000>; - read-only; - }; - partition@fs { - label = "file system"; - reg = <0x00700000 0x00900000>; - }; - }; - }; - - i2c@118000 { - lm75b@48 { - compatible = "nxp,lm75a"; - reg = <0x48>; - }; - eeprom@50 { - compatible = "at24,24c256"; - reg = <0x50>; - }; - rtc@68 { - compatible = "pericom,pt7c4338"; - reg = <0x68>; - }; - }; - - i2c@118100 { - eeprom@50 { - compatible = "at24,24c256"; - reg = <0x50>; - }; - }; - - usb1: usb@211000 { - dr_mode = "host"; - }; - - pme: pme@316000 { - /* Commented out, use default allocation */ - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ - }; - - qman: qman@318000 { - /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ - }; - - bman: bman@31a000 { - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ - }; - - fman0: fman@400000 { - enet0: ethernet@e0000 { - tbi-handle = <&tbi0>; - phy-handle = <&phy_sgmii_2>; - phy-connection-type = "sgmii"; - }; - - mdio0: mdio@e1120 { - tbi0: tbi-phy@8 { - reg = <0x8>; - device_type = "tbi-phy"; - }; - - phy_rgmii_0: ethernet-phy@0 { - reg = <0x0>; - }; - phy_rgmii_1: ethernet-phy@1 { - reg = <0x1>; - }; - phy_sgmii_2: ethernet-phy@2 { - reg = <0x2>; - }; - phy_sgmii_3: ethernet-phy@3 { - reg = <0x3>; - }; - phy_sgmii_4: ethernet-phy@4 { - reg = <0x4>; - }; - phy_sgmii_1c: ethernet-phy@1c { - reg = <0x1c>; - }; - phy_sgmii_1d: ethernet-phy@1d { - reg = <0x1d>; - }; - phy_sgmii_1e: ethernet-phy@1e { - reg = <0x1e>; - }; - phy_sgmii_1f: ethernet-phy@1f { - reg = <0x1f>; - }; - }; - - enet1: ethernet@e2000 { - tbi-handle = <&tbi1>; - phy-handle = <&phy_sgmii_3>; - phy-connection-type = "sgmii"; - }; - - mdio@e3120 { - tbi1: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet2: ethernet@e4000 { - tbi-handle = <&tbi2>; - phy-handle = <&phy_sgmii_4>; - phy-connection-type = "sgmii"; - }; - - mdio@e5120 { - tbi2: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet3: ethernet@e6000 { - tbi-handle = <&tbi3>; - phy-handle = <&phy_rgmii_1>; - phy-connection-type = "rgmii"; - }; - - mdio@e7120 { - tbi3: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet4: ethernet@e8000 { - tbi-handle = <&tbi4>; - phy-handle = <&phy_rgmii_0>; - phy-connection-type = "rgmii"; - }; - - mdio@e9120 { - tbi4: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet5: ethernet@f0000 { - /* - * phy-handle will be updated by U-Boot to - * reflect the actual slot the XAUI card is in. - */ - phy-handle = <&phy_xgmii_2>; - phy-connection-type = "xgmii"; - }; - - mdio@f1000 { - /* XAUI card in slot 2 */ - phy_xgmii_2: ethernet-phy@0 { - reg = <0x0>; - }; - }; - }; - }; - - rapidio@ffe0c0000 { - reg = <0xf 0xfe0c0000 0 0x11000>; - - port1 { - ranges = <0 0 0xc 0x20000000 0 0x10000000>; - }; - port2 { - ranges = <0 0 0xc 0x30000000 0 0x10000000>; - }; - }; - - localbus@ffe124000 { - reg = <0xf 0xfe124000 0 0x1000>; - ranges = <0 0 0xf 0xb8000000 0x04000000>; - - flash@0,0 { - compatible = "cfi-flash"; - /* - * Map 64Mb of 128MB NOR flash memory. Since highest - * line of address of NOR flash memory are set by - * FPGA, memory are divided into two pages equal to - * 64MB. One of the pages can be accessed at once. - */ - reg = <0 0 0x04000000>; - bank-width = <2>; - device-width = <2>; - }; - }; - - pci0: pcie@ffe200000 { - reg = <0xf 0xfe200000 0 0x1000>; - ranges = <0x02000000 0 0x80000000 0x0 0x80000000 0x0 0x10000000 - 0x01000000 0 0x00000000 0x0 0xff000000 0x0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0x80000000 - 0x02000000 0 0x80000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff000000 - 0 0x00010000>; - }; - }; - - pci1: pcie@ffe201000 { - reg = <0xf 0xfe201000 0 0x1000>; - ranges = <0x02000000 0x0 0x90000000 0x0 0x90000000 0x0 0x10000000 - 0x01000000 0x0 0x00000000 0x0 0xff010000 0x0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0x90000000 - 0x02000000 0 0x90000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff010000 - 0 0x00010000>; - }; - }; - - pci2: pcie@ffe202000 { - reg = <0xf 0xfe202000 0 0x1000>; - ranges = <0x02000000 0 0xa0000000 0x0 0xa0000000 0 0x10000000 - 0x01000000 0 0x00000000 0x0 0xff020000 0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0xa0000000 - 0x02000000 0 0xa0000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff020000 - 0 0x00010000>; - }; - }; - - fsl,dpaa { - compatible = "fsl,p2041-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status = "okay"; - }; - ethernet@1 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "okay"; - }; - ethernet@2 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "okay"; - }; - ethernet@3 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "okay"; - }; - ethernet@4 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "okay"; - }; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/p2041si.dtsi b/usr/src/boot/sys/boot/fdt/dts/powerpc/p2041si.dtsi deleted file mode 100644 index 9db01fa62c..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/p2041si.dtsi +++ /dev/null @@ -1,1296 +0,0 @@ -/* - * P2041 Silicon Device Tree Source - * - * Copyright 2011 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* $FreeBSD$ */ - -/dts-v1/; - -/ { - compatible = "fsl,P2041"; - #address-cells = <2>; - #size-cells = <2>; - interrupt-parent = <&mpic>; - - aliases { - ccsr = &soc; - dcsr = &dcsr; - - ethernet0 = &enet0; - ethernet1 = &enet1; - ethernet2 = &enet2; - ethernet3 = &enet3; - ethernet4 = &enet4; - ethernet5 = &enet5; - serial0 = &serial0; - serial1 = &serial1; - serial2 = &serial2; - serial3 = &serial3; - pci0 = &pci0; - pci1 = &pci1; - pci2 = &pci2; - usb0 = &usb0; - usb1 = &usb1; - dma0 = &dma0; - dma1 = &dma1; - bman = &bman; - qman = &qman; - pme = &pme; - rman = &rman; - sdhc = &sdhc; - msi0 = &msi0; - msi1 = &msi1; - msi2 = &msi2; - - crypto = &crypto; - sec_jr0 = &sec_jr0; - sec_jr1 = &sec_jr1; - sec_jr2 = &sec_jr2; - sec_jr3 = &sec_jr3; - rtic_a = &rtic_a; - rtic_b = &rtic_b; - rtic_c = &rtic_c; - rtic_d = &rtic_d; - sec_mon = &sec_mon; - - fman0 = &fman0; - fman0_oh0 = &fman0_oh0; - fman0_oh1 = &fman0_oh1; - fman0_oh2 = &fman0_oh2; - fman0_oh3 = &fman0_oh3; - fman0_oh4 = &fman0_oh4; - fman0_oh5 = &fman0_oh5; - fman0_oh6 = &fman0_oh6; - fman0_rx0 = &fman0_rx0; - fman0_rx1 = &fman0_rx1; - fman0_rx2 = &fman0_rx2; - fman0_rx3 = &fman0_rx3; - fman0_rx4 = &fman0_rx4; - fman0_rx5 = &fman0_rx5; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu0: PowerPC,e500mc@0 { - device_type = "cpu"; - reg = <0>; - bus-frequency = <749999996>; - next-level-cache = <&L2_0>; - L2_0: l2-cache { - next-level-cache = <&cpc>; - }; - }; - cpu1: PowerPC,e500mc@1 { - device_type = "cpu"; - reg = <1>; - next-level-cache = <&L2_1>; - L2_1: l2-cache { - next-level-cache = <&cpc>; - }; - }; - cpu2: PowerPC,e500mc@2 { - device_type = "cpu"; - reg = <2>; - next-level-cache = <&L2_2>; - L2_2: l2-cache { - next-level-cache = <&cpc>; - }; - }; - cpu3: PowerPC,e500mc@3 { - device_type = "cpu"; - reg = <3>; - next-level-cache = <&L2_3>; - L2_3: l2-cache { - next-level-cache = <&cpc>; - }; - }; - }; - - dcsr: dcsr@f00000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,dcsr", "simple-bus"; - - dcsr-epu@0 { - compatible = "fsl,dcsr-epu"; - interrupts = <52 2 0 0 - 84 2 0 0 - 85 2 0 0>; - interrupt-parent = <&mpic>; - reg = <0x0 0x1000>; - }; - dcsr-npc { - compatible = "fsl,dcsr-npc"; - reg = <0x1000 0x1000 0x1000000 0x8000>; - }; - dcsr-nxc@2000 { - compatible = "fsl,dcsr-nxc"; - reg = <0x2000 0x1000>; - }; - dcsr-corenet { - compatible = "fsl,dcsr-corenet"; - reg = <0x8000 0x1000 0xB0000 0x1000>; - }; - dcsr-dpaa@9000 { - compatible = "fsl,p2041-dcsr-dpaa", "fsl,dcsr-dpaa"; - reg = <0x9000 0x1000>; - }; - dcsr-ocn@11000 { - compatible = "fsl,p2041-dcsr-ocn", "fsl,dcsr-ocn"; - reg = <0x11000 0x1000>; - }; - dcsr-ddr@12000 { - compatible = "fsl,dcsr-ddr"; - dev-handle = <&ddr>; - reg = <0x12000 0x1000>; - }; - dcsr-nal@18000 { - compatible = "fsl,p2041-dcsr-nal", "fsl,dcsr-nal"; - reg = <0x18000 0x1000>; - }; - dcsr-rcpm@22000 { - compatible = "fsl,p2041-dcsr-rcpm", "fsl,dcsr-rcpm"; - reg = <0x22000 0x1000>; - }; - dcsr-cpu-sb-proxy@40000 { - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu0>; - reg = <0x40000 0x1000>; - }; - dcsr-cpu-sb-proxy@41000 { - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu1>; - reg = <0x41000 0x1000>; - }; - dcsr-cpu-sb-proxy@42000 { - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu2>; - reg = <0x42000 0x1000>; - }; - dcsr-cpu-sb-proxy@43000 { - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu3>; - reg = <0x43000 0x1000>; - }; - }; - - bman-portals@ff4000000 { - #address-cells = <0x1>; - #size-cells = <0x1>; - compatible = "bman-portals"; - ranges = <0x0 0xf 0xfde00000 0x200000>; - bman-portal@0 { - cell-index = <0x0>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x0 0x4000 0x100000 0x1000>; - interrupts = <105 2 0 0>; - }; - bman-portal@4000 { - cell-index = <0x1>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x4000 0x4000 0x101000 0x1000>; - interrupts = <107 2 0 0>; - }; - bman-portal@8000 { - cell-index = <2>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x8000 0x4000 0x102000 0x1000>; - interrupts = <109 2 0 0>; - }; - bman-portal@c000 { - cell-index = <0x3>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0xc000 0x4000 0x103000 0x1000>; - interrupts = <111 2 0 0>; - }; - bman-portal@10000 { - cell-index = <0x4>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x10000 0x4000 0x104000 0x1000>; - interrupts = <113 2 0 0>; - }; - bman-portal@14000 { - cell-index = <0x5>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x14000 0x4000 0x105000 0x1000>; - interrupts = <115 2 0 0>; - }; - bman-portal@18000 { - cell-index = <0x6>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x18000 0x4000 0x106000 0x1000>; - interrupts = <117 2 0 0>; - }; - bman-portal@1c000 { - cell-index = <0x7>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x1c000 0x4000 0x107000 0x1000>; - interrupts = <119 2 0 0>; - }; - bman-portal@20000 { - cell-index = <0x8>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x20000 0x4000 0x108000 0x1000>; - interrupts = <121 2 0 0>; - }; - bman-portal@24000 { - cell-index = <0x9>; - compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; - reg = <0x24000 0x4000 0x109000 0x1000>; - interrupts = <123 2 0 0>; - }; - - buffer-pool@0 { - compatible = "fsl,p2041-bpool", "fsl,bpool"; - fsl,bpid = <0>; - fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; - }; - }; - - qman-portals@ff4200000 { - #address-cells = <0x1>; - #size-cells = <0x1>; - compatible = "qman-portals"; - ranges = <0x0 0xf 0xfdc00000 0x200000>; - qportal0: qman-portal@0 { - cell-index = <0x0>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x0 0x4000 0x100000 0x1000>; - interrupts = <104 0x2 0 0>; - fsl,qman-channel-id = <0x0>; - }; - - qportal1: qman-portal@4000 { - cell-index = <0x1>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x4000 0x4000 0x101000 0x1000>; - interrupts = <106 0x2 0 0>; - fsl,qman-channel-id = <0x1>; - }; - - qportal2: qman-portal@8000 { - cell-index = <0x2>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x8000 0x4000 0x102000 0x1000>; - interrupts = <108 0x2 0 0>; - fsl,qman-channel-id = <0x2>; - }; - - qportal3: qman-portal@c000 { - cell-index = <0x3>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0xc000 0x4000 0x103000 0x1000>; - interrupts = <110 0x2 0 0>; - fsl,qman-channel-id = <0x3>; - }; - - qportal4: qman-portal@10000 { - cell-index = <0x4>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x10000 0x4000 0x104000 0x1000>; - interrupts = <112 0x2 0 0>; - fsl,qman-channel-id = <0x4>; - }; - - qportal5: qman-portal@14000 { - cell-index = <0x5>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x14000 0x4000 0x105000 0x1000>; - interrupts = <114 0x2 0 0>; - fsl,qman-channel-id = <0x5>; - }; - - qportal6: qman-portal@18000 { - cell-index = <0x6>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x18000 0x4000 0x106000 0x1000>; - interrupts = <116 0x2 0 0>; - fsl,qman-channel-id = <0x6>; - }; - - qportal7: qman-portal@1c000 { - cell-index = <0x7>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x1c000 0x4000 0x107000 0x1000>; - interrupts = <118 0x2 0 0>; - fsl,qman-channel-id = <0x7>; - }; - - qportal8: qman-portal@20000 { - cell-index = <0x8>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x20000 0x4000 0x108000 0x1000>; - interrupts = <120 0x2 0 0>; - fsl,qman-channel-id = <0x8>; - }; - - qportal9: qman-portal@24000 { - cell-index = <0x9>; - compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; - reg = <0x24000 0x4000 0x109000 0x1000>; - interrupts = <122 0x2 0 0>; - fsl,qman-channel-id = <0x9>; - }; - - qpool1: qman-pool@1 { - cell-index = <1>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x21>; - }; - - qpool2: qman-pool@2 { - cell-index = <2>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x22>; - }; - - qpool3: qman-pool@3 { - cell-index = <3>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x23>; - }; - - qpool4: qman-pool@4 { - cell-index = <4>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x24>; - }; - - qpool5: qman-pool@5 { - cell-index = <5>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x25>; - }; - - qpool6: qman-pool@6 { - cell-index = <6>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x26>; - }; - - qpool7: qman-pool@7 { - cell-index = <7>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x27>; - }; - - qpool8: qman-pool@8 { - cell-index = <8>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x28>; - }; - - qpool9: qman-pool@9 { - cell-index = <9>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x29>; - }; - - qpool10: qman-pool@10 { - cell-index = <10>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2a>; - }; - - qpool11: qman-pool@11 { - cell-index = <11>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2b>; - }; - - qpool12: qman-pool@12 { - cell-index = <12>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2c>; - }; - - qpool13: qman-pool@13 { - cell-index = <13>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2d>; - }; - - qpool14: qman-pool@14 { - cell-index = <14>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2e>; - }; - - qpool15: qman-pool@15 { - cell-index = <15>; - compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2f>; - }; - }; - - soc: soc@ffe000000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "soc"; - compatible = "simple-bus"; - - bus-frequency = <0>; // Filled out by kernel. - - ranges = <0x00000000 0xf 0xfe000000 0x1000000>; - reg = <0xf 0xfe000000 0 0x00001000>; - - soc-sram-error { - compatible = "fsl,soc-sram-error"; - interrupts = <16 2 1 29>; - }; - - corenet-law@0 { - compatible = "fsl,corenet-law"; - reg = <0x0 0x1000>; - fsl,num-laws = <32>; - }; - - ddr: memory-controller@8000 { - compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller"; - reg = <0x8000 0x1000>; - interrupts = <16 2 1 23>; - }; - - cpc: l3-cache-controller@10000 { - compatible = "fsl,p2041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache"; - reg = <0x10000 0x1000>; - interrupts = <16 2 1 27>; - }; - - corenet-cf@18000 { - compatible = "fsl,corenet-cf"; - reg = <0x18000 0x1000>; - interrupts = <16 2 1 31>; - fsl,ccf-num-csdids = <32>; - fsl,ccf-num-snoopids = <32>; - }; - - iommu@20000 { - compatible = "fsl,pamu-v1.0", "fsl,pamu"; - reg = <0x20000 0x4000>; - interrupts = < - 24 2 0 0 - 16 2 1 30>; - }; - - mpic: pic@40000 { - clock-frequency = <0>; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <4>; - reg = <0x40000 0x40000>; - compatible = "fsl,mpic", "chrp,open-pic"; - device_type = "open-pic"; - }; - - msi0: msi@41600 { - compatible = "fsl,mpic-msi"; - reg = <0x41600 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe0 0 0 0 - 0xe1 0 0 0 - 0xe2 0 0 0 - 0xe3 0 0 0 - 0xe4 0 0 0 - 0xe5 0 0 0 - 0xe6 0 0 0 - 0xe7 0 0 0>; - }; - - msi1: msi@41800 { - compatible = "fsl,mpic-msi"; - reg = <0x41800 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe8 0 0 0 - 0xe9 0 0 0 - 0xea 0 0 0 - 0xeb 0 0 0 - 0xec 0 0 0 - 0xed 0 0 0 - 0xee 0 0 0 - 0xef 0 0 0>; - }; - - msi2: msi@41a00 { - compatible = "fsl,mpic-msi"; - reg = <0x41a00 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xf0 0 0 0 - 0xf1 0 0 0 - 0xf2 0 0 0 - 0xf3 0 0 0 - 0xf4 0 0 0 - 0xf5 0 0 0 - 0xf6 0 0 0 - 0xf7 0 0 0>; - }; - - guts: global-utilities@e0000 { - compatible = "fsl,qoriq-device-config-1.0"; - reg = <0xe0000 0xe00>; - fsl,has-rstcr; - #sleep-cells = <1>; - fsl,liodn-bits = <12>; - }; - - pins: global-utilities@e0e00 { - compatible = "fsl,qoriq-pin-control-1.0"; - reg = <0xe0e00 0x200>; - #sleep-cells = <2>; - }; - - clockgen: global-utilities@e1000 { - compatible = "fsl,p2041-clockgen", "fsl,qoriq-clockgen-1.0"; - reg = <0xe1000 0x1000>; - clock-frequency = <0>; - }; - - rcpm: global-utilities@e2000 { - compatible = "fsl,qoriq-rcpm-1.0"; - reg = <0xe2000 0x1000>; - #sleep-cells = <1>; - }; - - sfp: sfp@e8000 { - compatible = "fsl,p2041-sfp", "fsl,qoriq-sfp-1.0"; - reg = <0xe8000 0x1000>; - }; - - serdes: serdes@ea000 { - compatible = "fsl,p2041-serdes"; - reg = <0xea000 0x1000>; - }; - - dma0: dma@100300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,p2041-dma", "fsl,eloplus-dma"; - reg = <0x100300 0x4>; - ranges = <0x0 0x100100 0x200>; - cell-index = <0>; - dma-channel@0 { - compatible = "fsl,p2041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupts = <28 2 0 0>; - }; - dma-channel@80 { - compatible = "fsl,p2041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupts = <29 2 0 0>; - }; - dma-channel@100 { - compatible = "fsl,p2041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupts = <30 2 0 0>; - }; - dma-channel@180 { - compatible = "fsl,p2041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupts = <31 2 0 0>; - }; - }; - - dma1: dma@101300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,p2041-dma", "fsl,eloplus-dma"; - reg = <0x101300 0x4>; - ranges = <0x0 0x101100 0x200>; - cell-index = <1>; - dma-channel@0 { - compatible = "fsl,p2041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupts = <32 2 0 0>; - }; - dma-channel@80 { - compatible = "fsl,p2041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupts = <33 2 0 0>; - }; - dma-channel@100 { - compatible = "fsl,p2041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupts = <34 2 0 0>; - }; - dma-channel@180 { - compatible = "fsl,p2041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupts = <35 2 0 0>; - }; - }; - - spi@110000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,p2041-espi", "fsl,mpc8536-espi"; - reg = <0x110000 0x1000>; - interrupts = <53 0x2 0 0>; - fsl,espi-num-chipselects = <4>; - }; - - sdhc: sdhc@114000 { - compatible = "fsl,p2041-esdhc", "fsl,esdhc"; - reg = <0x114000 0x1000>; - interrupts = <48 2 0 0>; - sdhci,auto-cmd12; - clock-frequency = <0>; - }; - - i2c@118000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <0>; - compatible = "fsl-i2c"; - reg = <0x118000 0x100>; - interrupts = <38 2 0 0>; - dfsrr; - }; - - i2c@118100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <1>; - compatible = "fsl-i2c"; - reg = <0x118100 0x100>; - interrupts = <38 2 0 0>; - dfsrr; - }; - - i2c@119000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <2>; - compatible = "fsl-i2c"; - reg = <0x119000 0x100>; - interrupts = <39 2 0 0>; - dfsrr; - }; - - i2c@119100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <3>; - compatible = "fsl-i2c"; - reg = <0x119100 0x100>; - interrupts = <39 2 0 0>; - dfsrr; - }; - - serial0: serial@11c500 { - cell-index = <0>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11c500 0x100>; - clock-frequency = <0>; - interrupts = <36 2 0 0>; - }; - - serial1: serial@11c600 { - cell-index = <1>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11c600 0x100>; - clock-frequency = <0>; - interrupts = <36 2 0 0>; - }; - - serial2: serial@11d500 { - cell-index = <2>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11d500 0x100>; - clock-frequency = <0>; - interrupts = <37 2 0 0>; - }; - - serial3: serial@11d600 { - cell-index = <3>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11d600 0x100>; - clock-frequency = <0>; - interrupts = <37 2 0 0>; - }; - - gpio0: gpio@130000 { - compatible = "fsl,p2041-gpio", "fsl,qoriq-gpio"; - reg = <0x130000 0x1000>; - interrupts = <55 2 0 0>; - #gpio-cells = <2>; - gpio-controller; - }; - - rman: rman@1e0000 { - compatible = "fsl,rman"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x1e0000 0x20000>; - reg = <0x1e0000 0x20000>; - interrupts = <16 2 1 11>; /* err_irq */ - fsl,qman-channels-id = <0x62 0x63>; - - inbound-block@0 { - compatible = "fsl,rman-inbound-block"; - reg = <0x0 0x800>; - }; - global-cfg@b00 { - compatible = "fsl,rman-global-cfg"; - reg = <0xb00 0x500>; - }; - inbound-block@1000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x1000 0x800>; - }; - inbound-block@2000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x2000 0x800>; - }; - inbound-block@3000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x3000 0x800>; - }; - }; - - usb0: usb@210000 { - compatible = "fsl,p2041-usb2-mph", - "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph"; - reg = <0x210000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <44 0x2 0 0>; - phy_type = "utmi"; - port0; - }; - - usb1: usb@211000 { - compatible = "fsl,p2041-usb2-dr", - "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr"; - reg = <0x211000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <45 0x2 0 0>; - phy_type = "utmi"; - }; - - sata@220000 { - compatible = "fsl,p2041-sata", "fsl,pq-sata-v2"; - reg = <0x220000 0x1000>; - interrupts = <68 0x2 0 0>; - }; - - sata@221000 { - compatible = "fsl,p2041-sata", "fsl,pq-sata-v2"; - reg = <0x221000 0x1000>; - interrupts = <69 0x2 0 0>; - }; - - crypto: crypto@300000 { - compatible = "fsl,sec-v4.2", "fsl,sec-v4.0"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x300000 0x10000>; - ranges = <0 0x300000 0x10000>; - interrupts = <92 2 0 0>; - - sec_jr0: jr@1000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x1000 0x1000>; - interrupts = <88 2 0 0>; - }; - - sec_jr1: jr@2000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x2000 0x1000>; - interrupts = <89 2 0 0>; - }; - - sec_jr2: jr@3000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x3000 0x1000>; - interrupts = <90 2 0 0>; - }; - - sec_jr3: jr@4000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x4000 0x1000>; - interrupts = <91 2 0 0>; - }; - - rtic@6000 { - compatible = "fsl,sec-v4.2-rtic", - "fsl,sec-v4.0-rtic"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x6000 0x100>; - ranges = <0x0 0x6100 0xe00>; - - rtic_a: rtic-a@0 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x00 0x20 0x100 0x80>; - }; - - rtic_b: rtic-b@20 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x20 0x20 0x200 0x80>; - }; - - rtic_c: rtic-c@40 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x40 0x20 0x300 0x80>; - }; - - rtic_d: rtic-d@60 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x60 0x20 0x500 0x80>; - }; - }; - }; - - sec_mon: sec_mon@314000 { - compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon"; - reg = <0x314000 0x1000>; - interrupts = <93 2 0 0>; - }; - - pme: pme@316000 { - compatible = "fsl,pme"; - reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ - interrupts = <16 2 1 5>; - }; - - qman: qman@318000 { - compatible = "fsl,p2041-qman", "fsl,qman"; - reg = <0x318000 0x1000>; - interrupts = <16 2 1 3>; - /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ - }; - - bman: bman@31a000 { - compatible = "fsl,p2041-bman", "fsl,bman"; - reg = <0x31a000 0x1000>; - interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ - }; - - fman0: fman@400000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <0>; - compatible = "fsl,p2041-fman", "fsl,fman", "simple-bus"; - ranges = <0 0x400000 0x100000>; - reg = <0x400000 0x100000>; - clock-frequency = <0>; - interrupts = < - 96 2 0 0 - 16 2 1 1>; - - cc@0 { - compatible = "fsl,p2041-fman-cc", "fsl,fman-cc"; - }; - - parser@c7000 { - compatible = "fsl,p2041-fman-parser", "fsl,fman-parser"; - reg = <0xc7000 0x1000>; - }; - - keygen@c1000 { - compatible = "fsl,p2041-fman-keygen", "fsl,fman-keygen"; - reg = <0xc1000 0x1000>; - }; - - policer@c0000 { - compatible = "fsl,p2041-fman-policer", "fsl,fman-policer"; - reg = <0xc0000 0x1000>; - }; - - muram@0 { - compatible = "fsl,p2041-fman-muram", "fsl,fman-muram"; - reg = <0x0 0x28000>; - }; - - bmi@80000 { - compatible = "fsl,p2041-fman-bmi", "fsl,fman-bmi"; - reg = <0x80000 0x400>; - }; - - qmi@80400 { - compatible = "fsl,p2041-fman-qmi", "fsl,fman-qmi"; - reg = <0x80400 0x400>; - }; - - fman0_rx0: port@88000 { - cell-index = <0>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x88000 0x1000>; - }; - fman0_rx1: port@89000 { - cell-index = <1>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x89000 0x1000>; - }; - fman0_rx2: port@8a000 { - cell-index = <2>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8a000 0x1000>; - }; - fman0_rx3: port@8b000 { - cell-index = <3>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8b000 0x1000>; - }; - fman0_rx4: port@8c000 { - cell-index = <4>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8c000 0x1000>; - }; - fman0_rx5: port@90000 { - cell-index = <0>; - compatible = "fsl,p2041-fman-port-10g-rx", "fsl,fman-port-10g-rx"; - reg = <0x90000 0x1000>; - }; - - fman0_tx5: port@b0000 { - cell-index = <0>; - compatible = "fsl,p2041-fman-port-10g-tx", "fsl,fman-port-10g-tx"; - reg = <0xb0000 0x1000>; - fsl,qman-channel-id = <0x40>; - }; - fman0_tx0: port@a8000 { - cell-index = <0>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xa8000 0x1000>; - fsl,qman-channel-id = <0x41>; - }; - fman0_tx1: port@a9000 { - cell-index = <1>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xa9000 0x1000>; - fsl,qman-channel-id = <0x42>; - }; - fman0_tx2: port@aa000 { - cell-index = <2>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xaa000 0x1000>; - fsl,qman-channel-id = <0x43>; - }; - fman0_tx3: port@ab000 { - cell-index = <3>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xab000 0x1000>; - fsl,qman-channel-id = <0x44>; - }; - fman0_tx4: port@ac000 { - cell-index = <4>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xac000 0x1000>; - fsl,qman-channel-id = <0x45>; - }; - - fman0_oh0: port@81000 { - cell-index = <0>; - compatible = "fsl,p2041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x81000 0x1000>; - fsl,qman-channel-id = <0x46>; - }; - fman0_oh1: port@82000 { - cell-index = <1>; - compatible = "fsl,p2041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x82000 0x1000>; - fsl,qman-channel-id = <0x47>; - }; - fman0_oh2: port@83000 { - cell-index = <2>; - compatible = "fsl,p2041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x83000 0x1000>; - fsl,qman-channel-id = <0x48>; - }; - fman0_oh3: port@84000 { - cell-index = <3>; - compatible = "fsl,p2041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x84000 0x1000>; - fsl,qman-channel-id = <0x49>; - }; - fman0_oh4: port@85000 { - cell-index = <4>; - compatible = "fsl,p2041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x85000 0x1000>; - fsl,qman-channel-id = <0x4a>; - }; - fman0_oh5: port@86000 { - cell-index = <5>; - compatible = "fsl,p2041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x86000 0x1000>; - fsl,qman-channel-id = <0x4b>; - }; - fman0_oh6: port@87000 { - cell-index = <6>; - compatible = "fsl,p2041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x87000 0x1000>; - }; - - enet0: ethernet@e0000 { - cell-index = <0>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe0000 0x1000>; - fsl,port-handles = <&fman0_rx0 &fman0_tx0>; - }; - - mdio0: mdio@e1120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-mdio"; - reg = <0xe1120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet1: ethernet@e2000 { - cell-index = <1>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe2000 0x1000>; - fsl,port-handles = <&fman0_rx1 &fman0_tx1>; - }; - - mdio@e3120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe3120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet2: ethernet@e4000 { - cell-index = <2>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe4000 0x1000>; - fsl,port-handles = <&fman0_rx2 &fman0_tx2>; - }; - - mdio@e5120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe5120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet3: ethernet@e6000 { - cell-index = <3>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe6000 0x1000>; - fsl,port-handles = <&fman0_rx3 &fman0_tx3>; - }; - - mdio@e7120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe7120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet4: ethernet@e8000 { - cell-index = <4>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe8000 0x1000>; - fsl,port-handles = <&fman0_rx4 &fman0_tx4>; - }; - - mdio@e9120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe9120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet5: ethernet@f0000 { - cell-index = <0>; - compatible = "fsl,p2041-fman-10g-mac", "fsl,fman-10g-mac"; - reg = <0xf0000 0x1000>; - fsl,port-handles = <&fman0_rx5 &fman0_tx5>; - }; - - mdio@f1000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-xmdio"; - reg = <0xf1000 0x1000>; - interrupts = <100 1 0 0>; - }; - }; - }; - - rapidio@ffe0c0000 { - compatible = "fsl,srio"; - interrupts = <16 2 1 11>; - #address-cells = <2>; - #size-cells = <2>; - ranges; - - port1 { - #address-cells = <2>; - #size-cells = <2>; - cell-index = <1>; - }; - - port2 { - #address-cells = <2>; - #size-cells = <2>; - cell-index = <2>; - }; - }; - - localbus@ffe124000 { - compatible = "fsl,p2041-elbc", "fsl,elbc", "simple-bus"; - interrupts = <25 2 0 0>; - #address-cells = <2>; - #size-cells = <1>; - }; - - pci0: pcie@ffe200000 { - compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "disabled"; - #size-cells = <2>; - #address-cells = <3>; - bus-range = <0x0 0xff>; - clock-frequency = <33333333>; - fsl,msi = <&msi0>; - interrupts = <16 2 1 15>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 15>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 40 1 0 0 - 0000 0 0 2 &mpic 1 1 0 0 - 0000 0 0 3 &mpic 2 1 0 0 - 0000 0 0 4 &mpic 3 1 0 0 - >; - }; - }; - - pci1: pcie@ffe201000 { - compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "okay"; - #size-cells = <2>; - #address-cells = <3>; - bus-range = <0 0xff>; - clock-frequency = <33333333>; - fsl,msi = <&msi1>; - interrupts = <16 2 1 14>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 14>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 41 1 0 0 - 0000 0 0 2 &mpic 5 1 0 0 - 0000 0 0 3 &mpic 6 1 0 0 - 0000 0 0 4 &mpic 7 1 0 0 - >; - }; - }; - - pci2: pcie@ffe202000 { - compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "disabled"; - #size-cells = <2>; - #address-cells = <3>; - bus-range = <0x0 0xff>; - clock-frequency = <33333333>; - fsl,msi = <&msi2>; - interrupts = <16 2 1 13>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 13>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 42 1 0 0 - 0000 0 0 2 &mpic 9 1 0 0 - 0000 0 0 3 &mpic 10 1 0 0 - 0000 0 0 4 &mpic 11 1 0 0 - >; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/p3041ds.dts b/usr/src/boot/sys/boot/fdt/dts/powerpc/p3041ds.dts deleted file mode 100644 index 70787e4327..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/p3041ds.dts +++ /dev/null @@ -1,587 +0,0 @@ -/* - * P3041DS Device Tree Source - * - * Copyright 2010-2011 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* $FreeBSD$ */ - -/include/ "p3041si.dtsi" - -/ { - model = "fsl,P3041DS"; - compatible = "fsl,P3041DS"; - #address-cells = <2>; - #size-cells = <2>; - interrupt-parent = <&mpic>; - - aliases { - phy_rgmii_0 = &phy_rgmii_0; - phy_rgmii_1 = &phy_rgmii_1; - phy_sgmii_1c = &phy_sgmii_1c; - phy_sgmii_1d = &phy_sgmii_1d; - phy_sgmii_1e = &phy_sgmii_1e; - phy_sgmii_1f = &phy_sgmii_1f; - phy_xgmii_1 = &phy_xgmii_1; - phy_xgmii_2 = &phy_xgmii_2; - emi1_rgmii = &hydra_mdio_rgmii; - emi1_sgmii = &hydra_mdio_sgmii; - emi2_xgmii = &hydra_mdio_xgmii; - }; - - memory { - device_type = "memory"; - reg = <0x00000000 0x00000000 0x00000000 0x80000000>; - }; - - dcsr: dcsr@f00000000 { - ranges = <0x00000000 0xf 0x00000000 0x01008000>; - }; - - bman-portals@ff4000000 { - bman-portal@0 { - cpu-handle = <&cpu0>; - }; - bman-portal@4000 { - cpu-handle = <&cpu1>; - }; - bman-portal@8000 { - cpu-handle = <&cpu2>; - }; - bman-portal@c000 { - cpu-handle = <&cpu3>; - }; - bman-portal@10000 { - }; - bman-portal@14000 { - }; - bman-portal@18000 { - }; - bman-portal@1c000 { - }; - bman-portal@20000 { - }; - bman-portal@24000 { - }; - - buffer-pool@0 { - compatible = "fsl,p3041-bpool", "fsl,bpool"; - fsl,bpid = <0>; - fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; - }; - }; - - qman-portals@ff4200000 { - qportal0: qman-portal@0 { - cpu-handle = <&cpu0>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal1: qman-portal@4000 { - cpu-handle = <&cpu1>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal2: qman-portal@8000 { - cpu-handle = <&cpu2>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal3: qman-portal@c000 { - cpu-handle = <&cpu3>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal4: qman-portal@10000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal5: qman-portal@14000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal6: qman-portal@18000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal7: qman-portal@1c000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal8: qman-portal@20000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal9: qman-portal@24000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - }; - - soc: soc@ffe000000 { - spi@110000 { - flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spansion,s25sl12801"; - reg = <0>; - spi-max-frequency = <35000000>; /* input clock */ - partition@u-boot { - label = "u-boot"; - reg = <0x00000000 0x00100000>; - read-only; - }; - partition@kernel { - label = "kernel"; - reg = <0x00100000 0x00500000>; - read-only; - }; - partition@dtb { - label = "dtb"; - reg = <0x00600000 0x00100000>; - read-only; - }; - partition@fs { - label = "file system"; - reg = <0x00700000 0x00900000>; - }; - }; - }; - - i2c@118100 { - eeprom@51 { - compatible = "at24,24c256"; - reg = <0x51>; - }; - eeprom@52 { - compatible = "at24,24c256"; - reg = <0x52>; - }; - }; - - i2c@119100 { - rtc@68 { - compatible = "dallas,ds3232"; - reg = <0x68>; - interrupts = <0x1 0x1 0 0>; - }; - }; - - pme: pme@316000 { - /* Commented out, use default allocation */ - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ - }; - - qman: qman@318000 { - /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ - }; - - bman: bman@31a000 { - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ - }; - - fman0: fman@400000 { - enet0: ethernet@e0000 { - tbi-handle = <&tbi0>; - phy-handle = <&phy_rgmii_0>; - phy-connection-type = "rgmii"; - }; - - mdio0: mdio@e1120 { - tbi0: tbi-phy@8 { - reg = <0x8>; - device_type = "tbi-phy"; - }; - - /* - * Virtual MDIO for the two on-board RGMII - * ports. The fsl,hydra-mdio-muxval property - * is already correct. - */ - hydra_mdio_rgmii: hydra-mdio-rgmii { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,hydra-mdio"; - fsl,mdio-handle = <&mdio0>; - fsl,hydra-mdio-muxval = <0x00>; - status = "disabled"; - - phy_rgmii_0: ethernet-phy@0 { - reg = <0x0>; - }; - phy_rgmii_1: ethernet-phy@1 { - reg = <0x1>; - }; - }; - - /* - * Virtual MDIO for the four-port SGMII card. - * The fsl,hydra-mdio-muxval property will be - * fixed-up by U-Boot based on the slot that - * the SGMII card is in. - * - * Note: we do not support DTSEC5 connected to - * SGMII, so this is the only SGMII node. - */ - hydra_mdio_sgmii: hydra-mdio-sgmii { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,hydra-mdio"; - fsl,mdio-handle = <&mdio0>; - fsl,hydra-mdio-muxval = <0x00>; - status = "disabled"; - - phy_sgmii_1c: ethernet-phy@1c { - reg = <0x1c>; - }; - phy_sgmii_1d: ethernet-phy@1d { - reg = <0x1d>; - }; - phy_sgmii_1e: ethernet-phy@1e { - reg = <0x1e>; - }; - phy_sgmii_1f: ethernet-phy@1f { - reg = <0x1f>; - }; - }; - }; - - enet1: ethernet@e2000 { - tbi-handle = <&tbi1>; - phy-handle = <&phy_sgmii_1d>; - phy-connection-type = "sgmii"; - }; - - mdio@e3120 { - tbi1: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet2: ethernet@e4000 { - tbi-handle = <&tbi2>; - phy-handle = <&phy_sgmii_1e>; - phy-connection-type = "sgmii"; - }; - - mdio@e5120 { - tbi2: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet3: ethernet@e6000 { - tbi-handle = <&tbi3>; - phy-handle = <&phy_sgmii_1f>; - phy-connection-type = "sgmii"; - }; - - mdio@e7120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe7120 0xee0>; - interrupts = <100 1 0 0>; - - tbi3: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet4: ethernet@e8000 { - tbi-handle = <&tbi4>; - phy-handle = <&phy_rgmii_1>; - phy-connection-type = "rgmii"; - }; - - mdio@e9120 { - tbi4: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet5: ethernet@f0000 { - /* - * phy-handle will be updated by U-Boot to - * reflect the actual slot the XAUI card is in. - */ - phy-handle = <&phy_xgmii_1>; - phy-connection-type = "xgmii"; - }; - - /* - * We only support one XAUI card, so the MDIO muxing - * is set by U-Boot, and Linux never touches it. - * Therefore, we don't need a virtual MDIO node. - * However, the phy address depends on the slot, so - * only one of the ethernet-phy nodes below will be - * used. - */ - hydra_mdio_xgmii: mdio@f1000 { - status = "disabled"; - - /* XAUI card in slot 1 */ - phy_xgmii_1: ethernet-phy@4 { - reg = <0x4>; - }; - - /* XAUI card in slot 2 */ - phy_xgmii_2: ethernet-phy@0 { - reg = <0x0>; - }; - }; - }; - }; - - rapidio@ffe0c0000 { - reg = <0xf 0xfe0c0000 0 0x11000>; - - port1 { - ranges = <0 0 0xc 0x20000000 0 0x10000000>; - }; - port2 { - ranges = <0 0 0xc 0x30000000 0 0x10000000>; - }; - }; - - localbus@ffe124000 { - reg = <0xf 0xfe124000 0 0x1000>; - ranges = <0 0 0xf 0xb8000000 0x04000000>; - - flash@0,0 { - compatible = "cfi-flash"; - /* - * Map 64Mb of 128MB NOR flash memory. Since highest - * line of address of NOR flash memory are set by - * FPGA, memory are divided into two pages equal to - * 64MB. One of the pages can be accessed at once. - */ - reg = <0 0 0x04000000>; - bank-width = <2>; - device-width = <2>; - }; - - nand@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,elbc-fcm-nand"; - reg = <0x2 0x0 0x40000>; - - partition@0 { - label = "NAND U-Boot Image"; - reg = <0x0 0x02000000>; - read-only; - }; - - partition@2000000 { - label = "NAND Root File System"; - reg = <0x02000000 0x10000000>; - }; - - partition@12000000 { - label = "NAND Compressed RFS Image"; - reg = <0x12000000 0x08000000>; - }; - - partition@1a000000 { - label = "NAND Linux Kernel Image"; - reg = <0x1a000000 0x04000000>; - }; - - partition@1e000000 { - label = "NAND DTB Image"; - reg = <0x1e000000 0x01000000>; - }; - - partition@1f000000 { - label = "NAND Writable User area"; - reg = <0x1f000000 0x21000000>; - }; - }; - - board-control@3,0 { - compatible = "fsl,p3041ds-fpga", "fsl,fpga-ngpixis"; - reg = <3 0 0x30>; - }; - }; - - pci0: pcie@ffe200000 { - reg = <0xf 0xfe200000 0 0x1000>; - ranges = <0x02000000 0 0x80000000 0x0 0x80000000 0x0 0x10000000 - 0x01000000 0 0x00000000 0x0 0xff000000 0x0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0x80000000 - 0x02000000 0 0x80000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff000000 - 0 0x00010000>; - }; - }; - - pci1: pcie@ffe201000 { - reg = <0xf 0xfe201000 0 0x1000>; - ranges = <0x02000000 0x0 0x90000000 0x0 0x90000000 0x0 0x10000000 - 0x01000000 0x0 0x00000000 0x0 0xff010000 0x0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0x90000000 - 0x02000000 0 0x90000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff010000 - 0 0x00010000>; - }; - }; - - pci2: pcie@ffe202000 { - reg = <0xf 0xfe202000 0 0x1000>; - ranges = <0x02000000 0 0xa0000000 0x0 0xa0000000 0 0x10000000 - 0x01000000 0 0x00000000 0x0 0xff020000 0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0xa0000000 - 0x02000000 0 0xa0000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff020000 - 0 0x00010000>; - }; - }; - - pci3: pcie@ffe203000 { - reg = <0xf 0xfe203000 0 0x1000>; - ranges = <0x02000000 0 0xb0000000 0x0 0xb0000000 0 0x08000000 - 0x01000000 0 0x00000000 0x0 0xff030000 0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0xb0000000 - 0x02000000 0 0xb0000000 - 0 0x08000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff030000 - 0 0x00010000>; - }; - }; - - fsl,dpaa { - compatible = "fsl,p3041-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status="okay"; - }; - ethernet@1 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "disabled"; - }; - ethernet@2 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "disabled"; - }; - ethernet@3 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "disabled"; - }; - ethernet@4 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "disabled"; - }; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/p3041si.dtsi b/usr/src/boot/sys/boot/fdt/dts/powerpc/p3041si.dtsi deleted file mode 100644 index 3335e48d47..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/p3041si.dtsi +++ /dev/null @@ -1,1339 +0,0 @@ -/* - * P3041 Silicon Device Tree Source - * - * Copyright 2010-2011 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* $FreeBSD$ */ - -/dts-v1/; - -/ { - compatible = "fsl,P3041"; - #address-cells = <2>; - #size-cells = <2>; - interrupt-parent = <&mpic>; - - aliases { - ccsr = &soc; - dcsr = &dcsr; - - ethernet0 = &enet0; - ethernet1 = &enet1; - ethernet2 = &enet2; - ethernet3 = &enet3; - ethernet4 = &enet4; - ethernet5 = &enet5; - serial0 = &serial0; - serial1 = &serial1; - serial2 = &serial2; - serial3 = &serial3; - pci0 = &pci0; - pci1 = &pci1; - pci2 = &pci2; - pci3 = &pci3; - usb0 = &usb0; - usb1 = &usb1; - dma0 = &dma0; - dma1 = &dma1; - bman = &bman; - qman = &qman; - pme = &pme; - rman = &rman; - sdhc = &sdhc; - msi0 = &msi0; - msi1 = &msi1; - msi2 = &msi2; - - crypto = &crypto; - sec_jr0 = &sec_jr0; - sec_jr1 = &sec_jr1; - sec_jr2 = &sec_jr2; - sec_jr3 = &sec_jr3; - rtic_a = &rtic_a; - rtic_b = &rtic_b; - rtic_c = &rtic_c; - rtic_d = &rtic_d; - sec_mon = &sec_mon; - - fman0 = &fman0; - fman0_oh0 = &fman0_oh0; - fman0_oh1 = &fman0_oh1; - fman0_oh2 = &fman0_oh2; - fman0_oh3 = &fman0_oh3; - fman0_oh4 = &fman0_oh4; - fman0_oh5 = &fman0_oh5; - fman0_oh6 = &fman0_oh6; - fman0_rx0 = &fman0_rx0; - fman0_rx1 = &fman0_rx1; - fman0_rx2 = &fman0_rx2; - fman0_rx3 = &fman0_rx3; - fman0_rx4 = &fman0_rx4; - fman0_rx5 = &fman0_rx5; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu0: PowerPC,e500mc@0 { - device_type = "cpu"; - reg = <0>; - bus-frequency = <749999996>; - next-level-cache = <&L2_0>; - L2_0: l2-cache { - next-level-cache = <&cpc>; - }; - }; - cpu1: PowerPC,e500mc@1 { - device_type = "cpu"; - reg = <1>; - next-level-cache = <&L2_1>; - L2_1: l2-cache { - next-level-cache = <&cpc>; - }; - }; - cpu2: PowerPC,e500mc@2 { - device_type = "cpu"; - reg = <2>; - next-level-cache = <&L2_2>; - L2_2: l2-cache { - next-level-cache = <&cpc>; - }; - }; - cpu3: PowerPC,e500mc@3 { - device_type = "cpu"; - reg = <3>; - next-level-cache = <&L2_3>; - L2_3: l2-cache { - next-level-cache = <&cpc>; - }; - }; - }; - - dcsr: dcsr@f00000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,dcsr", "simple-bus"; - - dcsr-epu@0 { - compatible = "fsl,dcsr-epu"; - interrupts = <52 2 0 0 - 84 2 0 0 - 85 2 0 0>; - interrupt-parent = <&mpic>; - reg = <0x0 0x1000>; - }; - dcsr-npc { - compatible = "fsl,dcsr-npc"; - reg = <0x1000 0x1000 0x1000000 0x8000>; - }; - dcsr-nxc@2000 { - compatible = "fsl,dcsr-nxc"; - reg = <0x2000 0x1000>; - }; - dcsr-corenet { - compatible = "fsl,dcsr-corenet"; - reg = <0x8000 0x1000 0xB0000 0x1000>; - }; - dcsr-dpaa@9000 { - compatible = "fsl,p43041-dcsr-dpaa", "fsl,dcsr-dpaa"; - reg = <0x9000 0x1000>; - }; - dcsr-ocn@11000 { - compatible = "fsl,p43041-dcsr-ocn", "fsl,dcsr-ocn"; - reg = <0x11000 0x1000>; - }; - dcsr-ddr@12000 { - compatible = "fsl,dcsr-ddr"; - dev-handle = <&ddr>; - reg = <0x12000 0x1000>; - }; - dcsr-nal@18000 { - compatible = "fsl,p43041-dcsr-nal", "fsl,dcsr-nal"; - reg = <0x18000 0x1000>; - }; - dcsr-rcpm@22000 { - compatible = "fsl,p43041-dcsr-rcpm", "fsl,dcsr-rcpm"; - reg = <0x22000 0x1000>; - }; - dcsr-cpu-sb-proxy@40000 { - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu0>; - reg = <0x40000 0x1000>; - }; - dcsr-cpu-sb-proxy@41000 { - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu1>; - reg = <0x41000 0x1000>; - }; - dcsr-cpu-sb-proxy@42000 { - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu2>; - reg = <0x42000 0x1000>; - }; - dcsr-cpu-sb-proxy@43000 { - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu3>; - reg = <0x43000 0x1000>; - }; - }; - - bman-portals@ff4000000 { - #address-cells = <0x1>; - #size-cells = <0x1>; - compatible = "bman-portals"; - ranges = <0x0 0xf 0xfde00000 0x200000>; - bman-portal@0 { - cell-index = <0x0>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x0 0x4000 0x100000 0x1000>; - interrupts = <105 2 0 0>; - }; - bman-portal@4000 { - cell-index = <0x1>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x4000 0x4000 0x101000 0x1000>; - interrupts = <107 2 0 0>; - }; - bman-portal@8000 { - cell-index = <2>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x8000 0x4000 0x102000 0x1000>; - interrupts = <109 2 0 0>; - }; - bman-portal@c000 { - cell-index = <0x3>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0xc000 0x4000 0x103000 0x1000>; - interrupts = <111 2 0 0>; - }; - bman-portal@10000 { - cell-index = <0x4>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x10000 0x4000 0x104000 0x1000>; - interrupts = <113 2 0 0>; - }; - bman-portal@14000 { - cell-index = <0x5>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x14000 0x4000 0x105000 0x1000>; - interrupts = <115 2 0 0>; - }; - bman-portal@18000 { - cell-index = <0x6>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x18000 0x4000 0x106000 0x1000>; - interrupts = <117 2 0 0>; - }; - bman-portal@1c000 { - cell-index = <0x7>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x1c000 0x4000 0x107000 0x1000>; - interrupts = <119 2 0 0>; - }; - bman-portal@20000 { - cell-index = <0x8>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x20000 0x4000 0x108000 0x1000>; - interrupts = <121 2 0 0>; - }; - bman-portal@24000 { - cell-index = <0x9>; - compatible = "fsl,p3041-bman-portal", "fsl,bman-portal"; - reg = <0x24000 0x4000 0x109000 0x1000>; - interrupts = <123 2 0 0>; - }; - - buffer-pool@0 { - compatible = "fsl,p3041-bpool", "fsl,bpool"; - fsl,bpid = <0>; - fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; - }; - }; - - qman-portals@ff4200000 { - #address-cells = <0x1>; - #size-cells = <0x1>; - compatible = "qman-portals"; - ranges = <0x0 0xf 0xfdc00000 0x200000>; - qportal0: qman-portal@0 { - cell-index = <0x0>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x0 0x4000 0x100000 0x1000>; - interrupts = <104 0x2 0 0>; - fsl,qman-channel-id = <0x0>; - }; - - qportal1: qman-portal@4000 { - cell-index = <0x1>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x4000 0x4000 0x101000 0x1000>; - interrupts = <106 0x2 0 0>; - fsl,qman-channel-id = <0x1>; - }; - - qportal2: qman-portal@8000 { - cell-index = <0x2>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x8000 0x4000 0x102000 0x1000>; - interrupts = <108 0x2 0 0>; - fsl,qman-channel-id = <0x2>; - }; - - qportal3: qman-portal@c000 { - cell-index = <0x3>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0xc000 0x4000 0x103000 0x1000>; - interrupts = <110 0x2 0 0>; - fsl,qman-channel-id = <0x3>; - }; - - qportal4: qman-portal@10000 { - cell-index = <0x4>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x10000 0x4000 0x104000 0x1000>; - interrupts = <112 0x2 0 0>; - fsl,qman-channel-id = <0x4>; - }; - - qportal5: qman-portal@14000 { - cell-index = <0x5>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x14000 0x4000 0x105000 0x1000>; - interrupts = <114 0x2 0 0>; - fsl,qman-channel-id = <0x5>; - }; - - qportal6: qman-portal@18000 { - cell-index = <0x6>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x18000 0x4000 0x106000 0x1000>; - interrupts = <116 0x2 0 0>; - fsl,qman-channel-id = <0x6>; - }; - - qportal7: qman-portal@1c000 { - cell-index = <0x7>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x1c000 0x4000 0x107000 0x1000>; - interrupts = <118 0x2 0 0>; - fsl,qman-channel-id = <0x7>; - }; - - qportal8: qman-portal@20000 { - cell-index = <0x8>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x20000 0x4000 0x108000 0x1000>; - interrupts = <120 0x2 0 0>; - fsl,qman-channel-id = <0x8>; - }; - - qportal9: qman-portal@24000 { - cell-index = <0x9>; - compatible = "fsl,p3041-qman-portal", "fsl,qman-portal"; - reg = <0x24000 0x4000 0x109000 0x1000>; - interrupts = <122 0x2 0 0>; - fsl,qman-channel-id = <0x9>; - }; - - qpool1: qman-pool@1 { - cell-index = <1>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x21>; - }; - - qpool2: qman-pool@2 { - cell-index = <2>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x22>; - }; - - qpool3: qman-pool@3 { - cell-index = <3>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x23>; - }; - - qpool4: qman-pool@4 { - cell-index = <4>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x24>; - }; - - qpool5: qman-pool@5 { - cell-index = <5>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x25>; - }; - - qpool6: qman-pool@6 { - cell-index = <6>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x26>; - }; - - qpool7: qman-pool@7 { - cell-index = <7>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x27>; - }; - - qpool8: qman-pool@8 { - cell-index = <8>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x28>; - }; - - qpool9: qman-pool@9 { - cell-index = <9>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x29>; - }; - - qpool10: qman-pool@10 { - cell-index = <10>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2a>; - }; - - qpool11: qman-pool@11 { - cell-index = <11>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2b>; - }; - - qpool12: qman-pool@12 { - cell-index = <12>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2c>; - }; - - qpool13: qman-pool@13 { - cell-index = <13>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2d>; - }; - - qpool14: qman-pool@14 { - cell-index = <14>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2e>; - }; - - qpool15: qman-pool@15 { - cell-index = <15>; - compatible = "fsl,p3041-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2f>; - }; - }; - - soc: soc@ffe000000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "soc"; - compatible = "simple-bus"; - - bus-frequency = <0>; // Filled out by kernel. - - ranges = <0x00000000 0xf 0xfe000000 0x1000000>; - reg = <0xf 0xfe000000 0 0x00001000>; - - soc-sram-error { - compatible = "fsl,soc-sram-error"; - interrupts = <16 2 1 29>; - }; - - corenet-law@0 { - compatible = "fsl,corenet-law"; - reg = <0x0 0x1000>; - fsl,num-laws = <32>; - }; - - ddr: memory-controller@8000 { - compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller"; - reg = <0x8000 0x1000>; - interrupts = <16 2 1 23>; - }; - - cpc: l3-cache-controller@10000 { - compatible = "fsl,p3041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache"; - reg = <0x10000 0x1000>; - interrupts = <16 2 1 27>; - }; - - corenet-cf@18000 { - compatible = "fsl,corenet-cf"; - reg = <0x18000 0x1000>; - interrupts = <16 2 1 31>; - fsl,ccf-num-csdids = <32>; - fsl,ccf-num-snoopids = <32>; - }; - - iommu@20000 { - compatible = "fsl,pamu-v1.0", "fsl,pamu"; - reg = <0x20000 0x4000>; - interrupts = < - 24 2 0 0 - 16 2 1 30>; - }; - - mpic: pic@40000 { - clock-frequency = <0>; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <4>; - reg = <0x40000 0x40000>; - compatible = "fsl,mpic", "chrp,open-pic"; - device_type = "open-pic"; - }; - - msi0: msi@41600 { - compatible = "fsl,mpic-msi"; - reg = <0x41600 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe0 0 0 0 - 0xe1 0 0 0 - 0xe2 0 0 0 - 0xe3 0 0 0 - 0xe4 0 0 0 - 0xe5 0 0 0 - 0xe6 0 0 0 - 0xe7 0 0 0>; - }; - - msi1: msi@41800 { - compatible = "fsl,mpic-msi"; - reg = <0x41800 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe8 0 0 0 - 0xe9 0 0 0 - 0xea 0 0 0 - 0xeb 0 0 0 - 0xec 0 0 0 - 0xed 0 0 0 - 0xee 0 0 0 - 0xef 0 0 0>; - }; - - msi2: msi@41a00 { - compatible = "fsl,mpic-msi"; - reg = <0x41a00 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xf0 0 0 0 - 0xf1 0 0 0 - 0xf2 0 0 0 - 0xf3 0 0 0 - 0xf4 0 0 0 - 0xf5 0 0 0 - 0xf6 0 0 0 - 0xf7 0 0 0>; - }; - - guts: global-utilities@e0000 { - compatible = "fsl,qoriq-device-config-1.0"; - reg = <0xe0000 0xe00>; - fsl,has-rstcr; - #sleep-cells = <1>; - fsl,liodn-bits = <12>; - }; - - pins: global-utilities@e0e00 { - compatible = "fsl,qoriq-pin-control-1.0"; - reg = <0xe0e00 0x200>; - #sleep-cells = <2>; - }; - - clockgen: global-utilities@e1000 { - compatible = "fsl,p3041-clockgen", "fsl,qoriq-clockgen-1.0"; - reg = <0xe1000 0x1000>; - clock-frequency = <0>; - }; - - rcpm: global-utilities@e2000 { - compatible = "fsl,qoriq-rcpm-1.0"; - reg = <0xe2000 0x1000>; - #sleep-cells = <1>; - }; - - sfp: sfp@e8000 { - compatible = "fsl,p3041-sfp", "fsl,qoriq-sfp-1.0"; - reg = <0xe8000 0x1000>; - }; - - serdes: serdes@ea000 { - compatible = "fsl,p3041-serdes"; - reg = <0xea000 0x1000>; - }; - - dma0: dma@100300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,p3041-dma", "fsl,eloplus-dma"; - reg = <0x100300 0x4>; - ranges = <0x0 0x100100 0x200>; - cell-index = <0>; - dma-channel@0 { - compatible = "fsl,p3041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupts = <28 2 0 0>; - }; - dma-channel@80 { - compatible = "fsl,p3041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupts = <29 2 0 0>; - }; - dma-channel@100 { - compatible = "fsl,p3041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupts = <30 2 0 0>; - }; - dma-channel@180 { - compatible = "fsl,p3041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupts = <31 2 0 0>; - }; - }; - - dma1: dma@101300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,p3041-dma", "fsl,eloplus-dma"; - reg = <0x101300 0x4>; - ranges = <0x0 0x101100 0x200>; - cell-index = <1>; - dma-channel@0 { - compatible = "fsl,p3041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupts = <32 2 0 0>; - }; - dma-channel@80 { - compatible = "fsl,p3041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupts = <33 2 0 0>; - }; - dma-channel@100 { - compatible = "fsl,p3041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupts = <34 2 0 0>; - }; - dma-channel@180 { - compatible = "fsl,p3041-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupts = <35 2 0 0>; - }; - }; - - spi@110000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,p3041-espi", "fsl,mpc8536-espi"; - reg = <0x110000 0x1000>; - interrupts = <53 0x2 0 0>; - fsl,espi-num-chipselects = <4>; - }; - - sdhc: sdhc@114000 { - compatible = "fsl,p3041-esdhc", "fsl,esdhc"; - reg = <0x114000 0x1000>; - interrupts = <48 2 0 0>; - sdhci,auto-cmd12; - clock-frequency = <0>; - }; - - i2c@118000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <0>; - compatible = "fsl-i2c"; - reg = <0x118000 0x100>; - interrupts = <38 2 0 0>; - dfsrr; - }; - - i2c@118100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <1>; - compatible = "fsl-i2c"; - reg = <0x118100 0x100>; - interrupts = <38 2 0 0>; - dfsrr; - }; - - i2c@119000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <2>; - compatible = "fsl-i2c"; - reg = <0x119000 0x100>; - interrupts = <39 2 0 0>; - dfsrr; - }; - - i2c@119100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <3>; - compatible = "fsl-i2c"; - reg = <0x119100 0x100>; - interrupts = <39 2 0 0>; - dfsrr; - }; - - serial0: serial@11c500 { - cell-index = <0>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11c500 0x100>; - clock-frequency = <0>; - interrupts = <36 2 0 0>; - }; - - serial1: serial@11c600 { - cell-index = <1>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11c600 0x100>; - clock-frequency = <0>; - interrupts = <36 2 0 0>; - }; - - serial2: serial@11d500 { - cell-index = <2>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11d500 0x100>; - clock-frequency = <0>; - interrupts = <37 2 0 0>; - }; - - serial3: serial@11d600 { - cell-index = <3>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11d600 0x100>; - clock-frequency = <0>; - interrupts = <37 2 0 0>; - }; - - gpio0: gpio@130000 { - compatible = "fsl,p3041-gpio", "fsl,qoriq-gpio"; - reg = <0x130000 0x1000>; - interrupts = <55 2 0 0>; - #gpio-cells = <2>; - gpio-controller; - }; - - rman: rman@1e0000 { - compatible = "fsl,rman"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x1e0000 0x20000>; - reg = <0x1e0000 0x20000>; - interrupts = <16 2 1 11>; /* err_irq */ - fsl,qman-channels-id = <0x62 0x63>; - - inbound-block@0 { - compatible = "fsl,rman-inbound-block"; - reg = <0x0 0x800>; - }; - global-cfg@b00 { - compatible = "fsl,rman-global-cfg"; - reg = <0xb00 0x500>; - }; - inbound-block@1000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x1000 0x800>; - }; - inbound-block@2000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x2000 0x800>; - }; - inbound-block@3000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x3000 0x800>; - }; - }; - - usb0: usb@210000 { - compatible = "fsl,p3041-usb2-mph", - "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph"; - reg = <0x210000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <44 0x2 0 0>; - phy_type = "utmi"; - port0; - }; - - usb1: usb@211000 { - compatible = "fsl,p3041-usb2-dr", - "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr"; - reg = <0x211000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <45 0x2 0 0>; - dr_mode = "host"; - phy_type = "utmi"; - }; - - sata@220000 { - compatible = "fsl,p3041-sata", "fsl,pq-sata-v2"; - reg = <0x220000 0x1000>; - interrupts = <68 0x2 0 0>; - }; - - sata@221000 { - compatible = "fsl,p3041-sata", "fsl,pq-sata-v2"; - reg = <0x221000 0x1000>; - interrupts = <69 0x2 0 0>; - }; - - crypto: crypto@300000 { - compatible = "fsl,sec-v4.2", "fsl,sec-v4.0"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x300000 0x10000>; - ranges = <0 0x300000 0x10000>; - interrupts = <92 2 0 0>; - - sec_jr0: jr@1000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x1000 0x1000>; - interrupts = <88 2 0 0>; - }; - - sec_jr1: jr@2000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x2000 0x1000>; - interrupts = <89 2 0 0>; - }; - - sec_jr2: jr@3000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x3000 0x1000>; - interrupts = <90 2 0 0>; - }; - - sec_jr3: jr@4000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x4000 0x1000>; - interrupts = <91 2 0 0>; - }; - - rtic@6000 { - compatible = "fsl,sec-v4.2-rtic", - "fsl,sec-v4.0-rtic"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x6000 0x100>; - ranges = <0x0 0x6100 0xe00>; - - rtic_a: rtic-a@0 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x00 0x20 0x100 0x80>; - }; - - rtic_b: rtic-b@20 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x20 0x20 0x200 0x80>; - }; - - rtic_c: rtic-c@40 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x40 0x20 0x300 0x80>; - }; - - rtic_d: rtic-d@60 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x60 0x20 0x500 0x80>; - }; - }; - }; - - sec_mon: sec_mon@314000 { - compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon"; - reg = <0x314000 0x1000>; - interrupts = <93 2 0 0>; - }; - - pme: pme@316000 { - compatible = "fsl,pme"; - reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ - interrupts = <16 2 1 5>; - }; - - qman: qman@318000 { - compatible = "fsl,p3041-qman", "fsl,qman"; - reg = <0x318000 0x1000>; - interrupts = <16 2 1 3>; - /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ - }; - - bman: bman@31a000 { - compatible = "fsl,p3041-bman", "fsl,bman"; - reg = <0x31a000 0x1000>; - interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ - }; - - fman0: fman@400000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <0>; - compatible = "fsl,p3041-fman", "fsl,fman", "simple-bus"; - ranges = <0 0x400000 0x100000>; - reg = <0x400000 0x100000>; - clock-frequency = <0>; - interrupts = < - 96 2 0 0 - 16 2 1 1>; - - cc@0 { - compatible = "fsl,p3041-fman-cc", "fsl,fman-cc"; - }; - - parser@c7000 { - compatible = "fsl,p3041-fman-parser", "fsl,fman-parser"; - reg = <0xc7000 0x1000>; - }; - - keygen@c1000 { - compatible = "fsl,p3041-fman-keygen", "fsl,fman-keygen"; - reg = <0xc1000 0x1000>; - }; - - policer@c0000 { - compatible = "fsl,p3041-fman-policer", "fsl,fman-policer"; - reg = <0xc0000 0x1000>; - }; - - muram@0 { - compatible = "fsl,p3041-fman-muram", "fsl,fman-muram"; - reg = <0x0 0x28000>; - }; - - bmi@80000 { - compatible = "fsl,p3041-fman-bmi", "fsl,fman-bmi"; - reg = <0x80000 0x400>; - }; - - qmi@80400 { - compatible = "fsl,p3041-fman-qmi", "fsl,fman-qmi"; - reg = <0x80400 0x400>; - }; - - fman0_rx0: port@88000 { - cell-index = <0>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x88000 0x1000>; - }; - fman0_rx1: port@89000 { - cell-index = <1>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x89000 0x1000>; - }; - fman0_rx2: port@8a000 { - cell-index = <2>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8a000 0x1000>; - }; - fman0_rx3: port@8b000 { - cell-index = <3>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8b000 0x1000>; - }; - fman0_rx4: port@8c000 { - cell-index = <4>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8c000 0x1000>; - }; - fman0_rx5: port@90000 { - cell-index = <0>; - compatible = "fsl,p3041-fman-port-10g-rx", "fsl,fman-port-10g-rx"; - reg = <0x90000 0x1000>; - }; - - fman0_tx5: port@b0000 { - cell-index = <0>; - compatible = "fsl,p3041-fman-port-10g-tx", "fsl,fman-port-10g-tx"; - reg = <0xb0000 0x1000>; - fsl,qman-channel-id = <0x40>; - }; - fman0_tx0: port@a8000 { - cell-index = <0>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xa8000 0x1000>; - fsl,qman-channel-id = <0x41>; - }; - fman0_tx1: port@a9000 { - cell-index = <1>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xa9000 0x1000>; - fsl,qman-channel-id = <0x42>; - }; - fman0_tx2: port@aa000 { - cell-index = <2>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xaa000 0x1000>; - fsl,qman-channel-id = <0x43>; - }; - fman0_tx3: port@ab000 { - cell-index = <3>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xab000 0x1000>; - fsl,qman-channel-id = <0x44>; - }; - fman0_tx4: port@ac000 { - cell-index = <4>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xac000 0x1000>; - fsl,qman-channel-id = <0x45>; - }; - - fman0_oh0: port@81000 { - cell-index = <0>; - compatible = "fsl,p3041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x81000 0x1000>; - fsl,qman-channel-id = <0x46>; - }; - fman0_oh1: port@82000 { - cell-index = <1>; - compatible = "fsl,p3041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x82000 0x1000>; - fsl,qman-channel-id = <0x47>; - }; - fman0_oh2: port@83000 { - cell-index = <2>; - compatible = "fsl,p3041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x83000 0x1000>; - fsl,qman-channel-id = <0x48>; - }; - fman0_oh3: port@84000 { - cell-index = <3>; - compatible = "fsl,p3041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x84000 0x1000>; - fsl,qman-channel-id = <0x49>; - }; - fman0_oh4: port@85000 { - cell-index = <4>; - compatible = "fsl,p3041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x85000 0x1000>; - fsl,qman-channel-id = <0x4a>; - }; - fman0_oh5: port@86000 { - cell-index = <5>; - compatible = "fsl,p3041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x86000 0x1000>; - fsl,qman-channel-id = <0x4b>; - }; - fman0_oh6: port@87000 { - cell-index = <6>; - compatible = "fsl,p3041-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x87000 0x1000>; - }; - - enet0: ethernet@e0000 { - cell-index = <0>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe0000 0x1000>; - fsl,port-handles = <&fman0_rx0 &fman0_tx0>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio0: mdio@e1120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-mdio"; - reg = <0xe1120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet1: ethernet@e2000 { - cell-index = <1>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe2000 0x1000>; - fsl,port-handles = <&fman0_rx1 &fman0_tx1>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio@e3120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe3120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet2: ethernet@e4000 { - cell-index = <2>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe4000 0x1000>; - fsl,port-handles = <&fman0_rx2 &fman0_tx2>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio@e5120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe5120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet3: ethernet@e6000 { - cell-index = <3>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe6000 0x1000>; - fsl,port-handles = <&fman0_rx3 &fman0_tx3>; - }; - - mdio@e7120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe7120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet4: ethernet@e8000 { - cell-index = <4>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe8000 0x1000>; - fsl,port-handles = <&fman0_rx4 &fman0_tx4>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio@e9120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe9120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet5: ethernet@f0000 { - cell-index = <0>; - compatible = "fsl,p3041-fman-10g-mac", "fsl,fman-10g-mac"; - reg = <0xf0000 0x1000>; - fsl,port-handles = <&fman0_rx5 &fman0_tx5>; - }; - - mdio@f1000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-xmdio"; - reg = <0xf1000 0x1000>; - interrupts = <100 1 0 0>; - }; - - ptp_timer0: rtc@fe000 { - compatible = "fsl,fman-rtc"; - reg = <0xfe000 0x1000>; - }; - }; - }; - - rapidio@ffe0c0000 { - compatible = "fsl,srio"; - interrupts = <16 2 1 11>; - #address-cells = <2>; - #size-cells = <2>; - ranges; - - port1 { - #address-cells = <2>; - #size-cells = <2>; - cell-index = <1>; - }; - - port2 { - #address-cells = <2>; - #size-cells = <2>; - cell-index = <2>; - }; - }; - - localbus@ffe124000 { - compatible = "fsl,p3041-rev1.0-elbc", "simple-bus", "fsl,elbc"; - interrupts = < - 25 2 0 0 - 16 2 1 19 - >; - #address-cells = <2>; - #size-cells = <1>; - }; - - pci0: pcie@ffe200000 { - compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "okay"; - #size-cells = <2>; - #address-cells = <3>; - bus-range = <0x0 0xff>; - clock-frequency = <0x1fca055>; - fsl,msi = <&msi0>; - interrupts = <16 2 1 15>; - - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 15>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 40 1 0 0 - 0000 0 0 2 &mpic 1 1 0 0 - 0000 0 0 3 &mpic 2 1 0 0 - 0000 0 0 4 &mpic 3 1 0 0 - >; - }; - }; - - pci1: pcie@ffe201000 { - compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "disabled"; - #size-cells = <2>; - #address-cells = <3>; - bus-range = <0 0xff>; - clock-frequency = <0x1fca055>; - fsl,msi = <&msi1>; - interrupts = <16 2 1 14>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 14>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 41 1 0 0 - 0000 0 0 2 &mpic 5 1 0 0 - 0000 0 0 3 &mpic 6 1 0 0 - 0000 0 0 4 &mpic 7 1 0 0 - >; - }; - }; - - pci2: pcie@ffe202000 { - compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "okay"; - #size-cells = <2>; - #address-cells = <3>; - bus-range = <0x0 0xff>; - clock-frequency = <0x1fca055>; - fsl,msi = <&msi2>; - interrupts = <16 2 1 13>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 13>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 42 1 0 0 - 0000 0 0 2 &mpic 9 1 0 0 - 0000 0 0 3 &mpic 10 1 0 0 - 0000 0 0 4 &mpic 11 1 0 0 - >; - }; - }; - - pci3: pcie@ffe203000 { - compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "disabled"; - #size-cells = <2>; - #address-cells = <3>; - bus-range = <0x0 0xff>; - clock-frequency = <0x1fca055>; - fsl,msi = <&msi2>; - interrupts = <16 2 1 12>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 12>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 43 1 0 0 - 0000 0 0 2 &mpic 0 1 0 0 - 0000 0 0 3 &mpic 4 1 0 0 - 0000 0 0 4 &mpic 8 1 0 0 - >; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/p5020ds.dts b/usr/src/boot/sys/boot/fdt/dts/powerpc/p5020ds.dts deleted file mode 100644 index cb07045792..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/p5020ds.dts +++ /dev/null @@ -1,583 +0,0 @@ -/* - * P5020DS Device Tree Source - * - * Copyright 2010-2011 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* $FreeBSD$ */ - -/include/ "p5020si.dtsi" - -/ { - model = "fsl,P5020DS"; - compatible = "fsl,P5020DS"; - #address-cells = <2>; - #size-cells = <2>; - interrupt-parent = <&mpic>; - - aliases { - phy_rgmii_0 = &phy_rgmii_0; - phy_rgmii_1 = &phy_rgmii_1; - phy_sgmii_1c = &phy_sgmii_1c; - phy_sgmii_1d = &phy_sgmii_1d; - phy_sgmii_1e = &phy_sgmii_1e; - phy_sgmii_1f = &phy_sgmii_1f; - phy_xgmii_1 = &phy_xgmii_1; - phy_xgmii_2 = &phy_xgmii_2; - emi1_rgmii = &hydra_mdio_rgmii; - emi1_sgmii = &hydra_mdio_sgmii; - emi2_xgmii = &hydra_mdio_xgmii; - }; - - memory { - device_type = "memory"; - reg = <0x00000000 0x00000000 0x00000000 0x80000000>; - }; - - dcsr: dcsr@f00000000 { - ranges = <0x00000000 0xf 0x00000000 0x01008000>; - }; - - bman-portals@ff4000000 { - bman-portal@0 { - cpu-handle = <&cpu0>; - }; - bman-portal@4000 { - cpu-handle = <&cpu1>; - }; - bman-portal@8000 { - }; - bman-portal@c000 { - }; - bman-portal@10000 { - }; - bman-portal@14000 { - }; - bman-portal@18000 { - }; - bman-portal@1c000 { - }; - bman-portal@20000 { - }; - bman-portal@24000 { - }; - - buffer-pool@0 { - compatible = "fsl,p5020-bpool", "fsl,bpool"; - fsl,bpid = <0>; - fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; - }; - }; - - qman-portals@ff4200000 { - qportal0: qman-portal@0 { - cpu-handle = <&cpu0>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal1: qman-portal@4000 { - cpu-handle = <&cpu1>; - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal2: qman-portal@8000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal3: qman-portal@c000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal4: qman-portal@10000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal5: qman-portal@14000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal6: qman-portal@18000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal7: qman-portal@1c000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal8: qman-portal@20000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - - qportal9: qman-portal@24000 { - fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 - &qpool4 &qpool5 &qpool6 - &qpool7 &qpool8 &qpool9 - &qpool10 &qpool11 &qpool12 - &qpool13 &qpool14 &qpool15>; - }; - }; - - soc: soc@ffe000000 { - spi@110000 { - flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spansion,s25sl12801"; - reg = <0>; - spi-max-frequency = <40000000>; /* input clock */ - partition@u-boot { - label = "u-boot"; - reg = <0x00000000 0x00100000>; - read-only; - }; - partition@kernel { - label = "kernel"; - reg = <0x00100000 0x00500000>; - read-only; - }; - partition@dtb { - label = "dtb"; - reg = <0x00600000 0x00100000>; - read-only; - }; - partition@fs { - label = "file system"; - reg = <0x00700000 0x00900000>; - }; - }; - }; - - i2c@118100 { - eeprom@51 { - compatible = "at24,24c256"; - reg = <0x51>; - }; - eeprom@52 { - compatible = "at24,24c256"; - reg = <0x52>; - }; - }; - - i2c@119100 { - rtc@68 { - compatible = "dallas,ds3232"; - reg = <0x68>; - interrupts = <0x1 0x1 0 0>; - }; - }; - - pme: pme@316000 { - /* Commented out, use default allocation */ - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ - }; - - qman: qman@318000 { - /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ - }; - - bman: bman@31a000 { - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ - }; - - fman0: fman@400000 { - enet0: ethernet@e0000 { - tbi-handle = <&tbi0>; - phy-handle = <&phy_rgmii_0>; - phy-connection-type = "rgmii"; - }; - - mdio0: mdio@e1120 { - tbi0: tbi-phy@8 { - reg = <0x8>; - device_type = "tbi-phy"; - }; - - /* - * Virtual MDIO for the two on-board RGMII - * ports. The fsl,hydra-mdio-muxval property - * is already correct. - */ - hydra_mdio_rgmii: hydra-mdio-rgmii { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,hydra-mdio"; - fsl,mdio-handle = <&mdio0>; - fsl,hydra-mdio-muxval = <0x00>; - status = "disabled"; - - phy_rgmii_0: ethernet-phy@0 { - reg = <0x0>; - }; - phy_rgmii_1: ethernet-phy@1 { - reg = <0x1>; - }; - }; - - /* - * Virtual MDIO for the four-port SGMII card. - * The fsl,hydra-mdio-muxval property will be - * fixed-up by U-Boot based on the slot that - * the SGMII card is in. - * - * Note: we do not support DTSEC5 connected to - * SGMII, so this is the only SGMII node. - */ - hydra_mdio_sgmii: hydra-mdio-sgmii { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,hydra-mdio"; - fsl,mdio-handle = <&mdio0>; - fsl,hydra-mdio-muxval = <0x00>; - status = "disabled"; - - phy_sgmii_1c: ethernet-phy@1c { - reg = <0x1c>; - }; - phy_sgmii_1d: ethernet-phy@1d { - reg = <0x1d>; - }; - phy_sgmii_1e: ethernet-phy@1e { - reg = <0x1e>; - }; - phy_sgmii_1f: ethernet-phy@1f { - reg = <0x1f>; - }; - }; - }; - - enet1: ethernet@e2000 { - tbi-handle = <&tbi1>; - phy-handle = <&phy_sgmii_1d>; - phy-connection-type = "sgmii"; - }; - - mdio@e3120 { - tbi1: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet2: ethernet@e4000 { - tbi-handle = <&tbi2>; - phy-handle = <&phy_sgmii_1e>; - phy-connection-type = "sgmii"; - }; - - mdio@e5120 { - tbi2: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet3: ethernet@e6000 { - tbi-handle = <&tbi3>; - phy-handle = <&phy_sgmii_1f>; - phy-connection-type = "sgmii"; - }; - - mdio@e7120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe7120 0xee0>; - interrupts = <100 1 0 0>; - - tbi3: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet4: ethernet@e8000 { - tbi-handle = <&tbi4>; - phy-handle = <&phy_rgmii_1>; - phy-connection-type = "rgmii"; - }; - - mdio@e9120 { - tbi4: tbi-phy@8 { - reg = <8>; - device_type = "tbi-phy"; - }; - }; - - enet5: ethernet@f0000 { - /* - * phy-handle will be updated by U-Boot to - * reflect the actual slot the XAUI card is in. - */ - phy-handle = <&phy_xgmii_1>; - phy-connection-type = "xgmii"; - }; - - /* - * We only support one XAUI card, so the MDIO muxing - * is set by U-Boot, and Linux never touches it. - * Therefore, we don't need a virtual MDIO node. - * However, the phy address depends on the slot, so - * only one of the ethernet-phy nodes below will be - * used. - */ - hydra_mdio_xgmii: mdio@f1000 { - status = "disabled"; - - /* XAUI card in slot 1 */ - phy_xgmii_1: ethernet-phy@4 { - reg = <0x4>; - }; - - /* XAUI card in slot 2 */ - phy_xgmii_2: ethernet-phy@0 { - reg = <0x0>; - }; - }; - }; - }; - - rapidio@ffe0c0000 { - reg = <0xf 0xfe0c0000 0 0x11000>; - - port1 { - ranges = <0 0 0xc 0x20000000 0 0x10000000>; - }; - port2 { - ranges = <0 0 0xc 0x30000000 0 0x10000000>; - }; - }; - - localbus@ffe124000 { - reg = <0xf 0xfe124000 0 0x1000>; - ranges = <0 0 0xf 0xb8000000 0x04000000>; - - flash@0,0 { - compatible = "cfi-flash"; - /* - * Map 64Mb of 128MB NOR flash memory. Since highest - * line of address of NOR flash memory are set by - * FPGA, memory are divided into two pages equal to - * 64MB. One of the pages can be accessed at once. - */ - reg = <0 0 0x04000000>; - bank-width = <2>; - device-width = <2>; - }; - - nand@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,elbc-fcm-nand"; - reg = <0x2 0x0 0x40000>; - - partition@0 { - label = "NAND U-Boot Image"; - reg = <0x0 0x02000000>; - read-only; - }; - - partition@2000000 { - label = "NAND Root File System"; - reg = <0x02000000 0x10000000>; - }; - - partition@12000000 { - label = "NAND Compressed RFS Image"; - reg = <0x12000000 0x08000000>; - }; - - partition@1a000000 { - label = "NAND Linux Kernel Image"; - reg = <0x1a000000 0x04000000>; - }; - - partition@1e000000 { - label = "NAND DTB Image"; - reg = <0x1e000000 0x01000000>; - }; - - partition@1f000000 { - label = "NAND Writable User area"; - reg = <0x1f000000 0x21000000>; - }; - }; - - board-control@3,0 { - compatible = "fsl,p5020ds-fpga", "fsl,fpga-ngpixis"; - reg = <3 0 0x30>; - }; - }; - - pci0: pcie@ffe200000 { - reg = <0xf 0xfe200000 0 0x1000>; - ranges = <0x02000000 0 0x80000000 0x0 0x80000000 0x0 0x10000000 - 0x01000000 0 0x00000000 0x0 0xff000000 0x0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0x80000000 - 0x02000000 0 0x80000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff000000 - 0 0x00010000>; - }; - }; - - pci1: pcie@ffe201000 { - reg = <0xf 0xfe201000 0 0x1000>; - ranges = <0x02000000 0x0 0x90000000 0x0 0x90000000 0x0 0x10000000 - 0x01000000 0x0 0x00000000 0x0 0xff010000 0x0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0x90000000 - 0x02000000 0 0x90000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff010000 - 0 0x00010000>; - }; - }; - - pci2: pcie@ffe202000 { - reg = <0xf 0xfe202000 0 0x1000>; - ranges = <0x02000000 0 0xa0000000 0x0 0xa0000000 0 0x10000000 - 0x01000000 0 0x00000000 0x0 0xff020000 0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0xa0000000 - 0x02000000 0 0xa0000000 - 0 0x10000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff020000 - 0 0x00010000>; - }; - }; - - pci3: pcie@ffe203000 { - reg = <0xf 0xfe203000 0 0x1000>; - ranges = <0x02000000 0 0xb0000000 0x0 0xb0000000 0 0x08000000 - 0x01000000 0 0x00000000 0x0 0xff030000 0 0x00010000>; - pcie@0 { - ranges = <0x02000000 0 0xb0000000 - 0x02000000 0 0xb0000000 - 0 0x08000000 - - 0x01000000 0 0x00000000 - 0x01000000 0 0xff030000 - 0 0x00010000>; - }; - }; - - fsl,dpaa { - compatible = "fsl,p5020-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status = "okay"; - }; - ethernet@1 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "disabled"; - }; - ethernet@2 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "disabled"; - }; - ethernet@3 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "disabled"; - }; - ethernet@4 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "disabled"; - }; - }; - - chosen { - stdin = "serial0"; - stdout = "serial0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/powerpc/p5020si.dtsi b/usr/src/boot/sys/boot/fdt/dts/powerpc/p5020si.dtsi deleted file mode 100644 index 27699cbc7e..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/powerpc/p5020si.dtsi +++ /dev/null @@ -1,1389 +0,0 @@ -/* - * P5020 Silicon Device Tree Source - * - * Copyright 2010-2011 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* $FreeBSD$ */ - -/dts-v1/; - -/ { - compatible = "fsl,P5020"; - #address-cells = <2>; - #size-cells = <2>; - interrupt-parent = <&mpic>; - - aliases { - ccsr = &soc; - dcsr = &dcsr; - - ethernet0 = &enet0; - ethernet1 = &enet1; - ethernet2 = &enet2; - ethernet3 = &enet3; - ethernet4 = &enet4; - ethernet5 = &enet5; - serial0 = &serial0; - serial1 = &serial1; - serial2 = &serial2; - serial3 = &serial3; - pci0 = &pci0; - pci1 = &pci1; - pci2 = &pci2; - pci3 = &pci3; - usb0 = &usb0; - usb1 = &usb1; - dma0 = &dma0; - dma1 = &dma1; - bman = &bman; - qman = &qman; - pme = &pme; - rman = &rman; - sdhc = &sdhc; - msi0 = &msi0; - msi1 = &msi1; - msi2 = &msi2; - - crypto = &crypto; - sec_jr0 = &sec_jr0; - sec_jr1 = &sec_jr1; - sec_jr2 = &sec_jr2; - sec_jr3 = &sec_jr3; - rtic_a = &rtic_a; - rtic_b = &rtic_b; - rtic_c = &rtic_c; - rtic_d = &rtic_d; - sec_mon = &sec_mon; - - raideng = &raideng; - raideng_jr0 = &raideng_jr0; - raideng_jr1 = &raideng_jr1; - raideng_jr2 = &raideng_jr2; - raideng_jr3 = &raideng_jr3; - - fman0 = &fman0; - fman0_oh0 = &fman0_oh0; - fman0_oh1 = &fman0_oh1; - fman0_oh2 = &fman0_oh2; - fman0_oh3 = &fman0_oh3; - fman0_oh4 = &fman0_oh4; - fman0_oh5 = &fman0_oh5; - fman0_oh6 = &fman0_oh6; - fman0_rx0 = &fman0_rx0; - fman0_rx1 = &fman0_rx1; - fman0_rx2 = &fman0_rx2; - fman0_rx3 = &fman0_rx3; - fman0_rx4 = &fman0_rx4; - fman0_rx5 = &fman0_rx5; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu0: PowerPC,e5500@0 { - device_type = "cpu"; - reg = <0>; - bus-frequency = <799999998>; - next-level-cache = <&L2_0>; - L2_0: l2-cache { - next-level-cache = <&cpc>; - }; - }; - cpu1: PowerPC,e5500@1 { - device_type = "cpu"; - reg = <1>; - next-level-cache = <&L2_1>; - L2_1: l2-cache { - next-level-cache = <&cpc>; - }; - }; - }; - - dcsr: dcsr@f00000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,dcsr", "simple-bus"; - - dcsr-epu@0 { - compatible = "fsl,dcsr-epu"; - interrupts = <52 2 0 0 - 84 2 0 0 - 85 2 0 0>; - interrupt-parent = <&mpic>; - reg = <0x0 0x1000>; - }; - dcsr-npc { - compatible = "fsl,dcsr-npc"; - reg = <0x1000 0x1000 0x1000000 0x8000>; - }; - dcsr-nxc@2000 { - compatible = "fsl,dcsr-nxc"; - reg = <0x2000 0x1000>; - }; - dcsr-corenet { - compatible = "fsl,dcsr-corenet"; - reg = <0x8000 0x1000 0xB0000 0x1000>; - }; - dcsr-dpaa@9000 { - compatible = "fsl,p5020-dcsr-dpaa", "fsl,dcsr-dpaa"; - reg = <0x9000 0x1000>; - }; - dcsr-ocn@11000 { - compatible = "fsl,p5020-dcsr-ocn", "fsl,dcsr-ocn"; - reg = <0x11000 0x1000>; - }; - dcsr-ddr@12000 { - compatible = "fsl,dcsr-ddr"; - dev-handle = <&ddr1>; - reg = <0x12000 0x1000>; - }; - dcsr-ddr@13000 { - compatible = "fsl,dcsr-ddr"; - dev-handle = <&ddr2>; - reg = <0x13000 0x1000>; - }; - dcsr-nal@18000 { - compatible = "fsl,p5020-dcsr-nal", "fsl,dcsr-nal"; - reg = <0x18000 0x1000>; - }; - dcsr-rcpm@22000 { - compatible = "fsl,p5020-dcsr-rcpm", "fsl,dcsr-rcpm"; - reg = <0x22000 0x1000>; - }; - dcsr-cpu-sb-proxy@40000 { - compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu0>; - reg = <0x40000 0x1000>; - }; - dcsr-cpu-sb-proxy@41000 { - compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; - cpu-handle = <&cpu1>; - reg = <0x41000 0x1000>; - }; - }; - - bman-portals@ff4000000 { - #address-cells = <0x1>; - #size-cells = <0x1>; - compatible = "bman-portals"; - ranges = <0x0 0xf 0xfde00000 0x200000>; - bman-portal@0 { - cell-index = <0x0>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x0 0x4000 0x100000 0x1000>; - interrupts = <105 2 0 0>; - }; - bman-portal@4000 { - cell-index = <0x1>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x4000 0x4000 0x101000 0x1000>; - interrupts = <107 2 0 0>; - }; - bman-portal@8000 { - cell-index = <2>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x8000 0x4000 0x102000 0x1000>; - interrupts = <109 2 0 0>; - }; - bman-portal@c000 { - cell-index = <0x3>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0xc000 0x4000 0x103000 0x1000>; - interrupts = <111 2 0 0>; - }; - bman-portal@10000 { - cell-index = <0x4>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x10000 0x4000 0x104000 0x1000>; - interrupts = <113 2 0 0>; - }; - bman-portal@14000 { - cell-index = <0x5>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x14000 0x4000 0x105000 0x1000>; - interrupts = <115 2 0 0>; - }; - bman-portal@18000 { - cell-index = <0x6>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x18000 0x4000 0x106000 0x1000>; - interrupts = <117 2 0 0>; - }; - bman-portal@1c000 { - cell-index = <0x7>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x1c000 0x4000 0x107000 0x1000>; - interrupts = <119 2 0 0>; - }; - bman-portal@20000 { - cell-index = <0x8>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x20000 0x4000 0x108000 0x1000>; - interrupts = <121 2 0 0>; - }; - bman-portal@24000 { - cell-index = <0x9>; - compatible = "fsl,p5020-bman-portal", "fsl,bman-portal"; - reg = <0x24000 0x4000 0x109000 0x1000>; - interrupts = <123 2 0 0>; - }; - - buffer-pool@0 { - compatible = "fsl,p5020-bpool", "fsl,bpool"; - fsl,bpid = <0>; - fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; - }; - }; - - qman-portals@ff4200000 { - #address-cells = <0x1>; - #size-cells = <0x1>; - compatible = "qman-portals"; - ranges = <0x0 0xf 0xfdc00000 0x200000>; - qportal0: qman-portal@0 { - cell-index = <0x0>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x0 0x4000 0x100000 0x1000>; - interrupts = <104 0x2 0 0>; - fsl,qman-channel-id = <0x0>; - }; - - qportal1: qman-portal@4000 { - cell-index = <0x1>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x4000 0x4000 0x101000 0x1000>; - interrupts = <106 0x2 0 0>; - fsl,qman-channel-id = <0x1>; - }; - - qportal2: qman-portal@8000 { - cell-index = <0x2>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x8000 0x4000 0x102000 0x1000>; - interrupts = <108 0x2 0 0>; - fsl,qman-channel-id = <0x2>; - }; - - qportal3: qman-portal@c000 { - cell-index = <0x3>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0xc000 0x4000 0x103000 0x1000>; - interrupts = <110 0x2 0 0>; - fsl,qman-channel-id = <0x3>; - }; - - qportal4: qman-portal@10000 { - cell-index = <0x4>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x10000 0x4000 0x104000 0x1000>; - interrupts = <112 0x2 0 0>; - fsl,qman-channel-id = <0x4>; - }; - - qportal5: qman-portal@14000 { - cell-index = <0x5>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x14000 0x4000 0x105000 0x1000>; - interrupts = <114 0x2 0 0>; - fsl,qman-channel-id = <0x5>; - }; - - qportal6: qman-portal@18000 { - cell-index = <0x6>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x18000 0x4000 0x106000 0x1000>; - interrupts = <116 0x2 0 0>; - fsl,qman-channel-id = <0x6>; - }; - - qportal7: qman-portal@1c000 { - cell-index = <0x7>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x1c000 0x4000 0x107000 0x1000>; - interrupts = <118 0x2 0 0>; - fsl,qman-channel-id = <0x7>; - }; - - qportal8: qman-portal@20000 { - cell-index = <0x8>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x20000 0x4000 0x108000 0x1000>; - interrupts = <120 0x2 0 0>; - fsl,qman-channel-id = <0x8>; - }; - - qportal9: qman-portal@24000 { - cell-index = <0x9>; - compatible = "fsl,p5020-qman-portal", "fsl,qman-portal"; - reg = <0x24000 0x4000 0x109000 0x1000>; - interrupts = <122 0x2 0 0>; - fsl,qman-channel-id = <0x9>; - }; - - qpool1: qman-pool@1 { - cell-index = <1>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x21>; - }; - - qpool2: qman-pool@2 { - cell-index = <2>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x22>; - }; - - qpool3: qman-pool@3 { - cell-index = <3>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x23>; - }; - - qpool4: qman-pool@4 { - cell-index = <4>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x24>; - }; - - qpool5: qman-pool@5 { - cell-index = <5>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x25>; - }; - - qpool6: qman-pool@6 { - cell-index = <6>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x26>; - }; - - qpool7: qman-pool@7 { - cell-index = <7>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x27>; - }; - - qpool8: qman-pool@8 { - cell-index = <8>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x28>; - }; - - qpool9: qman-pool@9 { - cell-index = <9>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x29>; - }; - - qpool10: qman-pool@10 { - cell-index = <10>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2a>; - }; - - qpool11: qman-pool@11 { - cell-index = <11>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2b>; - }; - - qpool12: qman-pool@12 { - cell-index = <12>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2c>; - }; - - qpool13: qman-pool@13 { - cell-index = <13>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2d>; - }; - - qpool14: qman-pool@14 { - cell-index = <14>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2e>; - }; - - qpool15: qman-pool@15 { - cell-index = <15>; - compatible = "fsl,p5020-qman-pool-channel", "fsl,qman-pool-channel"; - fsl,qman-channel-id = <0x2f>; - }; - }; - - soc: soc@ffe000000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "soc"; - compatible = "simple-bus"; - - bus-frequency = <0>; // Filled out by kernel. - - ranges = <0x00000000 0xf 0xfe000000 0x1000000>; - reg = <0xf 0xfe000000 0 0x00001000>; - - soc-sram-error { - compatible = "fsl,soc-sram-error"; - interrupts = <16 2 1 29>; - }; - - corenet-law@0 { - compatible = "fsl,corenet-law"; - reg = <0x0 0x1000>; - fsl,num-laws = <32>; - }; - - ddr1: memory-controller@8000 { - compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller"; - reg = <0x8000 0x1000>; - interrupts = <16 2 1 23>; - }; - - ddr2: memory-controller@9000 { - compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller"; - reg = <0x9000 0x1000>; - interrupts = <16 2 1 22>; - }; - - cpc: l3-cache-controller@10000 { - compatible = "fsl,p5020-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache"; - reg = <0x10000 0x1000 - 0x11000 0x1000>; - interrupts = <16 2 1 27 - 16 2 1 26>; - }; - - corenet-cf@18000 { - compatible = "fsl,corenet-cf"; - reg = <0x18000 0x1000>; - interrupts = <16 2 1 31>; - fsl,ccf-num-csdids = <32>; - fsl,ccf-num-snoopids = <32>; - }; - - iommu@20000 { - compatible = "fsl,pamu-v1.0", "fsl,pamu"; - reg = <0x20000 0x4000>; - interrupts = < - 24 2 0 0 - 16 2 1 30>; - }; - - mpic: pic@40000 { - clock-frequency = <0>; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <4>; - reg = <0x40000 0x40000>; - compatible = "fsl,mpic", "chrp,open-pic"; - device_type = "open-pic"; - }; - - msi0: msi@41600 { - compatible = "fsl,mpic-msi"; - reg = <0x41600 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe0 0 0 0 - 0xe1 0 0 0 - 0xe2 0 0 0 - 0xe3 0 0 0 - 0xe4 0 0 0 - 0xe5 0 0 0 - 0xe6 0 0 0 - 0xe7 0 0 0>; - }; - - msi1: msi@41800 { - compatible = "fsl,mpic-msi"; - reg = <0x41800 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xe8 0 0 0 - 0xe9 0 0 0 - 0xea 0 0 0 - 0xeb 0 0 0 - 0xec 0 0 0 - 0xed 0 0 0 - 0xee 0 0 0 - 0xef 0 0 0>; - }; - - msi2: msi@41a00 { - compatible = "fsl,mpic-msi"; - reg = <0x41a00 0x200>; - msi-available-ranges = <0 0x100>; - interrupts = < - 0xf0 0 0 0 - 0xf1 0 0 0 - 0xf2 0 0 0 - 0xf3 0 0 0 - 0xf4 0 0 0 - 0xf5 0 0 0 - 0xf6 0 0 0 - 0xf7 0 0 0>; - }; - - guts: global-utilities@e0000 { - compatible = "fsl,qoriq-device-config-1.0"; - reg = <0xe0000 0xe00>; - fsl,has-rstcr; - #sleep-cells = <1>; - fsl,liodn-bits = <12>; - }; - - pins: global-utilities@e0e00 { - compatible = "fsl,qoriq-pin-control-1.0"; - reg = <0xe0e00 0x200>; - #sleep-cells = <2>; - }; - - clockgen: global-utilities@e1000 { - compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0"; - reg = <0xe1000 0x1000>; - clock-frequency = <0>; - }; - - rcpm: global-utilities@e2000 { - compatible = "fsl,qoriq-rcpm-1.0"; - reg = <0xe2000 0x1000>; - #sleep-cells = <1>; - }; - - sfp: sfp@e8000 { - compatible = "fsl,p5020-sfp", "fsl,qoriq-sfp-1.0"; - reg = <0xe8000 0x1000>; - }; - - serdes: serdes@ea000 { - compatible = "fsl,p5020-serdes"; - reg = <0xea000 0x1000>; - }; - - dma0: dma@100300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,p5020-dma", "fsl,eloplus-dma"; - reg = <0x100300 0x4>; - ranges = <0x0 0x100100 0x200>; - cell-index = <0>; - dma-channel@0 { - compatible = "fsl,p5020-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupts = <28 2 0 0>; - }; - dma-channel@80 { - compatible = "fsl,p5020-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupts = <29 2 0 0>; - }; - dma-channel@100 { - compatible = "fsl,p5020-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupts = <30 2 0 0>; - }; - dma-channel@180 { - compatible = "fsl,p5020-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupts = <31 2 0 0>; - }; - }; - - dma1: dma@101300 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,p5020-dma", "fsl,eloplus-dma"; - reg = <0x101300 0x4>; - ranges = <0x0 0x101100 0x200>; - cell-index = <1>; - dma-channel@0 { - compatible = "fsl,p5020-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x0 0x80>; - cell-index = <0>; - interrupts = <32 2 0 0>; - }; - dma-channel@80 { - compatible = "fsl,p5020-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x80 0x80>; - cell-index = <1>; - interrupts = <33 2 0 0>; - }; - dma-channel@100 { - compatible = "fsl,p5020-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x100 0x80>; - cell-index = <2>; - interrupts = <34 2 0 0>; - }; - dma-channel@180 { - compatible = "fsl,p5020-dma-channel", - "fsl,eloplus-dma-channel"; - reg = <0x180 0x80>; - cell-index = <3>; - interrupts = <35 2 0 0>; - }; - }; - - spi@110000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,p5020-espi", "fsl,mpc8536-espi"; - reg = <0x110000 0x1000>; - interrupts = <53 0x2 0 0>; - fsl,espi-num-chipselects = <4>; - }; - - sdhc: sdhc@114000 { - compatible = "fsl,p5020-esdhc", "fsl,esdhc"; - reg = <0x114000 0x1000>; - interrupts = <48 2 0 0>; - sdhci,auto-cmd12; - clock-frequency = <0>; - }; - - i2c@118000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <0>; - compatible = "fsl-i2c"; - reg = <0x118000 0x100>; - interrupts = <38 2 0 0>; - dfsrr; - }; - - i2c@118100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <1>; - compatible = "fsl-i2c"; - reg = <0x118100 0x100>; - interrupts = <38 2 0 0>; - dfsrr; - }; - - i2c@119000 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <2>; - compatible = "fsl-i2c"; - reg = <0x119000 0x100>; - interrupts = <39 2 0 0>; - dfsrr; - }; - - i2c@119100 { - #address-cells = <1>; - #size-cells = <0>; - cell-index = <3>; - compatible = "fsl-i2c"; - reg = <0x119100 0x100>; - interrupts = <39 2 0 0>; - dfsrr; - }; - - serial0: serial@11c500 { - cell-index = <0>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11c500 0x100>; - clock-frequency = <0>; - interrupts = <36 2 0 0>; - }; - - serial1: serial@11c600 { - cell-index = <1>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11c600 0x100>; - clock-frequency = <0>; - interrupts = <36 2 0 0>; - }; - - serial2: serial@11d500 { - cell-index = <2>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11d500 0x100>; - clock-frequency = <0>; - interrupts = <37 2 0 0>; - }; - - serial3: serial@11d600 { - cell-index = <3>; - device_type = "serial"; - compatible = "ns16550"; - reg = <0x11d600 0x100>; - clock-frequency = <0>; - interrupts = <37 2 0 0>; - }; - - gpio0: gpio@130000 { - compatible = "fsl,p5020-gpio", "fsl,qoriq-gpio"; - reg = <0x130000 0x1000>; - interrupts = <55 2 0 0>; - #gpio-cells = <2>; - gpio-controller; - }; - - rman: rman@1e0000 { - compatible = "fsl,rman"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x1e0000 0x20000>; - reg = <0x1e0000 0x20000>; - interrupts = <16 2 1 11>; /* err_irq */ - fsl,qman-channels-id = <0x62 0x63>; - - inbound-block@0 { - compatible = "fsl,rman-inbound-block"; - reg = <0x0 0x800>; - }; - global-cfg@b00 { - compatible = "fsl,rman-global-cfg"; - reg = <0xb00 0x500>; - }; - inbound-block@1000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x1000 0x800>; - }; - inbound-block@2000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x2000 0x800>; - }; - inbound-block@3000 { - compatible = "fsl,rman-inbound-block"; - reg = <0x3000 0x800>; - }; - }; - - usb0: usb@210000 { - compatible = "fsl,p5020-usb2-mph", - "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph"; - reg = <0x210000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <44 0x2 0 0>; - phy_type = "utmi"; - port0; - }; - - usb1: usb@211000 { - compatible = "fsl,p5020-usb2-dr", - "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr"; - reg = <0x211000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <45 0x2 0 0>; - dr_mode = "host"; - phy_type = "utmi"; - }; - - sata@220000 { - compatible = "fsl,p5020-sata", "fsl,pq-sata-v2"; - reg = <0x220000 0x1000>; - interrupts = <68 0x2 0 0>; - }; - - sata@221000 { - compatible = "fsl,p5020-sata", "fsl,pq-sata-v2"; - reg = <0x221000 0x1000>; - interrupts = <69 0x2 0 0>; - }; - - crypto: crypto@300000 { - compatible = "fsl,sec-v4.2", "fsl,sec-v4.0"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x300000 0x10000>; - ranges = <0 0x300000 0x10000>; - interrupts = <92 2 0 0>; - - sec_jr0: jr@1000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x1000 0x1000>; - interrupts = <88 2 0 0>; - }; - - sec_jr1: jr@2000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x2000 0x1000>; - interrupts = <89 2 0 0>; - }; - - sec_jr2: jr@3000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x3000 0x1000>; - interrupts = <90 2 0 0>; - }; - - sec_jr3: jr@4000 { - compatible = "fsl,sec-v4.2-job-ring", - "fsl,sec-v4.0-job-ring"; - reg = <0x4000 0x1000>; - interrupts = <91 2 0 0>; - }; - - rtic@6000 { - compatible = "fsl,sec-v4.2-rtic", - "fsl,sec-v4.0-rtic"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x6000 0x100>; - ranges = <0x0 0x6100 0xe00>; - - rtic_a: rtic-a@0 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x00 0x20 0x100 0x80>; - }; - - rtic_b: rtic-b@20 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x20 0x20 0x200 0x80>; - }; - - rtic_c: rtic-c@40 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x40 0x20 0x300 0x80>; - }; - - rtic_d: rtic-d@60 { - compatible = "fsl,sec-v4.2-rtic-memory", - "fsl,sec-v4.0-rtic-memory"; - reg = <0x60 0x20 0x500 0x80>; - }; - }; - }; - - sec_mon: sec_mon@314000 { - compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon"; - reg = <0x314000 0x1000>; - interrupts = <93 2 0 0>; - }; - - raideng: raideng@320000 { - compatible = "fsl,raideng-v1.0"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x320000 0x10000>; - ranges = <0 0x320000 0x10000>; - - raideng_jq0@1000 { - compatible = "fsl,raideng-v1.0-job-queue"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x1000 0x1000>; - ranges = <0x0 0x1000 0x1000>; - - raideng_jr0: jr@0 { - compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-hp-ring"; - reg = <0x0 0x400>; - interrupts = <139 2 0 0>; - interrupt-parent = <&mpic>; - }; - - raideng_jr1: jr@400 { - compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-lp-ring"; - reg = <0x400 0x400>; - interrupts = <140 2 0 0>; - interrupt-parent = <&mpic>; - }; - }; - - raideng_jq1@2000 { - compatible = "fsl,raideng-v1.0-job-queue"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x2000 0x1000>; - ranges = <0x0 0x2000 0x1000>; - - raideng_jr2: jr@0 { - compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-hp-ring"; - reg = <0x0 0x400>; - interrupts = <141 2 0 0>; - interrupt-parent = <&mpic>; - }; - - raideng_jr3: jr@400 { - compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-lp-ring"; - reg = <0x400 0x400>; - interrupts = <142 2 0 0>; - interrupt-parent = <&mpic>; - }; - }; - }; - - pme: pme@316000 { - compatible = "fsl,pme"; - reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ - interrupts = <16 2 1 5>; - }; - - qman: qman@318000 { - compatible = "fsl,p5020-qman", "fsl,qman"; - reg = <0x318000 0x1000>; - interrupts = <16 2 1 3>; - /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ - }; - - bman: bman@31a000 { - compatible = "fsl,p5020-bman", "fsl,bman"; - reg = <0x31a000 0x1000>; - interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ - }; - - fman0: fman@400000 { - #address-cells = <1>; - #size-cells = <1>; - cell-index = <0>; - compatible = "fsl,p5020-fman", "fsl,fman", "simple-bus"; - ranges = <0 0x400000 0x100000>; - reg = <0x400000 0x100000>; - clock-frequency = <0>; - interrupts = < - 96 2 0 0 - 16 2 1 1>; - - cc@0 { - compatible = "fsl,p5020-fman-cc", "fsl,fman-cc"; - }; - - parser@c7000 { - compatible = "fsl,p5020-fman-parser", "fsl,fman-parser"; - reg = <0xc7000 0x1000>; - }; - - keygen@c1000 { - compatible = "fsl,p5020-fman-keygen", "fsl,fman-keygen"; - reg = <0xc1000 0x1000>; - }; - - policer@c0000 { - compatible = "fsl,p5020-fman-policer", "fsl,fman-policer"; - reg = <0xc0000 0x1000>; - }; - - muram@0 { - compatible = "fsl,p5020-fman-muram", "fsl,fman-muram"; - reg = <0x0 0x28000>; - }; - - bmi@80000 { - compatible = "fsl,p5020-fman-bmi", "fsl,fman-bmi"; - reg = <0x80000 0x400>; - }; - - qmi@80400 { - compatible = "fsl,p5020-fman-qmi", "fsl,fman-qmi"; - reg = <0x80400 0x400>; - }; - - fman0_rx0: port@88000 { - cell-index = <0>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x88000 0x1000>; - }; - fman0_rx1: port@89000 { - cell-index = <1>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x89000 0x1000>; - }; - fman0_rx2: port@8a000 { - cell-index = <2>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8a000 0x1000>; - }; - fman0_rx3: port@8b000 { - cell-index = <3>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8b000 0x1000>; - }; - fman0_rx4: port@8c000 { - cell-index = <4>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; - reg = <0x8c000 0x1000>; - }; - fman0_rx5: port@90000 { - cell-index = <0>; - compatible = "fsl,p5020-fman-port-10g-rx", "fsl,fman-port-10g-rx"; - reg = <0x90000 0x1000>; - }; - - fman0_tx5: port@b0000 { - cell-index = <0>; - compatible = "fsl,p5020-fman-port-10g-tx", "fsl,fman-port-10g-tx"; - reg = <0xb0000 0x1000>; - fsl,qman-channel-id = <0x40>; - }; - fman0_tx0: port@a8000 { - cell-index = <0>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xa8000 0x1000>; - fsl,qman-channel-id = <0x41>; - }; - fman0_tx1: port@a9000 { - cell-index = <1>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xa9000 0x1000>; - fsl,qman-channel-id = <0x42>; - }; - fman0_tx2: port@aa000 { - cell-index = <2>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xaa000 0x1000>; - fsl,qman-channel-id = <0x43>; - }; - fman0_tx3: port@ab000 { - cell-index = <3>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xab000 0x1000>; - fsl,qman-channel-id = <0x44>; - }; - fman0_tx4: port@ac000 { - cell-index = <4>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; - reg = <0xac000 0x1000>; - fsl,qman-channel-id = <0x45>; - }; - - fman0_oh0: port@81000 { - cell-index = <0>; - compatible = "fsl,p5020-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x81000 0x1000>; - fsl,qman-channel-id = <0x46>; - }; - fman0_oh1: port@82000 { - cell-index = <1>; - compatible = "fsl,p5020-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x82000 0x1000>; - fsl,qman-channel-id = <0x47>; - }; - fman0_oh2: port@83000 { - cell-index = <2>; - compatible = "fsl,p5020-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x83000 0x1000>; - fsl,qman-channel-id = <0x48>; - }; - fman0_oh3: port@84000 { - cell-index = <3>; - compatible = "fsl,p5020-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x84000 0x1000>; - fsl,qman-channel-id = <0x49>; - }; - fman0_oh4: port@85000 { - cell-index = <4>; - compatible = "fsl,p5020-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x85000 0x1000>; - fsl,qman-channel-id = <0x4a>; - }; - fman0_oh5: port@86000 { - cell-index = <5>; - compatible = "fsl,p5020-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x86000 0x1000>; - fsl,qman-channel-id = <0x4b>; - }; - fman0_oh6: port@87000 { - cell-index = <6>; - compatible = "fsl,p5020-fman-port-oh", "fsl,fman-port-oh"; - reg = <0x87000 0x1000>; - }; - - enet0: ethernet@e0000 { - cell-index = <0>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe0000 0x1000>; - fsl,port-handles = <&fman0_rx0 &fman0_tx0>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio0: mdio@e1120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-mdio"; - reg = <0xe1120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet1: ethernet@e2000 { - cell-index = <1>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe2000 0x1000>; - fsl,port-handles = <&fman0_rx1 &fman0_tx1>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio@e3120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe3120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet2: ethernet@e4000 { - cell-index = <2>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe4000 0x1000>; - fsl,port-handles = <&fman0_rx2 &fman0_tx2>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio@e5120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe5120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet3: ethernet@e6000 { - cell-index = <3>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe6000 0x1000>; - fsl,port-handles = <&fman0_rx3 &fman0_tx3>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio@e7120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe7120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet4: ethernet@e8000 { - cell-index = <4>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; - reg = <0xe8000 0x1000>; - fsl,port-handles = <&fman0_rx4 &fman0_tx4>; - ptimer-handle = <&ptp_timer0>; - }; - - mdio@e9120 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-tbi"; - reg = <0xe9120 0xee0>; - interrupts = <100 1 0 0>; - }; - - enet5: ethernet@f0000 { - cell-index = <0>; - compatible = "fsl,p5020-fman-10g-mac", "fsl,fman-10g-mac"; - reg = <0xf0000 0x1000>; - fsl,port-handles = <&fman0_rx5 &fman0_tx5>; - }; - - mdio@f1000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,fman-xmdio"; - reg = <0xf1000 0x1000>; - interrupts = <100 1 0 0>; - }; - - ptp_timer0: rtc@fe000 { - compatible = "fsl,fman-rtc"; - reg = <0xfe000 0x1000>; - }; - }; - }; - - rapidio@ffe0c0000 { - compatible = "fsl,srio"; - interrupts = <16 2 1 11>; - #address-cells = <2>; - #size-cells = <2>; - ranges; - - port1 { - #address-cells = <2>; - #size-cells = <2>; - cell-index = <1>; - }; - - port2 { - #address-cells = <2>; - #size-cells = <2>; - cell-index = <2>; - }; - }; - - localbus@ffe124000 { - compatible = "fsl,p5020-rev1.0-elbc", "simple-bus", "fsl,elbc"; - interrupts = < - 25 2 0 0 - 16 2 1 19 - >; - #address-cells = <2>; - #size-cells = <1>; - }; - - pci0: pcie@ffe200000 { - compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "okay"; - #size-cells = <2>; - #address-cells = <3>; - cell-index = <0>; - bus-range = <0x0 0xff>; - clock-frequency = <0x1fca055>; - fsl,msi = <&msi0>; - interrupts = <16 2 1 15>; - - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 15>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 40 1 0 0 - 0000 0 0 2 &mpic 1 1 0 0 - 0000 0 0 3 &mpic 2 1 0 0 - 0000 0 0 4 &mpic 3 1 0 0 - >; - }; - }; - - pci1: pcie@ffe201000 { - compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "disabled"; - #size-cells = <2>; - #address-cells = <3>; - cell-index = <1>; - bus-range = <0 0xff>; - clock-frequency = <0x1fca055>; - fsl,msi = <&msi1>; - interrupts = <16 2 1 14>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 14>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 41 1 0 0 - 0000 0 0 2 &mpic 5 1 0 0 - 0000 0 0 3 &mpic 6 1 0 0 - 0000 0 0 4 &mpic 7 1 0 0 - >; - }; - }; - - pci2: pcie@ffe202000 { - compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "okay"; - #size-cells = <2>; - #address-cells = <3>; - cell-index = <2>; - bus-range = <0x0 0xff>; - clock-frequency = <0x1fca055>; - fsl,msi = <&msi2>; - interrupts = <16 2 1 13>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 13>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 42 1 0 0 - 0000 0 0 2 &mpic 9 1 0 0 - 0000 0 0 3 &mpic 10 1 0 0 - 0000 0 0 4 &mpic 11 1 0 0 - >; - }; - }; - - pci3: pcie@ffe203000 { - compatible = "fsl,p5020-pcie", "fsl,qoriq-pcie-v2.2"; - device_type = "pci"; - status = "disabled"; - #size-cells = <2>; - #address-cells = <3>; - cell-index = <3>; - bus-range = <0x0 0xff>; - clock-frequency = <0x1fca055>; - fsl,msi = <&msi2>; - interrupts = <16 2 1 12>; - pcie@0 { - reg = <0 0 0 0 0>; - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - interrupts = <16 2 1 12>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = < - /* IDSEL 0x0 */ - 0000 0 0 1 &mpic 43 1 0 0 - 0000 0 0 2 &mpic 0 1 0 0 - 0000 0 0 3 &mpic 4 1 0 0 - 0000 0 0 4 &mpic 8 1 0 0 - >; - }; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/riscv/qemu.dts b/usr/src/boot/sys/boot/fdt/dts/riscv/qemu.dts deleted file mode 100644 index 067e18fcea..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/riscv/qemu.dts +++ /dev/null @@ -1,92 +0,0 @@ -/*- - * Copyright (c) 2016 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Portions of this software were developed by SRI International and the - * University of Cambridge Computer Laboratory under DARPA/AFRL contract - * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Portions of this software were developed by the University of Cambridge - * Computer Laboratory as part of the CTSRD Project, with support from the - * UK Higher Education Innovation Fund (HEIF). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "QEMU RV64I"; - compatible = "riscv,rv64i"; - #address-cells = <1>; - #size-cells = <1>; - #interrupt-cells = <1>; - - aliases { - console0 = &console0; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x40000000>; /* 1GB at 0x0 */ - }; - - soc { - #address-cells = <2>; - #size-cells = <2>; - #interrupt-cells = <1>; - - compatible = "simple-bus"; - ranges; - - pic0: pic@0 { - compatible = "riscv,pic"; - interrupt-controller; - }; - - timer0: timer@0 { - compatible = "riscv,timer"; - interrupts = < 1 >; - interrupt-parent = < &pic0 >; - clock-frequency = < 400000000 >; - }; - - htif0: htif@0 { - compatible = "riscv,htif"; - interrupts = < 0 >; - interrupt-parent = < &pic0 >; - - console0: console@0 { - compatible = "htif,console"; - status = "okay"; - }; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "console0"; - stdout = "console0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/dts/riscv/spike.dts b/usr/src/boot/sys/boot/fdt/dts/riscv/spike.dts deleted file mode 100644 index dc671141ac..0000000000 --- a/usr/src/boot/sys/boot/fdt/dts/riscv/spike.dts +++ /dev/null @@ -1,109 +0,0 @@ -/*- - * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com> - * All rights reserved. - * - * Portions of this software were developed by SRI International and the - * University of Cambridge Computer Laboratory under DARPA/AFRL contract - * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Portions of this software were developed by the University of Cambridge - * Computer Laboratory as part of the CTSRD Project, with support from the - * UK Higher Education Innovation Fund (HEIF). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "UC Berkeley Spike Simulator RV64I"; - compatible = "riscv,rv64i"; - #address-cells = <1>; - #size-cells = <1>; - #interrupt-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "riscv,rv64i"; - reg = <0x40002000>; - }; - - cpu@1 { - device_type = "cpu"; - compatible = "riscv,rv64i"; - reg = <0x4000a000>; - }; - }; - - aliases { - console0 = &console0; - }; - - memory { - device_type = "memory"; - reg = <0x0 0x40000000>; /* 1GB at 0x0 */ - }; - - soc { - #address-cells = <2>; - #size-cells = <2>; - #interrupt-cells = <1>; - - compatible = "simple-bus"; - ranges; - - pic0: pic@0 { - compatible = "riscv,pic"; - interrupt-controller; - }; - - timer0: timer@0 { - compatible = "riscv,timer"; - interrupts = < 1 >; - interrupt-parent = < &pic0 >; - clock-frequency = < 1000000 >; - }; - - htif0: htif@0 { - compatible = "riscv,htif"; - interrupts = < 0 >; - interrupt-parent = < &pic0 >; - - console0: console@0 { - compatible = "htif,console"; - status = "okay"; - }; - }; - }; - - chosen { - bootargs = "-v"; - stdin = "console0"; - stdout = "console0"; - }; -}; diff --git a/usr/src/boot/sys/boot/fdt/fdt_loader_cmd.c b/usr/src/boot/sys/boot/fdt/fdt_loader_cmd.c deleted file mode 100644 index b0b7ef568c..0000000000 --- a/usr/src/boot/sys/boot/fdt/fdt_loader_cmd.c +++ /dev/null @@ -1,1589 +0,0 @@ -/*- - * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include <fdt.h> -#include <libfdt.h> -#include <sys/param.h> -#include <sys/linker.h> -#include <machine/elf.h> - -#include "bootstrap.h" -#include "fdt_platform.h" - -#ifdef DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ - printf(fmt,##args); } while (0) -#else -#define debugf(fmt, args...) -#endif - -#define FDT_CWD_LEN 256 -#define FDT_MAX_DEPTH 6 - -#define FDT_PROP_SEP " = " - -#define COPYOUT(s,d,l) archsw.arch_copyout(s, d, l) -#define COPYIN(s,d,l) archsw.arch_copyin(s, d, l) - -#define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" - -#define CMD_REQUIRES_BLOB 0x01 - -/* Location of FDT yet to be loaded. */ -/* This may be in read-only memory, so can't be manipulated directly. */ -static struct fdt_header *fdt_to_load = NULL; -/* Location of FDT on heap. */ -/* This is the copy we actually manipulate. */ -static struct fdt_header *fdtp = NULL; -/* Size of FDT blob */ -static size_t fdtp_size = 0; -/* Location of FDT in kernel or module. */ -/* This won't be set if FDT is loaded from disk or memory. */ -/* If it is set, we'll update it when fdt_copy() gets called. */ -static vm_offset_t fdtp_va = 0; - -static int fdt_load_dtb(vm_offset_t va); - -static int fdt_cmd_nyi(int argc, char *argv[]); - -static int fdt_cmd_addr(int argc, char *argv[]); -static int fdt_cmd_mkprop(int argc, char *argv[]); -static int fdt_cmd_cd(int argc, char *argv[]); -static int fdt_cmd_hdr(int argc, char *argv[]); -static int fdt_cmd_ls(int argc, char *argv[]); -static int fdt_cmd_prop(int argc, char *argv[]); -static int fdt_cmd_pwd(int argc, char *argv[]); -static int fdt_cmd_rm(int argc, char *argv[]); -static int fdt_cmd_mknode(int argc, char *argv[]); -static int fdt_cmd_mres(int argc, char *argv[]); - -typedef int cmdf_t(int, char *[]); - -struct cmdtab { - const char *name; - cmdf_t *handler; - int flags; -}; - -static const struct cmdtab commands[] = { - { "addr", &fdt_cmd_addr, 0 }, - { "alias", &fdt_cmd_nyi, 0 }, - { "cd", &fdt_cmd_cd, CMD_REQUIRES_BLOB }, - { "header", &fdt_cmd_hdr, CMD_REQUIRES_BLOB }, - { "ls", &fdt_cmd_ls, CMD_REQUIRES_BLOB }, - { "mknode", &fdt_cmd_mknode, CMD_REQUIRES_BLOB }, - { "mkprop", &fdt_cmd_mkprop, CMD_REQUIRES_BLOB }, - { "mres", &fdt_cmd_mres, CMD_REQUIRES_BLOB }, - { "prop", &fdt_cmd_prop, CMD_REQUIRES_BLOB }, - { "pwd", &fdt_cmd_pwd, CMD_REQUIRES_BLOB }, - { "rm", &fdt_cmd_rm, CMD_REQUIRES_BLOB }, - { NULL, NULL } -}; - -static char cwd[FDT_CWD_LEN] = "/"; - -static vm_offset_t -fdt_find_static_dtb() -{ - Elf_Ehdr *ehdr; - Elf_Shdr *shdr; - Elf_Sym sym; - vm_offset_t strtab, symtab, fdt_start; - uint64_t offs; - struct preloaded_file *kfp; - struct file_metadata *md; - char *strp; - int i, sym_count; - - debugf("fdt_find_static_dtb()\n"); - - sym_count = symtab = strtab = 0; - strp = NULL; - - offs = __elfN(relocation_offset); - - kfp = file_findfile(NULL, NULL); - if (kfp == NULL) - return (0); - - /* Locate the dynamic symbols and strtab. */ - md = file_findmetadata(kfp, MODINFOMD_ELFHDR); - if (md == NULL) - return (0); - ehdr = (Elf_Ehdr *)md->md_data; - - md = file_findmetadata(kfp, MODINFOMD_SHDR); - if (md == NULL) - return (0); - shdr = (Elf_Shdr *)md->md_data; - - for (i = 0; i < ehdr->e_shnum; ++i) { - if (shdr[i].sh_type == SHT_DYNSYM && symtab == 0) { - symtab = shdr[i].sh_addr + offs; - sym_count = shdr[i].sh_size / sizeof(Elf_Sym); - } else if (shdr[i].sh_type == SHT_STRTAB && strtab == 0) { - strtab = shdr[i].sh_addr + offs; - } - } - - /* - * The most efficient way to find a symbol would be to calculate a - * hash, find proper bucket and chain, and thus find a symbol. - * However, that would involve code duplication (e.g. for hash - * function). So we're using simpler and a bit slower way: we're - * iterating through symbols, searching for the one which name is - * 'equal' to 'fdt_static_dtb'. To speed up the process a little bit, - * we are eliminating symbols type of which is not STT_NOTYPE, or(and) - * those which binding attribute is not STB_GLOBAL. - */ - fdt_start = 0; - while (sym_count > 0 && fdt_start == 0) { - COPYOUT(symtab, &sym, sizeof(sym)); - symtab += sizeof(sym); - --sym_count; - if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || - ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) - continue; - strp = strdupout(strtab + sym.st_name); - if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) - fdt_start = (vm_offset_t)sym.st_value + offs; - free(strp); - } - return (fdt_start); -} - -static int -fdt_load_dtb(vm_offset_t va) -{ - struct fdt_header header; - int err; - - debugf("fdt_load_dtb(0x%08jx)\n", (uintmax_t)va); - - COPYOUT(va, &header, sizeof(header)); - err = fdt_check_header(&header); - if (err < 0) { - if (err == -FDT_ERR_BADVERSION) { - snprintf(command_errbuf, sizeof (command_errbuf), - "incompatible blob version: %d, should be: %d", - fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); - - } else { - snprintf(command_errbuf, sizeof (command_errbuf), - "error validating blob: %s", fdt_strerror(err)); - } - return (1); - } - - /* - * Release previous blob - */ - if (fdtp) - free(fdtp); - - fdtp_size = fdt_totalsize(&header); - fdtp = malloc(fdtp_size); - - if (fdtp == NULL) { - command_errmsg = "can't allocate memory for device tree copy"; - return (1); - } - - fdtp_va = va; - COPYOUT(va, fdtp, fdtp_size); - debugf("DTB blob found at 0x%jx, size: 0x%jx\n", (uintmax_t)va, (uintmax_t)fdtp_size); - - return (0); -} - -int -fdt_load_dtb_addr(struct fdt_header *header) -{ - int err; - - debugf("fdt_load_dtb_addr(%p)\n", header); - - fdtp_size = fdt_totalsize(header); - err = fdt_check_header(header); - if (err < 0) { - snprintf(command_errbuf, sizeof (command_errbuf), - "error validating blob: %s", fdt_strerror(err)); - return (err); - } - free(fdtp); - if ((fdtp = malloc(fdtp_size)) == NULL) { - command_errmsg = "can't allocate memory for device tree copy"; - return (1); - } - - fdtp_va = 0; // Don't write this back into module or kernel. - bcopy(header, fdtp, fdtp_size); - return (0); -} - -int -fdt_load_dtb_file(const char * filename) -{ - struct preloaded_file *bfp, *oldbfp; - int err; - - debugf("fdt_load_dtb_file(%s)\n", filename); - - oldbfp = file_findfile(NULL, "dtb"); - - /* Attempt to load and validate a new dtb from a file. */ - if ((bfp = file_loadraw(filename, "dtb", 1)) == NULL) { - snprintf(command_errbuf, sizeof (command_errbuf), - "failed to load file '%s'", filename); - return (1); - } - if ((err = fdt_load_dtb(bfp->f_addr)) != 0) { - file_discard(bfp); - return (err); - } - - /* A new dtb was validated, discard any previous file. */ - if (oldbfp) - file_discard(oldbfp); - return (0); -} - -int -fdt_setup_fdtp() -{ - struct preloaded_file *bfp; - vm_offset_t va; - - debugf("fdt_setup_fdtp()\n"); - - /* If we already loaded a file, use it. */ - if ((bfp = file_findfile(NULL, "dtb")) != NULL) { - if (fdt_load_dtb(bfp->f_addr) == 0) { - printf("Using DTB from loaded file '%s'.\n", - bfp->f_name); - return (0); - } - } - - /* If we were given the address of a valid blob in memory, use it. */ - if (fdt_to_load != NULL) { - if (fdt_load_dtb_addr(fdt_to_load) == 0) { - printf("Using DTB from memory address 0x%p.\n", - fdt_to_load); - return (0); - } - } - - if (fdt_platform_load_dtb() == 0) - return (0); - - /* If there is a dtb compiled into the kernel, use it. */ - if ((va = fdt_find_static_dtb()) != 0) { - if (fdt_load_dtb(va) == 0) { - printf("Using DTB compiled into kernel.\n"); - return (0); - } - } - - command_errmsg = "No device tree blob found!\n"; - return (1); -} - -#define fdt_strtovect(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ - (cellbuf), (lim), (cellsize), 0); - -/* Force using base 16 */ -#define fdt_strtovectx(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ - (cellbuf), (lim), (cellsize), 16); - -static int -_fdt_strtovect(const char *str, void *cellbuf, int lim, unsigned char cellsize, - uint8_t base) -{ - const char *buf = str; - const char *end = str + strlen(str) - 2; - uint32_t *u32buf = NULL; - uint8_t *u8buf = NULL; - int cnt = 0; - - if (cellsize == sizeof(uint32_t)) - u32buf = (uint32_t *)cellbuf; - else - u8buf = (uint8_t *)cellbuf; - - if (lim == 0) - return (0); - - while (buf < end) { - - /* Skip white whitespace(s)/separators */ - while (!isxdigit(*buf) && buf < end) - buf++; - - if (u32buf != NULL) - u32buf[cnt] = - cpu_to_fdt32((uint32_t)strtol(buf, NULL, base)); - - else - u8buf[cnt] = (uint8_t)strtol(buf, NULL, base); - - if (cnt + 1 <= lim - 1) - cnt++; - else - break; - buf++; - /* Find another number */ - while ((isxdigit(*buf) || *buf == 'x') && buf < end) - buf++; - } - return (cnt); -} - -void -fdt_fixup_ethernet(const char *str, char *ethstr, int len) -{ - uint8_t tmp_addr[6]; - - /* Convert macaddr string into a vector of uints */ - fdt_strtovectx(str, &tmp_addr, 6, sizeof(uint8_t)); - /* Set actual property to a value from vect */ - fdt_setprop(fdtp, fdt_path_offset(fdtp, ethstr), - "local-mac-address", &tmp_addr, 6 * sizeof(uint8_t)); -} - -void -fdt_fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) -{ - int lo, o = 0, o2, maxo = 0, depth; - const uint32_t zero = 0; - - /* We want to modify every subnode of /cpus */ - o = fdt_path_offset(fdtp, "/cpus"); - if (o < 0) - return; - - /* maxo should contain offset of node next to /cpus */ - depth = 0; - maxo = o; - while (depth != -1) - maxo = fdt_next_node(fdtp, maxo, &depth); - - /* Find CPU frequency properties */ - o = fdt_node_offset_by_prop_value(fdtp, o, "clock-frequency", - &zero, sizeof(uint32_t)); - - o2 = fdt_node_offset_by_prop_value(fdtp, o, "bus-frequency", &zero, - sizeof(uint32_t)); - - lo = MIN(o, o2); - - while (o != -FDT_ERR_NOTFOUND && o2 != -FDT_ERR_NOTFOUND) { - - o = fdt_node_offset_by_prop_value(fdtp, lo, - "clock-frequency", &zero, sizeof(uint32_t)); - - o2 = fdt_node_offset_by_prop_value(fdtp, lo, "bus-frequency", - &zero, sizeof(uint32_t)); - - /* We're only interested in /cpus subnode(s) */ - if (lo > maxo) - break; - - fdt_setprop_inplace_cell(fdtp, lo, "clock-frequency", - (uint32_t)cpufreq); - - fdt_setprop_inplace_cell(fdtp, lo, "bus-frequency", - (uint32_t)busfreq); - - lo = MIN(o, o2); - } -} - -#ifdef notyet -static int -fdt_reg_valid(uint32_t *reg, int len, int addr_cells, int size_cells) -{ - int cells_in_tuple, i, tuples, tuple_size; - uint32_t cur_start, cur_size; - - cells_in_tuple = (addr_cells + size_cells); - tuple_size = cells_in_tuple * sizeof(uint32_t); - tuples = len / tuple_size; - if (tuples == 0) - return (EINVAL); - - for (i = 0; i < tuples; i++) { - if (addr_cells == 2) - cur_start = fdt64_to_cpu(reg[i * cells_in_tuple]); - else - cur_start = fdt32_to_cpu(reg[i * cells_in_tuple]); - - if (size_cells == 2) - cur_size = fdt64_to_cpu(reg[i * cells_in_tuple + 2]); - else - cur_size = fdt32_to_cpu(reg[i * cells_in_tuple + 1]); - - if (cur_size == 0) - return (EINVAL); - - debugf(" reg#%d (start: 0x%0x size: 0x%0x) valid!\n", - i, cur_start, cur_size); - } - return (0); -} -#endif - -void -fdt_fixup_memory(struct fdt_mem_region *region, size_t num) -{ - struct fdt_mem_region *curmr; - uint32_t addr_cells, size_cells; - uint32_t *addr_cellsp, *size_cellsp; - int err, i, len, memory, root; - size_t realmrno; - uint8_t *buf, *sb; - uint64_t rstart, rsize; - int reserved; - - root = fdt_path_offset(fdtp, "/"); - if (root < 0) { - sprintf(command_errbuf, "Could not find root node !"); - return; - } - - memory = fdt_path_offset(fdtp, "/memory"); - if (memory <= 0) { - /* Create proper '/memory' node. */ - memory = fdt_add_subnode(fdtp, root, "memory"); - if (memory <= 0) { - snprintf(command_errbuf, sizeof (command_errbuf), - "Could not fixup '/memory' " - "node, error code : %d!\n", memory); - return; - } - - err = fdt_setprop(fdtp, memory, "device_type", "memory", - sizeof("memory")); - - if (err < 0) - return; - } - - addr_cellsp = (uint32_t *)fdt_getprop(fdtp, root, "#address-cells", - NULL); - size_cellsp = (uint32_t *)fdt_getprop(fdtp, root, "#size-cells", NULL); - - if (addr_cellsp == NULL || size_cellsp == NULL) { - snprintf(command_errbuf, sizeof (command_errbuf), - "Could not fixup '/memory' node : " - "%s %s property not found in root node!\n", - (!addr_cellsp) ? "#address-cells" : "", - (!size_cellsp) ? "#size-cells" : ""); - return; - } - - addr_cells = fdt32_to_cpu(*addr_cellsp); - size_cells = fdt32_to_cpu(*size_cellsp); - - /* - * Convert memreserve data to memreserve property - * Check if property already exists - */ - reserved = fdt_num_mem_rsv(fdtp); - if (reserved && - (fdt_getprop(fdtp, root, "memreserve", NULL) == NULL)) { - len = (addr_cells + size_cells) * reserved * sizeof(uint32_t); - sb = buf = (uint8_t *)malloc(len); - if (!buf) - return; - - bzero(buf, len); - - for (i = 0; i < reserved; i++) { - if (fdt_get_mem_rsv(fdtp, i, &rstart, &rsize)) - break; - if (rsize) { - /* Ensure endianness, and put cells into a buffer */ - if (addr_cells == 2) - *(uint64_t *)buf = - cpu_to_fdt64(rstart); - else - *(uint32_t *)buf = - cpu_to_fdt32(rstart); - - buf += sizeof(uint32_t) * addr_cells; - if (size_cells == 2) - *(uint64_t *)buf = - cpu_to_fdt64(rsize); - else - *(uint32_t *)buf = - cpu_to_fdt32(rsize); - - buf += sizeof(uint32_t) * size_cells; - } - } - - /* Set property */ - if ((err = fdt_setprop(fdtp, root, "memreserve", sb, len)) < 0) - printf("Could not fixup 'memreserve' property.\n"); - - free(sb); - } - - /* Count valid memory regions entries in sysinfo. */ - realmrno = num; - for (i = 0; i < num; i++) - if (region[i].start == 0 && region[i].size == 0) - realmrno--; - - if (realmrno == 0) { - snprintf(command_errbuf, sizeof (command_errbuf), - "Could not fixup '/memory' node : " - "sysinfo doesn't contain valid memory regions info!\n"); - return; - } - - len = (addr_cells + size_cells) * realmrno * sizeof(uint32_t); - sb = buf = (uint8_t *)malloc(len); - if (!buf) - return; - - bzero(buf, len); - - for (i = 0; i < num; i++) { - curmr = ®ion[i]; - if (curmr->size != 0) { - /* Ensure endianness, and put cells into a buffer */ - if (addr_cells == 2) - *(uint64_t *)buf = - cpu_to_fdt64(curmr->start); - else - *(uint32_t *)buf = - cpu_to_fdt32(curmr->start); - - buf += sizeof(uint32_t) * addr_cells; - if (size_cells == 2) - *(uint64_t *)buf = - cpu_to_fdt64(curmr->size); - else - *(uint32_t *)buf = - cpu_to_fdt32(curmr->size); - - buf += sizeof(uint32_t) * size_cells; - } - } - - /* Set property */ - if ((err = fdt_setprop(fdtp, memory, "reg", sb, len)) < 0) - sprintf(command_errbuf, "Could not fixup '/memory' node.\n"); - - free(sb); -} - -void -fdt_fixup_stdout(const char *str) -{ - char *ptr; - int serialno; - int len, no, sero; - const struct fdt_property *prop; - char *tmp[10]; - - ptr = (char *)str + strlen(str) - 1; - while (ptr > str && isdigit(*(str - 1))) - str--; - - if (ptr == str) - return; - - serialno = (int)strtol(ptr, NULL, 0); - no = fdt_path_offset(fdtp, "/chosen"); - if (no < 0) - return; - - prop = fdt_get_property(fdtp, no, "stdout", &len); - - /* If /chosen/stdout does not extist, create it */ - if (prop == NULL || (prop != NULL && len == 0)) { - - bzero(tmp, 10 * sizeof(char)); - strcpy((char *)&tmp, "serial"); - if (strlen(ptr) > 3) - /* Serial number too long */ - return; - - strncpy((char *)tmp + 6, ptr, 3); - sero = fdt_path_offset(fdtp, (const char *)tmp); - if (sero < 0) - /* - * If serial device we're trying to assign - * stdout to doesn't exist in DT -- return. - */ - return; - - fdt_setprop(fdtp, no, "stdout", &tmp, - strlen((char *)&tmp) + 1); - fdt_setprop(fdtp, no, "stdin", &tmp, - strlen((char *)&tmp) + 1); - } -} - -/* - * Locate the blob, fix it up and return its location. - */ -static int -fdt_fixup(void) -{ - int chosen, len; - - len = 0; - - debugf("fdt_fixup()\n"); - - if (fdtp == NULL && fdt_setup_fdtp() != 0) - return (0); - - /* Create /chosen node (if not exists) */ - if ((chosen = fdt_subnode_offset(fdtp, 0, "chosen")) == - -FDT_ERR_NOTFOUND) - chosen = fdt_add_subnode(fdtp, 0, "chosen"); - - /* Value assigned to fixup-applied does not matter. */ - if (fdt_getprop(fdtp, chosen, "fixup-applied", NULL)) - return (1); - - fdt_platform_fixups(); - - fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); - return (1); -} - -/* - * Copy DTB blob to specified location and return size - */ -int -fdt_copy(vm_offset_t va) -{ - int err; - debugf("fdt_copy va 0x%08x\n", va); - if (fdtp == NULL) { - err = fdt_setup_fdtp(); - if (err) { - printf("No valid device tree blob found!\n"); - return (0); - } - } - - if (fdt_fixup() == 0) - return (0); - - if (fdtp_va != 0) { - /* Overwrite the FDT with the fixed version. */ - /* XXX Is this really appropriate? */ - COPYIN(fdtp, fdtp_va, fdtp_size); - } - COPYIN(fdtp, va, fdtp_size); - return (fdtp_size); -} - - - -int -command_fdt_internal(int argc, char *argv[]) -{ - cmdf_t *cmdh; - int flags; - char *cmd; - int i, err; - - if (argc < 2) { - command_errmsg = "usage is 'fdt <command> [<args>]"; - return (CMD_ERROR); - } - - /* - * Validate fdt <command>. - */ - cmd = strdup(argv[1]); - i = 0; - cmdh = NULL; - while (!(commands[i].name == NULL)) { - if (strcmp(cmd, commands[i].name) == 0) { - /* found it */ - cmdh = commands[i].handler; - flags = commands[i].flags; - break; - } - i++; - } - if (cmdh == NULL) { - command_errmsg = "unknown command"; - return (CMD_ERROR); - } - - if (flags & CMD_REQUIRES_BLOB) { - /* - * Check if uboot env vars were parsed already. If not, do it now. - */ - if (fdt_fixup() == 0) - return (CMD_ERROR); - } - - /* - * Call command handler. - */ - err = (*cmdh)(argc, argv); - - return (err); -} - -static int -fdt_cmd_addr(int argc, char *argv[]) -{ - struct preloaded_file *fp; - struct fdt_header *hdr; - const char *addr; - char *cp; - - fdt_to_load = NULL; - - if (argc > 2) - addr = argv[2]; - else { - sprintf(command_errbuf, "no address specified"); - return (CMD_ERROR); - } - - hdr = (struct fdt_header *)strtoul(addr, &cp, 16); - if (cp == addr) { - snprintf(command_errbuf, sizeof (command_errbuf), - "Invalid address: %s", addr); - return (CMD_ERROR); - } - - while ((fp = file_findfile(NULL, "dtb")) != NULL) { - file_discard(fp); - } - - fdt_to_load = hdr; - return (CMD_OK); -} - -static int -fdt_cmd_cd(int argc, char *argv[]) -{ - char *path; - char tmp[FDT_CWD_LEN]; - int len, o; - - path = (argc > 2) ? argv[2] : "/"; - - if (path[0] == '/') { - len = strlen(path); - if (len >= FDT_CWD_LEN) - goto fail; - } else { - /* Handle path specification relative to cwd */ - len = strlen(cwd) + strlen(path) + 1; - if (len >= FDT_CWD_LEN) - goto fail; - - strcpy(tmp, cwd); - strcat(tmp, "/"); - strcat(tmp, path); - path = tmp; - } - - o = fdt_path_offset(fdtp, path); - if (o < 0) { - snprintf(command_errbuf, sizeof (command_errbuf), - "could not find node: '%s'", path); - return (CMD_ERROR); - } - - strcpy(cwd, path); - return (CMD_OK); - -fail: - snprintf(command_errbuf, sizeof (command_errbuf), - "path too long: %d, max allowed: %d", len, FDT_CWD_LEN - 1); - return (CMD_ERROR); -} - -static int -fdt_cmd_hdr(int argc __unused, char *argv[] __unused) -{ - char line[80]; - int ver; - - if (fdtp == NULL) { - command_errmsg = "no device tree blob pointer?!"; - return (CMD_ERROR); - } - - ver = fdt_version(fdtp); - pager_open(); - sprintf(line, "\nFlattened device tree header (%p):\n", fdtp); - pager_output(line); - sprintf(line, " magic = 0x%08x\n", fdt_magic(fdtp)); - pager_output(line); - sprintf(line, " size = %d\n", fdt_totalsize(fdtp)); - pager_output(line); - sprintf(line, " off_dt_struct = 0x%08x\n", - fdt_off_dt_struct(fdtp)); - pager_output(line); - sprintf(line, " off_dt_strings = 0x%08x\n", - fdt_off_dt_strings(fdtp)); - pager_output(line); - sprintf(line, " off_mem_rsvmap = 0x%08x\n", - fdt_off_mem_rsvmap(fdtp)); - pager_output(line); - sprintf(line, " version = %d\n", ver); - pager_output(line); - sprintf(line, " last compatible version = %d\n", - fdt_last_comp_version(fdtp)); - pager_output(line); - if (ver >= 2) { - sprintf(line, " boot_cpuid = %d\n", - fdt_boot_cpuid_phys(fdtp)); - pager_output(line); - } - if (ver >= 3) { - sprintf(line, " size_dt_strings = %d\n", - fdt_size_dt_strings(fdtp)); - pager_output(line); - } - if (ver >= 17) { - sprintf(line, " size_dt_struct = %d\n", - fdt_size_dt_struct(fdtp)); - pager_output(line); - } - pager_close(); - - return (CMD_OK); -} - -static int -fdt_cmd_ls(int argc, char *argv[]) -{ - const char *prevname[FDT_MAX_DEPTH] = { NULL }; - const char *name; - char *path; - int i, o, depth, len; - - path = (argc > 2) ? argv[2] : NULL; - if (path == NULL) - path = cwd; - - o = fdt_path_offset(fdtp, path); - if (o < 0) { - snprintf(command_errbuf, sizeof (command_errbuf), - "could not find node: '%s'", path); - return (CMD_ERROR); - } - - for (depth = 0; - (o >= 0) && (depth >= 0); - o = fdt_next_node(fdtp, o, &depth)) { - - name = fdt_get_name(fdtp, o, &len); - - if (depth > FDT_MAX_DEPTH) { - printf("max depth exceeded: %d\n", depth); - continue; - } - - prevname[depth] = name; - - /* Skip root (i = 1) when printing devices */ - for (i = 1; i <= depth; i++) { - if (prevname[i] == NULL) - break; - - if (strcmp(cwd, "/") == 0) - printf("/"); - printf("%s", prevname[i]); - } - printf("\n"); - } - - return (CMD_OK); -} - -static __inline int -isprint(int c) -{ - - return (c >= ' ' && c <= 0x7e); -} - -static int -fdt_isprint(const void *data, int len, int *count) -{ - const char *d; - char ch; - int yesno, i; - - if (len == 0) - return (0); - - d = (const char *)data; - if (d[len - 1] != '\0') - return (0); - - *count = 0; - yesno = 1; - for (i = 0; i < len; i++) { - ch = *(d + i); - if (isprint(ch) || (ch == '\0' && i > 0)) { - /* Count strings */ - if (ch == '\0') - (*count)++; - continue; - } - - yesno = 0; - break; - } - - return (yesno); -} - -static int -fdt_data_str(const void *data, int len, int count, char **buf) -{ - char *b, *tmp; - const char *d; - int buf_len, i, l; - - /* - * Calculate the length for the string and allocate memory. - * - * Note that 'len' already includes at least one terminator. - */ - buf_len = len; - if (count > 1) { - /* - * Each token had already a terminator buried in 'len', but we - * only need one eventually, don't count space for these. - */ - buf_len -= count - 1; - - /* Each consecutive token requires a ", " separator. */ - buf_len += count * 2; - } - - /* Add some space for surrounding double quotes. */ - buf_len += count * 2; - - /* Note that string being put in 'tmp' may be as big as 'buf_len'. */ - b = (char *)malloc(buf_len); - tmp = (char *)malloc(buf_len); - if (b == NULL) - goto error; - - if (tmp == NULL) { - free(b); - goto error; - } - - b[0] = '\0'; - - /* - * Now that we have space, format the string. - */ - i = 0; - do { - d = (const char *)data + i; - l = strlen(d) + 1; - - sprintf(tmp, "\"%s\"%s", d, - (i + l) < len ? ", " : ""); - strcat(b, tmp); - - i += l; - - } while (i < len); - *buf = b; - - free(tmp); - - return (0); -error: - return (1); -} - -static int -fdt_data_cell(const void *data, int len, char **buf) -{ - char *b, *tmp; - const uint32_t *c; - int count, i, l; - - /* Number of cells */ - count = len / 4; - - /* - * Calculate the length for the string and allocate memory. - */ - - /* Each byte translates to 2 output characters */ - l = len * 2; - if (count > 1) { - /* Each consecutive cell requires a " " separator. */ - l += (count - 1) * 1; - } - /* Each cell will have a "0x" prefix */ - l += count * 2; - /* Space for surrounding <> and terminator */ - l += 3; - - b = (char *)malloc(l); - tmp = (char *)malloc(l); - if (b == NULL) - goto error; - - if (tmp == NULL) { - free(b); - goto error; - } - - b[0] = '\0'; - strcat(b, "<"); - - for (i = 0; i < len; i += 4) { - c = (const uint32_t *)((const uint8_t *)data + i); - sprintf(tmp, "0x%08x%s", fdt32_to_cpu(*c), - i < (len - 4) ? " " : ""); - strcat(b, tmp); - } - strcat(b, ">"); - *buf = b; - - free(tmp); - - return (0); -error: - return (1); -} - -static int -fdt_data_bytes(const void *data, int len, char **buf) -{ - char *b, *tmp; - const char *d; - int i, l; - - /* - * Calculate the length for the string and allocate memory. - */ - - /* Each byte translates to 2 output characters */ - l = len * 2; - if (len > 1) - /* Each consecutive byte requires a " " separator. */ - l += (len - 1) * 1; - /* Each byte will have a "0x" prefix */ - l += len * 2; - /* Space for surrounding [] and terminator. */ - l += 3; - - b = (char *)malloc(l); - tmp = (char *)malloc(l); - if (b == NULL) - goto error; - - if (tmp == NULL) { - free(b); - goto error; - } - - b[0] = '\0'; - strcat(b, "["); - - for (i = 0, d = data; i < len; i++) { - sprintf(tmp, "0x%02x%s", d[i], i < len - 1 ? " " : ""); - strcat(b, tmp); - } - strcat(b, "]"); - *buf = b; - - free(tmp); - - return (0); -error: - return (1); -} - -static int -fdt_data_fmt(const void *data, int len, char **buf) -{ - int count; - - if (len == 0) { - *buf = NULL; - return (1); - } - - if (fdt_isprint(data, len, &count)) - return (fdt_data_str(data, len, count, buf)); - - else if ((len % 4) == 0) - return (fdt_data_cell(data, len, buf)); - - else - return (fdt_data_bytes(data, len, buf)); -} - -static int -fdt_prop(int offset) -{ - char *line, *buf; - const struct fdt_property *prop; - const char *name; - const void *data; - int len, rv; - - line = NULL; - prop = fdt_offset_ptr(fdtp, offset, sizeof(*prop)); - if (prop == NULL) - return (1); - - name = fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)); - len = fdt32_to_cpu(prop->len); - - rv = 0; - buf = NULL; - if (len == 0) { - /* Property without value */ - line = (char *)malloc(strlen(name) + 2); - if (line == NULL) { - rv = 2; - goto out2; - } - sprintf(line, "%s\n", name); - goto out1; - } - - /* - * Process property with value - */ - data = prop->data; - - if (fdt_data_fmt(data, len, &buf) != 0) { - rv = 3; - goto out2; - } - - line = (char *)malloc(strlen(name) + strlen(FDT_PROP_SEP) + - strlen(buf) + 2); - if (line == NULL) { - sprintf(command_errbuf, "could not allocate space for string"); - rv = 4; - goto out2; - } - - sprintf(line, "%s" FDT_PROP_SEP "%s\n", name, buf); - -out1: - pager_open(); - pager_output(line); - pager_close(); - -out2: - if (buf) - free(buf); - - if (line) - free(line); - - return (rv); -} - -static int -fdt_modprop(int nodeoff, char *propname, void *value, char mode) -{ - uint32_t cells[100]; - const char *buf; - int len, rv; - const struct fdt_property *p; - - p = fdt_get_property(fdtp, nodeoff, propname, NULL); - - if (p != NULL) { - if (mode == 1) { - /* Adding inexistant value in mode 1 is forbidden */ - sprintf(command_errbuf, "property already exists!"); - return (CMD_ERROR); - } - } else if (mode == 0) { - sprintf(command_errbuf, "property does not exist!"); - return (CMD_ERROR); - } - len = strlen(value); - rv = 0; - buf = value; - - switch (*buf) { - case '&': - /* phandles */ - break; - case '<': - /* Data cells */ - len = fdt_strtovect(buf, (void *)&cells, 100, - sizeof(uint32_t)); - - rv = fdt_setprop(fdtp, nodeoff, propname, &cells, - len * sizeof(uint32_t)); - break; - case '[': - /* Data bytes */ - len = fdt_strtovect(buf, (void *)&cells, 100, - sizeof(uint8_t)); - - rv = fdt_setprop(fdtp, nodeoff, propname, &cells, - len * sizeof(uint8_t)); - break; - case '"': - default: - /* Default -- string */ - rv = fdt_setprop_string(fdtp, nodeoff, propname, value); - break; - } - - if (rv != 0) { - if (rv == -FDT_ERR_NOSPACE) - sprintf(command_errbuf, - "Device tree blob is too small!\n"); - else - sprintf(command_errbuf, - "Could not add/modify property!\n"); - } - return (rv); -} - -/* Merge strings from argv into a single string */ -static int -fdt_merge_strings(int argc, char *argv[], int start, char **buffer) -{ - char *buf; - int i, idx, sz; - - *buffer = NULL; - sz = 0; - - for (i = start; i < argc; i++) - sz += strlen(argv[i]); - - /* Additional bytes for whitespaces between args */ - sz += argc - start; - - buf = (char *)malloc(sizeof(char) * sz); - if (buf == NULL) { - sprintf(command_errbuf, "could not allocate space " - "for string"); - return (1); - } - bzero(buf, sizeof(char) * sz); - - idx = 0; - for (i = start, idx = 0; i < argc; i++) { - strcpy(buf + idx, argv[i]); - idx += strlen(argv[i]); - buf[idx] = ' '; - idx++; - } - buf[sz - 1] = '\0'; - *buffer = buf; - return (0); -} - -/* Extract offset and name of node/property from a given path */ -static int -fdt_extract_nameloc(char **pathp, char **namep, int *nodeoff) -{ - int o; - char *path = *pathp, *name = NULL, *subpath = NULL; - - subpath = strrchr(path, '/'); - if (subpath == NULL) { - o = fdt_path_offset(fdtp, cwd); - name = path; - path = (char *)&cwd; - } else { - *subpath = '\0'; - if (strlen(path) == 0) - path = cwd; - - name = subpath + 1; - o = fdt_path_offset(fdtp, path); - } - - if (strlen(name) == 0) { - sprintf(command_errbuf, "name not specified"); - return (1); - } - if (o < 0) { - snprintf(command_errbuf, sizeof (command_errbuf), - "could not find node: '%s'", path); - return (1); - } - *namep = name; - *nodeoff = o; - *pathp = path; - return (0); -} - -static int -fdt_cmd_prop(int argc, char *argv[]) -{ - char *path, *propname, *value; - int o, next, depth, rv; - uint32_t tag; - - path = (argc > 2) ? argv[2] : NULL; - - value = NULL; - - if (argc > 3) { - /* Merge property value strings into one */ - if (fdt_merge_strings(argc, argv, 3, &value) != 0) - return (CMD_ERROR); - } else - value = NULL; - - if (path == NULL) - path = cwd; - - rv = CMD_OK; - - if (value) { - /* If value is specified -- try to modify prop. */ - if (fdt_extract_nameloc(&path, &propname, &o) != 0) - return (CMD_ERROR); - - rv = fdt_modprop(o, propname, value, 0); - if (rv) - return (CMD_ERROR); - return (CMD_OK); - - } - /* User wants to display properties */ - o = fdt_path_offset(fdtp, path); - - if (o < 0) { - snprintf(command_errbuf, sizeof (command_errbuf), - "could not find node: '%s'", path); - rv = CMD_ERROR; - goto out; - } - - depth = 0; - while (depth >= 0) { - tag = fdt_next_tag(fdtp, o, &next); - switch (tag) { - case FDT_NOP: - break; - case FDT_PROP: - if (depth > 1) - /* Don't process properties of nested nodes */ - break; - - if (fdt_prop(o) != 0) { - sprintf(command_errbuf, "could not process " - "property"); - rv = CMD_ERROR; - goto out; - } - break; - case FDT_BEGIN_NODE: - depth++; - if (depth > FDT_MAX_DEPTH) { - printf("warning: nesting too deep: %d\n", - depth); - goto out; - } - break; - case FDT_END_NODE: - depth--; - if (depth == 0) - /* - * This is the end of our starting node, force - * the loop finish. - */ - depth--; - break; - } - o = next; - } -out: - return (rv); -} - -static int -fdt_cmd_mkprop(int argc, char *argv[]) -{ - int o; - char *path, *propname, *value; - - path = (argc > 2) ? argv[2] : NULL; - - value = NULL; - - if (argc > 3) { - /* Merge property value strings into one */ - if (fdt_merge_strings(argc, argv, 3, &value) != 0) - return (CMD_ERROR); - } else - value = NULL; - - if (fdt_extract_nameloc(&path, &propname, &o) != 0) - return (CMD_ERROR); - - if (fdt_modprop(o, propname, value, 1)) - return (CMD_ERROR); - - return (CMD_OK); -} - -static int -fdt_cmd_rm(int argc, char *argv[]) -{ - int o, rv; - char *path = NULL, *propname; - - if (argc > 2) - path = argv[2]; - else { - sprintf(command_errbuf, "no node/property name specified"); - return (CMD_ERROR); - } - - o = fdt_path_offset(fdtp, path); - if (o < 0) { - /* If node not found -- try to find & delete property */ - if (fdt_extract_nameloc(&path, &propname, &o) != 0) - return (CMD_ERROR); - - if ((rv = fdt_delprop(fdtp, o, propname)) != 0) { - snprintf(command_errbuf, sizeof (command_errbuf), - "could not delete %s\n", - (rv == -FDT_ERR_NOTFOUND) ? - "(property/node does not exist)" : ""); - return (CMD_ERROR); - - } else - return (CMD_OK); - } - /* If node exists -- remove node */ - rv = fdt_del_node(fdtp, o); - if (rv) { - sprintf(command_errbuf, "could not delete node"); - return (CMD_ERROR); - } - return (CMD_OK); -} - -static int -fdt_cmd_mknode(int argc, char *argv[]) -{ - int o, rv; - char *path = NULL, *nodename = NULL; - - if (argc > 2) - path = argv[2]; - else { - sprintf(command_errbuf, "no node name specified"); - return (CMD_ERROR); - } - - if (fdt_extract_nameloc(&path, &nodename, &o) != 0) - return (CMD_ERROR); - - rv = fdt_add_subnode(fdtp, o, nodename); - - if (rv < 0) { - if (rv == -FDT_ERR_NOSPACE) - sprintf(command_errbuf, - "Device tree blob is too small!\n"); - else - sprintf(command_errbuf, - "Could not add node!\n"); - return (CMD_ERROR); - } - return (CMD_OK); -} - -static int -fdt_cmd_pwd(int argc, char *argv[]) -{ - char line[FDT_CWD_LEN]; - - pager_open(); - sprintf(line, "%s\n", cwd); - pager_output(line); - pager_close(); - return (CMD_OK); -} - -static int -fdt_cmd_mres(int argc, char *argv[]) -{ - uint64_t start, size; - int i, total; - char line[80]; - - pager_open(); - total = fdt_num_mem_rsv(fdtp); - if (total > 0) { - pager_output("Reserved memory regions:\n"); - for (i = 0; i < total; i++) { - fdt_get_mem_rsv(fdtp, i, &start, &size); - sprintf(line, "reg#%d: (start: 0x%jx, size: 0x%jx)\n", - i, start, size); - pager_output(line); - } - } else - pager_output("No reserved memory regions\n"); - pager_close(); - - return (CMD_OK); -} - -static int -fdt_cmd_nyi(int argc, char *argv[]) -{ - - printf("command not yet implemented\n"); - return (CMD_ERROR); -} diff --git a/usr/src/boot/sys/boot/fdt/fdt_platform.h b/usr/src/boot/sys/boot/fdt/fdt_platform.h deleted file mode 100644 index cad760279b..0000000000 --- a/usr/src/boot/sys/boot/fdt/fdt_platform.h +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * Copyright (c) 2014 Andrew Turner <andrew@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef FDT_PLATFORM_H -#define FDT_PLATFORM_H - -struct fdt_header; - -struct fdt_mem_region { - unsigned long start; - unsigned long size; -}; - -#define TMP_MAX_ETH 8 - -int fdt_copy(vm_offset_t); -void fdt_fixup_cpubusfreqs(unsigned long, unsigned long); -void fdt_fixup_ethernet(const char *, char *, int); -void fdt_fixup_memory(struct fdt_mem_region *, size_t); -void fdt_fixup_stdout(const char *); -int fdt_load_dtb_addr(struct fdt_header *); -int fdt_load_dtb_file(const char *); -int fdt_setup_fdtp(void); - -/* The platform library needs to implement these functions */ -int fdt_platform_load_dtb(void); -void fdt_platform_fixups(void); - -#endif /* FDT_PLATFORM_H */ diff --git a/usr/src/boot/sys/boot/fdt/help.fdt b/usr/src/boot/sys/boot/fdt/help.fdt deleted file mode 100644 index 665f63c260..0000000000 --- a/usr/src/boot/sys/boot/fdt/help.fdt +++ /dev/null @@ -1,93 +0,0 @@ -$FreeBSD$ -############################################################################### -# Tfdt Dfdt manipulation commands - - fdt <subcommand> <arguments> - - Facilities for loading and manipulating device tree data. - -############################################################################### -# Tfdt Saddr Dload fdt from an address in memory - - fdt addr <address> - - Copies compiled device tree from a particular location - in memory. - -############################################################################### -# Tfdt Salias DXXX - - fdt alias <address> - - Not Yet Implemented - -############################################################################### -# Tfdt Scd DSelect a particular node for future commands - - fdt cd <path> - - Changes the current node to the node specified by the path. - Path elements are separated by '/'; a leading '/' represents - the root node. - -############################################################################### -# Tfdt Sheader DDump the header of the compiled device tree - - fdt header - - Dumps DTB size, format and other key values. - -############################################################################### -# Tfdt Sls DList subnodes of the current node - - fdt ls <path> - - Lists the nodes under the specified path. - If no path is specified, lists nodes under the current path. - -############################################################################### -# Tfdt Smknode DCreate a new node in the device tree - - fdt mknode <name> - - Creates a new node with the specified name. - -############################################################################### -# Tfdt Smkprop DAdd a new property to the current node - - fdt mkprop <name> <value> ... - - Creates a new property with the specified name and values. - Multiple values can be specified and will be concatenated. - -############################################################################### -# Tfdt Smres DXXX - - fdt mres - - Dumps the list of reserved memory regions. - -############################################################################### -# Tfdt Sprop DDump value of a particular property - - fdt prop <name> <value> ... - - If value is specified, set the given property to the indicated value. - Otherwise, print the value of the property. - -############################################################################### -# Tfdt Spwd DPrint path to current node in device tree - - fdt pwd - - Print path to the current node in the device tree. - The current node can be changed with "fdt cd". - -############################################################################### -# Tfdt Srm DRemove node or property from device tree - - fdt rm <name> - - The named node or property will be removed from the device tree. - -############################################################################### diff --git a/usr/src/boot/sys/boot/forth/Makefile b/usr/src/boot/sys/boot/forth/Makefile deleted file mode 100644 index 1f42003f9d..0000000000 --- a/usr/src/boot/sys/boot/forth/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $FreeBSD$ - -MAN+= beastie.4th.8 \ - brand.4th.8 \ - check-password.4th.8 \ - color.4th.8 \ - delay.4th.8 \ - loader.conf.5 \ - loader.4th.8 \ - menu.4th.8 \ - menusets.4th.8 \ - version.4th.8 - -.include <bsd.prog.mk> diff --git a/usr/src/boot/sys/boot/i386/boot0/Makefile b/usr/src/boot/sys/boot/i386/boot0/Makefile deleted file mode 100644 index 733fc68d32..0000000000 --- a/usr/src/boot/sys/boot/i386/boot0/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -# $FreeBSD$ - -PROG?= boot0 -STRIP= -BINMODE=${NOBINMODE} -MAN= -SRCS= ${PROG}.S - -# Additional options that you can specify with make OPTS="..." -# (these only apply to boot0.S) -# -# -DVOLUME_SERIAL support volume serial number (NT, XP, Vista) -# -DSIO do I/O using COM1: -# -DPXE fallback to INT18/PXE with F6 -# -DCHECK_DRIVE enable checking drive number -# -DONLY_F_KEYS accept only Fx keys in console -# -DTEST print drive number on entry -# -OPTS ?= -DVOLUME_SERIAL -DPXE -CFLAGS += ${OPTS} - -# Flags used in the boot0.S code: -# 0x0f all valid partitions enabled. -# 0x80 'packet', use BIOS EDD (LBA) extensions instead of CHS -# to read from disk. boot0.S does not check that the extensions -# are supported, but all modern BIOSes should have them. -# 0x40 'noupdate', disable writing boot0 back to disk so that -# the current selection is not preserved across reboots. -# 0x20 'setdrv', override the drive number supplied by the bios -# with the one in the boot sector. - -# Default boot flags: -BOOT_BOOT0_FLAGS?= 0x8f - -# The number of timer ticks to wait for a keypress before assuming the default -# selection. Since there are 18.2 ticks per second, the default value of -# 0xb6 (182d) corresponds to 10 seconds. -BOOT_BOOT0_TICKS?= 0xb6 - -# The base address that we the boot0 code to to run it. Don't change this -# unless you are glutton for punishment. -BOOT_BOOT0_ORG?= 0x600 - -# Comm settings for boot0sio. -# Bit(s) Description -# 7-5 data rate (110,150,300,600,1200,2400,4800,9600 bps) -# 4-3 parity (00 or 10 = none, 01 = odd, 11 = even) -# 2 stop bits (set = 2, clear = 1) -# 1-0 data bits (00 = 5, 01 = 6, 10 = 7, 11 = 8) -.if !defined(BOOT_BOOT0_COMCONSOLE_SPEED) -BOOT_COMCONSOLE_SPEED?= 9600 -.if ${BOOT_COMCONSOLE_SPEED} == 9600 -BOOT_BOOT0_COMCONSOLE_SPEED= "7 << 5 + 3" -.elif ${BOOT_COMCONSOLE_SPEED} == 4800 -BOOT_BOOT0_COMCONSOLE_SPEED= "6 << 5 + 3" -.elif ${BOOT_COMCONSOLE_SPEED} == 2400 -BOOT_BOOT0_COMCONSOLE_SPEED= "5 << 5 + 3" -.elif ${BOOT_COMCONSOLE_SPEED} == 1200 -BOOT_BOOT0_COMCONSOLE_SPEED= "4 << 5 + 3" -.elif ${BOOT_COMCONSOLE_SPEED} == 600 -BOOT_BOOT0_COMCONSOLE_SPEED= "3 << 5 + 3" -.elif ${BOOT_COMCONSOLE_SPEED} == 300 -BOOT_BOOT0_COMCONSOLE_SPEED= "2 << 5 + 3" -.elif ${BOOT_COMCONSOLE_SPEED} == 150 -BOOT_BOOT0_COMCONSOLE_SPEED= "1 << 5 + 3" -.elif ${BOOT_COMCONSOLE_SPEED} == 110 -BOOT_BOOT0_COMCONSOLE_SPEED= "0 << 5 + 3" -.else -BOOT_BOOT0_COMCONSOLE_SPEED= "7 << 5 + 3" -.endif -.endif - -CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ - -DTICKS=${BOOT_BOOT0_TICKS} \ - -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} - -LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary - -.include <bsd.prog.mk> - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.boot0.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} diff --git a/usr/src/boot/sys/boot/i386/boot0/boot0.S b/usr/src/boot/sys/boot/i386/boot0/boot0.S deleted file mode 100644 index 708f0934c4..0000000000 --- a/usr/src/boot/sys/boot/i386/boot0/boot0.S +++ /dev/null @@ -1,682 +0,0 @@ -/* - * Copyright (c) 2008 Luigi Rizzo (mostly documentation) - * Copyright (c) 2002 Bruce M. Simpson - * Copyright (c) 1998 Robert Nordier - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - * - * $FreeBSD$ - */ - -/* build options: */ -#ifdef SIO /* use serial console on COM1. */ -#endif - -#ifdef PXE /* enable PXE/INT18 booting with F6 */ -#define SAVE_MORE_MEMORY -#endif - -#ifdef CHECK_DRIVE /* make sure we boot from a HD. */ -#endif - -#ifdef ONLY_F_KEYS /* Only F1..F6, no digits on console */ -#endif - -#ifdef VOLUME_SERIAL /* support Volume serial number */ -#define B0_BASE 0x1ae /* move the internal data area */ -#define SAVE_MEMORY -#else -#define B0_BASE 0x1b2 -#endif - -#ifdef TEST /* enable some test code */ -#define SAVE_MEMORY -#define SAVE_MORE_MEMORY -#endif - -/* - * Note - this code uses many tricks to save space and fit in one sector. - * This includes using side effects of certain instructions, reusing - * register values from previous operations, etc. - * Be extremely careful when changing the code, even for simple things. - */ - -/* - * BOOT BLOCK STRUCTURE - * - * This code implements a Master Boot Record (MBR) for an Intel/PC disk. - * It is 512 bytes long and it is normally loaded by the BIOS (or another - * bootloader) at 0:0x7c00. This code depends on %cs:%ip being 0:0x7c00 - * - * The initial chunk of instructions is used as a signature by external - * tools (e.g. boot0cfg) which can manipulate the block itself. - * - * The area at offset 0x1b2 contains a magic string ('Drive '), also - * used as a signature to detect the block, and some variables that can - * be updated by boot0cfg (and optionally written back to the disk). - * These variables control the operation of the bootloader itself, - * e.g. which partitions to enable, the timeout, the use of LBA - * (called 'packet') or CHS mode, whether to force a drive number, - * and whether to write back the user's selection back to disk. - * - * As in every Master Boot Record, the partition table is at 0x1be, - * made of four 16-byte entries each containing: - * - * OFF SIZE DESCRIPTION - * 0 1 status (0x80: bootable, 0: non bootable) - * 1 3 start sector CHS - * 8:head, 6:sector, 2:cyl bit 9..8, 8:cyl bit 7..0 - * 4 1 partition type - * 5 3 end sector CHS - * 8 4 LBA of first sector - * 12 4 partition size in sectors - * - * and followed by the two bytes 0x55, 0xAA (MBR signature). - */ - - -/* - * BOOT BLOCK OPERATION - * - * On entry, the registers contain the following values: - * - * %cs:%ip 0:0x7c00 - * %dl drive number (0x80, 0x81, ... ) - * %si pointer to the partition table from which we were loaded. - * Some boot code (e.g. syslinux) use this info to relocate - * themselves, so we want to pass a valid one to the next stage. - * NOTE: the use of %si is not a standard. - * - * This boot block first relocates itself at a different address (0:0x600), - * to free the space at 0:0x7c00 for the next stage boot block. - * - * It then initializes some memory at 0:0x800 and above (pointed by %bp) - * to store the original drive number (%dl) passed to us, and to construct a - * fake partition entry. The latter is used by the disk I/O routine and, - * in some cases, passed in %si to the next stage boot code. - * - * The variables at 0x1b2 are accessed as negative offsets from %bp. - * - * After the relocation, the code scans the partition table printing - * out enabled partition or disks, and waits for user input. - * - * When a partition is selected, or a timeout expires, the currently - * selected partition is used to load the next stage boot code, - * %dl and %si are set appropriately as when we were called, and - * control is transferred to the newly loaded code at 0:0x7c00. - */ - -/* - * CONSTANTS - * - * NHRDRV is the address in segment 0 where the BIOS writes the - * total number of hard disks in the system. - * LOAD is the original load address and cannot be changed. - * ORIGIN is the relocation address. If you change it, you also need - * to change the value passed to the linker in the Makefile - * PRT_OFF is the location of the partition table (from the MBR standard). - * B0_OFF is the location of the data area, known to boot0cfg so - * it cannot be changed. Computed as a negative offset from 0x200 - * MAGIC is the signature of a boot block. - */ - - .set NHRDRV,0x475 # Number of hard drives - .set ORIGIN,0x600 # Execution address - .set LOAD,0x7c00 # Load address - - .set PRT_OFF,0x1be # Partition table - .set B0_OFF,(B0_BASE-0x200) # Offset of boot0 data - - .set MAGIC,0xaa55 # Magic: bootable - - .set KEY_ENTER,0x1c # Enter key scan code - .set KEY_F1,0x3b # F1 key scan code - .set KEY_1,0x02 # #1 key scan code - - .set ASCII_BEL,'#' # ASCII code for <BEL> - .set ASCII_CR,0x0D # ASCII code for <CR> - -/* - * Offsets of variables in the block at B0_OFF, and in the volatile - * data area, computed as displacement from %bp. - * We need to define them as constant as the assembler cannot - * compute them in its single pass. - */ - .set _NXTDRV, B0_OFF+6 # Next drive - .set _OPT, B0_OFF+7 # Default option - .set _SETDRV, B0_OFF+8 # Drive to force - .set _FLAGS, B0_OFF+9 # Flags - .set SETDRV, 0x20 # the 'setdrv' flag - .set NOUPDATE, 0x40 # the 'noupdate' flag - .set USEPACKET, 0x80 # the 'packet' flag - - /* ticks is at a fixed position */ - .set _TICKS, (PRT_OFF - 0x200 - 2) # Timeout ticks - .set _MNUOPT, 0x10 # Saved menu entries - - .set TLEN, (desc_ofs - bootable_ids) # size of bootable ids - .globl start # Entry point - .code16 # This runs in real mode - -/* - * MAIN ENTRY POINT - * Initialise segments and registers to known values. - * segments start at 0. - * The stack is immediately below the address we were loaded to. - * NOTE: the initial section of the code (up to movw $LOAD,%sp) - * is used by boot0cfg, together with the 'Drive ' string and - * the 0x55, 0xaa at the end, as an identifier for version 1.0 - * of the boot code. Do not change it. - * In version 1.0 the parameter table (_NEXTDRV etc) is at 0x1b9 - */ -start: cld # String ops inc - xorw %ax,%ax # Zero - movw %ax,%es # Address - movw %ax,%ds # data - movw %ax,%ss # Set up - movw $LOAD,%sp # stack - - /* - * Copy this code to the address it was linked for, 0x600 by default. - */ - movw %sp,%si # Source - movw $start,%di # Destination - movw $0x100,%cx # Word count - rep # Relocate - movsw # code - /* - * After the code, (i.e. at %di+0, 0x800) create a partition entry, - * initialized to LBA 0 / CHS 0:0:1. - * Set %bp to point to the partition and also, with negative offsets, - * to the variables embedded in the bootblock (nextdrv and so on). - */ - movw %di,%bp # Address variables - movb $0x8,%cl # Words to clear - rep # Zero - stosw # them - incb -0xe(%di) # Set the S field to 1 - - jmp main-LOAD+ORIGIN # Jump to relocated code - -main: -#if defined(SIO) && COMSPEED != 0 - /* - * Init the serial port. bioscom preserves the driver number in DX. - */ - movw $COMSPEED,%ax # defined by Makefile - callw bioscom -#endif - - /* - * If the 'setdrv' flag is set in the boot sector, use the drive - * number from the boot sector at 'setdrv_num'. - * Optionally, do the same if the BIOS gives us an invalid number - * (note though that the override prevents booting from a floppy - * or a ZIP/flash drive in floppy emulation). - * The test costs 4 bytes of code so it is disabled by default. - */ - testb $SETDRV,_FLAGS(%bp) # Set drive number? -#ifndef CHECK_DRIVE /* disable drive checks */ - jz save_curdrive # no, use the default -#else - jnz disable_update # Yes - testb %dl,%dl # Drive number valid? - js save_curdrive # Possibly (0x80 set) -#endif - /* - * Disable updates if the drive number is forced. - */ -disable_update: orb $NOUPDATE,_FLAGS(%bp) # Disable updates - movb _SETDRV(%bp),%dl # Use stored drive number - - /* - * Whatever drive we decided to use, store it at (%bp). The byte - * is normally used for the state of the partition (0x80 or 0x00), - * but we abuse it as it is very convenient to access at offset 0. - * The value is read back after 'check_selection' - */ -save_curdrive: movb %dl, (%bp) # Save drive number - pushw %dx # Also in the stack -#ifdef TEST /* test code, print internal bios drive */ - rolb $1, %dl - movw $drive, %si - call putkey -#endif - callw putn # Print a newline - /* - * Start out with a pointer to the 4th byte of the first table entry - * so that after 4 iterations it's beyond the end of the sector - * and beyond a 256 byte boundary. We use the latter trick to check for - * end of the loop without using an extra register (see start.5). - */ - movw $(partbl+0x4),%bx # Partition table (+4) - xorw %dx,%dx # Item number - - /* - * Loop around on the partition table, printing values until we - * pass a 256 byte boundary. - */ -read_entry: movb %ch,-0x4(%bx) # Zero active flag (ch == 0) - btw %dx,_FLAGS(%bp) # Entry enabled? - jnc next_entry # No - movb (%bx),%al # Load type - test %al, %al # skip empty partition - jz next_entry - /* - * Scan the table of bootable ids, which starts at %di and has - * length TLEN. On a match, %di points to the element following the - * match; the corresponding offset to the description is $(TLEN-1) - * bytes ahead. We use a count of TLEN+1 so if we don't find a match - * within the first TLEN entries, we hit the 'unknown' entry. - */ - movw $bootable_ids,%di # Lookup tables - movb $(TLEN+1),%cl # Number of entries - repne # Locate - scasb # type - /* - * Get the matching element in the next array. - * The byte at $(TLEN-1)(%di) contains the offset of the description - * string from %di, so we add the number and print the string. - */ - addw $(TLEN-1), %di # Adjust - movb (%di),%cl # Partition - addw %cx,%di # description - callw putx # Display it - -next_entry: incw %dx # Next item - addb $0x10,%bl # Next entry - jnc read_entry # Till done - /* - * We are past a 256 byte boundary: the partition table is finished. - * Add one to the drive number and check it is valid. - * Note that if we started from a floppy, %dl was 0 so we still - * get an entry for the next drive, which is the first Hard Disk. - */ - popw %ax # Drive number - subb $0x80-0x1,%al # Does next - cmpb NHRDRV,%al # drive exist? (from BIOS?) - jb print_drive # Yes - /* - * If this is the only drive, don't display it as an option. - */ - decw %ax # Already drive 0? - jz print_prompt # Yes - /* - * If it was illegal or we cycled through them, go back to drive 0. - */ - xorb %al,%al # Drive 0 - /* - * Whatever drive we selected, make it an ascii digit and save it - * back to the "nxtdrv" location in case we want to save it to disk. - * This digit is also part of the printed drive string, so add 0x80 - * to indicate end of string. - */ -print_drive: addb $'0'|0x80,%al # Save next - movb %al,_NXTDRV(%bp) # drive number - movw $drive,%di # Display - callw putx # item - /* - * Menu is complete, display a prompt followed by current selection. - * 'decw %si' makes the register point to the space after 'Boot: ' - * so we do not see an extra CRLF on the screen. - */ -print_prompt: movw $prompt,%si # Display - callw putstr # prompt - movb _OPT(%bp),%dl # Display - decw %si # default - callw putkey # key - jmp start_input # Skip beep - -/* - * Here we have the code waiting for user input or a timeout. - */ -beep: movb $ASCII_BEL,%al # Input error, print or beep - callw putchr - -start_input: - /* - * Actual Start of input loop. Take note of time - */ - xorb %ah,%ah # BIOS: Get - int $0x1a # system time - movw %dx,%di # Ticks when - addw _TICKS(%bp),%di # timeout -read_key: - /* - * Busy loop, looking for keystrokes but keeping one eye on the time. - */ -#ifndef SIO - movb $0x1,%ah # BIOS: Check - int $0x16 # for keypress -#else /* SIO */ - movb $0x03,%ah # BIOS: Read COM - call bioscom - testb $0x01,%ah # Check line status - # (bit 1 indicates input) -#endif /* SIO */ - jnz got_key # Have input - xorb %ah,%ah # BIOS: int 0x1a, 00 - int $0x1a # get system time - cmpw %di,%dx # Timeout? - jb read_key # No - - /* - * Timed out or default selection - */ -use_default: movb _OPT(%bp),%al # Load default - orb $NOUPDATE,_FLAGS(%bp) # Disable updates - jmp check_selection # Join common code - - /* - * Get the keystroke. - * ENTER or CR confirm the current selection (same as a timeout). - * Otherwise convert F1..F6 (or '1'..'6') to 0..5 and check if the - * selection is valid. - * The SIO code uses ascii chars, the console code uses scancodes. - */ -got_key: -#ifndef SIO - xorb %ah,%ah # BIOS: int 0x16, 00 - int $0x16 # get keypress - movb %ah,%al # move scan code to %al - cmpb $KEY_ENTER,%al -#else - movb $0x02,%ah # BIOS: Receive - call bioscom - cmpb $ASCII_CR,%al -#endif - je use_default # enter -> default - /* - * Check if the key is acceptable, and loop back if not. - * The console (non-SIO) code looks at scancodes and accepts - * both F1..F6 and 1..6 (the latter costs 6 bytes of code), - * relying on the fact that F1..F6 have higher scancodes than 1..6 - * The SIO code only takes 1..6 - */ -#ifdef SIO /* SIO mode, use ascii values */ - subb $'1',%al # Subtract '1' ascii code -#else /* console mode -- use scancodes */ - subb $KEY_F1,%al /* Subtract F1 scan code */ -#if !defined(ONLY_F_KEYS) - cmpb $0x5,%al # F1..F6 - jna 3f # Yes - subb $(KEY_1 - KEY_F1),%al # Less #1 scan code - 3: -#endif /* ONLY_F_KEYS */ -#endif /* SIO */ -check_selection: - cmpb $0x5,%al # F1..F6 or 1..6 ? -#ifdef PXE /* enable PXE/INT18 using F6 */ - jne 1f; - int $0x18 # found F6, try INT18 - 1: -#endif /* PXE */ - jae beep # Not in F1..F5, beep - - /* - * We have a selection. If it's a bad selection go back to complain. - * The bits in MNUOPT were set when the options were printed. - * Anything not printed is not an option. - */ - cbtw # Extend (%ah=0 used later) - btw %ax,_MNUOPT(%bp) # Option enabled? - jnc beep # No - /* - * Save the info in the original tables - * for rewriting to the disk. - */ - movb %al,_OPT(%bp) # Save option - - /* - * Make %si and %bx point to the fake partition at LBA 0 (CHS 0:0:1). - * Because the correct address is already in %bp, just use it. - * Set %dl with the drive number saved in byte 0. - * If we have pressed F5 or 5, then this is a good, fake value - * to present to the next stage boot code. - */ - movw %bp,%si # Partition for write - movb (%si),%dl # Drive number, saved above - movw %si,%bx # Partition for read - cmpb $0x4,%al # F5/#5 pressed? - pushf # Save results for later - je 1f # Yes, F5 - - /* - * F1..F4 was pressed, so make %bx point to the currently - * selected partition, and leave the drive number unchanged. - */ - shlb $0x4,%al # Point to - addw $partbl,%ax # selected - xchgw %bx,%ax # partition - movb $0x80,(%bx) # Flag active - /* - * If not asked to do a write-back (flags 0x40) don't do one. - * Around the call, save the partition pointer to %bx and - * restore to %si which is where the next stage expects it. - */ - 1: pushw %bx # Save - testb $NOUPDATE,_FLAGS(%bp) # No updates? - jnz 2f # skip update - movw $start,%bx # Data to write - movb $0x3,%ah # Write sector - callw intx13 # to disk - 2: popw %si # Restore - - /* - * If going to next drive, replace drive with selected one. - * Remember to un-ascii it. Hey 0x80 is already set, cool! - */ - popf # Restore %al test results - jne 3f # If not F5/#5 - movb _NXTDRV(%bp),%dl # Next drive - subb $'0',%dl # number - /* - * Load selected bootsector to the LOAD location in RAM. If read - * fails or there is no 0x55aa marker, treat it as a bad selection. - */ - 3: movw $LOAD,%bx # Address for read - movb $0x2,%ah # Read sector - callw intx13 # from disk - jc beep # If error - cmpw $MAGIC,0x1fe(%bx) # Bootable? - jne beep # No - pushw %si # Save ptr to selected part. - callw putn # Leave some space - popw %si # Restore, next stage uses it - jmp *%bx # Invoke bootstrap - -/* - * Display routines - * putkey prints the option selected in %dl (F1..F5 or 1..5) followed by - * the string at %si - * putx: print the option in %dl followed by the string at %di - * also record the drive as valid. - * putn: print a crlf - * putstr: print the string at %si - * putchr: print the char in al - */ - -/* - * Display the option and record the drive as valid in the options. - * That last point is done using the btsw instruction which does - * a test and set. We don't care for the test part. - */ -putx: btsw %dx,_MNUOPT(%bp) # Enable menu option - movw $item,%si # Display - callw putkey # key - movw %di,%si # Display the rest - callw putstr # Display string - -putn: movw $crlf,%si # To next line - jmp putstr - -putkey: -#ifndef SIO - movb $'F',%al # Display - callw putchr # 'F' -#endif - movb $'1',%al # Prepare - addb %dl,%al # digit - -putstr.1: callw putchr # Display char -putstr: lodsb # Get byte - testb $0x80,%al # End of string? - jz putstr.1 # No - andb $~0x80,%al # Clear MSB then print last - -putchr: -#ifndef SIO - pushw %bx # Save - movw $0x7,%bx # Page:attribute - movb $0xe,%ah # BIOS: Display - int $0x10 # character - popw %bx # Restore -#else /* SIO */ - movb $0x01,%ah # BIOS: Send character -bioscom: - pushw %dx # Save - xorw %dx,%dx # Use COM1 - int $0x14 # BIOS: Serial I/O - popw %dx # Restore -#endif /* SIO */ - retw # To caller - -/* One-sector disk I/O routine */ - -/* - * %dl: drive, %si partition entry, %es:%bx transfer buffer. - * Load the CHS values and possibly the LBA address from the block - * at %si, and use the appropriate method to load the sector. - * Don't use packet mode for a floppy. - */ -intx13: # Prepare CHS parameters - movb 0x1(%si),%dh # Load head - movw 0x2(%si),%cx # Load cylinder:sector - movb $0x1,%al # Sector count - pushw %si # Save - movw %sp,%di # Save -#ifndef CHECK_DRIVE /* floppy support */ - testb %dl, %dl # is this a floppy ? - jz 1f # Yes, use CHS mode -#endif - testb $USEPACKET,_FLAGS(%bp) # Use packet interface? - jz 1f # No - pushl $0x0 # Set the - pushl 0x8(%si) # LBA address - pushw %es # Set the transfer - pushw %bx # buffer address - push $0x1 # Block count - push $0x10 # Packet size - movw %sp,%si # Packet pointer - decw %ax # Verify off - orb $0x40,%ah # Use disk packet - 1: int $0x13 # BIOS: Disk I/O - movw %di,%sp # Restore - popw %si # Restore - retw # To caller - -/* - * Various menu strings. 'item' goes after 'prompt' to save space. - * Also use shorter versions to make room for the PXE/INT18 code. - */ -prompt: -#ifdef PXE - .ascii "\nF6 PXE\r" -#endif - .ascii "\nBoot:" -item: .ascii " "; .byte ' '|0x80 -crlf: .ascii "\r"; .byte '\n'|0x80 - -/* Partition type tables */ - -bootable_ids: - /* - * These values indicate bootable types we know about. - * Corresponding descriptions are at desc_ofs: - * Entries don't need to be sorted. - */ - .byte 0x83, 0xa5, 0xa6, 0xa9, 0x06, 0x07, 0x0b -#ifndef SAVE_MORE_MEMORY - .byte 0x05 # extended partition -#endif -#ifndef SAVE_MEMORY /* other DOS partitions */ - .byte 0x01 # FAT12 - .byte 0x04 # FAT16 < 32M -#endif - -desc_ofs: - /* - * Offsets that match the known types above, used to point to the - * actual partition name. The last entry must point to os_misc, - * which is used for non-matching names. - */ - .byte os_linux-. # 131, Linux - .byte os_freebsd-. # 165, FreeBSD - .byte os_bsd-. # 166, OpenBSD - .byte os_bsd-. # 169, NetBSD - .byte os_dos-. # 6, FAT16 >= 32M - .byte os_win-. # 7, NTFS - .byte os_win-. # 11, FAT32 - -#ifndef SAVE_MORE_MEMORY - .byte os_ext-. # 5, DOS Ext -#endif -#ifndef SAVE_MEMORY - .byte os_dos-. # 1, FAT12 DOS - .byte os_dos-. # 4, FAT16 <32M -#endif - .byte os_misc-. # Unknown - - /* - * And here are the strings themselves. The last byte of - * the string has bit 7 set. - */ -os_misc: .byte '?'|0x80 -os_dos: -#ifndef SAVE_MORE_MEMORY /* 'DOS' remapped to 'WIN' if no room */ - .ascii "DO"; .byte 'S'|0x80 -#endif -os_win: .ascii "Wi"; .byte 'n'|0x80 -os_linux: .ascii "Linu"; .byte 'x'|0x80 -os_freebsd: .ascii "Free" -os_bsd: .ascii "BS"; .byte 'D'|0x80 -#ifndef SAVE_MORE_MEMORY -os_ext: .ascii "EX"; .byte 'T'|0x80 -#endif - - .org (0x200 + B0_OFF),0x90 -/* - * The boot0 version 1.0 parameter table. - * Do not move it nor change the "Drive " string, boot0cfg - * uses its offset and content to identify the boot sector. - * The other fields are sometimes changed before writing back to the drive - * Be especially careful that nxtdrv: must come after drive:, as it - * is part of the same string. - */ -drive: .ascii "Drive " -nxtdrv: .byte 0x0 # Next drive number -opt: .byte 0x0 # Option -setdrv_num: .byte 0x80 # Drive to force -flags: .byte FLAGS # Flags -#ifdef VOLUME_SERIAL - .byte 0xa8,0xa8,0xa8,0xa8 # Volume Serial Number -#endif -ticks: .word TICKS # Delay - - .org PRT_OFF -/* - * Here is the 64 byte partition table that fdisk would fiddle with. - */ -partbl: .fill 0x40,0x1,0x0 # Partition table - .word MAGIC # Magic number - .org 0x200 # again, safety check -endblock: diff --git a/usr/src/boot/sys/boot/i386/boot0sio/Makefile b/usr/src/boot/sys/boot/i386/boot0sio/Makefile deleted file mode 100644 index 1321dd330c..0000000000 --- a/usr/src/boot/sys/boot/i386/boot0sio/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../boot0 - -PROGNAME= boot0sio -CFLAGS+= -DSIO - -.include "${.CURDIR}/../boot0/Makefile" diff --git a/usr/src/boot/sys/boot/i386/boot2/Makefile b/usr/src/boot/sys/boot/i386/boot2/Makefile deleted file mode 100644 index 195206f1c6..0000000000 --- a/usr/src/boot/sys/boot/i386/boot2/Makefile +++ /dev/null @@ -1,118 +0,0 @@ -# $FreeBSD$ - -.include <bsd.own.mk> - -FILES= boot boot1 boot2 - -NM?= nm - -# A value of 0x80 enables LBA support. -BOOT_BOOT1_FLAGS?= 0x80 - -BOOT_COMCONSOLE_PORT?= 0x3f8 -BOOT_COMCONSOLE_SPEED?= 9600 -B2SIOFMT?= 0x3 - -REL1= 0x700 -ORG1= 0x7c00 -ORG2= 0x2000 - -# Decide level of UFS support. -BOOT2_UFS?= UFS1_AND_UFS2 -#BOOT2_UFS?= UFS2_ONLY -#BOOT2_UFS?= UFS1_ONLY - -CFLAGS= -fomit-frame-pointer \ - -mrtd \ - -mregparm=3 \ - -DUSE_XREAD \ - -D${BOOT2_UFS} \ - -DFLAGS=${BOOT_BOOT1_FLAGS} \ - -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ - -DSIOFMT=${B2SIOFMT} \ - -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../btx/lib -I. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ - -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline - -CFLAGS.gcc+= -Os \ - -fno-guess-branch-probability \ - -fno-unit-at-a-time \ - --param max-inline-insns-single=100 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 -CFLAGS.gcc+= -mno-align-long-strings -.endif - -CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} - -LD_FLAGS=-static -N --gc-sections - -# Pick up ../Makefile.inc early. -.include <bsd.init.mk> - -CLEANFILES= boot - -boot: boot1 boot2 - cat boot1 boot2 > boot - -CLEANFILES+= boot1 boot1.out boot1.o - -boot1: boot1.out - ${OBJCOPY} -S -O binary boot1.out ${.TARGET} - -boot1.out: boot1.o - ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o - -CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ - boot2.s boot2.s.tmp boot2.h sio.o - -boot2: boot2.ld - @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ - echo "$$x bytes available"; test $$x -ge 0 - dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync status=none - -boot2.ld: boot2.ldr boot2.bin ${BTXKERN} - btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ - -o ${.TARGET} -P 1 boot2.bin - -boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 status=none - -boot2.bin: boot2.out - ${OBJCOPY} -S -O binary boot2.out ${.TARGET} - -boot2.out: ${BTXCRT} boot2.o sio.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} - -boot2.o: boot2.s - ${CC} ${ACFLAGS} -c boot2.s - -SRCS= boot2.c boot2.h - -boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c - ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c - sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s - rm -f boot2.s.tmp - -boot2.h: boot1.out - ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ - { x = $$1 - ORG1; \ - printf("#define XREADORG %#x\n", REL1 + x) }' \ - ORG1=`printf "%d" ${ORG1}` \ - REL1=`printf "%d" ${REL1}` > ${.TARGET} - -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend boot2.s: machine -CLEANFILES+= machine -machine: ${.CURDIR}/../../../i386/include .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} -.endif - -.include <bsd.prog.mk> - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.boot1.S= ${CLANG_NO_IAS} -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} diff --git a/usr/src/boot/sys/boot/i386/libfirewire/Makefile b/usr/src/boot/sys/boot/i386/libfirewire/Makefile deleted file mode 100644 index 191b95479e..0000000000 --- a/usr/src/boot/sys/boot/i386/libfirewire/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# $FreeBSD$ - -LIB= firewire -INTERNALLIB= - -.PATH: ${.CURDIR}/../../../dev/dcons ${.CURDIR}/../../../dev/firewire -SRCS+= firewire.c fwohci.c dconsole.c -SRCS+= dcons.c fwcrom.c - -CFLAGS+= -D_BOOT - -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand -CFLAGS+= -I${.CURDIR}/../btx/lib -CFLAGS+= -I${.CURDIR}/../libi386 - -CFLAGS+= -Wformat -Wall - -.if ${MACHINE_CPUARCH} == "amd64" -CLEANFILES+= machine -machine: - ln -sf ${.CURDIR}/../../../i386/include machine -.endif - -.include <bsd.lib.mk> - -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend ${OBJS}: machine -.endif - diff --git a/usr/src/boot/sys/boot/i386/libfirewire/dconsole.c b/usr/src/boot/sys/boot/i386/libfirewire/dconsole.c deleted file mode 100644 index a77e4ba098..0000000000 --- a/usr/src/boot/sys/boot/i386/libfirewire/dconsole.c +++ /dev/null @@ -1,128 +0,0 @@ -/*- - * Copyright (c) 2004 Hidetoshi Shimokawa - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include <bootstrap.h> -#include <sys/param.h> -#include <btxv86.h> -#include <dev/dcons/dcons.h> - -void fw_enable(void); -void fw_poll(void); - -static void dconsole_probe(struct console *cp); -static int dconsole_init(int arg); -static void dconsole_putchar(int c); -static int dconsole_getchar(void); -static int dconsole_ischar(void); - -static int dcons_started = 0; - -#define DCONS_BUF_SIZE (64*1024) -static struct dcons_softc sc[DCONS_NPORT]; -uint32_t dcons_paddr; - -/* The buffer must be allocated in BSS because: - * - The dcons driver in the kernel is initialized before VM/pmap is - * initialized, so that the buffer must be allocated in the region - * that is mapped at the very early boot state. - * - We expect identity map only for regions before KERNLOAD - * (i386:4MB amd64:1MB). - * - It seems that heap in conventional memory(640KB) is not sufficient - * and we move it to high address as LOADER_SUPPORT_BZIP2. - * - BSS is placed in conventional memory. - */ -static char dcons_buffer[DCONS_BUF_SIZE + PAGE_SIZE]; - -struct console dconsole = { - .c_name = "dcons", - .c_desc = "dumb console port", - .c_flags = 0, - .c_probe = dconsole_probe, - .c_init = dconsole_init, - .c_out = dconsole_putchar, - .c_in = dconsole_getchar, - .c_ready = dconsole_ischar, - .c_private = NULL -}; - -#define DCONSOLE_AS_MULTI_CONSOLE 1 - -static void -dconsole_probe(struct console *cp) -{ - /* XXX check the BIOS equipment list? */ - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); -#if DCONSOLE_AS_MULTI_CONSOLE - dconsole_init(0); - cp->c_flags |= (C_ACTIVEIN | C_ACTIVEOUT); -#endif -} - -static int -dconsole_init(int arg) -{ - char buf[16], *dbuf; - int size; - - if (dcons_started && arg == 0) - return 0; - dcons_started = 1; - - size = DCONS_BUF_SIZE; - dbuf = (char *)round_page((vm_offset_t)&dcons_buffer[0]); - dcons_paddr = VTOP(dbuf); - sprintf(buf, "0x%08x", dcons_paddr); - setenv("dcons.addr", buf, 1); - - dcons_init((struct dcons_buf *)dbuf, size, sc); - sprintf(buf, "%d", size); - setenv("dcons.size", buf, 1); - fw_enable(); - return(0); -} - -static void -dconsole_putchar(int c) -{ - dcons_putc(&sc[0], c); -} - -static int -dconsole_getchar(void) -{ - fw_poll(); - return (dcons_checkc(&sc[0])); -} - -static int -dconsole_ischar(void) -{ - fw_poll(); - return (dcons_ischar(&sc[0])); -} diff --git a/usr/src/boot/sys/boot/i386/libfirewire/firewire.c b/usr/src/boot/sys/boot/i386/libfirewire/firewire.c deleted file mode 100644 index 4c62145ef2..0000000000 --- a/usr/src/boot/sys/boot/i386/libfirewire/firewire.c +++ /dev/null @@ -1,481 +0,0 @@ -/*- - * Copyright (c) 2004 Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * FireWire disk device handling. - * - */ - -#include <stand.h> - -#include <machine/bootinfo.h> - -#include <stdarg.h> - -#include <bootstrap.h> -#include <btxv86.h> -#include <libi386.h> -#include "fwohci.h" -#include <dev/dcons/dcons.h> - -/* XXX */ -#define BIT4x2(x,y) uint8_t y:4, x:4 -#define BIT16x2(x,y) uint32_t y:16, x:16 -#define _KERNEL -#include <dev/firewire/iec13213.h> - -extern uint32_t dcons_paddr; -extern struct console dconsole; - -struct crom_src_buf { - struct crom_src src; - struct crom_chunk root; - struct crom_chunk vendor; - struct crom_chunk hw; - /* for dcons */ - struct crom_chunk unit; - struct crom_chunk spec; - struct crom_chunk ver; -}; - -static int fw_init(void); -static int fw_strategy(void *devdata, int flag, daddr_t dblk, - size_t size, char *buf, size_t *rsize); -static int fw_open(struct open_file *f, ...); -static int fw_close(struct open_file *f); -static int fw_print(int verbose); -static void fw_cleanup(void); - -void fw_enable(void); - -struct devsw fwohci = { - "FW1394", /* 7 chars at most */ - DEVT_NET, - fw_init, - fw_strategy, - fw_open, - fw_close, - noioctl, - fw_print, - fw_cleanup -}; - -static struct fwohci_softc fwinfo[MAX_OHCI]; -static int fw_initialized = 0; - -static void -fw_probe(int index, struct fwohci_softc *sc) -{ - int err; - - sc->state = FWOHCI_STATE_INIT; - err = biospci_find_devclass( - 0x0c0010 /* Serial:FireWire:OHCI */, - index /* index */, - &sc->locator); - - if (err != 0) { - sc->state = FWOHCI_STATE_DEAD; - return; - } - - biospci_write_config(sc->locator, - 0x4 /* command */, - 0x6 /* enable bus master and memory mapped I/O */, - 1 /* word */); - - biospci_read_config(sc->locator, 0x00 /*devid*/, 2 /*dword*/, - &sc->devid); - biospci_read_config(sc->locator, 0x10 /*base_addr*/, 2 /*dword*/, - &sc->base_addr); - - sc->handle = (uint32_t)PTOV(sc->base_addr); - sc->bus_id = OREAD(sc, OHCI_BUS_ID); - - return; -} - -static int -fw_init(void) -{ - int i, avail; - struct fwohci_softc *sc; - - if (fw_initialized) - return (0); - - avail = 0; - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - fw_probe(i, sc); - if (sc->state == FWOHCI_STATE_DEAD) - break; - avail ++; - break; - } - fw_initialized = 1; - - return (0); -} - - -/* - * Print information about OHCI chips - */ -static int -fw_print(int verbose) -{ - int i, ret; - struct fwohci_softc *sc; - - printf("%s devices:", fwohci.dv_name); - if ((ret = pager_output("\n")) != 0) - return (ret); - - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - if (sc->state == FWOHCI_STATE_DEAD) - break; - printf("%d: locator=0x%04x devid=0x%08x" - " base_addr=0x%08x handle=0x%08x bus_id=0x%08x", - i, sc->locator, sc->devid, - sc->base_addr, sc->handle, sc->bus_id); - if ((ret = pager_output("\n")) != 0) - break; - } - return (ret); -} - -static int -fw_open(struct open_file *f, ...) -{ -#if 0 - va_list ap; - struct i386_devdesc *dev; - struct open_disk *od; - int error; - - va_start(ap, f); - dev = va_arg(ap, struct i386_devdesc *); - va_end(ap); -#endif - - return (ENXIO); -} - -static int -fw_close(struct open_file *f) -{ - return (0); -} - -static void -fw_cleanup() -{ - struct dcons_buf *db; - - /* invalidate dcons buffer */ - if (dcons_paddr) { - db = (struct dcons_buf *)PTOV(dcons_paddr); - db->magic = 0; - } -} - -static int -fw_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) -{ - return (EIO); -} - -static void -fw_init_crom(struct fwohci_softc *sc) -{ - struct crom_src *src; - - printf("fw_init_crom\n"); - sc->crom_src_buf = (struct crom_src_buf *) - malloc(sizeof(struct crom_src_buf)); - if (sc->crom_src_buf == NULL) - return; - - src = &sc->crom_src_buf->src; - bzero(src, sizeof(struct crom_src)); - - /* BUS info sample */ - src->hdr.info_len = 4; - - src->businfo.bus_name = CSR_BUS_NAME_IEEE1394; - - src->businfo.irmc = 1; - src->businfo.cmc = 1; - src->businfo.isc = 1; - src->businfo.bmc = 1; - src->businfo.pmc = 0; - src->businfo.cyc_clk_acc = 100; - src->businfo.max_rec = sc->maxrec; - src->businfo.max_rom = MAXROM_4; -#define FW_GENERATION_CHANGEABLE 2 - src->businfo.generation = FW_GENERATION_CHANGEABLE; - src->businfo.link_spd = sc->speed; - - src->businfo.eui64.hi = sc->eui.hi; - src->businfo.eui64.lo = sc->eui.lo; - - STAILQ_INIT(&src->chunk_list); - - sc->crom_src = src; - sc->crom_root = &sc->crom_src_buf->root; -} - -static void -fw_reset_crom(struct fwohci_softc *sc) -{ - struct crom_src_buf *buf; - struct crom_src *src; - struct crom_chunk *root; - - printf("fw_reset\n"); - if (sc->crom_src_buf == NULL) - fw_init_crom(sc); - - buf = sc->crom_src_buf; - src = sc->crom_src; - root = sc->crom_root; - - STAILQ_INIT(&src->chunk_list); - - bzero(root, sizeof(struct crom_chunk)); - crom_add_chunk(src, NULL, root, 0); - crom_add_entry(root, CSRKEY_NCAP, 0x0083c0); /* XXX */ - /* private company_id */ - crom_add_entry(root, CSRKEY_VENDOR, CSRVAL_VENDOR_PRIVATE); -#ifdef __DragonFly__ - crom_add_simple_text(src, root, &buf->vendor, "DragonFly Project"); -#else - crom_add_simple_text(src, root, &buf->vendor, "FreeBSD Project"); -#endif -} - - -#define ADDR_HI(x) (((x) >> 24) & 0xffffff) -#define ADDR_LO(x) ((x) & 0xffffff) - -static void -dcons_crom(struct fwohci_softc *sc) -{ - struct crom_src_buf *buf; - struct crom_src *src; - struct crom_chunk *root; - - buf = sc->crom_src_buf; - src = sc->crom_src; - root = sc->crom_root; - - bzero(&buf->unit, sizeof(struct crom_chunk)); - - crom_add_chunk(src, root, &buf->unit, CROM_UDIR); - crom_add_entry(&buf->unit, CSRKEY_SPEC, CSRVAL_VENDOR_PRIVATE); - crom_add_simple_text(src, &buf->unit, &buf->spec, "FreeBSD"); - crom_add_entry(&buf->unit, CSRKEY_VER, DCONS_CSR_VAL_VER); - crom_add_simple_text(src, &buf->unit, &buf->ver, "dcons"); - crom_add_entry(&buf->unit, DCONS_CSR_KEY_HI, ADDR_HI(dcons_paddr)); - crom_add_entry(&buf->unit, DCONS_CSR_KEY_LO, ADDR_LO(dcons_paddr)); -} - -void -fw_crom(struct fwohci_softc *sc) -{ - struct crom_src *src; - void *newrom; - - fw_reset_crom(sc); - dcons_crom(sc); - - newrom = malloc(CROMSIZE); - src = &sc->crom_src_buf->src; - crom_load(src, (uint32_t *)newrom, CROMSIZE); - if (bcmp(newrom, sc->config_rom, CROMSIZE) != 0) { - /* Bump generation and reload. */ - src->businfo.generation++; - - /* Handle generation count wraps. */ - if (src->businfo.generation < 2) - src->businfo.generation = 2; - - /* Recalculate CRC to account for generation change. */ - crom_load(src, (uint32_t *)newrom, CROMSIZE); - bcopy(newrom, (void *)sc->config_rom, CROMSIZE); - } - free(newrom); -} - -static int -fw_busreset(struct fwohci_softc *sc) -{ - int count; - - if (sc->state < FWOHCI_STATE_ENABLED) { - printf("fwohci not enabled\n"); - return(CMD_OK); - } - fw_crom(sc); - fwohci_ibr(sc); - count = 0; - while (sc->state< FWOHCI_STATE_NORMAL) { - fwohci_poll(sc); - count ++; - if (count > 1000) { - printf("give up to wait bus initialize\n"); - return (-1); - } - } - printf("poll count = %d\n", count); - return (0); -} - -void -fw_enable(void) -{ - struct fwohci_softc *sc; - int i; - - if (fw_initialized == 0) - fw_init(); - - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - if (sc->state != FWOHCI_STATE_INIT) - break; - - sc->config_rom = (uint32_t *) - (((uint32_t)sc->config_rom_buf - + (CROMSIZE - 1)) & ~(CROMSIZE - 1)); -#if 0 - printf("configrom: %08p %08p\n", - sc->config_rom_buf, sc->config_rom); -#endif - if (fwohci_init(sc, 0) == 0) { - sc->state = FWOHCI_STATE_ENABLED; - fw_busreset(sc); - } else - sc->state = FWOHCI_STATE_DEAD; - } -} - -void -fw_poll(void) -{ - struct fwohci_softc *sc; - int i; - - if (fw_initialized == 0) - return; - - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - if (sc->state < FWOHCI_STATE_ENABLED) - break; - fwohci_poll(sc); - } -} - -#if 0 /* for debug */ -static int -fw_busreset_cmd(int argc, char *argv[]) -{ - struct fwohci_softc *sc; - int i; - - for (i = 0; i < MAX_OHCI; i ++) { - sc = &fwinfo[i]; - if (sc->state < FWOHCI_STATE_INIT) - break; - fw_busreset(sc); - } - return(CMD_OK); -} - -static int -fw_poll_cmd(int argc, char *argv[]) -{ - fw_poll(); - return(CMD_OK); -} - -static int -fw_enable_cmd(int argc, char *argv[]) -{ - fw_print(0); - fw_enable(); - return(CMD_OK); -} - - -static int -dcons_enable(int argc, char *argv[]) -{ - dconsole.c_init(0); - fw_enable(); - dconsole.c_flags |= C_ACTIVEIN | C_ACTIVEOUT; - return(CMD_OK); -} - -static int -dcons_read(int argc, char *argv[]) -{ - char c; - while (dconsole.c_ready()) { - c = dconsole.c_in(); - printf("%c", c); - } - printf("\r\n"); - return(CMD_OK); -} - -static int -dcons_write(int argc, char *argv[]) -{ - int len, i; - if (argc < 2) - return(CMD_OK); - - len = strlen(argv[1]); - for (i = 0; i < len; i ++) - dconsole.c_out(argv[1][i]); - dconsole.c_out('\r'); - dconsole.c_out('\n'); - return(CMD_OK); -} -COMMAND_SET(firewire, "firewire", "enable firewire", fw_enable_cmd); -COMMAND_SET(fwbusreset, "fwbusreset", "firewire busreset", fw_busreset_cmd); -COMMAND_SET(fwpoll, "fwpoll", "firewire poll", fw_poll_cmd); -COMMAND_SET(dcons, "dcons", "enable dcons", dcons_enable); -COMMAND_SET(dread, "dread", "read from dcons", dcons_read); -COMMAND_SET(dwrite, "dwrite", "write to dcons", dcons_write); -#endif diff --git a/usr/src/boot/sys/boot/i386/libfirewire/fwohci.c b/usr/src/boot/sys/boot/i386/libfirewire/fwohci.c deleted file mode 100644 index cd47708851..0000000000 --- a/usr/src/boot/sys/boot/i386/libfirewire/fwohci.c +++ /dev/null @@ -1,479 +0,0 @@ -/* - * Copyright (c) 2003 Hidetoshi Shimokawa - * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the acknowledgement as bellow: - * - * This product includes software developed by K. Kobayashi and H. Shimokawa - * - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * - */ - -#include <stand.h> -#include <btxv86.h> -#include <bootstrap.h> - -#include "fwohci.h" -#include "fwohcireg.h" -#include <dev/firewire/firewire_phy.h> - -static uint32_t fwphy_wrdata ( struct fwohci_softc *, uint32_t, uint32_t); -static uint32_t fwphy_rddata ( struct fwohci_softc *, uint32_t); -int firewire_debug=0; - -#if 0 -#define device_printf(a, x, ...) printf("FW1394: " x, ## __VA_ARGS__) -#else -#define device_printf(a, x, ...) -#endif - -#define device_t int -#define DELAY(x) delay(x) - -#define MAX_SPEED 3 -#define MAXREC(x) (2 << (x)) -char *linkspeed[] = { - "S100", "S200", "S400", "S800", - "S1600", "S3200", "undef", "undef" -}; - -#define FW_EUI64_BYTE(eui, x) \ - ((((x)<4)? \ - ((eui)->hi >> (8*(3-(x)))): \ - ((eui)->lo >> (8*(7-(x)))) \ - ) & 0xff) - -/* - * Communication with PHY device - */ -static uint32_t -fwphy_wrdata( struct fwohci_softc *sc, uint32_t addr, uint32_t data) -{ - uint32_t fun; - - addr &= 0xf; - data &= 0xff; - - fun = (PHYDEV_WRCMD | (addr << PHYDEV_REGADDR) | (data << PHYDEV_WRDATA)); - OWRITE(sc, OHCI_PHYACCESS, fun); - DELAY(100); - - return(fwphy_rddata( sc, addr)); -} - -static uint32_t -fwphy_rddata(struct fwohci_softc *sc, u_int addr) -{ - uint32_t fun, stat; - u_int i, retry = 0; - - addr &= 0xf; -#define MAX_RETRY 100 -again: - OWRITE(sc, FWOHCI_INTSTATCLR, OHCI_INT_REG_FAIL); - fun = PHYDEV_RDCMD | (addr << PHYDEV_REGADDR); - OWRITE(sc, OHCI_PHYACCESS, fun); - for ( i = 0 ; i < MAX_RETRY ; i ++ ){ - fun = OREAD(sc, OHCI_PHYACCESS); - if ((fun & PHYDEV_RDCMD) == 0 && (fun & PHYDEV_RDDONE) != 0) - break; - DELAY(100); - } - if(i >= MAX_RETRY) { - if (firewire_debug) - device_printf(sc->fc.dev, "phy read failed(1).\n"); - if (++retry < MAX_RETRY) { - DELAY(100); - goto again; - } - } - /* Make sure that SCLK is started */ - stat = OREAD(sc, FWOHCI_INTSTAT); - if ((stat & OHCI_INT_REG_FAIL) != 0 || - ((fun >> PHYDEV_REGADDR) & 0xf) != addr) { - if (firewire_debug) - device_printf(sc->fc.dev, "phy read failed(2).\n"); - if (++retry < MAX_RETRY) { - DELAY(100); - goto again; - } - } - if (firewire_debug || retry >= MAX_RETRY) - device_printf(sc->fc.dev, - "fwphy_rddata: 0x%x loop=%d, retry=%d\n", addr, i, retry); -#undef MAX_RETRY - return((fun >> PHYDEV_RDDATA )& 0xff); -} - - -static int -fwohci_probe_phy(struct fwohci_softc *sc, device_t dev) -{ - uint32_t reg, reg2; - int e1394a = 1; - int nport, speed; -/* - * probe PHY parameters - * 0. to prove PHY version, whether compliance of 1394a. - * 1. to probe maximum speed supported by the PHY and - * number of port supported by core-logic. - * It is not actually available port on your PC . - */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LPS); - DELAY(500); - - reg = fwphy_rddata(sc, FW_PHY_SPD_REG); - - if((reg >> 5) != 7 ){ - nport = reg & FW_PHY_NP; - speed = reg & FW_PHY_SPD >> 6; - if (speed > MAX_SPEED) { - device_printf(dev, "invalid speed %d (fixed to %d).\n", - speed, MAX_SPEED); - speed = MAX_SPEED; - } - device_printf(dev, - "Phy 1394 only %s, %d ports.\n", - linkspeed[speed], nport); - }else{ - reg2 = fwphy_rddata(sc, FW_PHY_ESPD_REG); - nport = reg & FW_PHY_NP; - speed = (reg2 & FW_PHY_ESPD) >> 5; - if (speed > MAX_SPEED) { - device_printf(dev, "invalid speed %d (fixed to %d).\n", - speed, MAX_SPEED); - speed = MAX_SPEED; - } - device_printf(dev, - "Phy 1394a available %s, %d ports.\n", - linkspeed[speed], nport); - - /* check programPhyEnable */ - reg2 = fwphy_rddata(sc, 5); -#if 0 - if (e1394a && (OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_PRPHY)) { -#else /* XXX force to enable 1394a */ - if (e1394a) { -#endif - if (firewire_debug) - device_printf(dev, - "Enable 1394a Enhancements\n"); - /* enable EAA EMC */ - reg2 |= 0x03; - /* set aPhyEnhanceEnable */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_PHYEN); - OWRITE(sc, OHCI_HCCCTLCLR, OHCI_HCC_PRPHY); - } else { - /* for safe */ - reg2 &= ~0x83; - } - reg2 = fwphy_wrdata(sc, 5, reg2); - } - sc->speed = speed; - - reg = fwphy_rddata(sc, FW_PHY_SPD_REG); - if((reg >> 5) == 7 ){ - reg = fwphy_rddata(sc, 4); - reg |= 1 << 6; - fwphy_wrdata(sc, 4, reg); - reg = fwphy_rddata(sc, 4); - } - return 0; -} - - -void -fwohci_reset(struct fwohci_softc *sc, device_t dev) -{ - int i, max_rec, speed; - uint32_t reg, reg2; - - /* Disable interrupts */ - OWRITE(sc, FWOHCI_INTMASKCLR, ~0); - - /* FLUSH FIFO and reset Transmitter/Receiver */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); - if (firewire_debug) - device_printf(dev, "resetting OHCI..."); - i = 0; - while(OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_RESET) { - if (i++ > 100) break; - DELAY(1000); - } - if (firewire_debug) - printf("done (loop=%d)\n", i); - - /* Probe phy */ - fwohci_probe_phy(sc, dev); - - /* Probe link */ - reg = OREAD(sc, OHCI_BUS_OPT); - reg2 = reg | OHCI_BUSFNC; - max_rec = (reg & 0x0000f000) >> 12; - speed = (reg & 0x00000007); - device_printf(dev, "Link %s, max_rec %d bytes.\n", - linkspeed[speed], MAXREC(max_rec)); - /* XXX fix max_rec */ - sc->maxrec = sc->speed + 8; - if (max_rec != sc->maxrec) { - reg2 = (reg2 & 0xffff0fff) | (sc->maxrec << 12); - device_printf(dev, "max_rec %d -> %d\n", - MAXREC(max_rec), MAXREC(sc->maxrec)); - } - if (firewire_debug) - device_printf(dev, "BUS_OPT 0x%x -> 0x%x\n", reg, reg2); - OWRITE(sc, OHCI_BUS_OPT, reg2); - - /* Initialize registers */ - OWRITE(sc, OHCI_CROMHDR, sc->config_rom[0]); - OWRITE(sc, OHCI_CROMPTR, VTOP(sc->config_rom)); -#if 0 - OWRITE(sc, OHCI_SID_BUF, sc->sid_dma.bus_addr); -#endif - OWRITE(sc, OHCI_HCCCTLCLR, OHCI_HCC_BIGEND); - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_POSTWR); -#if 0 - OWRITE(sc, OHCI_LNKCTL, OHCI_CNTL_SID); -#endif - - /* Enable link */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LINKEN); -} - -int -fwohci_init(struct fwohci_softc *sc, device_t dev) -{ - int i, mver; - uint32_t reg; - uint8_t ui[8]; - -/* OHCI version */ - reg = OREAD(sc, OHCI_VERSION); - mver = (reg >> 16) & 0xff; - device_printf(dev, "OHCI version %x.%x (ROM=%d)\n", - mver, reg & 0xff, (reg>>24) & 1); - if (mver < 1 || mver > 9) { - device_printf(dev, "invalid OHCI version\n"); - return (ENXIO); - } - -/* Available Isochronous DMA channel probe */ - OWRITE(sc, OHCI_IT_MASK, 0xffffffff); - OWRITE(sc, OHCI_IR_MASK, 0xffffffff); - reg = OREAD(sc, OHCI_IT_MASK) & OREAD(sc, OHCI_IR_MASK); - OWRITE(sc, OHCI_IT_MASKCLR, 0xffffffff); - OWRITE(sc, OHCI_IR_MASKCLR, 0xffffffff); - for (i = 0; i < 0x20; i++) - if ((reg & (1 << i)) == 0) - break; - device_printf(dev, "No. of Isochronous channels is %d.\n", i); - if (i == 0) - return (ENXIO); - -#if 0 -/* SID receive buffer must align 2^11 */ -#define OHCI_SIDSIZE (1 << 11) - sc->sid_buf = fwdma_malloc(&sc->fc, OHCI_SIDSIZE, OHCI_SIDSIZE, - &sc->sid_dma, BUS_DMA_WAITOK); - if (sc->sid_buf == NULL) { - device_printf(dev, "sid_buf alloc failed."); - return ENOMEM; - } -#endif - - sc->eui.hi = OREAD(sc, FWOHCIGUID_H); - sc->eui.lo = OREAD(sc, FWOHCIGUID_L); - for( i = 0 ; i < 8 ; i ++) - ui[i] = FW_EUI64_BYTE(&sc->eui,i); - device_printf(dev, "EUI64 %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", - ui[0], ui[1], ui[2], ui[3], ui[4], ui[5], ui[6], ui[7]); - fwohci_reset(sc, dev); - - return 0; -} - -void -fwohci_ibr(struct fwohci_softc *sc) -{ - uint32_t fun; - - device_printf(sc->dev, "Initiate bus reset\n"); - - /* - * Make sure our cached values from the config rom are - * initialised. - */ - OWRITE(sc, OHCI_CROMHDR, ntohl(sc->config_rom[0])); - OWRITE(sc, OHCI_BUS_OPT, ntohl(sc->config_rom[2])); - - /* - * Set root hold-off bit so that non cyclemaster capable node - * shouldn't became the root node. - */ -#if 1 - fun = fwphy_rddata(sc, FW_PHY_IBR_REG); - fun |= FW_PHY_IBR; - fun = fwphy_wrdata(sc, FW_PHY_IBR_REG, fun); -#else /* Short bus reset */ - fun = fwphy_rddata(sc, FW_PHY_ISBR_REG); - fun |= FW_PHY_ISBR; - fun = fwphy_wrdata(sc, FW_PHY_ISBR_REG, fun); -#endif -} - - -void -fwohci_sid(struct fwohci_softc *sc) -{ - uint32_t node_id; - int plen; - - node_id = OREAD(sc, FWOHCI_NODEID); - if (!(node_id & OHCI_NODE_VALID)) { -#if 0 - printf("Bus reset failure\n"); -#endif - return; - } - - /* Enable bus reset interrupt */ - OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_PHY_BUS_R); - /* Allow async. request to us */ - OWRITE(sc, OHCI_AREQHI, 1 << 31); - /* XXX insecure ?? */ - OWRITE(sc, OHCI_PREQHI, 0x7fffffff); - OWRITE(sc, OHCI_PREQLO, 0xffffffff); - OWRITE(sc, OHCI_PREQUPPER, 0x10000); - /* Set ATRetries register */ - OWRITE(sc, OHCI_ATRETRY, 1<<(13+16) | 0xfff); -/* -** Checking whether the node is root or not. If root, turn on -** cycle master. -*/ - plen = OREAD(sc, OHCI_SID_CNT); - device_printf(fc->dev, "node_id=0x%08x, gen=%d, ", - node_id, (plen >> 16) & 0xff); - if (node_id & OHCI_NODE_ROOT) { - device_printf(sc->dev, "CYCLEMASTER mode\n"); - OWRITE(sc, OHCI_LNKCTL, - OHCI_CNTL_CYCMTR | OHCI_CNTL_CYCTIMER); - } else { - device_printf(sc->dev, "non CYCLEMASTER mode\n"); - OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCMTR); - OWRITE(sc, OHCI_LNKCTL, OHCI_CNTL_CYCTIMER); - } - if (plen & OHCI_SID_ERR) { - device_printf(fc->dev, "SID Error\n"); - return; - } - device_printf(sc->dev, "bus reset phase done\n"); - sc->state = FWOHCI_STATE_NORMAL; -} - -static void -fwohci_intr_body(struct fwohci_softc *sc, uint32_t stat, int count) -{ -#undef OHCI_DEBUG -#ifdef OHCI_DEBUG -#if 0 - if(stat & OREAD(sc, FWOHCI_INTMASK)) -#else - if (1) -#endif - device_printf(fc->dev, "INTERRUPT < %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s> 0x%08x, 0x%08x\n", - stat & OHCI_INT_EN ? "DMA_EN ":"", - stat & OHCI_INT_PHY_REG ? "PHY_REG ":"", - stat & OHCI_INT_CYC_LONG ? "CYC_LONG ":"", - stat & OHCI_INT_ERR ? "INT_ERR ":"", - stat & OHCI_INT_CYC_ERR ? "CYC_ERR ":"", - stat & OHCI_INT_CYC_LOST ? "CYC_LOST ":"", - stat & OHCI_INT_CYC_64SECOND ? "CYC_64SECOND ":"", - stat & OHCI_INT_CYC_START ? "CYC_START ":"", - stat & OHCI_INT_PHY_INT ? "PHY_INT ":"", - stat & OHCI_INT_PHY_BUS_R ? "BUS_RESET ":"", - stat & OHCI_INT_PHY_SID ? "SID ":"", - stat & OHCI_INT_LR_ERR ? "DMA_LR_ERR ":"", - stat & OHCI_INT_PW_ERR ? "DMA_PW_ERR ":"", - stat & OHCI_INT_DMA_IR ? "DMA_IR ":"", - stat & OHCI_INT_DMA_IT ? "DMA_IT " :"", - stat & OHCI_INT_DMA_PRRS ? "DMA_PRRS " :"", - stat & OHCI_INT_DMA_PRRQ ? "DMA_PRRQ " :"", - stat & OHCI_INT_DMA_ARRS ? "DMA_ARRS " :"", - stat & OHCI_INT_DMA_ARRQ ? "DMA_ARRQ " :"", - stat & OHCI_INT_DMA_ATRS ? "DMA_ATRS " :"", - stat & OHCI_INT_DMA_ATRQ ? "DMA_ATRQ " :"", - stat, OREAD(sc, FWOHCI_INTMASK) - ); -#endif -/* Bus reset */ - if(stat & OHCI_INT_PHY_BUS_R ){ - device_printf(fc->dev, "BUS reset\n"); - if (sc->state == FWOHCI_STATE_BUSRESET) - goto busresetout; - sc->state = FWOHCI_STATE_BUSRESET; - /* Disable bus reset interrupt until sid recv. */ - OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_PHY_BUS_R); - - OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST); - OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCSRC); - - OWRITE(sc, OHCI_CROMHDR, ntohl(sc->config_rom[0])); - OWRITE(sc, OHCI_BUS_OPT, ntohl(sc->config_rom[2])); - } else if (sc->state == FWOHCI_STATE_BUSRESET) { - fwohci_sid(sc); - } -busresetout: - return; -} - -static uint32_t -fwochi_check_stat(struct fwohci_softc *sc) -{ - uint32_t stat; - - stat = OREAD(sc, FWOHCI_INTSTAT); - if (stat == 0xffffffff) { - device_printf(sc->fc.dev, - "device physically ejected?\n"); - return(stat); - } - if (stat) - OWRITE(sc, FWOHCI_INTSTATCLR, stat); - return(stat); -} - -void -fwohci_poll(struct fwohci_softc *sc) -{ - uint32_t stat; - - stat = fwochi_check_stat(sc); - if (stat != 0xffffffff) - fwohci_intr_body(sc, stat, 1); -} diff --git a/usr/src/boot/sys/boot/i386/libfirewire/fwohci.h b/usr/src/boot/sys/boot/i386/libfirewire/fwohci.h deleted file mode 100644 index 4a93220b31..0000000000 --- a/usr/src/boot/sys/boot/i386/libfirewire/fwohci.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2007 Hidetoshi Shimokawa - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the acknowledgement as bellow: - * - * This product includes software developed by K. Kobayashi and H. Shimokawa - * - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * - */ - -#define MAX_OHCI 5 -#define CROMSIZE 0x400 - -struct fw_eui64 { - uint32_t hi, lo; -}; - -struct fwohci_softc { - uint32_t locator; - uint32_t devid; - uint32_t base_addr; - uint32_t bus_id; - uint32_t handle; - int32_t state; - struct crom_src_buf *crom_src_buf; - struct crom_src *crom_src; - struct crom_chunk *crom_root; - struct fw_eui64 eui; - int speed; - int maxrec; - uint32_t *config_rom; - char config_rom_buf[CROMSIZE*2]; /* double size for alignment */ -}; - -int fwohci_init(struct fwohci_softc *, int); -void fwohci_ibr(struct fwohci_softc *); -void fwohci_poll(struct fwohci_softc *); - -#define FWOHCI_STATE_DEAD (-1) -#define FWOHCI_STATE_INIT 0 -#define FWOHCI_STATE_ENABLED 1 -#define FWOHCI_STATE_BUSRESET 2 -#define FWOHCI_STATE_NORMAL 3 - -#define OREAD(f, o) (*(volatile uint32_t *)((f)->handle + (o))) -#define OWRITE(f, o, v) (*(volatile uint32_t *)((f)->handle + (o)) = (v)) - -#define OHCI_VERSION 0x00 -#define OHCI_ATRETRY 0x08 -#define OHCI_CROMHDR 0x18 -#define OHCI_BUS_ID 0x1c -#define OHCI_BUS_OPT 0x20 -#define OHCI_BUSIRMC (1U << 31) -#define OHCI_BUSCMC (1 << 30) -#define OHCI_BUSISC (1 << 29) -#define OHCI_BUSBMC (1 << 28) -#define OHCI_BUSPMC (1 << 27) -#define OHCI_BUSFNC OHCI_BUSIRMC | OHCI_BUSCMC | OHCI_BUSISC |\ - OHCI_BUSBMC | OHCI_BUSPMC - -#define OHCI_EUID_HI 0x24 -#define OHCI_EUID_LO 0x28 - -#define OHCI_CROMPTR 0x34 -#define OHCI_HCCCTL 0x50 -#define OHCI_HCCCTLCLR 0x54 -#define OHCI_AREQHI 0x100 -#define OHCI_AREQHICLR 0x104 -#define OHCI_AREQLO 0x108 -#define OHCI_AREQLOCLR 0x10c -#define OHCI_PREQHI 0x110 -#define OHCI_PREQHICLR 0x114 -#define OHCI_PREQLO 0x118 -#define OHCI_PREQLOCLR 0x11c -#define OHCI_PREQUPPER 0x120 - -#define OHCI_SID_BUF 0x64 -#define OHCI_SID_CNT 0x68 -#define OHCI_SID_ERR (1U << 31) -#define OHCI_SID_CNT_MASK 0xffc - -#define OHCI_IT_STAT 0x90 -#define OHCI_IT_STATCLR 0x94 -#define OHCI_IT_MASK 0x98 -#define OHCI_IT_MASKCLR 0x9c - -#define OHCI_IR_STAT 0xa0 -#define OHCI_IR_STATCLR 0xa4 -#define OHCI_IR_MASK 0xa8 -#define OHCI_IR_MASKCLR 0xac - -#define OHCI_LNKCTL 0xe0 -#define OHCI_LNKCTLCLR 0xe4 - -#define OHCI_PHYACCESS 0xec -#define OHCI_CYCLETIMER 0xf0 - -#define OHCI_DMACTL(off) (off) -#define OHCI_DMACTLCLR(off) (off + 4) -#define OHCI_DMACMD(off) (off + 0xc) -#define OHCI_DMAMATCH(off) (off + 0x10) - -#define OHCI_ATQOFF 0x180 -#define OHCI_ATQCTL OHCI_ATQOFF -#define OHCI_ATQCTLCLR (OHCI_ATQOFF + 4) -#define OHCI_ATQCMD (OHCI_ATQOFF + 0xc) -#define OHCI_ATQMATCH (OHCI_ATQOFF + 0x10) - -#define OHCI_ATSOFF 0x1a0 -#define OHCI_ATSCTL OHCI_ATSOFF -#define OHCI_ATSCTLCLR (OHCI_ATSOFF + 4) -#define OHCI_ATSCMD (OHCI_ATSOFF + 0xc) -#define OHCI_ATSMATCH (OHCI_ATSOFF + 0x10) - -#define OHCI_ARQOFF 0x1c0 -#define OHCI_ARQCTL OHCI_ARQOFF -#define OHCI_ARQCTLCLR (OHCI_ARQOFF + 4) -#define OHCI_ARQCMD (OHCI_ARQOFF + 0xc) -#define OHCI_ARQMATCH (OHCI_ARQOFF + 0x10) - -#define OHCI_ARSOFF 0x1e0 -#define OHCI_ARSCTL OHCI_ARSOFF -#define OHCI_ARSCTLCLR (OHCI_ARSOFF + 4) -#define OHCI_ARSCMD (OHCI_ARSOFF + 0xc) -#define OHCI_ARSMATCH (OHCI_ARSOFF + 0x10) - -#define OHCI_ITOFF(CH) (0x200 + 0x10 * (CH)) -#define OHCI_ITCTL(CH) (OHCI_ITOFF(CH)) -#define OHCI_ITCTLCLR(CH) (OHCI_ITOFF(CH) + 4) -#define OHCI_ITCMD(CH) (OHCI_ITOFF(CH) + 0xc) - -#define OHCI_IROFF(CH) (0x400 + 0x20 * (CH)) -#define OHCI_IRCTL(CH) (OHCI_IROFF(CH)) -#define OHCI_IRCTLCLR(CH) (OHCI_IROFF(CH) + 4) -#define OHCI_IRCMD(CH) (OHCI_IROFF(CH) + 0xc) -#define OHCI_IRMATCH(CH) (OHCI_IROFF(CH) + 0x10) diff --git a/usr/src/boot/sys/boot/i386/libfirewire/fwohcireg.h b/usr/src/boot/sys/boot/i386/libfirewire/fwohcireg.h deleted file mode 100644 index d57870cd62..0000000000 --- a/usr/src/boot/sys/boot/i386/libfirewire/fwohcireg.h +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright (c) 2003 Hidetoshi Shimokawa - * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the acknowledgement as bellow: - * - * This product includes software developed by K. Kobayashi and H. Shimokawa - * - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * - */ -#define PCI_CBMEM PCIR_BAR(0) - -#define FW_VENDORID_NATSEMI 0x100B -#define FW_VENDORID_NEC 0x1033 -#define FW_VENDORID_SIS 0x1039 -#define FW_VENDORID_TI 0x104c -#define FW_VENDORID_SONY 0x104d -#define FW_VENDORID_VIA 0x1106 -#define FW_VENDORID_RICOH 0x1180 -#define FW_VENDORID_APPLE 0x106b -#define FW_VENDORID_LUCENT 0x11c1 -#define FW_VENDORID_INTEL 0x8086 -#define FW_VENDORID_ADAPTEC 0x9004 - -#define FW_DEVICE_CS4210 (0x000f << 16) -#define FW_DEVICE_UPD861 (0x0063 << 16) -#define FW_DEVICE_UPD871 (0x00ce << 16) -#define FW_DEVICE_UPD72870 (0x00cd << 16) -#define FW_DEVICE_UPD72873 (0x00e7 << 16) -#define FW_DEVICE_UPD72874 (0x00f2 << 16) -#define FW_DEVICE_TITSB22 (0x8009 << 16) -#define FW_DEVICE_TITSB23 (0x8019 << 16) -#define FW_DEVICE_TITSB26 (0x8020 << 16) -#define FW_DEVICE_TITSB43 (0x8021 << 16) -#define FW_DEVICE_TITSB43A (0x8023 << 16) -#define FW_DEVICE_TITSB43AB23 (0x8024 << 16) -#define FW_DEVICE_TITSB82AA2 (0x8025 << 16) -#define FW_DEVICE_TITSB43AB21 (0x8026 << 16) -#define FW_DEVICE_TIPCI4410A (0x8017 << 16) -#define FW_DEVICE_TIPCI4450 (0x8011 << 16) -#define FW_DEVICE_TIPCI4451 (0x8027 << 16) -#define FW_DEVICE_CXD1947 (0x8009 << 16) -#define FW_DEVICE_CXD3222 (0x8039 << 16) -#define FW_DEVICE_VT6306 (0x3044 << 16) -#define FW_DEVICE_R5C551 (0x0551 << 16) -#define FW_DEVICE_R5C552 (0x0552 << 16) -#define FW_DEVICE_PANGEA (0x0030 << 16) -#define FW_DEVICE_UNINORTH (0x0031 << 16) -#define FW_DEVICE_AIC5800 (0x5800 << 16) -#define FW_DEVICE_FW322 (0x5811 << 16) -#define FW_DEVICE_7007 (0x7007 << 16) -#define FW_DEVICE_82372FB (0x7605 << 16) - -#define PCI_INTERFACE_OHCI 0x10 - -#define FW_OHCI_BASE_REG 0x10 - -#define OHCI_DMA_ITCH 0x20 -#define OHCI_DMA_IRCH 0x20 - -#define OHCI_MAX_DMA_CH (0x4 + OHCI_DMA_ITCH + OHCI_DMA_IRCH) - - -typedef uint32_t fwohcireg_t; - -/* for PCI */ -#if BYTE_ORDER == BIG_ENDIAN -#define FWOHCI_DMA_WRITE(x, y) ((x) = htole32(y)) -#define FWOHCI_DMA_READ(x) le32toh(x) -#define FWOHCI_DMA_SET(x, y) ((x) |= htole32(y)) -#define FWOHCI_DMA_CLEAR(x, y) ((x) &= htole32(~(y))) -#else -#define FWOHCI_DMA_WRITE(x, y) ((x) = (y)) -#define FWOHCI_DMA_READ(x) (x) -#define FWOHCI_DMA_SET(x, y) ((x) |= (y)) -#define FWOHCI_DMA_CLEAR(x, y) ((x) &= ~(y)) -#endif - -struct fwohcidb { - union { - struct { - uint32_t cmd; - uint32_t addr; - uint32_t depend; - uint32_t res; - } desc; - uint32_t immed[4]; - } db; -#define OHCI_STATUS_SHIFT 16 -#define OHCI_COUNT_MASK 0xffff -#define OHCI_OUTPUT_MORE (0 << 28) -#define OHCI_OUTPUT_LAST (1 << 28) -#define OHCI_INPUT_MORE (2 << 28) -#define OHCI_INPUT_LAST (3 << 28) -#define OHCI_STORE_QUAD (4 << 28) -#define OHCI_LOAD_QUAD (5 << 28) -#define OHCI_NOP (6 << 28) -#define OHCI_STOP (7 << 28) -#define OHCI_STORE (8 << 28) -#define OHCI_CMD_MASK (0xf << 28) - -#define OHCI_UPDATE (1 << 27) - -#define OHCI_KEY_ST0 (0 << 24) -#define OHCI_KEY_ST1 (1 << 24) -#define OHCI_KEY_ST2 (2 << 24) -#define OHCI_KEY_ST3 (3 << 24) -#define OHCI_KEY_REGS (5 << 24) -#define OHCI_KEY_SYS (6 << 24) -#define OHCI_KEY_DEVICE (7 << 24) -#define OHCI_KEY_MASK (7 << 24) - -#define OHCI_INTERRUPT_NEVER (0 << 20) -#define OHCI_INTERRUPT_TRUE (1 << 20) -#define OHCI_INTERRUPT_FALSE (2 << 20) -#define OHCI_INTERRUPT_ALWAYS (3 << 20) - -#define OHCI_BRANCH_NEVER (0 << 18) -#define OHCI_BRANCH_TRUE (1 << 18) -#define OHCI_BRANCH_FALSE (2 << 18) -#define OHCI_BRANCH_ALWAYS (3 << 18) -#define OHCI_BRANCH_MASK (3 << 18) - -#define OHCI_WAIT_NEVER (0 << 16) -#define OHCI_WAIT_TRUE (1 << 16) -#define OHCI_WAIT_FALSE (2 << 16) -#define OHCI_WAIT_ALWAYS (3 << 16) -}; - -#define OHCI_SPD_S100 0x4 -#define OHCI_SPD_S200 0x1 -#define OHCI_SPD_S400 0x2 - - -#define FWOHCIEV_NOSTAT 0 -#define FWOHCIEV_LONGP 2 -#define FWOHCIEV_MISSACK 3 -#define FWOHCIEV_UNDRRUN 4 -#define FWOHCIEV_OVRRUN 5 -#define FWOHCIEV_DESCERR 6 -#define FWOHCIEV_DTRDERR 7 -#define FWOHCIEV_DTWRERR 8 -#define FWOHCIEV_BUSRST 9 -#define FWOHCIEV_TIMEOUT 0xa -#define FWOHCIEV_TCODERR 0xb -#define FWOHCIEV_UNKNOWN 0xe -#define FWOHCIEV_FLUSHED 0xf -#define FWOHCIEV_ACKCOMPL 0x11 -#define FWOHCIEV_ACKPEND 0x12 -#define FWOHCIEV_ACKBSX 0x14 -#define FWOHCIEV_ACKBSA 0x15 -#define FWOHCIEV_ACKBSB 0x16 -#define FWOHCIEV_ACKTARD 0x1b -#define FWOHCIEV_ACKDERR 0x1d -#define FWOHCIEV_ACKTERR 0x1e - -#define FWOHCIEV_MASK 0x1f - -struct ohci_dma{ - fwohcireg_t cntl; - -#define OHCI_CNTL_CYCMATCH_S (0x1 << 31) - -#define OHCI_CNTL_BUFFIL (0x1 << 31) -#define OHCI_CNTL_ISOHDR (0x1 << 30) -#define OHCI_CNTL_CYCMATCH_R (0x1 << 29) -#define OHCI_CNTL_MULTICH (0x1 << 28) - -#define OHCI_CNTL_DMA_RUN (0x1 << 15) -#define OHCI_CNTL_DMA_WAKE (0x1 << 12) -#define OHCI_CNTL_DMA_DEAD (0x1 << 11) -#define OHCI_CNTL_DMA_ACTIVE (0x1 << 10) -#define OHCI_CNTL_DMA_BT (0x1 << 8) -#define OHCI_CNTL_DMA_BAD (0x1 << 7) -#define OHCI_CNTL_DMA_STAT (0xff) - - fwohcireg_t cntl_clr; - fwohcireg_t dummy0; - fwohcireg_t cmd; - fwohcireg_t match; - fwohcireg_t dummy1; - fwohcireg_t dummy2; - fwohcireg_t dummy3; -}; - -struct ohci_itdma{ - fwohcireg_t cntl; - fwohcireg_t cntl_clr; - fwohcireg_t dummy0; - fwohcireg_t cmd; -}; - -struct ohci_registers { - fwohcireg_t ver; /* Version No. 0x0 */ - fwohcireg_t guid; /* GUID_ROM No. 0x4 */ - fwohcireg_t retry; /* AT retries 0x8 */ -#define FWOHCI_RETRY 0x8 - fwohcireg_t csr_data; /* CSR data 0xc */ - fwohcireg_t csr_cmp; /* CSR compare 0x10 */ - fwohcireg_t csr_cntl; /* CSR compare 0x14 */ - fwohcireg_t rom_hdr; /* config ROM ptr. 0x18 */ - fwohcireg_t bus_id; /* BUS_ID 0x1c */ - fwohcireg_t bus_opt; /* BUS option 0x20 */ -#define FWOHCIGUID_H 0x24 -#define FWOHCIGUID_L 0x28 - fwohcireg_t guid_hi; /* GUID hi 0x24 */ - fwohcireg_t guid_lo; /* GUID lo 0x28 */ - fwohcireg_t dummy0[2]; /* dummy 0x2c-0x30 */ - fwohcireg_t config_rom; /* config ROM map 0x34 */ - fwohcireg_t post_wr_lo; /* post write addr lo 0x38 */ - fwohcireg_t post_wr_hi; /* post write addr hi 0x3c */ - fwohcireg_t vendor; /* vendor ID 0x40 */ - fwohcireg_t dummy1[3]; /* dummy 0x44-0x4c */ - fwohcireg_t hcc_cntl_set; /* HCC control set 0x50 */ - fwohcireg_t hcc_cntl_clr; /* HCC control clr 0x54 */ -#define OHCI_HCC_BIBIV (1U << 31) /* BIBimage Valid */ -#define OHCI_HCC_BIGEND (1 << 30) /* noByteSwapData */ -#define OHCI_HCC_PRPHY (1 << 23) /* programPhyEnable */ -#define OHCI_HCC_PHYEN (1 << 22) /* aPhyEnhanceEnable */ -#define OHCI_HCC_LPS (1 << 19) /* LPS */ -#define OHCI_HCC_POSTWR (1 << 18) /* postedWriteEnable */ -#define OHCI_HCC_LINKEN (1 << 17) /* linkEnable */ -#define OHCI_HCC_RESET (1 << 16) /* softReset */ - fwohcireg_t dummy2[2]; /* dummy 0x58-0x5c */ - fwohcireg_t dummy3[1]; /* dummy 0x60 */ - fwohcireg_t sid_buf; /* self id buffer 0x64 */ - fwohcireg_t sid_cnt; /* self id count 0x68 */ - fwohcireg_t dummy4[1]; /* dummy 0x6c */ - fwohcireg_t ir_mask_hi_set; /* ir mask hi set 0x70 */ - fwohcireg_t ir_mask_hi_clr; /* ir mask hi set 0x74 */ - fwohcireg_t ir_mask_lo_set; /* ir mask hi set 0x78 */ - fwohcireg_t ir_mask_lo_clr; /* ir mask hi set 0x7c */ -#define FWOHCI_INTSTAT 0x80 -#define FWOHCI_INTSTATCLR 0x84 -#define FWOHCI_INTMASK 0x88 -#define FWOHCI_INTMASKCLR 0x8c - fwohcireg_t int_stat; /* 0x80 */ - fwohcireg_t int_clear; /* 0x84 */ - fwohcireg_t int_mask; /* 0x88 */ - fwohcireg_t int_mask_clear; /* 0x8c */ - fwohcireg_t it_int_stat; /* 0x90 */ - fwohcireg_t it_int_clear; /* 0x94 */ - fwohcireg_t it_int_mask; /* 0x98 */ - fwohcireg_t it_mask_clear; /* 0x9c */ - fwohcireg_t ir_int_stat; /* 0xa0 */ - fwohcireg_t ir_int_clear; /* 0xa4 */ - fwohcireg_t ir_int_mask; /* 0xa8 */ - fwohcireg_t ir_mask_clear; /* 0xac */ - fwohcireg_t dummy5[11]; /* dummy 0xb0-d8 */ - fwohcireg_t fairness; /* fairness control 0xdc */ - fwohcireg_t link_cntl; /* Chip control 0xe0*/ - fwohcireg_t link_cntl_clr; /* Chip control clear 0xe4*/ -#define FWOHCI_NODEID 0xe8 - fwohcireg_t node; /* Node ID 0xe8 */ -#define OHCI_NODE_VALID (1U << 31) -#define OHCI_NODE_ROOT (1 << 30) - -#define OHCI_ASYSRCBUS 1 - - fwohcireg_t phy_access; /* PHY cntl 0xec */ -#define PHYDEV_RDDONE (1<<31) -#define PHYDEV_RDCMD (1<<15) -#define PHYDEV_WRCMD (1<<14) -#define PHYDEV_REGADDR 8 -#define PHYDEV_WRDATA 0 -#define PHYDEV_RDADDR 24 -#define PHYDEV_RDDATA 16 - - fwohcireg_t cycle_timer; /* Cycle Timer 0xf0 */ - fwohcireg_t dummy6[3]; /* dummy 0xf4-fc */ - fwohcireg_t areq_hi; /* Async req. filter hi 0x100 */ - fwohcireg_t areq_hi_clr; /* Async req. filter hi 0x104 */ - fwohcireg_t areq_lo; /* Async req. filter lo 0x108 */ - fwohcireg_t areq_lo_clr; /* Async req. filter lo 0x10c */ - fwohcireg_t preq_hi; /* Async req. filter hi 0x110 */ - fwohcireg_t preq_hi_clr; /* Async req. filter hi 0x114 */ - fwohcireg_t preq_lo; /* Async req. filter lo 0x118 */ - fwohcireg_t preq_lo_clr; /* Async req. filter lo 0x11c */ - - fwohcireg_t pys_upper; /* Physical Upper bound 0x120 */ - - fwohcireg_t dummy7[23]; /* dummy 0x124-0x17c */ - - /* 0x180, 0x184, 0x188, 0x18c */ - /* 0x190, 0x194, 0x198, 0x19c */ - /* 0x1a0, 0x1a4, 0x1a8, 0x1ac */ - /* 0x1b0, 0x1b4, 0x1b8, 0x1bc */ - /* 0x1c0, 0x1c4, 0x1c8, 0x1cc */ - /* 0x1d0, 0x1d4, 0x1d8, 0x1dc */ - /* 0x1e0, 0x1e4, 0x1e8, 0x1ec */ - /* 0x1f0, 0x1f4, 0x1f8, 0x1fc */ - struct ohci_dma dma_ch[0x4]; - - /* 0x200, 0x204, 0x208, 0x20c */ - /* 0x210, 0x204, 0x208, 0x20c */ - struct ohci_itdma dma_itch[0x20]; - - /* 0x400, 0x404, 0x408, 0x40c */ - /* 0x410, 0x404, 0x408, 0x40c */ - struct ohci_dma dma_irch[0x20]; -}; - -#define OHCI_CNTL_CYCSRC (0x1 << 22) -#define OHCI_CNTL_CYCMTR (0x1 << 21) -#define OHCI_CNTL_CYCTIMER (0x1 << 20) -#define OHCI_CNTL_PHYPKT (0x1 << 10) -#define OHCI_CNTL_SID (0x1 << 9) - -#define OHCI_INT_DMA_ATRQ (0x1 << 0) -#define OHCI_INT_DMA_ATRS (0x1 << 1) -#define OHCI_INT_DMA_ARRQ (0x1 << 2) -#define OHCI_INT_DMA_ARRS (0x1 << 3) -#define OHCI_INT_DMA_PRRQ (0x1 << 4) -#define OHCI_INT_DMA_PRRS (0x1 << 5) -#define OHCI_INT_DMA_IT (0x1 << 6) -#define OHCI_INT_DMA_IR (0x1 << 7) -#define OHCI_INT_PW_ERR (0x1 << 8) -#define OHCI_INT_LR_ERR (0x1 << 9) - -#define OHCI_INT_PHY_SID (0x1 << 16) -#define OHCI_INT_PHY_BUS_R (0x1 << 17) - -#define OHCI_INT_REG_FAIL (0x1 << 18) - -#define OHCI_INT_PHY_INT (0x1 << 19) -#define OHCI_INT_CYC_START (0x1 << 20) -#define OHCI_INT_CYC_64SECOND (0x1 << 21) -#define OHCI_INT_CYC_LOST (0x1 << 22) -#define OHCI_INT_CYC_ERR (0x1 << 23) - -#define OHCI_INT_ERR (0x1 << 24) -#define OHCI_INT_CYC_LONG (0x1 << 25) -#define OHCI_INT_PHY_REG (0x1 << 26) - -#define OHCI_INT_EN (0x1 << 31) - -#define IP_CHANNELS 0x0234 -#define FWOHCI_MAXREC 2048 - -#define OHCI_ISORA 0x02 -#define OHCI_ISORB 0x04 - -#define FWOHCITCODE_PHY 0xe diff --git a/usr/src/boot/sys/boot/ofw/Makefile b/usr/src/boot/sys/boot/ofw/Makefile deleted file mode 100644 index 3b881b780e..0000000000 --- a/usr/src/boot/sys/boot/ofw/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -SUBDIR= libofw - -.include <bsd.subdir.mk> diff --git a/usr/src/boot/sys/boot/ofw/Makefile.inc b/usr/src/boot/sys/boot/ofw/Makefile.inc deleted file mode 100644 index e67c0dc904..0000000000 --- a/usr/src/boot/sys/boot/ofw/Makefile.inc +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc_fbsd -.endif - -.include "../Makefile.inc" diff --git a/usr/src/boot/sys/boot/ofw/common/Makefile.inc b/usr/src/boot/sys/boot/ofw/common/Makefile.inc deleted file mode 100644 index 5d20372631..0000000000 --- a/usr/src/boot/sys/boot/ofw/common/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -SRCS+= main.c diff --git a/usr/src/boot/sys/boot/ofw/common/main.c b/usr/src/boot/sys/boot/ofw/common/main.c deleted file mode 100644 index a927203a76..0000000000 --- a/usr/src/boot/sys/boot/ofw/common/main.c +++ /dev/null @@ -1,183 +0,0 @@ -/*- - * Copyright (c) 2000 Benno Rice <benno@jeamland.net> - * Copyright (c) 2000 Stephane Potvin <sepotvin@videotron.ca> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <stand.h> -#include "openfirm.h" -#include "libofw.h" -#include "bootstrap.h" - -struct arch_switch archsw; /* MI/MD interface boundary */ - -extern char end[]; - -u_int32_t acells, scells; - -static char bootargs[128]; - -#define HEAP_SIZE 0x100000 - -#define OF_puts(fd, text) OF_write(fd, text, strlen(text)) - -void -init_heap(void) -{ - void *base; - ihandle_t stdout; - - if ((base = ofw_alloc_heap(HEAP_SIZE)) == (void *)0xffffffff) { - OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); - OF_puts(stdout, "Heap memory claim failed!\n"); - OF_enter(); - } - - setheap(base, (void *)((int)base + HEAP_SIZE)); -} - -uint64_t -memsize(void) -{ - phandle_t memoryp; - cell_t reg[24]; - int i, sz; - u_int64_t memsz; - - memsz = 0; - memoryp = OF_instance_to_package(memory); - - sz = OF_getprop(memoryp, "reg", ®, sizeof(reg)); - sz /= sizeof(reg[0]); - - for (i = 0; i < sz; i += (acells + scells)) { - if (scells > 1) - memsz += (uint64_t)reg[i + acells] << 32; - memsz += reg[i + acells + scells - 1]; - } - - return (memsz); -} - -int -main(int (*openfirm)(void *)) -{ - phandle_t root; - int i; - char bootpath[64]; - char *ch; - int bargc; - char **bargv; - - /* - * Initialize the Open Firmware routines by giving them the entry point. - */ - OF_init(openfirm); - - root = OF_finddevice("/"); - - scells = acells = 1; - OF_getprop(root, "#address-cells", &acells, sizeof(acells)); - OF_getprop(root, "#size-cells", &scells, sizeof(scells)); - - /* - * Initialise the heap as early as possible. Once this is done, - * alloc() is usable. The stack is buried inside us, so this is - * safe. - */ - init_heap(); - - /* - * Set up console. - */ - cons_probe(); - - /* - * March through the device switch probing for things. - */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); - - printf("\n%s", bootprog_info); - printf("Memory: %lldKB\n", memsize() / 1024); - - OF_getprop(chosen, "bootpath", bootpath, 64); - ch = strchr(bootpath, ':'); - *ch = '\0'; - printf("Booted from: %s\n", bootpath); - - printf("\n"); - - /* - * Only parse the first bootarg if present. It should - * be simple to handle extra arguments - */ - OF_getprop(chosen, "bootargs", bootargs, sizeof(bootargs)); - bargc = 0; - parse(&bargc, &bargv, bootargs); - if (bargc == 1) - env_setenv("currdev", EV_VOLATILE, bargv[0], ofw_setcurrdev, - env_nounset); - else - env_setenv("currdev", EV_VOLATILE, bootpath, - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, - env_nounset); - setenv("screen-#rows", "24", 1); /* optional */ - - archsw.arch_getdev = ofw_getdev; - archsw.arch_copyin = ofw_copyin; - archsw.arch_copyout = ofw_copyout; - archsw.arch_readin = ofw_readin; - archsw.arch_autoload = ofw_autoload; - - interact(NULL); /* doesn't return */ - - OF_exit(); - - return 0; -} - -COMMAND_SET(halt, "halt", "halt the system", command_halt); - -static int -command_halt(int argc, char *argv[]) -{ - - OF_exit(); - return (CMD_OK); -} - -COMMAND_SET(memmap, "memmap", "print memory map", command_memmap); - -int -command_memmap(int argc, char **argv) -{ - - ofw_memmap(acells); - return (CMD_OK); -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/Makefile b/usr/src/boot/sys/boot/ofw/libofw/Makefile deleted file mode 100644 index 751ebfda75..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# $FreeBSD$ - -LIB= ofw -INTERNALLIB= - -SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ - ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ - ofw_time.c openfirm.c -.PATH: ${.CURDIR}/../../zfs -SRCS+= devicename_stubs.c - -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ - -# Pick up the bootstrap header for some interface items -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. - -CFLAGS+= -ffreestanding -.if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float -SRCS+= ppc64_elf_freebsd.c -.endif - -.ifdef(BOOT_DISK_DEBUG) -# Make the disk code more talkative -CFLAGS+= -DDISK_DEBUG -.endif - -machine: - ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine - -CLEANFILES+= machine - -.include <bsd.lib.mk> - -beforedepend ${OBJS}: machine diff --git a/usr/src/boot/sys/boot/ofw/libofw/devicename.c b/usr/src/boot/sys/boot/ofw/libofw/devicename.c deleted file mode 100644 index 94d0d0bbeb..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/devicename.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <stand.h> - -#include "bootstrap.h" -#include "libofw.h" -#include "libzfs.h" - -static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); - -/* - * Point (dev) at an allocated device specifier for the device matching the - * path in (devspec). If it contains an explicit device specification, - * use that. If not, use the default device. - */ -int -ofw_getdev(void **vdev, const char *devspec, const char **path) -{ - struct ofw_devdesc **dev = (struct ofw_devdesc **)vdev; - int rv; - - /* - * If it looks like this is just a path and no - * device, go with the current device. - */ - if ((devspec == NULL) || - ((strchr(devspec, '@') == NULL) && - (strchr(devspec, ':') == NULL))) { - - if (((rv = ofw_parsedev(dev, getenv("currdev"), NULL)) == 0) && - (path != NULL)) - *path = devspec; - return(rv); - } - - /* - * Try to parse the device name off the beginning of the devspec - */ - return(ofw_parsedev(dev, devspec, path)); -} - -/* - * Point (dev) at an allocated device specifier matching the string version - * at the beginning of (devspec). Return a pointer to the remaining - * text in (path). - */ -static int -ofw_parsedev(struct ofw_devdesc **dev, const char *devspec, const char **path) -{ - struct ofw_devdesc *idev; - struct devsw *dv; - phandle_t handle; - const char *p; - const char *s; - char *ep; - char name[256]; - char type[64]; - int err; - int len; - int i; - - for (p = s = devspec; *s != '\0'; p = s) { - if ((s = strchr(p + 1, '/')) == NULL) - s = strchr(p, '\0'); - len = s - devspec; - bcopy(devspec, name, len); - name[len] = '\0'; - if ((handle = OF_finddevice(name)) == -1) { - bcopy(name, type, len); - type[len] = '\0'; - } else if (OF_getprop(handle, "device_type", type, sizeof(type)) == -1) - continue; - for (i = 0; (dv = devsw[i]) != NULL; i++) { - if (strncmp(dv->dv_name, type, strlen(dv->dv_name)) == 0) - goto found; - } - } - return(ENOENT); - -found: - if (path != NULL) - *path = s; - idev = malloc(sizeof(struct ofw_devdesc)); - if (idev == NULL) { - printf("ofw_parsedev: malloc failed\n"); - return ENOMEM; - } - strcpy(idev->d_path, name); - idev->dd.d_dev = dv; - if (dv->dv_type == DEVT_ZFS) { - p = devspec + strlen(dv->dv_name); - err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); - if (err != 0) { - free(idev); - return (err); - } - } - - if (dev == NULL) { - free(idev); - } else { - *dev = idev; - } - return(0); -} - -int -ofw_setcurrdev(struct env_var *ev, int flags, const void *value) -{ - struct ofw_devdesc *ncurr; - int rv; - - if ((rv = ofw_parsedev(&ncurr, value, NULL)) != 0) - return rv; - - free(ncurr); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return 0; -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/elf_freebsd.c b/usr/src/boot/sys/boot/ofw/libofw/elf_freebsd.c deleted file mode 100644 index 80ece7eeba..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/elf_freebsd.c +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * Copyright (c) 2001 Benno Rice <benno@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/linker.h> - -#include <machine/metadata.h> -#include <machine/elf.h> - -#include <stand.h> - -#include "bootstrap.h" -#include "libofw.h" -#include "openfirm.h" - -extern char end[]; -extern vm_offset_t reloc; /* From <arch>/conf.c */ - -int -__elfN(ofw_loadfile)(char *filename, u_int64_t dest, - struct preloaded_file **result) -{ - int r; - - r = __elfN(loadfile)(filename, dest, result); - if (r != 0) - return (r); - -#if defined(__powerpc__) - /* - * No need to sync the icache for modules: this will - * be done by the kernel after relocation. - */ - if (!strcmp((*result)->f_type, "elf kernel")) - __syncicache((void *) (*result)->f_addr, (*result)->f_size); -#endif - return (0); -} - -int -__elfN(ofw_exec)(struct preloaded_file *fp) -{ - struct file_metadata *fmp; - vm_offset_t mdp, dtbp; - Elf_Ehdr *e; - int error; - intptr_t entry; - - if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { - return(EFTYPE); - } - e = (Elf_Ehdr *)&fmp->md_data; - entry = e->e_entry; - - if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0) - return (error); - - printf("Kernel entry at 0x%lx ...\n", e->e_entry); - - dev_cleanup(); - ofw_release_heap(); - if (dtbp != 0) { - OF_quiesce(); - ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 0, 0, - mdp, sizeof(mdp)); - } else { - OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, - (void *)mdp, sizeof(mdp)); - } - - panic("exec returned"); -} - -struct file_format ofw_elf = -{ - __elfN(ofw_loadfile), - __elfN(ofw_exec) -}; diff --git a/usr/src/boot/sys/boot/ofw/libofw/libofw.h b/usr/src/boot/sys/boot/ofw/libofw/libofw.h deleted file mode 100644 index b211766d57..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/libofw.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2000 Benno Rice. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "openfirm.h" - -/* Note: Must match the 'struct devdesc' in stand.h */ -struct ofw_devdesc { - struct devdesc dd; - union { - struct { - ihandle_t d_handle; - char d_path[256]; - }; - struct { - uint64_t pool_guid; - uint64_t root_guid; - }; - }; -}; - -extern int ofw_getdev(void **vdev, const char *devspec, const char **path); -extern ev_sethook_t ofw_setcurrdev; - -extern struct devsw ofwdisk; -extern struct netif_driver ofwnet; - -int ofwn_getunit(const char *); - -ssize_t ofw_copyin(const void *src, vm_offset_t dest, const size_t len); -ssize_t ofw_copyout(const vm_offset_t src, void *dest, const size_t len); -ssize_t ofw_readin(const int fd, vm_offset_t dest, const size_t len); - -extern int ofw_boot(void); -extern int ofw_autoload(void); - -void ofw_memmap(int); -void *ofw_alloc_heap(unsigned int); -void ofw_release_heap(void); - -struct preloaded_file; -struct file_format; - -int ofw_elf_loadfile(char *, vm_offset_t, struct preloaded_file **); -int ofw_elf_exec(struct preloaded_file *); - -extern struct file_format ofw_elf; -#ifdef __powerpc__ -extern struct file_format ofw_elf64; -#endif - -extern void reboot(void); - -struct ofw_reg -{ - cell_t base; - cell_t size; -}; - -struct ofw_reg2 -{ - cell_t base_hi; - cell_t base_lo; - cell_t size; -}; - -extern int (*openfirmware)(void *); diff --git a/usr/src/boot/sys/boot/ofw/libofw/ofw_console.c b/usr/src/boot/sys/boot/ofw/libofw/ofw_console.c deleted file mode 100644 index a46c4a66ae..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ofw_console.c +++ /dev/null @@ -1,121 +0,0 @@ -/* $NetBSD: prom.c,v 1.3 1997/09/06 14:03:58 drochner Exp $ */ - -/*- - * Mach Operating System - * Copyright (c) 1992 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> - -#include "bootstrap.h" -#include "openfirm.h" - -static void ofw_cons_probe(struct console *cp); -static int ofw_cons_init(int); -void ofw_cons_putchar(int); -int ofw_cons_getchar(void); -int ofw_cons_poll(void); - -static ihandle_t stdin; -static ihandle_t stdout; - -struct console ofwconsole = { - .c_name = "ofw", - .c_desc = "Open Firmware console", - .c_flags = 0, - .c_probe = ofw_cons_probe, - .c_init = ofw_cons_init, - .c_out = ofw_cons_putchar, - .c_in = ofw_cons_getchar, - .c_ready = ofw_cons_poll, - .c_private = NULL -}; - -static void -ofw_cons_probe(struct console *cp) -{ - - OF_getprop(chosen, "stdin", &stdin, sizeof(stdin)); - OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); - cp->c_flags |= C_PRESENTIN|C_PRESENTOUT; -} - -static int -ofw_cons_init(int arg) -{ - return 0; -} - -void -ofw_cons_putchar(int c) -{ - char cbuf; - - if (c == '\n') { - cbuf = '\r'; - OF_write(stdout, &cbuf, 1); - } - - cbuf = c; - OF_write(stdout, &cbuf, 1); -} - -static int saved_char = -1; - -int -ofw_cons_getchar() -{ - unsigned char ch = '\0'; - int l; - - if (saved_char != -1) { - l = saved_char; - saved_char = -1; - return l; - } - - if (OF_read(stdin, &ch, 1) > 0) - return (ch); - - return (-1); -} - -int -ofw_cons_poll() -{ - unsigned char ch; - - if (saved_char != -1) - return 1; - - if (OF_read(stdin, &ch, 1) > 0) { - saved_char = ch; - return 1; - } - - return 0; -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/ofw_copy.c b/usr/src/boot/sys/boot/ofw/libofw/ofw_copy.c deleted file mode 100644 index ffd6987315..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ofw_copy.c +++ /dev/null @@ -1,173 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * MD primitives supporting placement of module data - * - * XXX should check load address/size against memory top. - */ -#include <stand.h> - -#include "libofw.h" - -#define READIN_BUF (4 * 1024) -#define PAGE_SIZE 0x1000 -#define PAGE_MASK 0x0fff -#define MAPMEM_PAGE_INC 16 - - -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) - -static int -ofw_mapmem(vm_offset_t dest, const size_t len) -{ - void *destp, *addr; - size_t dlen; - size_t resid; - size_t nlen; - static vm_offset_t last_dest = 0; - static size_t last_len = 0; - - nlen = len; - /* - * Check to see if this region fits in a prior mapping. - * Allocations are generally sequential, so only check - * the last one. - */ - if (dest >= last_dest && - (dest + len) <= (last_dest + last_len)) { - return (0); - } - - /* - * Trim area covered by existing mapping, if any - */ - if (dest < (last_dest + last_len) && dest >= last_dest) { - nlen -= (last_dest + last_len) - dest; - dest = last_dest + last_len; - } - - destp = (void *)(dest & ~PAGE_MASK); - resid = dest & PAGE_MASK; - - /* - * To avoid repeated mappings on small allocations, - * never map anything less than MAPMEM_PAGE_INC pages at a time - */ - if ((nlen + resid) < PAGE_SIZE*MAPMEM_PAGE_INC) { - dlen = PAGE_SIZE*MAPMEM_PAGE_INC; - } else - dlen = roundup(nlen + resid, PAGE_SIZE); - - if (OF_call_method("claim", memory, 3, 1, destp, dlen, 0, &addr) - == -1) { - printf("ofw_mapmem: physical claim failed\n"); - return (ENOMEM); - } - - /* - * We only do virtual memory management when real_mode is false. - */ - if (real_mode == 0) { - if (OF_call_method("claim", mmu, 3, 1, destp, dlen, 0, &addr) - == -1) { - printf("ofw_mapmem: virtual claim failed\n"); - return (ENOMEM); - } - - if (OF_call_method("map", mmu, 4, 0, destp, destp, dlen, 0) - == -1) { - printf("ofw_mapmem: map failed\n"); - return (ENOMEM); - } - } - last_dest = (vm_offset_t) destp; - last_len = dlen; - - return (0); -} - -ssize_t -ofw_copyin(const void *src, vm_offset_t dest, const size_t len) -{ - if (ofw_mapmem(dest, len)) { - printf("ofw_copyin: map error\n"); - return (0); - } - - bcopy(src, (void *)dest, len); - return(len); -} - -ssize_t -ofw_copyout(const vm_offset_t src, void *dest, const size_t len) -{ - bcopy((void *)src, dest, len); - return(len); -} - -ssize_t -ofw_readin(const int fd, vm_offset_t dest, const size_t len) -{ - void *buf; - size_t resid, chunk, get; - ssize_t got; - vm_offset_t p; - - p = dest; - - chunk = min(READIN_BUF, len); - buf = malloc(chunk); - if (buf == NULL) { - printf("ofw_readin: buf malloc failed\n"); - return(0); - } - - if (ofw_mapmem(dest, len)) { - printf("ofw_readin: map error\n"); - free(buf); - return (0); - } - - for (resid = len; resid > 0; resid -= got, p += got) { - get = min(chunk, resid); - got = read(fd, buf, get); - - if (got <= 0) { - if (got < 0) - printf("ofw_readin: read failed\n"); - break; - } - - bcopy(buf, (void *)p, got); - } - - free(buf); - return(len - resid); -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/ofw_disk.c b/usr/src/boot/sys/boot/ofw/libofw/ofw_disk.c deleted file mode 100644 index 9b2e11cbfb..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ofw_disk.c +++ /dev/null @@ -1,168 +0,0 @@ -/*- - * Copyright (C) 2000 Benno Rice. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * Disk I/O routines using Open Firmware - */ - -#include <sys/param.h> - -#include <netinet/in.h> - -#include <machine/stdarg.h> - -#include <stand.h> - -#include "bootstrap.h" -#include "libofw.h" - -static int ofwd_init(void); -static int ofwd_strategy(void *devdata, int flag, daddr_t dblk, - size_t size, char *buf, size_t *rsize); -static int ofwd_open(struct open_file *f, ...); -static int ofwd_close(struct open_file *f); -static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); -static void ofwd_print(int verbose); - -struct devsw ofwdisk = { - "block", - DEVT_DISK, - ofwd_init, - ofwd_strategy, - ofwd_open, - ofwd_close, - ofwd_ioctl, - ofwd_print -}; - -/* - * We're not guaranteed to be able to open a device more than once and there - * is no OFW standard method to determine whether a device is already opened. - * Opening a device multiple times simultaneously happens to work with most - * OFW block device drivers but triggers a trap with at least the driver for - * the on-board controllers of Sun Fire V100 and Ultra 1. Upper layers and MI - * code expect to be able to open a device more than once however. Given that - * different partitions of the same device might be opened at the same time as - * done by ZFS, we can't generally just keep track of the opened devices and - * reuse the instance handle when asked to open an already opened device. So - * the best we can do is to cache the lastly used device path and close and - * open devices in ofwd_strategy() as needed. - */ -static struct ofw_devdesc *kdp; - -static int -ofwd_init(void) -{ - - return (0); -} - -static int -ofwd_strategy(void *devdata, int flag __unused, daddr_t dblk, size_t size, - char *buf, size_t *rsize) -{ - struct ofw_devdesc *dp = (struct ofw_devdesc *)devdata; - daddr_t pos; - int n; - - if (dp != kdp) { - if (kdp != NULL) { -#if !defined(__powerpc__) - OF_close(kdp->d_handle); -#endif - kdp = NULL; - } - if ((dp->d_handle = OF_open(dp->d_path)) == -1) - return (ENOENT); - kdp = dp; - } - - pos = dblk * 512; - do { - if (OF_seek(dp->d_handle, pos) < 0) - return (EIO); - n = OF_read(dp->d_handle, buf, size); - if (n < 0 && n != -2) - return (EIO); - } while (n == -2); - *rsize = size; - return (0); -} - -static int -ofwd_open(struct open_file *f, ...) -{ - struct ofw_devdesc *dp; - va_list vl; - - va_start(vl, f); - dp = va_arg(vl, struct ofw_devdesc *); - va_end(vl); - - if (dp != kdp) { - if (kdp != NULL) { - OF_close(kdp->d_handle); - kdp = NULL; - } - if ((dp->d_handle = OF_open(dp->d_path)) == -1) { - printf("%s: Could not open %s\n", __func__, - dp->d_path); - return (ENOENT); - } - kdp = dp; - } - return (0); -} - -static int -ofwd_close(struct open_file *f) -{ - struct ofw_devdesc *dev = f->f_devdata; - - if (dev == kdp) { -#if !defined(__powerpc__) - OF_close(dev->d_handle); -#endif - kdp = NULL; - } - return (0); -} - -static int -ofwd_ioctl(struct open_file *f __unused, u_long cmd __unused, - void *data __unused) -{ - - return (EINVAL); -} - -static void -ofwd_print(int verbose __unused) -{ - -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/ofw_memory.c b/usr/src/boot/sys/boot/ofw/libofw/ofw_memory.c deleted file mode 100644 index 60cc90457b..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ofw_memory.c +++ /dev/null @@ -1,146 +0,0 @@ -/*- - * Copyright (c) 2001 Benno Rice - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/types.h> - -#include <stand.h> - -#include "libofw.h" -#include "openfirm.h" - -static void *heap_base = 0; -static unsigned int heap_size = 0; - -struct ofw_mapping { - vm_offset_t va; - int len; - vm_offset_t pa; - int mode; -}; - -struct ofw_mapping2 { - vm_offset_t va; - int len; - vm_offset_t pa_hi; - vm_offset_t pa_lo; - int mode; -}; - -void -ofw_memmap(int acells) -{ - struct ofw_mapping *mapptr; - struct ofw_mapping2 *mapptr2; - phandle_t mmup; - int nmapping, i; - u_char mappings[256 * sizeof(struct ofw_mapping2)]; - char lbuf[80]; - - mmup = OF_instance_to_package(mmu); - - bzero(mappings, sizeof(mappings)); - - nmapping = OF_getprop(mmup, "translations", mappings, sizeof(mappings)); - if (nmapping == -1) { - printf("Could not get memory map (%d)\n", - nmapping); - return; - } - - pager_open(); - if (acells == 1) { - nmapping /= sizeof(struct ofw_mapping); - mapptr = (struct ofw_mapping *) mappings; - - printf("%17s\t%17s\t%8s\t%6s\n", "Virtual Range", - "Physical Range", "#Pages", "Mode"); - - for (i = 0; i < nmapping; i++) { - sprintf(lbuf, "%08x-%08x\t%08x-%08x\t%8d\t%6x\n", - mapptr[i].va, - mapptr[i].va + mapptr[i].len, - mapptr[i].pa, - mapptr[i].pa + mapptr[i].len, - mapptr[i].len / 0x1000, - mapptr[i].mode); - if (pager_output(lbuf)) - break; - } - } else { - nmapping /= sizeof(struct ofw_mapping2); - mapptr2 = (struct ofw_mapping2 *) mappings; - - printf("%17s\t%17s\t%8s\t%6s\n", "Virtual Range", - "Physical Range", "#Pages", "Mode"); - - for (i = 0; i < nmapping; i++) { - sprintf(lbuf, "%08x-%08x\t%08x-%08x\t%8d\t%6x\n", - mapptr2[i].va, - mapptr2[i].va + mapptr2[i].len, - mapptr2[i].pa_lo, - mapptr2[i].pa_lo + mapptr2[i].len, - mapptr2[i].len / 0x1000, - mapptr2[i].mode); - if (pager_output(lbuf)) - break; - } - } - pager_close(); -} - -void * -ofw_alloc_heap(unsigned int size) -{ - phandle_t memoryp, root; - cell_t available[4]; - cell_t acells; - - root = OF_finddevice("/"); - acells = 1; - OF_getprop(root, "#address-cells", &acells, sizeof(acells)); - - memoryp = OF_instance_to_package(memory); - OF_getprop(memoryp, "available", available, sizeof(available)); - - heap_base = OF_claim((void *)available[acells-1], size, - sizeof(register_t)); - - if (heap_base != (void *)-1) { - heap_size = size; - } - - return (heap_base); -} - -void -ofw_release_heap(void) -{ - OF_release(heap_base, heap_size); -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/ofw_module.c b/usr/src/boot/sys/boot/ofw/libofw/ofw_module.c deleted file mode 100644 index d39a343445..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ofw_module.c +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * ofw-specific module functionality. - * - */ - -#include <stand.h> -#include <string.h> - -#include "bootstrap.h" -#include "libofw.h" - -/* - * Use voodoo to load modules required by current hardware. - */ -int -ofw_autoload(void) -{ - /* XXX Call some machdep autoload routine? */ - return(0); -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/ofw_net.c b/usr/src/boot/sys/boot/ofw/libofw/ofw_net.c deleted file mode 100644 index 977467f753..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ofw_net.c +++ /dev/null @@ -1,274 +0,0 @@ -/*- - * Copyright (c) 2000-2001 Benno Rice - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> - -#include <net/if.h> -#include <netinet/in.h> -#include <netinet/in_systm.h> -#include <netinet/if_ether.h> -#include <netinet/ip.h> - -#include <stand.h> -#include <net.h> -#include <netif.h> - -#include "openfirm.h" - -static int ofwn_probe(struct netif *, void *); -static int ofwn_match(struct netif *, void *); -static void ofwn_init(struct iodesc *, void *); -static ssize_t ofwn_get(struct iodesc *, void **, time_t); -static ssize_t ofwn_put(struct iodesc *, void *, size_t); -static void ofwn_end(struct netif *); - -extern struct netif_stats ofwn_stats[]; - -struct netif_dif ofwn_ifs[] = { - /* dif_unit dif_nsel dif_stats dif_private */ - { 0, 1, &ofwn_stats[0], 0, }, -}; - -struct netif_stats ofwn_stats[nitems(ofwn_ifs)]; - -struct netif_driver ofwnet = { - "net", /* netif_bname */ - ofwn_match, /* netif_match */ - ofwn_probe, /* netif_probe */ - ofwn_init, /* netif_init */ - ofwn_get, /* netif_get */ - ofwn_put, /* netif_put */ - ofwn_end, /* netif_end */ - ofwn_ifs, /* netif_ifs */ - nitems(ofwn_ifs) /* netif_nifs */ -}; - -static ihandle_t netinstance; - -static void *dmabuf; - -static int -ofwn_match(struct netif *nif, void *machdep_hint) -{ - return 1; -} - -static int -ofwn_probe(struct netif *nif, void *machdep_hint) -{ - return 0; -} - -static ssize_t -ofwn_put(struct iodesc *desc, void *pkt, size_t len) -{ - size_t sendlen; - ssize_t rv; - -#if defined(NETIF_DEBUG) - struct ether_header *eh; - printf("netif_put: desc=0x%x pkt=0x%x len=%d\n", desc, pkt, len); - eh = pkt; - printf("dst: %s ", ether_sprintf(eh->ether_dhost)); - printf("src: %s ", ether_sprintf(eh->ether_shost)); - printf("type: 0x%x\n", eh->ether_type & 0xffff); -#endif - - sendlen = len; - if (sendlen < 60) { - sendlen = 60; -#if defined(NETIF_DEBUG) - printf("netif_put: length padded to %d\n", sendlen); -#endif - } - - if (dmabuf) { - bcopy(pkt, dmabuf, sendlen); - pkt = dmabuf; - } - - rv = OF_write(netinstance, pkt, len); - -#if defined(NETIF_DEBUG) - printf("netif_put: OF_write returned %d\n", rv); -#endif - - return rv; -} - -static ssize_t -ofwn_get(struct iodesc *desc, void **pkt, time_t timeout) -{ - time_t t; - ssize_t length; - size_t len; - char *buf, *ptr; - -#if defined(NETIF_DEBUG) - printf("netif_get: pkt=%p, timeout=%d\n", pkt, timeout); -#endif - - /* - * We should read the "max-frame-size" int property instead, - * but at this time the iodesc does not have mtu, so we will take - * a small shortcut here. - */ - len = ETHER_MAX_LEN; - buf = malloc(len + ETHER_ALIGN); - if (buf == NULL) - return (-1); - ptr = buf + ETHER_ALIGN; - - t = getsecs(); - do { - length = OF_read(netinstance, ptr, len); - } while ((length == -2 || length == 0) && - (getsecs() - t < timeout)); - -#if defined(NETIF_DEBUG) - printf("netif_get: received length=%d (%x)\n", length, length); -#endif - - if (length < 12) { - free(buf); - return (-1); - } - -#if defined(NETIF_VERBOSE_DEBUG) - { - char *ch = ptr; - int i; - - for(i = 0; i < 96; i += 4) { - printf("%02x%02x%02x%02x ", ch[i], ch[i+1], - ch[i+2], ch[i+3]); - } - printf("\n"); - } -#endif - -#if defined(NETIF_DEBUG) - { - struct ether_header *eh = ptr; - - printf("dst: %s ", ether_sprintf(eh->ether_dhost)); - printf("src: %s ", ether_sprintf(eh->ether_shost)); - printf("type: 0x%x\n", eh->ether_type & 0xffff); - } -#endif - - *pkt = buf; - return (length); -} - -extern char *strchr(); - -static void -ofwn_init(struct iodesc *desc, void *machdep_hint) -{ - phandle_t netdev; - char path[64]; - char *ch; - int pathlen; - - pathlen = OF_getprop(chosen, "bootpath", path, 64); - if ((ch = strchr(path, ':')) != NULL) - *ch = '\0'; - netdev = OF_finddevice(path); -#ifdef __sparc64__ - if (OF_getprop(netdev, "mac-address", desc->myea, 6) == -1) -#else - if (OF_getprop(netdev, "local-mac-address", desc->myea, 6) == -1) -#endif - goto punt; - - printf("boot: ethernet address: %s\n", ether_sprintf(desc->myea)); - - if ((netinstance = OF_open(path)) == -1) { - printf("Could not open network device.\n"); - goto punt; - } - -#if defined(NETIF_DEBUG) - printf("ofwn_init: Open Firmware instance handle: %08x\n", netinstance); -#endif - -#ifndef __sparc64__ - dmabuf = NULL; - if (OF_call_method("dma-alloc", netinstance, 1, 1, (64 * 1024), &dmabuf) - < 0) { - printf("Failed to allocate DMA buffer (got %08x).\n", dmabuf); - goto punt; - } - -#if defined(NETIF_DEBUG) - printf("ofwn_init: allocated DMA buffer: %08x\n", dmabuf); -#endif -#endif - - return; - -punt: - printf("\n"); - printf("Could not boot from %s.\n", path); - OF_enter(); -} - -static void -ofwn_end(struct netif *nif) -{ -#ifdef BROKEN - /* dma-free freezes at least some Apple ethernet controllers */ - OF_call_method("dma-free", netinstance, 2, 0, dmabuf, MAXPHYS); -#endif - OF_close(netinstance); -} - -#if 0 -int -ofwn_getunit(const char *path) -{ - int i; - char newpath[255]; - - OF_canon(path, newpath, 254); - - for (i = 0; i < nofwninfo; i++) { - printf(">>> test =\t%s\n", ofwninfo[i].ofwn_path); - if (strcmp(path, ofwninfo[i].ofwn_path) == 0) - return i; - - if (strcmp(newpath, ofwninfo[i].ofwn_path) == 0) - return i; - } - - return -1; -} -#endif diff --git a/usr/src/boot/sys/boot/ofw/libofw/ofw_reboot.c b/usr/src/boot/sys/boot/ofw/libofw/ofw_reboot.c deleted file mode 100644 index bbb420ac17..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ofw_reboot.c +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * Copyright (c) 2000 Benno Rice - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include "openfirm.h" - -void -exit(int code) -{ - OF_exit(); -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/ofw_time.c b/usr/src/boot/sys/boot/ofw/libofw/ofw_time.c deleted file mode 100644 index d3f3f9484e..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ofw_time.c +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * Copyright (c) 2000 Benno Rice - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <stand.h> -#include "openfirm.h" - -time_t -time(time_t *tloc) -{ - int secs; - - secs = OF_milliseconds() / 1000; - if (tloc) - *tloc = secs; - return secs; -} - -time_t -getsecs(void) -{ - time_t n = 0; - time(&n); - return n; -} - -void -delay(int usecs) -{ - int msecs, start; - - msecs = usecs / 1000; - start = OF_milliseconds(); - - while (OF_milliseconds() - start < msecs); -} diff --git a/usr/src/boot/sys/boot/ofw/libofw/openfirm.c b/usr/src/boot/sys/boot/ofw/libofw/openfirm.c deleted file mode 100644 index a8626cc403..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/openfirm.c +++ /dev/null @@ -1,785 +0,0 @@ -/* $NetBSD: Locore.c,v 1.7 2000/08/20 07:04:59 tsubai Exp $ */ - -/*- - * Copyright (C) 1995, 1996 Wolfgang Solfrank. - * Copyright (C) 1995, 1996 TooLs GmbH. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by TooLs GmbH. - * 4. The name of TooLs GmbH may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/*- - * Copyright (C) 2000 Benno Rice. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <machine/stdarg.h> - -#include <stand.h> - -#include "openfirm.h" - -int (*openfirmware)(void *); - -phandle_t chosen; -ihandle_t mmu; -ihandle_t memory; -int real_mode = 0; - -/* Initialiser */ - -void -OF_init(int (*openfirm)(void *)) -{ - phandle_t options; - char mode[sizeof("true")]; - - openfirmware = openfirm; - - if ((chosen = OF_finddevice("/chosen")) == -1) - OF_exit(); - if (OF_getprop(chosen, "memory", &memory, sizeof(memory)) == -1) { - memory = OF_open("/memory"); - if (memory == -1) - memory = OF_open("/memory@0"); - if (memory == -1) - OF_exit(); - } - if (OF_getprop(chosen, "mmu", &mmu, sizeof(mmu)) == -1) - OF_exit(); - - /* - * Check if we run in real mode. If so, we do not need to map - * memory later on. - */ - options = OF_finddevice("/options"); - if (OF_getprop(options, "real-mode?", mode, sizeof(mode)) > 0 && - strcmp(mode, "true") == 0) - real_mode = 1; -} - -/* - * Generic functions - */ - -/* Test to see if a service exists. */ -int -OF_test(char *name) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t service; - cell_t missing; - } args = { - (cell_t)"test", - 1, - 1, - }; - - args.service = (cell_t)name; - if (openfirmware(&args) == -1) - return (-1); - return (args.missing); -} - -/* Return firmware millisecond count. */ -int -OF_milliseconds() -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t ms; - } args = { - (cell_t)"milliseconds", - 0, - 1, - }; - - openfirmware(&args); - return (args.ms); -} - -/* - * Device tree functions - */ - -/* Return the next sibling of this node or 0. */ -phandle_t -OF_peer(phandle_t node) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t node; - cell_t next; - } args = { - (cell_t)"peer", - 1, - 1, - }; - - args.node = node; - if (openfirmware(&args) == -1) - return (-1); - return (args.next); -} - -/* Return the first child of this node or 0. */ -phandle_t -OF_child(phandle_t node) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t node; - cell_t child; - } args = { - (cell_t)"child", - 1, - 1, - }; - - args.node = node; - if (openfirmware(&args) == -1) - return (-1); - return (args.child); -} - -/* Return the parent of this node or 0. */ -phandle_t -OF_parent(phandle_t node) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t node; - cell_t parent; - } args = { - (cell_t)"parent", - 1, - 1, - }; - - args.node = node; - if (openfirmware(&args) == -1) - return (-1); - return (args.parent); -} - -/* Return the package handle that corresponds to an instance handle. */ -phandle_t -OF_instance_to_package(ihandle_t instance) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t instance; - cell_t package; - } args = { - (cell_t)"instance-to-package", - 1, - 1, - }; - - args.instance = instance; - if (openfirmware(&args) == -1) - return (-1); - return (args.package); -} - -/* Get the length of a property of a package. */ -int -OF_getproplen(phandle_t package, char *propname) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t package; - cell_t propname; - cell_t proplen; - } args = { - (cell_t)"getproplen", - 2, - 1, - }; - - args.package = package; - args.propname = (cell_t)propname; - if (openfirmware(&args) == -1) - return (-1); - return (args.proplen); -} - -/* Get the value of a property of a package. */ -int -OF_getprop(phandle_t package, char *propname, void *buf, int buflen) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t package; - cell_t propname; - cell_t buf; - cell_t buflen; - cell_t size; - } args = { - (cell_t)"getprop", - 4, - 1, - }; - - args.package = package; - args.propname = (cell_t)propname; - args.buf = (cell_t)buf; - args.buflen = buflen; - if (openfirmware(&args) == -1) - return (-1); - return (args.size); -} - -/* Get the next property of a package. */ -int -OF_nextprop(phandle_t package, char *previous, char *buf) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t package; - cell_t previous; - cell_t buf; - cell_t flag; - } args = { - (cell_t)"nextprop", - 3, - 1, - }; - - args.package = package; - args.previous = (cell_t)previous; - args.buf = (cell_t)buf; - if (openfirmware(&args) == -1) - return (-1); - return (args.flag); -} - -/* Set the value of a property of a package. */ -/* XXX Has a bug on FirePower */ -int -OF_setprop(phandle_t package, char *propname, void *buf, int len) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t package; - cell_t propname; - cell_t buf; - cell_t len; - cell_t size; - } args = { - (cell_t)"setprop", - 4, - 1, - }; - - args.package = package; - args.propname = (cell_t)propname; - args.buf = (cell_t)buf; - args.len = len; - if (openfirmware(&args) == -1) - return (-1); - return (args.size); -} - -/* Convert a device specifier to a fully qualified pathname. */ -int -OF_canon(const char *device, char *buf, int len) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t device; - cell_t buf; - cell_t len; - cell_t size; - } args = { - (cell_t)"canon", - 3, - 1, - }; - - args.device = (cell_t)device; - args.buf = (cell_t)buf; - args.len = len; - if (openfirmware(&args) == -1) - return (-1); - return (args.size); -} - -/* Return a package handle for the specified device. */ -phandle_t -OF_finddevice(const char *device) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t device; - cell_t package; - } args = { - (cell_t)"finddevice", - 1, - 1, - }; - - args.device = (cell_t)device; - if (openfirmware(&args) == -1) - return (-1); - return (args.package); -} - -/* Return the fully qualified pathname corresponding to an instance. */ -int -OF_instance_to_path(ihandle_t instance, char *buf, int len) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t instance; - cell_t buf; - cell_t len; - cell_t size; - } args = { - (cell_t)"instance-to-path", - 3, - 1, - }; - - args.instance = instance; - args.buf = (cell_t)buf; - args.len = len; - if (openfirmware(&args) == -1) - return (-1); - return (args.size); -} - -/* Return the fully qualified pathname corresponding to a package. */ -int -OF_package_to_path(phandle_t package, char *buf, int len) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t package; - cell_t buf; - cell_t len; - cell_t size; - } args = { - (cell_t)"package-to-path", - 3, - 1, - }; - - args.package = package; - args.buf = (cell_t)buf; - args.len = len; - if (openfirmware(&args) == -1) - return (-1); - return (args.size); -} - -/* Call the method in the scope of a given instance. */ -int -OF_call_method(char *method, ihandle_t instance, int nargs, int nreturns, ...) -{ - va_list ap; - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t method; - cell_t instance; - cell_t args_n_results[12]; - } args = { - (cell_t)"call-method", - 2, - 1, - }; - cell_t *cp; - int n; - - if (nargs > 6) - return (-1); - args.nargs = nargs + 2; - args.nreturns = nreturns + 1; - args.method = (cell_t)method; - args.instance = instance; - va_start(ap, nreturns); - for (cp = (cell_t *)(args.args_n_results + (n = nargs)); --n >= 0;) - *--cp = va_arg(ap, cell_t); - if (openfirmware(&args) == -1) - return (-1); - if (args.args_n_results[nargs]) - return (args.args_n_results[nargs]); - for (cp = (cell_t *)(args.args_n_results + nargs + (n = args.nreturns)); - --n > 0;) - *va_arg(ap, cell_t *) = *--cp; - va_end(ap); - return (0); -} - -/* - * Device I/O functions - */ - -/* Open an instance for a device. */ -ihandle_t -OF_open(char *device) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t device; - cell_t instance; - } args = { - (cell_t)"open", - 1, - 1, - }; - - args.device = (cell_t)device; - if (openfirmware(&args) == -1 || args.instance == 0) { - return (-1); - } - return (args.instance); -} - -/* Close an instance. */ -void -OF_close(ihandle_t instance) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t instance; - } args = { - (cell_t)"close", - 1, - }; - - args.instance = instance; - openfirmware(&args); -} - -/* Read from an instance. */ -int -OF_read(ihandle_t instance, void *addr, int len) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t instance; - cell_t addr; - cell_t len; - cell_t actual; - } args = { - (cell_t)"read", - 3, - 1, - }; - - args.instance = instance; - args.addr = (cell_t)addr; - args.len = len; - -#if defined(OPENFIRM_DEBUG) - printf("OF_read: called with instance=%08x, addr=%p, len=%d\n", - args.instance, args.addr, args.len); -#endif - - if (openfirmware(&args) == -1) - return (-1); - -#if defined(OPENFIRM_DEBUG) - printf("OF_read: returning instance=%d, addr=%p, len=%d, actual=%d\n", - args.instance, args.addr, args.len, args.actual); -#endif - - return (args.actual); -} - -/* Write to an instance. */ -int -OF_write(ihandle_t instance, void *addr, int len) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t instance; - cell_t addr; - cell_t len; - cell_t actual; - } args = { - (cell_t)"write", - 3, - 1, - }; - - args.instance = instance; - args.addr = (cell_t)addr; - args.len = len; - if (openfirmware(&args) == -1) - return (-1); - return (args.actual); -} - -/* Seek to a position. */ -int -OF_seek(ihandle_t instance, u_int64_t pos) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t instance; - cell_t poshi; - cell_t poslo; - cell_t status; - } args = { - (cell_t)"seek", - 3, - 1, - }; - - args.instance = instance; - args.poshi = pos >> 32; - args.poslo = pos; - if (openfirmware(&args) == -1) - return (-1); - return (args.status); -} - -/* - * Memory functions - */ - -/* Claim an area of memory. */ -void * -OF_claim(void *virt, u_int size, u_int align) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t virt; - cell_t size; - cell_t align; - cell_t baseaddr; - } args = { - (cell_t)"claim", - 3, - 1, - }; - - args.virt = (cell_t)virt; - args.size = size; - args.align = align; - if (openfirmware(&args) == -1) - return ((void *)-1); - return ((void *)args.baseaddr); -} - -/* Release an area of memory. */ -void -OF_release(void *virt, u_int size) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t virt; - cell_t size; - } args = { - (cell_t)"release", - 2, - }; - - args.virt = (cell_t)virt; - args.size = size; - openfirmware(&args); -} - -/* - * Control transfer functions - */ - -/* Reset the system and call "boot <bootspec>". */ -void -OF_boot(char *bootspec) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t bootspec; - } args = { - (cell_t)"boot", - 1, - }; - - args.bootspec = (cell_t)bootspec; - openfirmware(&args); - for (;;) /* just in case */ - ; -} - -/* Suspend and drop back to the Open Firmware interface. */ -void -OF_enter() -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - } args = { - (cell_t)"enter", - }; - - openfirmware(&args); - /* We may come back. */ -} - -/* Shut down and drop back to the Open Firmware interface. */ -void -OF_exit() -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - } args = { - (cell_t)"exit", - }; - - openfirmware(&args); - for (;;) /* just in case */ - ; -} - -void -OF_quiesce() -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - } args = { - (cell_t)"quiesce", - }; - - openfirmware(&args); -} - -/* Free <size> bytes starting at <virt>, then call <entry> with <arg>. */ -#if 0 -void -OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t virt; - cell_t size; - cell_t entry; - cell_t arg; - cell_t len; - } args = { - (cell_t)"chain", - 5, - }; - - args.virt = (cell_t)virt; - args.size = size; - args.entry = (cell_t)entry; - args.arg = (cell_t)arg; - args.len = len; - openfirmware(&args); -} -#else -void -OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len) -{ - /* - * This is a REALLY dirty hack till the firmware gets this going - */ -#if 0 - if (size > 0) - OF_release(virt, size); -#endif - entry(0, 0, openfirmware, arg, len); -} -#endif diff --git a/usr/src/boot/sys/boot/ofw/libofw/openfirm.h b/usr/src/boot/sys/boot/ofw/libofw/openfirm.h deleted file mode 100644 index ecb1f32834..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/openfirm.h +++ /dev/null @@ -1,122 +0,0 @@ -/* $NetBSD: openfirm.h,v 1.1 1998/05/15 10:16:00 tsubai Exp $ */ - -/*- - * Copyright (C) 1995, 1996 Wolfgang Solfrank. - * Copyright (C) 1995, 1996 TooLs GmbH. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by TooLs GmbH. - * 4. The name of TooLs GmbH may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/*- - * Copyright (C) 2000 Benno Rice. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ -#ifndef _OPENFIRM_H_ -#define _OPENFIRM_H_ -/* - * Prototypes for Open Firmware Interface Routines - */ - -#include <sys/cdefs.h> -#include <sys/types.h> - -typedef unsigned int ihandle_t; -typedef unsigned int phandle_t; -typedef unsigned long int cell_t; - -extern int (*openfirmware)(void *); -extern phandle_t chosen; -extern ihandle_t memory, mmu; -extern int real_mode; - -/* - * This isn't actually an Open Firmware function, but it seemed like the right - * place for it to go. - */ -void OF_init(int (*openfirm)(void *)); - -/* Generic functions */ -int OF_test(char *); -void OF_quiesce(); /* Disable firmware */ - -/* Device tree functions */ -phandle_t OF_peer(phandle_t); -phandle_t OF_child(phandle_t); -phandle_t OF_parent(phandle_t); -phandle_t OF_instance_to_package(ihandle_t); -int OF_getproplen(phandle_t, char *); -int OF_getprop(phandle_t, char *, void *, int); -int OF_nextprop(phandle_t, char *, char *); -int OF_setprop(phandle_t, char *, void *, int); -int OF_canon(const char *, char *, int); -phandle_t OF_finddevice(const char *); -int OF_instance_to_path(ihandle_t, char *, int); -int OF_package_to_path(phandle_t, char *, int); -int OF_call_method(char *, ihandle_t, int, int, ...); - -/* Device I/O functions */ -ihandle_t OF_open(char *); -void OF_close(ihandle_t); -int OF_read(ihandle_t, void *, int); -int OF_write(ihandle_t, void *, int); -int OF_seek(ihandle_t, u_quad_t); - -/* Memory functions */ -void *OF_claim(void *, u_int, u_int); -void OF_release(void *, u_int); - -/* Control transfer functions */ -void OF_boot(char *); -void OF_enter(void); -void OF_exit(void) __attribute__((noreturn)); -void OF_chain(void *, u_int, void (*)(), void *, u_int); - -/* Time function */ -int OF_milliseconds(void); - -#endif /* _OPENFIRM_H_ */ diff --git a/usr/src/boot/sys/boot/ofw/libofw/ppc64_elf_freebsd.c b/usr/src/boot/sys/boot/ofw/libofw/ppc64_elf_freebsd.c deleted file mode 100644 index b411da4912..0000000000 --- a/usr/src/boot/sys/boot/ofw/libofw/ppc64_elf_freebsd.c +++ /dev/null @@ -1,110 +0,0 @@ -/*- - * Copyright (c) 2001 Benno Rice <benno@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#define __ELF_WORD_SIZE 64 - -#include <sys/param.h> -#include <sys/linker.h> - -#include <machine/metadata.h> -#include <machine/elf.h> - -#include <stand.h> - -#include "bootstrap.h" -#include "libofw.h" -#include "openfirm.h" - -extern char end[]; -extern vm_offset_t reloc; /* From <arch>/conf.c */ - -int -ppc64_ofw_elf_loadfile(char *filename, u_int64_t dest, - struct preloaded_file **result) -{ - int r; - - r = __elfN(loadfile)(filename, dest, result); - if (r != 0) - return (r); - - /* - * No need to sync the icache for modules: this will - * be done by the kernel after relocation. - */ - if (!strcmp((*result)->f_type, "elf kernel")) - __syncicache((void *) (*result)->f_addr, (*result)->f_size); - return (0); -} - -int -ppc64_ofw_elf_exec(struct preloaded_file *fp) -{ - struct file_metadata *fmp; - vm_offset_t mdp, dtbp; - Elf_Ehdr *e; - int error; - intptr_t entry; - - if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { - return(EFTYPE); - } - e = (Elf_Ehdr *)&fmp->md_data; - - /* Handle function descriptor for ELFv1 kernels */ - if ((e->e_flags & 3) == 2) - entry = e->e_entry; - else - entry = *(uint64_t *)e->e_entry; - - if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) - return (error); - - printf("Kernel entry at 0x%lx ...\n", entry); - - dev_cleanup(); - ofw_release_heap(); - - if (dtbp != 0) { - OF_quiesce(); - ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 0, 0, - mdp, sizeof(mdp)); - } else { - OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, - (void *)mdp, sizeof(mdp)); - } - - panic("exec returned"); -} - -struct file_format ofw_elf64 = -{ - ppc64_ofw_elf_loadfile, - ppc64_ofw_elf_exec -}; diff --git a/usr/src/boot/sys/boot/sparc64/Makefile b/usr/src/boot/sys/boot/sparc64/Makefile deleted file mode 100644 index 3bc76be267..0000000000 --- a/usr/src/boot/sys/boot/sparc64/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -SUBDIR= boot1 loader zfsboot - -.include <bsd.subdir.mk> diff --git a/usr/src/boot/sys/boot/sparc64/Makefile.inc b/usr/src/boot/sys/boot/sparc64/Makefile.inc deleted file mode 100644 index ef5a7cee74..0000000000 --- a/usr/src/boot/sys/boot/sparc64/Makefile.inc +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -BINDIR?= /boot -CFLAGS+= -ffreestanding -LDFLAGS+= -nostdlib - -.include "../Makefile.inc" diff --git a/usr/src/boot/sys/boot/sparc64/boot1/Makefile b/usr/src/boot/sys/boot/sparc64/boot1/Makefile deleted file mode 100644 index 5150c3b5f8..0000000000 --- a/usr/src/boot/sys/boot/sparc64/boot1/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# $FreeBSD$ - -PROG= boot1.elf -INTERNALPROG= -MAN= -FILES?= boot1 -SRCS= _start.s boot1.c -CLEANFILES=${FILES} boot1.aout - -BOOTBLOCKBASE= 0x4000 - -CFLAGS.clang+=-mcmodel=small -CFLAGS.gcc+=-mcmodel=medlow -CFLAGS+=-Os -I${.CURDIR}/../../common -LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N - -# Construct boot1. sunlabel expects it to contain zeroed-out space for the -# label, and to be of the correct size. -${FILES}: boot1.aout - @set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \ - echo "$$x bytes available"; test $$x -ge 0 - dd if=/dev/zero of=${.TARGET} bs=512 count=16 - dd if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc - -boot1.aout: boot1.elf - elf2aout -o ${.TARGET} ${.ALLSRC} - -boot1.o: ${.CURDIR}/../../common/ufsread.c - -.include <bsd.prog.mk> diff --git a/usr/src/boot/sys/boot/sparc64/boot1/_start.s b/usr/src/boot/sys/boot/sparc64/boot1/_start.s deleted file mode 100644 index 30f8019cc8..0000000000 --- a/usr/src/boot/sys/boot/sparc64/boot1/_start.s +++ /dev/null @@ -1,8 +0,0 @@ -/* $FreeBSD$ */ - - .text - .globl _start -_start: - call ofw_init - nop - sir diff --git a/usr/src/boot/sys/boot/sparc64/boot1/boot1.c b/usr/src/boot/sys/boot/sparc64/boot1/boot1.c deleted file mode 100644 index d0b738039b..0000000000 --- a/usr/src/boot/sys/boot/sparc64/boot1/boot1.c +++ /dev/null @@ -1,751 +0,0 @@ -/*- - * Copyright (c) 1998 Robert Nordier - * All rights reserved. - * Copyright (c) 2001 Robert Drehmel - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/dirent.h> - -#include <machine/elf.h> -#include <machine/stdarg.h> - -#include "paths.h" - -#define READ_BUF_SIZE 8192 - -typedef int putc_func_t(char c, void *arg); -typedef int32_t ofwh_t; - -struct sp_data { - char *sp_buf; - u_int sp_len; - u_int sp_size; -}; - -static const char digits[] = "0123456789abcdef"; - -static char bootpath[128]; -static char bootargs[128]; - -static ofwh_t bootdev; - -static uint32_t fs_off; - -int main(int ac, char **av); -static void exit(int) __dead2; -static void usage(void); - -#ifdef ZFSBOOT -static void loadzfs(void); -static int zbread(char *buf, off_t off, size_t bytes); -#else -static void load(const char *); -#endif - -static void bcopy(const void *src, void *dst, size_t len); -static void bzero(void *b, size_t len); - -static int domount(const char *device); -static int dskread(void *buf, u_int64_t lba, int nblk); - -static void panic(const char *fmt, ...) __dead2; -static int printf(const char *fmt, ...); -static int putchar(char c, void *arg); -static int vprintf(const char *fmt, va_list ap); -static int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); - -static int __printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap); -static int __puts(const char *s, putc_func_t *putc, void *arg); -static int __sputc(char c, void *arg); -static char *__uitoa(char *buf, u_int val, int base); -static char *__ultoa(char *buf, u_long val, int base); - -/* - * Open Firmware interface functions - */ -typedef u_int64_t ofwcell_t; -typedef u_int32_t u_ofwh_t; -typedef int (*ofwfp_t)(ofwcell_t []); -static ofwfp_t ofw; /* the PROM Open Firmware entry */ - -void ofw_init(int, int, int, int, ofwfp_t); -static ofwh_t ofw_finddevice(const char *); -static ofwh_t ofw_open(const char *); -static int ofw_getprop(ofwh_t, const char *, void *, size_t); -static int ofw_read(ofwh_t, void *, size_t); -static int ofw_write(ofwh_t, const void *, size_t); -static int ofw_seek(ofwh_t, u_int64_t); -static void ofw_exit(void) __dead2; - -static ofwh_t stdinh, stdouth; - -/* - * This has to stay here, as the PROM seems to ignore the - * entry point specified in the a.out header. (or elftoaout is broken) - */ - -void -ofw_init(int d, int d1, int d2, int d3, ofwfp_t ofwaddr) -{ - ofwh_t chosenh; - char *av[16]; - char *p; - int ac; - - ofw = ofwaddr; - - chosenh = ofw_finddevice("/chosen"); - ofw_getprop(chosenh, "stdin", &stdinh, sizeof(stdinh)); - ofw_getprop(chosenh, "stdout", &stdouth, sizeof(stdouth)); - ofw_getprop(chosenh, "bootargs", bootargs, sizeof(bootargs)); - ofw_getprop(chosenh, "bootpath", bootpath, sizeof(bootpath)); - - bootargs[sizeof(bootargs) - 1] = '\0'; - bootpath[sizeof(bootpath) - 1] = '\0'; - - ac = 0; - p = bootargs; - for (;;) { - while (*p == ' ' && *p != '\0') - p++; - if (*p == '\0' || ac >= 16) - break; - av[ac++] = p; - while (*p != ' ' && *p != '\0') - p++; - if (*p != '\0') - *p++ = '\0'; - } - - exit(main(ac, av)); -} - -static ofwh_t -ofw_finddevice(const char *name) -{ - ofwcell_t args[] = { - (ofwcell_t)"finddevice", - 1, - 1, - (ofwcell_t)name, - 0 - }; - - if ((*ofw)(args)) { - printf("ofw_finddevice: name=\"%s\"\n", name); - return (1); - } - return (args[4]); -} - -static int -ofw_getprop(ofwh_t ofwh, const char *name, void *buf, size_t len) -{ - ofwcell_t args[] = { - (ofwcell_t)"getprop", - 4, - 1, - (u_ofwh_t)ofwh, - (ofwcell_t)name, - (ofwcell_t)buf, - len, - 0 - }; - - if ((*ofw)(args)) { - printf("ofw_getprop: ofwh=0x%x buf=%p len=%u\n", - ofwh, buf, len); - return (1); - } - return (0); -} - -static ofwh_t -ofw_open(const char *path) -{ - ofwcell_t args[] = { - (ofwcell_t)"open", - 1, - 1, - (ofwcell_t)path, - 0 - }; - - if ((*ofw)(args)) { - printf("ofw_open: path=\"%s\"\n", path); - return (-1); - } - return (args[4]); -} - -static int -ofw_close(ofwh_t devh) -{ - ofwcell_t args[] = { - (ofwcell_t)"close", - 1, - 0, - (u_ofwh_t)devh - }; - - if ((*ofw)(args)) { - printf("ofw_close: devh=0x%x\n", devh); - return (1); - } - return (0); -} - -static int -ofw_read(ofwh_t devh, void *buf, size_t len) -{ - ofwcell_t args[] = { - (ofwcell_t)"read", - 3, - 1, - (u_ofwh_t)devh, - (ofwcell_t)buf, - len, - 0 - }; - - if ((*ofw)(args)) { - printf("ofw_read: devh=0x%x buf=%p len=%u\n", devh, buf, len); - return (1); - } - return (0); -} - -static int -ofw_write(ofwh_t devh, const void *buf, size_t len) -{ - ofwcell_t args[] = { - (ofwcell_t)"write", - 3, - 1, - (u_ofwh_t)devh, - (ofwcell_t)buf, - len, - 0 - }; - - if ((*ofw)(args)) { - printf("ofw_write: devh=0x%x buf=%p len=%u\n", devh, buf, len); - return (1); - } - return (0); -} - -static int -ofw_seek(ofwh_t devh, u_int64_t off) -{ - ofwcell_t args[] = { - (ofwcell_t)"seek", - 3, - 1, - (u_ofwh_t)devh, - off >> 32, - off, - 0 - }; - - if ((*ofw)(args)) { - printf("ofw_seek: devh=0x%x off=0x%lx\n", devh, off); - return (1); - } - return (0); -} - -static void -ofw_exit(void) -{ - ofwcell_t args[3]; - - args[0] = (ofwcell_t)"exit"; - args[1] = 0; - args[2] = 0; - - for (;;) - (*ofw)(args); -} - -static void -bcopy(const void *src, void *dst, size_t len) -{ - const char *s = src; - char *d = dst; - - while (len-- != 0) - *d++ = *s++; -} - -static void -memcpy(void *dst, const void *src, size_t len) -{ - - bcopy(src, dst, len); -} - -static void -bzero(void *b, size_t len) -{ - char *p = b; - - while (len-- != 0) - *p++ = 0; -} - -static int -strcmp(const char *s1, const char *s2) -{ - - for (; *s1 == *s2 && *s1; s1++, s2++) - ; - return ((u_char)*s1 - (u_char)*s2); -} - -int -main(int ac, char **av) -{ - const char *path; - int i; - - path = PATH_LOADER; - for (i = 0; i < ac; i++) { - switch (av[i][0]) { - case '-': - switch (av[i][1]) { - default: - usage(); - } - break; - default: - path = av[i]; - break; - } - } - -#ifdef ZFSBOOT - printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", - bootpath); -#else - printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" - " Boot loader: %s\n", bootpath, path); -#endif - - if (domount(bootpath) == -1) - panic("domount"); - -#ifdef ZFSBOOT - loadzfs(); -#else - load(path); -#endif - return (1); -} - -static void -usage(void) -{ - - printf("usage: boot device [/path/to/loader]\n"); - exit(1); -} - -static void -exit(int code) -{ - - ofw_exit(); -} - -#ifdef ZFSBOOT - -#define VDEV_BOOT_OFFSET (2 * 256 * 1024) -static char zbuf[READ_BUF_SIZE]; - -static int -zbread(char *buf, off_t off, size_t bytes) -{ - size_t len; - off_t poff; - off_t soff; - char *p; - unsigned int nb; - unsigned int lb; - - p = buf; - soff = VDEV_BOOT_OFFSET + off; - lb = (soff + bytes + DEV_BSIZE - 1) / DEV_BSIZE; - poff = soff; - while (poff < soff + bytes) { - nb = lb - poff / DEV_BSIZE; - if (nb > READ_BUF_SIZE / DEV_BSIZE) - nb = READ_BUF_SIZE / DEV_BSIZE; - if (dskread(zbuf, poff / DEV_BSIZE, nb)) - break; - if ((poff / DEV_BSIZE + nb) * DEV_BSIZE > soff + bytes) - len = soff + bytes - poff; - else - len = (poff / DEV_BSIZE + nb) * DEV_BSIZE - poff; - memcpy(p, zbuf + poff % DEV_BSIZE, len); - p += len; - poff += len; - } - return (poff - soff); -} - -static void -loadzfs(void) -{ - Elf64_Ehdr eh; - Elf64_Phdr ph; - caddr_t p; - int i; - - if (zbread((char *)&eh, 0, sizeof(eh)) != sizeof(eh)) { - printf("Can't read elf header\n"); - return; - } - if (!IS_ELF(eh)) { - printf("Not an ELF file\n"); - return; - } - for (i = 0; i < eh.e_phnum; i++) { - fs_off = eh.e_phoff + i * eh.e_phentsize; - if (zbread((char *)&ph, fs_off, sizeof(ph)) != sizeof(ph)) { - printf("Can't read program header %d\n", i); - return; - } - if (ph.p_type != PT_LOAD) - continue; - fs_off = ph.p_offset; - p = (caddr_t)ph.p_vaddr; - if (zbread(p, fs_off, ph.p_filesz) != ph.p_filesz) { - printf("Can't read content of section %d\n", i); - return; - } - if (ph.p_filesz != ph.p_memsz) - bzero(p + ph.p_filesz, ph.p_memsz - ph.p_filesz); - } - ofw_close(bootdev); - (*(void (*)(int, int, int, int, ofwfp_t))eh.e_entry)(0, 0, 0, 0, ofw); -} - -#else - -#include "ufsread.c" - -static struct dmadat __dmadat; - -static void -load(const char *fname) -{ - Elf64_Ehdr eh; - Elf64_Phdr ph; - caddr_t p; - ufs_ino_t ino; - int i; - - if ((ino = lookup(fname)) == 0) { - printf("File %s not found\n", fname); - return; - } - if (fsread(ino, &eh, sizeof(eh)) != sizeof(eh)) { - printf("Can't read elf header\n"); - return; - } - if (!IS_ELF(eh)) { - printf("Not an ELF file\n"); - return; - } - for (i = 0; i < eh.e_phnum; i++) { - fs_off = eh.e_phoff + i * eh.e_phentsize; - if (fsread(ino, &ph, sizeof(ph)) != sizeof(ph)) { - printf("Can't read program header %d\n", i); - return; - } - if (ph.p_type != PT_LOAD) - continue; - fs_off = ph.p_offset; - p = (caddr_t)ph.p_vaddr; - if (fsread(ino, p, ph.p_filesz) != ph.p_filesz) { - printf("Can't read content of section %d\n", i); - return; - } - if (ph.p_filesz != ph.p_memsz) - bzero(p + ph.p_filesz, ph.p_memsz - ph.p_filesz); - } - ofw_close(bootdev); - (*(void (*)(int, int, int, int, ofwfp_t))eh.e_entry)(0, 0, 0, 0, ofw); -} - -#endif /* ZFSBOOT */ - -static int -domount(const char *device) -{ - - if ((bootdev = ofw_open(device)) == -1) { - printf("domount: can't open device\n"); - return (-1); - } -#ifndef ZFSBOOT - dmadat = &__dmadat; - if (fsread(0, NULL, 0)) { - printf("domount: can't read superblock\n"); - return (-1); - } -#endif - return (0); -} - -static int -dskread(void *buf, u_int64_t lba, int nblk) -{ - - /* - * The Open Firmware should open the correct partition for us. - * That means, if we read from offset zero on an open instance handle, - * we should read from offset zero of that partition. - */ - ofw_seek(bootdev, lba * DEV_BSIZE); - ofw_read(bootdev, buf, nblk * DEV_BSIZE); - return (0); -} - -static void -panic(const char *fmt, ...) -{ - char buf[128]; - va_list ap; - - va_start(ap, fmt); - vsnprintf(buf, sizeof buf, fmt, ap); - printf("panic: %s\n", buf); - va_end(ap); - - exit(1); -} - -static int -printf(const char *fmt, ...) -{ - va_list ap; - int ret; - - va_start(ap, fmt); - ret = vprintf(fmt, ap); - va_end(ap); - return (ret); -} - -static int -putchar(char c, void *arg) -{ - char buf; - - if (c == '\n') { - buf = '\r'; - ofw_write(stdouth, &buf, 1); - } - buf = c; - ofw_write(stdouth, &buf, 1); - return (1); -} - -static int -vprintf(const char *fmt, va_list ap) -{ - int ret; - - ret = __printf(fmt, putchar, 0, ap); - return (ret); -} - -static int -vsnprintf(char *str, size_t sz, const char *fmt, va_list ap) -{ - struct sp_data sp; - int ret; - - sp.sp_buf = str; - sp.sp_len = 0; - sp.sp_size = sz; - ret = __printf(fmt, __sputc, &sp, ap); - return (ret); -} - -static int -__printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap) -{ - char buf[(sizeof(long) * 8) + 1]; - char *nbuf; - u_long ul; - u_int ui; - int lflag; - int sflag; - char *s; - int pad; - int ret; - int c; - - nbuf = &buf[sizeof buf - 1]; - ret = 0; - while ((c = *fmt++) != 0) { - if (c != '%') { - ret += putc(c, arg); - continue; - } - lflag = 0; - sflag = 0; - pad = 0; -reswitch: c = *fmt++; - switch (c) { - case '#': - sflag = 1; - goto reswitch; - case '%': - ret += putc('%', arg); - break; - case 'c': - c = va_arg(ap, int); - ret += putc(c, arg); - break; - case 'd': - if (lflag == 0) { - ui = (u_int)va_arg(ap, int); - if (ui < (int)ui) { - ui = -ui; - ret += putc('-', arg); - } - s = __uitoa(nbuf, ui, 10); - } else { - ul = (u_long)va_arg(ap, long); - if (ul < (long)ul) { - ul = -ul; - ret += putc('-', arg); - } - s = __ultoa(nbuf, ul, 10); - } - ret += __puts(s, putc, arg); - break; - case 'l': - lflag = 1; - goto reswitch; - case 'o': - if (lflag == 0) { - ui = (u_int)va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 8); - } else { - ul = (u_long)va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 8); - } - ret += __puts(s, putc, arg); - break; - case 'p': - ul = (u_long)va_arg(ap, void *); - s = __ultoa(nbuf, ul, 16); - ret += __puts("0x", putc, arg); - ret += __puts(s, putc, arg); - break; - case 's': - s = va_arg(ap, char *); - ret += __puts(s, putc, arg); - break; - case 'u': - if (lflag == 0) { - ui = va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 10); - } else { - ul = va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 10); - } - ret += __puts(s, putc, arg); - break; - case 'x': - if (lflag == 0) { - ui = va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 16); - } else { - ul = va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 16); - } - if (sflag) - ret += __puts("0x", putc, arg); - ret += __puts(s, putc, arg); - break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - pad = pad * 10 + c - '0'; - goto reswitch; - default: - break; - } - } - return (ret); -} - -static int -__sputc(char c, void *arg) -{ - struct sp_data *sp; - - sp = arg; - if (sp->sp_len < sp->sp_size) - sp->sp_buf[sp->sp_len++] = c; - sp->sp_buf[sp->sp_len] = '\0'; - return (1); -} - -static int -__puts(const char *s, putc_func_t *putc, void *arg) -{ - const char *p; - int ret; - - ret = 0; - for (p = s; *p != '\0'; p++) - ret += putc(*p, arg); - return (ret); -} - -static char * -__uitoa(char *buf, u_int ui, int base) -{ - char *p; - - p = buf; - *p = '\0'; - do - *--p = digits[ui % base]; - while ((ui /= base) != 0); - return (p); -} - -static char * -__ultoa(char *buf, u_long ul, int base) -{ - char *p; - - p = buf; - *p = '\0'; - do - *--p = digits[ul % base]; - while ((ul /= base) != 0); - return (p); -} diff --git a/usr/src/boot/sys/boot/sparc64/loader/Makefile b/usr/src/boot/sys/boot/sparc64/loader/Makefile deleted file mode 100644 index b3988284ea..0000000000 --- a/usr/src/boot/sys/boot/sparc64/loader/Makefile +++ /dev/null @@ -1,96 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> -MK_SSP= no -MAN= - -PROG?= loader -NEWVERSWHAT?= "ZFS enabled bootstrap loader" sparc64 -INSTALLFLAGS= -b - -# Architecture-specific loader code -SRCS= locore.S main.c metadata.c vers.c - -LOADER_DISK_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= yes -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= yes -LOADER_GZIP_SUPPORT?= yes -LOADER_BZIP2_SUPPORT?= no -LOADER_DEBUG?= no - -.if ${LOADER_DEBUG} == "yes" -CFLAGS+= -DLOADER_DEBUG -.endif -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -CFLAGS+= -I${.CURDIR}/../../zfs -CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs -LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif - -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/sparc64 -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - -# Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -CFLAGS+= -I. - -CLEANFILES+= vers.c loader.help - -LDFLAGS= -static - -# Open Firmware standalone support library -LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a -CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ - -# where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ - -DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand - -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ - ${NEWVERSWHAT} - -loader.help: help.common help.sparc64 - cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} - -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" - -FILES+= loader.rc menu.rc - -.include <bsd.prog.mk> diff --git a/usr/src/boot/sys/boot/sparc64/loader/help.sparc64 b/usr/src/boot/sys/boot/sparc64/loader/help.sparc64 deleted file mode 100644 index e69de29bb2..0000000000 --- a/usr/src/boot/sys/boot/sparc64/loader/help.sparc64 +++ /dev/null diff --git a/usr/src/boot/sys/boot/sparc64/loader/locore.S b/usr/src/boot/sys/boot/sparc64/loader/locore.S deleted file mode 100644 index a73f5bfa7f..0000000000 --- a/usr/src/boot/sys/boot/sparc64/loader/locore.S +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * Initial implementation: - * Copyright (c) 2001 Robert Drehmel - * All rights reserved. - * - * As long as the above copyright statement and this notice remain - * unchanged, you can do what ever you want with this file. - */ - -#include <machine/asm.h> -__FBSDID("$FreeBSD$"); - -#define LOCORE - -#include <machine/frame.h> -#include <machine/fsr.h> -#include <machine/intr_machdep.h> -#include <machine/pstate.h> - -#define PAGE_SIZE 8192 -#define PAGE_SHIFT 13 - -#define STACK_SIZE (2 * PAGE_SIZE) - -ENTRY(_start) - /* Limit interrupts. */ - wrpr %g0, PIL_TICK - 1, %pil - - /* - * PSTATE: privileged, interrupts enabled, floating point - * unit enabled - */ - wrpr %g0, PSTATE_PRIV | PSTATE_IE | PSTATE_PEF, %pstate - wr %g0, FPRS_FEF, %fprs - - setx stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6 - mov %l6, %sp - call main - mov %o4, %o0 - sir - - .comm stack, STACK_SIZE, 32 diff --git a/usr/src/boot/sys/boot/sparc64/loader/main.c b/usr/src/boot/sys/boot/sparc64/loader/main.c deleted file mode 100644 index e81976c61c..0000000000 --- a/usr/src/boot/sys/boot/sparc64/loader/main.c +++ /dev/null @@ -1,974 +0,0 @@ -/* - * Initial implementation: - * Copyright (c) 2001 Robert Drehmel - * All rights reserved. - * - * As long as the above copyright statement and this notice remain - * unchanged, you can do what ever you want with this file. - */ -/* - * Copyright (c) 2008 - 2012 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -/* - * FreeBSD/sparc64 kernel loader - machine dependent part - * - * - implements copyin and readin functions that map kernel - * pages on demand. The machine independent code does not - * know the size of the kernel early enough to pre-enter - * TTEs and install just one 4MB mapping seemed to limiting - * to me. - */ - -#include <stand.h> -#include <sys/param.h> -#include <sys/exec.h> -#include <sys/linker.h> -#include <sys/queue.h> -#include <sys/types.h> -#include <sys/vtoc.h> -#include "libzfs.h" - -#include <vm/vm.h> -#include <machine/asi.h> -#include <machine/cmt.h> -#include <machine/cpufunc.h> -#include <machine/elf.h> -#include <machine/fireplane.h> -#include <machine/jbus.h> -#include <machine/lsu.h> -#include <machine/metadata.h> -#include <machine/tte.h> -#include <machine/tlb.h> -#include <machine/upa.h> -#include <machine/ver.h> -#include <machine/vmparam.h> - -#include "bootstrap.h" -#include "libofw.h" -#include "dev_net.h" - -enum { - HEAPVA = 0x800000, - HEAPSZ = 0x1000000, - LOADSZ = 0x1000000 /* for kernel and modules */ -}; - -/* At least Sun Fire V1280 require page sized allocations to be claimed. */ -CTASSERT(HEAPSZ % PAGE_SIZE == 0); - -static struct mmu_ops { - void (*tlb_init)(void); - int (*mmu_mapin)(vm_offset_t va, vm_size_t len); -} *mmu_ops; - -typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, - void *openfirmware); - -static inline u_long dtlb_get_data_sun4u(u_int, u_int); -static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); -static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(u_int, u_int); -static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); -static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); -static void itlb_relocate_locked0_sun4u(void); -extern vm_offset_t md_load(char *, vm_offset_t *, vm_offset_t *); -static int sparc64_autoload(void); -static ssize_t sparc64_readin(const int, vm_offset_t, const size_t); -static ssize_t sparc64_copyin(const void *, vm_offset_t, size_t); -static vm_offset_t claim_virt(vm_offset_t, size_t, int); -static vm_offset_t alloc_phys(size_t, int); -static int map_phys(int, size_t, vm_offset_t, vm_offset_t); -static void release_phys(vm_offset_t, u_int); -static int __elfN(exec)(struct preloaded_file *); -static int mmu_mapin_sun4u(vm_offset_t, vm_size_t); -static vm_offset_t init_heap(void); -static phandle_t find_bsp_sun4u(phandle_t, uint32_t); -const char *cpu_cpuid_prop_sun4u(void); -uint32_t cpu_get_mid_sun4u(void); -static void tlb_init_sun4u(void); - -#ifdef LOADER_DEBUG -typedef u_int64_t tte_t; - -static void pmap_print_tlb_sun4u(void); -static void pmap_print_tte_sun4u(tte_t, tte_t); -#endif - -static struct mmu_ops mmu_ops_sun4u = { tlb_init_sun4u, mmu_mapin_sun4u }; - -/* sun4u */ -struct tlb_entry *dtlb_store; -struct tlb_entry *itlb_store; -u_int dtlb_slot; -u_int itlb_slot; -static int cpu_impl; -static u_int dtlb_slot_max; -static u_int itlb_slot_max; -static u_int tlb_locked; - -static vm_offset_t curkva = 0; -static vm_offset_t heapva; - -static char bootpath[64]; -static phandle_t root; - -static struct zfs_devdesc zfs_currdev; - -/* - * Machine dependent structures that the machine independent - * loader part uses. - */ -struct devsw *devsw[] = { -#ifdef LOADER_DISK_SUPPORT - &ofwdisk, -#endif -#ifdef LOADER_NET_SUPPORT - &netdev, -#endif - &zfs_dev, - NULL -}; - -struct arch_switch archsw; - -static struct file_format sparc64_elf = { - __elfN(loadfile), - __elfN(exec) -}; - -struct file_format *file_formats[] = { - &sparc64_elf, - NULL -}; - -struct fs_ops *file_system[] = { - &zfs_fsops, -#ifdef LOADER_UFS_SUPPORT - &ufs_fsops, -#endif -#ifdef LOADER_CD9660_SUPPORT - &cd9660_fsops, -#endif -#ifdef LOADER_ZIP_SUPPORT - &zipfs_fsops, -#endif -#ifdef LOADER_GZIP_SUPPORT - &gzipfs_fsops, -#endif -#ifdef LOADER_BZIP2_SUPPORT - &bzipfs_fsops, -#endif -#ifdef LOADER_NFS_SUPPORT - &nfs_fsops, -#endif -#ifdef LOADER_TFTP_SUPPORT - &tftp_fsops, -#endif - NULL -}; - -struct netif_driver *netif_drivers[] = { -#ifdef LOADER_NET_SUPPORT - &ofwnet, -#endif - NULL -}; - -extern struct console ofwconsole; -struct console *consoles[] = { - &ofwconsole, - NULL -}; - -#ifdef LOADER_DEBUG -static int -watch_phys_set_mask(vm_offset_t pa, u_long mask) -{ - u_long lsucr; - - stxa(AA_DMMU_PWPR, ASI_DMMU, pa & (((2UL << 38) - 1) << 3)); - lsucr = ldxa(0, ASI_LSU_CTL_REG); - lsucr = ((lsucr | LSU_PW) & ~LSU_PM_MASK) | - (mask << LSU_PM_SHIFT); - stxa(0, ASI_LSU_CTL_REG, lsucr); - return (0); -} - -static int -watch_phys_set(vm_offset_t pa, int sz) -{ - u_long off; - - off = (u_long)pa & 7; - /* Test for misaligned watch points. */ - if (off + sz > 8) - return (-1); - return (watch_phys_set_mask(pa, ((1 << sz) - 1) << off)); -} - - -static int -watch_virt_set_mask(vm_offset_t va, u_long mask) -{ - u_long lsucr; - - stxa(AA_DMMU_VWPR, ASI_DMMU, va & (((2UL << 41) - 1) << 3)); - lsucr = ldxa(0, ASI_LSU_CTL_REG); - lsucr = ((lsucr | LSU_VW) & ~LSU_VM_MASK) | - (mask << LSU_VM_SHIFT); - stxa(0, ASI_LSU_CTL_REG, lsucr); - return (0); -} - -static int -watch_virt_set(vm_offset_t va, int sz) -{ - u_long off; - - off = (u_long)va & 7; - /* Test for misaligned watch points. */ - if (off + sz > 8) - return (-1); - return (watch_virt_set_mask(va, ((1 << sz) - 1) << off)); -} -#endif - -/* - * archsw functions - */ -static int -sparc64_autoload(void) -{ - - return (0); -} - -static ssize_t -sparc64_readin(const int fd, vm_offset_t va, const size_t len) -{ - - mmu_ops->mmu_mapin(va, len); - return (read(fd, (void *)va, len)); -} - -static ssize_t -sparc64_copyin(const void *src, vm_offset_t dest, size_t len) -{ - - mmu_ops->mmu_mapin(dest, len); - memcpy((void *)dest, src, len); - return (len); -} - -/* - * other MD functions - */ -static vm_offset_t -claim_virt(vm_offset_t virt, size_t size, int align) -{ - vm_offset_t mva; - - if (OF_call_method("claim", mmu, 3, 1, virt, size, align, &mva) == -1) - return ((vm_offset_t)-1); - return (mva); -} - -static vm_offset_t -alloc_phys(size_t size, int align) -{ - cell_t phys_hi, phys_low; - - if (OF_call_method("claim", memory, 2, 2, size, align, &phys_low, - &phys_hi) == -1) - return ((vm_offset_t)-1); - return ((vm_offset_t)phys_hi << 32 | phys_low); -} - -static int -map_phys(int mode, size_t size, vm_offset_t virt, vm_offset_t phys) -{ - - return (OF_call_method("map", mmu, 5, 0, (uint32_t)phys, - (uint32_t)(phys >> 32), virt, size, mode)); -} - -static void -release_phys(vm_offset_t phys, u_int size) -{ - - (void)OF_call_method("release", memory, 3, 0, (uint32_t)phys, - (uint32_t)(phys >> 32), size); -} - -static int -__elfN(exec)(struct preloaded_file *fp) -{ - struct file_metadata *fmp; - vm_offset_t mdp, dtbp; - Elf_Addr entry; - Elf_Ehdr *e; - int error; - - if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == 0) - return (EFTYPE); - e = (Elf_Ehdr *)&fmp->md_data; - - if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0) - return (error); - - printf("jumping to kernel entry at %#lx.\n", e->e_entry); -#ifdef LOADER_DEBUG - pmap_print_tlb_sun4u(); -#endif - - dev_cleanup(); - - entry = e->e_entry; - - OF_release((void *)heapva, HEAPSZ); - - ((kernel_entry_t *)entry)(mdp, 0, 0, 0, openfirmware); - - panic("%s: exec returned", __func__); -} - -static inline u_long -dtlb_get_data_sun4u(u_int tlb, u_int slot) -{ - u_long data, pstate; - - slot = TLB_DAR_SLOT(tlb, slot); - /* - * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to - * work around errata of USIII and beyond. - */ - pstate = rdpr(pstate); - wrpr(pstate, pstate & ~PSTATE_IE, 0); - (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); - data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); - wrpr(pstate, pstate, 0); - return (data); -} - -static inline u_long -itlb_get_data_sun4u(u_int tlb, u_int slot) -{ - u_long data, pstate; - - slot = TLB_DAR_SLOT(tlb, slot); - /* - * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to - * work around errata of USIII and beyond. - */ - pstate = rdpr(pstate); - wrpr(pstate, pstate & ~PSTATE_IE, 0); - (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); - data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); - wrpr(pstate, pstate, 0); - return (data); -} - -static vm_offset_t -dtlb_va_to_pa_sun4u(vm_offset_t va) -{ - u_long pstate, reg; - u_int i, tlb; - - pstate = rdpr(pstate); - wrpr(pstate, pstate & ~PSTATE_IE, 0); - for (i = 0; i < dtlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), - ASI_DTLB_TAG_READ_REG); - if (TLB_TAR_VA(reg) != va) - continue; - reg = dtlb_get_data_sun4u(tlb_locked, i); - wrpr(pstate, pstate, 0); - reg >>= TD_PA_SHIFT; - if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIII) - return (reg & TD_PA_CH_MASK); - return (reg & TD_PA_SF_MASK); - } - wrpr(pstate, pstate, 0); - return (-1); -} - -static vm_offset_t -itlb_va_to_pa_sun4u(vm_offset_t va) -{ - u_long pstate, reg; - int i; - - pstate = rdpr(pstate); - wrpr(pstate, pstate & ~PSTATE_IE, 0); - for (i = 0; i < itlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), - ASI_ITLB_TAG_READ_REG); - if (TLB_TAR_VA(reg) != va) - continue; - reg = itlb_get_data_sun4u(tlb_locked, i); - wrpr(pstate, pstate, 0); - reg >>= TD_PA_SHIFT; - if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIII) - return (reg & TD_PA_CH_MASK); - return (reg & TD_PA_SF_MASK); - } - wrpr(pstate, pstate, 0); - return (-1); -} - -static int -dtlb_enter_sun4u(u_int index, u_long data, vm_offset_t virt) -{ - - return (OF_call_method("SUNW,dtlb-load", mmu, 3, 0, index, data, - virt)); -} - -static int -itlb_enter_sun4u(u_int index, u_long data, vm_offset_t virt) -{ - - if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp && index == 0 && - (data & TD_L) != 0) - panic("%s: won't enter locked TLB entry at index 0 on USIII+", - __func__); - return (OF_call_method("SUNW,itlb-load", mmu, 3, 0, index, data, - virt)); -} - -static void -itlb_relocate_locked0_sun4u(void) -{ - u_long data, pstate, tag; - int i; - - if (cpu_impl != CPU_IMPL_ULTRASPARCIIIp) - return; - - pstate = rdpr(pstate); - wrpr(pstate, pstate & ~PSTATE_IE, 0); - - data = itlb_get_data_sun4u(tlb_locked, 0); - if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) { - wrpr(pstate, pstate, 0); - return; - } - - /* Flush the mapping of slot 0. */ - tag = ldxa(TLB_DAR_SLOT(tlb_locked, 0), ASI_ITLB_TAG_READ_REG); - stxa(TLB_DEMAP_VA(TLB_TAR_VA(tag)) | TLB_DEMAP_PRIMARY | - TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0); - flush(0); /* The USIII-family ignores the address. */ - - /* - * Search a replacement slot != 0 and enter the data and tag - * that formerly were in slot 0. - */ - for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(tlb_locked, i) & TD_V) != 0) - continue; - - stxa(AA_IMMU_TAR, ASI_IMMU, tag); - stxa(TLB_DAR_SLOT(tlb_locked, i), ASI_ITLB_DATA_ACCESS_REG, - data); - flush(0); /* The USIII-family ignores the address. */ - break; - } - wrpr(pstate, pstate, 0); - if (i == itlb_slot_max) - panic("%s: could not find a replacement slot", __func__); -} - -static int -mmu_mapin_sun4u(vm_offset_t va, vm_size_t len) -{ - vm_offset_t pa, mva; - u_long data; - u_int index; - - if (va + len > curkva) - curkva = va + len; - - pa = (vm_offset_t)-1; - len += va & PAGE_MASK_4M; - va &= ~PAGE_MASK_4M; - while (len) { - if (dtlb_va_to_pa_sun4u(va) == (vm_offset_t)-1 || - itlb_va_to_pa_sun4u(va) == (vm_offset_t)-1) { - /* Allocate a physical page, claim the virtual area. */ - if (pa == (vm_offset_t)-1) { - pa = alloc_phys(PAGE_SIZE_4M, PAGE_SIZE_4M); - if (pa == (vm_offset_t)-1) - panic("%s: out of memory", __func__); - mva = claim_virt(va, PAGE_SIZE_4M, 0); - if (mva != va) - panic("%s: can't claim virtual page " - "(wanted %#lx, got %#lx)", - __func__, va, mva); - /* - * The mappings may have changed, be paranoid. - */ - continue; - } - /* - * Actually, we can only allocate two pages less at - * most (depending on the kernel TSB size). - */ - if (dtlb_slot >= dtlb_slot_max) - panic("%s: out of dtlb_slots", __func__); - if (itlb_slot >= itlb_slot_max) - panic("%s: out of itlb_slots", __func__); - data = TD_V | TD_4M | TD_PA(pa) | TD_L | TD_CP | - TD_CV | TD_P | TD_W; - dtlb_store[dtlb_slot].te_pa = pa; - dtlb_store[dtlb_slot].te_va = va; - index = dtlb_slot_max - dtlb_slot - 1; - if (dtlb_enter_sun4u(index, data, va) < 0) - panic("%s: can't enter dTLB slot %d data " - "%#lx va %#lx", __func__, index, data, - va); - dtlb_slot++; - itlb_store[itlb_slot].te_pa = pa; - itlb_store[itlb_slot].te_va = va; - index = itlb_slot_max - itlb_slot - 1; - if (itlb_enter_sun4u(index, data, va) < 0) - panic("%s: can't enter iTLB slot %d data " - "%#lx va %#lxd", __func__, index, data, - va); - itlb_slot++; - pa = (vm_offset_t)-1; - } - len -= len > PAGE_SIZE_4M ? PAGE_SIZE_4M : len; - va += PAGE_SIZE_4M; - } - if (pa != (vm_offset_t)-1) - release_phys(pa, PAGE_SIZE_4M); - return (0); -} - -static vm_offset_t -init_heap(void) -{ - - /* There is no need for continuous physical heap memory. */ - heapva = (vm_offset_t)OF_claim((void *)HEAPVA, HEAPSZ, 32); - return (heapva); -} - -static phandle_t -find_bsp_sun4u(phandle_t node, uint32_t bspid) -{ - char type[sizeof("cpu")]; - phandle_t child; - uint32_t cpuid; - - for (; node > 0; node = OF_peer(node)) { - child = OF_child(node); - if (child > 0) { - child = find_bsp_sun4u(child, bspid); - if (child > 0) - return (child); - } else { - if (OF_getprop(node, "device_type", type, - sizeof(type)) <= 0) - continue; - if (strcmp(type, "cpu") != 0) - continue; - if (OF_getprop(node, cpu_cpuid_prop_sun4u(), &cpuid, - sizeof(cpuid)) <= 0) - continue; - if (cpuid == bspid) - return (node); - } - } - return (0); -} - -const char * -cpu_cpuid_prop_sun4u(void) -{ - - switch (cpu_impl) { - case CPU_IMPL_SPARC64: - case CPU_IMPL_SPARC64V: - case CPU_IMPL_ULTRASPARCI: - case CPU_IMPL_ULTRASPARCII: - case CPU_IMPL_ULTRASPARCIIi: - case CPU_IMPL_ULTRASPARCIIe: - return ("upa-portid"); - case CPU_IMPL_ULTRASPARCIII: - case CPU_IMPL_ULTRASPARCIIIp: - case CPU_IMPL_ULTRASPARCIIIi: - case CPU_IMPL_ULTRASPARCIIIip: - return ("portid"); - case CPU_IMPL_ULTRASPARCIV: - case CPU_IMPL_ULTRASPARCIVp: - return ("cpuid"); - default: - return (""); - } -} - -uint32_t -cpu_get_mid_sun4u(void) -{ - - switch (cpu_impl) { - case CPU_IMPL_SPARC64: - case CPU_IMPL_SPARC64V: - case CPU_IMPL_ULTRASPARCI: - case CPU_IMPL_ULTRASPARCII: - case CPU_IMPL_ULTRASPARCIIi: - case CPU_IMPL_ULTRASPARCIIe: - return (UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG))); - case CPU_IMPL_ULTRASPARCIII: - case CPU_IMPL_ULTRASPARCIIIp: - return (FIREPLANE_CR_GET_AID(ldxa(AA_FIREPLANE_CONFIG, - ASI_FIREPLANE_CONFIG_REG))); - case CPU_IMPL_ULTRASPARCIIIi: - case CPU_IMPL_ULTRASPARCIIIip: - return (JBUS_CR_GET_JID(ldxa(0, ASI_JBUS_CONFIG_REG))); - case CPU_IMPL_ULTRASPARCIV: - case CPU_IMPL_ULTRASPARCIVp: - return (INTR_ID_GET_ID(ldxa(AA_INTR_ID, ASI_INTR_ID))); - default: - return (0); - } -} - -static void -tlb_init_sun4u(void) -{ - phandle_t bsp; - - cpu_impl = VER_IMPL(rdpr(ver)); - switch (cpu_impl) { - case CPU_IMPL_SPARC64: - case CPU_IMPL_ULTRASPARCI: - case CPU_IMPL_ULTRASPARCII: - case CPU_IMPL_ULTRASPARCIIi: - case CPU_IMPL_ULTRASPARCIIe: - tlb_locked = TLB_DAR_T32; - break; - case CPU_IMPL_ULTRASPARCIII: - case CPU_IMPL_ULTRASPARCIIIp: - case CPU_IMPL_ULTRASPARCIIIi: - case CPU_IMPL_ULTRASPARCIIIip: - case CPU_IMPL_ULTRASPARCIV: - case CPU_IMPL_ULTRASPARCIVp: - tlb_locked = TLB_DAR_T16; - break; - case CPU_IMPL_SPARC64V: - tlb_locked = TLB_DAR_FTLB; - break; - } - bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); - if (bsp == 0) - panic("%s: no node for bootcpu?!?!", __func__); - - if (OF_getprop(bsp, "#dtlb-entries", &dtlb_slot_max, - sizeof(dtlb_slot_max)) == -1 || - OF_getprop(bsp, "#itlb-entries", &itlb_slot_max, - sizeof(itlb_slot_max)) == -1) - panic("%s: can't get TLB slot max.", __func__); - - if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp) { -#ifdef LOADER_DEBUG - printf("pre fixup:\n"); - pmap_print_tlb_sun4u(); -#endif - - /* - * Relocate the locked entry in it16 slot 0 (if existent) - * as part of working around Cheetah+ erratum 34. - */ - itlb_relocate_locked0_sun4u(); - -#ifdef LOADER_DEBUG - printf("post fixup:\n"); - pmap_print_tlb_sun4u(); -#endif - } - - dtlb_store = malloc(dtlb_slot_max * sizeof(*dtlb_store)); - itlb_store = malloc(itlb_slot_max * sizeof(*itlb_store)); - if (dtlb_store == NULL || itlb_store == NULL) - panic("%s: can't allocate TLB store", __func__); -} - -static void -sparc64_zfs_probe(void) -{ - struct vtoc8 vtoc; - char alias[64], devname[sizeof(alias) + sizeof(":x") - 1]; - char type[sizeof("device_type")]; - char *bdev, *dev, *odev; - uint64_t guid; - int fd, len, part; - phandle_t aliases, options; - - /* Get the GUID of the ZFS pool on the boot device. */ - guid = 0; - zfs_probe_dev(bootpath, &guid); - - /* - * Get the GUIDs of the ZFS pools on any additional disks listed in - * the boot-device environment variable. - */ - if ((aliases = OF_finddevice("/aliases")) == -1) - goto out; - options = OF_finddevice("/options"); - len = OF_getproplen(options, "boot-device"); - if (len <= 0) - goto out; - bdev = odev = malloc(len + 1); - if (bdev == NULL) - goto out; - if (OF_getprop(options, "boot-device", bdev, len) <= 0) - goto out; - bdev[len] = '\0'; - while ((dev = strsep(&bdev, " ")) != NULL) { - if (*dev == '\0') - continue; - strcpy(alias, dev); - (void)OF_getprop(aliases, dev, alias, sizeof(alias)); - /* - * Don't probe the boot disk twice. Note that bootpath - * includes the partition specifier. - */ - if (strncmp(alias, bootpath, strlen(alias)) == 0) - continue; - if (OF_getprop(OF_finddevice(alias), "device_type", type, - sizeof(type)) == -1) - continue; - if (strcmp(type, "block") != 0) - continue; - - /* Find freebsd-zfs slices in the VTOC. */ - fd = open(alias, O_RDONLY); - if (fd == -1) - continue; - lseek(fd, 0, SEEK_SET); - if (read(fd, &vtoc, sizeof(vtoc)) != sizeof(vtoc)) { - close(fd); - continue; - } - close(fd); - - for (part = 0; part < 8; part++) { - if (part == 2 || vtoc.part[part].tag != - VTOC_TAG_FREEBSD_ZFS) - continue; - (void)sprintf(devname, "%s:%c", alias, part + 'a'); - if (zfs_probe_dev(devname, NULL) == ENXIO) - break; - } - } - free(odev); - - out: - if (guid != 0) { - zfs_currdev.pool_guid = guid; - zfs_currdev.root_guid = 0; - zfs_currdev.dd.d_dev = &zfs_dev; - } -} - -int -main(int (*openfirm)(void *)) -{ - char compatible[32]; - struct devsw **dp; - - /* - * Tell the Open Firmware functions where they find the OFW gate. - */ - OF_init(openfirm); - - archsw.arch_getdev = ofw_getdev; - archsw.arch_copyin = sparc64_copyin; - archsw.arch_copyout = ofw_copyout; - archsw.arch_readin = sparc64_readin; - archsw.arch_autoload = sparc64_autoload; - archsw.arch_zfs_probe = sparc64_zfs_probe; - - if (init_heap() == (vm_offset_t)-1) - OF_exit(); - setheap((void *)heapva, (void *)(heapva + HEAPSZ)); - - /* - * Probe for a console. - */ - cons_probe(); - - if ((root = OF_peer(0)) == -1) - panic("%s: can't get root phandle", __func__); - OF_getprop(root, "compatible", compatible, sizeof(compatible)); - mmu_ops = &mmu_ops_sun4u; - - mmu_ops->tlb_init(); - - /* - * Set up the current device. - */ - OF_getprop(chosen, "bootpath", bootpath, sizeof(bootpath)); - - /* - * Initialize devices. - */ - for (dp = devsw; *dp != 0; dp++) - if ((*dp)->dv_init != 0) - (*dp)->dv_init(); - - if (zfs_currdev.pool_guid != 0) { - (void)strncpy(bootpath, zfs_fmtdev(&zfs_currdev), - sizeof(bootpath) - 1); - bootpath[sizeof(bootpath) - 1] = '\0'; - } else - - /* - * Sun compatible bootable CD-ROMs have a disk label placed before - * the ISO 9660 data, with the actual file system being in the first - * partition, while the other partitions contain pseudo disk labels - * with embedded boot blocks for different architectures, which may - * be followed by UFS file systems. - * The firmware will set the boot path to the partition it boots from - * ('f' in the sun4u/sun4v case), but we want the kernel to be loaded - * from the ISO 9660 file system ('a'), so the boot path needs to be - * altered. - */ - if (bootpath[strlen(bootpath) - 2] == ':' && - bootpath[strlen(bootpath) - 1] == 'f') - bootpath[strlen(bootpath) - 1] = 'a'; - - env_setenv("currdev", EV_VOLATILE, bootpath, - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, bootpath, - env_noset, env_nounset); - - printf("\n%s", bootprog_info); - printf("bootpath=\"%s\"\n", bootpath); - - /* Give control to the machine independent loader code. */ - interact(NULL); - return (1); -} - -COMMAND_SET(heap, "heap", "show heap usage", command_heap); - -static int -command_heap(int argc, char *argv[]) -{ - - mallocstats(); - printf("heap base at %p, top at %p, upper limit at %p\n", heapva, - sbrk(0), heapva + HEAPSZ); - return(CMD_OK); -} - -COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); - -static int -command_reboot(int argc, char *argv[]) -{ - int i; - - for (i = 0; devsw[i] != NULL; ++i) - if (devsw[i]->dv_cleanup != NULL) - (devsw[i]->dv_cleanup)(); - - printf("Rebooting...\n"); - OF_exit(); -} - -/* provide this for panic, as it's not in the startup code */ -void -exit(int code) -{ - - OF_exit(); -} - -#ifdef LOADER_DEBUG -static const char *const page_sizes[] = { - " 8k", " 64k", "512k", " 4m" -}; - -static void -pmap_print_tte_sun4u(tte_t tag, tte_t tte) -{ - - printf("%s %s ", - page_sizes[(tte >> TD_SIZE_SHIFT) & TD_SIZE_MASK], - tag & TD_G ? "G" : " "); - printf(tte & TD_W ? "W " : " "); - printf(tte & TD_P ? "\e[33mP\e[0m " : " "); - printf(tte & TD_E ? "E " : " "); - printf(tte & TD_CV ? "CV " : " "); - printf(tte & TD_CP ? "CP " : " "); - printf(tte & TD_L ? "\e[32mL\e[0m " : " "); - printf(tte & TD_IE ? "IE " : " "); - printf(tte & TD_NFO ? "NFO " : " "); - printf("pa=0x%lx va=0x%lx ctx=%ld\n", - TD_PA(tte), TLB_TAR_VA(tag), TLB_TAR_CTX(tag)); -} - -static void -pmap_print_tlb_sun4u(void) -{ - tte_t tag, tte; - u_long pstate; - int i; - - pstate = rdpr(pstate); - for (i = 0; i < itlb_slot_max; i++) { - wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = itlb_get_data_sun4u(tlb_locked, i); - wrpr(pstate, pstate, 0); - if (!(tte & TD_V)) - continue; - tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), - ASI_ITLB_TAG_READ_REG); - printf("iTLB-%2u: ", i); - pmap_print_tte_sun4u(tag, tte); - } - for (i = 0; i < dtlb_slot_max; i++) { - wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = dtlb_get_data_sun4u(tlb_locked, i); - wrpr(pstate, pstate, 0); - if (!(tte & TD_V)) - continue; - tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), - ASI_DTLB_TAG_READ_REG); - printf("dTLB-%2u: ", i); - pmap_print_tte_sun4u(tag, tte); - } -} -#endif diff --git a/usr/src/boot/sys/boot/sparc64/loader/metadata.c b/usr/src/boot/sys/boot/sparc64/loader/metadata.c deleted file mode 100644 index a3b3eb5ced..0000000000 --- a/usr/src/boot/sys/boot/sparc64/loader/metadata.c +++ /dev/null @@ -1,345 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: FreeBSD: src/sys/boot/i386/libi386/bootinfo.c,v 1.29 - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include <sys/param.h> -#include <sys/reboot.h> -#include <sys/linker.h> -#include <sys/boot.h> - -#include <machine/metadata.h> - -#include "bootstrap.h" -#include "libofw.h" - -extern struct tlb_entry *dtlb_store; -extern struct tlb_entry *itlb_store; - -extern int dtlb_slot; -extern int itlb_slot; - -static int md_bootserial(void); - -int -md_getboothowto(char *kargs) -{ - char *cp; - int howto; - int active; - int i; - - /* Parse kargs */ - howto = 0; - if (kargs != NULL) { - cp = kargs; - active = 0; - while (*cp != 0) { - if (!active && (*cp == '-')) { - active = 1; - } else if (active) - switch (*cp) { - case 'a': - howto |= RB_ASKNAME; - break; - case 'C': - howto |= RB_CDROM; - break; - case 'd': - howto |= RB_KDB; - break; - case 'D': - howto |= RB_MULTIPLE; - break; - case 'm': - howto |= RB_MUTE; - break; - case 'g': - howto |= RB_GDB; - break; - case 'h': - howto |= RB_SERIAL; - break; - case 'p': - howto |= RB_PAUSE; - break; - case 'r': - howto |= RB_DFLTROOT; - break; - case 's': - howto |= RB_SINGLE; - break; - case 'v': - howto |= RB_VERBOSE; - break; - default: - active = 0; - break; - } - cp++; - } - } - /* get equivalents from the environment */ - for (i = 0; howto_names[i].ev != NULL; i++) - if (getenv(howto_names[i].ev) != NULL) - howto |= howto_names[i].mask; - if (md_bootserial() != -1) - howto |= RB_SERIAL; - return(howto); -} - -static int -md_bootserial(void) -{ - char buf[64]; - ihandle_t inst; - phandle_t input; - phandle_t node; - phandle_t output; - - if ((node = OF_finddevice("/options")) == -1) - return(-1); - if (OF_getprop(node, "input-device", buf, sizeof(buf)) == -1) - return(-1); - input = OF_finddevice(buf); - if (OF_getprop(node, "output-device", buf, sizeof(buf)) == -1) - return(-1); - output = OF_finddevice(buf); - if (input == -1 || output == -1 || OF_getproplen(input, "keyboard") >= 0) { - if ((node = OF_finddevice("/chosen")) == -1) - return(-1); - if (OF_getprop(node, "stdin", &inst, sizeof(inst)) == -1) - return(-1); - if ((input = OF_instance_to_package(inst)) == -1) - return(-1); - if (OF_getprop(node, "stdout", &inst, sizeof(inst)) == -1) - return(-1); - if ((output = OF_instance_to_package(inst)) == -1) - return(-1); - } - if (input != output) - return(-1); - if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1) - return(-1); - if (strcmp(buf, "serial") != 0) - return(-1); - return(0); -} - -/* - * Copy the environment into the load area starting at (addr). - * Each variable is formatted as <name>=<value>, with a single nul - * separating each variable, and a double nul terminating the environment. - */ -vm_offset_t -md_copyenv(vm_offset_t addr) -{ - struct env_var *ep; - - /* traverse the environment */ - for (ep = environ; ep != NULL; ep = ep->ev_next) { - archsw.arch_copyin(ep->ev_name, addr, strlen(ep->ev_name)); - addr += strlen(ep->ev_name); - archsw.arch_copyin("=", addr, 1); - addr++; - if (ep->ev_value != NULL) { - archsw.arch_copyin(ep->ev_value, addr, strlen(ep->ev_value)); - addr += strlen(ep->ev_value); - } - archsw.arch_copyin("", addr, 1); - addr++; - } - archsw.arch_copyin("", addr, 1); - addr++; - return(addr); -} - -/* - * Copy module-related data into the load area, where it can be - * used as a directory for loaded modules. - * - * Module data is presented in a self-describing format. Each datum - * is preceded by a 32-bit identifier and a 32-bit size field. - * - * Currently, the following data are saved: - * - * MOD_NAME (variable) module name (string) - * MOD_TYPE (variable) module type (string) - * MOD_ARGS (variable) module parameters (string) - * MOD_ADDR sizeof(vm_offset_t) module load address - * MOD_SIZE sizeof(size_t) module size - * MOD_METADATA (variable) type-specific metadata - */ -#define COPY32(v, a, c) { \ - u_int32_t x = (v); \ - if (c) \ - archsw.arch_copyin(&x, a, sizeof(x)); \ - a += sizeof(x); \ -} - -#define MOD_STR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(strlen(s) + 1, a, c) \ - if (c) \ - archsw.arch_copyin(s, a, strlen(s) + 1);\ - a += roundup(strlen(s) + 1, sizeof(u_long));\ -} - -#define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) -#define MOD_TYPE(a, s, c) MOD_STR(MODINFO_TYPE, a, s, c) -#define MOD_ARGS(a, s, c) MOD_STR(MODINFO_ARGS, a, s, c) - -#define MOD_VAR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(sizeof(s), a, c); \ - if (c) \ - archsw.arch_copyin(&s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_long)); \ -} - -#define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) -#define MOD_SIZE(a, s, c) MOD_VAR(MODINFO_SIZE, a, s, c) - -#define MOD_METADATA(a, mm, c) { \ - COPY32(MODINFO_METADATA | mm->md_type, a, c);\ - COPY32(mm->md_size, a, c); \ - if (c) \ - archsw.arch_copyin(mm->md_data, a, mm->md_size);\ - a += roundup(mm->md_size, sizeof(u_long)); \ -} - -#define MOD_END(a, c) { \ - COPY32(MODINFO_END, a, c); \ - COPY32(0, a, c); \ -} - -vm_offset_t -md_copymodules(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); - MOD_SIZE(addr, fp->f_size, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) { - if (!(md->md_type & MODINFOMD_NOCOPY)) { - MOD_METADATA(addr, md, c); - } - } - } - MOD_END(addr, c); - return(addr); -} - -/* - * Load the information expected by a sparc64 kernel. - * - * - The 'boothowto' argument is constructed - * - The 'bootdev' argument is constructed - * - The kernel environment is copied into kernel space. - * - Module metadata are formatted and placed in kernel space. - */ -int -md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtbp) -{ - struct preloaded_file *kfp; - struct preloaded_file *xp; - struct file_metadata *md; - vm_offset_t kernend; - vm_offset_t addr; - vm_offset_t envp; - vm_offset_t size; - char *rootdevname; - int howto; - - howto = md_getboothowto(args); - *dtbp = 0; - - /* - * Allow the environment variable 'rootdev' to override the supplied device - * This should perhaps go to MI code and/or have $rootdev tested/set by - * MI code before launching the kernel. - */ - if ((rootdevname = getenv("rootdev")) == NULL) - rootdevname = getenv("currdev"); - getrootmount(rootdevname); - - /* find the last module in the chain */ - addr = 0; - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - /* copy our environment */ - envp = addr; - addr = md_copyenv(addr); - - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - kernend = 0; - kfp = file_findfile(NULL, "elf64 kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - panic("can't find kernel file"); - file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); - file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); - file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); - file_addmetadata(kfp, MODINFOMD_DTLB_SLOTS, sizeof dtlb_slot, &dtlb_slot); - file_addmetadata(kfp, MODINFOMD_ITLB_SLOTS, sizeof itlb_slot, &itlb_slot); - file_addmetadata(kfp, MODINFOMD_DTLB, - dtlb_slot * sizeof(*dtlb_store), dtlb_store); - file_addmetadata(kfp, MODINFOMD_ITLB, - itlb_slot * sizeof(*itlb_store), itlb_store); - - *modulep = addr; - size = md_copymodules(0); - kernend = roundup(addr + size, PAGE_SIZE); - - md = file_findmetadata(kfp, MODINFOMD_KERNEND); - bcopy(&kernend, md->md_data, sizeof kernend); - - (void)md_copymodules(addr); - - return(0); -} diff --git a/usr/src/boot/sys/boot/sparc64/loader/version b/usr/src/boot/sys/boot/sparc64/loader/version deleted file mode 100644 index bef4091e58..0000000000 --- a/usr/src/boot/sys/boot/sparc64/loader/version +++ /dev/null @@ -1,6 +0,0 @@ -$FreeBSD$ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - -1.0: I hate the loader. diff --git a/usr/src/boot/sys/boot/sparc64/zfsboot/Makefile b/usr/src/boot/sys/boot/sparc64/zfsboot/Makefile deleted file mode 100644 index 9e58c27eb0..0000000000 --- a/usr/src/boot/sys/boot/sparc64/zfsboot/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../boot1 - -PROGNAME= zfsboot -CFLAGS+= -DZFSBOOT -FILES= zfsboot - -.include "${.CURDIR}/../boot1/Makefile" diff --git a/usr/src/boot/sys/boot/uboot/Makefile b/usr/src/boot/sys/boot/uboot/Makefile deleted file mode 100644 index 43b57480fe..0000000000 --- a/usr/src/boot/sys/boot/uboot/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> - -SUBDIR= lib - -.if ${MK_FDT} != "no" -SUBDIR+=fdt -.endif - -.include <bsd.subdir.mk> diff --git a/usr/src/boot/sys/boot/uboot/Makefile.inc b/usr/src/boot/sys/boot/uboot/Makefile.inc deleted file mode 100644 index e67c0dc904..0000000000 --- a/usr/src/boot/sys/boot/uboot/Makefile.inc +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc_fbsd -.endif - -.include "../Makefile.inc" diff --git a/usr/src/boot/sys/boot/uboot/common/Makefile.inc b/usr/src/boot/sys/boot/uboot/common/Makefile.inc deleted file mode 100644 index e12804cb39..0000000000 --- a/usr/src/boot/sys/boot/uboot/common/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -SRCS+= main.c metadata.c diff --git a/usr/src/boot/sys/boot/uboot/common/main.c b/usr/src/boot/sys/boot/uboot/common/main.c deleted file mode 100644 index 841f2b560d..0000000000 --- a/usr/src/boot/sys/boot/uboot/common/main.c +++ /dev/null @@ -1,679 +0,0 @@ -/* - * Copyright (c) 2000 Benno Rice <benno@jeamland.net> - * Copyright (c) 2000 Stephane Potvin <sepotvin@videotron.ca> - * Copyright (c) 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -#include <sys/param.h> - -#include <stand.h> - -#include "api_public.h" -#include "bootstrap.h" -#include "glue.h" -#include "libuboot.h" - -#ifndef nitems -#define nitems(x) (sizeof((x)) / sizeof((x)[0])) -#endif - -struct uboot_devdesc currdev; -struct arch_switch archsw; /* MI/MD interface boundary */ -int devs_no; - -uintptr_t uboot_heap_start; -uintptr_t uboot_heap_end; - -struct device_type { - const char *name; - int type; -} device_types[] = { - { "disk", DEV_TYP_STOR }, - { "ide", DEV_TYP_STOR | DT_STOR_IDE }, - { "mmc", DEV_TYP_STOR | DT_STOR_MMC }, - { "sata", DEV_TYP_STOR | DT_STOR_SATA }, - { "scsi", DEV_TYP_STOR | DT_STOR_SCSI }, - { "usb", DEV_TYP_STOR | DT_STOR_USB }, - { "net", DEV_TYP_NET } -}; - -extern char end[]; - -extern unsigned char _etext[]; -extern unsigned char _edata[]; -extern unsigned char __bss_start[]; -extern unsigned char __sbss_start[]; -extern unsigned char __sbss_end[]; -extern unsigned char _end[]; - -#ifdef LOADER_FDT_SUPPORT -extern int command_fdt_internal(int argc, char *argv[]); -#endif - -static void -dump_sig(struct api_signature *sig) -{ -#ifdef DEBUG - printf("signature:\n"); - printf(" version\t= %d\n", sig->version); - printf(" checksum\t= 0x%08x\n", sig->checksum); - printf(" sc entry\t= 0x%08x\n", sig->syscall); -#endif -} - -static void -dump_addr_info(void) -{ -#ifdef DEBUG - printf("\naddresses info:\n"); - printf(" _etext (sdata) = 0x%08x\n", (uint32_t)_etext); - printf(" _edata = 0x%08x\n", (uint32_t)_edata); - printf(" __sbss_start = 0x%08x\n", (uint32_t)__sbss_start); - printf(" __sbss_end = 0x%08x\n", (uint32_t)__sbss_end); - printf(" __sbss_start = 0x%08x\n", (uint32_t)__bss_start); - printf(" _end = 0x%08x\n", (uint32_t)_end); - printf(" syscall entry = 0x%08x\n", (uint32_t)syscall_ptr); -#endif -} - -static uint64_t -memsize(struct sys_info *si, int flags) -{ - uint64_t size; - int i; - - size = 0; - for (i = 0; i < si->mr_no; i++) - if (si->mr[i].flags == flags && si->mr[i].size) - size += (si->mr[i].size); - - return (size); -} - -static void -meminfo(void) -{ - uint64_t size; - struct sys_info *si; - int t[3] = { MR_ATTR_DRAM, MR_ATTR_FLASH, MR_ATTR_SRAM }; - int i; - - if ((si = ub_get_sys_info()) == NULL) - panic("could not retrieve system info"); - - for (i = 0; i < 3; i++) { - size = memsize(si, t[i]); - if (size > 0) - printf("%s: %juMB\n", ub_mem_type(t[i]), - (uintmax_t)(size / 1024 / 1024)); - } -} - -static const char * -get_device_type(const char *devstr, int *devtype) -{ - int i; - int namelen; - struct device_type *dt; - - if (devstr) { - for (i = 0; i < nitems(device_types); i++) { - dt = &device_types[i]; - namelen = strlen(dt->name); - if (strncmp(dt->name, devstr, namelen) == 0) { - *devtype = dt->type; - return (devstr + namelen); - } - } - printf("Unknown device type '%s'\n", devstr); - } - - *devtype = -1; - return (NULL); -} - -static const char * -device_typename(int type) -{ - int i; - - for (i = 0; i < nitems(device_types); i++) - if (device_types[i].type == type) - return (device_types[i].name); - - return ("<unknown>"); -} - -/* - * Parse a device string into type, unit, slice and partition numbers. A - * returned value of -1 for type indicates a search should be done for the - * first loadable device, otherwise a returned value of -1 for unit - * indicates a search should be done for the first loadable device of the - * given type. - * - * The returned values for slice and partition are interpreted by - * disk_open(). - * - * Valid device strings: For device types: - * - * <type_name> DEV_TYP_STOR, DEV_TYP_NET - * <type_name><unit> DEV_TYP_STOR, DEV_TYP_NET - * <type_name><unit>: DEV_TYP_STOR, DEV_TYP_NET - * <type_name><unit>:<slice> DEV_TYP_STOR - * <type_name><unit>:<slice>. DEV_TYP_STOR - * <type_name><unit>:<slice>.<partition> DEV_TYP_STOR - * - * For valid type names, see the device_types array, above. - * - * Slice numbers are 1-based. 0 is a wildcard. - */ -static void -get_load_device(int *type, int *unit, int *slice, int *partition) -{ - char *devstr; - const char *p; - char *endp; - - *type = DEV_TYP_NONE; - *unit = -1; - *slice = D_SLICEWILD; - *partition = D_PARTWILD; - - devstr = ub_env_get("loaderdev"); - if (devstr == NULL) { - printf("U-Boot env: loaderdev not set, will probe all devices.\n"); - return; - } - printf("U-Boot env: loaderdev='%s'\n", devstr); - - p = get_device_type(devstr, type); - - /* Ignore optional spaces after the device name. */ - while (*p == ' ') - p++; - - /* Unknown device name, or a known name without unit number. */ - if ((*type == -1) || (*p == '\0')) { - return; - } - - /* Malformed unit number. */ - if (!isdigit(*p)) { - *type = DEV_TYP_NONE; - return; - } - - /* Guaranteed to extract a number from the string, as *p is a digit. */ - *unit = strtol(p, &endp, 10); - p = endp; - - /* Known device name with unit number and nothing else. */ - if (*p == '\0') { - return; - } - - /* Device string is malformed beyond unit number. */ - if (*p != ':') { - *type = DEV_TYP_NONE; - *unit = -1; - return; - } - - p++; - - /* No slice and partition specification. */ - if ('\0' == *p ) - return; - - /* Only DEV_TYP_STOR devices can have a slice specification. */ - if (!(*type & DEV_TYP_STOR)) { - *type = DEV_TYP_NONE; - *unit = -1; - return; - } - - *slice = strtoul(p, &endp, 10); - - /* Malformed slice number. */ - if (p == endp) { - *type = DEV_TYP_NONE; - *unit = -1; - *slice = D_SLICEWILD; - return; - } - - p = endp; - - /* No partition specification. */ - if (*p == '\0') - return; - - /* Device string is malformed beyond slice number. */ - if (*p != '.') { - *type = DEV_TYP_NONE; - *unit = -1; - *slice = D_SLICEWILD; - return; - } - - p++; - - /* No partition specification. */ - if (*p == '\0') - return; - - *partition = strtol(p, &endp, 10); - p = endp; - - /* Full, valid device string. */ - if (*endp == '\0') - return; - - /* Junk beyond partition number. */ - *type = DEV_TYP_NONE; - *unit = -1; - *slice = D_SLICEWILD; - *partition = D_PARTWILD; -} - -static void -print_disk_probe_info() -{ - char slice[32]; - char partition[32]; - - if (currdev.d_disk.slice == D_SLICENONE) - strlcpy(slice, "<none>", sizeof(slice)); - else if (currdev.d_disk.d_slice == D_SLICEWILD) - strlcpy(slice, "<auto>", sizeof(slice)); - else - snprintf(slice, sizeof(slice), "%d", currdev.d_disk.d_slice); - - if (currdev.d_disk.partition == D_PARTNONE) - strlcpy(partition, "<none>", sizeof(partition)); - else if (currdev.d_disk.d_partition == D_PARTWILD) - strlcpy(partition, "<auto>", sizeof(partition)); - else - sprintf(partition, "%d", currdev.d_disk.partition); - else - snprintf(partition, sizeof(partition), "%d", - currdev.d_disk.d_partition); - - printf(" Checking unit=%d slice=%s partition=%s...", - currdev.dd.d_unit, slice, partition); - -} - -static int -probe_disks(int devidx, int load_type, int load_unit, int load_slice, - int load_partition) -{ - int open_result, unit; - struct open_file f; - - currdev.d_disk.slice = load_slice; - currdev.d_disk.partition = load_partition; - - f.f_devdata = &currdev; - open_result = -1; - - if (load_type == -1) { - printf(" Probing all disk devices...\n"); - /* Try each disk in succession until one works. */ - for (currdev.dd.d_unit = 0; currdev.dd.d_unit < UB_MAX_DEV; - currdev.dd.d_unit++) { - print_disk_probe_info(); - open_result = devsw[devidx]->dv_open(&f, &currdev); - if (open_result == 0) { - printf(" good.\n"); - return (0); - } - printf("\n"); - } - return (-1); - } - - if (load_unit == -1) { - printf(" Probing all %s devices...\n", device_typename(load_type)); - /* Try each disk of given type in succession until one works. */ - for (unit = 0; unit < UB_MAX_DEV; unit++) { - currdev.dd.d_unit = uboot_diskgetunit(load_type, unit); - if (currdev.dd.d_unit == -1) - break; - print_disk_probe_info(); - open_result = devsw[devidx]->dv_open(&f, &currdev); - if (open_result == 0) { - printf(" good.\n"); - return (0); - } - printf("\n"); - } - return (-1); - } - - if ((currdev.dd.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { - print_disk_probe_info(); - open_result = devsw[devidx]->dv_open(&f,&currdev); - if (open_result == 0) { - printf(" good.\n"); - return (0); - } - printf("\n"); - } - - printf(" Requested disk type/unit/slice/partition not found\n"); - return (-1); -} - -int -main(void) -{ - struct api_signature *sig = NULL; - int load_type, load_unit, load_slice, load_partition; - int i; - const char *ldev; - - /* - * If we can't find the magic signature and related info, exit with a - * unique error code that U-Boot reports as "## Application terminated, - * rc = 0xnnbadab1". Hopefully 'badab1' looks enough like "bad api" to - * provide a clue. It's better than 0xffffffff anyway. - */ - if (!api_search_sig(&sig)) - return (0x01badab1); - - syscall_ptr = sig->syscall; - if (syscall_ptr == NULL) - return (0x02badab1); - - if (sig->version > API_SIG_VERSION) - return (0x03badab1); - - /* Clear BSS sections */ - bzero(__sbss_start, __sbss_end - __sbss_start); - bzero(__bss_start, _end - __bss_start); - - /* - * Initialise the heap as early as possible. Once this is done, - * alloc() is usable. The stack is buried inside us, so this is safe. - */ - uboot_heap_start = round_page((uintptr_t)end); - uboot_heap_end = uboot_heap_start + 512 * 1024; - setheap((void *)uboot_heap_start, (void *)uboot_heap_end); - - /* - * Set up console. - */ - cons_probe(); - printf("Compatible U-Boot API signature found @%p\n", sig); - - printf("\n%s", bootprog_info); - printf("\n"); - - dump_sig(sig); - dump_addr_info(); - - meminfo(); - - /* - * Enumerate U-Boot devices - */ - if ((devs_no = ub_dev_enum()) == 0) - panic("no U-Boot devices found"); - printf("Number of U-Boot devices: %d\n", devs_no); - - get_load_device(&load_type, &load_unit, &load_slice, &load_partition); - - /* - * March through the device switch probing for things. - */ - for (i = 0; devsw[i] != NULL; i++) { - - if (devsw[i]->dv_init == NULL) - continue; - if ((devsw[i]->dv_init)() != 0) - continue; - - printf("Found U-Boot device: %s\n", devsw[i]->dv_name); - - currdev.dd.d_dev = devsw[i]; - currdev.dd.d_unit = 0; - - if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && - strcmp(devsw[i]->dv_name, "disk") == 0) { - if (probe_disks(i, load_type, load_unit, load_slice, - load_partition) == 0) - break; - } - - if ((load_type == -1 || (load_type & DEV_TYP_NET)) && - strcmp(devsw[i]->dv_name, "net") == 0) - break; - } - - /* - * If we couldn't find a boot device, return an error to u-boot. - * U-boot may be running a boot script that can try something different - * so returning an error is better than forcing a reboot. - */ - if (devsw[i] == NULL) { - printf("No boot device found!\n"); - return (0xbadef1ce); - } - - ldev = uboot_fmtdev(&currdev); - env_setenv("currdev", EV_VOLATILE, ldev, uboot_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset); - printf("Booting from %s\n", ldev); - - setenv("screen-#rows", "24", 1); /* optional */ - setenv("prompt", "loader>", 1); - - archsw.arch_loadaddr = uboot_loadaddr; - archsw.arch_getdev = uboot_getdev; - archsw.arch_copyin = uboot_copyin; - archsw.arch_copyout = uboot_copyout; - archsw.arch_readin = uboot_readin; - archsw.arch_autoload = uboot_autoload; - - interact(NULL); /* doesn't return */ - - return (0); -} - - -COMMAND_SET(heap, "heap", "show heap usage", command_heap); -static int -command_heap(int argc, char *argv[]) -{ - - printf("heap base at %p, top at %p, used %td\n", end, sbrk(0), - sbrk(0) - end); - - return (CMD_OK); -} - -COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); -static int -command_reboot(int argc, char *argv[]) -{ - - printf("Resetting...\n"); - ub_reset(); - - printf("Reset failed!\n"); - while(1); -} - -COMMAND_SET(devinfo, "devinfo", "show U-Boot devices", command_devinfo); -static int -command_devinfo(int argc, char *argv[]) -{ - int i; - - if ((devs_no = ub_dev_enum()) == 0) { - command_errmsg = "no U-Boot devices found!?"; - return (CMD_ERROR); - } - - printf("U-Boot devices:\n"); - for (i = 0; i < devs_no; i++) { - ub_dump_di(i); - printf("\n"); - } - return (CMD_OK); -} - -COMMAND_SET(sysinfo, "sysinfo", "show U-Boot system info", command_sysinfo); -static int -command_sysinfo(int argc, char *argv[]) -{ - struct sys_info *si; - - if ((si = ub_get_sys_info()) == NULL) { - command_errmsg = "could not retrieve U-Boot sys info!?"; - return (CMD_ERROR); - } - - printf("U-Boot system info:\n"); - ub_dump_si(si); - return (CMD_OK); -} - -enum ubenv_action { - UBENV_UNKNOWN, - UBENV_SHOW, - UBENV_IMPORT -}; - -static void -handle_uboot_env_var(enum ubenv_action action, const char * var) -{ - char ldvar[128]; - const char *val; - char *wrk; - int len; - - /* - * On an import with the variable name formatted as ldname=ubname, - * import the uboot variable ubname into the loader variable ldname, - * otherwise the historical behavior is to import to uboot.ubname. - */ - if (action == UBENV_IMPORT) { - len = strcspn(var, "="); - if (len == 0) { - printf("name cannot start with '=': '%s'\n", var); - return; - } - if (var[len] == 0) { - strcpy(ldvar, "uboot."); - strncat(ldvar, var, sizeof(ldvar) - 7); - } else { - len = MIN(len, sizeof(ldvar) - 1); - strncpy(ldvar, var, len); - ldvar[len] = 0; - var = &var[len + 1]; - } - } - - /* - * If the user prepended "uboot." (which is how they usually see these - * names) strip it off as a convenience. - */ - if (strncmp(var, "uboot.", 6) == 0) { - var = &var[6]; - } - - /* If there is no variable name left, punt. */ - if (var[0] == 0) { - printf("empty variable name\n"); - return; - } - - val = ub_env_get(var); - if (action == UBENV_SHOW) { - if (val == NULL) - printf("uboot.%s is not set\n", var); - else - printf("uboot.%s=%s\n", var, val); - } else if (action == UBENV_IMPORT) { - if (val != NULL) { - setenv(ldvar, val, 1); - } - } -} - -static int -command_ubenv(int argc, char *argv[]) -{ - enum ubenv_action action; - const char *var; - int i; - - action = UBENV_UNKNOWN; - if (argc > 1) { - if (strcasecmp(argv[1], "import") == 0) - action = UBENV_IMPORT; - else if (strcasecmp(argv[1], "show") == 0) - action = UBENV_SHOW; - } - if (action == UBENV_UNKNOWN) { - command_errmsg = "usage: 'ubenv <import|show> [var ...]"; - return (CMD_ERROR); - } - - if (argc > 2) { - for (i = 2; i < argc; i++) - handle_uboot_env_var(action, argv[i]); - } else { - var = NULL; - for (;;) { - if ((var = ub_env_enum(var)) == NULL) - break; - handle_uboot_env_var(action, var); - } - } - - return (CMD_OK); -} -COMMAND_SET(ubenv, "ubenv", "show or import U-Boot env vars", command_ubenv); - -#ifdef LOADER_FDT_SUPPORT -/* - * Since proper fdt command handling function is defined in fdt_loader_cmd.c, - * and declaring it as extern is in contradiction with COMMAND_SET() macro - * (which uses static pointer), we're defining wrapper function, which - * calls the proper fdt handling routine. - */ -static int -command_fdt(int argc, char *argv[]) -{ - - return (command_fdt_internal(argc, argv)); -} - -COMMAND_SET(fdt, "fdt", "flattened device tree handling", command_fdt); -#endif diff --git a/usr/src/boot/sys/boot/uboot/common/metadata.c b/usr/src/boot/sys/boot/uboot/common/metadata.c deleted file mode 100644 index 38db4bca44..0000000000 --- a/usr/src/boot/sys/boot/uboot/common/metadata.c +++ /dev/null @@ -1,366 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * Copyright (C) 2006 Semihalf, Piotr Kruszynski <ppk@semihalf.com> - * Copyright (C) 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include <sys/param.h> -#include <sys/reboot.h> -#include <sys/linker.h> -#include <sys/boot.h> - -#include <machine/elf.h> -#include <machine/metadata.h> - -#include "api_public.h" -#include "bootstrap.h" -#include "glue.h" - -#if defined(LOADER_FDT_SUPPORT) -#include <fdt_platform.h> -#endif - -static int -md_getboothowto(char *kargs) -{ - char *cp; - char *p; - int howto; - int active; - int i; - - /* Parse kargs */ - howto = 0; - if (kargs != NULL) { - cp = kargs; - active = 0; - while (*cp != 0) { - if (!active && (*cp == '-')) - active = 1; - else if (active) - switch (*cp) { - case 'a': - howto |= RB_ASKNAME; - break; - case 'C': - howto |= RB_CDROM; - break; - case 'd': - howto |= RB_KDB; - break; - case 'D': - howto |= RB_MULTIPLE; - break; - case 'm': - howto |= RB_MUTE; - break; - case 'g': - howto |= RB_GDB; - break; - case 'h': - howto |= RB_SERIAL; - break; - case 'p': - howto |= RB_PAUSE; - break; - case 'r': - howto |= RB_DFLTROOT; - break; - case 's': - howto |= RB_SINGLE; - break; - case 'v': - howto |= RB_VERBOSE; - break; - default: - active = 0; - break; - } - cp++; - } - } - - /* get equivalents from the environment */ - for (i = 0; howto_names[i].ev != NULL; i++) { - if (getenv(howto_names[i].ev) != NULL) - howto |= howto_names[i].mask; - } - if ((p = getenv("console"))) { - if (!strcmp(p, "comconsole")) - howto |= RB_SERIAL; - if (!strcmp(p, "nullconsole")) - howto |= RB_MUTE; - } - - return(howto); -} - -/* - * Copy the environment into the load area starting at (addr). - * Each variable is formatted as <name>=<value>, with a single nul - * separating each variable, and a double nul terminating the environment. - */ -static vm_offset_t -md_copyenv(vm_offset_t addr) -{ - struct env_var *ep; - - /* traverse the environment */ - for (ep = environ; ep != NULL; ep = ep->ev_next) { - archsw.arch_copyin(ep->ev_name, addr, strlen(ep->ev_name)); - addr += strlen(ep->ev_name); - archsw.arch_copyin("=", addr, 1); - addr++; - if (ep->ev_value != NULL) { - archsw.arch_copyin(ep->ev_value, addr, - strlen(ep->ev_value)); - addr += strlen(ep->ev_value); - } - archsw.arch_copyin("", addr, 1); - addr++; - } - archsw.arch_copyin("", addr, 1); - addr++; - return(addr); -} - -/* - * Copy module-related data into the load area, where it can be - * used as a directory for loaded modules. - * - * Module data is presented in a self-describing format. Each datum - * is preceded by a 32-bit identifier and a 32-bit size field. - * - * Currently, the following data are saved: - * - * MOD_NAME (variable) module name (string) - * MOD_TYPE (variable) module type (string) - * MOD_ARGS (variable) module parameters (string) - * MOD_ADDR sizeof(vm_offset_t) module load address - * MOD_SIZE sizeof(size_t) module size - * MOD_METADATA (variable) type-specific metadata - */ -#define COPY32(v, a, c) { \ - u_int32_t x = (v); \ - if (c) \ - archsw.arch_copyin(&x, a, sizeof(x)); \ - a += sizeof(x); \ -} - -#define MOD_STR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(strlen(s) + 1, a, c) \ - if (c) \ - archsw.arch_copyin(s, a, strlen(s) + 1);\ - a += roundup(strlen(s) + 1, sizeof(u_long));\ -} - -#define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) -#define MOD_TYPE(a, s, c) MOD_STR(MODINFO_TYPE, a, s, c) -#define MOD_ARGS(a, s, c) MOD_STR(MODINFO_ARGS, a, s, c) - -#define MOD_VAR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(sizeof(s), a, c); \ - if (c) \ - archsw.arch_copyin(&s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_long)); \ -} - -#define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) -#define MOD_SIZE(a, s, c) MOD_VAR(MODINFO_SIZE, a, s, c) - -#define MOD_METADATA(a, mm, c) { \ - COPY32(MODINFO_METADATA | mm->md_type, a, c);\ - COPY32(mm->md_size, a, c); \ - if (c) \ - archsw.arch_copyin(mm->md_data, a, mm->md_size);\ - a += roundup(mm->md_size, sizeof(u_long)); \ -} - -#define MOD_END(a, c) { \ - COPY32(MODINFO_END, a, c); \ - COPY32(0, a, c); \ -} - -static vm_offset_t -md_copymodules(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - vm_offset_t a; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must be first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - a = fp->f_addr - __elfN(relocation_offset); - MOD_ADDR(addr, a, c); - MOD_SIZE(addr, fp->f_size, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) { - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - } - MOD_END(addr, c); - return(addr); -} - -/* - * Load the information expected by a kernel. - * - * - The 'boothowto' argument is constructed - * - The 'bootdev' argument is constructed - * - The kernel environment is copied into kernel space. - * - Module metadata are formatted and placed in kernel space. - */ -int -md_load(char *args, vm_offset_t *modulep) -{ - struct preloaded_file *kfp, *bfp; - struct preloaded_file *xp; - struct file_metadata *md; - struct bootinfo *bip; - vm_offset_t kernend; - vm_offset_t addr; - vm_offset_t envp; - vm_offset_t size; - vm_offset_t vaddr; -#if defined(LOADER_FDT_SUPPORT) - vm_offset_t dtbp; - int dtb_size; -#endif - char *rootdevname; - int howto; - int i; - - /* - * These metadata addreses must be converted for kernel after - * relocation. - */ - uint32_t mdt[] = { - MODINFOMD_SSYM, MODINFOMD_ESYM, MODINFOMD_KERNEND, - MODINFOMD_ENVP, -#if defined(LOADER_FDT_SUPPORT) - MODINFOMD_DTBP -#endif - }; - - howto = md_getboothowto(args); - - /* - * Allow the environment variable 'rootdev' to override the supplied - * device. This should perhaps go to MI code and/or have $rootdev - * tested/set by MI code before launching the kernel. - */ - rootdevname = getenv("rootdev"); - if (rootdevname == NULL) - rootdevname = getenv("currdev"); - /* Try reading the /etc/fstab file to select the root device */ - getrootmount(rootdevname); - - /* Find the last module in the chain */ - addr = 0; - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } - /* Pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - /* Copy our environment */ - envp = addr; - addr = md_copyenv(addr); - - /* Pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - -#if defined(LOADER_FDT_SUPPORT) - /* Handle device tree blob */ - dtbp = addr; - dtb_size = fdt_copy(addr); - - /* Pad to a page boundary */ - if (dtb_size) - addr += roundup(dtb_size, PAGE_SIZE); -#endif - - kernend = 0; - kfp = file_findfile(NULL, "elf32 kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - panic("can't find kernel file"); - file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); - file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); - -#if defined(LOADER_FDT_SUPPORT) - if (dtb_size) - file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); - else - pager_output("WARNING! Trying to fire up the kernel, but no " - "device tree blob found!\n"); -#endif - - file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); - - /* Figure out the size and location of the metadata */ - *modulep = addr; - size = md_copymodules(0); - kernend = roundup(addr + size, PAGE_SIZE); - - /* Provide MODINFOMD_KERNEND */ - md = file_findmetadata(kfp, MODINFOMD_KERNEND); - bcopy(&kernend, md->md_data, sizeof kernend); - - /* Convert addresses to the final VA */ - *modulep -= __elfN(relocation_offset); - - /* Do relocation fixup on metadata of each module. */ - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - for (i = 0; i < nitems(mdt); i++) { - md = file_findmetadata(xp, mdt[i]); - if (md) { - bcopy(md->md_data, &vaddr, sizeof vaddr); - vaddr -= __elfN(relocation_offset); - bcopy(&vaddr, md->md_data, sizeof vaddr); - } - } - } - - /* Only now copy actual modules and metadata */ - (void)md_copymodules(addr); - - return (0); -} diff --git a/usr/src/boot/sys/boot/uboot/fdt/Makefile b/usr/src/boot/sys/boot/uboot/fdt/Makefile deleted file mode 100644 index 6f68665cc6..0000000000 --- a/usr/src/boot/sys/boot/uboot/fdt/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> - -.PATH: ${.CURDIR}/../../common - -LIB= uboot_fdt -INTERNALLIB= -WARNS?= 2 - -SRCS= uboot_fdt.c - -CFLAGS+= -ffreestanding -msoft-float - -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ - -# U-Boot library headers -CFLAGS+= -I${.CURDIR}/../lib - -# libfdt headers -CFLAGS+= -I${.CURDIR}/../../fdt - -# Pick up the bootstrap header for some interface items -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. - -machine: - ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine - -CLEANFILES+= machine - -.include <bsd.stand.mk> -.include <bsd.lib.mk> - -beforedepend ${OBJS}: machine diff --git a/usr/src/boot/sys/boot/uboot/fdt/uboot_fdt.c b/usr/src/boot/sys/boot/uboot/fdt/uboot_fdt.c deleted file mode 100644 index 46882338a8..0000000000 --- a/usr/src/boot/sys/boot/uboot/fdt/uboot_fdt.c +++ /dev/null @@ -1,180 +0,0 @@ -/*- - * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Semihalf under sponsorship from - * the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <stand.h> -#include <fdt_platform.h> - -#include "glue.h" - -#define STR(number) #number -#define STRINGIFY(number) STR(number) - -int -fdt_platform_load_dtb(void) -{ - struct fdt_header *hdr; - const char *s; - char *p; - - /* - * If the U-boot environment contains a variable giving the address of a - * valid blob in memory, use it. The U-boot README says the right - * variable for fdt data loaded into ram is fdt_addr_r, so try that - * first. Board vendors also use both fdtaddr and fdt_addr names. - */ - s = ub_env_get("fdt_addr_r"); - if (s == NULL) - s = ub_env_get("fdtaddr"); - if (s == NULL) - s = ub_env_get("fdt_addr"); - if (s != NULL && *s != '\0') { - hdr = (struct fdt_header *)strtoul(s, &p, 16); - if (*p == '\0') { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by U-Boot at " - "address %p.\n", hdr); - return (0); - } - } - } - - /* - * Try to get FDT filename first from loader env and then from u-boot env - */ - s = getenv("fdt_file"); - if (s == NULL) - s = ub_env_get("fdtfile"); - if (s == NULL) - s = ub_env_get("fdt_file"); - if (s != NULL && *s != '\0') { - if (fdt_load_dtb_file(s) == 0) { - printf("Loaded DTB from file '%s'.\n", s); - return (0); - } - } - - return (1); -} - -void -fdt_platform_fixups(void) -{ - static struct fdt_mem_region regions[UB_MAX_MR]; - const char *env, *str; - char *end, *ethstr; - int eth_no, i, len, n; - struct sys_info *si; - - env = NULL; - eth_no = 0; - ethstr = NULL; - - /* Acquire sys_info */ - si = ub_get_sys_info(); - - while ((env = ub_env_enum(env)) != NULL) { - if (strncmp(env, "eth", 3) == 0 && - strncmp(env + (strlen(env) - 4), "addr", 4) == 0) { - /* - * Handle Ethernet addrs: parse uboot env eth%daddr - */ - - if (!eth_no) { - /* - * Check how many chars we will need to store - * maximal eth iface number. - */ - len = strlen(STRINGIFY(TMP_MAX_ETH)) + - strlen("ethernet") + 1; - - /* - * Reserve mem for string "ethernet" and len - * chars for iface no. - */ - ethstr = (char *)malloc(len * sizeof(char)); - bzero(ethstr, len * sizeof(char)); - strcpy(ethstr, "ethernet0"); - } - - /* Extract interface number */ - i = strtol(env + 3, &end, 10); - if (end == (env + 3)) - /* 'ethaddr' means interface 0 address */ - n = 0; - else - n = i; - - if (n > TMP_MAX_ETH) - continue; - - str = ub_env_get(env); - - if (n != 0) { - /* - * Find the length of the interface id by - * taking in to account the first 3 and - * last 4 characters. - */ - i = strlen(env) - 7; - strncpy(ethstr + 8, env + 3, i); - } - - /* Modify blob */ - fdt_fixup_ethernet(str, ethstr, len); - - /* Clear ethernet..XXXX.. string */ - bzero(ethstr + 8, len - 8); - - if (n + 1 > eth_no) - eth_no = n + 1; - } else if (strcmp(env, "consoledev") == 0) { - str = ub_env_get(env); - fdt_fixup_stdout(str); - } - } - - /* Modify cpu(s) and bus clock frequenties in /cpus node [Hz] */ - fdt_fixup_cpubusfreqs(si->clk_cpu, si->clk_bus); - - /* Extract the DRAM regions into fdt_mem_region format. */ - for (i = 0, n = 0; i < si->mr_no && n < nitems(regions); i++) { - if (si->mr[i].flags == MR_ATTR_DRAM) { - regions[n].start = si->mr[i].start; - regions[n].size = si->mr[i].size; - n++; - } - } - - /* Fixup memory regions */ - fdt_fixup_memory(regions, n); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/Makefile b/usr/src/boot/sys/boot/uboot/lib/Makefile deleted file mode 100644 index b56c06021c..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -# $FreeBSD$ - -.include <src.opts.mk> - -.PATH: ${.CURDIR}/../../common - -LIB= uboot -INTERNALLIB= -WARNS?= 2 - -SRCS= crc32.c console.c copy.c devicename.c elf_freebsd.c glue.c -SRCS+= module.c net.c reboot.c time.c - -CFLAGS+= -ffreestanding -msoft-float - -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ - -.if !defined(LOADER_NO_DISK_SUPPORT) -SRCS+= disk.c -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif - -.if ${MK_FDT} != "no" -LOADER_FDT_SUPPORT= yes -.else -LOADER_FDT_SUPPORT= no -.endif - -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -DLOADER_FDT_SUPPORT -I${.CURDIR}/../../fdt -.endif - -# Pick up FDT includes -CFLAGS+= -I${.CURDIR}/../../../../sys/contrib/libfdt/ - -# Pick up the bootstrap header for some interface items -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. - -.ifdef(BOOT_DISK_DEBUG) -# Make the disk code more talkative -CFLAGS+= -DDISK_DEBUG -.endif - -machine: - ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine - -CLEANFILES+= machine - -.include <bsd.stand.mk> -.include <bsd.lib.mk> - -beforedepend ${OBJS}: machine diff --git a/usr/src/boot/sys/boot/uboot/lib/api_public.h b/usr/src/boot/sys/boot/uboot/lib/api_public.h deleted file mode 100644 index f393de8893..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/api_public.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * (C) Copyright 2007-2008 Semihalf - * - * Written by: Rafal Jaworowski <raj@semihalf.com> - * - * This file is dual licensed; you can use it under the terms of - * either the GPL, or the BSD license, at your option. - * - * I. GPL: - * - * This file 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 2 of - * the License, or (at your option) any later version. - * - * This file 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - * Alternatively, - * - * II. BSD license: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - * - * This file needs to be kept in sync with U-Boot reference: - * http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=include/api_public.h - */ - -#ifndef _API_PUBLIC_H_ -#define _API_PUBLIC_H_ - -#define API_EINVAL 1 /* invalid argument(s) */ -#define API_ENODEV 2 /* no device */ -#define API_ENOMEM 3 /* no memory */ -#define API_EBUSY 4 /* busy, occupied etc. */ -#define API_EIO 5 /* I/O error */ -#define API_ESYSC 6 /* syscall error */ - -typedef int (*scp_t)(int, int *, ...); - -#define API_SIG_VERSION 1 -#define API_SIG_MAGIC "UBootAPI" -#define API_SIG_MAGLEN 8 - -struct api_signature { - char magic[API_SIG_MAGLEN]; /* magic string */ - uint16_t version; /* API version */ - uint32_t checksum; /* checksum of this sig struct */ - scp_t syscall; /* entry point to the API */ -}; - -enum { - API_RSVD = 0, - API_GETC, - API_PUTC, - API_TSTC, - API_PUTS, - API_RESET, - API_GET_SYS_INFO, - API_UDELAY, - API_GET_TIMER, - API_DEV_ENUM, - API_DEV_OPEN, - API_DEV_CLOSE, - API_DEV_READ, - API_DEV_WRITE, - API_ENV_ENUM, - API_ENV_GET, - API_ENV_SET, - API_MAXCALL -}; - -#define MR_ATTR_FLASH 0x0001 -#define MR_ATTR_DRAM 0x0002 -#define MR_ATTR_SRAM 0x0003 - -struct mem_region { - unsigned long start; - unsigned long size; - int flags; -}; - -struct sys_info { - unsigned long clk_bus; - unsigned long clk_cpu; - unsigned long bar; - struct mem_region *mr; - int mr_no; /* number of memory regions */ -}; - -#undef CFG_64BIT_LBA -#ifdef CFG_64BIT_LBA -typedef uint64_t lbasize_t; -#else -typedef unsigned long lbasize_t; -#endif -typedef unsigned long lbastart_t; - -#define DEV_TYP_NONE 0x0000 -#define DEV_TYP_NET 0x0001 - -#define DEV_TYP_STOR 0x0002 -#define DT_STOR_IDE 0x0010 -#define DT_STOR_SCSI 0x0020 -#define DT_STOR_USB 0x0040 -#define DT_STOR_MMC 0x0080 -#define DT_STOR_SATA 0x0100 - -#define DEV_STA_CLOSED 0x0000 /* invalid, closed */ -#define DEV_STA_OPEN 0x0001 /* open i.e. active */ - -struct device_info { - int type; - void *cookie; - - union { - struct { - lbasize_t block_count; /* no of blocks */ - unsigned long block_size; /* size of one block */ - } storage; - - struct { - unsigned char hwaddr[6]; - } net; - } info; -#define di_stor info.storage -#define di_net info.net - - int state; -}; - -#endif /* _API_PUBLIC_H_ */ diff --git a/usr/src/boot/sys/boot/uboot/lib/console.c b/usr/src/boot/sys/boot/uboot/lib/console.c deleted file mode 100644 index f49f455c7e..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/console.c +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include "bootstrap.h" -#include "glue.h" - -int console; - -static void uboot_cons_probe(struct console *cp); -static int uboot_cons_init(int); -static void uboot_cons_putchar(int); -static int uboot_cons_getchar(void); -static int uboot_cons_poll(void); - -struct console uboot_console = { - "uboot", - "U-Boot console", - 0, - uboot_cons_probe, - uboot_cons_init, - uboot_cons_putchar, - uboot_cons_getchar, - uboot_cons_poll, -}; - -static void -uboot_cons_probe(struct console *cp) -{ - - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); -} - -static int -uboot_cons_init(int arg) -{ - - return (0); -} - -static void -uboot_cons_putchar(int c) -{ - - if (c == '\n') - ub_putc('\r'); - - ub_putc(c); -} - -static int -uboot_cons_getchar() -{ - - return (ub_getc()); -} - -static int -uboot_cons_poll() -{ - - return (ub_tstc()); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/copy.c b/usr/src/boot/sys/boot/uboot/lib/copy.c deleted file mode 100644 index b41246f179..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/copy.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -#include <sys/param.h> - -#include <stand.h> -#include <stdint.h> - -#include "api_public.h" -#include "glue.h" -#include "libuboot.h" - -/* - * MD primitives supporting placement of module data - */ - -#ifdef __arm__ -#define KERN_ALIGN (2 * 1024 * 1024) -#else -#define KERN_ALIGN PAGE_SIZE -#endif - -/* - * Avoid low memory, u-boot puts things like args and dtb blobs there. - */ -#define KERN_MINADDR max(KERN_ALIGN, (1024 * 1024)) - -extern void _start(void); /* ubldr entry point address. */ - -/* - * This is called for every object loaded (kernel, module, dtb file, etc). The - * expected return value is the next address at or after the given addr which is - * appropriate for loading the given object described by type and data. On each - * call the addr is the next address following the previously loaded object. - * - * The first call is for loading the kernel, and the addr argument will be zero, - * and we search for a big block of ram to load the kernel and modules. - * - * On subsequent calls the addr will be non-zero, and we just round it up so - * that each object begins on a page boundary. - */ -uint64_t -uboot_loadaddr(uint_t type, void *data, uint64_t addr) -{ - struct sys_info *si; - uint64_t sblock, eblock, subldr, eubldr; - uint64_t biggest_block, this_block; - uint64_t biggest_size, this_size; - int i; - char *envstr; - - if (addr == 0) { - /* - * If the loader_kernaddr environment variable is set, blindly - * honor it. It had better be right. We force interpretation - * of the value in base-16 regardless of any leading 0x prefix, - * because that's the U-Boot convention. - */ - envstr = ub_env_get("loader_kernaddr"); - if (envstr != NULL) - return (strtoul(envstr, NULL, 16)); - - /* - * Find addr/size of largest DRAM block. Carve our own address - * range out of the block, because loading the kernel over the - * top ourself is a poor memory-conservation strategy. Avoid - * memory at beginning of the first block of physical ram, - * since u-boot likes to pass args and data there. Assume that - * u-boot has moved itself to the very top of ram and - * optimistically assume that we won't run into it up there. - */ - if ((si = ub_get_sys_info()) == NULL) - panic("could not retrieve system info"); - - biggest_block = 0; - biggest_size = 0; - subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); - eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); - for (i = 0; i < si->mr_no; i++) { - if (si->mr[i].flags != MR_ATTR_DRAM) - continue; - sblock = roundup2((uint64_t)si->mr[i].start, - KERN_ALIGN); - eblock = rounddown2((uint64_t)si->mr[i].start + - si->mr[i].size, KERN_ALIGN); - if (biggest_size == 0) - sblock += KERN_MINADDR; - if (subldr >= sblock && subldr < eblock) { - if (subldr - sblock > eblock - eubldr) { - this_block = sblock; - this_size = subldr - sblock; - } else { - this_block = eubldr; - this_size = eblock - eubldr; - } - } else if (subldr < sblock && eubldr < eblock) { - /* Loader is below or engulfs the sblock */ - this_block = (eubldr < sblock) ? - sblock : eubldr; - this_size = eblock - this_block; - } else { - this_block = 0; - this_size = 0; - } - if (biggest_size < this_size) { - biggest_block = this_block; - biggest_size = this_size; - } - } - if (biggest_size == 0) - panic("Not enough DRAM to load kernel"); -#if 0 - printf("Loading kernel into region 0x%08jx-0x%08jx (%ju MiB)\n", - (uintmax_t)biggest_block, - (uintmax_t)biggest_block + biggest_size - 1, - (uintmax_t)biggest_size / 1024 / 1024); -#endif - return (biggest_block); - } - return (roundup2(addr, PAGE_SIZE)); -} - -ssize_t -uboot_copyin(const void *src, vm_offset_t dest, const size_t len) -{ - bcopy(src, (void *)dest, len); - return (len); -} - -ssize_t -uboot_copyout(const vm_offset_t src, void *dest, const size_t len) -{ - bcopy((void *)src, dest, len); - return (len); -} - -ssize_t -uboot_readin(const int fd, vm_offset_t dest, const size_t len) -{ - return (read(fd, (void *)dest, len)); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/devicename.c b/usr/src/boot/sys/boot/uboot/lib/devicename.c deleted file mode 100644 index 4d3350e78c..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/devicename.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <stand.h> -#include <string.h> - -#include "bootstrap.h" -#include "disk.h" -#include "libuboot.h" - -static int uboot_parsedev(struct uboot_devdesc **dev, const char *devspec, - const char **path); - -/* - * Point (dev) at an allocated device specifier for the device matching the - * path in (devspec). If it contains an explicit device specification, - * use that. If not, use the default device. - */ -int -uboot_getdev(void **vdev, const char *devspec, const char **path) -{ - struct uboot_devdesc **dev = (struct uboot_devdesc **)vdev; - int rv; - - /* - * If it looks like this is just a path and no - * device, go with the current device. - */ - if ((devspec == NULL) || (devspec[0] == '/') || - (strchr(devspec, ':') == NULL)) { - - if (((rv = uboot_parsedev(dev, getenv("currdev"), NULL)) == 0) - && (path != NULL)) - *path = devspec; - return(rv); - } - - /* - * Try to parse the device name off the beginning of the devspec. - */ - return (uboot_parsedev(dev, devspec, path)); -} - -/* - * Point (dev) at an allocated device specifier matching the string version - * at the beginning of (devspec). Return a pointer to the remaining - * text in (path). - * - * In all cases, the beginning of (devspec) is compared to the names - * of known devices in the device switch, and then any following text - * is parsed according to the rules applied to the device type. - * - * For disk-type devices, the syntax is: - * - * disk<unit>[<partition>]: - * - */ -static int -uboot_parsedev(struct uboot_devdesc **dev, const char *devspec, - const char **path) -{ - struct uboot_devdesc *idev; - struct devsw *dv; - char *cp; - const char *np; - int i, unit, err; - - /* minimum length check */ - if (strlen(devspec) < 2) - return(EINVAL); - - /* look for a device that matches */ - for (i = 0, dv = NULL; devsw[i] != NULL; i++) { - if (!strncmp(devspec, devsw[i]->dv_name, - strlen(devsw[i]->dv_name))) { - dv = devsw[i]; - break; - } - } - if (dv == NULL) - return(ENOENT); - idev = malloc(sizeof(struct uboot_devdesc)); - err = 0; - np = (devspec + strlen(dv->dv_name)); - - switch(dv->dv_type) { - case DEVT_NONE: - break; - -#ifdef LOADER_DISK_SUPPORT - case DEVT_DISK: - err = disk_parsedev((struct disk_devdesc *)idev, np, path); - if (err != 0) - goto fail; - break; -#endif - - case DEVT_NET: - unit = 0; - - if (*np && (*np != ':')) { - /* get unit number if present */ - unit = strtol(np, &cp, 0); - if (cp == np) { - err = EUNIT; - goto fail; - } - } - if (*cp && (*cp != ':')) { - err = EINVAL; - goto fail; - } - idev->dd.d_unit = unit; - - if (path != NULL) - *path = (*cp == 0) ? cp : cp + 1; - break; - - default: - err = EINVAL; - goto fail; - } - idev->dd.d_dev = dv; - if (dev == NULL) { - free(idev); - } else { - *dev = idev; - } - return (0); - -fail: - free(idev); - return (err); -} - - -char * -uboot_fmtdev(void *vdev) -{ - struct uboot_devdesc *dev = (struct uboot_devdesc *)vdev; - static char buf[128]; - - switch(dev->dd.d_dev->dv_type) { - case DEVT_NONE: - strcpy(buf, "(no device)"); - break; - - case DEVT_DISK: -#ifdef LOADER_DISK_SUPPORT - return (disk_fmtdev(vdev)); -#endif - - case DEVT_NET: - sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); - break; - } - return(buf); -} - -/* - * Set currdev to suit the value being supplied in (value). - */ -int -uboot_setcurrdev(struct env_var *ev, int flags, const void *value) -{ - struct uboot_devdesc *ncurr; - int rv; - - if ((rv = uboot_parsedev(&ncurr, value, NULL)) != 0) - return (rv); - free(ncurr); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return (0); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/disk.c b/usr/src/boot/sys/boot/uboot/lib/disk.c deleted file mode 100644 index 088101aab6..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/disk.c +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 2008 Semihalf, Rafal Jaworowski - * Copyright (c) 2009 Semihalf, Piotr Ziecik - * Copyright (c) 2012 Andrey V. Elsukov <ae@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - * Block storage I/O routines for U-Boot - */ - -#include <sys/cdefs.h> - -#include <sys/param.h> -#include <sys/disk.h> -#include <machine/stdarg.h> -#include <stand.h> - -#include "api_public.h" -#include "bootstrap.h" -#include "disk.h" -#include "glue.h" -#include "libuboot.h" - -#define stor_printf(fmt, args...) do { \ - printf("%s%d: ", dev->dd.d_dev->dv_name, dev->dd.d_unit); \ - printf(fmt, ##args); \ -} while (0) - -#ifdef DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ - printf(fmt,##args); } while (0) -#else -#define debugf(fmt, args...) -#endif - -static struct { - int opened; /* device is opened */ - int handle; /* storage device handle */ - int type; /* storage type */ - off_t blocks; /* block count */ - u_int bsize; /* block size */ -} stor_info[UB_MAX_DEV]; - -#define SI(dev) (stor_info[(dev)->dd.d_unit]) - -static int stor_info_no = 0; -static int stor_opendev(struct disk_devdesc *); -static int stor_readdev(struct disk_devdesc *, daddr_t, size_t, char *); - -/* devsw I/F */ -static int stor_init(void); -static int stor_strategy(void *, int, daddr_t, size_t, char *, size_t *); -static int stor_open(struct open_file *, ...); -static int stor_close(struct open_file *); -static int stor_ioctl(struct open_file *f, u_long cmd, void *data); -static int stor_print(int); -static void stor_cleanup(void); - -struct devsw uboot_storage = { - "disk", - DEVT_DISK, - stor_init, - stor_strategy, - stor_open, - stor_close, - stor_ioctl, - stor_print, - stor_cleanup -}; - -static int -stor_init(void) -{ - struct device_info *di; - int i; - - if (devs_no == 0) { - printf("No U-Boot devices! Really enumerated?\n"); - return (-1); - } - - for (i = 0; i < devs_no; i++) { - di = ub_dev_get(i); - if ((di != NULL) && (di->type & DEV_TYP_STOR)) { - if (stor_info_no >= UB_MAX_DEV) { - printf("Too many storage devices: %d\n", - stor_info_no); - return (-1); - } - stor_info[stor_info_no].handle = i; - stor_info[stor_info_no].opened = 0; - stor_info[stor_info_no].type = di->type; - stor_info[stor_info_no].blocks = - di->di_stor.block_count; - stor_info[stor_info_no].bsize = - di->di_stor.block_size; - stor_info_no++; - } - } - - if (!stor_info_no) { - debugf("No storage devices\n"); - return (-1); - } - - debugf("storage devices found: %d\n", stor_info_no); - return (0); -} - -static void -stor_cleanup(void) -{ - int i; - - for (i = 0; i < stor_info_no; i++) - if (stor_info[i].opened > 0) - ub_dev_close(stor_info[i].handle); - disk_cleanup(&uboot_storage); -} - -static int -stor_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, - size_t *rsize) -{ - struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - daddr_t bcount; - int err; - - rw &= F_MASK; - if (rw != F_READ) { - stor_printf("write attempt, operation not supported!\n"); - return (EROFS); - } - - if (size % SI(dev).bsize) { - stor_printf("size=%zu not multiple of device " - "block size=%d\n", - size, SI(dev).bsize); - return (EIO); - } - bcount = size / SI(dev).bsize; - if (rsize) - *rsize = 0; - - err = stor_readdev(dev, blk + dev->d_offset, bcount, buf); - if (!err && rsize) - *rsize = size; - - return (err); -} - -static int -stor_open(struct open_file *f, ...) -{ - va_list ap; - struct disk_devdesc *dev; - - va_start(ap, f); - dev = va_arg(ap, struct disk_devdesc *); - va_end(ap); - - return (stor_opendev(dev)); -} - -static int -stor_opendev(struct disk_devdesc *dev) -{ - int err; - - if (dev->dd.d_unit < 0 || dev->dd.d_unit >= stor_info_no) - return (EIO); - - if (SI(dev).opened == 0) { - err = ub_dev_open(SI(dev).handle); - if (err != 0) { - stor_printf("device open failed with error=%d, " - "handle=%d\n", err, SI(dev).handle); - return (ENXIO); - } - SI(dev).opened++; - } - return (disk_open(dev, SI(dev).blocks * SI(dev).bsize, SI(dev).bsize)); -} - -static int -stor_close(struct open_file *f) -{ - struct disk_devdesc *dev; - - dev = (struct disk_devdesc *)(f->f_devdata); - return (disk_close(dev)); -} - -static int -stor_readdev(struct disk_devdesc *dev, daddr_t blk, size_t size, char *buf) -{ - lbasize_t real_size; - int err; - - debugf("reading blk=%d size=%d @ 0x%08x\n", (int)blk, size, (uint32_t)buf); - - err = ub_dev_read(SI(dev).handle, buf, size, blk, &real_size); - if (err != 0) { - stor_printf("read failed, error=%d\n", err); - return (EIO); - } - - if (real_size != size) { - stor_printf("real size != size\n"); - err = EIO; - } - - return (err); -} - -static int -stor_print(int verbose) -{ - struct disk_devdesc dev; - static char line[80]; - int i; - - if (stor_info_no == 0) - return (ret); - - printf("%s devices:", uboot_storage.dv_name); - if ((ret = pager_output("\n")) != 0) - return (ret); - - for (i = 0; i < stor_info_no; i++) { - dev.dd.d_dev = &uboot_storage; - dev.dd.d_unit = i; - dev.d_slice = D_SLICENONE; - dev.d_partition = D_PARTNONE; - sprintf(line, "\tdisk%d (%s)\n", i, - ub_stor_type(SI(&dev).type)); - pager_output(line); - if (stor_opendev(&dev) == 0) { - sprintf(line, "\tdisk%d", i); - disk_print(&dev, line, verbose); - disk_close(&dev); - } - } -} - -static int -stor_ioctl(struct open_file *f, u_long cmd, void *data) -{ - struct disk_devdesc *dev; - - dev = (struct disk_devdesc *)f->f_devdata; - switch (cmd) { - case DIOCGSECTORSIZE: - *(u_int *)data = SI(dev).bsize; - break; - case DIOCGMEDIASIZE: - *(off_t *)data = SI(dev).bsize * SI(dev).blocks; - break; - default: - return (ENOTTY); - } - return (0); -} - - -/* - * Return the device unit number for the given type and type-relative unit - * number. - */ -int -uboot_diskgetunit(int type, int type_unit) -{ - int local_type_unit; - int i; - - local_type_unit = 0; - for (i = 0; i < stor_info_no; i++) { - if ((stor_info[i].type & type) == type) { - if (local_type_unit == type_unit) { - return (i); - } - local_type_unit++; - } - } - - return (-1); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/elf_freebsd.c b/usr/src/boot/sys/boot/uboot/lib/elf_freebsd.c deleted file mode 100644 index b4fd1b3c6f..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/elf_freebsd.c +++ /dev/null @@ -1,100 +0,0 @@ -/*- - * Copyright (c) 2001 Benno Rice <benno@FreeBSD.org> - * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/linker.h> - -#ifdef __mips__ -#include <sys/proc.h> -#include <machine/frame.h> -#endif -#include <machine/md_var.h> -#include <machine/metadata.h> -#include <machine/elf.h> - -#include <stand.h> - -#include "bootstrap.h" -#include "libuboot.h" - -extern vm_offset_t md_load(char *, vm_offset_t *); - -int -__elfN(uboot_load)(char *filename, u_int64_t dest, - struct preloaded_file **result) -{ - int r; - - r = __elfN(loadfile)(filename, dest, result); - if (r != 0) - return (r); - -#if defined(__powerpc__) - /* - * No need to sync the icache for modules: this will - * be done by the kernel after relocation. - */ - if (!strcmp((*result)->f_type, "elf kernel")) - __syncicache((void *) (*result)->f_addr, (*result)->f_size); -#endif - return (0); -} - -int -__elfN(uboot_exec)(struct preloaded_file *fp) -{ - struct file_metadata *fmp; - vm_offset_t mdp; - Elf_Ehdr *e; - int error; - void (*entry)(void *); - - if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) - return (EFTYPE); - - e = (Elf_Ehdr *)&fmp->md_data; - - if ((error = md_load(fp->f_args, &mdp)) != 0) - return (error); - - entry = (void *)e->e_entry; - printf("Kernel entry at 0x%p...\n", entry); - - dev_cleanup(); - printf("Kernel args: %s\n", fp->f_args); - - (*entry)((void *)mdp); - panic("exec returned"); -} - -struct file_format uboot_elf = { - __elfN(uboot_load), - __elfN(uboot_exec) -}; diff --git a/usr/src/boot/sys/boot/uboot/lib/glue.c b/usr/src/boot/sys/boot/uboot/lib/glue.c deleted file mode 100644 index 4c843f0c42..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/glue.c +++ /dev/null @@ -1,529 +0,0 @@ -/*- - * Copyright (c) 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> - -#include <crc32.h> -#include <stand.h> -#include "api_public.h" -#include "glue.h" - -#ifdef DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt,##args); } while (0) -#else -#define debugf(fmt, args...) -#endif - -/* Some random address used by U-Boot. */ -extern long uboot_address; - -static int -valid_sig(struct api_signature *sig) -{ - uint32_t checksum; - struct api_signature s; - - if (sig == NULL) - return (0); - /* - * Clear the checksum field (in the local copy) so as to calculate the - * CRC with the same initial contents as at the time when the sig was - * produced - */ - s = *sig; - s.checksum = 0; - - checksum = crc32((void *)&s, sizeof(struct api_signature)); - - if (checksum != sig->checksum) - return (0); - - return (1); -} - -/* - * Searches for the U-Boot API signature - * - * returns 1/0 depending on found/not found result - */ -int -api_search_sig(struct api_signature **sig) -{ - unsigned char *sp, *spend; - - if (sig == NULL) - return (0); - - if (uboot_address == 0) - uboot_address = 255 * 1024 * 1024; - - sp = (void *)(uboot_address & API_SIG_SEARCH_MASK); - spend = sp + API_SIG_SEARCH_LEN - API_SIG_MAGLEN; - - while (sp < spend) { - if (!bcmp(sp, API_SIG_MAGIC, API_SIG_MAGLEN)) { - *sig = (struct api_signature *)sp; - if (valid_sig(*sig)) - return (1); - } - sp += API_SIG_MAGLEN; - } - - *sig = NULL; - return (0); -} - -/**************************************** - * - * console - * - ****************************************/ - -int -ub_getc(void) -{ - int c; - - if (!syscall(API_GETC, NULL, &c)) - return (-1); - - return (c); -} - -int -ub_tstc(void) -{ - int t; - - if (!syscall(API_TSTC, NULL, &t)) - return (-1); - - return (t); -} - -void -ub_putc(const char c) -{ - - syscall(API_PUTC, NULL, &c); -} - -void -ub_puts(const char *s) -{ - - syscall(API_PUTS, NULL, s); -} - -/**************************************** - * - * system - * - ****************************************/ - -void -ub_reset(void) -{ - - syscall(API_RESET, NULL); -} - -static struct mem_region mr[UB_MAX_MR]; -static struct sys_info si; - -struct sys_info * -ub_get_sys_info(void) -{ - int err = 0; - - memset(&si, 0, sizeof(struct sys_info)); - si.mr = mr; - si.mr_no = UB_MAX_MR; - memset(&mr, 0, sizeof(mr)); - - if (!syscall(API_GET_SYS_INFO, &err, &si)) - return (NULL); - - return ((err) ? NULL : &si); -} - -/**************************************** - * - * timing - * - ****************************************/ - -void -ub_udelay(unsigned long usec) -{ - - syscall(API_UDELAY, NULL, &usec); -} - -unsigned long -ub_get_timer(unsigned long base) -{ - unsigned long cur; - - if (!syscall(API_GET_TIMER, NULL, &cur, &base)) - return (0); - - return (cur); -} - -/**************************************************************************** - * - * devices - * - * Devices are identified by handles: numbers 0, 1, 2, ..., UB_MAX_DEV-1 - * - ***************************************************************************/ - -static struct device_info devices[UB_MAX_DEV]; - -struct device_info * -ub_dev_get(int i) -{ - - return ((i < 0 || i >= UB_MAX_DEV) ? NULL : &devices[i]); -} - -/* - * Enumerates the devices: fills out device_info elements in the devices[] - * array. - * - * returns: number of devices found - */ -int -ub_dev_enum(void) -{ - struct device_info *di; - int n = 0; - - memset(&devices, 0, sizeof(struct device_info) * UB_MAX_DEV); - di = &devices[0]; - - if (!syscall(API_DEV_ENUM, NULL, di)) - return (0); - - while (di->cookie != NULL) { - - if (++n >= UB_MAX_DEV) - break; - - /* take another device_info */ - di++; - - /* pass on the previous cookie */ - di->cookie = devices[n - 1].cookie; - - if (!syscall(API_DEV_ENUM, NULL, di)) - return (0); - } - - return (n); -} - -/* - * handle: 0-based id of the device - * - * returns: 0 when OK, err otherwise - */ -int -ub_dev_open(int handle) -{ - struct device_info *di; - int err = 0; - - if (handle < 0 || handle >= UB_MAX_DEV) - return (API_EINVAL); - - di = &devices[handle]; - if (!syscall(API_DEV_OPEN, &err, di)) - return (-1); - - return (err); -} - -int -ub_dev_close(int handle) -{ - struct device_info *di; - - if (handle < 0 || handle >= UB_MAX_DEV) - return (API_EINVAL); - - di = &devices[handle]; - if (!syscall(API_DEV_CLOSE, NULL, di)) - return (-1); - - return (0); -} - -/* - * Validates device for read/write, it has to: - * - * - have sane handle - * - be opened - * - * returns: 0/1 accordingly - */ -static int -dev_valid(int handle) -{ - - if (handle < 0 || handle >= UB_MAX_DEV) - return (0); - - if (devices[handle].state != DEV_STA_OPEN) - return (0); - - return (1); -} - -static int -dev_stor_valid(int handle) -{ - - if (!dev_valid(handle)) - return (0); - - if (!(devices[handle].type & DEV_TYP_STOR)) - return (0); - - return (1); -} - -int -ub_dev_read(int handle, void *buf, lbasize_t len, lbastart_t start, - lbasize_t *rlen) -{ - struct device_info *di; - lbasize_t act_len; - int err = 0; - - if (!dev_stor_valid(handle)) - return (API_ENODEV); - - di = &devices[handle]; - if (!syscall(API_DEV_READ, &err, di, buf, &len, &start, &act_len)) - return (API_ESYSC); - - if (!err && rlen) - *rlen = act_len; - - return (err); -} - -static int -dev_net_valid(int handle) -{ - - if (!dev_valid(handle)) - return (0); - - if (devices[handle].type != DEV_TYP_NET) - return (0); - - return (1); -} - -int -ub_dev_recv(int handle, void *buf, int len, int *rlen) -{ - struct device_info *di; - int err = 0, act_len; - - if (!dev_net_valid(handle)) - return (API_ENODEV); - - di = &devices[handle]; - if (!syscall(API_DEV_READ, &err, di, buf, &len, &act_len)) - return (API_ESYSC); - - if (!err) - *rlen = act_len; - - return (err); -} - -int -ub_dev_send(int handle, void *buf, int len) -{ - struct device_info *di; - int err = 0; - - if (!dev_net_valid(handle)) - return (API_ENODEV); - - di = &devices[handle]; - if (!syscall(API_DEV_WRITE, &err, di, buf, &len)) - return (API_ESYSC); - - return (err); -} - -char * -ub_stor_type(int type) -{ - - if (type & DT_STOR_IDE) - return ("IDE"); - - if (type & DT_STOR_SCSI) - return ("SCSI"); - - if (type & DT_STOR_USB) - return ("USB"); - - if (type & DT_STOR_MMC) - return ("MMC"); - - if (type & DT_STOR_SATA) - return ("SATA"); - - return ("Unknown"); -} - -char * -ub_mem_type(int flags) -{ - - switch (flags & 0x000F) { - case MR_ATTR_FLASH: - return ("FLASH"); - case MR_ATTR_DRAM: - return ("DRAM"); - case MR_ATTR_SRAM: - return ("SRAM"); - default: - return ("Unknown"); - } -} - -void -ub_dump_di(int handle) -{ - struct device_info *di = ub_dev_get(handle); - int i; - - printf("device info (%d):\n", handle); - printf(" cookie\t= 0x%p\n", di->cookie); - printf(" type\t\t= 0x%08x\n", di->type); - - if (di->type == DEV_TYP_NET) { - printf(" hwaddr\t= "); - for (i = 0; i < 6; i++) - printf("%02x ", di->di_net.hwaddr[i]); - - printf("\n"); - - } else if (di->type & DEV_TYP_STOR) { - printf(" type\t\t= %s\n", ub_stor_type(di->type)); - printf(" blk size\t\t= %ld\n", di->di_stor.block_size); - printf(" blk count\t\t= %ld\n", di->di_stor.block_count); - } -} - -void -ub_dump_si(struct sys_info *si) -{ - int i; - - printf("sys info:\n"); - printf(" clkbus\t= %ld MHz\n", si->clk_bus / 1000 / 1000); - printf(" clkcpu\t= %ld MHz\n", si->clk_cpu / 1000 / 1000); - printf(" bar\t\t= 0x%08lx\n", si->bar); - - printf("---\n"); - for (i = 0; i < si->mr_no; i++) { - if (si->mr[i].flags == 0) - break; - - printf(" start\t= 0x%08lx\n", si->mr[i].start); - printf(" size\t= 0x%08lx\n", si->mr[i].size); - printf(" type\t= %s\n", ub_mem_type(si->mr[i].flags)); - printf("---\n"); - } -} - -/**************************************** - * - * env vars - * - ****************************************/ - -char * -ub_env_get(const char *name) -{ - char *value; - - if (!syscall(API_ENV_GET, NULL, name, &value)) - return (NULL); - - return (value); -} - -void -ub_env_set(const char *name, char *value) -{ - - syscall(API_ENV_SET, NULL, name, value); -} - -static char env_name[256]; - -const char * -ub_env_enum(const char *last) -{ - const char *env, *str; - int i; - - /* - * It's OK to pass only the name piece as last (and not the whole - * 'name=val' string), since the API_ENUM_ENV call uses envmatch() - * internally, which handles such case - */ - env = NULL; - if (!syscall(API_ENV_ENUM, NULL, last, &env)) - return (NULL); - - if (env == NULL || last == env) - /* no more env. variables to enumerate */ - return (NULL); - - /* next enumerated env var */ - memset(env_name, 0, 256); - for (i = 0, str = env; *str != '=' && *str != '\0';) - env_name[i++] = *str++; - - env_name[i] = '\0'; - - return (env_name); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/glue.h b/usr/src/boot/sys/boot/uboot/lib/glue.h deleted file mode 100644 index b9c60b625c..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/glue.h +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * Copyright (c) 2008 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * This is the header file for conveniency wrapper routines (API glue) - */ - -#ifndef _API_GLUE_H_ -#define _API_GLUE_H_ - -#include "api_public.h" - -/* - * Mask used to align the start address for API signature search to 1MiB - */ -#define API_SIG_SEARCH_MASK ~0x000fffff - -#ifdef __mips__ -/* - * On MIPS, U-Boot passes us a hint address, which is very close to the end of - * RAM (less than 1MiB), so searching for the API signature within more than - * that leads to exception. - */ -#define API_SIG_SEARCH_LEN 0x00100000 -#else -/* - * Search for the API signature within 3MiB of the 1MiB-aligned address that - * U-Boot has hinted us. - */ -#define API_SIG_SEARCH_LEN 0x00300000 -#endif - -int syscall(int, int *, ...); -void *syscall_ptr; - -int api_search_sig(struct api_signature **sig); - -#define UB_MAX_MR 16 /* max mem regions number */ -#define UB_MAX_DEV 6 /* max devices number */ - -/* - * The ub_ library calls are part of the application, not U-Boot code! They - * are front-end wrappers that are used by the consumer application: they - * prepare arguments for particular syscall and jump to the low level - * syscall() - */ - -/* console */ -int ub_getc(void); -int ub_tstc(void); -void ub_putc(char); -void ub_puts(const char *); - -/* system */ -void ub_reset(void); -struct sys_info *ub_get_sys_info(void); - -/* time */ -void ub_udelay(unsigned long); -unsigned long ub_get_timer(unsigned long); - -/* env vars */ -char *ub_env_get(const char *); -void ub_env_set(const char *, char *); -const char *ub_env_enum(const char *); - -/* devices */ -int ub_dev_enum(void); -int ub_dev_open(int); -int ub_dev_close(int); -int ub_dev_read(int, void *, lbasize_t, lbastart_t, lbasize_t *); -int ub_dev_send(int, void *, int); -int ub_dev_recv(int, void *, int, int *); -struct device_info *ub_dev_get(int); - -void ub_dump_di(int); -void ub_dump_si(struct sys_info *); -char *ub_mem_type(int); -char *ub_stor_type(int); - -#endif /* _API_GLUE_H_ */ diff --git a/usr/src/boot/sys/boot/uboot/lib/libuboot.h b/usr/src/boot/sys/boot/uboot/lib/libuboot.h deleted file mode 100644 index ff68dcd87c..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/libuboot.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2000 Benno Rice. - * Copyright (C) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -struct uboot_devdesc { - struct devdesc dd; /* Must be first. */ - union { - struct { - int slice; - int partition; - off_t offset; - } disk; - } d_kind; -}; - -#define d_disk d_kind.disk - -/* - * Default network packet alignment in memory - */ -#define PKTALIGN 32 - -int uboot_getdev(void **vdev, const char *devspec, const char **path); -char *uboot_fmtdev(void *vdev); -int uboot_setcurrdev(struct env_var *ev, int flags, const void *value); - -extern int devs_no; -extern struct netif_driver uboot_net; -extern struct devsw uboot_storage; - -extern uintptr_t uboot_heap_start; -extern uintptr_t uboot_heap_end; - -uint64_t uboot_loadaddr(u_int type, void *data, uint64_t addr); -ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len); -ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len); -ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len); -extern int uboot_autoload(void); - -struct preloaded_file; -struct file_format; - -extern struct file_format uboot_elf; - -void reboot(void); - -int uboot_diskgetunit(int type, int type_unit); - diff --git a/usr/src/boot/sys/boot/uboot/lib/module.c b/usr/src/boot/sys/boot/uboot/lib/module.c deleted file mode 100644 index 0951ed6618..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/module.c +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * U-Boot-specific module functionality. - */ - -#include <stand.h> -#include <string.h> - -#if defined(LOADER_FDT_SUPPORT) -#include <fdt_platform.h> -#endif - -#include "bootstrap.h" -#include "libuboot.h" - -int -uboot_autoload(void) -{ -#if defined(LOADER_FDT_SUPPORT) - int err; - - if ((err = fdt_setup_fdtp()) != 0) { - printf("No valid device tree blob found!\n"); - return (err); - } -#endif - - return(0); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/net.c b/usr/src/boot/sys/boot/uboot/lib/net.c deleted file mode 100644 index ba3909d215..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/net.c +++ /dev/null @@ -1,363 +0,0 @@ -/* - * Copyright (c) 2000-2001 Benno Rice - * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> - -#include <net/if.h> -#include <netinet/in.h> -#include <netinet/in_systm.h> -#include <netinet/if_ether.h> -#include <netinet/ip.h> - -#include <stand.h> -#include <net.h> -#include <netif.h> - -#include "api_public.h" -#include "glue.h" -#include "libuboot.h" -#include "dev_net.h" - -static int net_probe(struct netif *, void *); -static int net_match(struct netif *, void *); -static void net_init(struct iodesc *, void *); -static ssize_t net_get(struct iodesc *, void **, time_t); -static ssize_t net_put(struct iodesc *, void *, size_t); -static void net_end(struct netif *); - -extern struct netif_stats net_stats[]; - -struct netif_dif net_ifs[] = { - /* dif_unit dif_nsel dif_stats dif_private */ - { 0, 1, &net_stats[0], 0, }, -}; - -struct netif_stats net_stats[nitems(net_ifs)]; - -struct netif_driver uboot_net = { - "uboot_eth", /* netif_bname */ - net_match, /* netif_match */ - net_probe, /* netif_probe */ - net_init, /* netif_init */ - net_get, /* netif_get */ - net_put, /* netif_put */ - net_end, /* netif_end */ - net_ifs, /* netif_ifs */ - nitems(net_ifs) /* netif_nifs */ -}; - -struct uboot_softc { - uint32_t sc_pad; - uint8_t sc_rxbuf[ETHER_MAX_LEN]; - uint8_t sc_txbuf[ETHER_MAX_LEN + PKTALIGN]; - uint8_t *sc_txbufp; - int sc_handle; /* device handle for ub_dev_xxx */ -}; - -static struct uboot_softc uboot_softc; - -/* - * get_env_net_params() - * - * Attempt to obtain all the parms we need for netbooting from the U-Boot - * environment. If we fail to obtain the values it may still be possible to - * netboot; the net_dev code will attempt to get the values from bootp, rarp, - * and other such sources. - * - * If rootip.s_addr is non-zero net_dev assumes the required global variables - * are set and skips the bootp inquiry. For that reason, we don't set rootip - * until we've verified that we have at least the minimum required info. - * - * This is called from netif_init() which can result in it getting called - * multiple times, by design. The network code at higher layers zeroes out - * rootip when it closes a network interface, so if it gets opened again we have - * to obtain all this info again. - */ -static void -get_env_net_params() -{ - char *envstr; - in_addr_t rootaddr, serveraddr; - - /* - * Silently get out right away if we don't have rootpath, because none - * of the other info we obtain below is sufficient to boot without it. - * - * If we do have rootpath, copy it into the global var and also set - * dhcp.root-path in the env. If we don't get all the other info from - * the u-boot env below, we will still try dhcp/bootp, but the server- - * provided path will not replace the user-provided value we set here. - */ - if ((envstr = ub_env_get("rootpath")) == NULL) - return; - strlcpy(rootpath, envstr, sizeof (rootpath)); - setenv("dhcp.root-path", rootpath, 0); - - /* - * Our own IP address must be valid. Silently get out if it's not set, - * but whine if it's there and we can't parse it. - */ - if ((envstr = ub_env_get("ipaddr")) == NULL) - return; - if ((myip.s_addr = inet_addr(envstr)) == INADDR_NONE) { - printf("Could not parse ipaddr '%s'\n", envstr); - return; - } - - /* - * Netmask is optional, default to the "natural" netmask for our IP, but - * whine if it was provided and we couldn't parse it. - */ - if ((envstr = ub_env_get("netmask")) != NULL && - (netmask = inet_addr(envstr)) == INADDR_NONE) { - printf("Could not parse netmask '%s'\n", envstr); - } - if (netmask == INADDR_NONE) { - if (IN_CLASSA(myip.s_addr)) - netmask = IN_CLASSA_NET; - else if (IN_CLASSB(myip.s_addr)) - netmask = IN_CLASSB_NET; - else - netmask = IN_CLASSC_NET; - } - - /* - * Get optional serverip before rootpath; the latter can override it. - * Whine only if it's present but can't be parsed. - */ - serveraddr = INADDR_NONE; - if ((envstr = ub_env_get("serverip")) != NULL) { - if ((serveraddr = inet_addr(envstr)) == INADDR_NONE) - printf("Could not parse serverip '%s'\n", envstr); - } - - /* - * There must be a rootpath. It may be ip:/path or it may be just the - * path in which case the ip needs to be in serverip. - */ - rootaddr = net_parse_rootpath(); - if (rootaddr == INADDR_NONE) - rootaddr = serveraddr; - if (rootaddr == INADDR_NONE) { - printf("No server address for rootpath '%s'\n", envstr); - return; - } - rootip.s_addr = rootaddr; - - /* - * Gateway IP is optional unless rootip is on a different net in which - * case whine if it's missing or we can't parse it, and set rootip addr - * to zero, which signals to other network code that network params - * aren't set (so it will try dhcp, bootp, etc). - */ - envstr = ub_env_get("gatewayip"); - if (!SAMENET(myip, rootip, netmask)) { - if (envstr == NULL) { - printf("Need gatewayip for a root server on a " - "different network.\n"); - rootip.s_addr = 0; - return; - } - if ((gateip.s_addr = inet_addr(envstr) == INADDR_NONE)) { - printf("Could not parse gatewayip '%s'\n", envstr); - rootip.s_addr = 0; - return; - } - } -} - -static int -net_match(struct netif *nif, void *machdep_hint) -{ - char **a = (char **)machdep_hint; - - if (memcmp("net", *a, 3) == 0) - return (1); - - printf("net_match: could not match network device\n"); - return (0); -} - -static int -net_probe(struct netif *nif, void *machdep_hint) -{ - struct device_info *di; - int i; - - for (i = 0; i < devs_no; i++) - if ((di = ub_dev_get(i)) != NULL) - if (di->type == DEV_TYP_NET) - break; - - if (i == devs_no) { - printf("net_probe: no network devices found, maybe not" - " enumerated yet..?\n"); - return (-1); - } - -#if defined(NETIF_DEBUG) - printf("net_probe: network device found: %d\n", i); -#endif - uboot_softc.sc_handle = i; - - return (0); -} - -static ssize_t -net_put(struct iodesc *desc, void *pkt, size_t len) -{ - struct netif *nif = desc->io_netif; - struct uboot_softc *sc = nif->nif_devdata; - size_t sendlen; - ssize_t rv; - -#if defined(NETIF_DEBUG) - struct ether_header *eh; - - printf("net_put: desc %p, pkt %p, len %d\n", desc, pkt, len); - eh = pkt; - printf("dst: %s ", ether_sprintf(eh->ether_dhost)); - printf("src: %s ", ether_sprintf(eh->ether_shost)); - printf("type: 0x%x\n", eh->ether_type & 0xffff); -#endif - - if (len < ETHER_MIN_LEN - ETHER_CRC_LEN) { - sendlen = ETHER_MIN_LEN - ETHER_CRC_LEN; - bzero(sc->sc_txbufp, sendlen); - } else - sendlen = len; - - memcpy(sc->sc_txbufp, pkt, len); - - rv = ub_dev_send(sc->sc_handle, sc->sc_txbufp, sendlen); - -#if defined(NETIF_DEBUG) - printf("net_put: ub_send returned %d\n", rv); -#endif - if (rv == 0) - rv = len; - else - rv = -1; - - return (rv); -} - -static ssize_t -net_get(struct iodesc *desc, void **pkt, time_t timeout) -{ - struct netif *nif = desc->io_netif; - struct uboot_softc *sc = nif->nif_devdata; - time_t t; - int err, rlen; - size_t len; - char *buf; - -#if defined(NETIF_DEBUG) - printf("net_get: pkt %p, timeout %d\n", pkt, timeout); -#endif - t = getsecs(); - len = sizeof (sc->sc_rxbuf); - do { - err = ub_dev_recv(sc->sc_handle, sc->sc_rxbuf, len, &rlen); - - if (err != 0) { - printf("net_get: ub_dev_recv() failed, error=%d\n", - err); - rlen = 0; - break; - } - } while ((rlen == -1 || rlen == 0) && (getsecs() - t < timeout)); - -#if defined(NETIF_DEBUG) - printf("net_get: received len %d (%x)\n", rlen, rlen); -#endif - - if (rlen > 0) { - buf = malloc(rlen + ETHER_ALIGN); - if (buf == NULL) - return (-1); - memcpy(buf + ETHER_ALIGN, sc->sc_rxbuf, rlen); - *pkt = buf; - return ((ssize_t)rlen); - } - - return (-1); -} - -static void -net_init(struct iodesc *desc, void *machdep_hint) -{ - struct netif *nif = desc->io_netif; - struct uboot_softc *sc; - struct device_info *di; - int err; - - sc = nif->nif_devdata = &uboot_softc; - - if ((err = ub_dev_open(sc->sc_handle)) != 0) - panic("%s%d: initialisation failed with error %d", - nif->nif_driver->netif_bname, nif->nif_unit, err); - - /* Get MAC address */ - di = ub_dev_get(sc->sc_handle); - memcpy(desc->myea, di->di_net.hwaddr, 6); - if (memcmp(desc->myea, "\0\0\0\0\0\0", 6) == 0) { - panic("%s%d: empty ethernet address!", - nif->nif_driver->netif_bname, nif->nif_unit); - } - - /* Attempt to get netboot params from the u-boot env. */ - get_env_net_params(); - if (myip.s_addr != 0) - desc->myip = myip; - -#if defined(NETIF_DEBUG) - printf("network: %s%d attached to %s\n", nif->nif_driver->netif_bname, - nif->nif_unit, ether_sprintf(desc->myea)); -#endif - - /* Set correct alignment for TX packets */ - sc->sc_txbufp = sc->sc_txbuf; - if ((unsigned long)sc->sc_txbufp % PKTALIGN) - sc->sc_txbufp += PKTALIGN - - (unsigned long)sc->sc_txbufp % PKTALIGN; -} - -static void -net_end(struct netif *nif) -{ - struct uboot_softc *sc = nif->nif_devdata; - int err; - - if ((err = ub_dev_close(sc->sc_handle)) != 0) - panic("%s%d: net_end failed with error %d", - nif->nif_driver->netif_bname, nif->nif_unit, err); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/reboot.c b/usr/src/boot/sys/boot/uboot/lib/reboot.c deleted file mode 100644 index 9f4d277eb6..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/reboot.c +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include "glue.h" - -void -exit(int code) -{ - - ub_reset(); -} diff --git a/usr/src/boot/sys/boot/uboot/lib/time.c b/usr/src/boot/sys/boot/uboot/lib/time.c deleted file mode 100644 index b50eb112fa..0000000000 --- a/usr/src/boot/sys/boot/uboot/lib/time.c +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * Copyright (c) 2000 Benno Rice - * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <stand.h> - -#include "glue.h" - -/* - * Return the time in seconds since the beginning of the day. - */ -time_t -time(time_t *tloc) -{ - int secs; - - secs = ub_get_timer(0) / 1000; - if (tloc) - *tloc = secs; - - return (secs); -} - -time_t -getsecs(void) -{ - - return (time(NULL)); -} - -/* - * Use U-Boot udelay() function to wait for a given microseconds period - */ -void -delay(int usecs) -{ - - ub_udelay(usecs); -} diff --git a/usr/src/boot/sys/boot/usb/Makefile b/usr/src/boot/sys/boot/usb/Makefile deleted file mode 100644 index 6ad13d0173..0000000000 --- a/usr/src/boot/sys/boot/usb/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# -# $FreeBSD$ -# -# Copyright (c) 2013 Hans Petter Selasky. -# Copyright (c) 2014 SRI International -# All rights reserved. -# -# This software was developed by SRI International and the University of -# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 -# ("CTSRD"), as part of the DARPA CRASH research programme. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# - -LIB= usbboot -INTERNALLIB= - -CFLAGS+= -DBOOTPROG=\"usbloader\" -CFLAGS+= -ffunction-sections -fdata-sections -CFLAGS+= -ffreestanding -CFLAGS+= -Wformat -Wall -CFLAGS+= -g -CFLAGS+= -fno-pic - -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -.endif -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -.endif -.if ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -mno-abicalls -.endif - - -.include "usbcore.mk" -.include "../kshim/kshim.mk" -.include <bsd.lib.mk> diff --git a/usr/src/boot/sys/boot/usb/Makefile.test b/usr/src/boot/sys/boot/usb/Makefile.test deleted file mode 100644 index 9b6478a0bb..0000000000 --- a/usr/src/boot/sys/boot/usb/Makefile.test +++ /dev/null @@ -1,60 +0,0 @@ -# -# $FreeBSD$ -# -# Copyright (c) 2013 Hans Petter Selasky. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# - -# -# USB test application -# - -.PATH: ${.CURDIR} - -PROG= usbloader -MAN= -SRCS= - -CFLAGS+= -Wall -CFLAGS+= -g - -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -.endif -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -.endif - -LDFLAGS+= -Wl,--gc-sections - -SRCS+= bsd_usbloader_test.c - -LDADD+= libusbboot.a -DPADD+= libusbboot.a - -.include <bsd.prog.mk> - -${PROG}: libusbboot.a - -libusbboot.a: - make -f Makefile diff --git a/usr/src/boot/sys/boot/usb/bsd_usbloader_test.c b/usr/src/boot/sys/boot/usb/bsd_usbloader_test.c deleted file mode 100644 index 8744e2e763..0000000000 --- a/usr/src/boot/sys/boot/usb/bsd_usbloader_test.c +++ /dev/null @@ -1,95 +0,0 @@ -/* $FreeBSD$ */ -/*- - * Copyright (c) 2013 Hans Petter Selasky. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <stdio.h> -#include <stdint.h> -#include <stdlib.h> -#include <time.h> - -extern int usleep(int); -extern void callout_process(int); -extern void usb_idle(void); -extern void usb_init(void); -extern void usb_uninit(void); - -#define hz 1000 - -#ifdef HAVE_MALLOC -void * -usb_malloc(size_t size) -{ - return (malloc(size)); -} - -void -usb_free(void *ptr) -{ - free(ptr); -} -#endif - -void -DELAY(unsigned int delay) -{ - usleep(delay); -} - -int -pause(const char *what, int timeout) -{ - if (timeout == 0) - timeout = 1; - - usleep((1000000 / hz) * timeout); - - return (0); -} - -int -main(int argc, char **argv) -{ - uint32_t time; - - usb_init(); - - time = 0; - - while (1) { - - usb_idle(); - - usleep(1000); - - if (++time >= (1000 / hz)) { - time = 0; - callout_process(1); - } - } - - usb_uninit(); - - return (0); -} diff --git a/usr/src/boot/sys/boot/usb/storage/umass_common.c b/usr/src/boot/sys/boot/usb/storage/umass_common.c deleted file mode 100644 index 5ddd159297..0000000000 --- a/usr/src/boot/sys/boot/usb/storage/umass_common.c +++ /dev/null @@ -1,90 +0,0 @@ -/* $FreeBSD$ */ -/*- - * Copyright (c) 2014 Hans Petter Selasky <hselasky@FreeBSD.org> - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include USB_GLOBAL_INCLUDE_FILE - -#include "umass_common.h" - -struct usb_attach_arg umass_uaa; - -static device_probe_t umass_probe; -static device_attach_t umass_attach; -static device_detach_t umass_detach; - -static devclass_t umass_devclass; - -static device_method_t umass_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, umass_probe), - DEVMETHOD(device_attach, umass_attach), - DEVMETHOD(device_detach, umass_detach), - - DEVMETHOD_END -}; - -static driver_t umass_driver = { - .name = "umass", - .methods = umass_methods, -}; - -DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, NULL, 0); - -static int -umass_probe(device_t dev) -{ - struct usb_attach_arg *uaa = device_get_ivars(dev); - - if (uaa->usb_mode != USB_MODE_HOST || - uaa->info.bInterfaceClass != UICLASS_MASS || - uaa->info.bInterfaceSubClass != UISUBCLASS_SCSI || - uaa->info.bInterfaceProtocol != UIPROTO_MASS_BBB || - device_get_unit(dev) != 0) - return (ENXIO); - return (0); -} - -static int -umass_attach(device_t dev) -{ - struct usb_attach_arg *uaa = device_get_ivars(dev); - umass_uaa = *uaa; - return (0); /* success */ -} - -static int -umass_detach(device_t dev) -{ - -#ifdef USB_DEBUG - memset(&umass_uaa, 0, sizeof(umass_uaa)); -#endif - return (0); -} diff --git a/usr/src/boot/sys/boot/usb/storage/umass_common.h b/usr/src/boot/sys/boot/usb/storage/umass_common.h deleted file mode 100644 index a8ffd4987e..0000000000 --- a/usr/src/boot/sys/boot/usb/storage/umass_common.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $FreeBSD$ */ -/*- - * Copyright (c) 2014 Hans Petter Selasky <hselasky@FreeBSD.org> - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _UMASS_COMMON_H_ -#define _UMASS_COMMON_H_ - -struct usb_attach_arg; -struct devsw; - -extern struct usb_attach_arg umass_uaa; -extern struct devsw umass_disk; - -#endif /* _UMASS_COMMON_H_ */ diff --git a/usr/src/boot/sys/boot/usb/storage/umass_loader.c b/usr/src/boot/sys/boot/usb/storage/umass_loader.c deleted file mode 100644 index cb9d632ebe..0000000000 --- a/usr/src/boot/sys/boot/usb/storage/umass_loader.c +++ /dev/null @@ -1,227 +0,0 @@ -/* $FreeBSD$ */ -/*- - * Copyright (c) 2014 Hans Petter Selasky <hselasky@FreeBSD.org> - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/param.h> - -#include <bootstrap.h> -#include <stdarg.h> - -#include <stand.h> -#include <disk.h> - -#define HAVE_STANDARD_DEFS - -#include USB_GLOBAL_INCLUDE_FILE - -#include "umass_common.h" - -static int umass_disk_init(void); -static int umass_disk_open(struct open_file *,...); -static int umass_disk_close(struct open_file *); -static void umass_disk_cleanup(void); -static int umass_disk_ioctl(struct open_file *, u_long, void *); -static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); -static int umass_disk_print(int); - -struct devsw umass_disk = { - .dv_name = "umass", - .dv_type = DEVT_DISK, - .dv_init = umass_disk_init, - .dv_strategy = umass_disk_strategy, - .dv_open = umass_disk_open, - .dv_close = umass_disk_close, - .dv_ioctl = umass_disk_ioctl, - .dv_print = umass_disk_print, - .dv_cleanup = umass_disk_cleanup, -}; - -static int -umass_disk_init(void) -{ - uint32_t time; - - usb_init(); - usb_needs_explore_all(); - - /* wait 8 seconds for a USB mass storage device to appear */ - for (time = 0; time < (8 * hz); time++) { - usb_idle(); - delay(1000000 / hz); - time++; - callout_process(1); - if (umass_uaa.device != NULL) - return (0); - } - return (0); -} - -static int -umass_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, - char *buf, size_t *rsizep) -{ - if (umass_uaa.device == NULL) - return (ENXIO); - if (rsizep != NULL) - *rsizep = 0; - - flag &= F_MASK; - if (flag == F_WRITE) { - if (usb_msc_write_10(umass_uaa.device, 0, dblk, size >> 9, buf) != 0) - return (EINVAL); - } else if (flag == F_READ) { - if (usb_msc_read_10(umass_uaa.device, 0, dblk, size >> 9, buf) != 0) - return (EINVAL); - } else { - return (EROFS); - } - - if (rsizep != NULL) - *rsizep = size; - return (0); -} - -static int -umass_disk_open_sub(struct disk_devdesc *dev) -{ - uint32_t nblock; - uint32_t blocksize; - - if (usb_msc_read_capacity(umass_uaa.device, 0, &nblock, &blocksize) != 0) - return (EINVAL); - - return (disk_open(dev, ((uint64_t)nblock + 1) * (uint64_t)blocksize, blocksize)); -} - -static int -umass_disk_open(struct open_file *f,...) -{ - va_list ap; - struct disk_devdesc *dev; - - va_start(ap, f); - dev = va_arg(ap, struct disk_devdesc *); - va_end(ap); - - if (umass_uaa.device == NULL) - return (ENXIO); - if (dev->d_unit != 0) - return (EIO); - return (umass_disk_open_sub(dev)); -} - -static int -umass_disk_ioctl(struct open_file *f __unused, u_long cmd, void *buf) -{ - uint32_t nblock; - uint32_t blocksize; - - switch (cmd) { - case IOCTL_GET_BLOCK_SIZE: - case IOCTL_GET_BLOCKS: - if (usb_msc_read_capacity(umass_uaa.device, 0, - &nblock, &blocksize) != 0) - return (EINVAL); - - if (cmd == IOCTL_GET_BLOCKS) - *(uint32_t*)buf = nblock; - else - *(uint32_t*)buf = blocksize; - - return (0); - default: - return (ENXIO); - } -} - -static int -umass_disk_close(struct open_file *f) -{ - struct disk_devdesc *dev; - - dev = (struct disk_devdesc *)f->f_devdata; - return (disk_close(dev)); -} - -static int -umass_disk_print(int verbose) -{ - struct disk_devdesc dev; - - printf("%s devices:", umass_disk.dv_name); - if (pager_output("\n") != 0) - return (1); - - memset(&dev, 0, sizeof(dev)); - - pager_output(" umass0 UMASS device\n"); - dev.d_dev = &umass_disk; - dev.d_unit = 0; - dev.d_slice = D_SLICENONE; - dev.d_partition = D_PARTNONE; - - if (umass_disk_open_sub(&dev) == 0) { - disk_print(&dev, " umass0", verbose); - disk_close(&dev); - } -} - -static void -umass_disk_cleanup(void) -{ - disk_cleanup(&umass_disk); - - usb_uninit(); -} - - -/* USB specific functions */ - -extern void callout_process(int); -extern void usb_idle(void); -extern void usb_init(void); -extern void usb_uninit(void); - -void -DELAY(unsigned int usdelay) -{ - delay(usdelay); -} - -int -pause(const char *what, int timeout) -{ - if (timeout == 0) - timeout = 1; - - delay((1000000 / hz) * timeout); - - return (0); -} diff --git a/usr/src/boot/sys/boot/usb/tools/Makefile b/usr/src/boot/sys/boot/usb/tools/Makefile deleted file mode 100644 index 64cf28ca75..0000000000 --- a/usr/src/boot/sys/boot/usb/tools/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -PROG= sysinit -MAN= - -CFLAGS+= -I${.CURDIR}/../../kshim - -BINDIR?= /usr/bin - -.include <bsd.prog.mk> diff --git a/usr/src/boot/sys/boot/usb/tools/sysinit.c b/usr/src/boot/sys/boot/usb/tools/sysinit.c deleted file mode 100644 index b968fe0ab8..0000000000 --- a/usr/src/boot/sys/boot/usb/tools/sysinit.c +++ /dev/null @@ -1,331 +0,0 @@ -/* $FreeBSD$ */ -/*- - * Copyright (c) 2013 Hans Petter Selasky. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * This utility sorts sysinit structure entries in binary format and - * prints out the result in C-format. - */ - -#include <stdio.h> -#include <stdint.h> -#include <stdlib.h> -#include <err.h> -#include <unistd.h> -#include <fcntl.h> -#include <string.h> -#include <sysexits.h> -#include "sysinit.h" - -static int opt_R; -static const char *input_f; -static const char *output_f; -static const char *struct_name; -static const char *keyword; -static struct sysinit_data **start; -static struct sysinit_data **stop; - -static int input_file = -1; -static int output_file = -1; - -static uint8_t *input_ptr; -static uint32_t input_len; - -static uint32_t endian32; - -static char scratch_buf[4096]; - -static int success; - -static void do_sysinit(void); - -/* the following function converts the numbers into host endian format */ - -static uint32_t -read32(uint32_t val) -{ - uint32_t temp; - uint32_t endian; - - endian = endian32; - temp = 0; - - while (val) { - temp |= (val & 0xF) << ((endian & 0xF) * 4); - endian >>= 4; - val >>= 4; - } - return (temp); -} - -static void -do_write(int fd, const char *buf) -{ - int len = strlen(buf); - - if (write(fd, buf, len) != len) - err(EX_SOFTWARE, "Could not write to output file"); -} - -static void * -do_malloc(int size) -{ - void *ptr; - - ptr = malloc(size); - if (ptr == NULL) - errx(EX_SOFTWARE, "Could not allocate memory"); - return (ptr); -} - -static void -usage(void) -{ - errx(EX_USAGE, "sysinit -i sysinit.bin -o sysinit_data.c \\\n" - "\t" "-k sysinit -s sysinit_data [ -R (reverse)]"); -} - -static void -cleanup(void) -{ - if (output_file >= 0) - close(output_file); - if (input_file >= 0) - close(input_file); - if (success == 0) { - if (output_f) - unlink(output_f); - } -} - -static int -compare(const void *_pa, const void *_pb) -{ - const struct sysinit_data * const *pa = _pa; - const struct sysinit_data * const *pb = _pb; - - if ((*pa)->dw_msb_value > (*pb)->dw_msb_value) - return (1); - - if ((*pa)->dw_msb_value < (*pb)->dw_msb_value) - return (-1); - - if ((*pa)->dw_lsb_value > (*pb)->dw_lsb_value) - return (1); - - if ((*pa)->dw_lsb_value < (*pb)->dw_lsb_value) - return (-1); - - return (0); /* equal */ -} - -static int -compare_R(const void *_pa, const void *_pb) -{ - const struct sysinit_data * const *pa = _pa; - const struct sysinit_data * const *pb = _pb; - - if ((*pa)->dw_msb_value > (*pb)->dw_msb_value) - return (-1); - - if ((*pa)->dw_msb_value < (*pb)->dw_msb_value) - return (1); - - if ((*pa)->dw_lsb_value > (*pb)->dw_lsb_value) - return (-1); - - if ((*pa)->dw_lsb_value < (*pb)->dw_lsb_value) - return (1); - - return (0); /* equal */ -} - -int -main(int argc, char **argv) -{ - struct sysinit_data **sipp; - int c; - int entries; - off_t off; - - while ((c = getopt(argc, argv, "k:s:i:o:Rh")) != -1) { - switch (c) { - case 'i': - input_f = optarg; - break; - case 'o': - output_f = optarg; - break; - case 'R': - opt_R = 1; - break; - case 'k': - keyword = optarg; - break; - case 's': - struct_name = optarg; - break; - default: - usage(); - } - } - - if (input_f == NULL || output_f == NULL || - struct_name == NULL || keyword == NULL) - usage(); - - atexit(&cleanup); - - cleanup(); - - input_file = open(input_f, O_RDONLY); - if (input_file < 0) - err(EX_SOFTWARE, "Could not open input file: %s", input_f); - - output_file = open(output_f, O_TRUNC | O_CREAT | O_RDWR, 0600); - if (output_file < 0) - err(EX_SOFTWARE, "Could not open output file: %s", output_f); - - off = lseek(input_file, 0, SEEK_END); - - input_ptr = do_malloc(off); - input_len = off; - - if (input_len % (uint32_t)sizeof(struct sysinit_data)) { - errx(EX_SOFTWARE, "Input file size is not divisible by %u", - (unsigned int)sizeof(struct sysinit_data)); - } - off = lseek(input_file, 0, SEEK_SET); - if (off < 0) - err(EX_SOFTWARE, "Could not seek to start of input file"); - - if (read(input_file, input_ptr, input_len) != input_len) - err(EX_SOFTWARE, "Could not read input file"); - - entries = input_len / (uint32_t)sizeof(struct sysinit_data); - - start = do_malloc(sizeof(void *) * entries); - stop = start + entries; - - for (c = 0; c != entries; c++) - start[c] = &((struct sysinit_data *)input_ptr)[c]; - - if (start != stop) - endian32 = (*start)->dw_endian32; - - /* switch all fields to host endian order */ - for (sipp = start; sipp < stop; sipp++) { - (*sipp)->dw_lsb_value = read32((*sipp)->dw_lsb_value); - (*sipp)->dw_msb_value = read32((*sipp)->dw_msb_value); - (*sipp)->dw_file_line = read32((*sipp)->dw_file_line); - } - - if (opt_R == 0) { - /* sort entries, rising numerical order */ - qsort(start, entries, sizeof(void *), &compare); - } else { - /* sort entries, falling numerical order */ - qsort(start, entries, sizeof(void *), &compare_R); - } - - /* safe all strings */ - for (sipp = start; sipp < stop; sipp++) { - (*sipp)->b_keyword_name[sizeof((*sipp)->b_keyword_name) - 1] = 0; - (*sipp)->b_global_type[sizeof((*sipp)->b_global_type) - 1] = 0; - (*sipp)->b_global_name[sizeof((*sipp)->b_global_name) - 1] = 0; - (*sipp)->b_file_name[sizeof((*sipp)->b_file_name) - 1] = 0; - (*sipp)->b_debug_info[sizeof((*sipp)->b_debug_info) - 1] = 0; - } - - if (strcmp(keyword, "sysinit") == 0) - do_sysinit(); - else if (strcmp(keyword, "sysuninit") == 0) - do_sysinit(); - else - errx(EX_USAGE, "Unknown keyword '%s'", keyword); - - success = 1; - - return (0); -} - -static void -do_sysinit(void) -{ - struct sysinit_data **sipp; - int c; - - snprintf(scratch_buf, sizeof(scratch_buf), - "/*\n" - " * This file was automatically generated.\n" - " * Please do not edit.\n" - " */\n\n"); - - /* write out externals */ - for (c = 0, sipp = start; sipp < stop; c++, sipp++) { - if (strcmp((const char *)(*sipp)->b_keyword_name, keyword)) - continue; - if ((*sipp)->dw_msb_value == 0) - continue; - - snprintf(scratch_buf, sizeof(scratch_buf), - "/* #%04u: %s entry at %s:%u */\n", - c, (*sipp)->b_debug_info, (*sipp)->b_file_name, - (unsigned int)(*sipp)->dw_file_line); - - do_write(output_file, scratch_buf); - - snprintf(scratch_buf, sizeof(scratch_buf), - "extern %s %s;\n\n", (*sipp)->b_global_type, - (*sipp)->b_global_name); - - do_write(output_file, scratch_buf); - } - - snprintf(scratch_buf, sizeof(scratch_buf), - "const void *%s[] = {\n", struct_name); - - do_write(output_file, scratch_buf); - - /* write out actual table */ - for (c = 0, sipp = start; sipp < stop; c++, sipp++) { - if (strcmp((const char *)(*sipp)->b_keyword_name, keyword)) - continue; - if ((*sipp)->dw_msb_value == 0) - continue; - - snprintf(scratch_buf, sizeof(scratch_buf), - "\t&%s, /* #%04u */\n", - (*sipp)->b_global_name, (unsigned int)c); - - do_write(output_file, scratch_buf); - } - - snprintf(scratch_buf, sizeof(scratch_buf), - "\t(const void *)0\n" - "};\n"); - - do_write(output_file, scratch_buf); -} diff --git a/usr/src/boot/sys/boot/usb/usb_busdma_loader.c b/usr/src/boot/sys/boot/usb/usb_busdma_loader.c deleted file mode 100644 index 90dc1692ba..0000000000 --- a/usr/src/boot/sys/boot/usb/usb_busdma_loader.c +++ /dev/null @@ -1,619 +0,0 @@ -/* $FreeBSD$ */ -/*- - * Copyright (c) 2013 Hans Petter Selasky. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <bsd_global.h> - -#if USB_HAVE_BUSDMA -static void usb_pc_common_mem_cb(struct usb_page_cache *pc, - void *vaddr, uint32_t length); -#endif - -/*------------------------------------------------------------------------* - * usbd_get_page - lookup DMA-able memory for the given offset - * - * NOTE: Only call this function when the "page_cache" structure has - * been properly initialized ! - *------------------------------------------------------------------------*/ -void -usbd_get_page(struct usb_page_cache *pc, usb_frlength_t offset, - struct usb_page_search *res) -{ -#if USB_HAVE_BUSDMA - struct usb_page *page; - - if (pc->page_start) { - - /* Case 1 - something has been loaded into DMA */ - - if (pc->buffer) { - - /* Case 1a - Kernel Virtual Address */ - - res->buffer = USB_ADD_BYTES(pc->buffer, offset); - } - offset += pc->page_offset_buf; - - /* compute destination page */ - - page = pc->page_start; - - if (pc->ismultiseg) { - - page += (offset / USB_PAGE_SIZE); - - offset %= USB_PAGE_SIZE; - - res->length = USB_PAGE_SIZE - offset; - res->physaddr = page->physaddr + offset; - } else { - res->length = (usb_size_t)-1; - res->physaddr = page->physaddr + offset; - } - if (!pc->buffer) { - - /* Case 1b - Non Kernel Virtual Address */ - - res->buffer = USB_ADD_BYTES(page->buffer, offset); - } - return; - } -#endif - /* Case 2 - Plain PIO */ - - res->buffer = USB_ADD_BYTES(pc->buffer, offset); - res->length = (usb_size_t)-1; -#if USB_HAVE_BUSDMA - res->physaddr = 0; -#endif -} - -/*------------------------------------------------------------------------* - * usbd_copy_in - copy directly to DMA-able memory - *------------------------------------------------------------------------*/ -void -usbd_copy_in(struct usb_page_cache *cache, usb_frlength_t offset, - const void *ptr, usb_frlength_t len) -{ - struct usb_page_search buf_res; - - while (len != 0) { - - usbd_get_page(cache, offset, &buf_res); - - if (buf_res.length > len) { - buf_res.length = len; - } - memcpy(buf_res.buffer, ptr, buf_res.length); - - offset += buf_res.length; - len -= buf_res.length; - ptr = USB_ADD_BYTES(ptr, buf_res.length); - } -} - -/*------------------------------------------------------------------------* - * usbd_copy_out - copy directly from DMA-able memory - *------------------------------------------------------------------------*/ -void -usbd_copy_out(struct usb_page_cache *cache, usb_frlength_t offset, - void *ptr, usb_frlength_t len) -{ - struct usb_page_search res; - - while (len != 0) { - - usbd_get_page(cache, offset, &res); - - if (res.length > len) { - res.length = len; - } - memcpy(ptr, res.buffer, res.length); - - offset += res.length; - len -= res.length; - ptr = USB_ADD_BYTES(ptr, res.length); - } -} - -/*------------------------------------------------------------------------* - * usbd_frame_zero - zero DMA-able memory - *------------------------------------------------------------------------*/ -void -usbd_frame_zero(struct usb_page_cache *cache, usb_frlength_t offset, - usb_frlength_t len) -{ - struct usb_page_search res; - - while (len != 0) { - - usbd_get_page(cache, offset, &res); - - if (res.length > len) { - res.length = len; - } - memset(res.buffer, 0, res.length); - - offset += res.length; - len -= res.length; - } -} - -#if USB_HAVE_BUSDMA - -/*------------------------------------------------------------------------* - * usb_pc_common_mem_cb - BUS-DMA callback function - *------------------------------------------------------------------------*/ -static void -usb_pc_common_mem_cb(struct usb_page_cache *pc, - void *vaddr, uint32_t length) -{ - struct usb_page *pg; - usb_size_t rem; - bus_size_t off; - bus_addr_t phys = (uintptr_t)vaddr; /* XXX */ - uint32_t nseg; - - if (length == 0) - nseg = 1; - else - nseg = ((length + USB_PAGE_SIZE - 1) / USB_PAGE_SIZE); - - pg = pc->page_start; - pg->physaddr = phys & ~(USB_PAGE_SIZE - 1); - rem = phys & (USB_PAGE_SIZE - 1); - pc->page_offset_buf = rem; - pc->page_offset_end += rem; - length += rem; - - for (off = USB_PAGE_SIZE; off < length; off += USB_PAGE_SIZE) { - pg++; - pg->physaddr = (phys + off) & ~(USB_PAGE_SIZE - 1); - } -} - -/*------------------------------------------------------------------------* - * usb_pc_alloc_mem - allocate DMA'able memory - * - * Returns: - * 0: Success - * Else: Failure - *------------------------------------------------------------------------*/ -uint8_t -usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg, - usb_size_t size, usb_size_t align) -{ - void *ptr; - uint32_t rem; - - /* allocate zeroed memory */ - - if (align != 1) { - ptr = malloc(size + align, XXX, XXX); - if (ptr == NULL) - goto error; - - rem = (-((uintptr_t)ptr)) & (align - 1); - } else { - ptr = malloc(size, XXX, XXX); - if (ptr == NULL) - goto error; - rem = 0; - } - - /* setup page cache */ - pc->buffer = ((uint8_t *)ptr) + rem; - pc->page_start = pg; - pc->page_offset_buf = 0; - pc->page_offset_end = size; - pc->map = NULL; - pc->tag = ptr; - pc->ismultiseg = (align == 1); - - /* compute physical address */ - usb_pc_common_mem_cb(pc, pc->buffer, size); - - usb_pc_cpu_flush(pc); - return (0); - -error: - /* reset most of the page cache */ - pc->buffer = NULL; - pc->page_start = NULL; - pc->page_offset_buf = 0; - pc->page_offset_end = 0; - pc->map = NULL; - pc->tag = NULL; - return (1); -} - -/*------------------------------------------------------------------------* - * usb_pc_free_mem - free DMA memory - * - * This function is NULL safe. - *------------------------------------------------------------------------*/ -void -usb_pc_free_mem(struct usb_page_cache *pc) -{ - if (pc != NULL && pc->buffer != NULL) { - free(pc->tag, XXX); - pc->buffer = NULL; - } -} - -/*------------------------------------------------------------------------* - * usb_pc_load_mem - load virtual memory into DMA - * - * Return values: - * 0: Success - * Else: Error - *------------------------------------------------------------------------*/ -uint8_t -usb_pc_load_mem(struct usb_page_cache *pc, usb_size_t size, uint8_t sync) -{ - /* setup page cache */ - pc->page_offset_buf = 0; - pc->page_offset_end = size; - pc->ismultiseg = 1; - - mtx_assert(pc->tag_parent->mtx, MA_OWNED); - - if (size > 0) { - /* compute physical address */ - usb_pc_common_mem_cb(pc, pc->buffer, size); - } - if (sync == 0) { - /* - * Call callback so that refcount is decremented - * properly: - */ - pc->tag_parent->dma_error = 0; - (pc->tag_parent->func) (pc->tag_parent); - } - return (0); -} - -/*------------------------------------------------------------------------* - * usb_pc_cpu_invalidate - invalidate CPU cache - *------------------------------------------------------------------------*/ -void -usb_pc_cpu_invalidate(struct usb_page_cache *pc) -{ - if (pc->page_offset_end == pc->page_offset_buf) { - /* nothing has been loaded into this page cache! */ - return; - } - /* NOP */ -} - -/*------------------------------------------------------------------------* - * usb_pc_cpu_flush - flush CPU cache - *------------------------------------------------------------------------*/ -void -usb_pc_cpu_flush(struct usb_page_cache *pc) -{ - if (pc->page_offset_end == pc->page_offset_buf) { - /* nothing has been loaded into this page cache! */ - return; - } - /* NOP */ -} - -/*------------------------------------------------------------------------* - * usb_pc_dmamap_create - create a DMA map - * - * Returns: - * 0: Success - * Else: Failure - *------------------------------------------------------------------------*/ -uint8_t -usb_pc_dmamap_create(struct usb_page_cache *pc, usb_size_t size) -{ - return (0); /* NOP, success */ -} - -/*------------------------------------------------------------------------* - * usb_pc_dmamap_destroy - * - * This function is NULL safe. - *------------------------------------------------------------------------*/ -void -usb_pc_dmamap_destroy(struct usb_page_cache *pc) -{ - /* NOP */ -} - -/*------------------------------------------------------------------------* - * usb_dma_tag_setup - initialise USB DMA tags - *------------------------------------------------------------------------*/ -void -usb_dma_tag_setup(struct usb_dma_parent_tag *udpt, - struct usb_dma_tag *udt, bus_dma_tag_t dmat, - struct mtx *mtx, usb_dma_callback_t *func, - uint8_t ndmabits, uint8_t nudt) -{ - memset(udpt, 0, sizeof(*udpt)); - - /* sanity checking */ - if ((nudt == 0) || - (ndmabits == 0) || - (mtx == NULL)) { - /* something is corrupt */ - return; - } - /* initialise condition variable */ - cv_init(udpt->cv, "USB DMA CV"); - - /* store some information */ - udpt->mtx = mtx; - udpt->func = func; - udpt->tag = dmat; - udpt->utag_first = udt; - udpt->utag_max = nudt; - udpt->dma_bits = ndmabits; - - while (nudt--) { - memset(udt, 0, sizeof(*udt)); - udt->tag_parent = udpt; - udt++; - } -} - -/*------------------------------------------------------------------------* - * usb_bus_tag_unsetup - factored out code - *------------------------------------------------------------------------*/ -void -usb_dma_tag_unsetup(struct usb_dma_parent_tag *udpt) -{ - struct usb_dma_tag *udt; - uint8_t nudt; - - udt = udpt->utag_first; - nudt = udpt->utag_max; - - while (nudt--) { - udt->align = 0; - udt++; - } - - if (udpt->utag_max) { - /* destroy the condition variable */ - cv_destroy(udpt->cv); - } -} - -/*------------------------------------------------------------------------* - * usb_bdma_work_loop - * - * This function handles loading of virtual buffers into DMA and is - * only called when "dma_refcount" is zero. - *------------------------------------------------------------------------*/ -void -usb_bdma_work_loop(struct usb_xfer_queue *pq) -{ - struct usb_xfer_root *info; - struct usb_xfer *xfer; - usb_frcount_t nframes; - - xfer = pq->curr; - info = xfer->xroot; - - mtx_assert(info->xfer_mtx, MA_OWNED); - - if (xfer->error) { - /* some error happened */ - USB_BUS_LOCK(info->bus); - usbd_transfer_done(xfer, 0); - USB_BUS_UNLOCK(info->bus); - return; - } - if (!xfer->flags_int.bdma_setup) { - struct usb_page *pg; - usb_frlength_t frlength_0; - uint8_t isread; - - xfer->flags_int.bdma_setup = 1; - - /* reset BUS-DMA load state */ - - info->dma_error = 0; - - if (xfer->flags_int.isochronous_xfr) { - /* only one frame buffer */ - nframes = 1; - frlength_0 = xfer->sumlen; - } else { - /* can be multiple frame buffers */ - nframes = xfer->nframes; - frlength_0 = xfer->frlengths[0]; - } - - /* - * Set DMA direction first. This is needed to - * select the correct cache invalidate and cache - * flush operations. - */ - isread = USB_GET_DATA_ISREAD(xfer); - pg = xfer->dma_page_ptr; - - if (xfer->flags_int.control_xfr && - xfer->flags_int.control_hdr) { - /* special case */ - if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { - /* The device controller writes to memory */ - xfer->frbuffers[0].isread = 1; - } else { - /* The host controller reads from memory */ - xfer->frbuffers[0].isread = 0; - } - } else { - /* default case */ - xfer->frbuffers[0].isread = isread; - } - - /* - * Setup the "page_start" pointer which points to an array of - * USB pages where information about the physical address of a - * page will be stored. Also initialise the "isread" field of - * the USB page caches. - */ - xfer->frbuffers[0].page_start = pg; - - info->dma_nframes = nframes; - info->dma_currframe = 0; - info->dma_frlength_0 = frlength_0; - - pg += (frlength_0 / USB_PAGE_SIZE); - pg += 2; - - while (--nframes > 0) { - xfer->frbuffers[nframes].isread = isread; - xfer->frbuffers[nframes].page_start = pg; - - pg += (xfer->frlengths[nframes] / USB_PAGE_SIZE); - pg += 2; - } - - } - if (info->dma_error) { - USB_BUS_LOCK(info->bus); - usbd_transfer_done(xfer, USB_ERR_DMA_LOAD_FAILED); - USB_BUS_UNLOCK(info->bus); - return; - } - if (info->dma_currframe != info->dma_nframes) { - - if (info->dma_currframe == 0) { - /* special case */ - usb_pc_load_mem(xfer->frbuffers, - info->dma_frlength_0, 0); - } else { - /* default case */ - nframes = info->dma_currframe; - usb_pc_load_mem(xfer->frbuffers + nframes, - xfer->frlengths[nframes], 0); - } - - /* advance frame index */ - info->dma_currframe++; - - return; - } - /* go ahead */ - usb_bdma_pre_sync(xfer); - - /* start loading next USB transfer, if any */ - usb_command_wrapper(pq, NULL); - - /* finally start the hardware */ - usbd_pipe_enter(xfer); -} - -/*------------------------------------------------------------------------* - * usb_bdma_done_event - * - * This function is called when the BUS-DMA has loaded virtual memory - * into DMA, if any. - *------------------------------------------------------------------------*/ -void -usb_bdma_done_event(struct usb_dma_parent_tag *udpt) -{ - struct usb_xfer_root *info; - - info = USB_DMATAG_TO_XROOT(udpt); - - mtx_assert(info->xfer_mtx, MA_OWNED); - - /* copy error */ - info->dma_error = udpt->dma_error; - - /* enter workloop again */ - usb_command_wrapper(&info->dma_q, - info->dma_q.curr); -} - -/*------------------------------------------------------------------------* - * usb_bdma_pre_sync - * - * This function handles DMA synchronisation that must be done before - * an USB transfer is started. - *------------------------------------------------------------------------*/ -void -usb_bdma_pre_sync(struct usb_xfer *xfer) -{ - struct usb_page_cache *pc; - usb_frcount_t nframes; - - if (xfer->flags_int.isochronous_xfr) { - /* only one frame buffer */ - nframes = 1; - } else { - /* can be multiple frame buffers */ - nframes = xfer->nframes; - } - - pc = xfer->frbuffers; - - while (nframes--) { - - if (pc->isread) { - usb_pc_cpu_invalidate(pc); - } else { - usb_pc_cpu_flush(pc); - } - pc++; - } -} - -/*------------------------------------------------------------------------* - * usb_bdma_post_sync - * - * This function handles DMA synchronisation that must be done after - * an USB transfer is complete. - *------------------------------------------------------------------------*/ -void -usb_bdma_post_sync(struct usb_xfer *xfer) -{ - struct usb_page_cache *pc; - usb_frcount_t nframes; - - if (xfer->flags_int.isochronous_xfr) { - /* only one frame buffer */ - nframes = 1; - } else { - /* can be multiple frame buffers */ - nframes = xfer->nframes; - } - - pc = xfer->frbuffers; - - while (nframes--) { - if (pc->isread) { - usb_pc_cpu_invalidate(pc); - } - pc++; - } -} -#endif diff --git a/usr/src/boot/sys/boot/usb/usbcore.mk b/usr/src/boot/sys/boot/usb/usbcore.mk deleted file mode 100644 index 153a1d435c..0000000000 --- a/usr/src/boot/sys/boot/usb/usbcore.mk +++ /dev/null @@ -1,175 +0,0 @@ -# -# $FreeBSD$ -# -# Copyright (c) 2013 Hans Petter Selasky. -# Copyright (c) 2014 SRI International -# All rights reserved. -# -# This software was developed by SRI International and the University of -# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 -# ("CTSRD"), as part of the DARPA CRASH research programme. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# - -USBCOREDIR:= ${.PARSEDIR} -S=${USBCOREDIR}/../.. - -MACHDEP_DIRS= - -.if defined(HAVE_EXYNOS_EHCI) -MACHDEP_DIRS+= ${S}/arm/samsung/exynos -.endif - -.PATH: \ - ${USBCOREDIR} \ - ${USBCOREDIR}/storage \ - ${S}/dev/usb \ - ${S}/dev/usb/controller \ - ${S}/dev/usb/serial \ - ${S}/dev/usb/storage \ - ${S}/dev/usb/template \ - ${MACHDEP_DIRS} -.undef S - -USB_POOL_SIZE?= 131072 - -CFLAGS+= -DUSB_MSCTEST_BULK_SIZE=65536 -CFLAGS+= -DUSB_POOL_SIZE=${USB_POOL_SIZE} - - -# -# BUSDMA implementation -# -SRCS+= usb_busdma_loader.c - -# -# USB controller drivers -# - -KSRCS+= usb_controller.c - -.if defined(HAVE_AT91DCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"at91dci\"" -KSRCS+= at91dci.c -.endif - -.if defined(HAVE_ATMEGADCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"atmegadci\"" -KSRCS+= atmegadci.c -.endif - -.if defined(HAVE_AVR32DCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"avr32dci\"" -KSRCS+= avr32dci.c -.endif - -.if defined(HAVE_DWCOTG) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"dwcotg\"" -KSRCS+= dwcotg.c -.endif - -.if defined(HAVE_MUSBOTG) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"musbotg\"" -KSRCS+= musbotg.c -.endif - -.if defined(HAVE_EHCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"ehci\"" -KSRCS+= ehci.c -.endif - -.if defined(HAVE_EXYNOS_EHCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"combiner\", \"pad\", \"ehci\"" -KSRCS+= ehci.c -KSRCS+= exynos5_combiner.c -KSRCS+= exynos5_pad.c -KSRCS+= exynos5_ehci.c -.endif - -.if defined(HAVE_OHCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"ohci\"" -KSRCS+= ohci.c -.endif - -.if defined(HAVE_UHCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"uhci\"" -KSRCS+= uhci.c -.endif - -.if defined(HAVE_XHCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"xhci\"" -KSRCS+= xhci.c -.endif - -.if defined(HAVE_USS820DCI) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"uss820dci\"" -KSRCS+= uss820dci.c -.endif - -.if defined(HAVE_SAF1761OTG) -CFLAGS += -DUSB_PCI_PROBE_LIST="\"saf1761otg\"" -CFLAGS += -DUSB_PCI_MEMORY_ADDRESS=0x900000007f100000ULL -CFLAGS += -DUSB_PCI_MEMORY_SIZE=0x40000U -KSRCS+= saf1761_otg.c -KSRCS+= saf1761_otg_boot.c -.endif - -# -# USB core and templates -# -KSRCS+= usb_core.c -KSRCS+= usb_debug.c -KSRCS+= usb_device.c -KSRCS+= usb_dynamic.c -KSRCS+= usb_error.c -KSRCS+= usb_handle_request.c -KSRCS+= usb_hid.c -KSRCS+= usb_hub.c -KSRCS+= usb_lookup.c -KSRCS+= usb_msctest.c -KSRCS+= usb_parse.c -KSRCS+= usb_request.c -KSRCS+= usb_transfer.c -KSRCS+= usb_util.c -KSRCS+= usb_template.c -KSRCS+= usb_template_cdce.c -KSRCS+= usb_template_msc.c -KSRCS+= usb_template_mtp.c -KSRCS+= usb_template_modem.c -KSRCS+= usb_template_mouse.c -KSRCS+= usb_template_kbd.c -KSRCS+= usb_template_audio.c -KSRCS+= usb_template_phone.c -KSRCS+= usb_template_serialnet.c -KSRCS+= usb_template_midi.c - -# -# USB mass storage support -# -SRCS+= umass_common.c - -.if defined(HAVE_UMASS_LOADER) -CFLAGS+= -I${.CURDIR}/../common -SRCS+= umass_loader.c -.endif - diff --git a/usr/src/boot/sys/boot/userboot/Makefile b/usr/src/boot/sys/boot/userboot/Makefile deleted file mode 100644 index ebacf64547..0000000000 --- a/usr/src/boot/sys/boot/userboot/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.include <bsd.own.mk> - -SUBDIR= ficl libstand test zfs userboot - -.include <bsd.subdir.mk> - diff --git a/usr/src/boot/sys/boot/userboot/ficl/Makefile b/usr/src/boot/sys/boot/userboot/ficl/Makefile deleted file mode 100644 index d8f749f9c6..0000000000 --- a/usr/src/boot/sys/boot/userboot/ficl/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# $FreeBSD$ -# -.include <bsd.own.mk> -MK_SSP= no - -.PATH: ${.CURDIR}/../../ficl -.PATH: ${.CURDIR}/../../ficl/${MACHINE_CPUARCH} -BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ - prefix.c search.c stack.c tools.c vm.c words.c - -SRCS= ${BASE_SRCS} sysdep.c softcore.c -CLEANFILES= softcore.c testmain testmain.o -.if HAVE_PNP -CFLAGS+= -DHAVE_PNP -.endif -.include <bsd.stand.mk> -.ifmake testmain -CFLAGS+= -DTESTMAIN -D_TESTMAIN -SRCS+= testmain.c -PROG= testmain -.include <bsd.prog.mk> -.else -LIB= ficl -INTERNALLIB= -.include <bsd.lib.mk> -.endif - -# Standard softwords -.PATH: ${.CURDIR}/../../ficl/softwords -SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \ - ifbrack.fr -# Optional OO extension softwords -#SOFTWORDS+= oo.fr classes.fr - -#.if ${MACHINE_CPUARCH} == "amd64" -#CFLAGS+= -m32 -I. -#.endif - -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -I. -.endif - -CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} -CFLAGS+= -I${.CURDIR}/../../common - -softcore.c: ${SOFTWORDS} softcore.awk - (cd ${.CURDIR}/../../ficl/softwords; cat ${SOFTWORDS} \ - | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET} - -#.if ${MACHINE_CPUARCH} == "amd64" -#${SRCS:M*.c:R:S/$/.o/g}: machine -# -#beforedepend ${OBJS}: machine -# -#machine: -# ln -sf ${.CURDIR}/../../i386/include machine -# -#CLEANFILES+= machine -#.endif diff --git a/usr/src/boot/sys/boot/userboot/libstand/Makefile b/usr/src/boot/sys/boot/userboot/libstand/Makefile deleted file mode 100644 index 401bbdacdb..0000000000 --- a/usr/src/boot/sys/boot/userboot/libstand/Makefile +++ /dev/null @@ -1,136 +0,0 @@ -# $FreeBSD$ -# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ -# -# Notes: -# - We don't use the libc strerror/sys_errlist because the string table is -# quite large. -# - -MAN= - -.include <bsd.own.mk> -MK_SSP= no - -LIBSTAND_SRC= ${.CURDIR}/../../../../lib/libstand -LIBC_SRC= ${LIBSTAND_SRC}/../libc - -.PATH: ${LIBSTAND_SRC} -LIB= stand -INTERNALLIB= -MK_PROFILE= no -NO_PIC= - -WARNS?= 0 - -# standalone components and stuff we have modified locally -SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ - globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ - sbrk.c twiddle.c zalloc.c zalloc_malloc.c - -# private (pruned) versions of libc string functions -SRCS+= strcasecmp.c - -.PATH: ${LIBC_SRC}/net - -SRCS+= ntoh.c - -# string functions from libc -.PATH: ${LIBC_SRC}/string -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ - ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" -SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ - memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ - strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ - strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c -.endif -.if ${MACHINE_CPUARCH} == "arm" -.PATH: ${LIBC_SRC}/arm/gen -SRCS+= divsi3.S -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -.PATH: ${LIBC_SRC}/quad -SRCS+= ashldi3.c ashrdi3.c -.PATH: ${LIBC_SRC}/powerpc/gen -SRCS+= syncicache.c -.endif - -# uuid functions from libc -.PATH: ${LIBC_SRC}/uuid -SRCS+= uuid_equal.c uuid_is_nil.c - -# _setjmp/_longjmp -.if ${MACHINE_CPUARCH} == "amd64" -.PATH: ${LIBSTAND_SRC}/amd64 -.elif ${MACHINE_ARCH} == "powerpc64" -.PATH: ${LIBSTAND_SRC}/powerpc -.else -.PATH: ${LIBSTAND_SRC}/${MACHINE_CPUARCH} -.endif -SRCS+= _setjmp.S - -# decompression functionality from libbz2 -# NOTE: to actually test this functionality after libbz2 upgrade compile -# loader(8) with LOADER_BZIP2_SUPPORT defined -.PATH: ${LIBSTAND_SRC}/../../contrib/bzip2 -CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS -SRCS+= libstand_bzlib_private.h - -.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c -SRCS+= _${file} -CLEANFILES+= _${file} - -_${file}: ${file} - sed "s|bzlib_private\.h|libstand_bzlib_private.h|" \ - ${.ALLSRC} > ${.TARGET} -.endfor - -CLEANFILES+= libstand_bzlib_private.h -libstand_bzlib_private.h: bzlib_private.h - sed -e 's|<stdlib.h>|"stand.h"|' \ - ${.ALLSRC} > ${.TARGET} - -# decompression functionality from libz -.PATH: ${LIBSTAND_SRC}/../libz -CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../libz -SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h - -.for file in infback.c inffast.c inflate.c inftrees.c zutil.c -SRCS+= _${file} -CLEANFILES+= _${file} - -_${file}: ${file} - sed -e "s|zutil\.h|libstand_zutil.h|" \ - -e "s|gzguts\.h|libstand_gzguts.h|" \ - ${.ALLSRC} > ${.TARGET} -.endfor - -# depend on stand.h being able to be included multiple times -.for file in zutil.h gzguts.h -CLEANFILES+= libstand_${file} -libstand_${file}: ${file} - sed -e 's|<fcntl.h>|"stand.h"|' \ - -e 's|<stddef.h>|"stand.h"|' \ - -e 's|<string.h>|"stand.h"|' \ - -e 's|<stdio.h>|"stand.h"|' \ - -e 's|<stdlib.h>|"stand.h"|' \ - ${.ALLSRC} > ${.TARGET} -.endfor - -# io routines -SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ - fstat.c close.c lseek.c open.c read.c write.c readdir.c - -# network routines -SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c - -# network info services: -SRCS+= bootp.c rarp.c bootparam.c - -# boot filesystems -SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c -SRCS+= dosfs.c ext2fs.c -SRCS+= splitfs.c - -.include <bsd.stand.mk> -.include <bsd.lib.mk> diff --git a/usr/src/boot/sys/boot/userboot/test/Makefile b/usr/src/boot/sys/boot/userboot/test/Makefile deleted file mode 100644 index e9ecf58c77..0000000000 --- a/usr/src/boot/sys/boot/userboot/test/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# $FreeBSD$ - - -MAN= - -.include <bsd.own.mk> -MK_SSP= no - -PROG= test -INTERNALPROG= - -CFLAGS+= -I${.CURDIR}/.. -CFLAGS+= -I${.CURDIR}/../../.. - -.include <bsd.prog.mk> diff --git a/usr/src/boot/sys/boot/userboot/test/test.c b/usr/src/boot/sys/boot/userboot/test/test.c deleted file mode 100644 index d5707de216..0000000000 --- a/usr/src/boot/sys/boot/userboot/test/test.c +++ /dev/null @@ -1,475 +0,0 @@ -/*- - * Copyright (c) 2011 Google, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <sys/types.h> -#include <sys/disk.h> -#include <sys/ioctl.h> -#include <sys/stat.h> -#include <dirent.h> -#include <dlfcn.h> -#include <err.h> -#include <errno.h> -#include <fcntl.h> -#include <getopt.h> -#include <inttypes.h> -#include <limits.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <termios.h> -#include <unistd.h> - -#include <boot/userboot/userboot.h> - -char *host_base = NULL; -struct termios term, oldterm; -char *image; -size_t image_size; -int disk_fd = -1; - -uint64_t regs[16]; -uint64_t pc; - -void test_exit(void *arg, int v); - -/* - * Console i/o - */ - -void -test_putc(void *arg, int ch) -{ - char c = ch; - - write(1, &c, 1); -} - -int -test_getc(void *arg) -{ - char c; - - if (read(0, &c, 1) == 1) - return c; - return -1; -} - -int -test_poll(void *arg) -{ - int n; - - if (ioctl(0, FIONREAD, &n) >= 0) - return (n > 0); - return (0); -} - -/* - * Host filesystem i/o - */ - -struct test_file { - int tf_isdir; - size_t tf_size; - struct stat tf_stat; - union { - int fd; - DIR *dir; - } tf_u; -}; - -int -test_open(void *arg, const char *filename, void **h_return) -{ - struct stat st; - struct test_file *tf; - char path[PATH_MAX]; - - if (!host_base) - return (ENOENT); - - strlcpy(path, host_base, PATH_MAX); - if (path[strlen(path) - 1] == '/') - path[strlen(path) - 1] = 0; - strlcat(path, filename, PATH_MAX); - tf = malloc(sizeof(struct test_file)); - if (stat(path, &tf->tf_stat) < 0) { - free(tf); - return (errno); - } - - tf->tf_size = st.st_size; - if (S_ISDIR(tf->tf_stat.st_mode)) { - tf->tf_isdir = 1; - tf->tf_u.dir = opendir(path); - if (!tf->tf_u.dir) - goto out; - *h_return = tf; - return (0); - } - if (S_ISREG(tf->tf_stat.st_mode)) { - tf->tf_isdir = 0; - tf->tf_u.fd = open(path, O_RDONLY); - if (tf->tf_u.fd < 0) - goto out; - *h_return = tf; - return (0); - } - -out: - free(tf); - return (EINVAL); -} - -int -test_close(void *arg, void *h) -{ - struct test_file *tf = h; - - if (tf->tf_isdir) - closedir(tf->tf_u.dir); - else - close(tf->tf_u.fd); - free(tf); - - return (0); -} - -int -test_isdir(void *arg, void *h) -{ - struct test_file *tf = h; - - return (tf->tf_isdir); -} - -int -test_read(void *arg, void *h, void *dst, size_t size, size_t *resid_return) -{ - struct test_file *tf = h; - ssize_t sz; - - if (tf->tf_isdir) - return (EINVAL); - sz = read(tf->tf_u.fd, dst, size); - if (sz < 0) - return (EINVAL); - *resid_return = size - sz; - return (0); -} - -int -test_readdir(void *arg, void *h, uint32_t *fileno_return, uint8_t *type_return, - size_t *namelen_return, char *name) -{ - struct test_file *tf = h; - struct dirent *dp; - - if (!tf->tf_isdir) - return (EINVAL); - - dp = readdir(tf->tf_u.dir); - if (!dp) - return (ENOENT); - - /* - * Note: d_namlen is in the range 0..255 and therefore less - * than PATH_MAX so we don't need to test before copying. - */ - *fileno_return = dp->d_fileno; - *type_return = dp->d_type; - *namelen_return = dp->d_namlen; - memcpy(name, dp->d_name, dp->d_namlen); - name[dp->d_namlen] = 0; - - return (0); -} - -int -test_seek(void *arg, void *h, uint64_t offset, int whence) -{ - struct test_file *tf = h; - - if (tf->tf_isdir) - return (EINVAL); - if (lseek(tf->tf_u.fd, offset, whence) < 0) - return (errno); - return (0); -} - -int -test_stat(void *arg, void *h, int *mode_return, int *uid_return, int *gid_return, - uint64_t *size_return) -{ - struct test_file *tf = h; - - *mode_return = tf->tf_stat.st_mode; - *uid_return = tf->tf_stat.st_uid; - *gid_return = tf->tf_stat.st_gid; - *size_return = tf->tf_stat.st_size; - return (0); -} - -/* - * Disk image i/o - */ - -int -test_diskread(void *arg, int unit, uint64_t offset, void *dst, size_t size, - size_t *resid_return) -{ - ssize_t n; - - if (unit != 0 || disk_fd == -1) - return (EIO); - n = pread(disk_fd, dst, size, offset); - if (n < 0) - return (errno); - *resid_return = size - n; - return (0); -} - -int -test_diskioctl(void *arg, int unit, u_long cmd, void *data) -{ - struct stat sb; - - if (unit != 0 || disk_fd == -1) - return (EBADF); - switch (cmd) { - case DIOCGSECTORSIZE: - *(u_int *)data = 512; - break; - case DIOCGMEDIASIZE: - if (fstat(disk_fd, &sb) == 0) - *(off_t *)data = sb.st_size; - else - return (ENOTTY); - break; - default: - return (ENOTTY); - }; - return (0); -} - -/* - * Guest virtual machine i/o - * - * Note: guest addresses are kernel virtual - */ - -int -test_copyin(void *arg, const void *from, uint64_t to, size_t size) -{ - - to &= 0x7fffffff; - if (to > image_size) - return (EFAULT); - if (to + size > image_size) - size = image_size - to; - memcpy(&image[to], from, size); - return(0); -} - -int -test_copyout(void *arg, uint64_t from, void *to, size_t size) -{ - - from &= 0x7fffffff; - if (from > image_size) - return (EFAULT); - if (from + size > image_size) - size = image_size - from; - memcpy(to, &image[from], size); - return(0); -} - -void -test_setreg(void *arg, int r, uint64_t v) -{ - - if (r < 0 || r >= 16) - return; - regs[r] = v; -} - -void -test_setmsr(void *arg, int r, uint64_t v) -{ -} - -void -test_setcr(void *arg, int r, uint64_t v) -{ -} - -void -test_setgdt(void *arg, uint64_t v, size_t sz) -{ -} - -void -test_exec(void *arg, uint64_t pc) -{ - printf("Execute at 0x%"PRIu64"\n", pc); - test_exit(arg, 0); -} - -/* - * Misc - */ - -void -test_delay(void *arg, int usec) -{ - - usleep(usec); -} - -void -test_exit(void *arg, int v) -{ - - tcsetattr(0, TCSAFLUSH, &oldterm); - exit(v); -} - -void -test_getmem(void *arg, uint64_t *lowmem, uint64_t *highmem) -{ - - *lowmem = 128*1024*1024; - *highmem = 0; -} - -const char * -test_getenv(void *arg, int idx) -{ - static const char *vars[] = { - "foo=bar", - "bar=barbar", - NULL - }; - - return (vars[idx]); -} - -struct loader_callbacks cb = { - .putc = test_putc, - .getc = test_getc, - .poll = test_poll, - - .open = test_open, - .close = test_close, - .isdir = test_isdir, - .read = test_read, - .readdir = test_readdir, - .seek = test_seek, - .stat = test_stat, - - .diskread = test_diskread, - .diskioctl = test_diskioctl, - - .copyin = test_copyin, - .copyout = test_copyout, - .setreg = test_setreg, - .setmsr = test_setmsr, - .setcr = test_setcr, - .setgdt = test_setgdt, - .exec = test_exec, - - .delay = test_delay, - .exit = test_exit, - .getmem = test_getmem, - - .getenv = test_getenv, -}; - -void -usage() -{ - - printf("usage: [-b <userboot shared object>] [-d <disk image path>] [-h <host filesystem path>\n"); - exit(1); -} - -int -main(int argc, char** argv) -{ - void *h; - void (*func)(struct loader_callbacks *, void *, int, int); - int opt; - char *disk_image = NULL; - const char *userboot_obj = "/boot/userboot.so"; - - while ((opt = getopt(argc, argv, "b:d:h:")) != -1) { - switch (opt) { - case 'b': - userboot_obj = optarg; - break; - - case 'd': - disk_image = optarg; - break; - - case 'h': - host_base = optarg; - break; - - case '?': - usage(); - } - } - - h = dlopen(userboot_obj, RTLD_LOCAL); - if (!h) { - printf("%s\n", dlerror()); - return (1); - } - func = dlsym(h, "loader_main"); - if (!func) { - printf("%s\n", dlerror()); - return (1); - } - - image_size = 128*1024*1024; - image = malloc(image_size); - if (disk_image) { - disk_fd = open(disk_image, O_RDONLY); - if (disk_fd < 0) - err(1, "Can't open disk image '%s'", disk_image); - } - - tcgetattr(0, &term); - oldterm = term; - term.c_iflag &= ~(ICRNL); - term.c_lflag &= ~(ICANON|ECHO); - tcsetattr(0, TCSAFLUSH, &term); - - func(&cb, NULL, USERBOOT_VERSION_3, disk_fd >= 0); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot.h b/usr/src/boot/sys/boot/userboot/userboot.h deleted file mode 100644 index 7ffb06f652..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot.h +++ /dev/null @@ -1,213 +0,0 @@ -/*- - * Copyright (c) 2011 Doug Rabson - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * USERBOOT interface versions - */ -#define USERBOOT_VERSION_1 1 -#define USERBOOT_VERSION_2 2 -#define USERBOOT_VERSION_3 3 - -/* - * Version 4 added more generic callbacks for setting up - * registers and descriptors. The callback structure is - * backward compatible (new callbacks have been added at - * the tail end). - */ -#define USERBOOT_VERSION_4 4 - -/* - * Exit codes from the loader - */ -#define USERBOOT_EXIT_QUIT 1 -#define USERBOOT_EXIT_REBOOT 2 - -struct loader_callbacks { - /* - * Console i/o - */ - - /* - * Wait until a key is pressed on the console and then return it - */ - int (*getc)(void *arg); - - /* - * Write the character ch to the console - */ - void (*putc)(void *arg, int ch); - - /* - * Return non-zero if a key can be read from the console - */ - int (*poll)(void *arg); - - /* - * Host filesystem i/o - */ - - /* - * Open a file in the host filesystem - */ - int (*open)(void *arg, const char *filename, void **h_return); - - /* - * Close a file - */ - int (*close)(void *arg, void *h); - - /* - * Return non-zero if the file is a directory - */ - int (*isdir)(void *arg, void *h); - - /* - * Read size bytes from a file. The number of bytes remaining - * in dst after reading is returned in *resid_return - */ - int (*read)(void *arg, void *h, void *dst, size_t size, - size_t *resid_return); - - /* - * Read an entry from a directory. The entry's inode number is - * returned in *fileno_return, its type in *type_return and - * the name length in *namelen_return. The name itself is - * copied to the buffer name which must be at least PATH_MAX - * in size. - */ - int (*readdir)(void *arg, void *h, uint32_t *fileno_return, - uint8_t *type_return, size_t *namelen_return, char *name); - - /* - * Seek to a location within an open file - */ - int (*seek)(void *arg, void *h, uint64_t offset, - int whence); - - /* - * Return some stat(2) related information about the file - */ - int (*stat)(void *arg, void *h, int *mode_return, - int *uid_return, int *gid_return, uint64_t *size_return); - - /* - * Disk image i/o - */ - - /* - * Read from a disk image at the given offset - */ - int (*diskread)(void *arg, int unit, uint64_t offset, - void *dst, size_t size, size_t *resid_return); - - /* - * Guest virtual machine i/o - */ - - /* - * Copy to the guest address space - */ - int (*copyin)(void *arg, const void *from, - uint64_t to, size_t size); - - /* - * Copy from the guest address space - */ - int (*copyout)(void *arg, uint64_t from, - void *to, size_t size); - - /* - * Set a guest register value - */ - void (*setreg)(void *arg, int, uint64_t); - - /* - * Set a guest MSR value - */ - void (*setmsr)(void *arg, int, uint64_t); - - /* - * Set a guest CR value - */ - void (*setcr)(void *arg, int, uint64_t); - - /* - * Set the guest GDT address - */ - void (*setgdt)(void *arg, uint64_t, size_t); - - /* - * Transfer control to the guest at the given address - */ - void (*exec)(void *arg, uint64_t pc); - - /* - * Misc - */ - - /* - * Sleep for usec microseconds - */ - void (*delay)(void *arg, int usec); - - /* - * Exit with the given exit code - */ - void (*exit)(void *arg, int v); - - /* - * Return guest physical memory map details - */ - void (*getmem)(void *arg, uint64_t *lowmem, - uint64_t *highmem); - - /* - * ioctl interface to the disk device - */ - int (*diskioctl)(void *arg, int unit, u_long cmd, - void *data); - - /* - * Returns an environment variable in the form "name=value". - * - * If there are no more variables that need to be set in the - * loader environment then return NULL. - * - * 'num' is used as a handle for the callback to identify which - * environment variable to return next. It will begin at 0 and - * each invocation will add 1 to the previous value of 'num'. - */ - const char * (*getenv)(void *arg, int num); - - /* - * Version 4 additions. - */ - int (*vm_set_register)(void *arg, int vcpu, int reg, uint64_t val); - int (*vm_set_desc)(void *arg, int vcpu, int reg, uint64_t base, - u_int limit, u_int access); -}; diff --git a/usr/src/boot/sys/boot/userboot/userboot/Makefile b/usr/src/boot/sys/boot/userboot/userboot/Makefile deleted file mode 100644 index 41fb8e8636..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# $FreeBSD$ - -MAN= - -.include <src.opts.mk> -MK_SSP= no - -SHLIB_NAME= userboot.so -NO_CTF= yes -STRIP= -LIBDIR= /boot - -SRCS= autoload.c -SRCS+= biossmap.c -SRCS+= bootinfo.c -SRCS+= bootinfo32.c -SRCS+= bootinfo64.c -SRCS+= conf.c -SRCS+= console.c -SRCS+= copy.c -SRCS+= devicename.c -SRCS+= elf32_freebsd.c -SRCS+= elf64_freebsd.c -SRCS+= host.c -SRCS+= main.c -SRCS+= userboot_cons.c -SRCS+= userboot_disk.c -SRCS+= vers.c - -CFLAGS+= -Wall -CFLAGS+= -I${.CURDIR}/.. -CFLAGS+= -I${.CURDIR}/../../common -CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand -CFLAGS+= -ffreestanding -I. - -LDFLAGS+= -nostdlib -Wl,-Bsymbolic - -NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} - -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - -CLEANFILES= vers.c - -.if ${MK_FORTH} != "no" -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 -CFLAGS+= -DBF_DICTSIZE=15000 -LIBFICL= ${.OBJDIR}/../ficl/libficl.a -LIBSTAND= ${.OBJDIR}/../libstand/libstand.a -.endif - -.if ${MK_ZFS} != "no" -LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a -.endif - -# Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} -LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} - -.include <bsd.lib.mk> diff --git a/usr/src/boot/sys/boot/userboot/userboot/autoload.c b/usr/src/boot/sys/boot/userboot/userboot/autoload.c deleted file mode 100644 index a86afcfa2b..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/autoload.c +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * Copyright (c) 2011 Google, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -int -userboot_autoload(void) -{ - - return (0); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/biossmap.c b/usr/src/boot/sys/boot/userboot/userboot/biossmap.c deleted file mode 100644 index 9e556be373..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/biossmap.c +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include <sys/param.h> -#include <sys/reboot.h> -#include <sys/linker.h> -#include <machine/pc/bios.h> -#include <machine/metadata.h> - -#include "bootstrap.h" -#include "libuserboot.h" - -#define GB (1024UL * 1024 * 1024) - -void -bios_addsmapdata(struct preloaded_file *kfp) -{ - uint64_t lowmem, highmem; - int smapnum, len; - struct bios_smap smap[3], *sm; - - CALLBACK(getmem, &lowmem, &highmem); - - sm = &smap[0]; - - sm->base = 0; /* base memory */ - sm->length = 640 * 1024; - sm->type = SMAP_TYPE_MEMORY; - sm++; - - sm->base = 0x100000; /* extended memory */ - sm->length = lowmem - 0x100000; - sm->type = SMAP_TYPE_MEMORY; - sm++; - - smapnum = 2; - - if (highmem != 0) { - sm->base = 4 * GB; - sm->length = highmem; - sm->type = SMAP_TYPE_MEMORY; - smapnum++; - } - - len = smapnum * sizeof(struct bios_smap); - file_addmetadata(kfp, MODINFOMD_SMAP, len, &smap[0]); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/bootinfo.c b/usr/src/boot/sys/boot/userboot/userboot/bootinfo.c deleted file mode 100644 index 289ca071fe..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/bootinfo.c +++ /dev/null @@ -1,170 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include <sys/param.h> -#include <sys/reboot.h> -#include <sys/linker.h> -#include <sys/boot.h> - -#include "bootstrap.h" -#include "libuserboot.h" - -int -bi_getboothowto(char *kargs) -{ - char *cp; - char *curpos, *next, *string; - int howto; - int active; - int i; - int vidconsole; - - /* Parse kargs */ - howto = 0; - if (kargs != NULL) { - cp = kargs; - active = 0; - while (*cp != 0) { - if (!active && (*cp == '-')) { - active = 1; - } else if (active) - switch (*cp) { - case 'a': - howto |= RB_ASKNAME; - break; - case 'C': - howto |= RB_CDROM; - break; - case 'd': - howto |= RB_KDB; - break; - case 'D': - howto |= RB_MULTIPLE; - break; - case 'm': - howto |= RB_MUTE; - break; - case 'g': - howto |= RB_GDB; - break; - case 'h': - howto |= RB_SERIAL; - break; - case 'p': - howto |= RB_PAUSE; - break; - case 'r': - howto |= RB_DFLTROOT; - break; - case 's': - howto |= RB_SINGLE; - break; - case 'v': - howto |= RB_VERBOSE; - break; - default: - active = 0; - break; - } - cp++; - } - } - /* get equivalents from the environment */ - for (i = 0; howto_names[i].ev != NULL; i++) - if (getenv(howto_names[i].ev) != NULL) - howto |= howto_names[i].mask; - - /* Enable selected consoles */ - string = next = strdup(getenv("console")); - vidconsole = 0; - while (next != NULL) { - curpos = strsep(&next, " ,"); - if (*curpos == '\0') - continue; - if (!strcmp(curpos, "vidconsole")) - vidconsole = 1; - else if (!strcmp(curpos, "comconsole")) - howto |= RB_SERIAL; - else if (!strcmp(curpos, "nullconsole")) - howto |= RB_MUTE; - } - - if (vidconsole && (howto & RB_SERIAL)) - howto |= RB_MULTIPLE; - - /* - * XXX: Note that until the kernel is ready to respect multiple consoles - * for the boot messages, the first named console is the primary console - */ - if (!strcmp(string, "vidconsole")) - howto &= ~RB_SERIAL; - - free(string); - - return(howto); -} - -void -bi_setboothowto(int howto) -{ - int i; - - for (i = 0; howto_names[i].ev != NULL; i++) - if (howto & howto_names[i].mask) - setenv(howto_names[i].ev, "YES", 1); -} - -/* - * Copy the environment into the load area starting at (addr). - * Each variable is formatted as <name>=<value>, with a single nul - * separating each variable, and a double nul terminating the environment. - */ -vm_offset_t -bi_copyenv(vm_offset_t addr) -{ - struct env_var *ep; - - /* traverse the environment */ - for (ep = environ; ep != NULL; ep = ep->ev_next) { - CALLBACK(copyin, ep->ev_name, addr, strlen(ep->ev_name)); - addr += strlen(ep->ev_name); - CALLBACK(copyin, "=", addr, 1); - addr++; - if (ep->ev_value != NULL) { - CALLBACK(copyin, ep->ev_value, addr, strlen(ep->ev_value)); - addr += strlen(ep->ev_value); - } - CALLBACK(copyin, "", addr, 1); - addr++; - } - CALLBACK(copyin, "", addr, 1); - addr++; - return(addr); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/bootinfo32.c b/usr/src/boot/sys/boot/userboot/userboot/bootinfo32.c deleted file mode 100644 index 6498461a74..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/bootinfo32.c +++ /dev/null @@ -1,262 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include <sys/param.h> -#include <sys/reboot.h> -#include <sys/linker.h> -#include <i386/include/bootinfo.h> - -#include "bootstrap.h" -#include "libuserboot.h" - -static struct bootinfo bi; - -/* - * Copy module-related data into the load area, where it can be - * used as a directory for loaded modules. - * - * Module data is presented in a self-describing format. Each datum - * is preceded by a 32-bit identifier and a 32-bit size field. - * - * Currently, the following data are saved: - * - * MOD_NAME (variable) module name (string) - * MOD_TYPE (variable) module type (string) - * MOD_ARGS (variable) module parameters (string) - * MOD_ADDR sizeof(vm_offset_t) module load address - * MOD_SIZE sizeof(size_t) module size - * MOD_METADATA (variable) type-specific metadata - */ -#define COPY32(v, a, c) { \ - u_int32_t x = (v); \ - if (c) \ - CALLBACK(copyin, &x, a, sizeof(x)); \ - a += sizeof(x); \ -} - -#define MOD_STR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(strlen(s) + 1, a, c); \ - if (c) \ - CALLBACK(copyin, s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(uint32_t));\ -} - -#define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) -#define MOD_TYPE(a, s, c) MOD_STR(MODINFO_TYPE, a, s, c) -#define MOD_ARGS(a, s, c) MOD_STR(MODINFO_ARGS, a, s, c) - -#define MOD_VAR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(sizeof(s), a, c); \ - if (c) \ - CALLBACK(copyin, &s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(uint32_t)); \ -} - -#define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) -#define MOD_SIZE(a, s, c) MOD_VAR(MODINFO_SIZE, a, s, c) - -#define MOD_METADATA(a, mm, c) { \ - COPY32(MODINFO_METADATA | mm->md_type, a, c); \ - COPY32(mm->md_size, a, c); \ - if (c) \ - CALLBACK(copyin, mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(uint32_t));\ -} - -#define MOD_END(a, c) { \ - COPY32(MODINFO_END, a, c); \ - COPY32(0, a, c); \ -} - -static vm_offset_t -bi_copymodules32(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); - MOD_SIZE(addr, fp->f_size, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - -/* - * Load the information expected by an i386 kernel. - * - * - The 'boothowto' argument is constructed - * - The 'bootdev' argument is constructed - * - The 'bootinfo' struct is constructed, and copied into the kernel space. - * - The kernel environment is copied into kernel space. - * - Module metadata are formatted and placed in kernel space. - */ -int -bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernendp) -{ - struct preloaded_file *xp, *kfp; - struct i386_devdesc *rootdev; - struct file_metadata *md; - vm_offset_t addr; - vm_offset_t kernend; - vm_offset_t envp; - vm_offset_t size; - vm_offset_t ssym, esym; - char *rootdevname; - int bootdevnr, howto; - char *kernelname; - const char *kernelpath; - uint64_t lowmem, highmem; - - howto = bi_getboothowto(args); - - /* - * Allow the environment variable 'rootdev' to override the supplied device - * This should perhaps go to MI code and/or have $rootdev tested/set by - * MI code before launching the kernel. - */ - rootdevname = getenv("rootdev"); - userboot_getdev((void **)(&rootdev), rootdevname, NULL); - if (rootdev == NULL) { /* bad $rootdev/$currdev */ - printf("can't determine root device\n"); - return(EINVAL); - } - - /* Try reading the /etc/fstab file to select the root device */ - getrootmount(userboot_fmtdev((void *)rootdev)); - - bootdevnr = 0; -#if 0 - if (bootdevnr == -1) { - printf("root device %s invalid\n", i386_fmtdev(rootdev)); - return (EINVAL); - } -#endif - free(rootdev); - - /* find the last module in the chain */ - addr = 0; - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - /* copy our environment */ - envp = addr; - addr = bi_copyenv(addr); - - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf32 kernel"); - if (kfp == NULL) - panic("can't find kernel file"); - kernend = 0; /* fill it in later */ - file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); - file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); - file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); - bios_addsmapdata(kfp); - - /* Figure out the size and location of the metadata */ - *modulep = addr; - size = bi_copymodules32(0); - kernend = roundup(addr + size, PAGE_SIZE); - *kernendp = kernend; - - /* patch MODINFOMD_KERNEND */ - md = file_findmetadata(kfp, MODINFOMD_KERNEND); - bcopy(&kernend, md->md_data, sizeof kernend); - - /* copy module list and metadata */ - (void)bi_copymodules32(addr); - - ssym = esym = 0; - md = file_findmetadata(kfp, MODINFOMD_SSYM); - if (md != NULL) - ssym = *((vm_offset_t *)&(md->md_data)); - md = file_findmetadata(kfp, MODINFOMD_ESYM); - if (md != NULL) - esym = *((vm_offset_t *)&(md->md_data)); - if (ssym == 0 || esym == 0) - ssym = esym = 0; /* sanity */ - - /* legacy bootinfo structure */ - kernelname = getenv("kernelname"); - userboot_getdev(NULL, kernelname, &kernelpath); - bi.bi_version = BOOTINFO_VERSION; - bi.bi_kernelname = 0; /* XXX char * -> kernel name */ - bi.bi_nfs_diskless = 0; /* struct nfs_diskless * */ - bi.bi_n_bios_used = 0; /* XXX would have to hook biosdisk driver for these */ -#if 0 - for (i = 0; i < N_BIOS_GEOM; i++) - bi.bi_bios_geom[i] = bd_getbigeom(i); -#endif - bi.bi_size = sizeof(bi); - CALLBACK(getmem, &lowmem, &highmem); - bi.bi_memsizes_valid = 1; - bi.bi_basemem = 640; - bi.bi_extmem = (lowmem - 0x100000) / 1024; - bi.bi_envp = envp; - bi.bi_modulep = *modulep; - bi.bi_kernend = kernend; - bi.bi_symtab = ssym; /* XXX this is only the primary kernel symtab */ - bi.bi_esymtab = esym; - - /* - * Copy the legacy bootinfo and kernel name to the guest at 0x2000 - */ - bi.bi_kernelname = 0x2000 + sizeof(bi); - CALLBACK(copyin, &bi, 0x2000, sizeof(bi)); - CALLBACK(copyin, kernelname, 0x2000 + sizeof(bi), strlen(kernelname) + 1); - - /* legacy boot arguments */ - *howtop = howto | RB_BOOTINFO; - *bootdevp = bootdevnr; - *bip = 0x2000; - - return(0); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/bootinfo64.c b/usr/src/boot/sys/boot/userboot/userboot/bootinfo64.c deleted file mode 100644 index 10ff133ce5..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/bootinfo64.c +++ /dev/null @@ -1,257 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include <sys/param.h> -#include <sys/reboot.h> -#include <sys/linker.h> -#include <i386/include/bootinfo.h> -#include <machine/cpufunc.h> -#include <machine/psl.h> -#include <machine/specialreg.h> - -#include "bootstrap.h" -#include "libuserboot.h" - -/* - * Copy module-related data into the load area, where it can be - * used as a directory for loaded modules. - * - * Module data is presented in a self-describing format. Each datum - * is preceded by a 32-bit identifier and a 32-bit size field. - * - * Currently, the following data are saved: - * - * MOD_NAME (variable) module name (string) - * MOD_TYPE (variable) module type (string) - * MOD_ARGS (variable) module parameters (string) - * MOD_ADDR sizeof(vm_offset_t) module load address - * MOD_SIZE sizeof(size_t) module size - * MOD_METADATA (variable) type-specific metadata - */ -#define COPY32(v, a, c) { \ - u_int32_t x = (v); \ - if (c) \ - CALLBACK(copyin, &x, a, sizeof(x)); \ - a += sizeof(x); \ -} - -#define MOD_STR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(strlen(s) + 1, a, c); \ - if (c) \ - CALLBACK(copyin, s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(u_int64_t));\ -} - -#define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) -#define MOD_TYPE(a, s, c) MOD_STR(MODINFO_TYPE, a, s, c) -#define MOD_ARGS(a, s, c) MOD_STR(MODINFO_ARGS, a, s, c) - -#define MOD_VAR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(sizeof(s), a, c); \ - if (c) \ - CALLBACK(copyin, &s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_int64_t)); \ -} - -#define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) -#define MOD_SIZE(a, s, c) MOD_VAR(MODINFO_SIZE, a, s, c) - -#define MOD_METADATA(a, mm, c) { \ - COPY32(MODINFO_METADATA | mm->md_type, a, c); \ - COPY32(mm->md_size, a, c); \ - if (c) \ - CALLBACK(copyin, mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(u_int64_t));\ -} - -#define MOD_END(a, c) { \ - COPY32(MODINFO_END, a, c); \ - COPY32(0, a, c); \ -} - -static vm_offset_t -bi_copymodules64(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - u_int64_t v; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - v = fp->f_addr; - MOD_ADDR(addr, v, c); - v = fp->f_size; - MOD_SIZE(addr, v, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - -/* - * Check to see if this CPU supports long mode. - */ -static int -bi_checkcpu(void) -{ -#if 0 - char *cpu_vendor; - int vendor[3]; - int eflags, regs[4]; - - /* Check for presence of "cpuid". */ - eflags = read_eflags(); - write_eflags(eflags ^ PSL_ID); - if (!((eflags ^ read_eflags()) & PSL_ID)) - return (0); - - /* Fetch the vendor string. */ - do_cpuid(0, regs); - vendor[0] = regs[1]; - vendor[1] = regs[3]; - vendor[2] = regs[2]; - cpu_vendor = (char *)vendor; - - /* Check for vendors that support AMD features. */ - if (strncmp(cpu_vendor, INTEL_VENDOR_ID, 12) != 0 && - strncmp(cpu_vendor, AMD_VENDOR_ID, 12) != 0 && - strncmp(cpu_vendor, CENTAUR_VENDOR_ID, 12) != 0) - return (0); - - /* Has to support AMD features. */ - do_cpuid(0x80000000, regs); - if (!(regs[0] >= 0x80000001)) - return (0); - - /* Check for long mode. */ - do_cpuid(0x80000001, regs); - return (regs[3] & AMDID_LM); -#else - return (1); -#endif -} - -/* - * Load the information expected by an amd64 kernel. - * - * - The 'boothowto' argument is constructed - * - The 'bootdev' argument is constructed - * - The 'bootinfo' struct is constructed, and copied into the kernel space. - * - The kernel environment is copied into kernel space. - * - Module metadata are formatted and placed in kernel space. - */ -int -bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) -{ - struct preloaded_file *xp, *kfp; - struct userboot_devdesc *rootdev; - struct file_metadata *md; - vm_offset_t addr; - u_int64_t kernend; - u_int64_t envp; - vm_offset_t size; - char *rootdevname; - int howto; - - if (!bi_checkcpu()) { - printf("CPU doesn't support long mode\n"); - return (EINVAL); - } - - howto = bi_getboothowto(args); - - /* - * Allow the environment variable 'rootdev' to override the supplied device - * This should perhaps go to MI code and/or have $rootdev tested/set by - * MI code before launching the kernel. - */ - rootdevname = getenv("rootdev"); - userboot_getdev((void **)(&rootdev), rootdevname, NULL); - if (rootdev == NULL) { /* bad $rootdev/$currdev */ - printf("can't determine root device\n"); - return(EINVAL); - } - - /* Try reading the /etc/fstab file to select the root device */ - getrootmount(userboot_fmtdev((void *)rootdev)); - - /* find the last module in the chain */ - addr = 0; - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - /* copy our environment */ - envp = addr; - addr = bi_copyenv(addr); - - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf64 kernel"); - if (kfp == NULL) - panic("can't find kernel file"); - kernend = 0; /* fill it in later */ - file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); - file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); - file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); - bios_addsmapdata(kfp); - - /* Figure out the size and location of the metadata */ - *modulep = addr; - size = bi_copymodules64(0); - kernend = roundup(addr + size, PAGE_SIZE); - *kernendp = kernend; - - /* patch MODINFOMD_KERNEND */ - md = file_findmetadata(kfp, MODINFOMD_KERNEND); - bcopy(&kernend, md->md_data, sizeof kernend); - - /* copy module list and metadata */ - (void)bi_copymodules64(addr); - - return(0); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/conf.c b/usr/src/boot/sys/boot/userboot/userboot/conf.c deleted file mode 100644 index 5ccde455d7..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/conf.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1997 - * Matthias Drochner. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project - * by Matthias Drochner. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $NetBSD: conf.c,v 1.2 1997/03/22 09:03:29 thorpej Exp $ - */ - -#include <sys/cdefs.h> - -#include <stand.h> - -#include "libuserboot.h" -#include "libzfs.h" - -/* - * We could use linker sets for some or all of these, but - * then we would have to control what ended up linked into - * the bootstrap. So it's easier to conditionalise things - * here. - * - * XXX rename these arrays to be consistent and less namespace-hostile - */ - -/* Exported for libstand */ -struct devsw *devsw[] = { - &host_dev, - &userboot_disk, - &zfs_dev, - NULL -}; - -struct fs_ops *file_system[] = { - &host_fsops, - &ufs_fsops, - &cd9660_fsops, - &zfs_fsops, - &gzipfs_fsops, - &bzipfs_fsops, - NULL -}; - -/* Exported for i386 only */ -/* - * Sort formats so that those that can detect based on arguments - * rather than reading the file go first. - */ -extern struct file_format i386_elf; -extern struct file_format i386_elf_obj; -extern struct file_format amd64_elf; -extern struct file_format amd64_elf_obj; - -struct file_format *file_formats[] = { - &i386_elf, - &i386_elf_obj, - &amd64_elf, - &amd64_elf_obj, - NULL -}; - -/* - * Consoles - * - * We don't prototype these in libuserboot.h because they require - * data structures from bootstrap.h as well. - */ -extern struct console userboot_console; -extern struct console userboot_comconsole; - -struct console *consoles[] = { - &userboot_console, - &userboot_comconsole, - NULL -}; diff --git a/usr/src/boot/sys/boot/userboot/userboot/copy.c b/usr/src/boot/sys/boot/userboot/userboot/copy.c deleted file mode 100644 index f8763e9b52..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/copy.c +++ /dev/null @@ -1,73 +0,0 @@ -/*- - * Copyright (c) 2011 Google, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> - -#include "libuserboot.h" - -ssize_t -userboot_copyin(const void *src, vm_offset_t va, size_t len) -{ - - CALLBACK(copyin, src, va, len); - return (len); -} - -ssize_t -userboot_copyout(vm_offset_t va, void *dst, size_t len) -{ - - CALLBACK(copyout, va, dst, len); - return (len); -} - -ssize_t -userboot_readin(int fd, vm_offset_t va, size_t len) -{ - ssize_t res, s; - size_t sz; - char buf[4096]; - - res = 0; - while (len > 0) { - sz = len; - if (sz > sizeof(buf)) - sz = sizeof(buf); - s = read(fd, buf, sz); - if (s == 0) - break; - if (s < 0) - return (s); - CALLBACK(copyin, buf, va, s); - len -= s; - res += s; - va += s; - } - return (res); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/devicename.c b/usr/src/boot/sys/boot/userboot/userboot/devicename.c deleted file mode 100644 index 0d0e7ced5f..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/devicename.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <stand.h> -#include <string.h> - -#include "bootstrap.h" -#include "disk.h" -#include "libuserboot.h" -#include "libzfs.h" - -static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path); - -/* - * Point (dev) at an allocated device specifier for the device matching the - * path in (devspec). If it contains an explicit device specification, - * use that. If not, use the default device. - */ -int -userboot_getdev(void **vdev, const char *devspec, const char **path) -{ - struct disk_devdesc **dev = (struct disk_devdesc **)vdev; - int rv; - - /* - * If it looks like this is just a path and no - * device, go with the current device. - */ - if ((devspec == NULL) || - (devspec[0] == '/') || - (strchr(devspec, ':') == NULL)) { - - if (((rv = userboot_parsedev(dev, getenv("currdev"), NULL)) == 0) && - (path != NULL)) - *path = devspec; - return(rv); - } - - /* - * Try to parse the device name off the beginning of the devspec - */ - return(userboot_parsedev(dev, devspec, path)); -} - -/* - * Point (dev) at an allocated device specifier matching the string version - * at the beginning of (devspec). Return a pointer to the remaining - * text in (path). - * - * In all cases, the beginning of (devspec) is compared to the names - * of known devices in the device switch, and then any following text - * is parsed according to the rules applied to the device type. - * - * For disk-type devices, the syntax is: - * - * disk<unit>[s<slice>][<partition>]: - * - */ -static int -userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path) -{ - struct disk_devdesc *idev; - struct devsw *dv; - int i, unit, err; - const char *cp; - const char *np; - - /* minimum length check */ - if (strlen(devspec) < 2) - return(EINVAL); - - /* look for a device that matches */ - for (i = 0, dv = NULL; devsw[i] != NULL; i++) { - if (!strncmp(devspec, devsw[i]->dv_name, strlen(devsw[i]->dv_name))) { - dv = devsw[i]; - break; - } - } - if (dv == NULL) - return(ENOENT); - idev = malloc(sizeof(struct disk_devdesc)); - err = 0; - np = (devspec + strlen(dv->dv_name)); - - switch(dv->dv_type) { - case DEVT_NONE: /* XXX what to do here? Do we care? */ - break; - - case DEVT_DISK: - err = disk_parsedev(idev, np, path); - if (err != 0) - goto fail; - break; - - case DEVT_CD: - case DEVT_NET: - unit = 0; - - if (*np && (*np != ':')) { - unit = strtol(np, (char **)&cp, 0); /* get unit number if present */ - if (cp == np) { - err = EUNIT; - goto fail; - } - } else { - cp = np; - } - if (*cp && (*cp != ':')) { - err = EINVAL; - goto fail; - } - - idev->dd.d_unit = unit; - if (path != NULL) - *path = (*cp == 0) ? cp : cp + 1; - break; - - case DEVT_ZFS: - err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); - if (err != 0) - goto fail; - break; - - default: - err = EINVAL; - goto fail; - } - idev->dd.d_dev = dv; - if (dev == NULL) { - free(idev); - } else { - *dev = idev; - } - return(0); - - fail: - free(idev); - return(err); -} - - -char * -userboot_fmtdev(void *vdev) -{ - struct disk_devdesc *dev = (struct disk_devdesc *)vdev; - static char buf[128]; /* XXX device length constant? */ - - switch(dev->dd.d_dev->dv_type) { - case DEVT_NONE: - strcpy(buf, "(no device)"); - break; - - case DEVT_CD: - sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); - break; - - case DEVT_DISK: - return (disk_fmtdev(vdev)); - - case DEVT_NET: - sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); - break; - - case DEVT_ZFS: - return (zfs_fmtdev(vdev)); - } - return(buf); -} - - -/* - * Set currdev to suit the value being supplied in (value) - */ -int -userboot_setcurrdev(struct env_var *ev, int flags, const void *value) -{ - struct disk_devdesc *ncurr; - int rv; - - if ((rv = userboot_parsedev(&ncurr, value, NULL)) != 0) - return(rv); - free(ncurr); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return(0); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/elf32_freebsd.c b/usr/src/boot/sys/boot/userboot/userboot/elf32_freebsd.c deleted file mode 100644 index d8ccc3375c..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/elf32_freebsd.c +++ /dev/null @@ -1,114 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/exec.h> -#include <sys/linker.h> -#include <string.h> -#define _MACHINE_ELF_WANT_32BIT -#include <i386/include/bootinfo.h> -#include <i386/include/elf.h> -#include <stand.h> - -#include "bootstrap.h" -#include "libuserboot.h" - -static int elf32_exec(struct preloaded_file *amp); -static int elf32_obj_exec(struct preloaded_file *amp); - -struct file_format i386_elf = { elf32_loadfile, elf32_exec }; -struct file_format i386_elf_obj = { elf32_obj_loadfile, elf32_obj_exec }; - -#define GUEST_STACK 0x1000 /* Initial stack base */ -#define GUEST_GDT 0x3000 /* Address of initial GDT */ - -/* - * There is an ELF kernel and one or more ELF modules loaded. - * We wish to start executing the kernel image, so make such - * preparations as are required, and do so. - */ -static int -elf32_exec(struct preloaded_file *fp) -{ - struct file_metadata *md; - Elf_Ehdr *ehdr; - vm_offset_t entry, bootinfop, modulep, kernend; - int boothowto, err, bootdev; - uint32_t stack[1024], *sp; - - - if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) - return(EFTYPE); - ehdr = (Elf_Ehdr *)&(md->md_data); - - err = bi_load32(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep, &kernend); - if (err != 0) - return(err); - entry = ehdr->e_entry & 0xffffff; - -#ifdef DEBUG - printf("Start @ 0x%lx ...\n", entry); -#endif - - dev_cleanup(); - - /* - * Build a scratch stack at physical 0x1000 - */ - memset(stack, 0, sizeof(stack)); - sp = (uint32_t *)((char *)stack + sizeof(stack)); - *--sp = kernend; - *--sp = modulep; - *--sp = bootinfop; - *--sp = 0; - *--sp = 0; - *--sp = 0; - *--sp = bootdev; - *--sp = boothowto; - - /* - * Fake return address to mimic "new" boot blocks. For more - * details see recover_bootinfo in locore.S. - */ - *--sp = 0xbeefface; - CALLBACK(copyin, stack, GUEST_STACK, sizeof(stack)); - CALLBACK(setreg, 4, (char *)sp - (char *)stack + GUEST_STACK); - - CALLBACK(setgdt, GUEST_GDT, 8 * 4 - 1); - - CALLBACK(exec, entry); - - panic("exec returned"); -} - -static int -elf32_obj_exec(struct preloaded_file *fp) -{ - return (EFTYPE); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/elf64_freebsd.c b/usr/src/boot/sys/boot/userboot/userboot/elf64_freebsd.c deleted file mode 100644 index f7c3984f27..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/elf64_freebsd.c +++ /dev/null @@ -1,175 +0,0 @@ -/*- - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#define __ELF_WORD_SIZE 64 -#include <sys/param.h> -#include <sys/exec.h> -#include <sys/linker.h> -#ifdef DEBUG -#include <machine/_inttypes.h> -#endif -#include <string.h> -#include <i386/include/bootinfo.h> -#include <machine/elf.h> -#include <stand.h> - -#include "bootstrap.h" -#include "libuserboot.h" - -static int elf64_exec(struct preloaded_file *amp); -static int elf64_obj_exec(struct preloaded_file *amp); - -struct file_format amd64_elf = { elf64_loadfile, elf64_exec }; -struct file_format amd64_elf_obj = { elf64_obj_loadfile, elf64_obj_exec }; - -#define MSR_EFER 0xc0000080 -#define EFER_LME 0x00000100 -#define EFER_LMA 0x00000400 /* Long mode active (R) */ -#define CR4_PAE 0x00000020 -#define CR4_VMXE (1UL << 13) -#define CR4_PSE 0x00000010 -#define CR0_PG 0x80000000 -#define CR0_PE 0x00000001 /* Protected mode Enable */ -#define CR0_NE 0x00000020 /* Numeric Error enable (EX16 vs IRQ13) */ - -#define PG_V 0x001 -#define PG_RW 0x002 -#define PG_U 0x004 -#define PG_PS 0x080 - -typedef u_int64_t p4_entry_t; -typedef u_int64_t p3_entry_t; -typedef u_int64_t p2_entry_t; - -#define GUEST_NULL_SEL 0 -#define GUEST_CODE_SEL 1 -#define GUEST_DATA_SEL 2 -#define GUEST_GDTR_LIMIT (3 * 8 - 1) - -static void -setup_freebsd_gdt(uint64_t *gdtr) -{ - gdtr[GUEST_NULL_SEL] = 0; - gdtr[GUEST_CODE_SEL] = 0x0020980000000000; - gdtr[GUEST_DATA_SEL] = 0x0000900000000000; -} - -/* - * There is an ELF kernel and one or more ELF modules loaded. - * We wish to start executing the kernel image, so make such - * preparations as are required, and do so. - */ -static int -elf64_exec(struct preloaded_file *fp) -{ - struct file_metadata *md; - Elf_Ehdr *ehdr; - vm_offset_t modulep, kernend; - int err; - int i; - uint32_t stack[1024]; - p4_entry_t PT4[512]; - p3_entry_t PT3[512]; - p2_entry_t PT2[512]; - uint64_t gdtr[3]; - - if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) - return(EFTYPE); - ehdr = (Elf_Ehdr *)&(md->md_data); - - err = bi_load64(fp->f_args, &modulep, &kernend); - if (err != 0) - return(err); - - bzero(PT4, PAGE_SIZE); - bzero(PT3, PAGE_SIZE); - bzero(PT2, PAGE_SIZE); - - /* - * Build a scratch stack at physical 0x1000, page tables: - * PT4 at 0x2000, - * PT3 at 0x3000, - * PT2 at 0x4000, - * gdtr at 0x5000, - */ - - /* - * This is kinda brutal, but every single 1GB VM memory segment - * points to the same first 1GB of physical memory. But it is - * more than adequate. - */ - for (i = 0; i < 512; i++) { - /* Each slot of the level 4 pages points to the same level 3 page */ - PT4[i] = (p4_entry_t) 0x3000; - PT4[i] |= PG_V | PG_RW | PG_U; - - /* Each slot of the level 3 pages points to the same level 2 page */ - PT3[i] = (p3_entry_t) 0x4000; - PT3[i] |= PG_V | PG_RW | PG_U; - - /* The level 2 page slots are mapped with 2MB pages for 1GB. */ - PT2[i] = i * (2 * 1024 * 1024); - PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; - } - -#ifdef DEBUG - printf("Start @ %#" PRIx64 " ...\n", ehdr->e_entry); -#endif - - dev_cleanup(); - - stack[0] = 0; /* return address */; - stack[1] = modulep; - stack[2] = kernend; - CALLBACK(copyin, stack, 0x1000, sizeof(stack)); - CALLBACK(copyin, PT4, 0x2000, sizeof(PT4)); - CALLBACK(copyin, PT3, 0x3000, sizeof(PT3)); - CALLBACK(copyin, PT2, 0x4000, sizeof(PT2)); - CALLBACK(setreg, 4, 0x1000); - - CALLBACK(setmsr, MSR_EFER, EFER_LMA | EFER_LME); - CALLBACK(setcr, 4, CR4_PAE | CR4_VMXE); - CALLBACK(setcr, 3, 0x2000); - CALLBACK(setcr, 0, CR0_PG | CR0_PE | CR0_NE); - - setup_freebsd_gdt(gdtr); - CALLBACK(copyin, gdtr, 0x5000, sizeof(gdtr)); - CALLBACK(setgdt, 0x5000, sizeof(gdtr)); - - CALLBACK(exec, ehdr->e_entry); - - panic("exec returned"); -} - -static int -elf64_obj_exec(struct preloaded_file *fp) -{ - - return (EFTYPE); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/host.c b/usr/src/boot/sys/boot/userboot/userboot/host.c deleted file mode 100644 index c15d9d7e41..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/host.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2011 Google, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -/* - * Read from the host filesystem - */ - -#include <sys/param.h> -#include <sys/time.h> -#include <stddef.h> -#include <stdarg.h> -#include <string.h> -#include <stand.h> -#include <bootstrap.h> - -#include "libuserboot.h" - -/* - * Open a file. - */ -static int -host_open(const char *upath, struct open_file *f) -{ - - if (f->f_dev != &host_dev) - return (EINVAL); - - return (CALLBACK(open, upath, &f->f_fsdata)); -} - -static int -host_close(struct open_file *f) -{ - - CALLBACK(close, f->f_fsdata); - f->f_fsdata = (void *)0; - - return (0); -} - -/* - * Copy a portion of a file into memory. - */ -static int -host_read(struct open_file *f, void *start, size_t size, size_t *resid) -{ - - return (CALLBACK(read, f->f_fsdata, start, size, resid)); -} - -static off_t -host_seek(struct open_file *f, off_t offset, int where) -{ - - return (CALLBACK(seek, f->f_fsdata, offset, where)); -} - -static int -host_stat(struct open_file *f, struct stat *sb) -{ - int mode; - int uid; - int gid; - uint64_t size; - - CALLBACK(stat, f->f_fsdata, &mode, &uid, &gid, &size); - sb->st_mode = mode; - sb->st_uid = uid; - sb->st_gid = gid; - sb->st_size = size; - return (0); -} - -static int -host_readdir(struct open_file *f, struct dirent *d) -{ - uint32_t fileno; - uint8_t type; - size_t namelen; - int rc; - - rc = CALLBACK(readdir, f->f_fsdata, &fileno, &type, &namelen, - d->d_name); - if (rc) - return (rc); - - d->d_fileno = fileno; - d->d_type = type; - d->d_namlen = namelen; - - return (0); -} - -static int -host_dev_init(void) -{ - - return (0); -} - -static int -host_dev_print(int verbose) -{ - char line[80]; - - printf("%s devices:", host_dev.dv_name); - if (pager_output("\n") != 0) - return (1); - - sprintf(line, " host%d: Host filesystem\n", 0); - pager_output(line); -} - -/* - * 'Open' the host device. - */ -static int -host_dev_open(struct open_file *f, ...) -{ - va_list args; - struct devdesc *dev; - - va_start(args, f); - dev = va_arg(args, struct devdesc*); - va_end(args); - - return (0); -} - -static int -host_dev_close(struct open_file *f) -{ - - return (0); -} - -static int -host_dev_strategy(void *devdata, int rw, daddr_t dblk, size_t size, - char *buf, size_t *rsize) -{ - - return (ENOSYS); -} - -struct fs_ops host_fsops = { - "host", - host_open, - host_close, - host_read, - null_write, - host_seek, - host_stat, - host_readdir -}; - -struct devsw host_dev = { - .dv_name = "host", - .dv_type = DEVT_NET, - .dv_init = host_dev_init, - .dv_strategy = host_dev_strategy, - .dv_open = host_dev_open, - .dv_close = host_dev_close, - .dv_ioctl = noioctl, - .dv_print = host_dev_print, - .dv_cleanup = NULL -}; diff --git a/usr/src/boot/sys/boot/userboot/userboot/libuserboot.h b/usr/src/boot/sys/boot/userboot/userboot/libuserboot.h deleted file mode 100644 index e2048d5fef..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/libuserboot.h +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * Copyright (c) 2011 Google, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "userboot.h" - -extern struct loader_callbacks *callbacks; -extern void *callbacks_arg; - -#define CALLBACK(fn, args...) (callbacks->fn(callbacks_arg , ##args)) - -#define MAXDEV 31 /* maximum number of distinct devices */ - -typedef unsigned long physaddr_t; - -/* exported devices */ -extern struct devsw userboot_disk; -extern int userboot_disk_maxunit; -extern struct devsw host_dev; - -/* access to host filesystem */ -struct fs_ops host_fsops; - -struct bootinfo; -struct preloaded_file; -extern int bi_load(struct bootinfo *, struct preloaded_file *); - -extern void delay(int); - -extern int userboot_autoload(void); -extern ssize_t userboot_copyin(const void *, vm_offset_t, size_t); -extern ssize_t userboot_copyout(vm_offset_t, void *, size_t); -extern ssize_t userboot_readin(int, vm_offset_t, size_t); -extern int userboot_getdev(void **, const char *, const char **); -char *userboot_fmtdev(void *vdev); -int userboot_setcurrdev(struct env_var *ev, int flags, const void *value); - -int bi_getboothowto(char *kargs); -void bi_setboothowto(int howto); -vm_offset_t bi_copyenv(vm_offset_t addr); -int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, - vm_offset_t *modulep, vm_offset_t *kernend); -int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend); -void bios_addsmapdata(struct preloaded_file *kfp); diff --git a/usr/src/boot/sys/boot/userboot/userboot/main.c b/usr/src/boot/sys/boot/userboot/userboot/main.c deleted file mode 100644 index 7fa4331e36..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/main.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> - * Copyright (c) 1998,2000 Doug Rabson <dfr@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -#include <stand.h> -#include <string.h> -#include <setjmp.h> - -#include "bootstrap.h" -#include "disk.h" -#include "libuserboot.h" -#include "libzfs.h" - -static void userboot_zfs_probe(void); -static int userboot_zfs_found; - -/* Minimum version required */ -#define USERBOOT_VERSION USERBOOT_VERSION_3 - -#define MALLOCSZ (10*1024*1024) - -struct loader_callbacks *callbacks; -void *callbacks_arg; - -static jmp_buf jb; - -struct arch_switch archsw; /* MI/MD interface boundary */ - -static void extract_currdev(void); - -void -delay(int usec) -{ - - CALLBACK(delay, usec); -} - -void -exit(int v) -{ - - CALLBACK(exit, v); - longjmp(jb, 1); -} - -void -loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks) -{ - static char mallocbuf[MALLOCSZ]; - const char *var; - int i; - - if (version < USERBOOT_VERSION) - abort(); - - callbacks = cb; - callbacks_arg = arg; - userboot_disk_maxunit = ndisks; - - /* - * initialise the heap as early as possible. Once this is done, - * alloc() is usable. - */ - setheap((void *)mallocbuf, (void *)(mallocbuf + sizeof(mallocbuf))); - - /* - * Hook up the console - */ - cons_probe(); - - printf("\n%s", bootprog_info); -#if 0 - printf("Memory: %ld k\n", memsize() / 1024); -#endif - - setenv("screen-#rows", "24", 1); /* optional */ - - /* - * Set custom environment variables - */ - i = 0; - while (1) { - var = CALLBACK(getenv, i++); - if (var == NULL) - break; - putenv(var); - } - - archsw.arch_autoload = userboot_autoload; - archsw.arch_getdev = userboot_getdev; - archsw.arch_copyin = userboot_copyin; - archsw.arch_copyout = userboot_copyout; - archsw.arch_readin = userboot_readin; - archsw.arch_zfs_probe = userboot_zfs_probe; - - /* - * March through the device switch probing for things. - */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); - - extract_currdev(); - - if (setjmp(jb)) - return; - - interact(NULL); /* doesn't return */ - - exit(0); -} - -/* - * Set the 'current device' by (if possible) recovering the boot device as - * supplied by the initial bootstrap. - */ -static void -extract_currdev(void) -{ - struct disk_devdesc dev; - - //bzero(&dev, sizeof(dev)); - - if (userboot_zfs_found) { - struct zfs_devdesc zdev; - - /* Leave the pool/root guid's unassigned */ - bzero(&zdev, sizeof(zdev)); - zdev.dd.d_dev = &zfs_dev; - zdev.dd.d_type = zdev.dd.d_dev->dv_type; - - dev = *(struct disk_devdesc *)&zdev; - init_zfs_bootenv(zfs_fmtdev(&dev)); - } else if (userboot_disk_maxunit > 0) { - dev.dd.d_dev = &userboot_disk; - dev.dd.d_unit = 0; - dev.d_slice = D_SLICEWILD; - dev.d_partition = D_SLICEWILD; - /* - * If we cannot auto-detect the partition type then - * access the disk as a raw device. - */ - if (dev.dd.d_dev->dv_open(NULL, &dev)) { - dev.d_slice = D_SLICENONE; - dev.d_partition = D_SLICENONE; - } - } else { - dev.dd.d_dev = &host_dev; - dev.dd.d_unit = 0; - } - - env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(&dev), - userboot_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(&dev), - env_noset, env_nounset); -} - -static void -userboot_zfs_probe(void) -{ - char devname[32]; - uint64_t pool_guid; - int unit; - - /* - * Open all the disks we can find and see if we can reconstruct - * ZFS pools from them. Record if any were found. - */ - for (unit = 0; unit < userboot_disk_maxunit; unit++) { - sprintf(devname, "disk%d:", unit); - pool_guid = 0; - zfs_probe_dev(devname, &pool_guid); - if (pool_guid != 0) - userboot_zfs_found = 1; - } -} - -COMMAND_SET(quit, "quit", "exit the loader", command_quit); - -static int -command_quit(int argc, char *argv[]) -{ - - exit(USERBOOT_EXIT_QUIT); - return (CMD_OK); -} - -COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); - -static int -command_reboot(int argc, char *argv[]) -{ - - exit(USERBOOT_EXIT_REBOOT); - return (CMD_OK); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/userboot_cons.c b/usr/src/boot/sys/boot/userboot/userboot/userboot_cons.c deleted file mode 100644 index 9b388e5f08..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/userboot_cons.c +++ /dev/null @@ -1,131 +0,0 @@ -/*- - * Copyright (c) 2011 Google, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stand.h> -#include "bootstrap.h" -#include "libuserboot.h" - -int console; - -static struct console *userboot_comconsp; - -static void userboot_cons_probe(struct console *cp); -static int userboot_cons_init(int); -static void userboot_comcons_probe(struct console *cp); -static int userboot_comcons_init(int); -static void userboot_cons_putchar(int); -static int userboot_cons_getchar(void); -static int userboot_cons_poll(void); - -struct console userboot_console = { - .c_name = "userboot", - .c_desc = "userboot", - .c_flags = 0, - .c_probe = userboot_cons_probe, - .c_init = userboot_cons_init, - .c_out = userboot_cons_putchar, - .c_in = userboot_cons_getchar, - .c_ready = userboot_cons_poll, - .c_private = NULL -}; - -/* - * Provide a simple alias to allow loader scripts to set the - * console to comconsole without resulting in an error - */ -struct console userboot_comconsole = { - "comconsole", - "comconsole", - 0, - userboot_comcons_probe, - userboot_comcons_init, - userboot_cons_putchar, - userboot_cons_getchar, - userboot_cons_poll, -}; - -static void -userboot_cons_probe(struct console *cp) -{ - - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); -} - -static int -userboot_cons_init(int arg) -{ - - return (0); -} - -static void -userboot_comcons_probe(struct console *cp) -{ - - /* - * Save the console pointer so the comcons_init routine - * can set the C_PRESENT* flags. They are not set - * here to allow the existing userboot console to - * be elected the default. - */ - userboot_comconsp = cp; -} - -static int -userboot_comcons_init(int arg) -{ - - /* - * Set the C_PRESENT* flags to allow the comconsole - * to be selected as the active console - */ - userboot_comconsp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); - return (0); -} - -static void -userboot_cons_putchar(int c) -{ - - CALLBACK(putc, c); -} - -static int -userboot_cons_getchar() -{ - - return (CALLBACK(getc)); -} - -static int -userboot_cons_poll() -{ - - return (CALLBACK(poll)); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/userboot_disk.c b/usr/src/boot/sys/boot/userboot/userboot/userboot_disk.c deleted file mode 100644 index 2742bc11f4..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/userboot_disk.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright (c) 2011 Google, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> - -/* - * Userboot disk image handling. - */ - -#include <sys/disk.h> -#include <stand.h> -#include <stdarg.h> -#include <bootstrap.h> - -#include "disk.h" -#include "libuserboot.h" - -struct userdisk_info { - uint64_t mediasize; - uint16_t sectorsize; -}; - -int userboot_disk_maxunit = 0; - -static int userdisk_maxunit = 0; -static struct userdisk_info *ud_info; - -static int userdisk_init(void); -static void userdisk_cleanup(void); -static int userdisk_strategy(void *devdata, int flag, daddr_t dblk, - size_t size, char *buf, size_t *rsize); -static int userdisk_open(struct open_file *f, ...); -static int userdisk_close(struct open_file *f); -static int userdisk_ioctl(struct open_file *f, u_long cmd, void *data); -static int userdisk_print(int verbose); - -struct devsw userboot_disk = { - "disk", - DEVT_DISK, - userdisk_init, - userdisk_strategy, - userdisk_open, - userdisk_close, - userdisk_ioctl, - userdisk_print, - userdisk_cleanup -}; - -/* - * Initialize userdisk_info structure for each disk. - */ -static int -userdisk_init(void) -{ - off_t mediasize; - u_int sectorsize; - int i; - - userdisk_maxunit = userboot_disk_maxunit; - if (userdisk_maxunit > 0) { - ud_info = malloc(sizeof(*ud_info) * userdisk_maxunit); - if (ud_info == NULL) - return (ENOMEM); - for (i = 0; i < userdisk_maxunit; i++) { - if (CALLBACK(diskioctl, i, DIOCGSECTORSIZE, - §orsize) != 0 || CALLBACK(diskioctl, i, - DIOCGMEDIASIZE, &mediasize) != 0) - return (ENXIO); - ud_info[i].mediasize = mediasize; - ud_info[i].sectorsize = sectorsize; - } - } - - return(0); -} - -static void -userdisk_cleanup(void) -{ - - if (userdisk_maxunit > 0) - free(ud_info); - disk_cleanup(&userboot_disk); -} - -/* - * Print information about disks - */ -static int -userdisk_print(int verbose) -{ - struct disk_devdesc dev; - char line[80]; - int i; - - if (userdisk_maxunit == 0) - return (0); - - printf("%s devices:", userboot_disk.dv_name); - if ((ret = pager_output("\n")) != 0) - return (ret); - - for (i = 0; i < userdisk_maxunit; i++) { - sprintf(line, " disk%d: Guest drive image\n", i); - pager_output(line); - dev.dd.d_dev = &userboot_disk; - dev.dd.d_unit = i; - dev.d_slice = D_SLICENONE; - dev.d_partition = D_SLICENONE; - if (disk_open(&dev, ud_info[i].mediasize, - ud_info[i].sectorsize) == 0) { - sprintf(line, " disk%d", i); - disk_print(&dev, line, verbose); - disk_close(&dev); - } - } -} - -/* - * Attempt to open the disk described by (dev) for use by (f). - */ -static int -userdisk_open(struct open_file *f, ...) -{ - va_list ap; - struct disk_devdesc *dev; - - va_start(ap, f); - dev = va_arg(ap, struct disk_devdesc *); - va_end(ap); - - if (dev->dd.d_unit < 0 || dev->dd.d_unit >= userdisk_maxunit) - return (EIO); - ud_info[dev->dd.d_unit].ud_open++; - if (ud_info[dev->dd.d_unit].ud_bcache == NULL) - ud_info[dev->dd.d_unit].ud_bcache = bcache_allocate(); - return (disk_open(dev, ud_info[dev->dd.d_unit].mediasize, - ud_info[dev->dd.d_unit].sectorsize)); -} - -static int -userdisk_close(struct open_file *f) -{ - struct disk_devdesc *dev; - - dev = (struct disk_devdesc *)f->f_devdata; - ud_info[dev->dd.d_unit].ud_open--; - if (ud_info[dev->dd.d_unit].ud_open == 0) { - bcache_free(ud_info[dev->dd.d_unit].ud_bcache); - ud_info[dev->dd.d_unit].ud_bcache = NULL; - } - return (disk_close(dev)); -} - -static int -userdisk_strategy(void *devdata, int rw, daddr_t dblk, size_t size, - char *buf, size_t *rsize) -{ - struct bcache_devdata bcd; - struct disk_devdesc *dev; - - dev = (struct disk_devdesc *)devdata; - bcd.dv_strategy = userdisk_realstrategy; - bcd.dv_devdata = devdata; - bcd.dv_cache = ud_info[dev->dd.d_unit].ud_bcache; - return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, - size, buf, rsize)); -} - -static int -userdisk_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, - char *buf, size_t *rsize) -{ - struct disk_devdesc *dev = devdata; - uint64_t off; - size_t resid; - int rc; - - rw &= F_MASK; - if (rw == F_WRITE) - return (EROFS); - if (rw != F_READ) - return (EINVAL); - if (rsize) - *rsize = 0; - off = dblk * ud_info[dev->dd.d_unit].sectorsize; - rc = CALLBACK(diskread, dev->dd.d_unit, off, buf, size, &resid); - if (rc) - return (rc); - if (rsize) - *rsize = size - resid; - return (0); -} - -static int -userdisk_ioctl(struct open_file *f, u_long cmd, void *data) -{ - struct disk_devdesc *dev; - - dev = (struct disk_devdesc *)f->f_devdata; - return (CALLBACK(diskioctl, dev->dd.d_unit, cmd, data)); -} diff --git a/usr/src/boot/sys/boot/userboot/userboot/version b/usr/src/boot/sys/boot/userboot/userboot/version deleted file mode 100644 index ce6e2701fd..0000000000 --- a/usr/src/boot/sys/boot/userboot/userboot/version +++ /dev/null @@ -1,4 +0,0 @@ -$FreeBSD$ - -1.1: Initial userland boot - diff --git a/usr/src/boot/sys/boot/userboot/zfs/Makefile b/usr/src/boot/sys/boot/userboot/zfs/Makefile deleted file mode 100644 index 8fe315b38e..0000000000 --- a/usr/src/boot/sys/boot/userboot/zfs/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# $FreeBSD$ - -S= ${.CURDIR}/../../zfs - -.PATH: ${S} -LIB= zfsboot -INTERNALLIB= - -SRCS+= zfs.c - -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand -CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs - -CFLAGS+= -ffreestanding -fPIC -CFLAGS+= -Wformat -Wall - -.include <bsd.lib.mk> |
