From patchwork Fri Nov 11 01:06:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 693521 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tFMFW28mkz9t0w for ; Fri, 11 Nov 2016 12:06:55 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tFMFW0kX0zDvnk for ; Fri, 11 Nov 2016 12:06:55 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tFMFF6xBmzDvmZ for ; Fri, 11 Nov 2016 12:06:41 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAB10WDL082907 for ; Thu, 10 Nov 2016 20:06:39 -0500 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 26mwa6g5ap-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 10 Nov 2016 20:06:39 -0500 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Nov 2016 18:06:38 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 10 Nov 2016 18:06:36 -0700 Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 9500D3E40030; Thu, 10 Nov 2016 18:06:35 -0700 (MST) Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uAB16Zod59179086; Thu, 10 Nov 2016 18:06:35 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77FE56A03C; Thu, 10 Nov 2016 18:06:35 -0700 (MST) Received: from birb.localdomain (unknown [9.185.16.129]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id 018FE6A03D; Thu, 10 Nov 2016 18:06:35 -0700 (MST) Received: by birb.localdomain (Postfix, from userid 1000) id 8F242229DB2E; Fri, 11 Nov 2016 12:06:31 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Fri, 11 Nov 2016 12:06:29 +1100 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478826390-21311-1-git-send-email-stewart@linux.vnet.ibm.com> References: <1478826390-21311-1-git-send-email-stewart@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111101-0012-0000-0000-0000111E67CC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006054; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00779312; UDB=6.00375457; IPR=6.00556652; BA=6.00004868; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013289; XFM=3.00000011; UTC=2016-11-11 01:06:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111101-0013-0000-0000-00004714D4F1 Message-Id: <1478826390-21311-2-git-send-email-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-10_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611110017 Subject: [Skiboot] [PATCH 1/2] Add SuperMicro p8dtu1u and p8dtu2u platforms X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jim Yuan , leoluo MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: leoluo From: https://github.com/supermicro/p8dtu-op-build/blob/9e8242de579ce947a3d30df8b8ddb94584783f91/openpower/package/skiboot/skiboot-0001-add-p8dtu1u-and-p8dtu2u-mode-in-skiboot.patch Signed-off-by: Jim Yuan Signed-off-by: Stewart Smith --- platforms/astbmc/Makefile.inc | 2 +- platforms/astbmc/p8dtu.c | 260 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 platforms/astbmc/p8dtu.c diff --git a/platforms/astbmc/Makefile.inc b/platforms/astbmc/Makefile.inc index 46befc1..0830b3e 100644 --- a/platforms/astbmc/Makefile.inc +++ b/platforms/astbmc/Makefile.inc @@ -1,6 +1,6 @@ SUBDIRS += $(PLATDIR)/astbmc -ASTBMC_OBJS = palmetto.o habanero.o firestone.o garrison.o barreleye.o pnor.o common.o slots.o +ASTBMC_OBJS = palmetto.o habanero.o firestone.o p8dtu.o garrison.o barreleye.o pnor.o common.o slots.o ASTBMC = $(PLATDIR)/astbmc/built-in.o $(ASTBMC): $(ASTBMC_OBJS:%=$(PLATDIR)/astbmc/%) diff --git a/platforms/astbmc/p8dtu.c b/platforms/astbmc/p8dtu.c new file mode 100644 index 0000000..6788568 --- /dev/null +++ b/platforms/astbmc/p8dtu.c @@ -0,0 +1,260 @@ +/* Copyright 2016 supermicro. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include +#include +#include +#include +#include + +#include "astbmc.h" + +static const struct slot_table_entry p8dtu_phb0_0_slot[] = { + { + .etype = st_pluggable_slot, + .location = ST_LOC_DEVFN(0,0), + .name = "UIO Slot1", + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu_phb0_2_slot[] = { + { + .etype = st_pluggable_slot, + .location = ST_LOC_DEVFN(0,0), + .name = "UIO Network", + }, + { .etype = st_end }, +}; + + +static const struct slot_table_entry p8dtu_plx_slots[] = { + { + .etype = st_pluggable_slot, + .location = ST_LOC_DEVFN(1,0), + .name = "PLX Slot1", + }, + { + .etype = st_builtin_dev, + .location = ST_LOC_DEVFN(0x9,0), + .name = "Onboard USB", + }, + { + .etype = st_builtin_dev, + .location = ST_LOC_DEVFN(0xa,0), + .name = "Onboard SATA1", + }, + { + .etype = st_builtin_dev, + .location = ST_LOC_DEVFN(0xb,0), + .name = "Onboard BMC", + }, + { + .etype = st_builtin_dev, + .location = ST_LOC_DEVFN(0xc,0), + .name = "Onboard SATA2", + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu_plx_up[] = { + { + .etype = st_builtin_dev, + .location = ST_LOC_DEVFN(0,0), + .children = p8dtu_plx_slots, + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu_phb0_1_slot[] = { + { + .etype = st_builtin_dev, + .location = ST_LOC_DEVFN(0,0), + .name = "PLX Switch", + .children = p8dtu_plx_up, + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu_phb8_0_slot[] = { + { + .etype = st_pluggable_slot, + .location = ST_LOC_DEVFN(0,0), + .name = "WIO Slot1", + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu2u_phb8_1_slot[] = { + { + .etype = st_pluggable_slot, + .location = ST_LOC_DEVFN(0,0), + .name = "WIO Slot3", + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu2u_phb8_2_slot[] = { + { + .etype = st_pluggable_slot, + .location = ST_LOC_DEVFN(0,0), + .name = "WIO Slot2", + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu1u_phb8_1_slot[] = { + { + .etype = st_pluggable_slot, + .location = ST_LOC_DEVFN(0,0), + .name = "WIO Slot2", + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu1u_phb8_2_slot[] = { + { + .etype = st_pluggable_slot, + .location = ST_LOC_DEVFN(0,0), + .name = "WIO Slot3", + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu2u_phb_table[] = { + { + .etype = st_phb, + .location = ST_LOC_PHB(0,0), + .children = p8dtu_phb0_0_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(0,1), + .children = p8dtu_phb0_1_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(0,2), + .children = p8dtu_phb0_2_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(8,0), + .children = p8dtu_phb8_0_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(8,1), + .children = p8dtu2u_phb8_1_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(8,2), + .children = p8dtu2u_phb8_2_slot, + }, + { .etype = st_end }, +}; + +static const struct slot_table_entry p8dtu1u_phb_table[] = { + { + .etype = st_phb, + .location = ST_LOC_PHB(0,0), + .children = p8dtu_phb0_0_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(0,1), + .children = p8dtu_phb0_1_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(0,2), + .children = p8dtu_phb0_2_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(8,0), + .children = p8dtu_phb8_0_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(8,1), + .children = p8dtu1u_phb8_1_slot, + }, + { + .etype = st_phb, + .location = ST_LOC_PHB(8,2), + .children = p8dtu1u_phb8_2_slot, + }, + { .etype = st_end }, +}; + +static bool p8dtu1u_probe(void) +{ + if (!dt_node_is_compatible(dt_root, "supermicro,p8dtu1u")) + return false; + + /* Lot of common early inits here */ + astbmc_early_init(); + slot_table_init(p8dtu1u_phb_table); + + return true; +} + +static bool p8dtu2u_probe(void) +{ + if (!dt_node_is_compatible(dt_root, "supermicro,p8dtu2u")) + return false; + + /* Lot of common early inits here */ + astbmc_early_init(); + slot_table_init(p8dtu2u_phb_table); + + return true; +} + + +DECLARE_PLATFORM(p8dtu1u) = { + .name = "p8dtu1u", + .probe = p8dtu1u_probe, + .init = astbmc_init, + .pci_get_slot_info = slot_table_get_slot_info, + .external_irq = astbmc_ext_irq_serirq_cpld, + .cec_power_down = astbmc_ipmi_power_down, + .cec_reboot = astbmc_ipmi_reboot, + .elog_commit = ipmi_elog_commit, + .start_preload_resource = flash_start_preload_resource, + .resource_loaded = flash_resource_loaded, + .exit = ipmi_wdt_final_reset, + .terminate = ipmi_terminate, +}; + +DECLARE_PLATFORM(p8dtu2u) = { + .name = "p8dtu2u", + .probe = p8dtu2u_probe, + .init = astbmc_init, + .pci_get_slot_info = slot_table_get_slot_info, + .external_irq = astbmc_ext_irq_serirq_cpld, + .cec_power_down = astbmc_ipmi_power_down, + .cec_reboot = astbmc_ipmi_reboot, + .elog_commit = ipmi_elog_commit, + .start_preload_resource = flash_start_preload_resource, + .resource_loaded = flash_resource_loaded, + .exit = ipmi_wdt_final_reset, + .terminate = ipmi_terminate, +}; +