Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65992
b: refs/heads/master
c: f16295e
h: refs/heads/master
v: v3
  • Loading branch information
Robin Getz authored and Bryan Wu committed Aug 3, 2007
1 parent 2f99e2e commit 8a42b27
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 421 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b99ab54d4f11141b2ef3e50c3543b7243d3f49fb
refs/heads/master: f16295e7e7f2a2a15876f570f10d6dc8f1f36ab8
175 changes: 113 additions & 62 deletions trunk/arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ config CMDLINE
to the kernel, you may specify one here. As a minimum, you should specify
the memory size and the root device (e.g., mem=8M, root=/dev/nfs).

comment "Board Setup"
comment "Clock/PLL Setup"

config CLKIN_HZ
int "Crystal Frequency in Hz"
Expand All @@ -335,6 +335,118 @@ config CLKIN_HZ
help
The frequency of CLKIN crystal oscillator on the board in Hz.

config BFIN_KERNEL_CLOCK
bool "Re-program Clocks while Kernel boots?"
default n
help
This option decides if kernel clocks are re-programed from the
bootloader settings. If the clocks are not set, the SDRAM settings
are also not changed, and the Bootloader does 100% of the hardware
configuration.

config PLL_BYPASS
bool "Bypass PLL"
depends on BFIN_KERNEL_CLOCK
default n

config CLKIN_HALF
bool "Half Clock In"
depends on BFIN_KERNEL_CLOCK && (! PLL_BYPASS)
default n
help
If this is set the clock will be divided by 2, before it goes to the PLL.

config VCO_MULT
int "VCO Multiplier"
depends on BFIN_KERNEL_CLOCK && (! PLL_BYPASS)
range 1 64
default "22" if BFIN533_EZKIT
default "45" if BFIN533_STAMP
default "20" if BFIN537_STAMP
default "22" if BFIN533_BLUETECHNIX_CM
default "20" if BFIN537_BLUETECHNIX_CM
default "20" if BFIN561_BLUETECHNIX_CM
default "20" if BFIN561_EZKIT
help
This controls the frequency of the on-chip PLL. This can be between 1 and 64.
PLL Frequency = (Crystal Frequency) * (this setting)

choice
prompt "Core Clock Divider"
depends on BFIN_KERNEL_CLOCK
default CCLK_DIV_1
help
This sets the frequency of the core. It can be 1, 2, 4 or 8
Core Frequency = (PLL frequency) / (this setting)

config CCLK_DIV_1
bool "1"

config CCLK_DIV_2
bool "2"

config CCLK_DIV_4
bool "4"

config CCLK_DIV_8
bool "8"
endchoice

config SCLK_DIV
int "System Clock Divider"
depends on BFIN_KERNEL_CLOCK
range 1 15
default 5 if BFIN533_EZKIT
default 5 if BFIN533_STAMP
default 4 if BFIN537_STAMP
default 5 if BFIN533_BLUETECHNIX_CM
default 4 if BFIN537_BLUETECHNIX_CM
default 4 if BFIN561_BLUETECHNIX_CM
default 5 if BFIN561_EZKIT
help
This sets the frequency of the system clock (including SDRAM or DDR).
This can be between 1 and 15
System Clock = (PLL frequency) / (this setting)

#
# Max & Min Speeds for various Chips
#
config MAX_VCO_HZ
int
default 600000000 if BF522
default 600000000 if BF525
default 600000000 if BF527
default 400000000 if BF531
default 400000000 if BF532
default 750000000 if BF533
default 500000000 if BF534
default 400000000 if BF536
default 600000000 if BF537
default 533000000 if BF538
default 533000000 if BF539
default 600000000 if BF542
default 533000000 if BF544
default 533000000 if BF549
default 600000000 if BF561

config MIN_VCO_HZ
int
default 50000000

config MAX_SCLK_HZ
int
default 133000000

config MIN_SCLK_HZ
int
default 27000000

comment "Kernel Timer/Scheduler"

source kernel/Kconfig.hz

comment "Memory Setup"

config MEM_SIZE
int "SDRAM Memory Size in MBytes"
default 32 if BFIN533_EZKIT
Expand Down Expand Up @@ -448,10 +560,6 @@ endmenu

menu "Blackfin Kernel Optimizations"

comment "Timer Tick"

source kernel/Kconfig.hz

comment "Memory Optimizations"

config I_ENTRY_L1
Expand Down Expand Up @@ -672,63 +780,6 @@ config L1_MAX_PIECE
Set the max memory pieces for the L1 SRAM allocation algorithm.
Min value is 16. Max value is 1024.

menu "Clock Settings"


config BFIN_KERNEL_CLOCK
bool "Re-program Clocks while Kernel boots?"
default n
help
This option decides if kernel clocks are re-programed from the
bootloader settings. If the clocks are not set, the SDRAM settings
are also not changed, and the Bootloader does 100% of the hardware
configuration.

config VCO_MULT
int "VCO Multiplier"
depends on BFIN_KERNEL_CLOCK
default "22" if BFIN533_EZKIT
default "45" if BFIN533_STAMP
default "20" if BFIN537_STAMP
default "22" if BFIN533_BLUETECHNIX_CM
default "20" if BFIN537_BLUETECHNIX_CM
default "20" if BFIN561_BLUETECHNIX_CM
default "20" if BFIN561_EZKIT

config CCLK_DIV
int "Core Clock Divider"
depends on BFIN_KERNEL_CLOCK
default 1 if BFIN533_EZKIT
default 1 if BFIN533_STAMP
default 1 if BFIN537_STAMP
default 1 if BFIN533_BLUETECHNIX_CM
default 1 if BFIN537_BLUETECHNIX_CM
default 1 if BFIN561_BLUETECHNIX_CM
default 1 if BFIN561_EZKIT

config SCLK_DIV
int "System Clock Divider"
depends on BFIN_KERNEL_CLOCK
default 5 if BFIN533_EZKIT
default 5 if BFIN533_STAMP
default 4 if BFIN537_STAMP
default 5 if BFIN533_BLUETECHNIX_CM
default 4 if BFIN537_BLUETECHNIX_CM
default 4 if BFIN561_BLUETECHNIX_CM
default 5 if BFIN561_EZKIT

config CLKIN_HALF
bool "Half ClockIn"
depends on BFIN_KERNEL_CLOCK
default n

config PLL_BYPASS
bool "Bypass PLL"
depends on BFIN_KERNEL_CLOCK
default n

endmenu

comment "Asynchonous Memory Configuration"

menu "EBIU_AMBCTL Global Control"
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/blackfin/mach-bf533/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <asm/blackfin.h>
#include <asm/trace.h>
#if CONFIG_BFIN_KERNEL_CLOCK
#include <asm/mach-common/clocks.h>
#include <asm/mach/mem_init.h>
#endif
#if CONFIG_DEBUG_KERNEL_START
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/blackfin/mach-bf537/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <asm/trace.h>

#if CONFIG_BFIN_KERNEL_CLOCK
#include <asm/mach-common/clocks.h>
#include <asm/mach/mem_init.h>
#endif

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/blackfin/mach-bf548/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <asm/blackfin.h>
#include <asm/trace.h>
#if CONFIG_BFIN_KERNEL_CLOCK
#include <asm/mach-common/clocks.h>
#include <asm/mach/mem_init.h>
#endif

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/blackfin/mach-bf561/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <asm/trace.h>

#if CONFIG_BFIN_KERNEL_CLOCK
#include <asm/mach-common/clocks.h>
#include <asm/mach/mem_init.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

obj-y := \
cache.o cacheinit.o cplbhdlr.o cplbmgr.o entry.o \
interrupt.o lock.o irqpanic.o
interrupt.o lock.o irqpanic.o arch_checks.o

obj-$(CONFIG_CPLB_INFO) += cplbinfo.o
obj-$(CONFIG_BFIN_SINGLE_CORE) += ints-priority-sc.o
Expand Down
55 changes: 55 additions & 0 deletions trunk/arch/blackfin/mach-common/arch_checks.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* File: arch/blackfin/mach-common/arch_checks.c
* Based on:
* Author: Robin Getz <rgetz@blackfin.uclinux.org>
*
* Created: 25Jul07
* Description: Do some checking to make sure things are OK
*
* Modified:
* Copyright 2004-2007 Analog Devices Inc.
*
* Bugs: Enter bugs at http://blackfin.uclinux.org/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see the file COPYING, or write
* to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <asm/mach/anomaly.h>
#include <asm/mach-common/clocks.h>

#ifdef CONFIG_BFIN_KERNEL_CLOCK

# if (CONFIG_VCO_HZ > CONFIG_MAX_VCO_HZ)
# error "VCO selected is more than maximum value. Please change the VCO multipler"
# endif

# if (CONFIG_SCLK_HZ > CONFIG_MAX_SCLK_HZ)
# error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
# endif

# if (CONFIG_SCLK_HZ < CONFIG_MIN_SCLK_HZ)
# error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
# endif

# if (ANOMALY_05000273) && (CONFIG_SCLK_HZ * 2 > CONFIG_CCLK_HZ)
# error "ANOMALY 05000273, please make sure CCLK is at least 2x SCLK"
# endif

# if (CONFIG_SCLK_HZ > CONFIG_CCLK_HZ) && (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ) && (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
# error "Please select sclk less than cclk"
# endif

#endif /* CONFIG_BFIN_KERNEL_CLOCK */
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-common/dpmc.S
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ ENTRY(_sleep_deeper)
P0.H = hi(PLL_CTL);
P0.L = lo(PLL_CTL);
R5 = W[P0](z);
R0.L = (MIN_VC/CONFIG_CLKIN_HZ) << 9;
R0.L = (CONFIG_MIN_VCO_HZ/CONFIG_CLKIN_HZ) << 9;
W[P0] = R0.l;

SSYNC;
Expand Down
Loading

0 comments on commit 8a42b27

Please sign in to comment.