| 
									
										
										
										
											2012-07-25 16:17:24 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2013-01-22 12:59:30 +01:00
										 |  |  |  * 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 | 
					
						
							| 
									
										
										
										
											2012-07-25 16:17:24 +02:00
										 |  |  |  * Free Software Foundation;  either version 2 of the  License, or (at your | 
					
						
							|  |  |  |  * option) any later version. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/clk.h>
 | 
					
						
							|  |  |  | #include <linux/err.h>
 | 
					
						
							|  |  |  | #include <asm/time.h>
 | 
					
						
							| 
									
										
										
										
											2012-10-23 05:17:00 +00:00
										 |  |  | #include <platform.h>
 | 
					
						
							| 
									
										
										
										
											2012-07-25 16:17:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | void __init plat_time_init(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	struct clk *clk; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Initialize LS1X clocks */ | 
					
						
							| 
									
										
										
										
											2012-10-23 05:17:00 +00:00
										 |  |  | 	ls1x_clk_init(); | 
					
						
							| 
									
										
										
										
											2012-07-25 16:17:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* setup mips r4k timer */ | 
					
						
							|  |  |  | 	clk = clk_get(NULL, "cpu"); | 
					
						
							|  |  |  | 	if (IS_ERR(clk)) | 
					
						
							| 
									
										
										
										
											2012-10-23 05:17:03 +00:00
										 |  |  | 		panic("unable to get cpu clock, err=%ld", PTR_ERR(clk)); | 
					
						
							| 
									
										
										
										
											2012-07-25 16:17:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	mips_hpt_frequency = clk_get_rate(clk) / 2; | 
					
						
							|  |  |  | } |