55d88249998598c4442e3803197b5e05f33edf22
[openwrt.git] / target / linux / lantiq / patches-3.14 / 0011-lantiq-add-support-for-xrx200-firmware-depending-on-.patch
1 From 85f0df34dee96048515ef1e01d88524bd579f8e0 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Wed, 10 Sep 2014 22:39:19 +0200
4 Subject: [PATCH 11/36] lantiq: add support for xrx200 firmware depending on
5  soc type
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
11 ---
12  arch/mips/lantiq/xway/xrx200_phy_fw.c |   18 +++++++++++++++++-
13  1 file changed, 17 insertions(+), 1 deletion(-)
14
15 --- a/arch/mips/lantiq/xway/xrx200_phy_fw.c
16 +++ b/arch/mips/lantiq/xway/xrx200_phy_fw.c
17 @@ -24,7 +24,23 @@ static dma_addr_t xway_gphy_load(struct 
18         void *fw_addr;
19         size_t size;
20  
21 -       if (of_property_read_string(pdev->dev.of_node, "firmware", &fw_name)) {
22 +       if (of_get_property(pdev->dev.of_node, "firmware1", NULL) || of_get_property(pdev->dev.of_node, "firmware2", NULL)) {
23 +               switch(ltq_soc_type()) {
24 +                       case SOC_TYPE_VR9:
25 +                               if (of_property_read_string(pdev->dev.of_node, "firmware1", &fw_name)) {
26 +                                       dev_err(&pdev->dev, "failed to load firmware filename\n");
27 +                                       return 0;
28 +                               }
29 +                               break;
30 +                       case SOC_TYPE_VR9_2:
31 +                               if (of_property_read_string(pdev->dev.of_node, "firmware2", &fw_name)) {
32 +                                       dev_err(&pdev->dev, "failed to load firmware filename\n");
33 +                                       return 0;
34 +                               }
35 +                               break;
36 +               }
37 +       }
38 +       else if (of_property_read_string(pdev->dev.of_node, "firmware", &fw_name)) {
39                 dev_err(&pdev->dev, "failed to load firmware filename\n");
40                 return 0;
41         }