up_dac_common: Allow to disable GPIO registers

Not all peripherals use the GPIO register settings, but the registers still
take up a fair amount of space in the register map. Add options to allow to
disable them when not needed. This helps to reduce the utilization for
peripherals where these features are not needed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
main
Lars-Peter Clausen 2017-03-17 12:30:02 +01:00
parent 0ae0da488b
commit 957730c421
1 changed files with 10 additions and 1 deletions

View File

@ -45,7 +45,8 @@ module up_dac_common #(
parameter CONFIG = 0,
parameter COMMON_ID = 6'h10,
parameter DRP_DISABLE = 6'h00,
parameter USERPORTS_DISABLE = 0) (
parameter USERPORTS_DISABLE = 0,
parameter GPIO_DISABLE = 0) (
// mmcm reset
@ -310,6 +311,12 @@ module up_dac_common #(
assign up_dac_gpio_out = up_dac_gpio_out_int;
generate
if (GPIO_DISABLE == 1) begin
always @(posedge up_clk) begin
up_dac_gpio_out_int <= 'd0;
end
end else begin
always @(negedge up_rstn or posedge up_clk) begin
if (up_rstn == 0) begin
up_dac_gpio_out_int <= 'd0;
@ -319,6 +326,8 @@ module up_dac_common #(
end
end
end
end
endgenerate
// processor read interface