David Brazdil | 3d7b88b | 2019-07-22 17:19:35 +0100 | [diff] [blame] | 1 | # Copyright 2019 The Hafnium Authors. |
| 2 | # |
Andrew Walbran | 23417d8 | 2020-06-17 14:44:22 +0100 | [diff] [blame] | 3 | # Use of this source code is governed by a BSD-style |
| 4 | # license that can be found in the LICENSE file or at |
| 5 | # https://opensource.org/licenses/BSD-3-Clause. |
David Brazdil | 3d7b88b | 2019-07-22 17:19:35 +0100 | [diff] [blame] | 6 | |
| 7 | import("args.gni") |
| 8 | |
| 9 | source_set("mini_uart") { |
Olivier Deprez | a2293ae | 2023-02-02 09:51:53 +0100 | [diff] [blame] | 10 | sources = [ "mini_uart.c" ] |
David Brazdil | 3d7b88b | 2019-07-22 17:19:35 +0100 | [diff] [blame] | 11 | |
| 12 | assert(gpio_base_address != 0, |
| 13 | "\"gpio_base_address\" must be defined for ${target_name}.") |
| 14 | assert(aux_base_address != 0, |
| 15 | "\"aux_base_address\" must be defined for ${target_name}.") |
| 16 | assert(core_freq_mhz != 0, |
| 17 | "\"core_freq_mhz\" must be defined for ${target_name}.") |
| 18 | assert(baudrate != 0, "\"baudrate\" must be defined for ${target_name}.") |
| 19 | |
| 20 | defines = [ |
| 21 | "GPIO_BASE=${gpio_base_address}", |
| 22 | "AUX_BASE=${aux_base_address}", |
| 23 | "CORE_FREQ_MHZ=${core_freq_mhz}", |
| 24 | "BAUDRATE=${baudrate}", |
| 25 | ] |
| 26 | } |