From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Y1fMa-0008TQ-FJ for mharc-grub-devel@gnu.org; Thu, 18 Dec 2014 12:59:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1fMT-0008TG-2l for grub-devel@gnu.org; Thu, 18 Dec 2014 12:59:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1fMN-00019N-2z for grub-devel@gnu.org; Thu, 18 Dec 2014 12:59:41 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:36700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1fMM-000186-U9 for grub-devel@gnu.org; Thu, 18 Dec 2014 12:59:35 -0500 Received: by mail-pd0-f172.google.com with SMTP id y13so1855707pdi.31 for ; Thu, 18 Dec 2014 09:59:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:reply-to:organization :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=0V68JxGou8MoRvycu6/FAesoMClSjEynmCARcLrM08k=; b=GxodaiJf87Hdba1973RT0Af7SlhoFwhbMKG50nEZv0sDh5ErvR5whz1EwIbsuXM4zN HnfQW7T72NWohvVJwI3C6wSTVwvCE48cNK9hAp+ZkDODFZ0oPwXTXn0OLH/QeGYbARzA DuW+LYxeKe9cZ6zPC/uPYqMXeDatPUX3IAo/pnmCZ4T0VI4G+28Cu/+Qag4tIWwRIVSq YW2Fd+VnNaRkZmlhr0bjAuKGChPmO10jdwCTsbxtV4+MF8JwO3ZZs15Ubsd/sZdXKyXl PTH7b8seNwp36mhiI11HulxyRy6SNnHMJHdveD58WtEVIdTgbznA2OivitmqVsHnkE6z fdTA== X-Gm-Message-State: ALoCoQllS7tjRnwHHthNDuYLCp890EcrUYNQokMRjx1a/n6ZnKjtt/mrOKxlS+9Ly16nvsOlJO+4 X-Received: by 10.66.124.227 with SMTP id ml3mr5711678pab.28.1418925574158; Thu, 18 Dec 2014 09:59:34 -0800 (PST) Received: from [192.168.1.11] ([59.58.226.187]) by mx.google.com with ESMTPSA id cq6sm7421611pad.30.2014.12.18.09.59.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 09:59:33 -0800 (PST) Message-ID: <54931602.9070807@linaro.org> Date: Fri, 19 Dec 2014 01:59:30 +0800 From: Fu Wei Organization: Linaro User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: grub-devel@gnu.org, Leif Lindholm , Ian Campbell Subject: [PATCH 1/5] Add grub_fdt_set_reg64 macro into fdt.h header file for Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.172 Cc: Roy Franz , Jon Masters , linaro-uefi X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 17:59:47 -0000 inserting "reg" properiy, while #address-cells = <0x2> and #size-cells = <0x2> Signed-off-by: Fu Wei Reviewed-by: Leif Lindholm --- include/grub/fdt.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/grub/fdt.h b/include/grub/fdt.h index 3016998..fdfca75 100644 --- a/include/grub/fdt.h +++ b/include/grub/fdt.h @@ -117,4 +117,16 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name, grub_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 8); \ }) +/* Setup "reg" property for + * #address-cells = <0x2> + * #size-cells = <0x2> + */ +#define grub_fdt_set_reg64(fdt, nodeoffset, addr, size) \ +({ \ + grub_uint64_t reg_64[2]; \ + reg_64[0] = grub_cpu_to_be64(addr); \ + reg_64[1] = grub_cpu_to_be64(size); \ + grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \ +}) + #endif /* ! GRUB_FDT_HEADER */ -- 1.8.3.1