]> git.sur5r.net Git - u-boot/commitdiff
hammerhead: Use gclk helper functions
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Sun, 31 Aug 2008 16:07:35 +0000 (18:07 +0200)
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Mon, 1 Sep 2008 12:21:34 +0000 (14:21 +0200)
Use the new gclk helper functions to set up the PHY clock instead of
accessing the PM registers directly.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
board/miromico/hammerhead/hammerhead.c

index 3d6cf9b28b8de8e7be0ee46f5cce23114534a9b7..bf432cba85a35db041a61161236659b424fba127 100644 (file)
@@ -22,8 +22,6 @@
  * MA 02111-1307 USA
  */
 
-#include "../cpu/at32ap/at32ap700x/sm.h"
-
 #include <common.h>
 
 #include <asm/io.h>
@@ -105,10 +103,6 @@ void board_init_info(void)
 void gclk_init(void)
 {
        /* Hammerhead boards uses GCLK3 as 25MHz output to ethernet PHY */
-
-       /* Select GCLK3 peripheral function */
-       portmux_select_peripheral(PORTMUX_PORT_B, 1 << 29, PORTMUX_FUNC_A, 0);
-
-       /* Enable GCLK3 with no input divider, from OSC0 (crystal) */
-       sm_writel(PM_GCCTRL(3), SM_BIT(CEN));
+       gclk_enable_output(3, PORTMUX_DRIVE_LOW);
+       gclk_set_rate(3, GCLK_PARENT_OSC0, 25000000);
 }