From patchwork Tue May 18 19:47:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 1480460 Return-Path: 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=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=YQ8h5Gck; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fl6BN0W4Qz9sVt for ; Wed, 19 May 2021 05:53:32 +1000 (AEST) Received: from localhost ([::1]:34758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj5mU-0002uE-10 for incoming@patchwork.ozlabs.org; Tue, 18 May 2021 15:53:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3xxmkYAcKCpYL4DJKH46EE6B4.2ECG4CK-34L4BDED6DK.EH6@flex--venture.bounces.google.com>) id 1lj5gi-0007tb-GS for qemu-devel@nongnu.org; Tue, 18 May 2021 15:47:32 -0400 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]:34773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3xxmkYAcKCpYL4DJKH46EE6B4.2ECG4CK-34L4BDED6DK.EH6@flex--venture.bounces.google.com>) id 1lj5ga-00078P-M1 for qemu-devel@nongnu.org; Tue, 18 May 2021 15:47:32 -0400 Received: by mail-yb1-xb49.google.com with SMTP id b66-20020a25cb450000b02905076ea039f1so13992112ybg.1 for ; Tue, 18 May 2021 12:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=m4GNndj9w5BB2q8HFyXVE7JGjupZSHOpFa5YLNlobZM=; b=YQ8h5GckbOGoZ27LSe/BtnbzvJRt92ekECt3jXPX08B806bqL50Res0xiY2RHHs3SU oF/dp7LJsTpNWEpn8SxOvvYQ/nxFoC6GSZUChkuYrIZQqYAlx40Ei/7TN52fZ3qLAJcK s9jIP4DkQxKEmPCAK+dY4Doe7gAf4TmhWaHA5YVI/dQdHSGSVD/AjoYgExYS0MAldAp8 AIIH+4I3LaWD+BeTqAbuJG2xwqNhO9hn1XcK+2sA/2nzWgdEOH+FbBiwNIWbAdT8UneB 6YxVNA22FrNQUwzeMsIvQ4Ximh5+fvAdiY7iNIGZeWfAhK4PilZ3ix1AE1c++yVuhJ4I XYVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=m4GNndj9w5BB2q8HFyXVE7JGjupZSHOpFa5YLNlobZM=; b=QKjaVlxCZpkUpOCBGKJKY9oS1sH7tcnIjhg6wEcR8gEX/RFAfQH0WDQMcSzY+d4gB5 LzDRvUr/M7vCbmT+XudVLNgdnpG7Lq9TpFskFqsDOwIbIjgdisI3ul9rE5XoSm0wsiYd Zc/mdDz9nejHZ3US4Y13NR3rp12lLLe2+XOpfQR69mP6DiskvQpFBth/cSL1JgNsx39M rdzSAKgLByhCJvvv3FjlXjispy0CmCTR+h957M95fyfSDZb2oRtoMiyWUTVLFw/ukzRl tfutuloW9vwoMX7S/6fY1Fsc8bXSo0hWi9HSKfKZCs2qZKnVtpeo9AG+++1xLGrHC3E/ UtBA== X-Gm-Message-State: AOAM532GNNhCDmXgKRnHDSIUjKBbRjL5uscveXz7Cq7poDXAr6uw8RPF RLBF2Wkg/1SxNbXegASosGPgLEMiZI1x X-Google-Smtp-Source: ABdhPJx1po/pt4eTE87GwFyUi4tcWkAJ+jpaJWy6BfBRla+guksZsmldcGA8K5rnI1CfY35xwA0TU3Ks57jM X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:5902:8a04:d917:4e93]) (user=venture job=sendgmr) by 2002:a25:1884:: with SMTP id 126mr9714972yby.124.1621367239016; Tue, 18 May 2021 12:47:19 -0700 (PDT) Date: Tue, 18 May 2021 12:47:03 -0700 In-Reply-To: <20210518194704.764241-1-venture@google.com> Message-Id: <20210518194704.764241-2-venture@google.com> Mime-Version: 1.0 References: <20210518194704.764241-1-venture@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH 1/2] hw/arm: add quanta-gbs-bmc machine From: Patrick Venture To: hskinnemoen@google.com, kfting@nuvoton.com Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Patrick Venture , Brandon Kim , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::b49; envelope-from=3xxmkYAcKCpYL4DJKH46EE6B4.2ECG4CK-34L4BDED6DK.EH6@flex--venture.bounces.google.com; helo=mail-yb1-xb49.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Adds initial quanta-gbs-bmc machine support. Tested: Boots to userspace. Signed-off-by: Patrick Venture Reviewed-by: Brandon Kim Reviewed-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index d4553e3786..34a214fe79 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -29,6 +29,7 @@ #define NPCM750_EVB_POWER_ON_STRAPS 0x00001ff7 #define QUANTA_GSJ_POWER_ON_STRAPS 0x00001fff +#define QUANTA_GBS_POWER_ON_STRAPS 0x000017ff /* TODO: Get real values. */ static const char npcm7xx_default_bootrom[] = "npcm7xx_bootrom.bin"; @@ -268,6 +269,22 @@ static void quanta_gsj_init(MachineState *machine) npcm7xx_load_kernel(machine, soc); } +static void quanta_gbs_init(MachineState *machine) +{ + NPCM7xxState *soc; + + soc = npcm7xx_create_soc(machine, QUANTA_GBS_POWER_ON_STRAPS); + npcm7xx_connect_dram(soc, machine->ram); + qdev_realize(DEVICE(soc), NULL, &error_fatal); + + npcm7xx_load_bootrom(machine, soc); + + npcm7xx_connect_flash(&soc->fiu[0], 0, "mx66u51235f", + drive_get(IF_MTD, 0, 0)); + + npcm7xx_load_kernel(machine, soc); +} + static void npcm7xx_set_soc_type(NPCM7xxMachineClass *nmc, const char *type) { NPCM7xxClass *sc = NPCM7XX_CLASS(object_class_by_name(type)); @@ -316,6 +333,18 @@ static void gsj_machine_class_init(ObjectClass *oc, void *data) mc->default_ram_size = 512 * MiB; }; +static void gbs_bmc_machine_class_init(ObjectClass *oc, void *data) +{ + NPCM7xxMachineClass *nmc = NPCM7XX_MACHINE_CLASS(oc); + MachineClass *mc = MACHINE_CLASS(oc); + + npcm7xx_set_soc_type(nmc, TYPE_NPCM730); + + mc->desc = "Quanta GBS (Cortex A9)"; + mc->init = quanta_gbs_init; + mc->default_ram_size = 1 * GiB; +} + static const TypeInfo npcm7xx_machine_types[] = { { .name = TYPE_NPCM7XX_MACHINE, @@ -332,6 +361,10 @@ static const TypeInfo npcm7xx_machine_types[] = { .name = MACHINE_TYPE_NAME("quanta-gsj"), .parent = TYPE_NPCM7XX_MACHINE, .class_init = gsj_machine_class_init, + }, { + .name = MACHINE_TYPE_NAME("quanta-gbs-bmc"), + .parent = TYPE_NPCM7XX_MACHINE, + .class_init = gbs_bmc_machine_class_init, }, }; From patchwork Tue May 18 19:47:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 1480457 Return-Path: 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=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=Sk77cjIG; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fl66K3bMNz9sVt for ; Wed, 19 May 2021 05:50:01 +1000 (AEST) Received: from localhost ([::1]:52730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj5j4-00047Z-QO for incoming@patchwork.ozlabs.org; Tue, 18 May 2021 15:49:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3yhmkYAcKCpkO7GMNK79HH9E7.5HFJ7FN-67O7EGHG9GN.HK9@flex--venture.bounces.google.com>) id 1lj5gj-0007z3-QN for qemu-devel@nongnu.org; Tue, 18 May 2021 15:47:33 -0400 Received: from mail-qv1-xf49.google.com ([2607:f8b0:4864:20::f49]:34505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3yhmkYAcKCpkO7GMNK79HH9E7.5HFJ7FN-67O7EGHG9GN.HK9@flex--venture.bounces.google.com>) id 1lj5gb-00079A-RZ for qemu-devel@nongnu.org; Tue, 18 May 2021 15:47:33 -0400 Received: by mail-qv1-xf49.google.com with SMTP id f17-20020a0cf3d10000b02901eda24e6b92so8277483qvm.1 for ; Tue, 18 May 2021 12:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=1R4OqYgXALabVeS1jjyB5oy/+6Sj3iQ62rsKQF+LgxI=; b=Sk77cjIGQyY9yV3nr7g6YR0KnAHpng7S9Qf4iEH7CG2Oc6CZboVJGQgxCLKeg6x1vK iUy5WDpCQfFQxDW2JDo/hzw5ZHFQUn4P83Xhxhq4UKDwg6y+lkoleVjgNwIkX0xvDq4U sD4C+aoF7XVnRCb+6/2aMI5jIPCLumLRiba5BvHFFnPfPaKkyb+tZEv5DrG+zj6T2Yfr qfsFplwmMbQVR40jZhSLsBsT0ixITgfqiGWNM0G7lecw+PpAqkS2Kkt/nDn/Pq0Dk4my 8E18Hi74alLZqsWVHjKd3v8I8kYaXItaqHsXny7ZU1EXrcoHCLXZxyuVNkJoroMDXIqH RPLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=1R4OqYgXALabVeS1jjyB5oy/+6Sj3iQ62rsKQF+LgxI=; b=dPY01HY2tfvdRgnLfRpSmeLgz7DvvOgyJdZhX5IA5hyVq+jNEzK8Ndg+Y1XCdGUlBf t/WX6MhGGMnkoYdnJeJfDydnuadQezY26q6ykdNhBhgjBJb1J447tYMXT0rD2HHaqsUv 64AzH7wH5vlIJrNsPT1vGdkSjHiYFDNdeB+/hi2RQLF1vhBIm0IDJT0YxRaWRtjcc2ZP zx+dXGmxz1QB3Fe3IlFhW2KVQ5iVaUtAhodsNvXt0QcRuP1tSDclmUJbS1tEgd4irtCa xfs7OYgoUb3QS2LUeVyofVuFj+5COTzuhBylezOKWCXAqVyYRSbVUHMqJH3aavcEsNQh t5wg== X-Gm-Message-State: AOAM532dUDtqKa5LlQJG3s5zs/Xev/GSyE8SyTGmBlIymMvrOcFF5t9W ym2sAZdiCSHubbtm9cjwoyBPOdnaB5WC X-Google-Smtp-Source: ABdhPJyuG+y9N0sP9rOVa3gOqjPnEOFA1IGeH7258RgYz5tyhmksj81u1aR/OX5kFxXWOU5V1h/qs/kCZJ5Z X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:5902:8a04:d917:4e93]) (user=venture job=sendgmr) by 2002:a0c:cdc8:: with SMTP id a8mr7897551qvn.12.1621367242071; Tue, 18 May 2021 12:47:22 -0700 (PDT) Date: Tue, 18 May 2021 12:47:04 -0700 In-Reply-To: <20210518194704.764241-1-venture@google.com> Message-Id: <20210518194704.764241-3-venture@google.com> Mime-Version: 1.0 References: <20210518194704.764241-1-venture@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH 2/2] hw/arm: quanta-gbs-bmc add i2c comments From: Patrick Venture To: hskinnemoen@google.com, kfting@nuvoton.com Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Patrick Venture , Brandon Kim , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::f49; envelope-from=3yhmkYAcKCpkO7GMNK79HH9E7.5HFJ7FN-67O7EGHG9GN.HK9@flex--venture.bounces.google.com; helo=mail-qv1-xf49.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add a comment and i2c method that describes the board layout. Tested: firmware booted to userspace. Signed-off-by: Patrick Venture Reviewed-by: Brandon Kim Reviewed-by: Hao Wu --- hw/arm/npcm7xx_boards.c | 60 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index 34a214fe79..d9de375826 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -238,6 +238,65 @@ static void quanta_gsj_fan_init(NPCM7xxMachine *machine, NPCM7xxState *soc) npcm7xx_connect_pwm_fan(soc, &splitter[2], 0x05, 1); } +static void quanta_gbs_i2c_init(NPCM7xxState *soc) +{ + /* + * i2c-0: + * pca9546@71 + * + * i2c-1: + * pca9535@24 + * pca9535@20 + * pca9535@21 + * pca9535@22 + * pca9535@23 + * pca9535@25 + * pca9535@26 + * + * i2c-2: + * sbtsi@4c + * + * i2c-5: + * atmel,24c64@50 mb_fru + * pca9546@71 + * - channel 0: max31725@54 + * - channel 1: max31725@55 + * - channel 2: max31725@5d + * atmel,24c64@51 fan_fru + * - channel 3: atmel,24c64@52 hsbp_fru + * + * i2c-6: + * pca9545@73 + * + * i2c-7: + * pca9545@72 + * + * i2c-8: + * adi,adm1272@10 + * + * i2c-9: + * pca9546@71 + * - channel 0: isil,isl68137@60 + * - channel 1: isil,isl68137@61 + * - channel 2: isil,isl68137@63 + * - channel 3: isil,isl68137@45 + * + * i2c-10: + * pca9545@71 + * + * i2c-11: + * pca9545@76 + * + * i2c-12: + * maxim,max34451@4e + * isil,isl68137@5d + * isil,isl68137@5e + * + * i2c-14: + * pca9545@70 + */ +} + static void npcm750_evb_init(MachineState *machine) { NPCM7xxState *soc; @@ -282,6 +341,7 @@ static void quanta_gbs_init(MachineState *machine) npcm7xx_connect_flash(&soc->fiu[0], 0, "mx66u51235f", drive_get(IF_MTD, 0, 0)); + quanta_gbs_i2c_init(soc); npcm7xx_load_kernel(machine, soc); }