From patchwork Sun Mar 27 20:22:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beniamino Galvani X-Patchwork-Id: 602384 X-Patchwork-Delegate: trini@ti.com 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 3qY7ls3t5vz9s5M for ; Mon, 28 Mar 2016 07:23:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=GwqpZKt2; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CFCC5A7602; Sun, 27 Mar 2016 22:23:22 +0200 (CEST) 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 W8yJwYIzv7D5; Sun, 27 Mar 2016 22:23:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 675BDA760A; Sun, 27 Mar 2016 22:23:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2FA82A75F8 for ; Sun, 27 Mar 2016 22:23:02 +0200 (CEST) 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 R4C954q28vuk for ; Sun, 27 Mar 2016 22:23:02 +0200 (CEST) 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-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by theia.denx.de (Postfix) with ESMTPS id 6FF66A75C6 for ; Sun, 27 Mar 2016 22:22:53 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id p65so16651471wmp.1 for ; Sun, 27 Mar 2016 13:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7f0fPKzzN69x0sHrN0jvPWZLXtXu13XXjbEy2+zBSPE=; b=GwqpZKt2cnA+zlKu7HDgTmBY0ATP8LukuNidG50GVceSli/3kMhDNgMJY1sizwb2H8 u+z6d9vCvD3fsSn0NxEdTgRgEpE/giOFl3oEDdOMtWGCqVSQ8GQ2vRuwyqGEIskICViN r1cCcys7rKLgYRmaBXbuNXZyi7Cr2uLeQ1wLrnOnW2iGjTcBmkj/D11SvnNpDKFEHVaW czhNTDWqiqjFLOYQUSc8wrT05c+GHgvX2Knl02Svfg+UAPowil/RBc6rnV9i2JbPM6nt gGJg+WL1udrsncmiR3HC3S7r37Ys71HzneUZzC0BlEC/p6siAu0vuCMHGeX98FMchBZr 6CIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7f0fPKzzN69x0sHrN0jvPWZLXtXu13XXjbEy2+zBSPE=; b=PgPOrBduYgIt3rOmXEuclesgJEIx+FNKg6pHGk4qvG+DwXByb3jFFg6t2SBodDZSF3 vSgXorwFlWPKnY4pOBsxltBmUFVKFmGxmaY0lvT1K66ZVrqL0wT2X+hJXVKdSoSczEpm G+pmmdxUG4uqSTIHRSpTOC22MY16QDK+5dx0ci5OaqY32IdtFPMuDKOZQnDL1onc5SuP YnwbnkK5rowxxdz+SiZqXSxG6p7HahwZaaVxMKLHJgr93eplL4z2cUbBWFnna2OI306F FMaKdFXEWhdTDVJ8u69at9venkPOQNOZwRgIT1WLap1m4GLnYBdKT1aBmOxcLc4vJNph Ur8g== X-Gm-Message-State: AD7BkJLXjymvd03B1/hvE+DwvFMdVDTPdKNGd0YN+9M/sFZF4+5pf96QRs15WGxCi/0arQ== X-Received: by 10.195.12.42 with SMTP id en10mr25028638wjd.13.1459110173498; Sun, 27 Mar 2016 13:22:53 -0700 (PDT) Received: from shire.fritz.box ([95.236.43.82]) by smtp.gmail.com with ESMTPSA id jo6sm21667503wjb.48.2016.03.27.13.22.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Mar 2016 13:22:52 -0700 (PDT) From: Beniamino Galvani To: u-boot@lists.denx.de Date: Sun, 27 Mar 2016 22:22:14 +0200 Message-Id: <1459110135-10837-5-git-send-email-b.galvani@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1459110135-10837-1-git-send-email-b.galvani@gmail.com> References: <1459110135-10837-1-git-send-email-b.galvani@gmail.com> Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Carlo Caione Subject: [U-Boot] [PATCH 4/5] arm: meson: use device tree X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Convert the board and config files to the use of device tree. Signed-off-by: Beniamino Galvani --- arch/arm/mach-meson/board.c | 24 ++++++++++++++++++++++++ configs/odroid-c2_defconfig | 2 ++ 2 files changed, 26 insertions(+) diff --git a/arch/arm/mach-meson/board.c b/arch/arm/mach-meson/board.c index 346a2c2..9781f1a 100644 --- a/arch/arm/mach-meson/board.c +++ b/arch/arm/mach-meson/board.c @@ -5,6 +5,8 @@ */ #include +#include +#include #include #include @@ -17,9 +19,31 @@ int board_init(void) int dram_init(void) { + const fdt32_t *val; + int offset; + int len; + + offset = fdt_path_offset(gd->fdt_blob, "/memory"); + if (offset < 0) + return -EINVAL; + + val = fdt_getprop(gd->fdt_blob, offset, "reg", &len); + if (len < sizeof(*val) * 4) + return -EINVAL; + + /* Don't use fdt64_t to avoid unaligned access */ + gd->ram_size = (uint64_t)fdt32_to_cpu(val[2]) << 32; + gd->ram_size |= fdt32_to_cpu(val[3]); + return 0; } +void dram_init_banksize(void) +{ + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + gd->bd->bi_dram[0].size = gd->ram_size; +} + void reset_cpu(ulong addr) { } diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig index 8e6df12..66d9ab7 100644 --- a/configs/odroid-c2_defconfig +++ b/configs/odroid-c2_defconfig @@ -2,6 +2,8 @@ CONFIG_ARM=y CONFIG_ARCH_MESON=y CONFIG_MESON_GXBB=y CONFIG_TARGET_ODROID_C2=y +CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2" +CONFIG_OF_CONTROL=y # CONFIG_CMD_BDI is not set # CONFIG_CMD_IMI is not set # CONFIG_CMD_IMLS is not set