From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bX6IE-00078q-QV for barebox@lists.infradead.org; Tue, 09 Aug 2016 12:38:08 +0000 From: Steffen Trumtrar Date: Tue, 9 Aug 2016 14:37:28 +0200 Message-Id: <1470746252-3146-3-git-send-email-s.trumtrar@pengutronix.de> In-Reply-To: <1470746252-3146-1-git-send-email-s.trumtrar@pengutronix.de> References: <1470746252-3146-1-git-send-email-s.trumtrar@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 3/7] ARM: socfpga: xload: support more qspi partitions To: barebox@lists.infradead.org Cc: Steffen Trumtrar RnJvbTogVWxyaWNoIMOWbG1hbm4gPHUub2VsbWFubkBwZW5ndXRyb25peC5kZT4KClNpZ25lZC1v ZmYtYnk6IFVscmljaCDDlmxtYW5uIDx1Lm9lbG1hbm5AcGVuZ3V0cm9uaXguZGU+ClNpZ25lZC1v ZmYtYnk6IFN0ZWZmZW4gVHJ1bXRyYXIgPHMudHJ1bXRyYXJAcGVuZ3V0cm9uaXguZGU+Ci0tLQog YXJjaC9hcm0vbWFjaC1zb2NmcGdhL3hsb2FkLmMgfCA1NiArKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrLS0tLS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgNDEgaW5zZXJ0aW9ucygrKSwg MTUgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvYXJjaC9hcm0vbWFjaC1zb2NmcGdhL3hsb2Fk LmMgYi9hcmNoL2FybS9tYWNoLXNvY2ZwZ2EveGxvYWQuYwppbmRleCA3Zjh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