Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reform
reform-boundary-uboot
Commits
17bd4a84
Commit
17bd4a84
authored
22 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Patches
Plain Diff
Initial revision
parent
77f85581
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
board/sacsng/clkinit.h
+113
-0
113 additions, 0 deletions
board/sacsng/clkinit.h
with
113 additions
and
0 deletions
board/sacsng/clkinit.h
0 → 100644
+
113
−
0
View file @
17bd4a84
/*
* (C) Copyright 2002
* Custom IDEAS, Inc. <www.cideas.com>
* Jon Diekema <diekema@cideas.com>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef FALSE
#define FALSE 0
#define TRUE (!FALSE)
#endif
#define SLRCLK_EN_MASK 0x00040000
/* PA13 - SLRCLK_EN* */
#define MIN_SAMPLE_RATE 4000
/* Minimum sample rate */
#define MAX_128x_SAMPLE_RATE 43402
/* Maximum 128x sample rate */
#define MAX_64x_SAMPLE_RATE 86805
/* Maximum 64x sample rate */
#define KHZ ((uint)1000)
#define MHZ ((uint)(1000 * KHZ))
#define MCLK_BRG 3
/* MCLK, Master CLocK for the A/D & D/A */
#define SCLK_BRG 7
/* SCLK, Sample CLocK for the A/D & D/A */
#define LRCLK_BRG 5
/* LRCLK, L/R CLocK for the A/D & D/A */
/* 0 == BRG1 (used for SMC1) */
/* 1 == BRG2 (used for SMC2) */
/* 2 == BRG3 (used for SCC1) */
/* 3 == BRG4 (MCLK) */
/* 4 == BRG5 */
/* 5 == BRG6 (LRCLK) */
/* 6 == BRG7 */
/* 7 == BRG8 (SCLK) */
#define MCLK_DIVISOR 4
/* SCLK = MCLK / MCLK_DIVISOR */
#define SCLK_DIVISOR (Daq64xSampling ? 64 : 128)
/* LRCLK = SCLK / SCLK_DIVISOR */
#define TIGHTEN_UP_BRG_EN_TIMING
/* Tighten up the BRG enable timing */
#define RUN_SCLK_ON_BRG_INT
/* Run SCLK on BRG_INT instead of MCLK */
/* The 8260 (Mask B.3) seems to have */
/* problems generating SCLK from MCLK */
/* via CLK9. */
#define RUN_LRCLK_ON_BRG_INT
/* Run LRCLK on BRG_INT instead of SCLK */
/* The 8260 (Mask B.3) seems to have */
/* problems generating LRCLK from SCLK */
#define CPM_CLK (gd->bd->bi_cpmfreq)
#define DFBRG 4
#define BRG_INT_CLK (CPM_CLK * 2 / DFBRG)
/* BRG = CPM * 2 / DFBRG (Sect 9.8) */
/* BRG = CPM * 2 / 4 */
/* BRG = CPM / 2 */
#define CPM_BRG_EXTC_MASK ((uint)0x0000C000)
#define CPM_BRG_EXTC_SHIFT 14
#define CPM_BRG_DIV16_MASK ((uint)0x00000001)
#define CPM_BRG_DIV16_SHIFT 1
#define CPM_BRG_EXTC_BRGCLK 0
#define CPM_BRG_EXTC_CLK3 1
#define CPM_BRG_EXTC_CLK9 CPM_BRG_EXTC_CLK3
#define CPM_BRG_EXTC_CLK5 2
#define CPM_BRG_EXTC_CLK15 CPM_BRG_EXTC_CLK5
/*
* External declarations
*/
extern
int
Daq64xSampling
;
extern
void
Daq_BRG_Reset
(
uint
brg
);
extern
void
Daq_BRG_Run
(
uint
brg
);
extern
void
Daq_BRG_Disable
(
uint
brg
);
extern
void
Daq_BRG_Enable
(
uint
brg
);
extern
uint
Daq_BRG_Get_Div16
(
uint
brg
);
extern
void
Daq_BRG_Set_Div16
(
uint
brg
,
uint
div16
);
extern
uint
Daq_BRG_Get_Count
(
uint
brg
);
extern
void
Daq_BRG_Set_Count
(
uint
brg
,
uint
brg_cnt
);
extern
uint
Daq_BRG_Get_ExtClk
(
uint
brg
);
extern
char
*
Daq_BRG_Get_ExtClk_Description
(
uint
brg
);
extern
void
Daq_BRG_Set_ExtClk
(
uint
brg
,
uint
extc
);
extern
uint
Daq_BRG_Rate
(
uint
brg
);
extern
uint
Daq_Get_SampleRate
(
void
);
extern
uint
Daq_Set_SampleRate
(
uint
rate
,
uint
force
);
extern
void
Daq_Init_Clocks
(
int
sample_rate
,
int
sample_64x
);
extern
void
Daq_Stop_Clocks
(
void
);
extern
void
Daq_Start_Clocks
(
int
sample_rate
);
extern
void
Daq_Display_Clocks
(
void
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment