# HG changeset patch # User Paul Boddie # Date 1433782060 -7200 # Node ID 43cffcb9f04c512fd8145ea6b45d8efdee7cc169 # Parent 4b4b9ab4f2b12e2141a650a77a5b0b65707647a8 Reorganised and tidied the header files and their usage. Various licensing details have also been fixed up. diff -r 4b4b9ab4f2b1 -r 43cffcb9f04c include/configs.h --- a/include/configs.h Mon Jun 08 18:10:10 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * device board - * - * Copyright 2009 (C) Qi Hardware Inc., - * Author: Xiangfu Liu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 3 as published by the Free Software Foundation. - * - * 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 - */ -#ifndef _CONFIGS_H -#define _CONFIGS_H - -/* Here are these common definitions */ -/* Once your system configration change, just modify the file */ - -#include "xburst_types.h" - -#define CONFIG_NR_DRAM_BANKS 1 /* SDRAM BANK Number: 1, 2*/ -#define SDRAM_CASL 3 /* CAS latency: 2 or 3 */ -/* SDRAM Timings, unit: ns */ -#define SDRAM_TRAS 45 /* RAS# Active Time */ -#define SDRAM_RCD 20 /* RAS# to CAS# Delay */ -#define SDRAM_TPC 20 /* RAS# Precharge Time */ -#define SDRAM_TRWL 7 /* Write Latency Time */ -#define SDRAM_TREF 15625 /* Refresh period: 4096 refresh cycles/64ms */ - -extern volatile u32 CPU_ID; -extern volatile u8 SDRAM_BW16; -extern volatile u8 SDRAM_BANK4; -extern volatile u8 SDRAM_ROW; -extern volatile u8 SDRAM_COL; -extern volatile u8 CONFIG_MOBILE_SDRAM; -extern volatile u32 CFG_CPU_SPEED; -extern volatile u8 PHM_DIV; -extern volatile u32 CFG_EXTAL; -extern volatile u32 CONFIG_BAUDRATE; -extern volatile u32 UART_BASE; -extern volatile u8 CONFIG_MOBILE_SDRAM; -extern volatile u8 IS_SHARE; -#endif diff -r 4b4b9ab4f2b1 -r 43cffcb9f04c include/jz4740_lcd.h --- a/include/jz4740_lcd.h Mon Jun 08 18:10:10 2015 +0200 +++ b/include/jz4740_lcd.h Mon Jun 08 18:47:40 2015 +0200 @@ -21,8 +21,8 @@ * MA 02111-1307 USA */ -#ifndef _LCD_H_ -#define _LCD_H_ +#ifndef __JZ4740_LCD_H__ +#define __JZ4740_LCD_H__ /* * LCD controller stucture for JZSOC: JZ4740 @@ -61,6 +61,8 @@ extern vidinfo_t panel_info; +/* General values for colour depths and framebuffer characteristics. */ + #define LCD_MONOCHROME 0 #define LCD_COLOR2 1 #define LCD_COLOR4 2 @@ -68,11 +70,6 @@ #define LCD_COLOR16 4 #define LCD_COLOR32 5 -/* Default to 8bpp if bit depth not specified */ -#ifndef LCD_BPP -#define LCD_BPP LCD_COLOR8 -#endif - #ifndef PAGE_SIZE #define PAGE_SIZE 4096 #endif @@ -81,4 +78,4 @@ #define NBITS(bit_code) (1 << (bit_code)) #define NCOLORS(bit_code) (1 << NBITS(bit_code)) -#endif /* _LCD_H_ */ +#endif /* __JZ4740_LCD_H__ */ diff -r 4b4b9ab4f2b1 -r 43cffcb9f04c include/nanonote.h --- a/include/nanonote.h Mon Jun 08 18:10:10 2015 +0200 +++ b/include/nanonote.h Mon Jun 08 18:47:40 2015 +0200 @@ -1,18 +1,31 @@ /* - * Copyright (C) Xiangfu Liu * Copyright (C) 2015 Paul Boddie + * Copyright (C) 2009 Qi Hardware Inc. + * Authors: Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA */ /* * This file contains the configuration parameters for the NanoNote. */ -#ifndef __CONFIG_NANONOTE_H -#define __CONFIG_NANONOTE_H +#ifndef __NANONOTE_H__ +#define __NANONOTE_H__ + +#include "jz4740_lcd.h" /* * Display configuration @@ -25,6 +38,22 @@ #define CONFIG_SYS_SDRAM_BASE 0x80000000 /* + * SDRAM configuration (timings in ns) + */ +#define CONFIG_NR_DRAM_BANKS 1 + +#define SDRAM_BW16 1 /* Data bus width: 0-32bit, 1-16bit */ +#define SDRAM_BANK4 1 /* Banks each chip: 0-2bank, 1-4bank */ +#define SDRAM_ROW 13 /* Row address: 11 to 13 */ +#define SDRAM_COL 9 /* Column address: 8 to 12 */ +#define SDRAM_CASL 2 /* CAS latency: 2 or 3 */ +#define SDRAM_TRAS 45 /* RAS# Active Time */ +#define SDRAM_RCD 20 /* RAS# to CAS# Delay */ +#define SDRAM_TPC 20 /* RAS# Precharge Time */ +#define SDRAM_TRWL 7 /* Write Latency Time */ +#define SDRAM_TREF 15625 /* Refresh period: 8192 cycles/64ms */ + +/* * Cache configuration */ #define CONFIG_SYS_DCACHE_SIZE 16384 @@ -61,4 +90,4 @@ #define SPDA (2 * 32 + 22) /* LCDSCL:Serial command clock input */ #define SPCK (2 * 32 + 23) /* LCDSDA:Serial command data input */ -#endif /* __CONFIG_NANONOTE_H */ +#endif /* __NANONOTE_H__ */ diff -r 4b4b9ab4f2b1 -r 43cffcb9f04c include/xburst_types.h --- a/include/xburst_types.h Mon Jun 08 18:10:10 2015 +0200 +++ b/include/xburst_types.h Mon Jun 08 18:47:40 2015 +0200 @@ -1,10 +1,21 @@ /* - * Authors: Xiangfu Liu + * Copyright 2009 (C) Qi Hardware Inc., + * Author: Xiangfu Liu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA */ #ifndef __XBURST_TYPES_H__ diff -r 4b4b9ab4f2b1 -r 43cffcb9f04c stage1/board-nanonote.c --- a/stage1/board-nanonote.c Mon Jun 08 18:10:10 2015 +0200 +++ b/stage1/board-nanonote.c Mon Jun 08 18:47:40 2015 +0200 @@ -21,7 +21,6 @@ */ #include "jz4740.h" -#include "configs.h" #include "nanonote.h" #include "usb_boot_defines.h" @@ -29,26 +28,26 @@ /etc/xburst-tools/usbboot.cfg. */ struct fw_args *fw_args; -volatile u32 CPU_ID; -volatile u8 SDRAM_BW16; -volatile u8 SDRAM_BANK4; -volatile u8 SDRAM_ROW; -volatile u8 SDRAM_COL; -volatile u8 CONFIG_MOBILE_SDRAM; -volatile u8 IS_SHARE; +volatile u32 FW_CPU_ID; +volatile u8 FW_SDRAM_BW16; +volatile u8 FW_SDRAM_BANK4; +volatile u8 FW_SDRAM_ROW; +volatile u8 FW_SDRAM_COL; +volatile u8 FW_CONFIG_MOBILE_SDRAM; +volatile u8 FW_IS_SHARE; void load_args(void) { /* Get the fw args from memory. See head1.S for the memory layout. */ fw_args = (struct fw_args *)0x80002008; - CPU_ID = fw_args->cpu_id ; - SDRAM_BW16 = fw_args->bus_width; - SDRAM_BANK4 = fw_args->bank_num; - SDRAM_ROW = fw_args->row_addr; - SDRAM_COL = fw_args->col_addr; - CONFIG_MOBILE_SDRAM = fw_args->is_mobile; - IS_SHARE = fw_args->is_busshare; + FW_CPU_ID = fw_args->cpu_id ; + FW_SDRAM_BW16 = fw_args->bus_width; + FW_SDRAM_BANK4 = fw_args->bank_num; + FW_SDRAM_ROW = fw_args->row_addr; + FW_SDRAM_COL = fw_args->col_addr; + FW_CONFIG_MOBILE_SDRAM = fw_args->is_mobile; + FW_IS_SHARE = fw_args->is_busshare; } /* Initialisation functions. */ @@ -140,15 +139,15 @@ dmcr0 = ((SDRAM_ROW0-11)<