From patchwork Fri Mar 18 08:04:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rogan Dawes X-Patchwork-Id: 87498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 67752B6FDE for ; Fri, 18 Mar 2011 19:07:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 06F84281CB; Fri, 18 Mar 2011 09:06:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WXGTOETnFQfL; Fri, 18 Mar 2011 09:06:19 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5FF4D281CE; Fri, 18 Mar 2011 09:05:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A1A892817D for ; Fri, 18 Mar 2011 09:05:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G8R7hgd10qCi for ; Fri, 18 Mar 2011 09:05:48 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ww0-f52.google.com (mail-ww0-f52.google.com [74.125.82.52]) by theia.denx.de (Postfix) with ESMTPS id 949F9281A3 for ; Fri, 18 Mar 2011 09:05:36 +0100 (CET) Received: by mail-ww0-f52.google.com with SMTP id 40so4640941wwj.9 for ; Fri, 18 Mar 2011 01:05:36 -0700 (PDT) Received: by 10.227.147.196 with SMTP id m4mr843222wbv.179.1300435536405; Fri, 18 Mar 2011 01:05:36 -0700 (PDT) Received: from localhost.localdomain (196-215-42-15.dynamic.isadsl.co.za [196.215.42.15]) by mx.google.com with ESMTPS id y12sm260049wby.25.2011.03.18.01.05.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 01:05:35 -0700 (PDT) From: rogan@dawes.za.net To: u-boot@lists.denx.de Date: Fri, 18 Mar 2011 10:04:58 +0200 Message-Id: <1300435500-4909-10-git-send-email-rogan@dawes.za.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <4D81FE7F.8090002@dawes.za.net> References: <4D81FE7F.8090002@dawes.za.net> Subject: [U-Boot] [PATCH 09/11] Support passing a Marvell-specific ATAG X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Rogan Dawes --- arch/arm/include/asm/setup.h | 18 ++++++++++++++++++ arch/arm/lib/bootm.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h index 89df4dc..bd6229a 100644 --- a/arch/arm/include/asm/setup.h +++ b/arch/arm/include/asm/setup.h @@ -198,6 +198,19 @@ struct tag_acorn { u8 adfsdrives; }; +/* Marvell specific information + * requred for compatability with vendor kernels + */ +#define ATAG_MV_UBOOT 0x41000403 + +struct tag_mv_uboot { + u32 uboot_version; + u32 tclk; + u32 sysclk; + u32 isUsbHost; + u32 overEthAddr; +}; + /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */ #define ATAG_MEMCLK 0x41000402 @@ -227,6 +240,11 @@ struct tag { * DC21285 specific */ struct tag_memclk memclk; + + /* + * Marvell specific + */ + struct tag_mv_uboot mv_uboot; } u; }; diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 3101321..f3acd6c 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -45,6 +45,11 @@ static void setup_commandline_tag (bd_t *bd, char *commandline); static void setup_initrd_tag (bd_t *bd, ulong initrd_start, ulong initrd_end); # endif + +#ifdef CONFIG_MARVELL_TAG +static void setup_marvell_tag(void); +#endif + static void setup_end_tag (bd_t *bd); static struct tag *params; @@ -80,6 +85,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima #if defined (CONFIG_SETUP_MEMORY_TAGS) || \ defined (CONFIG_CMDLINE_TAG) || \ defined (CONFIG_INITRD_TAG) || \ + defined (CONFIG_MARVELL_TAG) || \ defined (CONFIG_SERIAL_TAG) || \ defined (CONFIG_REVISION_TAG) setup_start_tag (bd); @@ -99,6 +105,9 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima if (images->rd_start && images->rd_end) setup_initrd_tag (bd, images->rd_start, images->rd_end); #endif +#ifdef CONFIG_MARVELL_TAG + setup_marvell_tag(); +#endif setup_end_tag (bd); #endif @@ -232,6 +241,27 @@ void setup_revision_tag(struct tag **in_params) } #endif /* CONFIG_REVISION_TAG */ +#ifdef CONFIG_MARVELL_TAG +#define ATAG_MARVELL 0x41000403 +#define VER_NUM 0x01070300 + +void setup_marvell_tag(void) { + debug("Setting up Marvell tag\n"); + params->hdr.tag = ATAG_MARVELL; + params->hdr.size = tag_size (tag_mv_uboot); + + params->u.mv_uboot.uboot_version = VER_NUM; + params->u.mv_uboot.uboot_version |= 0xB; // RD_88F5182_2XSATA + params->u.mv_uboot.tclk = 166000000; + params->u.mv_uboot.sysclk = 166000000; + params->u.mv_uboot.isUsbHost = 1; + params->u.mv_uboot.isUsbHost |= 2; + + params->u.mv_uboot.overEthAddr = 0; + + params = tag_next (params); +} +#endif static void setup_end_tag (bd_t *bd) {