diff mbox series

[v2,1/4] ARM: davinci: fix cpufreq registration on da850-evm

Message ID 20190322133105.5945-2-brgl@bgdev.pl (mailing list archive)
State New, archived
Headers show
Series ARM: da850: enable cpufreq in DT mode | expand

Commit Message

Bartosz Golaszewski March 22, 2019, 1:31 p.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

The system_rev variable is never set on davinci and is always 0, so
we're using the default max operating point of 300MHz. The cvdd supply
comes from the tps6507 pmic and the voltage can go all the way to 1.3V
so the maximum supported rate should be 456MHz.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da850-evm.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Comments

Adam Ford March 26, 2019, 2 p.m. UTC | #1
On Fri, Mar 22, 2019 at 8:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> The system_rev variable is never set on davinci and is always 0, so
> we're using the default max operating point of 300MHz. The cvdd supply
> comes from the tps6507 pmic and the voltage can go all the way to 1.3V
> so the maximum supported rate should be 456MHz.

My understanding is that only certain revisions of the silicon can go
to 456MHz.   The L138's Datasheet lists both a 456 and 375 version.  I
cannot find a way to read a register to determine which version of the
silicon is available. Maybe Sekhar can confirm.

adam
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  arch/arm/mach-davinci/board-da850-evm.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> index 1fdc9283a8c5..58b2a485b527 100644
> --- a/arch/arm/mach-davinci/board-da850-evm.c
> +++ b/arch/arm/mach-davinci/board-da850-evm.c
> @@ -1155,17 +1155,7 @@ static struct edma_rsv_info *da850_edma_rsv[2] = {
>  #ifdef CONFIG_CPU_FREQ
>  static __init int da850_evm_init_cpufreq(void)
>  {
> -       switch (system_rev & 0xF) {
> -       case 3:
> -               da850_max_speed = 456000;
> -               break;
> -       case 2:
> -               da850_max_speed = 408000;
> -               break;
> -       case 1:
> -               da850_max_speed = 372000;
> -               break;
> -       }
> +       da850_max_speed = 456000;
>
>         return da850_register_cpufreq("pll0_sysclk3");
>  }
> --
> 2.20.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Bartosz Golaszewski March 26, 2019, 5:51 p.m. UTC | #2
wt., 26 mar 2019 o 15:00 Adam Ford <aford173@gmail.com> napisał(a):
>
> On Fri, Mar 22, 2019 at 8:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > The system_rev variable is never set on davinci and is always 0, so
> > we're using the default max operating point of 300MHz. The cvdd supply
> > comes from the tps6507 pmic and the voltage can go all the way to 1.3V
> > so the maximum supported rate should be 456MHz.
>
> My understanding is that only certain revisions of the silicon can go
> to 456MHz.   The L138's Datasheet lists both a 456 and 375 version.  I
> cannot find a way to read a register to determine which version of the
> silicon is available. Maybe Sekhar can confirm.
>

Commit 28bd2c341120 ("davinci: am18x/da850/omap-l138 evm: add support
for higher speed grades") mentions the following:

---
U-Boot on the EVM sets up ATAG_REVISION to inform the OS
regarding the speed grade supported by the silicon. We use
this information to pass on the speed grade information to
the SoC code.
---

Should the system_rev somehow reflect that revision? Any way I can check it?

Bart

> adam
> >
> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > ---
> >  arch/arm/mach-davinci/board-da850-evm.c | 12 +-----------
> >  1 file changed, 1 insertion(+), 11 deletions(-)
> >
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> > index 1fdc9283a8c5..58b2a485b527 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
> > @@ -1155,17 +1155,7 @@ static struct edma_rsv_info *da850_edma_rsv[2] = {
> >  #ifdef CONFIG_CPU_FREQ
> >  static __init int da850_evm_init_cpufreq(void)
> >  {
> > -       switch (system_rev & 0xF) {
> > -       case 3:
> > -               da850_max_speed = 456000;
> > -               break;
> > -       case 2:
> > -               da850_max_speed = 408000;
> > -               break;
> > -       case 1:
> > -               da850_max_speed = 372000;
> > -               break;
> > -       }
> > +       da850_max_speed = 456000;
> >
> >         return da850_register_cpufreq("pll0_sysclk3");
> >  }
> > --
> > 2.20.1
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sekhar Nori March 27, 2019, 11:14 a.m. UTC | #3
Hi Bart,

On 26/03/19 11:21 PM, Bartosz Golaszewski wrote:
> wt., 26 mar 2019 o 15:00 Adam Ford <aford173@gmail.com> napisał(a):
>>
>> On Fri, Mar 22, 2019 at 8:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>>>
>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>
>>> The system_rev variable is never set on davinci and is always 0, so
>>> we're using the default max operating point of 300MHz. The cvdd supply
>>> comes from the tps6507 pmic and the voltage can go all the way to 1.3V
>>> so the maximum supported rate should be 456MHz.
>>
>> My understanding is that only certain revisions of the silicon can go
>> to 456MHz.   The L138's Datasheet lists both a 456 and 375 version.  I
>> cannot find a way to read a register to determine which version of the
>> silicon is available. Maybe Sekhar can confirm.
>>
> 
> Commit 28bd2c341120 ("davinci: am18x/da850/omap-l138 evm: add support
> for higher speed grades") mentions the following:
> 
> ---
> U-Boot on the EVM sets up ATAG_REVISION to inform the OS
> regarding the speed grade supported by the silicon. We use
> this information to pass on the speed grade information to
> the SoC code.
> ---
> 
> Should the system_rev somehow reflect that revision? Any way I can check it?

Can you check if the procedure in doc/README.davinci in U-Boot sources 
still works?

Environment Variables
=====================

The DA850 EVM allows the user to specify the maximum cpu clock allowed by the
silicon, in Hz, via an environment variable "maxcpuclk".

The maximum clock rate allowed depends on the silicon populated on the EVM.
Please make sure you understand the restrictions placed on this clock in the
device specific datasheet before setting up this variable. This information is
passed to the Linux kernel using the ATAG_REVISION atag.

If "maxcpuclk" is not defined, the configuration CONFIG_DA850_EVM_MAX_CPU_CLK
is used to obtain this information.

Thanks,
Sekhar
Bartosz Golaszewski April 3, 2019, 12:50 p.m. UTC | #4
śr., 27 mar 2019 o 12:14 Sekhar Nori <nsekhar@ti.com> napisał(a):
>
> Hi Bart,
>
> On 26/03/19 11:21 PM, Bartosz Golaszewski wrote:
> > wt., 26 mar 2019 o 15:00 Adam Ford <aford173@gmail.com> napisał(a):
> >>
> >> On Fri, Mar 22, 2019 at 8:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >>>
> >>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >>>
> >>> The system_rev variable is never set on davinci and is always 0, so
> >>> we're using the default max operating point of 300MHz. The cvdd supply
> >>> comes from the tps6507 pmic and the voltage can go all the way to 1.3V
> >>> so the maximum supported rate should be 456MHz.
> >>
> >> My understanding is that only certain revisions of the silicon can go
> >> to 456MHz.   The L138's Datasheet lists both a 456 and 375 version.  I
> >> cannot find a way to read a register to determine which version of the
> >> silicon is available. Maybe Sekhar can confirm.
> >>
> >
> > Commit 28bd2c341120 ("davinci: am18x/da850/omap-l138 evm: add support
> > for higher speed grades") mentions the following:
> >
> > ---
> > U-Boot on the EVM sets up ATAG_REVISION to inform the OS
> > regarding the speed grade supported by the silicon. We use
> > this information to pass on the speed grade information to
> > the SoC code.
> > ---
> >
> > Should the system_rev somehow reflect that revision? Any way I can check it?
>
> Can you check if the procedure in doc/README.davinci in U-Boot sources
> still works?
>
> Environment Variables
> =====================
>
> The DA850 EVM allows the user to specify the maximum cpu clock allowed by the
> silicon, in Hz, via an environment variable "maxcpuclk".
>
> The maximum clock rate allowed depends on the silicon populated on the EVM.
> Please make sure you understand the restrictions placed on this clock in the
> device specific datasheet before setting up this variable. This information is
> passed to the Linux kernel using the ATAG_REVISION atag.
>
> If "maxcpuclk" is not defined, the configuration CONFIG_DA850_EVM_MAX_CPU_CLK
> is used to obtain this information.
>
> Thanks,
> Sekhar

Hi Sekhar,

I built the current upstream u-boot and the get_board_rev() function
for da850-evm doesn't seem to be called at all. For instance the
lego-ev3 platform does this:

./lego/ev3/legoev3.c:108: board_rev = get_board_rev();

but in davinci this function seems to be unused and I don't see it
called from any other core u-boot component. I don't see any commit
that would mention this function but there are a lot of commits
removing get_board_rev() for other boards in git log. Is it possible
it stopped being used at some point?

Bart
Adam Ford April 3, 2019, 3:49 p.m. UTC | #5
On Wed, Apr 3, 2019 at 7:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> śr., 27 mar 2019 o 12:14 Sekhar Nori <nsekhar@ti.com> napisał(a):
> >
> > Hi Bart,
> >
> > On 26/03/19 11:21 PM, Bartosz Golaszewski wrote:
> > > wt., 26 mar 2019 o 15:00 Adam Ford <aford173@gmail.com> napisał(a):
> > >>
> > >> On Fri, Mar 22, 2019 at 8:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >>>
> > >>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > >>>
> > >>> The system_rev variable is never set on davinci and is always 0, so
> > >>> we're using the default max operating point of 300MHz. The cvdd supply
> > >>> comes from the tps6507 pmic and the voltage can go all the way to 1.3V
> > >>> so the maximum supported rate should be 456MHz.
> > >>
> > >> My understanding is that only certain revisions of the silicon can go
> > >> to 456MHz.   The L138's Datasheet lists both a 456 and 375 version.  I
> > >> cannot find a way to read a register to determine which version of the
> > >> silicon is available. Maybe Sekhar can confirm.
> > >>
> > >
> > > Commit 28bd2c341120 ("davinci: am18x/da850/omap-l138 evm: add support
> > > for higher speed grades") mentions the following:
> > >
> > > ---
> > > U-Boot on the EVM sets up ATAG_REVISION to inform the OS
> > > regarding the speed grade supported by the silicon. We use
> > > this information to pass on the speed grade information to
> > > the SoC code.
> > > ---
> > >
> > > Should the system_rev somehow reflect that revision? Any way I can check it?
> >
> > Can you check if the procedure in doc/README.davinci in U-Boot sources
> > still works?
> >
> > Environment Variables
> > =====================
> >
> > The DA850 EVM allows the user to specify the maximum cpu clock allowed by the
> > silicon, in Hz, via an environment variable "maxcpuclk".
> >
> > The maximum clock rate allowed depends on the silicon populated on the EVM.
> > Please make sure you understand the restrictions placed on this clock in the
> > device specific datasheet before setting up this variable. This information is
> > passed to the Linux kernel using the ATAG_REVISION atag.
> >
> > If "maxcpuclk" is not defined, the configuration CONFIG_DA850_EVM_MAX_CPU_CLK
> > is used to obtain this information.
> >
> > Thanks,
> > Sekhar
>
> Hi Sekhar,
>
> I built the current upstream u-boot and the get_board_rev() function
> for da850-evm doesn't seem to be called at all. For instance the
> lego-ev3 platform does this:
>
> ./lego/ev3/legoev3.c:108: board_rev = get_board_rev();
>
> but in davinci this function seems to be unused and I don't see it
> called from any other core u-boot component. I don't see any commit
> that would mention this function but there are a lot of commits
> removing get_board_rev() for other boards in git log. Is it possible
> it stopped being used at some point?

Look for setup_revision_tag in arch/arm/lib/bootm.c

The function appears to be called from there.

There is a __weak reference in the header file which I think allows
people to remove them without breaking bootm.

adam
>
> Bart
Bartosz Golaszewski April 4, 2019, 10:01 a.m. UTC | #6
śr., 3 kwi 2019 o 17:49 Adam Ford <aford173@gmail.com> napisał(a):
>
> On Wed, Apr 3, 2019 at 7:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > śr., 27 mar 2019 o 12:14 Sekhar Nori <nsekhar@ti.com> napisał(a):
> > >
> > > Hi Bart,
> > >
> > > On 26/03/19 11:21 PM, Bartosz Golaszewski wrote:
> > > > wt., 26 mar 2019 o 15:00 Adam Ford <aford173@gmail.com> napisał(a):
> > > >>
> > > >> On Fri, Mar 22, 2019 at 8:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > >>>
> > > >>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > >>>
> > > >>> The system_rev variable is never set on davinci and is always 0, so
> > > >>> we're using the default max operating point of 300MHz. The cvdd supply
> > > >>> comes from the tps6507 pmic and the voltage can go all the way to 1.3V
> > > >>> so the maximum supported rate should be 456MHz.
> > > >>
> > > >> My understanding is that only certain revisions of the silicon can go
> > > >> to 456MHz.   The L138's Datasheet lists both a 456 and 375 version.  I
> > > >> cannot find a way to read a register to determine which version of the
> > > >> silicon is available. Maybe Sekhar can confirm.
> > > >>
> > > >
> > > > Commit 28bd2c341120 ("davinci: am18x/da850/omap-l138 evm: add support
> > > > for higher speed grades") mentions the following:
> > > >
> > > > ---
> > > > U-Boot on the EVM sets up ATAG_REVISION to inform the OS
> > > > regarding the speed grade supported by the silicon. We use
> > > > this information to pass on the speed grade information to
> > > > the SoC code.
> > > > ---
> > > >
> > > > Should the system_rev somehow reflect that revision? Any way I can check it?
> > >
> > > Can you check if the procedure in doc/README.davinci in U-Boot sources
> > > still works?
> > >
> > > Environment Variables
> > > =====================
> > >
> > > The DA850 EVM allows the user to specify the maximum cpu clock allowed by the
> > > silicon, in Hz, via an environment variable "maxcpuclk".
> > >
> > > The maximum clock rate allowed depends on the silicon populated on the EVM.
> > > Please make sure you understand the restrictions placed on this clock in the
> > > device specific datasheet before setting up this variable. This information is
> > > passed to the Linux kernel using the ATAG_REVISION atag.
> > >
> > > If "maxcpuclk" is not defined, the configuration CONFIG_DA850_EVM_MAX_CPU_CLK
> > > is used to obtain this information.
> > >
> > > Thanks,
> > > Sekhar
> >
> > Hi Sekhar,
> >
> > I built the current upstream u-boot and the get_board_rev() function
> > for da850-evm doesn't seem to be called at all. For instance the
> > lego-ev3 platform does this:
> >
> > ./lego/ev3/legoev3.c:108: board_rev = get_board_rev();
> >
> > but in davinci this function seems to be unused and I don't see it
> > called from any other core u-boot component. I don't see any commit
> > that would mention this function but there are a lot of commits
> > removing get_board_rev() for other boards in git log. Is it possible
> > it stopped being used at some point?
>
> Look for setup_revision_tag in arch/arm/lib/bootm.c
>
> The function appears to be called from there.
>
> There is a __weak reference in the header file which I think allows
> people to remove them without breaking bootm.
>
> adam
> >
> > Bart

Thanks, now verified that this still works in board file mode for
da850-evm. Now the questions is - what about DT mode? Should we only
enable the lowest possible mode (300MHz) and leave it to the user to
enable any higher frequencies?

Bart
Adam Ford April 4, 2019, 11:14 a.m. UTC | #7
On Thu, Apr 4, 2019 at 5:01 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> śr., 3 kwi 2019 o 17:49 Adam Ford <aford173@gmail.com> napisał(a):
> >
> > On Wed, Apr 3, 2019 at 7:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >
> > > śr., 27 mar 2019 o 12:14 Sekhar Nori <nsekhar@ti.com> napisał(a):
> > > >
> > > > Hi Bart,
> > > >
> > > > On 26/03/19 11:21 PM, Bartosz Golaszewski wrote:
> > > > > wt., 26 mar 2019 o 15:00 Adam Ford <aford173@gmail.com> napisał(a):
> > > > >>
> > > > >> On Fri, Mar 22, 2019 at 8:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > > >>>
> > > > >>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > > >>>
> > > > >>> The system_rev variable is never set on davinci and is always 0, so
> > > > >>> we're using the default max operating point of 300MHz. The cvdd supply
> > > > >>> comes from the tps6507 pmic and the voltage can go all the way to 1.3V
> > > > >>> so the maximum supported rate should be 456MHz.
> > > > >>
> > > > >> My understanding is that only certain revisions of the silicon can go
> > > > >> to 456MHz.   The L138's Datasheet lists both a 456 and 375 version.  I
> > > > >> cannot find a way to read a register to determine which version of the
> > > > >> silicon is available. Maybe Sekhar can confirm.
> > > > >>
> > > > >
> > > > > Commit 28bd2c341120 ("davinci: am18x/da850/omap-l138 evm: add support
> > > > > for higher speed grades") mentions the following:
> > > > >
> > > > > ---
> > > > > U-Boot on the EVM sets up ATAG_REVISION to inform the OS
> > > > > regarding the speed grade supported by the silicon. We use
> > > > > this information to pass on the speed grade information to
> > > > > the SoC code.
> > > > > ---
> > > > >
> > > > > Should the system_rev somehow reflect that revision? Any way I can check it?
> > > >
> > > > Can you check if the procedure in doc/README.davinci in U-Boot sources
> > > > still works?
> > > >
> > > > Environment Variables
> > > > =====================
> > > >
> > > > The DA850 EVM allows the user to specify the maximum cpu clock allowed by the
> > > > silicon, in Hz, via an environment variable "maxcpuclk".
> > > >
> > > > The maximum clock rate allowed depends on the silicon populated on the EVM.
> > > > Please make sure you understand the restrictions placed on this clock in the
> > > > device specific datasheet before setting up this variable. This information is
> > > > passed to the Linux kernel using the ATAG_REVISION atag.
> > > >
> > > > If "maxcpuclk" is not defined, the configuration CONFIG_DA850_EVM_MAX_CPU_CLK
> > > > is used to obtain this information.
> > > >
> > > > Thanks,
> > > > Sekhar
> > >
> > > Hi Sekhar,
> > >
> > > I built the current upstream u-boot and the get_board_rev() function
> > > for da850-evm doesn't seem to be called at all. For instance the
> > > lego-ev3 platform does this:
> > >
> > > ./lego/ev3/legoev3.c:108: board_rev = get_board_rev();
> > >
> > > but in davinci this function seems to be unused and I don't see it
> > > called from any other core u-boot component. I don't see any commit
> > > that would mention this function but there are a lot of commits
> > > removing get_board_rev() for other boards in git log. Is it possible
> > > it stopped being used at some point?
> >
> > Look for setup_revision_tag in arch/arm/lib/bootm.c
> >
> > The function appears to be called from there.
> >
> > There is a __weak reference in the header file which I think allows
> > people to remove them without breaking bootm.
> >
> > adam
> > >
> > > Bart
>
> Thanks, now verified that this still works in board file mode for
> da850-evm. Now the questions is - what about DT mode? Should we only
> enable the lowest possible mode (300MHz) and leave it to the user to
> enable any higher frequencies?

From everything that I can find in Logic PD's database, the standard
da850-evm kits and SOM's are 375MHz, so I think it's safe to run up to
that speed.  I would disable the speed options for 408 and 456, but
leave them shown for anyone who may have purchased a custom version
with the 456MHz variant which I can also see there are some.  At least
for the L138 and AM1808 SOM's, those customers who who they are, so
making it obvious how to enable it would be a good thing.

Just my two cents.

adam
>
> Bart
Sekhar Nori April 8, 2019, 8:48 a.m. UTC | #8
On 04/04/19 4:44 PM, Adam Ford wrote:
> On Thu, Apr 4, 2019 at 5:01 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>>
>> śr., 3 kwi 2019 o 17:49 Adam Ford <aford173@gmail.com> napisał(a):
>>>
>>> On Wed, Apr 3, 2019 at 7:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>>>>
>>>> śr., 27 mar 2019 o 12:14 Sekhar Nori <nsekhar@ti.com> napisał(a):
>>>>>
>>>>> Hi Bart,
>>>>>
>>>>> On 26/03/19 11:21 PM, Bartosz Golaszewski wrote:
>>>>>> wt., 26 mar 2019 o 15:00 Adam Ford <aford173@gmail.com> napisał(a):
>>>>>>>
>>>>>>> On Fri, Mar 22, 2019 at 8:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>>>>>>>>
>>>>>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>>>>>
>>>>>>>> The system_rev variable is never set on davinci and is always 0, so
>>>>>>>> we're using the default max operating point of 300MHz. The cvdd supply
>>>>>>>> comes from the tps6507 pmic and the voltage can go all the way to 1.3V
>>>>>>>> so the maximum supported rate should be 456MHz.
>>>>>>>
>>>>>>> My understanding is that only certain revisions of the silicon can go
>>>>>>> to 456MHz.   The L138's Datasheet lists both a 456 and 375 version.  I
>>>>>>> cannot find a way to read a register to determine which version of the
>>>>>>> silicon is available. Maybe Sekhar can confirm.
>>>>>>>
>>>>>>
>>>>>> Commit 28bd2c341120 ("davinci: am18x/da850/omap-l138 evm: add support
>>>>>> for higher speed grades") mentions the following:
>>>>>>
>>>>>> ---
>>>>>> U-Boot on the EVM sets up ATAG_REVISION to inform the OS
>>>>>> regarding the speed grade supported by the silicon. We use
>>>>>> this information to pass on the speed grade information to
>>>>>> the SoC code.
>>>>>> ---
>>>>>>
>>>>>> Should the system_rev somehow reflect that revision? Any way I can check it?
>>>>>
>>>>> Can you check if the procedure in doc/README.davinci in U-Boot sources
>>>>> still works?
>>>>>
>>>>> Environment Variables
>>>>> =====================
>>>>>
>>>>> The DA850 EVM allows the user to specify the maximum cpu clock allowed by the
>>>>> silicon, in Hz, via an environment variable "maxcpuclk".
>>>>>
>>>>> The maximum clock rate allowed depends on the silicon populated on the EVM.
>>>>> Please make sure you understand the restrictions placed on this clock in the
>>>>> device specific datasheet before setting up this variable. This information is
>>>>> passed to the Linux kernel using the ATAG_REVISION atag.
>>>>>
>>>>> If "maxcpuclk" is not defined, the configuration CONFIG_DA850_EVM_MAX_CPU_CLK
>>>>> is used to obtain this information.
>>>>>
>>>>> Thanks,
>>>>> Sekhar
>>>>
>>>> Hi Sekhar,
>>>>
>>>> I built the current upstream u-boot and the get_board_rev() function
>>>> for da850-evm doesn't seem to be called at all. For instance the
>>>> lego-ev3 platform does this:
>>>>
>>>> ./lego/ev3/legoev3.c:108: board_rev = get_board_rev();
>>>>
>>>> but in davinci this function seems to be unused and I don't see it
>>>> called from any other core u-boot component. I don't see any commit
>>>> that would mention this function but there are a lot of commits
>>>> removing get_board_rev() for other boards in git log. Is it possible
>>>> it stopped being used at some point?
>>>
>>> Look for setup_revision_tag in arch/arm/lib/bootm.c
>>>
>>> The function appears to be called from there.
>>>
>>> There is a __weak reference in the header file which I think allows
>>> people to remove them without breaking bootm.
>>>
>>> adam
>>>>
>>>> Bart
>>
>> Thanks, now verified that this still works in board file mode for
>> da850-evm. Now the questions is - what about DT mode? Should we only
>> enable the lowest possible mode (300MHz) and leave it to the user to
>> enable any higher frequencies?
> 
> From everything that I can find in Logic PD's database, the standard
> da850-evm kits and SOM's are 375MHz, so I think it's safe to run up to
> that speed.  I would disable the speed options for 408 and 456, but
> leave them shown for anyone who may have purchased a custom version
> with the 456MHz variant which I can also see there are some.  At least
> for the L138 and AM1808 SOM's, those customers who who they are, so
> making it obvious how to enable it would be a good thing.
> 
> Just my two cents.

Sounds good to me.

Thanks,
Sekhar
diff mbox series

Patch

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 1fdc9283a8c5..58b2a485b527 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1155,17 +1155,7 @@  static struct edma_rsv_info *da850_edma_rsv[2] = {
 #ifdef CONFIG_CPU_FREQ
 static __init int da850_evm_init_cpufreq(void)
 {
-	switch (system_rev & 0xF) {
-	case 3:
-		da850_max_speed = 456000;
-		break;
-	case 2:
-		da850_max_speed = 408000;
-		break;
-	case 1:
-		da850_max_speed = 372000;
-		break;
-	}
+	da850_max_speed = 456000;
 
 	return da850_register_cpufreq("pll0_sysclk3");
 }