Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: cpu/armv7Scorpion/QSD8x50/pll.c

Issue 1329001: ST1.5 board support and some ST1.0/1.5 common changes. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cpu/armv7Scorpion/QSD8x50/lcdc.c ('k') | cpu/armv7Scorpion/QSD8x50/proc_comm_clients.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2009, Code Aurora Forum. All rights reserved. 2 * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
3 * 3 *
4 * (C) Copyright 2002 4 * (C) Copyright 2002
5 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> 5 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
6 * Marius Groeger <mgroeger@sysgo.de> 6 * Marius Groeger <mgroeger@sysgo.de>
7 * 7 *
8 * (C) Copyright 2002 8 * (C) Copyright 2002
9 * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> 9 * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
10 * 10 *
11 * (C) Copyright 2003 11 * (C) Copyright 2003
12 * Texas Instruments, <www.ti.com> 12 * Texas Instruments, <www.ti.com>
(...skipping 23 matching lines...) Expand all
36 */ 36 */
37 37
38 #include <common.h> 38 #include <common.h>
39 /****************************** 39 /******************************
40 Routine: scorpion_pll_init 40 Routine: scorpion_pll_init
41 Description: Starts up Scorpion PLL and switches Scorpion clock from 41 Description: Starts up Scorpion PLL and switches Scorpion clock from
42 the AXI clock to the PLL. 42 the AXI clock to the PLL.
43 ******************************/ 43 ******************************/
44 void scorpion_pll_init (void) 44 void scorpion_pll_init (void)
45 { 45 {
46 #ifdef CPU_IS_QSD8x50A
47 // PLL to standby
48 IO_WRITE32(PLL_CTL, PLL_CTL__PLL_MODE__STAND_BY);
49 udelay(10);
50
51 // Calibrate for 384-1497 MHz
52 IO_WRITE32(PLL_CAL, 0x270A0000);
53 IO_WRITE32(PLL_CTL, PLL_CTL__PLL_MODE__FULL_CALIBRATION);
54 udelay(10);
55
56 // Wait for CAL_ALL_DONE_N to go from 1 to 0
57 while((IO_READ32(PLL_STATUS) & PLL_STATUS__CAL_ALL_DONE_N___M) != 0);
58
59 // SHOT to start PLL at 1190.4MHz (31 * 38.4MHz)
60 IO_WRITE32(PLL_FSM_CTL_EXT, PLL_FSM_CTL_EXT__STATIC_BITS |
61 PLL_FSM_CTL_EXT__FRESWI_MODE__SHOT |
62 (31 << PLL_FSM_CTL_EXT__TARG_L_VAL___S));
63 IO_WRITE32(PLL_CTL, PLL_CTL__PLL_MODE__NORMAL_OPERATION);
64 udelay(10);
65
66 // Wait for all bits in SWITCH_IN_PROGRESS_N to go from 1 to 0
67 while((IO_READ32(PLL_STATUS) & PLL_STATUS__SWITCH_IN_PROGRESS_N___M) != 0);
68
69 // Switch Scorpion clocks source from AXI clock to Scorpion PLL
70 IO_WRITE32(SPSS_CLK_SEL, 2);
71
72 #else /* CPU_IS_QSD8x50A */
46 uint32_t spare2; 73 uint32_t spare2;
47 int target_L_val; 74 int target_L_val;
48 75
49 // This function assumes: 76 // This function assumes:
50 // - Scorpion voltage has been set high enough to support the 77 // - Scorpion voltage has been set high enough to support the
51 // the frequency set in the HOP step below. 78 // the frequency set in the HOP step below.
52 // - The peripheral web clock has been enabled (PRPH_WEB_NS_REG) 79 // - The peripheral web clock has been enabled (PRPH_WEB_NS_REG)
53 80
54 // Set defaults 81 // Set defaults
55 IO_WRITE32(PLL_TEST_CTL, 0x00000000); 82 IO_WRITE32(PLL_TEST_CTL, 0x00000000);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 150
124 // Normal mode 151 // Normal mode
125 IO_WRITE32(PLL_CTL, PLL_CTL__BYPASSNL___M | 152 IO_WRITE32(PLL_CTL, PLL_CTL__BYPASSNL___M |
126 PLL_CTL__RESET_N___M | 153 PLL_CTL__RESET_N___M |
127 PLL_CTL__PLL_MODE__NORMAL_OPERATION); 154 PLL_CTL__PLL_MODE__NORMAL_OPERATION);
128 udelay(20); 155 udelay(20);
129 156
130 // Switch Scorpion clocks source from AXI clock to Scorpion PLL 157 // Switch Scorpion clocks source from AXI clock to Scorpion PLL
131 IO_WRITE32(SPSS_CLK_SEL, 2); 158 IO_WRITE32(SPSS_CLK_SEL, 2);
132 159
160 #endif /* CPU_IS_QSD8x50A */
133 } 161 }
134 162
OLDNEW
« no previous file with comments | « cpu/armv7Scorpion/QSD8x50/lcdc.c ('k') | cpu/armv7Scorpion/QSD8x50/proc_comm_clients.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698