From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web12.12188.1600172775630180538 for ; Tue, 15 Sep 2020 05:26:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=k9zczoDF; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.65, mailfrom: pete@akeo.ie) Received: by mail-wr1-f65.google.com with SMTP id j2so3088014wrx.7 for ; Tue, 15 Sep 2020 05:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zIR6JLdOTXWZBiyWUzvj8VfdHTzM6QvMMuHGwopvNvE=; b=k9zczoDFrVXPPRFoPcpK+/oHjoC/XqpRfMkDs+8OyUMYPvWZmOVLle5VfdA2XwtE8y lbmMNGvgFrTEWU6y/zJwPNJcqzz6KKCjuRN044cAG/yBEj1O22E4X2jOTJ33ujRNlwWD 63lgt7QlNTSBOAAkz1smPaLzLjgobFXO8Mm1GlmONOvWwEI7pETGWCH8+HT+vZr02LjS XKct/Gf1NnWyFxiihANs2bEDknKPmai2l1hPGE1Ke1hxgY6qacWnsllTppvo+iniwsRo OQdS5TIAwFg1g0/iD072tAs27RePbgt+ZfJGuH9cbthrMH9lJJ6POoZjgYs8GmSs9IEZ UvLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zIR6JLdOTXWZBiyWUzvj8VfdHTzM6QvMMuHGwopvNvE=; b=TPmJ1xObbUfI5p+3vl9yoml0Gv6RuiA9LkZgLeMitZ7nT+2xYDcm4LoMs3tko8AaAE cadCTcZLRAeuv1Ko7fNe+KcYx74KQ2kLfTVnN6t6Bh6iCuy9agFnhB0UKzf3VXRjOIEp PFwo6jxrMGcmmRXa0e6yMCqCtXXYaRbO9wmFmfacFa0yyeGYP7wxTTy9MlgErs2x5NiH CafROLhkAgkKc9dEc97bbmylOaDlAqur3YxM3TV2wRy0dhO0iDIwxtuskKiuq9w4uzGW EAn5l+G7X08P7mClhf8VVESNjepqliGLqL0niS9K8W9hY7ddQoSD+dPrN0eJqhuylTI8 tFgw== X-Gm-Message-State: AOAM530unf+KynLg2Gw8Mcw2z9cWqoLotKfsXv5bp3DS3dOF7I1ub15j 3keHJg2q96cZ3S4oRqvW4WP1CQ== X-Google-Smtp-Source: ABdhPJxIzrmwXsp6fANLT88itqgOXdctmijOO0D8ZCuB2C/thlCzNZ4HuqrSBPIP5R5I/7Jl6k76WA== X-Received: by 2002:adf:f890:: with SMTP id u16mr20340647wrp.183.1600172774008; Tue, 15 Sep 2020 05:26:14 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.46.13]) by smtp.googlemail.com with ESMTPSA id r14sm26306905wrn.56.2020.09.15.05.26.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Sep 2020 05:26:13 -0700 (PDT) Subject: Re: [PATCH v1 1/1] Platform/RaspberryPi/ConfigDxe: Fix JTAG Pinout for Pi3/4 To: Jeff Booher-Kaeding , devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Andrei Warkentin References: <20200914213230.78282-1-jeff.booher-kaeding@arm.com> From: "Pete Batard" Message-ID: Date: Tue, 15 Sep 2020 13:26:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200914213230.78282-1-jeff.booher-kaeding@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Copying Andrei on this, as the existing JTAG pinout is not technically incorrect, since GPIO pin 4 can be used for TDI in ALT5 mode, and we are using the relevant ALT mode in the existing code. See https://sysprogs.com/VisualKernel/tutorials/raspberry/jtagsetup/ As far as I'm concerned, I think it makes sense to use the same ALT mode and have all the JTAG pins grouped, but I'd like to confirm whether we deliberately chose not to use GPIO 26 in order to leave it available for some other purpose, before I approve this patch. If Andrei says he's okay with it, then I see no objection to this change. Regards, /Pete On 2020.09.14 22:32, Jeff Booher-Kaeding wrote: > Updated the pinout to match the Pi4 datasheet, tested with the RPi4, Pi3 Datasheet has same pinout. > > Signed-off-by: Jeff Booher-Kaeding > > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Pete Batard > --- > Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > index ac1004fe1836..6e793efb8227 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > @@ -502,7 +502,7 @@ ApplyVariables ( > * 1 VREF N/A 1 > > * 3 nTRST GPIO22 ALT4 15 > > * 4 GND N/A 9 > > - * 5 TDI GPIO4 ALT5 7 > > + * 5 TDI GPIO26 ALT4 37 > > * 7 TMS GPIO27 ALT4 13 > > * 9 TCK GPIO25 ALT4 22 > > * 11 RTCK GPIO23 ALT4 16 > > @@ -510,14 +510,14 @@ ApplyVariables ( > */ > > if (PcdGet32 (PcdDebugEnableJTAG)) { > > GpioPinFuncSet (22, GPIO_FSEL_ALT4); > > - GpioPinFuncSet (4, GPIO_FSEL_ALT5); > > + GpioPinFuncSet (26, GPIO_FSEL_ALT4); > > GpioPinFuncSet (27, GPIO_FSEL_ALT4); > > GpioPinFuncSet (25, GPIO_FSEL_ALT4); > > GpioPinFuncSet (23, GPIO_FSEL_ALT4); > > GpioPinFuncSet (24, GPIO_FSEL_ALT4); > > } else { > > GpioPinFuncSet (22, GPIO_FSEL_INPUT); > > - GpioPinFuncSet (4, GPIO_FSEL_INPUT); > > + GpioPinFuncSet (26, GPIO_FSEL_INPUT); > > GpioPinFuncSet (27, GPIO_FSEL_INPUT); > > GpioPinFuncSet (25, GPIO_FSEL_INPUT); > > GpioPinFuncSet (23, GPIO_FSEL_INPUT); >