From patchwork Fri Oct 13 08:30:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 825279 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UbnSfCTY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yD14y4cM6z9s82 for ; Fri, 13 Oct 2017 19:25:54 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 4F64AC21F71; Fri, 13 Oct 2017 08:25:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 320BCC21F04; Fri, 13 Oct 2017 08:25:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 06ADAC21C59; Fri, 13 Oct 2017 08:25:41 +0000 (UTC) Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by lists.denx.de (Postfix) with ESMTPS id 722FDC21FD1 for ; Fri, 13 Oct 2017 08:25:41 +0000 (UTC) Received: by mail-qk0-f193.google.com with SMTP id n5so4117138qke.11 for ; Fri, 13 Oct 2017 01:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=nDhY6Cy/Qf1TcUs4rJl3SvzVMiIYXel+y/W5NRlaNtI=; b=UbnSfCTYvHHKRIr52nPTLTzCA4pbvUcensjPVbCMPkTwReuQlVbGYtg9M2EfPhGnPG 4vhnKJrODC19lTKv+Ygk83ogGV39HyWjqkmmE3AxvEYnl3+Pb6jqiag2EMwp/5umsaAi VzgTkTTBsw1f/ar9qF1spVsMBzcofzqiPEEHE18MhAd/K/2ZQb+iaHrXGYul4ytznfVa CnduvyimINDQ6EE2Zsg2I/VUZLbNBw3jf+upeEQlKiKH0q6Bpm5kIO50ULGtYKLgBWwT gmknnAwLwRwCKt8Ocd0ld543eJEdWb1G4MpcQ+FkU1EkGafjSVd0UzCZqtXlULDFc9Du 1BGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=nDhY6Cy/Qf1TcUs4rJl3SvzVMiIYXel+y/W5NRlaNtI=; b=n7sqKcRQgxBHzX5vHUtjxHOg1CsPDMy+EKRFT2w8mie7R/XJkMecIH2rJGj0pHKsmL RMi1aksunWh+P5dI+u2ZsENBOGUtewlMynRB3yRYeSCIuepXgiZAl5uYeYEefUWOvsxQ IArtyHKwdwMYvNvwBLr/Q2OtFs5CJOyNVOK8KY+UrWJvNC52cZFJNgbCNHZcTKbQ9NlY hsTcWvAJx+hm3etzbWTGIS3o8J1eK/MRFq7JIGez84pmCZweTl49si501NJsWS+c4iKY 5uO+99Nbwy3DkxhWZ6XeUz2N//qeqNhJoWTRZIPr1YGEFoyV7f6+/kYTD0CVB0rd+HpB 1CTg== X-Gm-Message-State: AMCzsaXfMRDmbonC0U8mzH2fTPYKGEDG3Ny7xQbTk94rl5lNtIZdyNon 8cWiDQQDDyWLX9kjalV6l+k= X-Google-Smtp-Source: AOwi7QA0W4UDeBb5sptnlX45N+gmblS7oO+zudq+DsJSjJmeFbKuqJL4fjYO3NA3Mk6nrnpK9V501g== X-Received: by 10.55.192.204 with SMTP id v73mr846869qkv.117.1507883140238; Fri, 13 Oct 2017 01:25:40 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id f126sm228381qkd.37.2017.10.13.01.25.38 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Oct 2017 01:25:39 -0700 (PDT) From: Bin Meng To: Simon Glass , Stefan Roese , George McCollister , U-Boot Mailing List Date: Fri, 13 Oct 2017 01:30:04 -0700 Message-Id: <1507883406-31390-1-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 Subject: [U-Boot] [PATCH 1/3] x86: fsp: Consolidate Azalia header file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" So far there are two copies of Azalia struct defines with one in baytrail and the other one in braswell. This consolidates these two into one, put it in the common place, and remove the prefix pch_ to these structs to make their names more generic. This also corrects reset_wait_timer from us to ms. Signed-off-by: Bin Meng Reviewed-by: Stefan Roese --- arch/x86/cpu/baytrail/fsp_configs.c | 13 ++++---- arch/x86/include/asm/arch-baytrail/fsp/azalia.h | 39 ------------------------ arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h | 26 ---------------- arch/x86/include/asm/fsp/fsp_azalia.h | 39 ++++++++++++++++++++++++ arch/x86/include/asm/fsp/fsp_support.h | 1 + 5 files changed, 46 insertions(+), 72 deletions(-) delete mode 100644 arch/x86/include/asm/arch-baytrail/fsp/azalia.h create mode 100644 arch/x86/include/asm/fsp/fsp_azalia.h diff --git a/arch/x86/cpu/baytrail/fsp_configs.c b/arch/x86/cpu/baytrail/fsp_configs.c index 45f9bf9..926f26b 100644 --- a/arch/x86/cpu/baytrail/fsp_configs.c +++ b/arch/x86/cpu/baytrail/fsp_configs.c @@ -8,13 +8,12 @@ #include #include -#include #include DECLARE_GLOBAL_DATA_PTR; /* ALC262 Verb Table - 10EC0262 */ -static const uint32_t verb_table_data13[] = { +static const u32 verb_table_data13[] = { /* Pin Complex (NID 0x11) */ 0x01171cf0, 0x01171d11, @@ -94,7 +93,7 @@ static const uint32_t verb_table_data13[] = { * Codec Address: CAd value (0/1/2) * Codec Vendor: 0x10EC0262 */ -static const struct pch_azalia_verb_table azalia_verb_table[] = { +static const struct azalia_verb_table azalia_verb_table[] = { { { 0x10ec0262, @@ -108,16 +107,16 @@ static const struct pch_azalia_verb_table azalia_verb_table[] = { } }; -const struct pch_azalia_config azalia_config = { +const struct azalia_config azalia_config = { .pme_enable = 1, .docking_supported = 1, .docking_attached = 0, .hdmi_codec_enable = 1, .azalia_v_ci_enable = 1, .rsvdbits = 0, - .azalia_verb_table_num = 1, - .azalia_verb_table = azalia_verb_table, - .reset_wait_timer_us = 300 + .verb_table_num = 1, + .verb_table = azalia_verb_table, + .reset_wait_timer_ms = 300 }; /** diff --git a/arch/x86/include/asm/arch-baytrail/fsp/azalia.h b/arch/x86/include/asm/arch-baytrail/fsp/azalia.h deleted file mode 100644 index d96a20f..0000000 --- a/arch/x86/include/asm/arch-baytrail/fsp/azalia.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013, Intel Corporation - * Copyright (C) 2015 Google, Inc - * - * SPDX-License-Identifier: Intel - */ - -#ifndef _FSP_AZALIA_H_ -#define _FSP_AZALIA_H_ - -struct __packed pch_azalia_verb_table_header { - uint32_t vendor_device_id; - uint16_t sub_system_id; - uint8_t revision_id; /* 0xff applies to all steppings */ - uint8_t front_panel_support; - uint16_t number_of_rear_jacks; - uint16_t number_of_front_jacks; -}; - -struct __packed pch_azalia_verb_table { - struct pch_azalia_verb_table_header verb_table_header; - const uint32_t *verb_table_data; -}; - -struct __packed pch_azalia_config { - uint8_t pme_enable:1; - uint8_t docking_supported:1; - uint8_t docking_attached:1; - uint8_t hdmi_codec_enable:1; - uint8_t azalia_v_ci_enable:1; - uint8_t rsvdbits:3; - /* number of verb tables provided by platform */ - uint8_t azalia_verb_table_num; - const struct pch_azalia_verb_table *azalia_verb_table; - /* delay timer after azalia reset */ - uint16_t reset_wait_timer_us; -}; - -#endif diff --git a/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h b/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h index ecb01fa..99c4c0a 100644 --- a/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h +++ b/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h @@ -29,32 +29,6 @@ struct __packed memory_upd { u8 reserved[189]; /* Offset 0x0043 */ }; -struct __packed azalia_verb_table_header { - u32 vendor_device_id; - u16 sub_system_id; - u8 revision_id; - u8 front_panel_support; - u16 number_of_rear_jacks; - u16 number_of_front_jacks; -}; - -struct __packed azalia_verb_table { - struct azalia_verb_table_header header; - u32 *data; -}; - -struct __packed azalia_config { - u8 pme_enable:1; - u8 docking_supported:1; - u8 docking_attached:1; - u8 hdmi_codec_enable:1; - u8 azalia_v_ci_enable:1; - u8 reserved:3; - u8 verb_table_num; - struct azalia_verb_table *verb_table; - u16 reset_wait_timer_ms; -}; - struct gpio_family { u32 confg; u32 confg_changes; diff --git a/arch/x86/include/asm/fsp/fsp_azalia.h b/arch/x86/include/asm/fsp/fsp_azalia.h new file mode 100644 index 0000000..a1467bf --- /dev/null +++ b/arch/x86/include/asm/fsp/fsp_azalia.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013, Intel Corporation + * Copyright (C) 2015, Google, Inc + * + * SPDX-License-Identifier: Intel + */ + +#ifndef _FSP_AZALIA_H_ +#define _FSP_AZALIA_H_ + +struct __packed azalia_verb_table_header { + u32 vendor_device_id; + u16 sub_system_id; + u8 revision_id; /* 0xff applies to all steppings */ + u8 front_panel_support; + u16 number_of_rear_jacks; + u16 number_of_front_jacks; +}; + +struct __packed azalia_verb_table { + struct azalia_verb_table_header header; + const u32 *data; +}; + +struct __packed azalia_config { + u8 pme_enable:1; + u8 docking_supported:1; + u8 docking_attached:1; + u8 hdmi_codec_enable:1; + u8 azalia_v_ci_enable:1; + u8 rsvdbits:3; + /* number of verb tables provided by platform */ + u8 verb_table_num; + const struct azalia_verb_table *verb_table; + /* delay timer after azalia reset */ + u16 reset_wait_timer_ms; +}; + +#endif diff --git a/arch/x86/include/asm/fsp/fsp_support.h b/arch/x86/include/asm/fsp/fsp_support.h index 97a50b0..df3add0 100644 --- a/arch/x86/include/asm/fsp/fsp_support.h +++ b/arch/x86/include/asm/fsp/fsp_support.h @@ -15,6 +15,7 @@ #include "fsp_hob.h" #include "fsp_infoheader.h" #include "fsp_bootmode.h" +#include "fsp_azalia.h" #include #include From patchwork Fri Oct 13 08:30:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 825283 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SJmiScYE"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yD16m221Cz9sPr for ; Fri, 13 Oct 2017 19:27:25 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id DD49EC21F6B; Fri, 13 Oct 2017 08:26:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8A33EC21FE6; Fri, 13 Oct 2017 08:25:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 85F26C21F04; Fri, 13 Oct 2017 08:25:43 +0000 (UTC) Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by lists.denx.de (Postfix) with ESMTPS id D1155C21C59 for ; Fri, 13 Oct 2017 08:25:42 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id k123so4123744qke.3 for ; Fri, 13 Oct 2017 01:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=a60joddp2Q22sBV7BinqYH7OVjkCmBWjEF0/mPHW0rc=; b=SJmiScYE+bSsrqu9PDtj35qIlrDqPFnp6POXZSAEybuVK6HIk8dtJnI5IRWeZ5oeqq /QynsxSeUjxJahjHWva7VlvKVlelIGNc5/wF5Ca5vl8/b3CUc+VD7T3N119+BgdvXu19 H2ZIE8sir7e/LBrEE+oGPs021NH45/TKkvCtPSkonYFzziVIePjU75JDxbQXHXjocZLT lu+F0AGBczvjCxAPxiVNs8jbqJWFvyLnF3BADYe/1ZjRLzvUP9mSfB/wVdAXUPgAtYsg lZ2HxBEteEqqPBbgoy7LiXTNkbZXQ3Nf/PE6l0tO/YlDtVJGEljK/QvINMGoeLTTJn3B LXmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=a60joddp2Q22sBV7BinqYH7OVjkCmBWjEF0/mPHW0rc=; b=XmDe+FLfTkY7YrHL4FuFj9PXq/N7a6rgsssuK6nUemCOJCccKUyK4XKJZvta5tV0bW 698UHLE8XHxmTKW4pWTuVfFLwJwpsPeMpb9QKrpE353qCdcW3rdk761Yq11uxG06ma1k fN8DZTO+UmKllOX7JhFjI8+34DLTtLct9XYwQIg4hgHRk1vzkPlnS9inKMGyFdXYJh7c cE1oJ4KhmPkRuyJjcmjWojBiUYa3n+EPeVB+RhQIKDs5bTGwLqjgteaEJ/tC9et2lf9B x5Put2grGyXwYyHucIEBAo4tXMxgm/RctIcPFFxAnbkiB6DwYUId+24WzbZY/Odm5BoQ bIBA== X-Gm-Message-State: AMCzsaXCPl8QparAN/RgK+oQ90q8vyJUN0Wjeb1s+FMHmLJTp+R6Ww2D d64avHg26n15UtkVUNb4+e8= X-Google-Smtp-Source: ABhQp+QoGfr39MDxam5qmc4+yVbW+MaVyubhV7eTvkHdyexifts8l74BnGCXT9AaD0VIQoCeY0uMVw== X-Received: by 10.55.3.130 with SMTP id 124mr928916qkd.42.1507883141912; Fri, 13 Oct 2017 01:25:41 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id f126sm228381qkd.37.2017.10.13.01.25.40 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Oct 2017 01:25:41 -0700 (PDT) From: Bin Meng To: Simon Glass , Stefan Roese , George McCollister , U-Boot Mailing List Date: Fri, 13 Oct 2017 01:30:05 -0700 Message-Id: <1507883406-31390-2-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1507883406-31390-1-git-send-email-bmeng.cn@gmail.com> References: <1507883406-31390-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 2/3] x86: baytrail: fsp: Use a function to update the Azalia config pointer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present we directly pass the Azalia config pointer to the FSP UPD. This updates to use a function to do the stuff, like Braswell does. Signed-off-by: Bin Meng Reviewed-by: Stefan Roese --- arch/x86/cpu/baytrail/fsp_configs.c | 15 +++++++++++++-- arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/x86/cpu/baytrail/fsp_configs.c b/arch/x86/cpu/baytrail/fsp_configs.c index 926f26b..3052fb6 100644 --- a/arch/x86/cpu/baytrail/fsp_configs.c +++ b/arch/x86/cpu/baytrail/fsp_configs.c @@ -120,6 +120,17 @@ const struct azalia_config azalia_config = { }; /** + * Override the FSP's Azalia configuration data + * + * @azalia: pointer to be updated to point to a ROM address where Azalia + * configuration data is stored + */ +static void update_fsp_azalia_configs(struct azalia_config **azalia) +{ + *azalia = (struct azalia_config *)&azalia_config; +} + +/** * Override the FSP's configuration data. * If the device tree does not specify an integer setting, use the default * provided in Intel's Baytrail_FSP_Gold4.tgz release FSP/BayleyBayFsp.bsf file. @@ -137,8 +148,6 @@ void update_fsp_configs(struct fsp_config_data *config, rt_buf->common.boot_mode = config->common.boot_mode; rt_buf->common.upd_data = &config->fsp_upd; - fsp_upd->azalia_config_ptr = (uint32_t)&azalia_config; - node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_BAYTRAIL_FSP); if (node < 0) { debug("%s: Cannot find FSP node\n", __func__); @@ -173,6 +182,8 @@ void update_fsp_configs(struct fsp_config_data *config, SATA_MODE_AHCI); fsp_upd->enable_azalia = fdtdec_get_bool(blob, node, "fsp,enable-azalia"); + if (fsp_upd->enable_azalia) + update_fsp_azalia_configs(&fsp_upd->azalia_cfg_ptr); fsp_upd->enable_xhci = fdtdec_get_bool(blob, node, "fsp,enable-xhci"); fsp_upd->lpe_mode = fdtdec_get_int(blob, node, "fsp,lpe-mode", LPE_MODE_PCI); diff --git a/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h b/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h index 8c07b37..e2f0e39 100644 --- a/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h +++ b/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h @@ -45,7 +45,7 @@ struct __packed upd_region { uint8_t enable_sata; /* Offset 0x002d */ uint8_t sata_mode; /* Offset 0x002e */ uint8_t enable_azalia; /* Offset 0x002f */ - uint32_t azalia_config_ptr; /* Offset 0x0030 */ + struct azalia_config *azalia_cfg_ptr; /* Offset 0x0030 */ uint8_t enable_xhci; /* Offset 0x0034 */ uint8_t lpe_mode; /* Offset 0x0035 */ uint8_t lpss_sio_mode; /* Offset 0x0036 */ From patchwork Fri Oct 13 08:30:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 825282 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nPyTG/Rs"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yD16J3kHhz9s82 for ; Fri, 13 Oct 2017 19:27:04 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3C632C21FC5; Fri, 13 Oct 2017 08:26:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 39947C21FD9; Fri, 13 Oct 2017 08:26:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5211AC21FC1; Fri, 13 Oct 2017 08:25:48 +0000 (UTC) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by lists.denx.de (Postfix) with ESMTPS id A4A59C21F9D for ; Fri, 13 Oct 2017 08:25:44 +0000 (UTC) Received: by mail-qt0-f193.google.com with SMTP id f15so18219994qtf.7 for ; Fri, 13 Oct 2017 01:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=KrWTvuGaESxSoZFVE81dLPNSD29d0srowtDl0wypw48=; b=nPyTG/Rsz4haNRZ1wu4mNDkkuMHllEtiuPw6xAHAJ80LrlV1RKOoDI+9RS5mqWsnBO bET+MtGcV8b4DlwgJWzIcAuV9eu7pB1g+RA0Tz4DlNUzV0mc0NVLEg5jHEWBxZYvAQQH GKKpxiB6yvEKIScyDyQmnoCyjubr1LoNPEGpSUTNPeY7qeyRIKPSOLMmnHrNC5otreHX /UiXkchUM9IvsEA3D7vJ6c0cavWhIamLFwdFwsQhV6XxtoevZvl7OBL9xW/yBGPzD7Vy ugRVovzmdPmrM8u/71Dqg3TiuAkGq+1woI0/PNnVFlSnp+ULfHsbGWd0yxxkmRHiqbyI +0AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=KrWTvuGaESxSoZFVE81dLPNSD29d0srowtDl0wypw48=; b=qQHeeD/DglqpE5w7smZxwYgn/f3rRqLU+AkJwpQcPtsG86ikmqnp0AOD9C7FA3qKUl wQI0EzsJ+30Qn4MPwbERl3YYUg31YH5ZJuoBxJnBTHhI6nwIen+Det4PN1DvFX3/hTVL 79OGbn0fB4u65qtRZFiEZu4luH2m9J/MtgWhusS3TRfPYJARB4gwqtlNA150eZjFJWN6 V0JgfIdAIgKhUDUfYGhmgUsGUj7pbFe/2lJVr9/aPxDQp4GkEBLJsayHdn1S5zGNI6Fh 4R2L9WredAtd/5oo9128veT1u9DGPBsOiSdCn4D9eDgZPdriOV45fLtKULmaP9NVpY7W nmew== X-Gm-Message-State: AMCzsaV8mInZVW6NSc3sKf0FjyxhNrRjqSAtwSSqYiYnzpg+LHV2xV2Y KdehZm6fg+e1sRZY2ECpDww= X-Google-Smtp-Source: ABhQp+SDp2O3qM2nNESIleYs8bdXaTzrVYsFIBkivf5PPQOLM9JoDvn8CbYJDP5JU5466og1ZQIeGA== X-Received: by 10.200.16.8 with SMTP id z8mr866263qti.61.1507883143522; Fri, 13 Oct 2017 01:25:43 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id f126sm228381qkd.37.2017.10.13.01.25.42 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Oct 2017 01:25:42 -0700 (PDT) From: Bin Meng To: Simon Glass , Stefan Roese , George McCollister , U-Boot Mailing List Date: Fri, 13 Oct 2017 01:30:06 -0700 Message-Id: <1507883406-31390-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1507883406-31390-1-git-send-email-bmeng.cn@gmail.com> References: <1507883406-31390-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 3/3] x86: baytrail: fsp: Move Azalia update codes to board X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Azalia configuration may be different across boards, hence it's not appropriate to do that in the SoC level. Instead, let's make the SoC update_fsp_azalia_configs() routine as a weak version, and do the actual work in the board codes. So far it seems only som-db5800-som-6867 board enables the Azalia. Move the original codes into som-db5800-som-6867.c. Signed-off-by: Bin Meng Reviewed-by: Stefan Roese --- arch/x86/cpu/baytrail/fsp_configs.c | 111 +-------------------- .../som-db5800-som-6867/som-db5800-som-6867.c | 111 +++++++++++++++++++++ 2 files changed, 113 insertions(+), 109 deletions(-) diff --git a/arch/x86/cpu/baytrail/fsp_configs.c b/arch/x86/cpu/baytrail/fsp_configs.c index 3052fb6..6b762e5 100644 --- a/arch/x86/cpu/baytrail/fsp_configs.c +++ b/arch/x86/cpu/baytrail/fsp_configs.c @@ -12,122 +12,15 @@ DECLARE_GLOBAL_DATA_PTR; -/* ALC262 Verb Table - 10EC0262 */ -static const u32 verb_table_data13[] = { - /* Pin Complex (NID 0x11) */ - 0x01171cf0, - 0x01171d11, - 0x01171e11, - 0x01171f41, - /* Pin Complex (NID 0x12) */ - 0x01271cf0, - 0x01271d11, - 0x01271e11, - 0x01271f41, - /* Pin Complex (NID 0x14) */ - 0x01471c10, - 0x01471d40, - 0x01471e01, - 0x01471f01, - /* Pin Complex (NID 0x15) */ - 0x01571cf0, - 0x01571d11, - 0x01571e11, - 0x01571f41, - /* Pin Complex (NID 0x16) */ - 0x01671cf0, - 0x01671d11, - 0x01671e11, - 0x01671f41, - /* Pin Complex (NID 0x18) */ - 0x01871c20, - 0x01871d98, - 0x01871ea1, - 0x01871f01, - /* Pin Complex (NID 0x19) */ - 0x01971c21, - 0x01971d98, - 0x01971ea1, - 0x01971f02, - /* Pin Complex (NID 0x1A) */ - 0x01a71c2f, - 0x01a71d30, - 0x01a71e81, - 0x01a71f01, - /* Pin Complex */ - 0x01b71c1f, - 0x01b71d40, - 0x01b71e21, - 0x01b71f02, - /* Pin Complex */ - 0x01c71cf0, - 0x01c71d11, - 0x01c71e11, - 0x01c71f41, - /* Pin Complex */ - 0x01d71c01, - 0x01d71dc6, - 0x01d71e14, - 0x01d71f40, - /* Pin Complex */ - 0x01e71cf0, - 0x01e71d11, - 0x01e71e11, - 0x01e71f41, - /* Pin Complex */ - 0x01f71cf0, - 0x01f71d11, - 0x01f71e11, - 0x01f71f41, -}; - -/* - * This needs to be in ROM since if we put it in CAR, FSP init loses it when - * it drops CAR. - * - * TODO(sjg@chromium.org): Move to device tree when FSP allows it - * - * VerbTable: (RealTek ALC262) - * Revision ID = 0xFF, support all steps - * Codec Verb Table For AZALIA - * Codec Address: CAd value (0/1/2) - * Codec Vendor: 0x10EC0262 - */ -static const struct azalia_verb_table azalia_verb_table[] = { - { - { - 0x10ec0262, - 0x0000, - 0xff, - 0x01, - 0x000b, - 0x0002, - }, - verb_table_data13 - } -}; - -const struct azalia_config azalia_config = { - .pme_enable = 1, - .docking_supported = 1, - .docking_attached = 0, - .hdmi_codec_enable = 1, - .azalia_v_ci_enable = 1, - .rsvdbits = 0, - .verb_table_num = 1, - .verb_table = azalia_verb_table, - .reset_wait_timer_ms = 300 -}; - /** * Override the FSP's Azalia configuration data * * @azalia: pointer to be updated to point to a ROM address where Azalia * configuration data is stored */ -static void update_fsp_azalia_configs(struct azalia_config **azalia) +__weak void update_fsp_azalia_configs(struct azalia_config **azalia) { - *azalia = (struct azalia_config *)&azalia_config; + *azalia = NULL; } /** diff --git a/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c b/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c index 6158795..202e9875 100644 --- a/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c +++ b/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c @@ -6,6 +6,117 @@ */ #include +#include + +/* ALC262 Verb Table - 10EC0262 */ +static const u32 verb_table_data13[] = { + /* Pin Complex (NID 0x11) */ + 0x01171cf0, + 0x01171d11, + 0x01171e11, + 0x01171f41, + /* Pin Complex (NID 0x12) */ + 0x01271cf0, + 0x01271d11, + 0x01271e11, + 0x01271f41, + /* Pin Complex (NID 0x14) */ + 0x01471c10, + 0x01471d40, + 0x01471e01, + 0x01471f01, + /* Pin Complex (NID 0x15) */ + 0x01571cf0, + 0x01571d11, + 0x01571e11, + 0x01571f41, + /* Pin Complex (NID 0x16) */ + 0x01671cf0, + 0x01671d11, + 0x01671e11, + 0x01671f41, + /* Pin Complex (NID 0x18) */ + 0x01871c20, + 0x01871d98, + 0x01871ea1, + 0x01871f01, + /* Pin Complex (NID 0x19) */ + 0x01971c21, + 0x01971d98, + 0x01971ea1, + 0x01971f02, + /* Pin Complex (NID 0x1A) */ + 0x01a71c2f, + 0x01a71d30, + 0x01a71e81, + 0x01a71f01, + /* Pin Complex */ + 0x01b71c1f, + 0x01b71d40, + 0x01b71e21, + 0x01b71f02, + /* Pin Complex */ + 0x01c71cf0, + 0x01c71d11, + 0x01c71e11, + 0x01c71f41, + /* Pin Complex */ + 0x01d71c01, + 0x01d71dc6, + 0x01d71e14, + 0x01d71f40, + /* Pin Complex */ + 0x01e71cf0, + 0x01e71d11, + 0x01e71e11, + 0x01e71f41, + /* Pin Complex */ + 0x01f71cf0, + 0x01f71d11, + 0x01f71e11, + 0x01f71f41, +}; + +/* + * This needs to be in ROM since if we put it in CAR, FSP init loses it when + * it drops CAR. + * + * VerbTable: (RealTek ALC262) + * Revision ID = 0xFF, support all steps + * Codec Verb Table For AZALIA + * Codec Address: CAd value (0/1/2) + * Codec Vendor: 0x10EC0262 + */ +static const struct azalia_verb_table azalia_verb_table[] = { + { + { + 0x10ec0262, + 0x0000, + 0xff, + 0x01, + 0x000b, + 0x0002, + }, + verb_table_data13 + } +}; + +static const struct azalia_config azalia_config = { + .pme_enable = 1, + .docking_supported = 1, + .docking_attached = 0, + .hdmi_codec_enable = 1, + .azalia_v_ci_enable = 1, + .rsvdbits = 0, + .verb_table_num = 1, + .verb_table = azalia_verb_table, + .reset_wait_timer_ms = 300 +}; + +void update_fsp_azalia_configs(const struct azalia_config **azalia) +{ + *azalia = &azalia_config; +} int board_early_init_f(void) {