All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: b43-dev@lists.infradead.org
Subject: Extracting (boardvendor and) boardtype
Date: Tue, 19 Mar 2013 12:52:12 +0100	[thread overview]
Message-ID: <CACna6rwUTJHa772_OhdF8OZSp57DX+H1LwDWSHfWM2Frsg7AmQ@mail.gmail.com> (raw)
In-Reply-To: <51484FDA.1010706@broadcom.com>

2013/3/19 Arend van Spriel <arend@broadcom.com>:
> On 03/19/2013 12:37 PM, Rafa? Mi?ecki wrote:
>>
>> 2013/3/19 Arend van Spriel <arend@broadcom.com>:
>>>
>>> On 03/19/2013 12:18 PM, Rafa? Mi?ecki wrote:
>>>>
>>>>
>>>> 2013/3/19 Jonas Gorski <jogo@openwrt.org>:
>>>>>
>>>>>
>>>>> On 19 March 2013 11:36, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
>>>>>>
>>>>>>
>>>>>> However take a look at siutils.c you're using internally at Broadcom.
>>>>>> I've found it in:
>>>>>> GPL_RT_AC66U_3004270/asuswrt/release/src-rt-6.x/shared/siutils.c
>>>>>> This file contains si_nvram_process. This function calls that
>>>>>> si_getdevpathintvar and getintvar I'm not sure about. Does
>>>>>> si_nvram_process prefer SPROM's boardtype (offset SROM_SSID==0x2 or
>>>>>> offset SSB_SPROM1_SPID==0x4) if it's available (not 0xFFFF)?
>>>>>
>>>>>
>>>>>
>>>>> The getdevpathintvar and getintvar are for extracting these values
>>>>> from nvram instead of SPROM - remember that embedded bcm47xx devices
>>>>> are "sprom"-less and have these values stored in nvram. Since there is
>>>>> only one global nvram, you need to prefix these values with the
>>>>> "pci/sb" device path to differentiate if you have more than one wifi
>>>>> chip (e.g. "sb/1/boardflags" or "pci/1/boardflags"). But this isn't
>>>>> necessarily done for single wifi devices, hence the getdevpathintvar
>>>>> -> getinvar path (as the fall back).
>>>>
>>>>
>>>>
>>>> So what function does Broadcom use to extract something from SPROM?
>>>
>>>
>>> srom_var_init()
>>
>>
>> OK, so for PCI:
>> 1) srom_var_init calls initvars_srom_pci
>> 2) initvars_srom_pci calls _initvars_srom_pci
>> 3) _initvars_srom_pci calls varbuf_append for every entry
>>
>> After all we end up with varbuf_t variable filled like an NVRAM
>> (foo=bar\0baz=qux\0).
>>
>> So AFAIU getdevpathintvar and getintvar are still used to access SPROM
>> (just in a form common for NVRAM), is that right?
>>
>> If the above is right, in si_nvram_process we access SPROM (with the
>> use of getdevpathintvar/getintvar). So it seems in si_nvram_process we
>> always prefer "boardtype", no matter if it comes from SPROM of NVRAM.
>> Is that correct?
>>
>
> Yes. Non-volatile variables take precedence to PCI config info regardless
> from which device, SPROM or flash, it was loaded.

Thanks a lot for your help guys :)

-- 
Rafa?

      parent reply	other threads:[~2013-03-19 11:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19  9:48 Extracting (boardvendor and) boardtype Rafał Miłecki
2013-03-19 10:19 ` Arend van Spriel
2013-03-19 10:36   ` Rafał Miłecki
2013-03-19 11:03     ` Jonas Gorski
2013-03-19 11:18       ` Rafał Miłecki
2013-03-19 11:22         ` Arend van Spriel
2013-03-19 11:37           ` Rafał Miłecki
2013-03-19 11:45             ` Arend van Spriel
2013-03-19 11:47               ` Arend van Spriel
2013-03-19 11:52               ` Rafał Miłecki [this message]

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=CACna6rwUTJHa772_OhdF8OZSp57DX+H1LwDWSHfWM2Frsg7AmQ@mail.gmail.com \
    --to=zajec5@gmail.com \
    --cc=b43-dev@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.