public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Courbot <acourbot@nvidia.com>
To: Ben Skeggs <bskeggs@redhat.com>
Cc: gnurou@gmail.com, nouveau@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-tegra@vger.kernel.org
Subject: [PATCH v3 7/9] drm/nouveau/graph: pad firmware code at load time
Date: Fri, 25 Apr 2014 16:19:54 +0900	[thread overview]
Message-ID: <1398410396-23338-8-git-send-email-acourbot@nvidia.com> (raw)
In-Reply-To: <1398410396-23338-1-git-send-email-acourbot@nvidia.com>

Pad the microcode to a multiple of 0x40 words, otherwise firmware will
fail to run from non-prepadded firmware files.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
index e5b75f189988..ba324016120a 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
@@ -894,6 +894,10 @@ nvc0_graph_init_fw(struct nvc0_graph_priv *priv, u32 fuc_base,
 			nv_wr32(priv, fuc_base + 0x0188, i >> 6);
 		nv_wr32(priv, fuc_base + 0x0184, code->data[i]);
 	}
+
+	/* code must be padded to 0x40 words */
+	for (; i & 0x3f; i++)
+		nv_wr32(priv, fuc_base + 0x0184, 0);
 }
 
 static void
-- 
1.9.2

  parent reply	other threads:[~2014-04-25  7:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25  7:19 [PATCH v3 0/9] drm/nouveau: support for GK20A, cont'd Alexandre Courbot
     [not found] ` <1398410396-23338-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-04-25  7:19   ` [PATCH v3 1/9] drm/nouveau/bar: only ioremap BAR3 if it exists Alexandre Courbot
2014-04-25  7:19   ` [PATCH v3 2/9] drm/nouveau/bar/nvc0: support chips without BAR3 Alexandre Courbot
2014-04-25  7:19   ` [PATCH v3 3/9] drm/nouveau/ibus: add GK20A support Alexandre Courbot
2014-04-25  7:19   ` [PATCH v3 4/9] drm/nouveau/fb: " Alexandre Courbot
2014-04-25  7:19   ` [PATCH v3 5/9] drm/nouveau/fifo: " Alexandre Courbot
2014-04-25  7:19   ` [PATCH v3 6/9] drm/nouveau/graph: enable when using external firmware Alexandre Courbot
     [not found]     ` <1398410396-23338-7-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-04-28  2:10       ` Ben Skeggs
2014-04-28  6:57         ` [Nouveau] " Thierry Reding
2014-04-28 23:52           ` Ben Skeggs
     [not found]         ` <CACAvsv51Ju_ZqJfNU5GzzEmDzf2Fr6Xr_5yGRtfqOQRVTgvDPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-01  4:53           ` Alexandre Courbot
     [not found]             ` <CAAVeFuK7H3zK3CaxYT4MP4pY=r2dF0oojjYHG1DGRf7Sq0TExg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-01  4:59               ` [Nouveau] " Ben Skeggs
2014-04-25  7:19   ` [PATCH v3 8/9] drm/nouveau/graph: add GK20A support Alexandre Courbot
2014-05-01  7:11   ` [PATCH v3 0/9] drm/nouveau: support for GK20A, cont'd Ben Skeggs
     [not found]     ` <CACAvsv5x6uZcTGUTa3-wBRo0sJ-557sJ_d8r0kscODhr18yzBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-01  7:14       ` Alexandre Courbot
2014-04-25  7:19 ` Alexandre Courbot [this message]
2014-04-25  7:19 ` [PATCH v3 9/9] drm/nouveau: support for probing GK20A Alexandre Courbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398410396-23338-8-git-send-email-acourbot@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gnurou@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox