diff options
author | David Hendricks <dhendrix@chromium.org> | 2013-04-18 14:21:15 -0700 |
---|---|---|
committer | David Hendricks <dhendrix@chromium.org> | 2013-04-19 04:19:16 +0200 |
commit | cd14ed71bb25bf04ea450bdbd02805be5f9b1941 (patch) | |
tree | acb5f414fa9d315acf3f1ef18a57712cb6d28efb /src/cpu/samsung/exynos5250 | |
parent | 90a70093b1ca20781b7a92dd04500881a94539b2 (diff) |
[2/3] exynos5: modify thermal management unit code for coreboot
This updates the Exynos TMU code for coreboot:
- Remove dependency on device tree
- Add Makefile entries
Change-Id: I55e1b624d7c7b695b1253ec55f6ae3de8dc671bc
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: http://review.coreboot.org/3107
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/cpu/samsung/exynos5250')
-rw-r--r-- | src/cpu/samsung/exynos5250/Makefile.inc | 1 | ||||
-rw-r--r-- | src/cpu/samsung/exynos5250/cpu.h | 2 | ||||
-rw-r--r-- | src/cpu/samsung/exynos5250/exynos-tmu.h | 82 | ||||
-rw-r--r-- | src/cpu/samsung/exynos5250/exynos5250-tmu.c | 45 |
4 files changed, 48 insertions, 82 deletions
diff --git a/src/cpu/samsung/exynos5250/Makefile.inc b/src/cpu/samsung/exynos5250/Makefile.inc index 1046b8bc0b..8788a6c88e 100644 --- a/src/cpu/samsung/exynos5250/Makefile.inc +++ b/src/cpu/samsung/exynos5250/Makefile.inc @@ -28,6 +28,7 @@ ramstage-y += power.c ramstage-y += soc.c ramstage-$(CONFIG_CONSOLE_SERIAL_UART) += uart.c ramstage-y += cpu.c +ramstage-y += exynos5250-tmu.c ramstage-y += mct.c #ramstage-$(CONFIG_SATA_AHCI) += sata.c diff --git a/src/cpu/samsung/exynos5250/cpu.h b/src/cpu/samsung/exynos5250/cpu.h index a356e19990..cff966ee98 100644 --- a/src/cpu/samsung/exynos5250/cpu.h +++ b/src/cpu/samsung/exynos5250/cpu.h @@ -120,4 +120,6 @@ enum periph_id exynos5_get_periph_id(unsigned base_addr); void exynos5250_config_l2_cache(void); +extern struct tmu_info exynos5250_tmu_info; + #endif /* _EXYNOS5250_CPU_H */ diff --git a/src/cpu/samsung/exynos5250/exynos-tmu.h b/src/cpu/samsung/exynos5250/exynos-tmu.h deleted file mode 100644 index ad9e394456..0000000000 --- a/src/cpu/samsung/exynos5250/exynos-tmu.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2012 Samsung Electronics Co., Ltd. - * http://www.samsung.com - * Akshay Saraswat <Akshay.s@samsung.com> - * - * EXYNOS - Thermal Management Unit - * - * 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 version 2 as - * published by the Free Software Foundation. - * 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 __ASM_ARCH_THERMAL_H -#define __ASM_ARCH_THERMAL_H - -struct tmu_reg { - unsigned triminfo; - unsigned rsvd1; - unsigned rsvd2; - unsigned rsvd3; - unsigned rsvd4; - unsigned triminfo_control; - unsigned rsvd5; - unsigned rsvd6; - unsigned tmu_control; - unsigned rsvd7; - unsigned tmu_status; - unsigned sampling_internal; - unsigned counter_value0; - unsigned counter_value1; - unsigned rsvd8; - unsigned rsvd9; - unsigned current_temp; - unsigned rsvd10; - unsigned rsvd11; - unsigned rsvd12; - unsigned threshold_temp_rise; - unsigned threshold_temp_fall; - unsigned rsvd13; - unsigned rsvd14; - unsigned past_temp3_0; - unsigned past_temp7_4; - unsigned past_temp11_8; - unsigned past_temp15_12; - unsigned inten; - unsigned intstat; - unsigned intclear; - unsigned rsvd15; - unsigned emul_con; -}; - -enum tmu_status_t { - TMU_STATUS_INIT = 0, - TMU_STATUS_NORMAL, - TMU_STATUS_WARNING, - TMU_STATUS_TRIPPED, -}; - -/* - * Monitors status of the TMU device and exynos temperature - * - * @param temp pointer to the current temperature value - * @return enum tmu_status_t value, code indicating event to execute - * and -1 on error - */ -enum tmu_status_t tmu_monitor(int *temp); - -/* - * Initialize TMU device - * - * @param blob FDT blob - * @return int value, 0 for success - */ -int tmu_init(const void *blob); -#endif diff --git a/src/cpu/samsung/exynos5250/exynos5250-tmu.c b/src/cpu/samsung/exynos5250/exynos5250-tmu.c new file mode 100644 index 0000000000..7d8397c568 --- /dev/null +++ b/src/cpu/samsung/exynos5250/exynos5250-tmu.c @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 Google Inc. + * + * 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 + * + * This file contains Exynos5250-specific TMU information. + */ + +#include <cpu/samsung/exynos5-common/exynos-tmu.h> +#include <cpu/samsung/exynos5250/cpu.h> + +struct tmu_info exynos5250_tmu_info = { + .tmu_base = 0x10060000, + .tmu_mux = 6, + .data = { + .ts = { + .min_val = 25, + .max_val = 125, + .start_warning = 95, + .start_tripping = 105, + .hardware_tripping = 110, + }, + .efuse_min_value = 40, + .efuse_value = 55, + .efuse_max_value = 100, + .slope = 0x10008802, + }, + .dc_value = 25, +}; |