From patchwork Tue Oct 14 17:11:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 399508 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 96CEF14011D for ; Wed, 15 Oct 2014 04:11:27 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755339AbaJNRLR (ORCPT ); Tue, 14 Oct 2014 13:11:17 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:57432 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755381AbaJNRLP (ORCPT ); Tue, 14 Oct 2014 13:11:15 -0400 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id D8A4962E1; Tue, 14 Oct 2014 11:11:14 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id F1779E461F; Tue, 14 Oct 2014 11:11:13 -0600 (MDT) From: Stephen Warren To: swarren@wwwdotorg.org Cc: linux-tegra@vger.kernel.org, Stephen Warren Subject: [pinmux scripts PATCH 2/4] Board CSV import: Put full CSV filename in data structure Date: Tue, 14 Oct 2014 11:11:18 -0600 Message-Id: <1413306680-27330-2-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413306680-27330-1-git-send-email-swarren@wwwdotorg.org> References: <1413306680-27330-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.98.1 at avon.wwwdotorg.org X-Virus-Status: Clean Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Stephen Warren Putting the whole filename in to the data structure allows us to keep different CSV files in different directories. This will allow explicit separation of public and private CSV files. The per-board data is also modified to be a dictionary so that additional fields can be stored in the future. Signed-off-by: Stephen Warren --- csv-to-board-tegra124-xlsx.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/csv-to-board-tegra124-xlsx.py b/csv-to-board-tegra124-xlsx.py index c150fface9d2..d5a8f2f3f645 100755 --- a/csv-to-board-tegra124-xlsx.py +++ b/csv-to-board-tegra124-xlsx.py @@ -42,15 +42,26 @@ if args.debug: if dbg: print(args) supported_boards = { - 'jetson-tk1': 'T124_customer_pinmux_PM375_30Apr2014_v2.csv', # worksheet PM375Beaver_Configuration - 'norrin': 'PM370_T124_customer_pinmux_1.1.csv', # worksheet Customer_Configuration - 'venice2': 'Venice2_T124_customer_pinmux_based_on_P4_rev47_2013-07-12.csv', # worksheet Customer_Configuration + 'jetson-tk1': { + # T124_customer_pinmux_PM375_30Apr2014_v2.xlsm worksheet PM375Beaver_Configuration + # T124_customer_pinmux.xlsm worksheet Jetson TK1 Configuration + # Jetson_TK1_customer_pinmux_release.xlsm worksheet Jetson TK1 Configuration + 'filename': 'csv/jetson-tk1.csv', # worksheet PM375Beaver_Configuration + }, + 'norrin': { + # PM370_T124_customer_pinmux_1.1.xlsm worksheet Customer_Configuration + 'filename': 'nv-internal-data/PM370_T124_customer_pinmux_1.1.csv', + }, + 'venice2': { + # Venice2_T124_customer_pinmux_based_on_P4_rev47_2013-07-12.xlsm worksheet Customer_Configuration + 'filename': 'nv-internal-data/Venice2_T124_customer_pinmux_based_on_P4_rev47_2013-07-12.csv', + }, } if not args.board in supported_boards: print('ERROR: Unsupported board %s' % args.board, file=sys.stderr) sys.exit(1) -csvfile = os.path.join('nv-internal-data', supported_boards[args.board]) +board_conf = supported_boards[args.board] soc = tegra_pmx_soc_parser.load_soc('tegra124') @@ -136,7 +147,7 @@ def rcv_sel_munge(d): found_header = False pin_table = [] -with open(csvfile, newline='') as fh: +with open(board_conf['filename'], newline='') as fh: csv = csv.reader(fh) lnum = 0 for row in csv: