From patchwork Mon Feb 3 22:12:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darwin Rambo X-Patchwork-Id: 24072 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AD040202B2 for ; Mon, 3 Feb 2014 22:13:02 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id le5sf19887346vcb.11 for ; Mon, 03 Feb 2014 14:13:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=3ZeUJuQHQFqbI+Akz/+mgR/LuUdRzRepHG6TsF90d4M=; b=OEgVSlkrGNWOndM8lZLF66L8vCVBk6Nk1bua7I6dcv0iTq8IotT7DQ69JloU3BLxkU 9sznAC9ZLCT7d9Sp2cOzXnAOHAQ+aztzgtYYfUvVSw46lWng43T//7XLPMpoPci0f8r9 FRW49VJ/V+94DCdeqoHsTnivvCVkNkbHiCF17R4O7COlB7bGXW9IhvJxUaZkw5ybiRPx XDtBz3h94r+aqeqII15yrqAHN8dxRvRkaJNyt/PZz+9f2MIdHFdyEC2p5oKUocM+xwrj slj6ekFXiU4F0Kz5cGSLQirgtL/kgHyPuNsvXMBUODYI4WkXnqfGINaV6ooAc4NGY2MG 3nkg== X-Gm-Message-State: ALoCoQlxf3rOVPuyQJ2bKuYQNrmJkcaaDRJdi0egXpK59Z1FGyuWuVkwpSy/FwzoMpKNOeqxtjYr X-Received: by 10.52.53.73 with SMTP id z9mr12776116vdo.4.1391465581650; Mon, 03 Feb 2014 14:13:01 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.35.208 with SMTP id n74ls2142058qgn.65.gmail; Mon, 03 Feb 2014 14:13:01 -0800 (PST) X-Received: by 10.52.246.133 with SMTP id xw5mr2441817vdc.32.1391465581541; Mon, 03 Feb 2014 14:13:01 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id er6si7264384vdc.23.2014.02.03.14.13.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Feb 2014 14:13:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id c14so5423948vea.34 for ; Mon, 03 Feb 2014 14:13:01 -0800 (PST) X-Received: by 10.220.95.139 with SMTP id d11mr6520826vcn.21.1391465581443; Mon, 03 Feb 2014 14:13:01 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp187743vcz; Mon, 3 Feb 2014 14:13:00 -0800 (PST) X-Received: by 10.14.175.2 with SMTP id y2mr5590999eel.75.1391465580295; Mon, 03 Feb 2014 14:13:00 -0800 (PST) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id g47si38066249eet.150.2014.02.03.14.12.59 for ; Mon, 03 Feb 2014 14:13:00 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 883CB4B8D6; Mon, 3 Feb 2014 23:12:57 +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 bDYyxAs6ogJ1; Mon, 3 Feb 2014 23:12:57 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B6494B8BE; Mon, 3 Feb 2014 23:12:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 13BF14B8B7 for ; Mon, 3 Feb 2014 23:12:45 +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 0Xhbc8hph1Wq for ; Mon, 3 Feb 2014 23:12:41 +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-gw1-out.broadcom.com (mail-gw1-out.broadcom.com [216.31.210.62]) by theia.denx.de (Postfix) with ESMTP id 26A504B89A for ; Mon, 3 Feb 2014 23:12:36 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.95,774,1384329600"; d="scan'208";a="12926818" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw1-out.broadcom.com with ESMTP; 03 Feb 2014 14:38:10 -0800 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 3 Feb 2014 14:12:34 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.3.174.1; Mon, 3 Feb 2014 14:12:34 -0800 Received: from mail.broadcom.com (dhcp-rmna-vpn-108.ric.broadcom.com [10.136.253.108]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 658FC246A4; Mon, 3 Feb 2014 14:12:34 -0800 (PST) From: Darwin Rambo To: Date: Mon, 3 Feb 2014 14:12:11 -0800 Message-ID: <1391465536-25338-2-git-send-email-drambo@broadcom.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1391465536-25338-1-git-send-email-drambo@broadcom.com> References: <1391465536-25338-1-git-send-email-drambo@broadcom.com> MIME-Version: 1.0 Cc: Darwin Rambo Subject: [U-Boot] [PATCH v2 1/6] arch: kona: Initial commit of kona-common architecture code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: drambo@broadcom.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The Kona architecture is present on a number of Broadcom mobile SoCs including the bcm281xx family of chips. Signed-off-by: Darwin Rambo Reviewed-by: Steve Rae Reviewed-by: Tim Kryger --- arch/arm/cpu/armv7/Makefile | 1 + arch/arm/cpu/armv7/kona-common/Makefile | 9 ++++++++ arch/arm/cpu/armv7/kona-common/clk-stubs.c | 21 +++++++++++++++++ arch/arm/cpu/armv7/kona-common/hwinit-common.c | 16 +++++++++++++ arch/arm/cpu/armv7/kona-common/s_init.c | 12 ++++++++++ arch/arm/include/asm/kona-common/clk.h | 29 ++++++++++++++++++++++++ arch/arm/include/asm/kona-common/kona_sdhci.h | 12 ++++++++++ 7 files changed, 100 insertions(+) create mode 100644 arch/arm/cpu/armv7/kona-common/Makefile create mode 100644 arch/arm/cpu/armv7/kona-common/clk-stubs.c create mode 100644 arch/arm/cpu/armv7/kona-common/hwinit-common.c create mode 100644 arch/arm/cpu/armv7/kona-common/s_init.c create mode 100644 arch/arm/include/asm/kona-common/clk.h create mode 100644 arch/arm/include/asm/kona-common/kona_sdhci.h diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile index 0467d00..119ebb3 100644 --- a/arch/arm/cpu/armv7/Makefile +++ b/arch/arm/cpu/armv7/Makefile @@ -23,6 +23,7 @@ obj-y += nonsec_virt.o obj-y += virt-v7.o endif +obj-$(CONFIG_KONA) += kona-common/ obj-$(CONFIG_OMAP_COMMON) += omap-common/ obj-$(CONFIG_TEGRA) += tegra-common/ diff --git a/arch/arm/cpu/armv7/kona-common/Makefile b/arch/arm/cpu/armv7/kona-common/Makefile new file mode 100644 index 0000000..8af6f2c --- /dev/null +++ b/arch/arm/cpu/armv7/kona-common/Makefile @@ -0,0 +1,9 @@ +# +# Copyright 2013 Broadcom Corporation. All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += s_init.o +obj-y += hwinit-common.o +obj-y += clk-stubs.o diff --git a/arch/arm/cpu/armv7/kona-common/clk-stubs.c b/arch/arm/cpu/armv7/kona-common/clk-stubs.c new file mode 100644 index 0000000..824d597 --- /dev/null +++ b/arch/arm/cpu/armv7/kona-common/clk-stubs.c @@ -0,0 +1,21 @@ +/* + * Copyright 2013 Broadcom Corporation. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include + +/* + * These weak functions are available to kona architectures that don't + * require clock enables from the driver code. + */ +int __weak clk_sdio_enable(void *base, u32 rate, u32 *actual_ratep) +{ + return 0; +} + +int __weak clk_bsc_enable(void *base, u32 rate, u32 *actual_ratep) +{ + return 0; +} diff --git a/arch/arm/cpu/armv7/kona-common/hwinit-common.c b/arch/arm/cpu/armv7/kona-common/hwinit-common.c new file mode 100644 index 0000000..eb046a5 --- /dev/null +++ b/arch/arm/cpu/armv7/kona-common/hwinit-common.c @@ -0,0 +1,16 @@ +/* + * Copyright 2013 Broadcom Corporation. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include + +#ifndef CONFIG_SYS_DCACHE_OFF +void enable_caches(void) +{ + /* Enable D-cache. I-cache is already enabled in start.S */ + dcache_enable(); +} +#endif diff --git a/arch/arm/cpu/armv7/kona-common/s_init.c b/arch/arm/cpu/armv7/kona-common/s_init.c new file mode 100644 index 0000000..510896c --- /dev/null +++ b/arch/arm/cpu/armv7/kona-common/s_init.c @@ -0,0 +1,12 @@ +/* + * System init + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* + * Early system init. Currently empty. + */ +void s_init(void) +{ +} diff --git a/arch/arm/include/asm/kona-common/clk.h b/arch/arm/include/asm/kona-common/clk.h new file mode 100644 index 0000000..52031d3 --- /dev/null +++ b/arch/arm/include/asm/kona-common/clk.h @@ -0,0 +1,29 @@ +/* + * Copyright 2013 Broadcom Corporation. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* This API file is loosely based on u-boot/drivers/video/ipu.h and linux */ + +#ifndef __KONA_COMMON_CLK_H +#define __KONA_COMMON_CLK_H + +#include + +struct clk; + +/* Only implement required functions for your specific architecture */ +int clk_init(void); +struct clk *clk_get(const char *id); +int clk_enable(struct clk *clk); +void clk_disable(struct clk *clk); +unsigned long clk_get_rate(struct clk *clk); +long clk_round_rate(struct clk *clk, unsigned long rate); +int clk_set_rate(struct clk *clk, unsigned long rate); +int clk_set_parent(struct clk *clk, struct clk *parent); +struct clk *clk_get_parent(struct clk *clk); +int clk_sdio_enable(void *base, u32 rate, u32 *actual_ratep); +int clk_bsc_enable(void *base); + +#endif diff --git a/arch/arm/include/asm/kona-common/kona_sdhci.h b/arch/arm/include/asm/kona-common/kona_sdhci.h new file mode 100644 index 0000000..03f04dd --- /dev/null +++ b/arch/arm/include/asm/kona-common/kona_sdhci.h @@ -0,0 +1,12 @@ +/* + * Copyright 2013 Broadcom Corporation. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __KONA_SDHCI_H +#define __KONA_SDHCI_H + +int kona_sdhci_init(int dev_index, u32 min_clk, u32 quirks); + +#endif