From 27b207fd0a0941b03f27e2a82c0468b1a090c745 Mon Sep 17 00:00:00 2001 From: wdenk Date: Thu, 24 Jul 2003 23:38:38 +0000 Subject: * Implement new mechanism to export U-Boot's functions to standalone applications: instead of using (PPC-specific) system calls we now use a jump table; please see doc/README.standalone for details * Patch by Dave Westwood, 24 Jul 2003: added support for Unity OS (a proprietary OS) --- include/_exports.h | 12 ++++++++ include/asm-arm/global_data.h | 3 +- include/asm-i386/global_data.h | 1 + include/asm-mips/global_data.h | 3 +- include/asm-ppc/global_data.h | 3 +- include/bmp_layout.h | 68 +++++++++++++++++++++--------------------- include/cmd_confdefs.h | 1 + include/common.h | 5 ++-- include/configs/MIP405.h | 1 + include/configs/PIP405.h | 1 + include/configs/PN62.h | 9 +++--- include/configs/TQM823L.h | 17 ++++++++--- include/configs/TQM8260.h | 27 ++++++----------- include/exports.h | 36 ++++++++++++++++++++++ include/image.h | 3 +- include/post.h | 4 ++- include/syscall.h | 42 -------------------------- 17 files changed, 127 insertions(+), 109 deletions(-) create mode 100644 include/_exports.h create mode 100644 include/exports.h delete mode 100644 include/syscall.h (limited to 'include') diff --git a/include/_exports.h b/include/_exports.h new file mode 100644 index 0000000..a4e1561 --- /dev/null +++ b/include/_exports.h @@ -0,0 +1,12 @@ +EXPORT_FUNC(get_version) +EXPORT_FUNC(getc) +EXPORT_FUNC(tstc) +EXPORT_FUNC(putc) +EXPORT_FUNC(puts) +EXPORT_FUNC(printf) +EXPORT_FUNC(install_hdlr) +EXPORT_FUNC(free_hdlr) +EXPORT_FUNC(malloc) +EXPORT_FUNC(free) +EXPORT_FUNC(udelay) +EXPORT_FUNC(get_timer) diff --git a/include/asm-arm/global_data.h b/include/asm-arm/global_data.h index c804768..b5878ca 100644 --- a/include/asm-arm/global_data.h +++ b/include/asm-arm/global_data.h @@ -51,6 +51,7 @@ typedef struct global_data { unsigned long ram_size; /* RAM size */ unsigned long reset_status; /* reset status register at boot */ #endif + void **jt; /* jump table */ } gd_t; /* @@ -59,6 +60,6 @@ typedef struct global_data { #define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */ #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ -#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r8") +#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8") #endif /* __ASM_GBL_DATA_H */ diff --git a/include/asm-i386/global_data.h b/include/asm-i386/global_data.h index 324b435..4ffbc07 100644 --- a/include/asm-i386/global_data.h +++ b/include/asm-i386/global_data.h @@ -45,6 +45,7 @@ typedef struct { unsigned long bus_clk; unsigned long ram_size; /* RAM size */ unsigned long reset_status; /* reset status register at boot */ + void **jt; /* jump table */ } gd_t; /* diff --git a/include/asm-mips/global_data.h b/include/asm-mips/global_data.h index 72d0cb0..3ecf555 100644 --- a/include/asm-mips/global_data.h +++ b/include/asm-mips/global_data.h @@ -45,6 +45,7 @@ typedef struct global_data { unsigned long reloc_off; /* Relocation Offset */ unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid? */ + void **jt; /* jump table */ } gd_t; /* @@ -53,6 +54,6 @@ typedef struct global_data { #define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */ #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ -#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("k0") +#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("k0") #endif /* __ASM_GBL_DATA_H */ diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h index 4253020..8ebaa17 100644 --- a/include/asm-ppc/global_data.h +++ b/include/asm-ppc/global_data.h @@ -88,6 +88,7 @@ typedef struct global_data { #ifdef CONFIG_LWMON unsigned long kbd_status; #endif + void **jt; /* jump table */ } gd_t; /* @@ -97,7 +98,7 @@ typedef struct global_data { #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ #if 1 -#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r29") +#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r29") #else /* We could use plain global data, but the resulting code is bigger */ #define XTRN_DECLARE_GLOBAL_DATA_PTR extern #define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \ diff --git a/include/bmp_layout.h b/include/bmp_layout.h index 9d90e7f..d823de9 100644 --- a/include/bmp_layout.h +++ b/include/bmp_layout.h @@ -28,50 +28,50 @@ #define _BMP_H_ typedef struct bmp_color_table_entry { - __u8 blue; - __u8 green; - __u8 red; - __u8 reserved; -} __attribute__((packed)) bmp_color_table_entry_t; + __u8 blue; + __u8 green; + __u8 red; + __u8 reserved; +} __attribute__ ((packed)) bmp_color_table_entry_t; /* When accessing these fields, remember that they are stored in little endian format, so use linux macros, e.g. le32_to_cpu(width) */ -typedef struct bmp_header { - /* Header */ - char signature[2]; - __u32 file_size; - __u32 reserved; - __u32 data_offset; - /* InfoHeader */ - __u32 size; - __u32 width; - __u32 height; - __u16 planes; - __u16 bit_count; - __u32 compression; - __u32 image_size; - __u32 x_pixels_per_m; - __u32 y_pixels_per_m; - __u32 colors_used; - __u32 colors_important; - /* ColorTable */ +typedef struct bmp_header { + /* Header */ + char signature[2]; + __u32 file_size; + __u32 reserved; + __u32 data_offset; + /* InfoHeader */ + __u32 size; + __u32 width; + __u32 height; + __u16 planes; + __u16 bit_count; + __u32 compression; + __u32 image_size; + __u32 x_pixels_per_m; + __u32 y_pixels_per_m; + __u32 colors_used; + __u32 colors_important; + /* ColorTable */ -} __attribute__((packed)) bmp_header_t; +} __attribute__ ((packed)) bmp_header_t; typedef struct bmp_image { - bmp_header_t header; - /* We use a zero sized array just as a placeholder for variable - sized array */ - bmp_color_table_entry_t color_table[0]; + bmp_header_t header; + /* We use a zero sized array just as a placeholder for variable + sized array */ + bmp_color_table_entry_t color_table[0]; } bmp_image_t; /* Data in the bmp_image is aligned to this length */ -#define BMP_DATA_ALIGN 4 +#define BMP_DATA_ALIGN 4 /* Constants for the compression field */ -#define BMP_BI_RGB 0 -#define BMP_BI_RLE8 1 -#define BMP_BI_RLE4 2 +#define BMP_BI_RGB 0 +#define BMP_BI_RLE8 1 +#define BMP_BI_RLE4 2 -#endif /* _BMP_H_ */ +#endif /* _BMP_H_ */ diff --git a/include/cmd_confdefs.h b/include/cmd_confdefs.h index 577826c..8b8b0f5 100644 --- a/include/cmd_confdefs.h +++ b/include/cmd_confdefs.h @@ -84,6 +84,7 @@ #define CFG_CMD_PING 0x0004000000000000U /* ping support */ #define CFG_CMD_MMC 0x0008000000000000U /* MMC support */ #define CFG_CMD_FAT 0x0010000000000000U /* FAT support */ +#define CFG_CMD_IMLS 0x0020000000000000U /* List all found images */ #define CFG_CMD_ALL 0xFFFFFFFFFFFFFFFFU /* ALL commands */ diff --git a/include/common.h b/include/common.h index 03db8d7..5158f97 100644 --- a/include/common.h +++ b/include/common.h @@ -207,6 +207,9 @@ void pciinfo (int, int); int misc_init_f (void); int misc_init_r (void); +/* common/exports.c */ +void jumptable_init(void); + /* $(BOARD)/$(BOARD).c */ void reset_phy (void); void fdc_hw_init (void); @@ -436,8 +439,6 @@ ulong crc32 (ulong, const unsigned char *, uint); ulong crc32_no_comp (ulong, const unsigned char *, uint); /* common/console.c */ -extern void **syscall_tbl; - int console_init_f(void); /* Before relocation; uses the serial stuff */ int console_init_r(void); /* After relocation; uses the console stuff */ int console_assign (int file, char *devname); /* Assign the console */ diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h index 8d79307..49b830b 100644 --- a/include/configs/MIP405.h +++ b/include/configs/MIP405.h @@ -67,6 +67,7 @@ CFG_CMD_DATE | \ CFG_CMD_ELF | \ CFG_CMD_MII | \ + CFG_CMD_PING | \ CFG_CMD_SAVES | \ CFG_CMD_BSP ) diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h index 60e5a9a..d9f8be8 100644 --- a/include/configs/PIP405.h +++ b/include/configs/PIP405.h @@ -61,6 +61,7 @@ CFG_CMD_MII | \ CFG_CMD_SDRAM | \ CFG_CMD_DOC | \ + CFG_CMD_PING | \ CFG_CMD_SAVES | \ CFG_CMD_BSP ) /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ diff --git a/include/configs/PN62.h b/include/configs/PN62.h index 6c37208..c58e990 100644 --- a/include/configs/PN62.h +++ b/include/configs/PN62.h @@ -42,10 +42,11 @@ #define CONFIG_CONS_INDEX 1 -#define REMOVE_COMMANDS ( CFG_CMD_AUTOSCRIPT | \ - CFG_CMD_LOADS | \ - CFG_CMD_ENV | \ - CFG_CMD_FLASH ) +#define REMOVE_COMMANDS ( CFG_CMD_AUTOSCRIPT | \ + CFG_CMD_LOADS | \ + CFG_CMD_ENV | \ + CFG_CMD_FLASH | \ + CFG_CMD_IMLS ) #define CONFIG_COMMANDS ( (CONFIG_CMD_DFL & ~REMOVE_COMMANDS) |\ CFG_CMD_PCI |\ diff --git a/include/configs/TQM823L.h b/include/configs/TQM823L.h index c7a63e9..be6e2f9 100644 --- a/include/configs/TQM823L.h +++ b/include/configs/TQM823L.h @@ -37,7 +37,7 @@ #define CONFIG_TQM823L 1 /* ...on a TQM8xxL module */ #ifdef CONFIG_LCD /* with LCD controller ? */ -/* #define CONFIG_NEC_NL6648BC20 1 / * use NEC NL6648BC20 display */ +#define CONFIG_SPLASH_SCREEN /* ... with splashscreen support*/ #endif #define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */ @@ -97,11 +97,20 @@ #define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */ -#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \ +#ifdef CONFIG_SPLASH_SCREEN +# define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \ CFG_CMD_ASKENV | \ + CFG_CMD_BMP | \ + CFG_CMD_DATE | \ CFG_CMD_DHCP | \ - CFG_CMD_IDE | \ - CFG_CMD_DATE ) + CFG_CMD_IDE ) +#else +# define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \ + CFG_CMD_ASKENV | \ + CFG_CMD_DATE | \ + CFG_CMD_DHCP | \ + CFG_CMD_IDE ) +#endif /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/configs/TQM8260.h b/include/configs/TQM8260.h index de82e3e..a84f0dd 100644 --- a/include/configs/TQM8260.h +++ b/include/configs/TQM8260.h @@ -30,10 +30,13 @@ /* * Imported from global configuration: - * CONFIG_L2_CACHE + * CONFIG_MPC8255 + * CONFIG_MPC8265 + * CONFIG_200MHz * CONFIG_266MHz * CONFIG_300MHz - * CONFIG_MPC8255 + * CONFIG_L2_CACHE + * CONFIG_BUSMODE_60x */ /* @@ -49,18 +52,6 @@ #define CONFIG_TQM8260 200 /* ...on a TQM8260 module Rev.200 */ #endif -/* Define 60x busmode only if your TQM8260 has L2 cache! */ -#ifdef CONFIG_L2_CACHE -# define CONFIG_BUSMODE_60x 1 /* bus mode: 60x */ -#else -# undef CONFIG_BUSMODE_60x /* bus mode: 8260 */ -#endif - -/* The board with 300MHz CPU doesn't have L2 cache, but works in 60x bus mode */ -#ifdef CONFIG_300MHz -# define CONFIG_BUSMODE_60x -#endif - #define CONFIG_82xx_CONS_SMC1 1 /* console on SMC1 */ #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ @@ -203,9 +194,9 @@ /* system clock rate (CLKIN) - equal to the 60x and local bus speed */ -#ifdef CONFIG_MPC8255 +#if defined(CONFIG_MPC8255) || defined(CONFIG_MPC8265) # define CONFIG_8260_CLKIN 66666666 /* in Hz */ -#else /* !CONFIG_MPC8255 */ +#else /* !CONFIG_MPC8255 && !CONFIG_MPC8265 */ # ifndef CONFIG_300MHz # define CONFIG_8260_CLKIN 66666666 /* in Hz */ # else @@ -317,9 +308,9 @@ */ #define __HRCW__ALL__ (HRCW_CIP | HRCW_ISB111 | HRCW_BMS) -#ifdef CONFIG_MPC8255 +#if defined(CONFIG_MPC8255) || defined(CONFIG_MPC8265) # define CFG_HRCW_MASTER (__HRCW__ALL__ | HRCW_MODCK_H0111) -#else /* ! MPC8255 */ +#else /* ! MPC8255 && !MPC8265 */ # if defined(CONFIG_266MHz) # define CFG_HRCW_MASTER (__HRCW__ALL__ | HRCW_MODCK_H0111) # elif defined(CONFIG_300MHz) diff --git a/include/exports.h b/include/exports.h new file mode 100644 index 0000000..b45a466 --- /dev/null +++ b/include/exports.h @@ -0,0 +1,36 @@ +#ifndef __MON_SYS_CALL_H__ +#define __MON_SYS_CALL_H__ + +#ifndef __ASSEMBLY__ + +#include + +/* These are declarations of exported functions available in C code */ +unsigned long get_version(void); +int getc(void); +int tstc(void); +void putc(const char); +void puts(const char*); +void printf(const char* fmt, ...); +void install_hdlr(int, interrupt_handler_t*, void*); +void free_hdlr(int); +void *malloc(size_t); +void free(void*); +void udelay(unsigned long); +unsigned long get_timer(unsigned long); + +void app_startup(char **); + +#endif /* ifndef __ASSEMBLY__ */ + +enum { +#define EXPORT_FUNC(x) XF_ ## x , +#include <_exports.h> +#undef EXPORT_FUNC + + XF_MAX +}; + +#define XF_VERSION 1 + +#endif diff --git a/include/image.h b/include/image.h index 155617e..b93d104 100644 --- a/include/image.h +++ b/include/image.h @@ -47,6 +47,7 @@ #define IH_OS_U_BOOT 17 /* Firmware */ #define IH_OS_RTEMS 18 /* RTEMS */ #define IH_OS_ARTOS 19 /* ARTOS */ +#define IH_OS_UNITY 20 /* Unity OS */ /* * CPU Architecture Codes (supported by Linux) @@ -101,7 +102,7 @@ * "Script files" are command sequences that will be executed by * U-Boot's command interpreter; this feature is especially * useful when you configure U-Boot to use a real shell (hush) - * as command interpreter. + * as command interpreter (=> Shell Scripts). */ #define IH_TYPE_INVALID 0 /* Invalid Image */ diff --git a/include/post.h b/include/post.h index 0f63668..130e715 100644 --- a/include/post.h +++ b/include/post.h @@ -34,6 +34,8 @@ #define POST_SLOWTEST 0x04 /* test is slow, enabled by key press */ #define POST_POWERTEST 0x08 /* test runs after watchdog reset */ +#define POST_COLDBOOT 0x80 /* first boot after power-on */ + #define POST_ROM 0x0100 /* test runs in ROM */ #define POST_RAM 0x0200 /* test runs in RAM */ #define POST_MANUAL 0x0400 /* test runs on diag command */ @@ -71,7 +73,7 @@ unsigned long post_time_ms (unsigned long base); extern struct post_test post_list[]; extern unsigned int post_list_size; -extern int post_hotkeys_pressed(gd_t *); +extern int post_hotkeys_pressed(void); #endif /* __ASSEMBLY__ */ diff --git a/include/syscall.h b/include/syscall.h deleted file mode 100644 index 9b9be0d..0000000 --- a/include/syscall.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef __MON_SYS_CALL_H__ -#define __MON_SYS_CALL_H__ - -#ifndef __ASSEMBLY__ - -#include - -/* These are declarations of system calls available in C code */ -int mon_getc(void); -int mon_tstc(void); -void mon_putc(const char); -void mon_puts(const char*); -void mon_printf(const char* fmt, ...); -void mon_install_hdlr(int, interrupt_handler_t*, void*); -void mon_free_hdlr(int); -void *mon_malloc(size_t); -void mon_free(void*); -void mon_udelay(unsigned long); -unsigned long mon_get_timer(unsigned long); - -#endif /* ifndef __ASSEMBLY__ */ - -#define NR_SYSCALLS 11 /* number of syscalls */ - - -/* - * Make sure these functions are in the same order as they - * appear in the "examples/syscall.S" file !!! - */ -#define SYSCALL_GETC 0 -#define SYSCALL_TSTC 1 -#define SYSCALL_PUTC 2 -#define SYSCALL_PUTS 3 -#define SYSCALL_PRINTF 4 -#define SYSCALL_INSTALL_HDLR 5 -#define SYSCALL_FREE_HDLR 6 -#define SYSCALL_MALLOC 7 -#define SYSCALL_FREE 8 -#define SYSCALL_UDELAY 9 -#define SYSCALL_GET_TIMER 10 - -#endif -- cgit v1.1