From patchwork Tue Jun 8 19:36: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: 12308013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C578C48BCF for ; Tue, 8 Jun 2021 19:38:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 371BF610A1 for ; Tue, 8 Jun 2021 19:38:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 371BF610A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqhY7-0001rS-Cy for qemu-devel@archiver.kernel.org; Tue, 08 Jun 2021 15:38:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3wca_YAcKCloN6FLMJ68GG8D6.4GEI6EM-56N6DFGF8FM.GJ8@flex--venture.bounces.google.com>) id 1lqhWg-0007u0-FW for qemu-devel@nongnu.org; Tue, 08 Jun 2021 15:36:40 -0400 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]:36631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3wca_YAcKCloN6FLMJ68GG8D6.4GEI6EM-56N6DFGF8FM.GJ8@flex--venture.bounces.google.com>) id 1lqhWd-00029u-44 for qemu-devel@nongnu.org; Tue, 08 Jun 2021 15:36:38 -0400 Received: by mail-yb1-xb49.google.com with SMTP id w130-20020a25df880000b02905327e5d7f43so28216085ybg.3 for ; Tue, 08 Jun 2021 12:36:34 -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=VNh6+fxTEOy4MLnMIg3ZAjdinohY8fNQ1zbxPjrXhBI=; b=j4dGMR30zlL8L96gSSL8qAEe79Yo8Wt/OBeJ9zl59Ik27URrt+sw0J78Hps83PCG/Z UtuJ4jgo6wzyokbM2GJ8sLZ+xTkrYuI4il8+kaCSHlksC2uhmZYDKSHgSpzXj9wsUWyR xInjFOeoLENIYvfJkxlFuB6ZyY+HwNGuNfQoadMSndoZLzV7WtMR6H0/HXEXSeLKzJKZ IRkYssWTgRnYaApC+WffbRizdjyOK9iuJL3qOuT5a4rx1uo6P1+gCktg3c1utAfSyveY mTj4yEjtejYgfFnp8RXJ5OR1AvrGKF0YIv0TNZXAjFyM2JoHCT9m3tTJ43p7ejwX6Pcs /JcQ== 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=VNh6+fxTEOy4MLnMIg3ZAjdinohY8fNQ1zbxPjrXhBI=; b=cPIDZV3/96NsbMp0KBdUcitG6FfRpUvO3MLYTVnACfXfhvK+MEJcMowS62rx86/Rcd qPiB2WxxfVIpOePHzNffjuc0RPEp5lU/v6S+cvLIPKK6K4CSyk9rsNK+NsTtBDYWa1Y/ NgtYdC2t/bzLQKUwXzMwgFFZLVPDmy35cg/JD+0uLqURRyKF5cAiruGXZj6SRw3UDDhq iGpU/uIcOnRhuzpujCHsLvzUyuCylyWydfdORQNhfPszeV6W7W6Z3isWSsy9F5p+CV+Y i4pSD//j6F5Wctb0kJO5+93/S3oIAIUIggz9lACLWs6jMJ2z1LIeViNwr2Rlfb1vytfk Ja9Q== X-Gm-Message-State: AOAM532yRINuheKWCw+X/G+txt2huKR3NVpDW5C61WeyXa/OqwVfK5Fl Xou0Y25d1y+3PZnzBYhfG2R62z6SuDu2 X-Google-Smtp-Source: ABdhPJwjutf/c0gKXBr4Q3aPtUp8vz90F5xBEdmWi8rKjf5/BtCWy1LeczY0TSY2rqf/AATSbiapky6C2YBB X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:f886:41e8:7e16:711b]) (user=venture job=sendgmr) by 2002:a25:bec2:: with SMTP id k2mr34522889ybm.234.1623180993566; Tue, 08 Jun 2021 12:36:33 -0700 (PDT) Date: Tue, 8 Jun 2021 12:36:04 -0700 In-Reply-To: <20210608193605.2611114-1-venture@google.com> Message-Id: <20210608193605.2611114-2-venture@google.com> Mime-Version: 1.0 References: <20210608193605.2611114-1-venture@google.com> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog Subject: [PATCH v2 1/2] hw/arm: add quanta-gbs-bmc machine From: Patrick Venture To: hskinnemoen@google.com, kfting@nuvoton.com, peter.maydell@linaro.org 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=3wca_YAcKCloN6FLMJ68GG8D6.4GEI6EM-56N6DFGF8FM.GJ8@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+qemu-devel=archiver.kernel.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 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 Jun 8 19:36:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 12308015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.5 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBF31C47082 for ; Tue, 8 Jun 2021 19:39:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AB77261182 for ; Tue, 8 Jun 2021 19:39:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB77261182 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqhZX-0005Nu-Md for qemu-devel@archiver.kernel.org; Tue, 08 Jun 2021 15:39:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3x8a_YAcKCmATCLRSPCEMMEJC.AMKOCKS-BCTCJLMLELS.MPE@flex--venture.bounces.google.com>) id 1lqhWl-000850-Uy for qemu-devel@nongnu.org; Tue, 08 Jun 2021 15:36:43 -0400 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]:51097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3x8a_YAcKCmATCLRSPCEMMEJC.AMKOCKS-BCTCJLMLELS.MPE@flex--venture.bounces.google.com>) id 1lqhWj-0002D5-BG for qemu-devel@nongnu.org; Tue, 08 Jun 2021 15:36:43 -0400 Received: by mail-yb1-xb4a.google.com with SMTP id o12-20020a5b050c0000b02904f4a117bd74so28321138ybp.17 for ; Tue, 08 Jun 2021 12:36:40 -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=RkXqrjRgekzr5CjQOQBkgmrLWRpqPqTkRdb3fHTNCKCnK7D95oydx+fSVJNA8yAko8 vBp6mGnI7PBNUxAqIQZ54XINY+weyY7vOrDPI6eHcO6BuRKUle1Wzc3+RDTFoL8Q5dpA nZw1iUmCRGFoWtIYX7mIy5qsbeqLi8FI5scl0eOBVNdPP14dK/88tEiFJncr4kJxPNOI dRy94eoDFOEG1oTr3xRrXWMHwEfPylbmCBd38BFczFQdyEVTYXxnmtOmJX+yJgx13NCd lWfHwTekF1wYYkgMAD1GyXQJZXXiyP/6KUvkDe+DfEDLl5XvYlOeWVTqEnDOPZdtBFzt flAg== 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=i6MRJA4l6m3toxHx7rVbIQ9dAAXBC/2LVkpgJJee12ttbL29kQWjVx5M9bVQaPRbqC z6km0+zXjDHsBGrn9CGlzIiLHRPlD+SVPwxag/g5OddJVqT6HhsNpqw+8czj8HpWBWPm jbTeTg6rDYQ5vwWinSi3iy1SxJobjJOMJdoFLq0JFcR0HmCi3CVIhzQwVkqDup9L++L/ kp6/T3mkW6ttU0GExIdc15jRN5Y0qs/ZT8T/ZCiPpwmTSmC3uZUEw2c1iDWxY91fiqnL 2aVrOkIFvMSQJBql8ngx34b34aEHqShlj+COGcdsrRSedgXy4gpS5oaqawLWnZZ8za1X m3Xg== X-Gm-Message-State: AOAM530yBPKZ6HLRRTeCs9shs7t1t5a7PIIZgRELG4Ai/kS8bTpc5HUf blyVfG7oG5FDKpi+VmW3NfLwJOzO1bTW X-Google-Smtp-Source: ABdhPJyCFncshnyenGVbwRM0cbBQndhymGGOPPM/uXcQLPkuUoFGHxkbfNM1dxt2KXGT6D54eazxKQqaz6ml X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:f886:41e8:7e16:711b]) (user=venture job=sendgmr) by 2002:a25:5015:: with SMTP id e21mr9691309ybb.166.1623180999359; Tue, 08 Jun 2021 12:36:39 -0700 (PDT) Date: Tue, 8 Jun 2021 12:36:05 -0700 In-Reply-To: <20210608193605.2611114-1-venture@google.com> Message-Id: <20210608193605.2611114-3-venture@google.com> Mime-Version: 1.0 References: <20210608193605.2611114-1-venture@google.com> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog Subject: [PATCH v2 2/2] hw/arm: quanta-gbs-bmc add i2c comments From: Patrick Venture To: hskinnemoen@google.com, kfting@nuvoton.com, peter.maydell@linaro.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Patrick Venture , Brandon Kim , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::b4a; envelope-from=3x8a_YAcKCmATCLRSPCEMMEJC.AMKOCKS-BCTCJLMLELS.MPE@flex--venture.bounces.google.com; helo=mail-yb1-xb4a.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+qemu-devel=archiver.kernel.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); }