David Brazdil | 3d7b88b | 2019-07-22 17:19:35 +0100 | [diff] [blame] | 1 | # Copyright 2019 The Hafnium Authors. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | import("args.gni") |
| 16 | |
| 17 | source_set("mini_uart") { |
| 18 | sources = [ |
| 19 | "mini_uart.c", |
| 20 | ] |
| 21 | |
| 22 | assert(gpio_base_address != 0, |
| 23 | "\"gpio_base_address\" must be defined for ${target_name}.") |
| 24 | assert(aux_base_address != 0, |
| 25 | "\"aux_base_address\" must be defined for ${target_name}.") |
| 26 | assert(core_freq_mhz != 0, |
| 27 | "\"core_freq_mhz\" must be defined for ${target_name}.") |
| 28 | assert(baudrate != 0, "\"baudrate\" must be defined for ${target_name}.") |
| 29 | |
| 30 | defines = [ |
| 31 | "GPIO_BASE=${gpio_base_address}", |
| 32 | "AUX_BASE=${aux_base_address}", |
| 33 | "CORE_FREQ_MHZ=${core_freq_mhz}", |
| 34 | "BAUDRATE=${baudrate}", |
| 35 | ] |
| 36 | } |