From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200
Date: Wed, 19 Sep 2012 23:02:49 +0200 [thread overview]
Message-ID: <201209192302.49597.marex@denx.de> (raw)
In-Reply-To: <1348083538-16123-2-git-send-email-luk0104@gmail.com>
Dear ?ukasz Da?ek,
[ Joe, see the bottom of my babble here ]
> Signed-off-by: ?ukasz Da?ek <luk0104@gmail.com>
> ---
> arch/arm/include/asm/mach-types.h | 1 +
> board/h2200/Makefile | 51 ++++++++++
> board/h2200/h2200-header.S | 27 +++++
> board/h2200/h2200.c | 197
> +++++++++++++++++++++++++++++++++++++ board/h2200/h2200.h |
> 28 +++++
> boards.cfg | 2 +
> include/configs/h2200.h | 168 +++++++++++++++++++++++++++++++
> 7 files changed, 474 insertions(+), 0 deletions(-)
> create mode 100644 board/h2200/Makefile
> create mode 100644 board/h2200/h2200-header.S
> create mode 100644 board/h2200/h2200.c
> create mode 100644 board/h2200/h2200.h
> create mode 100644 include/configs/h2200.h
>
> diff --git a/arch/arm/include/asm/mach-types.h
> b/arch/arm/include/asm/mach-types.h index 2d5c3bc..b03f385 100644
> --- a/arch/arm/include/asm/mach-types.h
> +++ b/arch/arm/include/asm/mach-types.h
> @@ -74,6 +74,7 @@ extern unsigned int __machine_arch_type;
> #define MACH_TYPE_IXDP2801 300
> #define MACH_TYPE_IQ31244 327
> #define MACH_TYPE_BAST 331
> +#define MACH_TYPE_H2200 341
> #define MACH_TYPE_H1940 347
> #define MACH_TYPE_ENP2611 356
> #define MACH_TYPE_S3C2440 362
How come it's not in the mach-types already? Was it removed? If so, define
CONFIG_MACH_TYPE in your h2200.h (see m28evk.h for example)
> diff --git a/board/h2200/Makefile b/board/h2200/Makefile
> new file mode 100644
> index 0000000..39da114
> --- /dev/null
> +++ b/board/h2200/Makefile
> @@ -0,0 +1,51 @@
> +#
> +# h2200 Support
> +#
> +# Copyright (C) 2012 ?ukasz Da?ek <luk0104@gmail.com>
Can we cut the crappy unicode and stick to ascii?
[...]
> +
> + .org 0x40
> + .ascii "ECEC"
ECEC ... looks familiar, what is it though? WinCE bootloader signature ?
> + .org 0x1000 - 1
> + .byte 0x0
> diff --git a/board/h2200/h2200.c b/board/h2200/h2200.c
> new file mode 100644
> index 0000000..d31c67f
> --- /dev/null
> +++ b/board/h2200/h2200.c
> @@ -0,0 +1,197 @@
> +/*
> + * iPAQ h2200 board configuration
> + *
> + * Copyright (C) 2012 ?ukasz Da?ek <luk0104@gmail.com>
> + *
> + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
> USA + */
> +
> +#include <common.h>
> +#include <asm/arch/pxa.h>
> +#include <asm/arch/pxa-regs.h>
> +#include <asm/io.h>
> +#include "h2200.h"
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#ifdef CONFIG_H2200_USBETH
> +int board_eth_init(bd_t *bis)
> +{
> + usb_eth_initialize(bis);
> + return 0;
> +}
> +#endif
> +
> +int board_early_init_f(void)
> +{
> + /* Enable serial */
> + setbits_le32(GPDR0, 1 << 24);
> + writel(1 << 24, GPSR0);
Shitty ... doesn't the board do GPIO setup in arch/arm/cpu/pxa/pxa2xx.c already?
GPIOlib driver would come handy (see drivers/gpio/)
> + /* Enable serial transreceiver */
> + setbits_le32(GPDR2, 1 << 16);
> + writel(1 << 16, GPSR2);
> +
> + return 0;
> +}
> +
> +int board_init(void)
> +{
> + /* We have RAM, disable cache */
> + dcache_disable();
> + icache_disable();
> + /* arch number of Lubbock-Board */
Lubbock, yea ...
> + gd->bd->bi_arch_number = MACH_TYPE_H2200;
> +
> + /* adress of boot parameters */
> + gd->bd->bi_boot_params = 0xa0000100;
> +
> +#if defined(CONFIG_H2200_USBETH)
> + udc_disconnect();
> + mdelay(500);
Comment won't hurt here
> +#endif
> +
> + return 0;
> +}
> +
> +/*
> + * iPAQ h2200 has two stage bootloader.
> + * We only replace 2nd stage, so u-boot needs to be
> + * adpopted to the way how 1st stage bootloader works.
> + * Firstly, code needs to have first 4 bytes equal to
> + * 0xea0003fe (arm instruction b 0x1000)
GCC/GAS won't generate it so you use .word ?
> and at the offset
> + * 0x40 ascii characters 'ECEC', secondly 1st stage
> + * loads code from flash into SDRAM at address 0xa0040000
> + * so all instructions which reinitializes memory
> + * controller have to be disabled.
> + */
> +
> +static inline void writelrb(uint32_t val, uint32_t addr)
Replace this with clrsetbits_le32()
> +{
> + writel(val, addr);
> + asm volatile("" : : : "memory");
> + readl(addr);
> + asm volatile("" : : : "memory");
> +}
> +
> +static void h2200_pxa2xx_dram_init(void)
Why do you duplicate it ?!
[...]
> +}
> +
> +int dram_init(void)
> +{
> + h2200_pxa2xx_dram_init();
> + gd->ram_size = PHYS_SDRAM_1_SIZE;
> + return 0;
> +}
> +
> +void dram_init_banksize(void)
> +{
> + gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> + gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
Isn't there weak alias for this function in arch/arm/lib/board.c that does
exactly this?
[...]
> diff --git a/include/configs/h2200.h b/include/configs/h2200.h
> new file mode 100644
> index 0000000..fb4ec05
> --- /dev/null
> +++ b/include/configs/h2200.h
> @@ -0,0 +1,168 @@
Missing license header.
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +#define CONFIG_CPU_PXA25X 1
> +#define CONFIG_BOARD_H2200 1
> +
> +#define CONFIG_SYS_NO_FLASH 1
> +
> +#define CONFIG_SYS_HZ 1000
> +
> +#define CONFIG_NR_DRAM_BANKS 1
> +#define PHYS_SDRAM_1 0xa0000000 /* SDRAM Bank #1 */
> +#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
> +
> +#define CONFIG_SYS_DRAM_BASE PHYS_SDRAM_1
> +#define CONFIG_SYS_DRAM_SIZE PHYS_SDRAM_1_SIZE
> +
> +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
> +#define CONFIG_SYS_INIT_SP_ADDR 0xfffff800
> +
> +#define CONFIG_ENV_SIZE 0x00040000
> +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024)
> +
> +#define CONFIG_ENV_IS_NOWHERE 1
> +#define CONFIG_SYS_MAXARGS 16
> +#define CONFIG_SYS_LOAD_ADDR 0xa3000000 /* default load address */
> +
> +/*
> + * iPAQ 1st stage bootloader loads 2nd stage bootloader
> + * at address 0xa0040000 but bootloader requires header
> + * which is 0x1000 long.
> + *
> + * --- Header begin ---
> + * .word 0xea0003fe ; b 0x1000
> + *
> + * .org 0x40
> + * .ascii "ECEC"
> + *
> + * .org 0x1000
> + * --- Header end ---
> + */
> +
> +#define CONFIG_SYS_TEXT_BASE 0xa0041000
> +#define CONFIG_BOARD_EARLY_INIT_F 1
Just define it, not set to 1
[...]
> +#define CONFIG_BAUDRATE 115200
> +#define CONFIG_SYS_BAUDRATE_TABLE { 115200 }
115200 only?
> +/*
> + * USB device configuration
> + */
> +
> +#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1
> +#define CONFIG_USB_DEV_PULLUP_GPIO 33
> +/* USB VBUS GPIO 3 */
> +
> +#define CONFIG_CMD_LOADB 1
> +#define CONFIG_CMD_IMPORTENV 1
> +#define CONFIG_CMD_SOURCE 1
> +#define CONFIG_CMD_RUN 1
> +#define CONFIG_CMD_IMI 1
> +
> +/* Monitor Command Prompt */
> +#define CONFIG_SYS_PROMPT "> "
> +
> +/* Console I/O Buffer Size */
> +#define CONFIG_SYS_CBSIZE 256
> +
> +/* Print Buffer Size */
> +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
> + sizeof(CONFIG_SYS_PROMPT) + 16)
> +
> +#define CONFIG_BOOTARGS "root=/dev/ram0 ro console=ttyS0,115200n8"
> +
> +#ifdef CONFIG_H2200_USBETH
> +# define CONFIG_USB_ETH_SUBSET 1
> +# define CONFIG_SYS_HUSH_PARSER 1
> +# define CONFIG_SYS_PROMPT_HUSH_PS2 "$ "
> +
> +# define CONFIG_CMD_NET 1
> +# define CONFIG_CMD_PING 1
> +
> +# define CONFIG_BOOTDELAY 2
> +
> +# define CONFIG_BOOTCOMMAND \
> + "setenv downloaded 0 ; while test $downloaded -eq 0 ; do " \
> + "if bootp ; then setenv downloaded 1 ; fi ; done ; " \
> + "source :script ; " \
> + "bootm ; "
> +
> +# define CONFIG_USB_GADGET_PXA2XX 1
> +
> +# define CONFIG_FIT 1
> +# define CONFIG_SETUP_MEMORY_TAGS 1
> +# define CONFIG_CMDLINE_TAG 1
> +# define CONFIG_INITRD_TAG 1
> +
> +# define CONFIG_USB_ETHER 1
> +# define CONFIG_USBNET_DEV_ADDR "de:ad:be:ef:00:01"
> +# define CONFIG_USBNET_HOST_ADDR "de:ad:be:ef:00:02"
Definitelly not, any mac address setting should not be present, Joe ?
> +# define CONFIG_EXTRA_ENV_SETTINGS \
> + "stdin=serial\0" \
> + "stdout=serial\0" \
> + "stderr=serial\0"
> +#endif
> +
> +#endif /* __CONFIG_H */
next prev parent reply other threads:[~2012-09-19 21:02 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-19 19:38 [U-Boot] [PATCH 0/6] iPAQ h2200 support Łukasz Dałek
2012-09-19 19:38 ` [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200 Łukasz Dałek
2012-09-19 21:02 ` Marek Vasut [this message]
[not found] ` <505A3B2B.6080907@gmail.com>
2012-09-19 21:43 ` Marek Vasut
2012-09-19 21:54 ` Łukasz Dałek
2012-09-19 22:01 ` Marek Vasut
2012-09-19 22:16 ` Łukasz Dałek
2012-09-19 22:42 ` Marek Vasut
2012-09-19 22:51 ` Łukasz Dałek
2012-09-19 22:56 ` Marek Vasut
2012-09-19 23:07 ` Łukasz Dałek
2012-09-19 23:09 ` Marek Vasut
2012-09-19 23:20 ` Łukasz Dałek
2012-09-19 23:25 ` Marek Vasut
2012-09-19 23:36 ` Łukasz Dałek
2012-09-19 23:43 ` Marek Vasut
2012-09-19 23:51 ` Łukasz Dałek
2012-09-20 0:06 ` Marek Vasut
2012-09-20 5:49 ` Joe Hershberger
2012-09-20 12:14 ` Marek Vasut
2012-09-22 17:02 ` Łukasz Dałek
2012-09-22 17:04 ` Marek Vasut
2012-09-22 17:16 ` Łukasz Dałek
2012-09-22 18:00 ` Marek Vasut
2012-09-22 18:07 ` Łukasz Dałek
2012-09-22 18:21 ` Marek Vasut
2012-09-22 18:34 ` Łukasz Dałek
2012-09-22 18:37 ` Marek Vasut
2012-09-22 18:47 ` Łukasz Dałek
2012-09-19 19:38 ` [U-Boot] [PATCH 2/6] pxa25x: Add USB Ethernet driver Łukasz Dałek
2012-09-19 21:03 ` Marek Vasut
[not found] ` <505A386D.7080302@gmail.com>
2012-09-19 21:39 ` Marek Vasut
2012-09-19 19:38 ` [U-Boot] [PATCH 3/6] pxa: Add some stuff to examine cpu model and rev Łukasz Dałek
2012-09-19 21:04 ` Marek Vasut
2012-09-19 19:38 ` [U-Boot] [PATCH 4/6] usbether: Fixed bug when using with PXA25X chips Łukasz Dałek
2012-09-19 19:38 ` [U-Boot] [PATCH 5/6] usbether: Define CONFIG_USB_ETH_{CDC,SUBSET} Łukasz Dałek
2012-09-19 19:38 ` [U-Boot] [PATCH 6/6] usbether: Removed DEV_CONFIG_{CDC,SUBSET} Łukasz Dałek
2012-09-19 23:10 ` [U-Boot] [PATCH 0/6] iPAQ h2200 support Marek Vasut
2012-09-20 6:36 ` Andreas Bießmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201209192302.49597.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.