Message ID | 1591267479-8900-4-git-send-email-sagar.kadam@sifive.com |
---|---|
State | Superseded |
Delegated to: | Andes |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=selector1 header.b=EhoD0GPR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49d2WD6WPPz9sSf for <incoming@patchwork.ozlabs.org>; Thu, 4 Jun 2020 20:46:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B0364813C3; Thu, 4 Jun 2020 12:45:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.b="EhoD0GPR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 10AB781868; Thu, 4 Jun 2020 12:45:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20611.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::611]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 63C6A801CA for <u-boot@lists.denx.de>; Thu, 4 Jun 2020 12:45:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sagar.kadam@sifive.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FIuKQwRDU2RSHnyHkq0rbBXbDazAdLbj+hFcZKxJGHGr4ZVfaFxQFe44Hm7ul+XLnbTKnYmnC/QYdcDN1Ljgl1MPW7618At2jftOxorFg4vuV155vkxz/eidbuzSoP2TDfJDFM3b/GIZJoVpcBXKAM2Gx9KPzid4M1DKmnoPqS2RGtKcl7Clom2wpGbcJP6ke67csUWGOwTawqkdaHBQo8bUjB8V41i7bjOuUxQ48XS6OFyx5DypTN3jQ9leYtYzNYEHAwMAqQYcv1aGJoxacC+cfIIT6Ko1dDO6O2J3jcfoAi8uJfRv3feiti4cG5lFaeBJnSiiYtyGdYaycErWAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H3Q5xPtmgGdEGdcEcTM+vZona0QqBGqIGdQiV+55lFo=; b=gotPsZ0hxK62A5wUmL5oDdMg6z6LBwlLrrhAmC+JDsgiBc9LVFPMUcRgT1LecUwjcMa5EWSzDgfmMawEMYDc4PDp0qwV9Bjv4GeWUBZhmWhZMSyMcIY/COedJpsCXhRxtvQ9lcGR40ix/8Ajv+NdyzPKve9cXIMKromvT6c3LpBC5gcbtM61UYVKETeg1FFXttHfKjVpQjDcciHb44YpLixl0cE3vRe1t24hMNXHxFk5urasNxuvEyAZDrViTZzwFwvWXXr3mer6NIJacWa0EMNdqhMV3DMoV7+R5petu5SgTgv08akO6RAN1XVlSslQZbxSoOhVmWK6cRnLi1flpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sifive.com; dmarc=pass action=none header.from=sifive.com; dkim=pass header.d=sifive.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H3Q5xPtmgGdEGdcEcTM+vZona0QqBGqIGdQiV+55lFo=; b=EhoD0GPRQKB6kwsoLae3onZESDYebS2NmuhgS7tMlEiIbiL1eH6c1MmNlzvTOIvgO3LYuyzkVQoYsSfA04/1ehw99wBbG+09rJjji2Txl1vEtO4b+C8JBoqYcatWMZLzkcfTGFB3wzIj3Y6KrDtss6cRaFNKoLE724SlZDBLZn4= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=sifive.com; Received: from BN8PR13MB2611.namprd13.prod.outlook.com (2603:10b6:408:81::17) by BN6PR13MB1076.namprd13.prod.outlook.com (2603:10b6:404:21::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.7; Thu, 4 Jun 2020 10:44:57 +0000 Received: from BN8PR13MB2611.namprd13.prod.outlook.com ([fe80::c1d9:f4ee:80ab:de83]) by BN8PR13MB2611.namprd13.prod.outlook.com ([fe80::c1d9:f4ee:80ab:de83%6]) with mapi id 15.20.3066.016; Thu, 4 Jun 2020 10:44:57 +0000 From: Sagar Shrikant Kadam <sagar.kadam@sifive.com> To: u-boot@lists.denx.de, rick@andestech.com, lukma@denx.de Cc: bmeng.cn@gmail.com, jagan@amarulasolutions.com, pragnesh.patel@sifive.com, anup.patel@wdc.com, sjg@chromium.org, seanga2@gmail.com, Sagar Shrikant Kadam <sagar.kadam@sifive.com> Subject: [PATCH v3 3/4] riscv: cpu: fixes to display proper CPU features Date: Thu, 4 Jun 2020 03:44:38 -0700 Message-Id: <1591267479-8900-4-git-send-email-sagar.kadam@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591267479-8900-1-git-send-email-sagar.kadam@sifive.com> References: <1591267479-8900-1-git-send-email-sagar.kadam@sifive.com> Content-Type: text/plain X-ClientProxiedBy: BYAPR06CA0042.namprd06.prod.outlook.com (2603:10b6:a03:14b::19) To BN8PR13MB2611.namprd13.prod.outlook.com (2603:10b6:408:81::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from gamma07.internal.sifive.com (64.62.193.194) by BYAPR06CA0042.namprd06.prod.outlook.com (2603:10b6:a03:14b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Thu, 4 Jun 2020 10:44:56 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [64.62.193.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 94560750-9d28-45ce-c289-08d808745306 X-MS-TrafficTypeDiagnostic: BN6PR13MB1076: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <BN6PR13MB1076D2489938DBE1B6E58D7B99890@BN6PR13MB1076.namprd13.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 04244E0DC5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wBXkX/U5aX27dhn+eS7N5eAhBM0enSY8AWUFynulOSlj3PlX3CKui5AJgYpztN9e+tcqcBGdTsNtFY4kgKRd/asT7JpYXIVwan+Cw2/P3yvNrMZ+UtOixKu+pnrLivSxnj4lHyPjrX4D0zM/2tM2k4RKqPzzzarzzOAyVWK0ckX1JY8S1Xl2ynUAteWHnnegBVGAKGh7Zz3JulthbYah8RZsJeckn2fzIomwCrFTkN+2adA2keY5MxeoB5a83V/Z2zMjzmtvgN2LSd2oQQUODXV30Wre64jWCOQH62hyvS4Pbbv7wC4w9Vtqds9yBs14SYQrs21wVFuhW7EgNYym2A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR13MB2611.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39840400004)(136003)(396003)(346002)(366004)(376002)(2616005)(86362001)(6666004)(316002)(16526019)(66476007)(8936002)(107886003)(2906002)(6486002)(186003)(66556008)(7696005)(956004)(52116002)(36756003)(478600001)(66946007)(8676002)(4326008)(83380400001)(5660300002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: fF9jveNA4UJrKaoG+QTtZprH4FEsIeyX5VnokdBLujM5l9VHWQqzuBCtRXb8rfFYZgwllJ5FhBELAW20LDAjzb8XMHZ8UgfdXaio8KiNR9duFO/H7s0xQJjdl7XJmYtwW7GIY9z60z03DN76rFGyElVab+z4KdUFYnyYsSe55CQzxrdaGPiv8Nzlhqok/FacAgA+pejrnMPt1Mg5JjZ0Sgyo5+rDNibeS+1XFThXdGucj870//vrGG21Y7GtwMs/Z81eJfScvncHvYadKcPg+ko6SQ2srTleo2B2xpsTcoeLEahD9kLgSlXdaMsIzbh9X+KSmkLKjiePisZxo7tvmTRYmOgVLf1WbJIYiMz7m2pTSMfoZbQpsJTq5eaY0evN/K/mEMmlOeXcOtis+m9NdLTE0SoZDppYIXbu3IRLPSjbgqR589Uvj0Jf2WHP20s1c5pzJ1K95ycXeKdEFeh61SMt3mCuxy0sqFjOZxfty5Q= X-OriginatorOrg: sifive.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94560750-9d28-45ce-c289-08d808745306 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2020 10:44:57.7354 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 22f88e9d-ae0d-4ed9-b984-cdc9be1529f1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1t/pEq5qXWG5Irf8HHVBrKD+Hk79vB0EqLfPSi7W8bb80hjnnMwzNb8/gvLvyjllg+yE37HxfqMtBZAXVDW4ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR13MB1076 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
update clock handler and proper cpu features
|
expand
|
diff --git a/drivers/cpu/riscv_cpu.c b/drivers/cpu/riscv_cpu.c index 76b0489..8c4b5e7 100644 --- a/drivers/cpu/riscv_cpu.c +++ b/drivers/cpu/riscv_cpu.c @@ -38,6 +38,8 @@ static int riscv_cpu_get_info(struct udevice *dev, struct cpu_info *info) /* Zero out the frequency, in case sizeof(ulong) != sizeof(u32) */ info->cpu_freq = 0; + /* Initialise cpu features before updating from device tree */ + info->features = 0; /* First try getting the frequency from the assigned clock */ ret = clk_get_by_index(dev, 0, &clk); @@ -52,7 +54,7 @@ static int riscv_cpu_get_info(struct udevice *dev, struct cpu_info *info) dev_read_u32(dev, "clock-frequency", (u32 *)&info->cpu_freq); mmu = dev_read_string(dev, "mmu-type"); - if (!mmu) + if (mmu) info->features |= BIT(CPU_FEAT_MMU); return 0;